Phar->isFlushingToPhar
(no version information, might be only in CVS)
Phar->isFlushingToPhar -- Used to determine whether a Phar creation transaction is active
Opis
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.
Przykłady
Przykład 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()); ?>
|
Powyższy przykład wyświetli: bool(true)
bool(true)
=2=
bool(false)
bool(true)
=3=
bool(true)
bool(true) |
|