cellog Sat Feb 3 04:03:09 2007 UTC
Added files:
/phpdoc/en/reference/phar/functions Phar-apiVersion.xml
Phar-canCompress.xml
Phar-canWrite.xml
Phar-isFlushingToPhar.xml
Phar-setStub.xml
Removed files:
/phpdoc/en/reference/phar/functions apiVersion.xml canCompress.xml
canWrite.xml
Modified files:
/phpdoc/en/reference/phar reference.xml
/phpdoc/en/reference/phar/functions Phar-begin.xml Phar-commit.xml
Phar-compressAllFilesBZIP2.xml
Phar-compressAllFilesGZ.xml
Phar-count.xml
Phar-getMetaData.xml
Phar-getStub.xml
Phar-loadPhar.xml
Phar-mapPhar.xml
Phar-offsetExists.xml
Phar-offsetGet.xml
Phar-offsetSet.xml
Phar-offsetUnset.xml
Phar-setMetaData.xml
Phar-uncompressAllFiles.xml
PharFileInfo-getCRC32.xml
PharFileInfo-getCompressedSize.xml
PharFileInfo-getMetaData.xml
PharFileInfo-getPharFlags.xml
PharFileInfo-isCRCChecked.xml
PharFileInfo-isCompressed.xml
PharFileInfo-isCompressedBZIP2.xml
PharFileInfo-isCompressedGZ.xml
PharFileInfo-setCompressedBZIP2.xml
PharFileInfo-setCompressedGZ.xml
PharFileInfo-setMetaData.xml
PharFileInfo-setUncompressed.xml
Log:
update docs to current CVS, fix a few mistakes discovered
encourage best practices in the examples for Phar objects.
These will match the first release of the phar extension, to
occur this week some time, so any cleaning that needs to be
done can be done now.
http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/phar/reference.xml?r1=1.4&r2=1.5&diff_format=u
Index: phpdoc/en/reference/phar/reference.xml
diff -u phpdoc/en/reference/phar/reference.xml:1.4
phpdoc/en/reference/phar/reference.xml:1.5
--- phpdoc/en/reference/phar/reference.xml:1.4 Sun Jan 28 21:45:44 2007
+++ phpdoc/en/reference/phar/reference.xml Sat Feb 3 04:03:09 2007
@@ -1,5 +1,5 @@
<?xml version = '1.0' encoding = 'iso-8859-1'?>
-<!-- $Revision: 1.4 $ -->
+<!-- $Revision: 1.5 $ -->
<!-- Purpose: -->
<!-- Membership: pecl -->
<reference id="ref.phar" >
@@ -72,6 +72,9 @@
<member>
<classname>PharFileInfo</classname>
</member>
+ <member>
+ <classname>PharException</classname>
+ </member>
</simplelist>
</section>
&reference.phar.using;
http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/phar/functions/Phar-begin.xml?r1=1.2&r2=1.3&diff_format=u
Index: phpdoc/en/reference/phar/functions/Phar-begin.xml
diff -u phpdoc/en/reference/phar/functions/Phar-begin.xml:1.2
phpdoc/en/reference/phar/functions/Phar-begin.xml:1.3
--- phpdoc/en/reference/phar/functions/Phar-begin.xml:1.2 Sun Jan 28
21:52:56 2007
+++ phpdoc/en/reference/phar/functions/Phar-begin.xml Sat Feb 3 04:03:09 2007
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.2 $ -->
+<!-- $Revision: 1.3 $ -->
<refentry id="function.Phar-begin">
<refnamediv>
<refname>Phar->begin</refname>
@@ -50,7 +50,7 @@
// make sure it doesn't exist
@unlink('brandnewphar.phar');
try {
- $p = new Phar('brandnewphar.phar');
+ $p = new Phar(dirname(__FILE__) . '/brandnewphar.phar', 0,
'brandnewphar.phar');
} catch (Exception $e) {
echo 'Could not create phar:', $e;
}
@@ -61,7 +61,7 @@
$p['file2.txt']->setCompressedGZ();
$p['file3.txt'] = 'babyface';
$p['file3.txt']->setMetaData(42);
-$p->commit("<?php
+$p->setStub("<?php
function __autoload($class)
{
include 'phar://' . str_replace('_', '/', $class);
@@ -69,6 +69,7 @@
Phar::mapPhar('myphar.phar');
include 'phar://myphar.phar/startup.php';
__HALT_COMPILER();");
+$p->commit();
?>
]]>
</programlisting>
http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/phar/functions/Phar-commit.xml?r1=1.2&r2=1.3&diff_format=u
Index: phpdoc/en/reference/phar/functions/Phar-commit.xml
diff -u phpdoc/en/reference/phar/functions/Phar-commit.xml:1.2
phpdoc/en/reference/phar/functions/Phar-commit.xml:1.3
--- phpdoc/en/reference/phar/functions/Phar-commit.xml:1.2 Sun Jan 28
21:52:56 2007
+++ phpdoc/en/reference/phar/functions/Phar-commit.xml Sat Feb 3 04:03:09 2007
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.2 $ -->
+<!-- $Revision: 1.3 $ -->
<refentry id="function.Phar-commit">
<refnamediv>
<refname>Phar->commit</refname>
@@ -25,7 +25,7 @@
when it would make more sense to write the entire archive out at once.
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
+ relational database concept of transactions. The
<function>begin</function>/<function>commit</function> pair
of methods is provided for this purpose.
</para>
@@ -37,6 +37,14 @@
</refsect1>
+ <refsect1 role="errors">
+ &reftitle.errors;
+ <para>
+ <classname>PharException</classname> is thrown if any problems are
encountered
+ flushing changes to disk.
+ </para>
+ </refsect1>
+
<refsect1 role="examples">
&reftitle.examples;
<para>
@@ -51,7 +59,7 @@
$p['file1.txt'] = 'hi';
$p->commit();
var_dump($p->getStub());
-$p->commit("<?php
+$p->setStub("<?php
function __autoload(\$class)
{
include 'phar://' . str_replace('_', '/', \$class);
@@ -59,6 +67,7 @@
Phar::mapPhar('brandnewphar.phar');
include 'phar://brandnewphar.phar/startup.php';
__HALT_COMPILER();");
+$p->commit();
var_dump($p->getStub());
?>
]]>
http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/phar/functions/Phar-compressAllFilesBZIP2.xml?r1=1.2&r2=1.3&diff_format=u
Index: phpdoc/en/reference/phar/functions/Phar-compressAllFilesBZIP2.xml
diff -u phpdoc/en/reference/phar/functions/Phar-compressAllFilesBZIP2.xml:1.2
phpdoc/en/reference/phar/functions/Phar-compressAllFilesBZIP2.xml:1.3
--- phpdoc/en/reference/phar/functions/Phar-compressAllFilesBZIP2.xml:1.2
Sat Feb 3 03:55:05 2007
+++ phpdoc/en/reference/phar/functions/Phar-compressAllFilesBZIP2.xml Sat Feb
3 04:03:09 2007
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.2 $ -->
+<!-- $Revision: 1.3 $ -->
<refentry id="function.Phar-compressAllFilesBZIP2">
<refnamediv>
<refname>Phar->compressAllFilesBZIP2</refname>
@@ -43,7 +43,7 @@
<programlisting role="php">
<![CDATA[
<?php
-$p = new Phar('my.phar');
+$p = new Phar('/path/to/my.phar', 0, 'my.phar');
$p['myfile.txt'] = 'hi';
$p['myfile2.txt'] = 'hi';
foreach ($p as $file) {
http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/phar/functions/Phar-compressAllFilesGZ.xml?r1=1.2&r2=1.3&diff_format=u
Index: phpdoc/en/reference/phar/functions/Phar-compressAllFilesGZ.xml
diff -u phpdoc/en/reference/phar/functions/Phar-compressAllFilesGZ.xml:1.2
phpdoc/en/reference/phar/functions/Phar-compressAllFilesGZ.xml:1.3
--- phpdoc/en/reference/phar/functions/Phar-compressAllFilesGZ.xml:1.2 Sat Feb
3 03:55:05 2007
+++ phpdoc/en/reference/phar/functions/Phar-compressAllFilesGZ.xml Sat Feb
3 04:03:09 2007
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.2 $ -->
+<!-- $Revision: 1.3 $ -->
<refentry id="function.Phar-compressAllFilesGZ">
<refnamediv>
<refname>Phar->compressAllFilesGZ</refname>
@@ -43,7 +43,7 @@
<programlisting role="php">
<![CDATA[
<?php
-$p = new Phar('my.phar');
+$p = new Phar('/path/to/my.phar', 0, 'my.phar');
$p['myfile.txt'] = 'hi';
$p['myfile2.txt'] = 'hi';
foreach ($p as $file) {
http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/phar/functions/Phar-count.xml?r1=1.2&r2=1.3&diff_format=u
Index: phpdoc/en/reference/phar/functions/Phar-count.xml
diff -u phpdoc/en/reference/phar/functions/Phar-count.xml:1.2
phpdoc/en/reference/phar/functions/Phar-count.xml:1.3
--- phpdoc/en/reference/phar/functions/Phar-count.xml:1.2 Sun Jan 28
05:31:52 2007
+++ phpdoc/en/reference/phar/functions/Phar-count.xml Sat Feb 3 04:03:09 2007
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.2 $ -->
+<!-- $Revision: 1.3 $ -->
<refentry id="function.Phar-count">
<refnamediv>
<refname>Phar->count</refname>
@@ -42,7 +42,7 @@
// make sure it doesn't exist
@unlink('brandnewphar.phar');
try {
- $p = new Phar('brandnewphar.phar');
+ $p = new Phar(dirname(__FILE__) . '/brandnewphar.phar', 0,
'brandnewphar.phar');
} catch (Exception $e) {
echo 'Could not create phar:', $e;
}
http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/phar/functions/Phar-getMetaData.xml?r1=1.1&r2=1.2&diff_format=u
Index: phpdoc/en/reference/phar/functions/Phar-getMetaData.xml
diff -u phpdoc/en/reference/phar/functions/Phar-getMetaData.xml:1.1
phpdoc/en/reference/phar/functions/Phar-getMetaData.xml:1.2
--- phpdoc/en/reference/phar/functions/Phar-getMetaData.xml:1.1 Sun Jan 28
21:45:44 2007
+++ phpdoc/en/reference/phar/functions/Phar-getMetaData.xml Sat Feb 3
04:03:09 2007
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.1 $ -->
+<!-- $Revision: 1.2 $ -->
<refentry id="function.Phar-getMetaData">
<refnamediv>
<refname>Phar->getMetaData</refname>
@@ -42,7 +42,7 @@
// make sure it doesn't exist
@unlink('brandnewphar.phar');
try {
- $p = new Phar('brandnewphar.phar');
+ $p = new Phar(dirname(__FILE__) . '/brandnewphar.phar', 0,
'brandnewphar.phar');
} catch (Exception $e) {
echo 'Could not create phar:', $e;
}
http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/phar/functions/Phar-getStub.xml?r1=1.3&r2=1.4&diff_format=u
Index: phpdoc/en/reference/phar/functions/Phar-getStub.xml
diff -u phpdoc/en/reference/phar/functions/Phar-getStub.xml:1.3
phpdoc/en/reference/phar/functions/Phar-getStub.xml:1.4
--- phpdoc/en/reference/phar/functions/Phar-getStub.xml:1.3 Sun Jan 28
21:52:56 2007
+++ phpdoc/en/reference/phar/functions/Phar-getStub.xml Sat Feb 3 04:03:09 2007
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.3 $ -->
+<!-- $Revision: 1.4 $ -->
<refentry id="function.Phar-getStub">
<refnamediv>
<refname>Phar->getStub</refname>
@@ -35,6 +35,14 @@
</para>
</refsect1>
+ <refsect1 role="errors">
+ &reftitle.errors;
+ <para>
+ Throws <classname>RuntimeException</classname> if it is not possible to read
+ the stub from the Phar archive.
+ </para>
+ </refsect1>
+
<refsect1 role="examples">
&reftitle.examples;
<para>
@@ -42,10 +50,10 @@
<title>A <function>Phar->getStub</function> example</title>
<programlisting role="php">
<![CDATA[
-$p = new Phar('myphar.phar');
+$p = new Phar('/path/to/my.phar', 0, 'my.phar');
echo $p->getStub();
echo "==NEXT==\n";
-$p->commitWrite("<?php
+$p->setStub("<?php
function __autoload($class)
{
include 'phar://' . str_replace('_', '/', $class);
@@ -79,8 +87,7 @@
&reftitle.seealso;
<para>
<simplelist>
- <member><link
linkend="function.Phar-commit"><function>Phar->commit</function></link></member>
- <member><link
linkend="function.Phar-begin"><function>Phar->begin</function></link></member>
+ <member><link
linkend="function.Phar-setStub"><function>Phar->setStub</function></link></member>
</simplelist>
</para>
</refsect1>
http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/phar/functions/Phar-loadPhar.xml?r1=1.3&r2=1.4&diff_format=u
Index: phpdoc/en/reference/phar/functions/Phar-loadPhar.xml
diff -u phpdoc/en/reference/phar/functions/Phar-loadPhar.xml:1.3
phpdoc/en/reference/phar/functions/Phar-loadPhar.xml:1.4
--- phpdoc/en/reference/phar/functions/Phar-loadPhar.xml:1.3 Thu Jan 18
08:49:59 2007
+++ phpdoc/en/reference/phar/functions/Phar-loadPhar.xml Sat Feb 3
04:03:09 2007
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.3 $ -->
+<!-- $Revision: 1.4 $ -->
<refentry id="function.Phar-loadPhar">
<refnamediv>
<refname>Phar::loadPhar</refname>
@@ -38,7 +38,7 @@
<para>
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
+ phar archive, and a <classname>PharException</classname> will be thrown
if
a new alias is specified in this case.
</para>
</listitem>
@@ -56,7 +56,7 @@
<refsect1 role="errors">
&reftitle.errors;
<para>
- E_RECOVERABLE_ERROR is thrown if an alias is passed in and the phar archive
+ <classname>PharException</classname> is thrown if an alias is passed in and
the phar archive
already has an explicit alias
</para>
</refsect1>
@@ -67,14 +67,18 @@
<example>
<title>A <function>Phar::loadPhar</function> example</title>
<para>
- loadPhar can be used anywhere to load an external Phar archive, whereas
- mapPhar should be used in a loader stub for a Phar.
+ Phar::loadPhar can be used anywhere to load an external Phar archive,
whereas
+ Phar::mapPhar should be used in a loader stub for a Phar.
</para>
<programlisting role="php">
<![CDATA[
<?php
-Phar::loadPhar('/path/to/phar.phar', 'my.phar');
-echo file_get_contents('phar://my.phar/file.txt');
+try {
+ Phar::loadPhar('/path/to/phar.phar', 'my.phar');
+ echo file_get_contents('phar://my.phar/file.txt');
+} catch (PharException $e) {
+ echo $e;
+}
?>
]]>
</programlisting>
http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/phar/functions/Phar-mapPhar.xml?r1=1.4&r2=1.5&diff_format=u
Index: phpdoc/en/reference/phar/functions/Phar-mapPhar.xml
diff -u phpdoc/en/reference/phar/functions/Phar-mapPhar.xml:1.4
phpdoc/en/reference/phar/functions/Phar-mapPhar.xml:1.5
--- phpdoc/en/reference/phar/functions/Phar-mapPhar.xml:1.4 Sun Jan 28
21:52:56 2007
+++ phpdoc/en/reference/phar/functions/Phar-mapPhar.xml Sat Feb 3 04:03:09 2007
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.4 $ -->
+<!-- $Revision: 1.5 $ -->
<refentry id="function.Phar-mapPhar">
<refnamediv>
<refname>Phar::mapPhar</refname>
@@ -43,7 +43,7 @@
<refsect1 role="errors">
&reftitle.errors;
<para>
- E_RECOVERABLE_ERROR is thrown if not called directly within PHP execution,
+ <classname>PharException</classname> 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.
</para>
@@ -68,8 +68,13 @@
{
include 'phar://' . str_replace('_', '/', $class);
}
-Phar::mapPhar('me.phar');
-include 'phar://me.phar/startup.php';
+try {
+ Phar::mapPhar('me.phar');
+ include 'phar://me.phar/startup.php';
+} catch (PharException $e) {
+ echo $e->getMessage();
+ die('Cannot initialize Phar');
+}
__HALT_COMPILER();
]]>
</programlisting>
http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/phar/functions/Phar-offsetExists.xml?r1=1.2&r2=1.3&diff_format=u
Index: phpdoc/en/reference/phar/functions/Phar-offsetExists.xml
diff -u phpdoc/en/reference/phar/functions/Phar-offsetExists.xml:1.2
phpdoc/en/reference/phar/functions/Phar-offsetExists.xml:1.3
--- phpdoc/en/reference/phar/functions/Phar-offsetExists.xml:1.2 Thu Jan
18 08:45:26 2007
+++ phpdoc/en/reference/phar/functions/Phar-offsetExists.xml Sat Feb 3
04:03:09 2007
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.2 $ -->
+<!-- $Revision: 1.3 $ -->
<refentry id="function.Phar-offsetExists">
<refnamediv>
<refname>Phar::offsetExists</refname>
@@ -52,7 +52,7 @@
<programlisting role="php">
<![CDATA[
<?php
-$p = new Phar('my.phar');
+$p = new Phar(dirname(__FILE__) . '/my.phar', 0, 'my.phar');
$p['firstfile.txt'] = 'first file';
$p['secondfile.txt'] = 'second file';
// the next set of lines call offsetExists() indirectly
http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/phar/functions/Phar-offsetGet.xml?r1=1.2&r2=1.3&diff_format=u
Index: phpdoc/en/reference/phar/functions/Phar-offsetGet.xml
diff -u phpdoc/en/reference/phar/functions/Phar-offsetGet.xml:1.2
phpdoc/en/reference/phar/functions/Phar-offsetGet.xml:1.3
--- phpdoc/en/reference/phar/functions/Phar-offsetGet.xml:1.2 Thu Jan 18
08:49:59 2007
+++ phpdoc/en/reference/phar/functions/Phar-offsetGet.xml Sat Feb 3
04:03:09 2007
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.2 $ -->
+<!-- $Revision: 1.3 $ -->
<refentry id="function.Phar-offsetGet">
<refnamediv>
<refname>Phar::offsetGet</refname>
@@ -64,7 +64,7 @@
<programlisting role="php">
<![CDATA[
<?php
-$p = new Phar('myphar.phar');
+$p = new Phar(dirname(__FILE__) . '/myphar.phar', 0, 'myphar.phar');
$p['exists.txt'] = "file exists\n";
try {
// automatically calls offsetGet()
http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/phar/functions/Phar-offsetSet.xml?r1=1.3&r2=1.4&diff_format=u
Index: phpdoc/en/reference/phar/functions/Phar-offsetSet.xml
diff -u phpdoc/en/reference/phar/functions/Phar-offsetSet.xml:1.3
phpdoc/en/reference/phar/functions/Phar-offsetSet.xml:1.4
--- phpdoc/en/reference/phar/functions/Phar-offsetSet.xml:1.3 Thu Jan 18
08:49:59 2007
+++ phpdoc/en/reference/phar/functions/Phar-offsetSet.xml Sat Feb 3
04:03:09 2007
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.3 $ -->
+<!-- $Revision: 1.4 $ -->
<refentry id="function.Phar-offsetSet">
<refnamediv>
<refname>Phar::offsetSet</refname>
@@ -56,7 +56,9 @@
<para>
if <link linkend="ini.phar.readonly">phar.readonly</link> is
<literal>1</literal>,
<classname>BadMethodCallException</classname> is thrown, as modifying a Phar
- is only allowed when phar.readonly is set to <literal>0</literal>.
+ is only allowed when phar.readonly is set to <literal>0</literal>. Throws
+ <classname>PharException</classname> if there are any problems flushing
+ changes made to the Phar archive to disk.
</para>
</refsect1>
http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/phar/functions/Phar-offsetUnset.xml?r1=1.3&r2=1.4&diff_format=u
Index: phpdoc/en/reference/phar/functions/Phar-offsetUnset.xml
diff -u phpdoc/en/reference/phar/functions/Phar-offsetUnset.xml:1.3
phpdoc/en/reference/phar/functions/Phar-offsetUnset.xml:1.4
--- phpdoc/en/reference/phar/functions/Phar-offsetUnset.xml:1.3 Thu Jan 18
08:49:59 2007
+++ phpdoc/en/reference/phar/functions/Phar-offsetUnset.xml Sat Feb 3
04:03:09 2007
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.3 $ -->
+<!-- $Revision: 1.4 $ -->
<refentry id="function.Phar-offsetUnset">
<refnamediv>
<refname>Phar::offsetUnset</refname>
@@ -50,7 +50,9 @@
<para>
if <link linkend="ini.phar.readonly">phar.readonly</link> is
<literal>1</literal>,
<classname>BadMethodCallException</classname> is thrown, as modifying a Phar
- is only allowed when phar.readonly is set to <literal>0</literal>.
+ is only allowed when phar.readonly is set to <literal>0</literal>. Throws
+ <classname>PharException</classname> if there are any problems flushing
+ changes made to the Phar archive to disk.
</para>
</refsect1>
http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/phar/functions/Phar-setMetaData.xml?r1=1.1&r2=1.2&diff_format=u
Index: phpdoc/en/reference/phar/functions/Phar-setMetaData.xml
diff -u phpdoc/en/reference/phar/functions/Phar-setMetaData.xml:1.1
phpdoc/en/reference/phar/functions/Phar-setMetaData.xml:1.2
--- phpdoc/en/reference/phar/functions/Phar-setMetaData.xml:1.1 Sun Jan 28
21:45:44 2007
+++ phpdoc/en/reference/phar/functions/Phar-setMetaData.xml Sat Feb 3
04:03:09 2007
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.1 $ -->
+<!-- $Revision: 1.2 $ -->
<refentry id="function.Phar-setMetaData">
<refnamediv>
<refname>Phar->setMetaData</refname>
@@ -60,7 +60,7 @@
// make sure it doesn't exist
@unlink('brandnewphar.phar');
try {
- $p = new Phar('brandnewphar.phar');
+ $p = new Phar(dirname(__FILE__) . '/brandnewphar.phar', 0,
'brandnewphar.phar');
} catch (Exception $e) {
echo 'Could not create phar:', $e;
}
http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/phar/functions/Phar-uncompressAllFiles.xml?r1=1.2&r2=1.3&diff_format=u
Index: phpdoc/en/reference/phar/functions/Phar-uncompressAllFiles.xml
diff -u phpdoc/en/reference/phar/functions/Phar-uncompressAllFiles.xml:1.2
phpdoc/en/reference/phar/functions/Phar-uncompressAllFiles.xml:1.3
--- phpdoc/en/reference/phar/functions/Phar-uncompressAllFiles.xml:1.2 Sat Feb
3 03:55:05 2007
+++ phpdoc/en/reference/phar/functions/Phar-uncompressAllFiles.xml Sat Feb
3 04:03:09 2007
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.2 $ -->
+<!-- $Revision: 1.3 $ -->
<refentry id="function.Phar-uncompressAllFiles">
<refnamediv>
<refname>Phar->uncompressAllFiles</refname>
@@ -45,7 +45,7 @@
<programlisting role="php">
<![CDATA[
<?php
-$p = new Phar('my.phar');
+$p = new Phar('/path/to/my.phar', 0, 'my.phar');
$p['myfile.txt'] = 'hi';
$p['myfile2.txt'] = 'hi';
$p->compressAllFilesGZ();
http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/phar/functions/PharFileInfo-getCRC32.xml?r1=1.2&r2=1.3&diff_format=u
Index: phpdoc/en/reference/phar/functions/PharFileInfo-getCRC32.xml
diff -u phpdoc/en/reference/phar/functions/PharFileInfo-getCRC32.xml:1.2
phpdoc/en/reference/phar/functions/PharFileInfo-getCRC32.xml:1.3
--- phpdoc/en/reference/phar/functions/PharFileInfo-getCRC32.xml:1.2 Thu Jan
18 08:49:59 2007
+++ phpdoc/en/reference/phar/functions/PharFileInfo-getCRC32.xml Sat Feb
3 04:03:09 2007
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.2 $ -->
+<!-- $Revision: 1.3 $ -->
<refentry id="function.PharFileInfo-getCRC32">
<refnamediv>
<refname>PharFileInfo->getCRC32</refname>
@@ -25,6 +25,15 @@
</para>
</refsect1>
+ <refsect1 role="errors">
+ &reftitle.errors;
+ <para>
+ Throws <classname>BadMethodCallException</classname> if the file has not
+ yet had its CRC32 verified. This should be impossible with normal use, as
+ the CRC is verified upon opening the file for reading or writing.
+ </para>
+ </refsect1>
+
<refsect1 role="examples">
&reftitle.examples;
<para>
@@ -35,7 +44,7 @@
<programlisting role="php">
<![CDATA[
<?php
-$p = new Phar('my.phar');
+$p = new Phar('/path/to/my.phar', 0, 'my.phar');
$p['myfile.txt'] = 'hi';
$file = $p['myfile.txt'];
echo $file->getCRC32();
http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/phar/functions/PharFileInfo-getCompressedSize.xml?r1=1.2&r2=1.3&diff_format=u
Index: phpdoc/en/reference/phar/functions/PharFileInfo-getCompressedSize.xml
diff -u
phpdoc/en/reference/phar/functions/PharFileInfo-getCompressedSize.xml:1.2
phpdoc/en/reference/phar/functions/PharFileInfo-getCompressedSize.xml:1.3
--- phpdoc/en/reference/phar/functions/PharFileInfo-getCompressedSize.xml:1.2
Thu Jan 18 08:49:59 2007
+++ phpdoc/en/reference/phar/functions/PharFileInfo-getCompressedSize.xml
Sat Feb 3 04:03:09 2007
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.2 $ -->
+<!-- $Revision: 1.3 $ -->
<refentry id="function.PharFileInfo-getCompressedSize">
<refnamediv>
<refname>PharFileInfo->getCompressedSize</refname>
@@ -33,7 +33,7 @@
<programlisting role="php">
<![CDATA[
<?php
-$p = new Phar('my.phar');
+$p = new Phar('/path/to/my.phar', 0, 'my.phar');
$p['myfile.txt'] = 'hi';
$file = $p['myfile.txt'];
echo $file->getCompressedSize();
http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/phar/functions/PharFileInfo-getMetaData.xml?r1=1.1&r2=1.2&diff_format=u
Index: phpdoc/en/reference/phar/functions/PharFileInfo-getMetaData.xml
diff -u phpdoc/en/reference/phar/functions/PharFileInfo-getMetaData.xml:1.1
phpdoc/en/reference/phar/functions/PharFileInfo-getMetaData.xml:1.2
--- phpdoc/en/reference/phar/functions/PharFileInfo-getMetaData.xml:1.1 Sun Jan
28 05:31:52 2007
+++ phpdoc/en/reference/phar/functions/PharFileInfo-getMetaData.xml Sat Feb
3 04:03:09 2007
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.1 $ -->
+<!-- $Revision: 1.2 $ -->
<refentry id="function.PharFileInfo-getMetaData">
<refnamediv>
<refname>PharFileInfo->getMetaData</refname>
@@ -42,7 +42,7 @@
// make sure it doesn't exist
@unlink('brandnewphar.phar');
try {
- $p = new Phar('brandnewphar.phar');
+ $p = new Phar(dirname(__FILE__) . '/brandnewphar.phar', 0,
'brandnewphar.phar');
} catch (Exception $e) {
echo 'Could not create phar:', $e;
}
http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/phar/functions/PharFileInfo-getPharFlags.xml?r1=1.2&r2=1.3&diff_format=u
Index: phpdoc/en/reference/phar/functions/PharFileInfo-getPharFlags.xml
diff -u phpdoc/en/reference/phar/functions/PharFileInfo-getPharFlags.xml:1.2
phpdoc/en/reference/phar/functions/PharFileInfo-getPharFlags.xml:1.3
--- phpdoc/en/reference/phar/functions/PharFileInfo-getPharFlags.xml:1.2
Thu Jan 18 08:49:59 2007
+++ phpdoc/en/reference/phar/functions/PharFileInfo-getPharFlags.xml Sat Feb
3 04:03:09 2007
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.2 $ -->
+<!-- $Revision: 1.3 $ -->
<refentry id="function.PharFileInfo-getPharFlags">
<refnamediv>
<refname>PharFileInfo->getPharFlags</refname>
@@ -32,7 +32,7 @@
<programlisting role="php">
<![CDATA[
<?php
-$p = new Phar('my.phar');
+$p = new Phar('/path/to/my.phar', 0, 'my.phar');
$p['myfile.txt'] = 'hi';
$file = $p['myfile.txt'];
var_dump($file->getPharFlags());
http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/phar/functions/PharFileInfo-isCRCChecked.xml?r1=1.2&r2=1.3&diff_format=u
Index: phpdoc/en/reference/phar/functions/PharFileInfo-isCRCChecked.xml
diff -u phpdoc/en/reference/phar/functions/PharFileInfo-isCRCChecked.xml:1.2
phpdoc/en/reference/phar/functions/PharFileInfo-isCRCChecked.xml:1.3
--- phpdoc/en/reference/phar/functions/PharFileInfo-isCRCChecked.xml:1.2
Thu Jan 18 08:45:26 2007
+++ phpdoc/en/reference/phar/functions/PharFileInfo-isCRCChecked.xml Sat Feb
3 04:03:09 2007
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.2 $ -->
+<!-- $Revision: 1.3 $ -->
<refentry id="function.PharFileInfo-isCRCChecked">
<refnamediv>
<refname>PharFileInfo::isCRCChecked</refname>
@@ -33,7 +33,7 @@
<programlisting role="php">
<![CDATA[
<?php
-$p = new Phar('my.phar');
+$p = new Phar('/path/to/my.phar', 0, 'my.phar');
$p['myfile.txt'] = 'hi';
$file = $p['myfile.txt'];
var_dump($file->isCRCChecked());
http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/phar/functions/PharFileInfo-isCompressed.xml?r1=1.1&r2=1.2&diff_format=u
Index: phpdoc/en/reference/phar/functions/PharFileInfo-isCompressed.xml
diff -u phpdoc/en/reference/phar/functions/PharFileInfo-isCompressed.xml:1.1
phpdoc/en/reference/phar/functions/PharFileInfo-isCompressed.xml:1.2
--- phpdoc/en/reference/phar/functions/PharFileInfo-isCompressed.xml:1.1
Thu Jan 18 00:24:34 2007
+++ phpdoc/en/reference/phar/functions/PharFileInfo-isCompressed.xml Sat Feb
3 04:03:09 2007
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.1 $ -->
+<!-- $Revision: 1.2 $ -->
<refentry id="function.PharFileInfo-isCompressed">
<refnamediv>
<refname>PharFileInfo->isCompressed</refname>
@@ -33,7 +33,7 @@
<programlisting role="php">
<![CDATA[
<?php
-$p = new Phar('my.phar');
+$p = new Phar('/path/to/my.phar', 0, 'my.phar');
$p['myfile.txt'] = 'hi';
$file = $p['myfile.txt'];
var_dump($file->isCompressed());
http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/phar/functions/PharFileInfo-isCompressedBZIP2.xml?r1=1.1&r2=1.2&diff_format=u
Index: phpdoc/en/reference/phar/functions/PharFileInfo-isCompressedBZIP2.xml
diff -u
phpdoc/en/reference/phar/functions/PharFileInfo-isCompressedBZIP2.xml:1.1
phpdoc/en/reference/phar/functions/PharFileInfo-isCompressedBZIP2.xml:1.2
--- phpdoc/en/reference/phar/functions/PharFileInfo-isCompressedBZIP2.xml:1.1
Thu Jan 18 00:24:34 2007
+++ phpdoc/en/reference/phar/functions/PharFileInfo-isCompressedBZIP2.xml
Sat Feb 3 04:03:09 2007
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.1 $ -->
+<!-- $Revision: 1.2 $ -->
<refentry id="function.PharFileInfo-isCompressedBZIP2">
<refnamediv>
<refname>PharFileInfo->isCompressedBZIP2</refname>
@@ -33,7 +33,7 @@
<programlisting role="php">
<![CDATA[
<?php
-$p = new Phar('my.phar');
+$p = new Phar('/path/to/my.phar', 0, 'my.phar');
$p['myfile.txt'] = 'hi';
$file = $p['myfile.txt'];
var_dump($file->isCompressedBZIP2());
http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/phar/functions/PharFileInfo-isCompressedGZ.xml?r1=1.1&r2=1.2&diff_format=u
Index: phpdoc/en/reference/phar/functions/PharFileInfo-isCompressedGZ.xml
diff -u phpdoc/en/reference/phar/functions/PharFileInfo-isCompressedGZ.xml:1.1
phpdoc/en/reference/phar/functions/PharFileInfo-isCompressedGZ.xml:1.2
--- phpdoc/en/reference/phar/functions/PharFileInfo-isCompressedGZ.xml:1.1
Thu Jan 18 00:24:34 2007
+++ phpdoc/en/reference/phar/functions/PharFileInfo-isCompressedGZ.xml Sat Feb
3 04:03:09 2007
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.1 $ -->
+<!-- $Revision: 1.2 $ -->
<refentry id="function.PharFileInfo-isCompressedGZ">
<refnamediv>
<refname>PharFileInfo->isCompressedGZ</refname>
@@ -33,7 +33,7 @@
<programlisting role="php">
<![CDATA[
<?php
-$p = new Phar('my.phar');
+$p = new Phar('/path/to/my.phar', 0, 'my.phar');
$p['myfile.txt'] = 'hi';
$file = $p['myfile.txt'];
var_dump($file->isCompressedGZ());
http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/phar/functions/PharFileInfo-setCompressedBZIP2.xml?r1=1.2&r2=1.3&diff_format=u
Index: phpdoc/en/reference/phar/functions/PharFileInfo-setCompressedBZIP2.xml
diff -u
phpdoc/en/reference/phar/functions/PharFileInfo-setCompressedBZIP2.xml:1.2
phpdoc/en/reference/phar/functions/PharFileInfo-setCompressedBZIP2.xml:1.3
--- phpdoc/en/reference/phar/functions/PharFileInfo-setCompressedBZIP2.xml:1.2
Sun Jan 28 20:08:52 2007
+++ phpdoc/en/reference/phar/functions/PharFileInfo-setCompressedBZIP2.xml
Sat Feb 3 04:03:09 2007
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.2 $ -->
+<!-- $Revision: 1.3 $ -->
<refentry id="function.PharFileInfo-setCompressedBZIP2">
<refnamediv>
<refname>PharFileInfo->setCompressedBZIP2</refname>
@@ -41,7 +41,7 @@
<programlisting role="php">
<![CDATA[
<?php
-$p = new Phar('my.phar');
+$p = new Phar('/path/to/my.phar', 0, 'my.phar');
$p['myfile.txt'] = 'hi';
$file = $p['myfile.txt'];
var_dump($file->isCompressedBZIP2());
http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/phar/functions/PharFileInfo-setCompressedGZ.xml?r1=1.2&r2=1.3&diff_format=u
Index: phpdoc/en/reference/phar/functions/PharFileInfo-setCompressedGZ.xml
diff -u phpdoc/en/reference/phar/functions/PharFileInfo-setCompressedGZ.xml:1.2
phpdoc/en/reference/phar/functions/PharFileInfo-setCompressedGZ.xml:1.3
--- phpdoc/en/reference/phar/functions/PharFileInfo-setCompressedGZ.xml:1.2
Sun Jan 28 20:08:52 2007
+++ phpdoc/en/reference/phar/functions/PharFileInfo-setCompressedGZ.xml Sat Feb
3 04:03:09 2007
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.2 $ -->
+<!-- $Revision: 1.3 $ -->
<refentry id="function.PharFileInfo-setCompressedGZ">
<refnamediv>
<refname>PharFileInfo->setCompressedGZ</refname>
@@ -41,7 +41,7 @@
<programlisting role="php">
<![CDATA[
<?php
-$p = new Phar('my.phar');
+$p = new Phar('/path/to/my.phar', 0, 'my.phar');
$p['myfile.txt'] = 'hi';
$file = $p['myfile.txt'];
var_dump($file->isCompressedGZ());
http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/phar/functions/PharFileInfo-setMetaData.xml?r1=1.1&r2=1.2&diff_format=u
Index: phpdoc/en/reference/phar/functions/PharFileInfo-setMetaData.xml
diff -u phpdoc/en/reference/phar/functions/PharFileInfo-setMetaData.xml:1.1
phpdoc/en/reference/phar/functions/PharFileInfo-setMetaData.xml:1.2
--- phpdoc/en/reference/phar/functions/PharFileInfo-setMetaData.xml:1.1 Sun Jan
28 05:31:52 2007
+++ phpdoc/en/reference/phar/functions/PharFileInfo-setMetaData.xml Sat Feb
3 04:03:09 2007
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.1 $ -->
+<!-- $Revision: 1.2 $ -->
<refentry id="function.PharFileInfo-setMetaData">
<refnamediv>
<refname>PharFileInfo->getMetaData</refname>
@@ -61,7 +61,7 @@
// make sure it doesn't exist
@unlink('brandnewphar.phar');
try {
- $p = new Phar('brandnewphar.phar');
+ $p = new Phar(dirname(__FILE__) . '/brandnewphar.phar', 0,
'brandnewphar.phar');
} catch (Exception $e) {
echo 'Could not create phar:', $e;
}
http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/phar/functions/PharFileInfo-setUncompressed.xml?r1=1.2&r2=1.3&diff_format=u
Index: phpdoc/en/reference/phar/functions/PharFileInfo-setUncompressed.xml
diff -u phpdoc/en/reference/phar/functions/PharFileInfo-setUncompressed.xml:1.2
phpdoc/en/reference/phar/functions/PharFileInfo-setUncompressed.xml:1.3
--- phpdoc/en/reference/phar/functions/PharFileInfo-setUncompressed.xml:1.2
Sun Jan 28 20:08:52 2007
+++ phpdoc/en/reference/phar/functions/PharFileInfo-setUncompressed.xml Sat Feb
3 04:03:09 2007
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.2 $ -->
+<!-- $Revision: 1.3 $ -->
<refentry id="function.PharFileInfo-setUncompressed">
<refnamediv>
<refname>PharFileInfo->setUncompressed</refname>
@@ -40,7 +40,7 @@
<programlisting role="php">
<![CDATA[
<?php
-$p = new Phar('my.phar');
+$p = new Phar('/path/to/my.phar', 0, 'my.phar');
$p['myfile.txt'] = 'hi';
$file = $p['myfile.txt'];
$file->setCompressedGZ();
http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/phar/functions/Phar-apiVersion.xml?view=markup&rev=1.1
Index: phpdoc/en/reference/phar/functions/Phar-apiVersion.xml
+++ phpdoc/en/reference/phar/functions/Phar-apiVersion.xml
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.1 $ -->
<refentry id="function.Phar-apiVersion">
<refnamediv>
<refname>Phar::apiVersion</refname>
<refpurpose>Returns the api version</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>string</type><methodname>Phar::apiVersion</methodname>
<void/>
</methodsynopsis>
<para>
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.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
The API version string as in <literal>"1.0.0"</literal>.
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title>A <function>Phar::apiVersion</function> example</title>
<programlisting role="php">
<![CDATA[
<?php
echo Phar::apiVersion();
?>
]]>
</programlisting>
&example.outputs;
<screen>
<![CDATA[
1.0.0
]]>
</screen>
</example>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->
http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/phar/functions/Phar-canCompress.xml?view=markup&rev=1.1
Index: phpdoc/en/reference/phar/functions/Phar-canCompress.xml
+++ phpdoc/en/reference/phar/functions/Phar-canCompress.xml
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.1 $ -->
<refentry id="function.Phar-canCompress">
<refnamediv>
<refname>Phar::canCompress</refname>
<refpurpose>Returns whether phar extension supports compression using either
zlib or bzip2</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>bool</type><methodname>Phar::canCompress</methodname>
<void/>
</methodsynopsis>
<para>
This should be used to test whether compression is possible prior to
loading a phar archive containing compressed files.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
&true; if compression/decompression is available, &false; if not.
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title>A <function>Phar::canCompress</function> example</title>
<programlisting role="php">
<![CDATA[
<?php
if (Phar::canCompress()) {
echo file_get_contents('phar://whatever.phar/internal/file.txt');
} else {
echo 'no compression available';
}
?>
]]>
</programlisting>
</example>
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>PharFileInfo::isCompressed</function></member>
</simplelist>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->
http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/phar/functions/Phar-canWrite.xml?view=markup&rev=1.1
Index: phpdoc/en/reference/phar/functions/Phar-canWrite.xml
+++ phpdoc/en/reference/phar/functions/Phar-canWrite.xml
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.1 $ -->
<refentry id="function.Phar-canWrite">
<refnamediv>
<refname>Phar::canWrite</refname>
<refpurpose>Returns whether phar extension supports writing and creating
phars</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>bool</type><methodname>Phar::canWrite</methodname>
<void/>
</methodsynopsis>
<para>
This method determines whether write access has been disabled in
the system php.ini via the <link
linkend="ini.phar.readonly">phar.readonly</link>
ini variable.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
&true; if write access is enabled, &false; if it is disabled.
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title>A <function>Phar::canWrite</function> example</title>
<programlisting role="php">
<![CDATA[
<?php
if (Phar::canWrite()) {
file_put_contents('phar://myphar.phar/file.txt', 'hi there');
}
?>
]]>
</programlisting>
</example>
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><link linkend="ini.phar.readonly">phar.readonly</link></member>
</simplelist>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->
http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/phar/functions/Phar-isFlushingToPhar.xml?view=markup&rev=1.1
Index: phpdoc/en/reference/phar/functions/Phar-isFlushingToPhar.xml
+++ phpdoc/en/reference/phar/functions/Phar-isFlushingToPhar.xml
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.1 $ -->
<refentry id="function.Phar-isFlushingToPhar">
<refnamediv>
<refname>Phar->isFlushingToPhar</refname>
<refpurpose>Used to determine whether a Phar creation transaction is
active</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>void</type><methodname>Phar->isFlushingToPhar</methodname>
<void/>
</methodsynopsis>
<para>
This method can be used to determine whether a Phar will save changes
to disk immediately, or whether a call to
<function>Phar->commit</function>
is needed to enable saving changes.
</para>
<para>
Phar transactions are per-archive, a transaction active on the
<literal>foo.phar</literal> Phar archive does not affect changes
to the <literal>bar.phar</literal> Phar archive.
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title>A <function>Phar->isFlushingToPhar</function> example</title>
<para>
</para>
<programlisting role="php">
<![CDATA[
<?php
$p = new Phar(dirname(__FILE__) . '/brandnewphar.phar', 0, 'brandnewphar.phar');
$p['file1.txt'] = 'hi';
var_dump($p->isFlushingToPhar());
$p->begin();
var_dump($p->isFlushingToPhar());
$p->commit();
var_dump($p->isFlushingToPhar());
?>
]]>
</programlisting>
&example.outputs;
<screen>
<![CDATA[
bool(true)
bool(false)
bool(true)
]]>
</screen>
</example>
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><link
linkend="function.Phar-begin"><function>Phar->begin</function></link></member>
<member><link
linkend="function.Phar-commit"><function>Phar->commit</function></link></member>
</simplelist>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->
http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/phar/functions/Phar-setStub.xml?view=markup&rev=1.1
Index: phpdoc/en/reference/phar/functions/Phar-setStub.xml
+++ phpdoc/en/reference/phar/functions/Phar-setStub.xml
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.1 $ -->
<refentry id="function.Phar-setStub">
<refnamediv>
<refname>Phar->setStub</refname>
<refpurpose>Used to set the PHP loader or bootstrap stub of a Phar
archive</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>void</type><methodname>Phar->setStub</methodname>
<void/>
</methodsynopsis>
<para>
This method is used to add a PHP bootstrap loader stub to a new Phar
archive, or
to replace the loader stub in an existing Phar archive.
</para>
<para>
The loader stub for a Phar archive is used whenever an archive is included
directly
as in this example:
</para>
<programlisting role="php">
<![CDATA[
<?php
include 'myphar.phar';
?>
]]>
</programlisting>
<para>
The loader is not accessed when including a file through the
<literal>phar</literal>
stream wrapper like so:
</para>
<programlisting role="php">
<![CDATA[
<?php
include 'phar://myphar.phar/somefile.php';
?>
]]>
</programlisting>
</refsect1>
<refsect1 role="errors">
&reftitle.errors;
<para>
<classname>UnexpectedValueException</classname> is thrown if
<link linkend="ini.phar.readonly">phar.readonly</link> is enabled
in php.ini.
<classname>PharException</classname> is thrown if any problems are
encountered
flushing changes to disk.
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title>A <function>Phar->setStub</function> example</title>
<para>
</para>
<programlisting role="php">
<![CDATA[
<?php
$p = new Phar(dirname(__FILE__) . '/brandnewphar.phar', 0, 'brandnewphar.phar');
$p['a.php'] = '<?php var_dump("Hello");';
$p->setStub('<?php var_dump("First"); Phar::mapPhar("brandnewphar.phar");
__HALT_COMPILER(); ?>');
include 'phar://brandnewphar.phar/a.php';
var_dump($p->getStub());
$p['b.php'] = '<?php var_dump("World");';
$p->setStub('<?php var_dump("Second"); Phar::mapPhar("brandnewphar.phar");
__HALT_COMPILER(); ?>');
include 'phar://brandnewphar.phar/b.php';
var_dump($p->getStub());
?>
]]>
</programlisting>
&example.outputs;
<screen>
<![CDATA[
string(5) "Hello"
string(82) "<?php var_dump("First"); Phar::mapPhar("brandnewphar.phar");
__HALT_COMPILER(); ?>"
string(5) "World"
string(83) "<?php var_dump("Second"); Phar::mapPhar("brandnewphar.phar");
__HALT_COMPILER(); ?>"
]]>
</screen>
</example>
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><link
linkend="function.Phar-getStub"><function>Phar->getStub</function></link></member>
</simplelist>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->