示例#1
0
文件: nxcesieas.php 项目: nxc/nxc_esi
 /** Restore an instance of this class to be the current instance.
  *
  * This should only be used if you <em>really</em> know what you're doing,
  * as it messes with the internals of this class, and is meant for internal
  * use only, to implement some functionality needed in the absence of ESI.
  * @param nxcESIEAS|null $instance The instance to restore as the current
  * instance, or null to reset the class so a new instance is created.
  * @return nxcESIEAS|null|false The previous instance of this class, or
  * null if no previous instance existed, or false on error.
  * A returned instance should be treated as an opaque handle, not used for
  * anything except later calls to this method, for internal state reasons.
  * @see instance()
  */
 public static function restoreInstance($instance)
 {
     if ($instance instanceof self) {
         $previousInstance = self::$instance;
         self::$instance = $instance;
         $instance->updateSurrogateControlHeader();
         if ($previousInstance instanceof self) {
             return $previousInstance;
         }
         return null;
     }
     return false;
 }