Delicious Bookmark this on Delicious Share on Facebook SlashdotSlashdot It! Digg! Digg



PHP : Function Reference : Phar archive stream and classes : Phar->stopBuffering

Phar->stopBuffering

Stop buffering write requests to the Phar archive, and save changes to disk ()
void Phar->stopBuffering ( )

Example 1815. A Phar->stopBuffering() example

<?php
$p
= new Phar(dirname(__FILE__) . '/brandnewphar.phar', 0, 'brandnewphar.phar');
$p['file1.txt'] = 'hi';
$p->startBuffering();
var_dump($p->getStub());
$p->setStub("<?php
function __autoload(\$class)
{
   include 'phar://brandnewphar.phar/' . str_replace('_', '/', \$class) . '.php';
}
Phar::mapPhar('brandnewphar.phar');
include 'phar://brandnewphar.phar/startup.php';
__HALT_COMPILER();"
);
$p->stopBuffering();
var_dump($p->getStub());
?>

The above example will output:

string(24) "<?php __HALT_COMPILER();"
string(195) "<?php
function __autoload($class)
{
   include 'phar://' . str_replace('_', '/', $class);
}
Phar::mapPhar('brandnewphar.phar');
include 'phar://brandnewphar.phar/startup.php';
__HALT_COMPILER();"

Change Language


Follow Navioo On Twitter
Phar::apiVersion
Phar::canCompress
Phar::canWrite
Phar->compressAllFilesBZIP2
Phar->compressAllFilesGZ
Phar::__construct
Phar->count
Phar->getMetaData
Phar->getModified
Phar->getSignature
Phar->getStub
Phar->getVersion
Phar->isBuffering
Phar::loadPhar
Phar::mapPhar
Phar::offsetExists
Phar::offsetGet
Phar::offsetSet
Phar::offsetUnset
Phar->setMetaData
Phar->setStub
Phar->startBuffering
Phar->stopBuffering
Phar->uncompressAllFiles
PharFileInfo->chmod
PharFileInfo::__construct
PharFileInfo->getCompressedSize
PharFileInfo->getCRC32
PharFileInfo->getMetaData
PharFileInfo->getPharFlags
PharFileInfo->isCompressed
PharFileInfo->isCompressedBZIP2
PharFileInfo->isCompressedGZ
PharFileInfo->isCRCChecked
PharFileInfo->setCompressedBZIP2
PharFileInfo->setCompressedGZ
PharFileInfo->setMetaData
PharFileInfo->setUncompressed
eXTReMe Tracker