From a69f689899f0b1f64ae24358dda97c57ee7806a4 Mon Sep 17 00:00:00 2001 From: Greg Beaver Date: Sun, 28 Jan 2007 20:08:52 +0000 Subject: [PATCH] update docs to current cvs git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@228329 c90b9560-bf6c-de11-be94-00142212c4b1 --- .../{Phar-beginWrite.xml => Phar-begin.xml} | 18 +-- .../{Phar-commitWrite.xml => Phar-commit.xml} | 20 +-- .../functions/Phar-compressAllFilesBZIP2.xml | 125 +++++++++++++++++ .../functions/Phar-compressAllFilesGZ.xml | 126 +++++++++++++++++ reference/phar/functions/Phar-getStub.xml | 6 +- .../functions/Phar-uncompressAllFiles.xml | 128 ++++++++++++++++++ .../PharFileInfo-setCompressedBZIP2.xml | 5 +- .../PharFileInfo-setCompressedGZ.xml | 3 +- .../PharFileInfo-setUncompressed.xml | 3 +- 9 files changed, 408 insertions(+), 26 deletions(-) rename reference/phar/functions/{Phar-beginWrite.xml => Phar-begin.xml} (84%) rename reference/phar/functions/{Phar-commitWrite.xml => Phar-commit.xml} (83%) create mode 100644 reference/phar/functions/Phar-compressAllFilesBZIP2.xml create mode 100644 reference/phar/functions/Phar-compressAllFilesGZ.xml create mode 100644 reference/phar/functions/Phar-uncompressAllFiles.xml diff --git a/reference/phar/functions/Phar-beginWrite.xml b/reference/phar/functions/Phar-begin.xml similarity index 84% rename from reference/phar/functions/Phar-beginWrite.xml rename to reference/phar/functions/Phar-begin.xml index 9c62b7787c..2752271284 100644 --- a/reference/phar/functions/Phar-beginWrite.xml +++ b/reference/phar/functions/Phar-begin.xml @@ -1,19 +1,19 @@ - + - Phar->beginWrite + Phar->begin Begin a Phar modification transaction &reftitle.description; - voidPhar->beginWrite + voidPhar->begin - Although technically unnecessary, the beginWrite method + Although technically unnecessary, the begin method can provide a significant performance boost when creating or modifying a Phar archive with a large number of files. Ordinarily, every time a file within a Phar archive is created or modified in any way, the entire Phar @@ -26,7 +26,7 @@ Similarly, it is often necessary to make a series of changes and to ensure that they all are possible before making any changes on disk, similar to the relational database concept of transactions. the - beginWrite/commitWrite pair + begin/commit pair of methods is provided for this purpose. @@ -41,7 +41,7 @@ &reftitle.examples; - A <function>Phar->beginWrite</function> example + A <function>Phar->begin</function> example @@ -55,13 +55,13 @@ try { echo 'Could not create phar:', $e; } echo 'The new phar has ' . $p->count() . " entries\n"; -$p->beginWrite(); +$p->begin(); $p['file.txt'] = 'hi'; $p['file2.txt'] = 'there'; $p['file2.txt']->setCompressedGZ(); $p['file3.txt'] = 'babyface'; $p['file3.txt']->setMetaData(42); -$p->commitWrite("commit(" - Phar->commitWrite + Phar->commit Phar->getStub diff --git a/reference/phar/functions/Phar-commitWrite.xml b/reference/phar/functions/Phar-commit.xml similarity index 83% rename from reference/phar/functions/Phar-commitWrite.xml rename to reference/phar/functions/Phar-commit.xml index cac71ff213..a27e700432 100644 --- a/reference/phar/functions/Phar-commitWrite.xml +++ b/reference/phar/functions/Phar-commit.xml @@ -1,19 +1,19 @@ - - + + - Phar->commitWrite + Phar->commit End a Phar modification transaction by writing the Phar archive to disk &reftitle.description; - voidPhar->commitWrite + voidPhar->commit - Although technically unnecessary, the beginWrite method + Although technically unnecessary, the begin method can provide a significant performance boost when creating or modifying a Phar archive with a large number of files. Ordinarily, every time a file within a Phar archive is created or modified in any way, the entire Phar @@ -26,7 +26,7 @@ Similarly, it is often necessary to make a series of changes and to ensure that they all are possible before making any changes on disk, similar to the relational database concept of transactions. the - beginWrite/commitWrite pair + begin/commit pair of methods is provided for this purpose. @@ -41,7 +41,7 @@ &reftitle.examples; - A <function>Phar->commitWrite</function> example + A <function>Phar->commit</function> example @@ -49,9 +49,9 @@ commitWrite(); +$p->commit(); var_dump($p->getStub()); -$p->commitWrite("commit(" - Phar->beginWrite + Phar->begin Phar->getStub diff --git a/reference/phar/functions/Phar-compressAllFilesBZIP2.xml b/reference/phar/functions/Phar-compressAllFilesBZIP2.xml new file mode 100644 index 0000000000..6dc317e51b --- /dev/null +++ b/reference/phar/functions/Phar-compressAllFilesBZIP2.xml @@ -0,0 +1,125 @@ + + + + + PharFileInfo->compressAllFilesBZIP2 + Compresses all files in the current Phar archive using Bzip2 compression + + + &reftitle.description; + + boolPhar->compressAllFilesBZIP2 + + + + + This method causes all files in the Phar archive to be compressed using bzip2 compression. + The bzip2 extension must be enabled to take + advantage of this feature. In addition, if any files are already compressed using + gzip compression, the zlib extension must be enabled in order + to decompress the file. As with all functionality that modifies the contents of + a phar, the phar.readonly INI variable + must be off in order to succeed. + + + + + &reftitle.errors; + + Throws BadMethodCallException if + the phar.readonly + INI variable is on, the bzip2 + extension is not available, or if any files are compressed using + gzip compression and the zlib extension + is not enabled. + + + + + &reftitle.examples; + + + A <function>Phar->compressAllFilesBZIP2</function> example + +getFileName()); + var_dump($file->isCompressed()); + var_dump($file->isCompressedBZIP2()); + var_dump($file->isCompressedGZ()); +} +$p->compressAllFilesBZIP2(); +foreach ($p as $file) { + var_dump($file->getFileName()); + var_dump($file->isCompressed()); + var_dump($file->isCompressedBZIP2()); + var_dump($file->isCompressedGZ()); +} +?> +]]> + + &example.outputs; + + + + + + + + + &reftitle.seealso; + + + PharFileInfo->isCompressedGZ + PharFileInfo->isCompressed + PharFileInfo->isCompressedGZ + PharFileInfo->isCompressed + Phar->uncompressAllFiles + Phar->compressAllFilesGZ + + + + + + + diff --git a/reference/phar/functions/Phar-compressAllFilesGZ.xml b/reference/phar/functions/Phar-compressAllFilesGZ.xml new file mode 100644 index 0000000000..9c67ccc7b2 --- /dev/null +++ b/reference/phar/functions/Phar-compressAllFilesGZ.xml @@ -0,0 +1,126 @@ + + + + + PharFileInfo->compressAllFilesGZ + Compresses all files in the current Phar archive using Gzip compression + + + &reftitle.description; + + boolPhar->compressAllFilesGZ + + + + + This method causes all files in the Phar archive to be compressed using gzip compression. + The zlib extension must be enabled to take + advantage of this feature. In addition, if any files are already compressed using + bzip2 compression, the bzip2 extension must be enabled in order + to decompress the file. As with all functionality that modifies the contents of + a phar, the phar.readonly INI variable + must be off in order to succeed. + + + + + &reftitle.errors; + + Throws BadMethodCallException if + the phar.readonly + INI variable is on, the zlib + extension is not available, or if any files are compressed using + bzip2 compression and the bzip2 extension + is not enabled. + + + + + &reftitle.examples; + + + A <function>Phar->compressAllFilesGZ</function> example + +getFileName()); + var_dump($file->isCompressed()); + var_dump($file->isCompressedBZIP2()); + var_dump($file->isCompressedGZ()); +} +$p->compressAllFilesGZ(); +foreach ($p as $file) { + var_dump($file->getFileName()); + var_dump($file->isCompressed()); + var_dump($file->isCompressedBZIP2()); + var_dump($file->isCompressedGZ()); +} +?> +]]> + + &example.outputs; + + + + + + + + + &reftitle.seealso; + + + PharFileInfo->getCompressedSize + PharFileInfo->isCompressedGZ + PharFileInfo->isCompressed + PharFileInfo->isCompressedGZ + PharFileInfo->isCompressed + Phar->uncompressAllFiles + Phar->compressAllFilesBZIP2 + + + + + + + diff --git a/reference/phar/functions/Phar-getStub.xml b/reference/phar/functions/Phar-getStub.xml index 6874c36c67..978d70fd60 100644 --- a/reference/phar/functions/Phar-getStub.xml +++ b/reference/phar/functions/Phar-getStub.xml @@ -1,5 +1,5 @@ - + Phar->getStub @@ -81,8 +81,8 @@ __HALT_COMPILER(); &reftitle.seealso; - Phar->commitWrite - Phar->beginWrite + Phar->commit + Phar->begin diff --git a/reference/phar/functions/Phar-uncompressAllFiles.xml b/reference/phar/functions/Phar-uncompressAllFiles.xml new file mode 100644 index 0000000000..c1f6f622be --- /dev/null +++ b/reference/phar/functions/Phar-uncompressAllFiles.xml @@ -0,0 +1,128 @@ + + + + + PharFileInfo->uncompressAllFiles + Compresses all files in the current Phar archive using Bzip2 compression + + + &reftitle.description; + + boolPhar->uncompressAllFiles + + + + + This method causes all files in the Phar archive to be uncompressed. + If any files are already compressed using + gzip compression, the zlib extension must be enabled in order + to decompress the file, and any files compressed using bzip2 compression + require the bzip2 extension to decompress the file. + As with all functionality that modifies the contents of + a phar, the phar.readonly INI variable + must be off in order to succeed. + + + + + &reftitle.errors; + + Throws BadMethodCallException if + the phar.readonly + INI variable is on, the bzip2 + extension is not enabled and any files are compressed using bzip2 compression, + or if any files are compressed using + gzip compression and the zlib extension + is not enabled. + + + + + &reftitle.examples; + + + A <function>Phar->uncompressAllFiles</function> example + +compressAllFilesGZ(); +foreach ($p as $file) { + var_dump($file->getFileName()); + var_dump($file->isCompressed()); + var_dump($file->isCompressedBZIP2()); + var_dump($file->isCompressedGZ()); +} +$p->uncompressAllFiles(); +foreach ($p as $file) { + var_dump($file->getFileName()); + var_dump($file->isCompressed()); + var_dump($file->isCompressedBZIP2()); + var_dump($file->isCompressedGZ()); +} +?> +]]> + + &example.outputs; + + + + + + + + + &reftitle.seealso; + + + PharFileInfo->isCompressedGZ + PharFileInfo->isCompressed + PharFileInfo->isCompressedGZ + PharFileInfo->isCompressed + Phar->compressAllFilesBZIP2 + Phar->compressAllFilesGZ + + + + + + + diff --git a/reference/phar/functions/PharFileInfo-setCompressedBZIP2.xml b/reference/phar/functions/PharFileInfo-setCompressedBZIP2.xml index a95fbeb838..c0ce16cf89 100644 --- a/reference/phar/functions/PharFileInfo-setCompressedBZIP2.xml +++ b/reference/phar/functions/PharFileInfo-setCompressedBZIP2.xml @@ -1,5 +1,5 @@ - + PharFileInfo->setCompressedBZIP2 @@ -17,7 +17,7 @@ The bzip2 extension must be enabled to take advantage of this feature. In addition, if the file is already compressed using gzip compression, the zlib extension must be enabled in order - to decompress the file As with all functionality that modifies the contents of + to decompress the file. As with all functionality that modifies the contents of a phar, the phar.readonly INI variable must be off in order to succeed. @@ -70,6 +70,7 @@ bool(true) PharFileInfo->isCompressed PharFileInfo->isCompressedGZ PharFileInfo->isCompressed + Phar->compressAllFilesBZIP2 diff --git a/reference/phar/functions/PharFileInfo-setCompressedGZ.xml b/reference/phar/functions/PharFileInfo-setCompressedGZ.xml index 321553ef39..9516ea27ff 100644 --- a/reference/phar/functions/PharFileInfo-setCompressedGZ.xml +++ b/reference/phar/functions/PharFileInfo-setCompressedGZ.xml @@ -1,5 +1,5 @@ - + PharFileInfo->setCompressedGZ @@ -70,6 +70,7 @@ bool(true) PharFileInfo->isCompressed PharFileInfo->isCompressedBZIP2 PharFileInfo->isCompressed + Phar->compressAllFilesGZ diff --git a/reference/phar/functions/PharFileInfo-setUncompressed.xml b/reference/phar/functions/PharFileInfo-setUncompressed.xml index 812e3e01d8..ec39655d61 100644 --- a/reference/phar/functions/PharFileInfo-setUncompressed.xml +++ b/reference/phar/functions/PharFileInfo-setUncompressed.xml @@ -1,5 +1,5 @@ - + PharFileInfo->setUncompressed @@ -70,6 +70,7 @@ bool(false) PharFileInfo->isCompressedBZIP2 PharFileInfo->isCompressedGZ PharFileInfo->isCompressed + Phar->uncompressAllFiles