/**
  * Dispose of the active write guard. You must call this method when you are
  * done with a write guard. You do not normally need to call this yourself.
  *
  * @return void
  * @task manage
  */
 public function dispose()
 {
     if ($this->allowDepth > 0) {
         throw new Exception("Imbalanced AphrontWriteGuard: more beginUnguardedWrites() calls than " . "endUnguardedWrites() calls.");
     }
     self::$instance = null;
 }
 /**
  * Dispose of the active write guard. You must call this method when you are
  * done with a write guard. You do not normally need to call this yourself.
  *
  * @return void
  * @task manage
  */
 public function dispose()
 {
     if (!self::$instance) {
         throw new Exception(pht('Attempting to dispose of write guard, but no write guard is active!'));
     }
     if ($this->allowDepth > 0) {
         throw new Exception(pht('Imbalanced %s: more % calls than %s calls.', __CLASS__, 'beginUnguardedWrites()', 'endUnguardedWrites()'));
     }
     self::$instance = null;
 }
Beispiel #3
0
 /**
  * This is used for clearing the write guard without performing any checks.
  * This is used in conjunction with phutil_exit for abrupt exits.
  *
  * @return void
  */
 public function disposeAbruptly()
 {
     self::$instance = null;
 }