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.

Exemples

Exemple 1. A Phar->isFlushingToPhar() example

<?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());
?>

L'exemple ci-dessus va afficher :

bool(true)
bool(false)
bool(true)

Voir aussi

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