示例#1
0
 public function testAppendRollback()
 {
     fFilesystem::begin();
     $file = new fFile('output/fFile/one.txt');
     $file->append('+one=two');
     $this->assertEquals('one+one=two', file_get_contents('output/fFile/one.txt'));
     fFilesystem::rollback();
     $this->assertEquals('one', file_get_contents('output/fFile/one.txt'));
 }
示例#2
0
 /**
  * Rolls back a transaction, or decreases the level
  * 
  * @internal
  * 
  * @return void
  */
 public static function rollback()
 {
     // If the transaction was started by something else, don't even track it
     if (self::$transaction_level == 0) {
         return;
     }
     self::$transaction_level--;
     if (!self::$transaction_level) {
         fFilesystem::rollback();
     }
 }