getPharBasePath.php
Table of Contents
Functions
- getPharBasePath() : string
- Returns the base path of an archive, formatted for the `phar://` stream wrapper.
Functions
getPharBasePath()
Returns the base path of an archive, formatted for the `phar://` stream wrapper.
getPharBasePath(PharData $phar) : string
This function constructs a base URI by prefixing the archive's real path with phar://
.
This URI can be used to access or manipulate the internal files of the archive via PHP's stream wrapper.
It is particularly useful when extracting or analyzing archive contents by building full
paths to the internal files (e.g., phar:///path/to/archive.tar/dir/file.txt
).
Parameters
- $phar : PharData
-
The archive's
PharData
instance.
Tags
Return values
string —The base phar://
URI to access the contents of the archive
(e.g., phar:///absolute/path/to/archive.tar
).