* Construct a Phar archive object * @link https://php.net/manual/en/phar.construct.php * @param string $filename
* Path to an existing Phar archive or to-be-created archive. The file name's * extension must contain .phar. *
* @param int $flags [optional]* Flags to pass to parent class RecursiveDirectoryIterator. *
* @param string $alias [optional]* Alias with which this Phar archive should be referred to in calls to stream * functionality. *
* @throws BadMethodCallException If called twice. * @throws UnexpectedValueException If the phar archive can't be opened. */ public function __construct( #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $filename, #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $flags = FilesystemIterator::KEY_AS_PATHNAME|FilesystemIterator::CURRENT_AS_FILEINFO, #[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $alias = null, #[PhpStormStubsElementAvailable(from: '5.3', to: '5.6')] $fileformat = null ) {} public function __destruct() {} /** * (Unknown)* The name of the empty directory to create in the phar archive *
* @return void no return value, exception is thrown on failure. */ #[TentativeType] public function addEmptyDir( #[PhpStormStubsElementAvailable(from: '5.3', to: '7.4')] $directory = '', #[PhpStormStubsElementAvailable(from: '8.0')] string $directory ): void {} /** * (Unknown)* Full or relative path to a file on disk to be added * to the phar archive. *
* @param string $localName [optional]* Path that the file will be stored in the archive. *
* @return void no return value, exception is thrown on failure. */ #[TentativeType] public function addFile( #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $filename, #[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $localName = null ): void {} /** * (Unknown)* Path that the file will be stored in the archive. *
* @param string $contents* The file contents to store *
* @return void no return value, exception is thrown on failure. */ #[TentativeType] public function addFromString( #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $localName, #[PhpStormStubsElementAvailable(from: '5.3', to: '7.4')] $contents = '', #[PhpStormStubsElementAvailable(from: '8.0')] string $contents ): void {} /** * (PHP >= 5.3.0, PECL phar >= 2.0.0)* The full or relative path to the directory that contains all files * to add to the archive. *
* @param $pattern $regex [optional]* An optional pcre regular expression that is used to filter the * list of files. Only file paths matching the regular expression * will be included in the archive. *
* @return array Phar::buildFromDirectory returns an associative array * mapping internal path of file to the full path of the file on the * filesystem. */ #[TentativeType] public function buildFromDirectory( #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $directory, #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $pattern = null ): array {} /** * (PHP >= 5.3.0, PECL phar >= 2.0.0)* Any iterator that either associatively maps phar file to location or * returns SplFileInfo objects *
* @param string $baseDirectory [optional]* For iterators that return SplFileInfo objects, the portion of each * file's full path to remove when adding to the phar archive *
* @return array Phar::buildFromIterator returns an associative array * mapping internal path of file to the full path of the file on the * filesystem. */ #[TentativeType] public function buildFromIterator( Traversable $iterator, #[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $baseDirectory = null ): array {} /** * (PHP >= 5.3.0, PECL phar >= 2.0.0)* Compression must be one of Phar::GZ, * Phar::BZ2 to add compression, or Phar::NONE * to remove compression. *
* @return void No value is returned. */ #[TentativeType] public function compressFiles(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $compression): void {} /** * (PHP >= 5.3.0, PECL phar >= 2.0.0)* Compression must be one of Phar::GZ, * Phar::BZ2 to add compression, or Phar::NONE * to remove compression. *
* @param string $extension [optional]* By default, the extension is .phar.gz * or .phar.bz2 for compressing phar archives, and * .phar.tar.gz or .phar.tar.bz2 for * compressing tar archives. For decompressing, the default file extensions * are .phar and .phar.tar. *
* @return static|null a Phar object. */ #[TentativeType] public function compress( #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $compression, #[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $extension = null ): ?Phar {} /** * (PHP >= 5.3.0, PECL phar >= 2.0.0)* For decompressing, the default file extensions * are .phar and .phar.tar. * Use this parameter to specify another file extension. Be aware * that all executable phar archives must contain .phar * in their filename. *
* @return static|null A Phar object is returned. */ #[TentativeType] public function decompress(#[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $extension = null): ?Phar {} /** * (PHP >= 5.3.0, PECL phar >= 2.0.0)* This should be one of Phar::PHAR, Phar::TAR, * or Phar::ZIP. If set to NULL, the existing file format * will be preserved. *
* @param int $compression [optional]* This should be one of Phar::NONE for no whole-archive * compression, Phar::GZ for zlib-based compression, and * Phar::BZ2 for bzip-based compression. *
* @param string $extension [optional]* This parameter is used to override the default file extension for a * converted archive. Note that all zip- and tar-based phar archives must contain * .phar in their file extension in order to be processed as a * phar archive. *
** If converting to a phar-based archive, the default extensions are * .phar, .phar.gz, or .phar.bz2 * depending on the specified compression. For tar-based phar archives, the * default extensions are .phar.tar, .phar.tar.gz, * and .phar.tar.bz2. For zip-based phar archives, the * default extension is .phar.zip. *
* @return Phar|null The method returns a Phar object on success and throws an * exception on failure. */ #[TentativeType] public function convertToExecutable( #[LanguageLevelTypeAware(['8.0' => 'int|null'], default: '')] $format = 9021976, #[LanguageLevelTypeAware(['8.0' => 'int|null'], default: '')] $compression = 9021976, #[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $extension = null ): ?Phar {} /** * (PHP >= 5.3.0, PECL phar >= 2.0.0)* This should be one of Phar::TAR * or Phar::ZIP. If set to NULL, the existing file format * will be preserved. *
* @param int $compression [optional]* This should be one of Phar::NONE for no whole-archive * compression, Phar::GZ for zlib-based compression, and * Phar::BZ2 for bzip-based compression. *
* @param string $extension [optional]* This parameter is used to override the default file extension for a * converted archive. Note that .phar cannot be used * anywhere in the filename for a non-executable tar or zip archive. *
** If converting to a tar-based phar archive, the * default extensions are .tar, .tar.gz, * and .tar.bz2 depending on specified compression. * For zip-based archives, the * default extension is .zip. *
* @return PharData|null The method returns a PharData object on success and throws an * exception on failure. */ #[TentativeType] public function convertToData( #[LanguageLevelTypeAware(['8.0' => 'int|null'], default: '')] $format = 9021976, #[LanguageLevelTypeAware(['8.0' => 'int|null'], default: '')] $compression = 9021976, #[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $extension = null ): ?PharData {} /** * (PHP >= 5.3.0, PECL phar >= 2.0.0)* Path within an archive to the file to delete. *
* @return bool returns TRUE on success, but it is better to check for thrown exception, * and assume success if none is thrown. */ public function delete(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $localName) {} /** * (PHP >= 5.3.0, PECL phar >= 1.2.0)* Path within an archive to the file to delete. *
* @param string|array|null $files [optional]* The name of a file or directory to extract, or an array of files/directories to extract *
* @param bool $overwrite [optional]* Set to TRUE to enable overwriting existing files *
* @return bool returns TRUE on success, but it is better to check for thrown exception, * and assume success if none is thrown. */ #[TentativeType] public function extractTo( #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $directory, #[LanguageLevelTypeAware(['8.0' => 'array|string|null'], default: '')] $files = null, #[LanguageLevelTypeAware(['8.0' => 'bool'], default: '')] $overwrite = false ): bool {} /** * @return string|null * @see setAlias */ #[TentativeType] public function getAlias(): ?string {} /** * (PHP >= 5.3.0, PECL phar >= 1.0.0)* Either Phar::PHAR, Phar::TAR, or * Phar::ZIP to test for the format of the archive. *
* @return bool TRUE if the phar archive matches the file format requested by the parameter */ #[TentativeType] public function isFileFormat(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $format): bool {} /** * (Unknown)* The filename (relative path) to look for in a Phar. *
* @return bool TRUE if the file exists within the phar, or FALSE if not. */ #[TentativeType] public function offsetExists($localName): bool {} /** * (PHP >= 5.3.0, PECL phar >= 1.0.0)* The filename (relative path) to look for in a Phar. *
* @return PharFileInfo A PharFileInfo object is returned that can be used to * iterate over a file's contents or to retrieve information about the current file. */ #[TentativeType] public function offsetGet($localName): SplFileInfo {} /** * (PHP >= 5.3.0, PECL phar >= 1.0.0)* The filename (relative path) to modify in a Phar. *
* @param string $value* Content of the file. *
* @return void No return values. */ #[TentativeType] public function offsetSet($localName, $value): void {} /** * (PHP >= 5.3.0, PECL phar >= 1.0.0)* The filename (relative path) to modify in a Phar. *
* @return bool TRUE on success or FALSE on failure. */ #[TentativeType] public function offsetUnset($localName): void {} /** * (PHP >= 5.3.0, PECL phar >= 1.2.1)* A shorthand string that this archive can be referred to in phar * stream wrapper access. *
* @return bool */ #[TentativeType] public function setAlias(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $alias): bool {} /** * (Unknown)* Relative path within the phar archive to run if accessed on the command-line *
* @param string $webIndex [optional]* Relative path within the phar archive to run if accessed through a web browser *
* @return bool TRUE on success or FALSE on failure. */ #[TentativeType] public function setDefaultStub( #[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $index = null, #[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $webIndex = null ): bool {} /** * (PHP >= 5.3.0, PECL phar >= 1.0.0)* Any PHP variable containing information to store that describes the phar archive *
* @return void No value is returned. */ #[TentativeType] public function setMetadata(#[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $metadata): void {} /** * (PHP >= 5.3.0, PECL phar >= 1.1.0)* One of Phar::MD5, * Phar::SHA1, Phar::SHA256, * Phar::SHA512, or Phar::OPENSSL *
* @param string $privateKey [optional]
* The contents of an OpenSSL private key, as extracted from a certificate or
* OpenSSL key file:
*
* $private = openssl_get_privatekey(file_get_contents('private.pem'));
* $pkey = '';
* openssl_pkey_export($private, $pkey);
* $p->setSignatureAlgorithm(Phar::OPENSSL, $pkey);
*
* See phar introduction for instructions on
* naming and placement of the public key file.
*
* A string or an open stream handle to use as the executable stub for this * phar archive. *
* @param int $length [optional]*
* @return bool TRUE on success or FALSE on failure. */ public function setStub( $stub, #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $length = -1 ) {} /** * (PHP >= 5.3.0, PECL phar >= 1.0.0)* Either Phar::GZ or Phar::BZ2 can be * used to test whether compression is possible with a specific compression * algorithm (zlib or bzip2). *
* @return bool TRUE if compression/decompression is available, FALSE if not. */ final public static function canCompress(int $compression = 0): bool {} /** * (PHP >= 5.3.0, PECL phar >= 1.0.0)* The name or full path to a phar archive not yet created *
* @param bool $executable [optional]* This parameter determines whether the filename should be treated as * a phar executable archive, or a data non-executable archive *
* @return bool TRUE if the filename is valid, FALSE if not. */ final public static function isValidPharFilename(string $filename, bool $executable = true): bool {} /** * (PHP >= 5.3.0, PECL phar >= 1.0.0)* the full or relative path to the phar archive to open *
* @param string|null $alias [optional]* The alias that may be used to refer to the phar archive. Note * that many phar archives specify an explicit alias inside the * phar archive, and a PharException will be thrown if * a new alias is specified in this case. *
* @return bool TRUE on success or FALSE on failure. */ final public static function loadPhar(string $filename, ?string $alias = null): bool {} /** * (PHP >= 5.3.0, PECL phar >= 1.0.0)* The alias that can be used in phar:// URLs to * refer to this archive, rather than its full path. *
* @param int $offset [optional]* Unused variable, here for compatibility with PEAR's PHP_Archive. *
* @return bool TRUE on success or FALSE on failure. */ final public static function mapPhar(?string $alias = null, int $offset = 0): bool {} /** * (PHP >= 5.3.0, PECL phar >= 2.0.0)* If FALSE, the full path on disk to the phar * archive is returned. If TRUE, a full phar URL is returned. *
* @return string the filename if valid, empty string otherwise. */ final public static function running( #[PhpStormStubsElementAvailable(from: '5.3', to: '5.6')] $returnPhar, #[PhpStormStubsElementAvailable(from: '7.0')] bool $returnPhar = true ): string {} /** * (PHP >= 5.3.0, PECL phar >= 2.0.0)* The internal path within the phar archive to use as the mounted path location. * This must be a relative path within the phar archive, and must not already exist. *
* @param string $externalPath* A path or URL to an external file or directory to mount within the phar archive *
* @return void No return. PharException is thrown on failure. */ final public static function mount(string $pharPath, string $externalPath): void {} /** * (Unknown)* an array containing as string indices any of * REQUEST_URI, PHP_SELF, * SCRIPT_NAME and SCRIPT_FILENAME. * Other values trigger an exception, and Phar::mungServer * is case-sensitive. *
* @return void No return. */ final public static function mungServer(array $variables): void {} /** * (PHP >= 5.3.0, PECL phar >= 2.0.0)* The path on disk to the phar archive. *
* @throws PharException * @return bool TRUE on success or FALSE on failure. */ final public static function unlinkArchive(string $filename): bool {} /** * (PHP >= 5.3.0, PECL phar >= 2.0.0)* The alias that can be used in phar:// URLs to * refer to this archive, rather than its full path. *
* @param string|null $index [optional]* The location within the phar of the directory index. *
* @param null|string $fileNotFoundScript [optional]* The location of the script to run when a file is not found. This * script should output the proper HTTP 404 headers. *
* @param null|array $mimeTypes [optional]
* An array mapping additional file extensions to MIME type.
* If the default mapping is sufficient, pass an empty array.
* By default, these extensions are mapped to these MIME types:
*
* $mimes = array(
* 'phps' => Phar::PHPS, // pass to highlight_file()
* 'c' => 'text/plain',
* 'cc' => 'text/plain',
* 'cpp' => 'text/plain',
* 'c++' => 'text/plain',
* 'dtd' => 'text/plain',
* 'h' => 'text/plain',
* 'log' => 'text/plain',
* 'rng' => 'text/plain',
* 'txt' => 'text/plain',
* 'xsd' => 'text/plain',
* 'php' => Phar::PHP, // parse as PHP
* 'inc' => Phar::PHP, // parse as PHP
* 'avi' => 'video/avi',
* 'bmp' => 'image/bmp',
* 'css' => 'text/css',
* 'gif' => 'image/gif',
* 'htm' => 'text/html',
* 'html' => 'text/html',
* 'htmls' => 'text/html',
* 'ico' => 'image/x-ico',
* 'jpe' => 'image/jpeg',
* 'jpg' => 'image/jpeg',
* 'jpeg' => 'image/jpeg',
* 'js' => 'application/x-javascript',
* 'midi' => 'audio/midi',
* 'mid' => 'audio/midi',
* 'mod' => 'audio/mod',
* 'mov' => 'movie/quicktime',
* 'mp3' => 'audio/mp3',
* 'mpg' => 'video/mpeg',
* 'mpeg' => 'video/mpeg',
* 'pdf' => 'application/pdf',
* 'png' => 'image/png',
* 'swf' => 'application/shockwave-flash',
* 'tif' => 'image/tiff',
* 'tiff' => 'image/tiff',
* 'wav' => 'audio/wav',
* 'xbm' => 'image/xbm',
* 'xml' => 'text/xml',
* );
*
*
* The rewrites function is passed a string as its only parameter and must return a string or FALSE. *
** If you are using fast-cgi or cgi then the parameter passed to the function is the value of the * $_SERVER['PATH_INFO'] variable. Otherwise, the parameter passed to the function is the value * of the $_SERVER['REQUEST_URI'] variable. *
** If a string is returned it is used as the internal file path. If FALSE is returned then webPhar() will * send a HTTP 403 Denied Code. *
* @return void No value is returned. */ final public static function webPhar( ?string $alias = null, ?string $index = "index.php", #[LanguageLevelTypeAware(['8.0' => 'string|null'], default: 'string')] $fileNotFoundScript = null, array $mimeTypes = null, ?callable $rewrite = null ): void {} /** * Returns whether current entry is a directory and not '.' or '..' * @link https://php.net/manual/en/recursivedirectoryiterator.haschildren.php * @param bool $allow_links [optional]*
* @return bool whether the current entry is a directory, but not '.' or '..' */ public function hasChildren($allow_links = false) {} /** * Returns an iterator for the current entry if it is a directory * @link https://php.net/manual/en/recursivedirectoryiterator.getchildren.php * @return mixed The filename, file information, or $this depending on the set flags. * See the FilesystemIterator * constants. */ public function getChildren() {} /** * Rewinds back to the beginning * @link https://php.net/manual/en/filesystemiterator.rewind.php * @return void No value is returned. */ public function rewind() {} /** * Move to the next file * @link https://php.net/manual/en/filesystemiterator.next.php * @return void No value is returned. */ public function next() {} /** * Retrieve the key for the current file * @link https://php.net/manual/en/filesystemiterator.key.php * @return string the pathname or filename depending on the set flags. * See the FilesystemIterator constants. */ public function key() {} /** * The current file * @link https://php.net/manual/en/filesystemiterator.current.php * @return mixed The filename, file information, or $this depending on the set flags. * See the FilesystemIterator constants. */ public function current() {} /** * Check whether current DirectoryIterator position is a valid file * @link https://php.net/manual/en/directoryiterator.valid.php * @return bool TRUE if the position is valid, otherwise FALSE */ public function valid() {} /** * Seek to a DirectoryIterator item * @link https://php.net/manual/en/directoryiterator.seek.php * @param int $position* The zero-based numeric position to seek to. *
* @return void No value is returned. */ public function seek($position) {} public function _bad_state_ex() {} } /** * The PharData class provides a high-level interface to accessing and creating * non-executable tar and zip archives. Because these archives do not contain * a stub and cannot be executed by the phar extension, it is possible to create * and manipulate regular zip and tar files using the PharData class even if * phar.readonly php.ini setting is 1. * @link https://php.net/manual/en/class.phardata.php */ class PharData extends Phar { /** * (PHP >= 5.3.0, PECL phar >= 2.0.0)* Path to an existing tar/zip archive or to-be-created archive *
* @param int $flags [optional]* Flags to pass to Phar parent class * RecursiveDirectoryIterator. *
* @param string $alias [optional]* Alias with which this Phar archive should be referred to in calls to stream * functionality. *
* @param int $format [optional]* One of the * file format constants * available within the Phar class. *
*/ public function __construct( #[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $filename, #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $flags = FilesystemIterator::KEY_AS_PATHNAME|FilesystemIterator::CURRENT_AS_FILEINFO, #[LanguageLevelTypeAware(['8.0' => 'string|null'], default: '')] $alias = null, #[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $format = Phar::TAR ) {} /** * @param string $localName * @return bool */ #[TentativeType] public function offsetExists($localName): bool {} /** * @param string $localName * @return SplFileInfo */ #[TentativeType] public function offsetGet($localName): SplFileInfo {} /** * (PHP >= 5.3.0, PECL phar >= 2.0.0)* The filename (relative path) to modify in a tar or zip archive. *
* @param string $value* Content of the file. *
* @return void No return values. */ #[TentativeType] public function offsetSet($localName, $value): void {} /** * (PHP >= 5.3.0, PECL phar >= 2.0.0)* The filename (relative path) to modify in the tar/zip archive. *
* @return void */ #[TentativeType] public function offsetUnset($localName): void {} /** * Returns whether current entry is a directory and not '.' or '..' * @link https://php.net/manual/en/recursivedirectoryiterator.haschildren.php * @param bool $allow_links [optional]*
* @return bool whether the current entry is a directory, but not '.' or '..' */ public function hasChildren($allow_links = false) {} /** * Returns an iterator for the current entry if it is a directory * @link https://php.net/manual/en/recursivedirectoryiterator.getchildren.php * @return mixed The filename, file information, or $this depending on the set flags. * See the FilesystemIterator * constants. */ public function getChildren() {} /** * Rewinds back to the beginning * @link https://php.net/manual/en/filesystemiterator.rewind.php * @return void No value is returned. */ public function rewind() {} /** * Move to the next file * @link https://php.net/manual/en/filesystemiterator.next.php * @return void No value is returned. */ public function next() {} /** * Retrieve the key for the current file * @link https://php.net/manual/en/filesystemiterator.key.php * @return string the pathname or filename depending on the set flags. * See the FilesystemIterator constants. */ public function key() {} /** * The current file * @link https://php.net/manual/en/filesystemiterator.current.php * @return mixed The filename, file information, or $this depending on the set flags. * See the FilesystemIterator constants. */ public function current() {} /** * Check whether current DirectoryIterator position is a valid file * @link https://php.net/manual/en/directoryiterator.valid.php * @return bool TRUE if the position is valid, otherwise FALSE */ public function valid() {} /** * Seek to a DirectoryIterator item * @link https://php.net/manual/en/directoryiterator.seek.php * @param int $position* The zero-based numeric position to seek to. *
* @return void No value is returned. */ public function seek($position) {} } /** * The PharFileInfo class provides a high-level interface to the contents * and attributes of a single file within a phar archive. * @link https://php.net/manual/en/class.pharfileinfo.php */ class PharFileInfo extends SplFileInfo { /** * (PHP >= 5.3.0, PECL phar >= 1.0.0)* The full url to retrieve a file. If you wish to retrieve the information * for the file my/file.php from the phar boo.phar, * the entry should be phar://boo.phar/my/file.php. *
*/ public function __construct(#[LanguageLevelTypeAware(['8.0' => 'string'], default: '')] $filename) {} public function __destruct() {} /** * (PHP >= 5.3.0, PECL phar >= 1.0.0)* permissions (see chmod) *
* @return void No value is returned. */ #[TentativeType] public function chmod(#[LanguageLevelTypeAware(['8.0' => 'int'], default: '')] $perms): void {} /** * (PHP >= 5.3.0, PECL phar >= 2.0.0)* One of Phar::GZ or Phar::BZ2, * defaults to any compression. *
* @return bool TRUE if the file is compressed within the Phar archive, FALSE if not. */ #[TentativeType] public function isCompressed(#[LanguageLevelTypeAware(['8.0' => 'int|null'], default: '')] $compression = 9021976): bool {} /** * (PHP >= 5.3.0, PECL phar >= 1.0.0)* Any PHP variable containing information to store alongside a file *
* @return void No value is returned. */ #[TentativeType] public function setMetadata(#[LanguageLevelTypeAware(['8.0' => 'mixed'], default: '')] $metadata): void {} } // End of Phar v.2.0.1