Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
Phar->isFlushingToPhar

Phar->isFlushingToPhar

(no version information, might be only in CVS)

Phar->isFlushingToPhar -- Used to determine whether a Phar creation transaction is active

Description

void Phar->isFlushingToPhar ( void )

This method can be used to determine whether a Phar will save changes to disk immediately, or whether a call to Phar->commit() is needed to enable saving changes.

Phar transactions are per-archive, a transaction active on the foo.phar Phar archive does not affect changes to the bar.phar Phar archive.

Examples

Example 1. A Phar->isFlushingToPhar() example

<?php
$p = new Phar(dirname(__FILE__) . '/brandnewphar.phar', 0, 'brandnewphar.phar');
$p2 = new Phar('existingphar.phar');
$p['file1.txt'] = 'hi';
var_dump($p->isFlushingToPhar());
var_dump($p2->isFlushingToPhar());
?>
=2=
<?php
$p->begin();
var_dump($p->isFlushingToPhar());
var_dump($p2->isFlushingToPhar());
$p->commit();
?>
=3=
<?php
var_dump($p->isFlushingToPhar());
var_dump($p2->isFlushingToPhar());
?>

The above example will output:

bool(true)
bool(true)
=2=
bool(false)
bool(true)
=3=
bool(true)
bool(true)

See Also

Phar->begin()
Phar->commit()