From 6a342aa5e1f00f1a51cd6341877412689905a042 Mon Sep 17 00:00:00 2001 From: Greg Beaver Date: Thu, 18 Jan 2007 00:24:34 +0000 Subject: [PATCH] initial docs for phar extension # need sanity check, first time doing phpdoc git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@227468 c90b9560-bf6c-de11-be94-00142212c4b1 --- reference/phar/functions.xml | 21 +++ reference/phar/functions/Phar-construct.xml | 113 +++++++++++++++ reference/phar/functions/Phar-count.xml | 86 +++++++++++ reference/phar/functions/Phar-getModified.xml | 55 ++++++++ reference/phar/functions/Phar-getVersion.xml | 64 +++++++++ reference/phar/functions/Phar-loadPhar.xml | 115 +++++++++++++++ reference/phar/functions/Phar-mapPhar.xml | 111 +++++++++++++++ .../phar/functions/Phar-offsetExists.xml | 107 ++++++++++++++ reference/phar/functions/Phar-offsetGet.xml | 122 ++++++++++++++++ reference/phar/functions/Phar-offsetSet.xml | 118 ++++++++++++++++ reference/phar/functions/Phar-offsetUnset.xml | 95 +++++++++++++ .../phar/functions/PharFileInfo-construct.xml | 111 +++++++++++++++ .../phar/functions/PharFileInfo-getCRC32.xml | 76 ++++++++++ .../PharFileInfo-getCompressedSize.xml | 83 +++++++++++ .../functions/PharFileInfo-getPharFlags.xml | 73 ++++++++++ .../functions/PharFileInfo-isCRCChecked.xml | 74 ++++++++++ .../functions/PharFileInfo-isCompressed.xml | 85 +++++++++++ .../PharFileInfo-isCompressedBZIP2.xml | 85 +++++++++++ .../functions/PharFileInfo-isCompressedGZ.xml | 85 +++++++++++ reference/phar/functions/apiVersion.xml | 76 ++++++++++ reference/phar/functions/canCompress.xml | 84 +++++++++++ reference/phar/functions/canWrite.xml | 83 +++++++++++ reference/phar/ini.xml | 106 ++++++++++++++ reference/phar/installation.xml | 133 ++++++++++++++++++ reference/phar/reference.xml | 84 +++++++++++ 25 files changed, 2245 insertions(+) create mode 100644 reference/phar/functions.xml create mode 100644 reference/phar/functions/Phar-construct.xml create mode 100644 reference/phar/functions/Phar-count.xml create mode 100644 reference/phar/functions/Phar-getModified.xml create mode 100644 reference/phar/functions/Phar-getVersion.xml create mode 100644 reference/phar/functions/Phar-loadPhar.xml create mode 100644 reference/phar/functions/Phar-mapPhar.xml create mode 100644 reference/phar/functions/Phar-offsetExists.xml create mode 100644 reference/phar/functions/Phar-offsetGet.xml create mode 100644 reference/phar/functions/Phar-offsetSet.xml create mode 100644 reference/phar/functions/Phar-offsetUnset.xml create mode 100644 reference/phar/functions/PharFileInfo-construct.xml create mode 100644 reference/phar/functions/PharFileInfo-getCRC32.xml create mode 100644 reference/phar/functions/PharFileInfo-getCompressedSize.xml create mode 100644 reference/phar/functions/PharFileInfo-getPharFlags.xml create mode 100644 reference/phar/functions/PharFileInfo-isCRCChecked.xml create mode 100644 reference/phar/functions/PharFileInfo-isCompressed.xml create mode 100644 reference/phar/functions/PharFileInfo-isCompressedBZIP2.xml create mode 100644 reference/phar/functions/PharFileInfo-isCompressedGZ.xml create mode 100644 reference/phar/functions/apiVersion.xml create mode 100644 reference/phar/functions/canCompress.xml create mode 100644 reference/phar/functions/canWrite.xml create mode 100644 reference/phar/ini.xml create mode 100644 reference/phar/installation.xml create mode 100644 reference/phar/reference.xml diff --git a/reference/phar/functions.xml b/reference/phar/functions.xml new file mode 100644 index 0000000000..7a2594a855 --- /dev/null +++ b/reference/phar/functions.xml @@ -0,0 +1,21 @@ +&reference.phar.functions.Phar-construct; +&reference.phar.functions.Phar-count; +&reference.phar.functions.Phar-getModified; +&reference.phar.functions.Phar-getVersion; +&reference.phar.functions.Phar-loadPhar; +&reference.phar.functions.Phar-mapPhar; +&reference.phar.functions.Phar-offsetExists; +&reference.phar.functions.Phar-offsetGet; +&reference.phar.functions.Phar-offsetSet; +&reference.phar.functions.Phar-offsetUnset; +&reference.phar.functions.PharFileInfo-construct; +&reference.phar.functions.PharFileInfo-getCRC32; +&reference.phar.functions.PharFileInfo-getCompressedSize; +&reference.phar.functions.PharFileInfo-getPharFlags; +&reference.phar.functions.PharFileInfo-isCRCChecked; +&reference.phar.functions.PharFileInfo-isCompressed; +&reference.phar.functions.PharFileInfo-isCompressedBZIP2; +&reference.phar.functions.PharFileInfo-isCompressedGZ; +&reference.phar.functions.apiVersion; +&reference.phar.functions.canCompress; +&reference.phar.functions.canWrite; diff --git a/reference/phar/functions/Phar-construct.xml b/reference/phar/functions/Phar-construct.xml new file mode 100644 index 0000000000..229d4852da --- /dev/null +++ b/reference/phar/functions/Phar-construct.xml @@ -0,0 +1,113 @@ + + + + + Phar::__construct + Construct a Phar archive object + + + &reftitle.description; + + voidPhar::__construct + stringfname + intflags + stringalias + + + + + &reftitle.parameters; + + + + fname + + + Path to an existing Phar archive, or if the + phar.readonly INI + variable is set to "0", + + + + + flags + + + flags to pass to parent class RecursiveDirectoryIterator. + See SPL RecursiveDirectoryIterator docs + + + + + alias + + + Alias with which this Phar archive should be referred to in calls to stream + functionality. + + + + + + + + + &reftitle.errors; + + Throws BadMethodCallException if called twice, UnexpectedValueException + if the phar archive can't be opened. + + + + + + &reftitle.examples; + + + A <function>Phar::__construct</function> example + + + + ]]> + + + + + + + + + diff --git a/reference/phar/functions/Phar-count.xml b/reference/phar/functions/Phar-count.xml new file mode 100644 index 0000000000..f5916b9f09 --- /dev/null +++ b/reference/phar/functions/Phar-count.xml @@ -0,0 +1,86 @@ + + + + + Phar->count + Returns the number of entries (files) in the Phar archive + + + &reftitle.description; + + intPhar->count + + + + + + + + + &reftitle.parameters; + + + + + &reftitle.returnvalues; + + The number of files containd within this phar, or 0 (the number zero) if none. + + + + + &reftitle.examples; + + + A <function>Phar->count</function> example + + + +count() . " entries\n"; +$p['file.txt'] = 'hi'; +echo 'The new phar has ' . $p->count() . " entries\n"; +?> +]]> + + &example.outputs; + + + + + + + + + + diff --git a/reference/phar/functions/Phar-getModified.xml b/reference/phar/functions/Phar-getModified.xml new file mode 100644 index 0000000000..d6c0fed7cc --- /dev/null +++ b/reference/phar/functions/Phar-getModified.xml @@ -0,0 +1,55 @@ + + + + + Phar->getModified + Return whether phar was modified + + + &reftitle.description; + + boolPhar->getModified + + + + + This method can be used to determine whether a phar has either + had an internal file deleted, or contents of a file changed in + some way. + + + + + &reftitle.parameters; + + + + + &reftitle.returnvalues; + + &true; if the phar has been modified since opened, &false; if not + + + + + + diff --git a/reference/phar/functions/Phar-getVersion.xml b/reference/phar/functions/Phar-getVersion.xml new file mode 100644 index 0000000000..54acc61764 --- /dev/null +++ b/reference/phar/functions/Phar-getVersion.xml @@ -0,0 +1,64 @@ + + + + + Phar->getVersion + Return version info of Phar archive + + + &reftitle.description; + + stringPhar->getVersion + + + + + Returns the API version of an opened Phar archive. + + + + + &reftitle.parameters; + + + + + &reftitle.returnvalues; + + The opened archive's API version. This is not to be confused with + the API version that the loaded phar extension will use to create + new phars. + + + + &reftitle.seealso; + + + Phar::apiVersion + + + + + + + + diff --git a/reference/phar/functions/Phar-loadPhar.xml b/reference/phar/functions/Phar-loadPhar.xml new file mode 100644 index 0000000000..6ad84983ac --- /dev/null +++ b/reference/phar/functions/Phar-loadPhar.xml @@ -0,0 +1,115 @@ + + + + + Phar::loadPhar + Loads any phar archive with an alias + + + &reftitle.description; + + mixedPhar::loadPhar + stringfilename + stringalias + + + + This can be used to read the contents of an external Phar archive. This + is most useful for assigning an alias to a phar so that subsequent references + to the phar can use the shorter alias. + + + + + &reftitle.parameters; + + + + filename + + + the full or relative path to the phar archive to open + + + + + alias + + + 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 an E_RECOVERABLE_ERROR will be thrown if + a new alias is specified in this case. + + + + + + + + &reftitle.returnvalues; + + returns &true; if successful, &false; otherwise + + + + + &reftitle.errors; + + E_RECOVERABLE_ERROR is thrown if an alias is passed in and the phar archive + already has an explicit alias + + + + + &reftitle.examples; + + + A <function>Phar::loadPhar</function> example + + loadPhar can be used anywhere to load an external Phar archive, whereas + mapPhar should be used in a loader stub for a Phar. + + + +]]> + + + + + + + &reftitle.seealso; + + + Phar::mapPhar + + + + + + + diff --git a/reference/phar/functions/Phar-mapPhar.xml b/reference/phar/functions/Phar-mapPhar.xml new file mode 100644 index 0000000000..21e440a555 --- /dev/null +++ b/reference/phar/functions/Phar-mapPhar.xml @@ -0,0 +1,111 @@ + + + + + Phar::mapPhar + Reads the currently executed file (a phar) and registers its manifest + + + &reftitle.description; + + mixedPhar::mapPhar + stringalias + + + + This static method should be used inside a Phar archive's loader stub + in order to initialize the phar. + + + + + &reftitle.parameters; + + + + alias + + + The alias with which this phar should be referred to. + + + + + + + + &reftitle.returnvalues; + + + + + + &reftitle.errors; + + E_RECOVERABLE_ERROR is thrown if not called directly within PHP execution, + if no __HALT_COMPILER(); token is found in the current source file, or if + the file cannot be opened for reading. + + + + + &reftitle.examples; + + + A <function>Phar::mapPhar</function> example + + mapPhar should be used only inside a phar's loader stub. Use + loadPhar to load an external phar into memory. + + + Here is a sample Phar loader stub that uses mapPhar. + + + +]]> + + + + + + + &reftitle.seealso; + + + Phar::loadPhar + + + + + + + + diff --git a/reference/phar/functions/Phar-offsetExists.xml b/reference/phar/functions/Phar-offsetExists.xml new file mode 100644 index 0000000000..6ac550a1c0 --- /dev/null +++ b/reference/phar/functions/Phar-offsetExists.xml @@ -0,0 +1,107 @@ + + + + + Phar::offsetExists + determines whether a file exists in the phar + + + &reftitle.description; + + intPhar::offsetExists + stringoffset + + + + This is an implementation of the ArrayAccess interface allowing + direct manipulation of the contents of a Phar archive using + array access brackets. + + + offsetExists() is called whenever isset is called. + + + + + &reftitle.parameters; + + + + offset + + + The filename (relative path) to look for in a Phar. + + + + + + + + &reftitle.returnvalues; + + Returns &true; if the file exists within the phar, or &false; if not. + + + + + &reftitle.examples; + + + A <function>Phar::offsetExists</function> example + + +]]> + + &example.outputs; + + + + + + + + + &reftitle.seealso; + + + Phar::offsetGet + Phar::offsetSet + Phar::offsetUnset + + + + + + + diff --git a/reference/phar/functions/Phar-offsetGet.xml b/reference/phar/functions/Phar-offsetGet.xml new file mode 100644 index 0000000000..b3f307f420 --- /dev/null +++ b/reference/phar/functions/Phar-offsetGet.xml @@ -0,0 +1,122 @@ + + + + + Phar::offsetGet + get a PharFileInfo object for a specific file + + + &reftitle.description; + + intPhar::offsetGet + stringoffset + + + + This is an implementation of the ArrayAccess interface allowing + direct manipulation of the contents of a Phar archive using + array access brackets. offsetGet is used for retrieving files from + a Phar archive. + + + + + &reftitle.parameters; + + + + offset + + + The filename (relative path) to look for in a Phar. + + + + + + + + &reftitle.returnvalues; + + a PharFileInfo object is returned that can be used to + iterate over a file's contents or to retrieve information about the current file. + + + + + &reftitle.errors; + + This method throws BadMethodCallException if the file + does not exist in the Phar archive. + + + + + &reftitle.examples; + + + A <function>Phar::offsetGet</function> example + + As with all classes that implement the ArrayAccess + interface, offsetGet is automatically called when using the [] angle bracket + operator + + + +]]> + + &example.outputs; + + + + + + + + + &reftitle.seealso; + + + Phar::offsetExists + Phar::offsetSet + Phar::offsetUnset + + + + + + + diff --git a/reference/phar/functions/Phar-offsetSet.xml b/reference/phar/functions/Phar-offsetSet.xml new file mode 100644 index 0000000000..b06454e250 --- /dev/null +++ b/reference/phar/functions/Phar-offsetSet.xml @@ -0,0 +1,118 @@ + + + + + Phar::offsetSet + set the contents of an internal file to those of an external file + + + &reftitle.description; + + intPhar::offsetSet + stringoffset + stringvalue + + + + This is an implementation of the ArrayAccess interface allowing + direct manipulation of the contents of a Phar archive using + array access brackets. offsetSet is used for modifying an + existing file, or adding a new file to a Phar archive. + + + + + &reftitle.parameters; + + + + offset + + + The filename (relative path) to modify in a Phar. + + + + + value + + + Its description + + + + + + + + &reftitle.returnvalues; + + no return values + + + + + &reftitle.errors; + + if phar.readonly is 1, + BadMethodCallException is thrown, as modifying a Phar + is only allowed when phar.readonly is set to 0. + + + + + &reftitle.examples; + + + A <function>Phar::offsetSet</function> example + + offsetSet should not be accessed directly, but instead used + via array access with the [] operator. + + + +]]> + + + + + + + &reftitle.seealso; + + + Phar::offsetExists + Phar::offsetGet + Phar::offsetUnset + + + + + + + + diff --git a/reference/phar/functions/Phar-offsetUnset.xml b/reference/phar/functions/Phar-offsetUnset.xml new file mode 100644 index 0000000000..1485adf87b --- /dev/null +++ b/reference/phar/functions/Phar-offsetUnset.xml @@ -0,0 +1,95 @@ + + + + + Phar::offsetUnset + remove a file from a phar + + + &reftitle.description; + + intPhar::offsetUnset + + + + + This is an implementation of the ArrayAccess interface allowing + direct manipulation of the contents of a Phar archive using + array access brackets. offsetUnset is used for deleting an + existing file, and is called by the unset + language construct. + + + + + &reftitle.parameters; + + + + + &reftitle.returnvalues; + + &true; if successful, &false; on failure + + + + + &reftitle.errors; + + if phar.readonly is 1, + BadMethodCallException is thrown, as modifying a Phar + is only allowed when phar.readonly is set to 0. + + + + + &reftitle.examples; + + + A <function>Phar::offsetUnset</function> example + + +]]> + + + + + + + &reftitle.seealso; + + + Phar::offsetExists + Phar::offsetGet + Phar::offsetSet + + + + + + + diff --git a/reference/phar/functions/PharFileInfo-construct.xml b/reference/phar/functions/PharFileInfo-construct.xml new file mode 100644 index 0000000000..de44b3c77d --- /dev/null +++ b/reference/phar/functions/PharFileInfo-construct.xml @@ -0,0 +1,111 @@ + + + + + PharFileInfo::__construct + Construct a Phar entry object + + + &reftitle.description; + + voidPharFileInfo::__construct + stringentry + + + + This should not be called directly. Instead, a PharFileInfo object + is initialized by calling Phar::offsetGet + through array access. + + + + + &reftitle.parameters; + + + + entry + + + 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. + + + + + + + + + &reftitle.errors; + + Throws BadMethodCallException if + __construct is called twice. + Throws UnexpectedValueException if + the phar URL requested is malformed, the requested + phar cannot be opened, or the file can't be found within the phar. + + + + + &reftitle.examples; + + + A <function>PharFileInfo::__construct</function> example + + + + $text) { + echo "line number $line: $text"; +} +// this also works +$file = new PharFileInfo('phar:///path/to/my.phar/testfile.txt'); +foreach ($file as $line => $text) { + echo "line number $line: $text"; +} +?> +]]> + + &example.outputs; + + + + + + + + + + diff --git a/reference/phar/functions/PharFileInfo-getCRC32.xml b/reference/phar/functions/PharFileInfo-getCRC32.xml new file mode 100644 index 0000000000..3ee59aed15 --- /dev/null +++ b/reference/phar/functions/PharFileInfo-getCRC32.xml @@ -0,0 +1,76 @@ + + + + + PharFileInfo->getCRC32 + Returns CRC32 code or throws an exception if not CRC checked + + + &reftitle.description; + + intPharFileInfo->getCRC32 + + + + + This returns the crc32 checksum of the file + within the Phar archive. + + + + + &reftitle.returnvalues; + + the crc32 checksum of the file within the Phar archive. + + + + + &reftitle.examples; + + + A <function>PharFileInfo->getCRC32</function> example + + + +getCRC32(); +?> +]]> + + &example.outputs; + + + + + + + + + + diff --git a/reference/phar/functions/PharFileInfo-getCompressedSize.xml b/reference/phar/functions/PharFileInfo-getCompressedSize.xml new file mode 100644 index 0000000000..f16690cf29 --- /dev/null +++ b/reference/phar/functions/PharFileInfo-getCompressedSize.xml @@ -0,0 +1,83 @@ + + + + + PharFileInfo->getCompressedSize + Returns the actual size of the file (with compression) inside the Phar archive + + + &reftitle.description; + + intPharFileInfo->getCompressedSize + + + + + This returns the size of the file within the Phar archive. Uncompressed files will return + the same value for getCompressedSize as they will with filesize + + + + + &reftitle.returnvalues; + + the size in bytes of the file within the Phar archive on disk. + + + + + &reftitle.examples; + + + A <function>PharFileInfo->getCompressedSize</function> example + +getCompressedSize(); +?> +]]> + + &example.outputs; + + + + + + + + + &reftitle.seealso; + + + PharFileInfo->isCompressed + + + + + + + diff --git a/reference/phar/functions/PharFileInfo-getPharFlags.xml b/reference/phar/functions/PharFileInfo-getPharFlags.xml new file mode 100644 index 0000000000..2e7afe4545 --- /dev/null +++ b/reference/phar/functions/PharFileInfo-getPharFlags.xml @@ -0,0 +1,73 @@ + + + + + PharFileInfo->getPharFlags + Returns the Phar file entry flags + + + &reftitle.description; + + intPharFileInfo->getPharFlags + + + + This returns the size of the file within the Phar archive. Uncompressed files will return + the same value for getCompressedSize as they will with filesize + + + + + &reftitle.returnvalues; + + the size in bytes of the file within the Phar archive on disk. + + + + + &reftitle.examples; + + + A <function>PharFileInfo->getPharFlags</function> example + +getPharFlags()); +?> +]]> + + &example.outputs; + + + + + + + + + + diff --git a/reference/phar/functions/PharFileInfo-isCRCChecked.xml b/reference/phar/functions/PharFileInfo-isCRCChecked.xml new file mode 100644 index 0000000000..5fd523d4e1 --- /dev/null +++ b/reference/phar/functions/PharFileInfo-isCRCChecked.xml @@ -0,0 +1,74 @@ + + + + + PharFileInfo::isCRCChecked + Returns whether file entry has had its CRC verified + + + &reftitle.description; + + intPharFileInfo->isCRCChecked + + + + + This returns whether a file within a Phar archive + has had its CRC verified. + + + + + &reftitle.returnvalues; + + &true; if the file has had its CRC verified, &false; if not. + + + + + &reftitle.examples; + + + A <function>PharFileInfo->isCRCChecked</function> example + +isCRCChecked()); +?> +]]> + + &example.outputs; + + + + + + + + + + diff --git a/reference/phar/functions/PharFileInfo-isCompressed.xml b/reference/phar/functions/PharFileInfo-isCompressed.xml new file mode 100644 index 0000000000..e7a31539af --- /dev/null +++ b/reference/phar/functions/PharFileInfo-isCompressed.xml @@ -0,0 +1,85 @@ + + + + + PharFileInfo->isCompressed + Returns whether the entry is compressed + + + &reftitle.description; + + boolPharFileInfo->isCompressed + + + + + This returns whether a file is compressed within a Phar archive + with either Gzip or Bzip2 compression. + + + + + &reftitle.returnvalues; + + &true; if the file is compressed within the Phar archive, &false; if not. + + + + + &reftitle.examples; + + + A <function>PharFileInfo->isCompressed</function> example + +isCompressed()); +?> +]]> + + &example.outputs; + + + + + + + + + &reftitle.seealso; + + + PharFileInfo->getCompressedSize + PharFileInfo->isCompressedGZ + PharFileInfo->isCompressedBZIP2 + + + + + + + diff --git a/reference/phar/functions/PharFileInfo-isCompressedBZIP2.xml b/reference/phar/functions/PharFileInfo-isCompressedBZIP2.xml new file mode 100644 index 0000000000..9612190d1f --- /dev/null +++ b/reference/phar/functions/PharFileInfo-isCompressedBZIP2.xml @@ -0,0 +1,85 @@ + + + + + PharFileInfo->isCompressedBZIP2 + Returns whether the entry is compressed using bzip2 + + + &reftitle.description; + + boolPharFileInfo->isCompressedBZIP2 + + + + + This returns whether a file is compressed within a Phar archive + with Bzip2 compression. + + + + + &reftitle.returnvalues; + + &true; if the file is compressed within the Phar archive using Bzip2, &false; if not. + + + + + &reftitle.examples; + + + A <function>PharFileInfo->isCompressedBZIP2</function> example + +isCompressedBZIP2()); +?> +]]> + + &example.outputs; + + + + + + + + + &reftitle.seealso; + + + PharFileInfo->getCompressedSize + PharFileInfo->isCompressedGZ + PharFileInfo->isCompressed + + + + + + + diff --git a/reference/phar/functions/PharFileInfo-isCompressedGZ.xml b/reference/phar/functions/PharFileInfo-isCompressedGZ.xml new file mode 100644 index 0000000000..fdd4cff123 --- /dev/null +++ b/reference/phar/functions/PharFileInfo-isCompressedGZ.xml @@ -0,0 +1,85 @@ + + + + + PharFileInfo->isCompressedGZ + Returns whether the entry is compressed using gz + + + &reftitle.description; + + boolPharFileInfo->isCompressedGZ + + + + + This returns whether a file is compressed within a Phar archive + with Gzip compression. + + + + + &reftitle.returnvalues; + + &true; if the file is compressed within the Phar archive using Gzip, &false; if not. + + + + + &reftitle.examples; + + + A <function>PharFileInfo->isCompressedGZ</function> example + +isCompressedGZ()); +?> +]]> + + &example.outputs; + + + + + + + + + &reftitle.seealso; + + + PharFileInfo->getCompressedSize + PharFileInfo->isCompressedBZIP2 + PharFileInfo->isCompressed + + + + + + + diff --git a/reference/phar/functions/apiVersion.xml b/reference/phar/functions/apiVersion.xml new file mode 100644 index 0000000000..9ce1f7a7eb --- /dev/null +++ b/reference/phar/functions/apiVersion.xml @@ -0,0 +1,76 @@ + + + + + apiVersion + Returns the api version + + + &reftitle.description; + + stringapiVersion + + + + + Return the API version of the phar file format that will be + used when creating phars. The Phar extension supports reading API + version 1.0.0 or newer. + + + + + &reftitle.parameters; + + + + + &reftitle.returnvalues; + + The API version string as in "1.0.0" + + + + &reftitle.examples; + + + A <function>Phar::apiVersion</function> example + + +]]> + + &example.outputs; + + + + + + + + + + diff --git a/reference/phar/functions/canCompress.xml b/reference/phar/functions/canCompress.xml new file mode 100644 index 0000000000..8109cbf19b --- /dev/null +++ b/reference/phar/functions/canCompress.xml @@ -0,0 +1,84 @@ + + + + + canCompress + Returns whether phar extension supports compression using zlib or bzip2 + + + &reftitle.description; + + boolcanCompress + + + + + This should be used to test whether compression is possible prior to + loading a phar archive containing compressed files. + + + + + &reftitle.parameters; + + + + + &reftitle.returnvalues; + + &true; if compression/decompression is available, &false; if not + + + + + &reftitle.examples; + + + A <function>canCompress</function> example + + +]]> + + + + + + + &reftitle.seealso; + + + PharFileInfo::isCompressed + + + + + + + + diff --git a/reference/phar/functions/canWrite.xml b/reference/phar/functions/canWrite.xml new file mode 100644 index 0000000000..36fcc51368 --- /dev/null +++ b/reference/phar/functions/canWrite.xml @@ -0,0 +1,83 @@ + + + + + canWrite + Returns whether phar extension supports writing and creating phars + + + &reftitle.description; + + boolcanWrite + + + + + This method determines whether write access has been disabled in + the system php.ini via the phar.readonly + ini variable. + + + + + &reftitle.parameters; + + + + + &reftitle.returnvalues; + + &true; if write access is enabled, &false; if it is disabled. + + + + + &reftitle.examples; + + + A <function>Phar::canWrite</function> example + + +]]> + + + + + + + &reftitle.seealso; + + + phar.readonly + + + + + + + + diff --git a/reference/phar/ini.xml b/reference/phar/ini.xml new file mode 100644 index 0000000000..c24b6784dd --- /dev/null +++ b/reference/phar/ini.xml @@ -0,0 +1,106 @@ + + +
+ &reftitle.runtime; + &extension.runtime; + + + Filesystem and Streams Configuration Options + + + + Name + Default + Changeable + Changelog + + + + + phar.readonly + "1" + PHP_INI_SYSTEM + Available Since version 1.0.0 + + + phar.require_hash + "0" + PHP_INI_SYSTEM disable/enable, PHP_INI_ALL enable + Available Since version 1.0.0 + + + +
+
+ + &ini.descriptions.title; + + + + + + phar.readonly + boolean + + + + This option disables creation or modification of Phar archives + using the phar stream or Phar + object's write support. This setting should always be enabled on + production machines, as the phar extension's convenient write support + could allow straightforward creation of a php-based virus when coupled + with other common security vulnerabilities. + + + + This setting can only be set in php.ini due to security reasons. + + + + + + + + phar.require_hash + boolean + + + + This option will force all opened Phar archives to contain some + kind of signature (currently md5 and sha1 are supported), and will + refuse to process any Phar archive that does not contain a signature. + + + + The option can be disabled in the system level only, but can be + enabled using ini_set in a user script regardless + of the system setting. + + + + + + + +
+ + \ No newline at end of file diff --git a/reference/phar/installation.xml b/reference/phar/installation.xml new file mode 100644 index 0000000000..4b592003c1 --- /dev/null +++ b/reference/phar/installation.xml @@ -0,0 +1,133 @@ + + +
+ &reftitle.install; + + Windows binaries may be found at + &url.php.snapshots;. + To install, download php_phar.dll to the folder specified + by your php.ini file's extension_dir directive. + Enable it by adding extension=php_phar.dll + to your php.ini and restarting your webserver. + + + + + + + + Linux, BSD, and other *nix variants + can be compiled using the following steps: + + + + + + + Either: + + + + + + Run the pear installer for PECL/phar: pecl install phar + + + + + + Copy phar.so from the directory indicated by the + build process to the location specified in your php.ini file under + extension_dir. + + + + + + Add extension=phar.so to your php.ini + + + + + + Or: + + + + + + Set the path to your php.ini via: + + + pecl config-set php_ini /path/to/php.ini + + + + + + Run the pear installer for PECL/phar: pecl install phar + + + + + + + + + Restart your webserver to reload your php.ini settings. + + + + + + + Development Versions + + There are currently no stable versions of PECL/phar, + to force installation of the alpha version of PECL/phar + execute: pecl install phar-alpha + + + + + Compiling PECL/phar without using the PEAR command + + Rather than using pecl install phar to automatically + download and install PECL/phar, you may download the tarball from + PECL. + From the root of the unpacked tarball, run: + phpize && ./configure --enable-phar && make + to generate phar.so. + Once built, continue the installation from step 4 above. + + + + + &pecl.info; + &url.pecl.package;phar. + +
+ + \ No newline at end of file diff --git a/reference/phar/reference.xml b/reference/phar/reference.xml new file mode 100644 index 0000000000..1233b652cd --- /dev/null +++ b/reference/phar/reference.xml @@ -0,0 +1,84 @@ + + + + + + Phar archive stream and classes + phar + +
+ &reftitle.intro; + + The phar extension + provides the phar stream wrapper and the Phar + class for manipulating self-contained PHP Archive (phar) files. The + Phar class can be used to create and to extract contents of phar files as + well as iterating over their contents. + + + PHP Archive files are special collections of files that can be transparently + run right out of the file, similar to Java's jar archive files. Using a phar archive, + it is possible to distribute a complete PHP application in a single file. Phar + archives can also be used to store files for extraction similar to tar or zip + archive files. + +
+
+ &reftitle.required; + + Phar requires PHP 5.2.0 or newer, and requires that the + SPL extension + be built into PHP. + + + You may optionally wish to enable the zlib + and bzip2 extensions to take + advantage of compressed phar support. In addition, the + hash extension can be + used for signing phars and verifying integrity. + +
+ &reference.phar.installation; + + + + &reference.phar.ini; +
+ &reftitle.resources; + + + + &no.resource; +
+
+ Classes + + + Phar + PharFileInfo + + +
+
+ &reference.phar.functions; +
+ \ No newline at end of file