Beispiel #1
0
 public static function onDestroy()
 {
     if (!Runtime::hasLock("auth")) {
         Runtime::removeLock("session");
     } else {
         Runtime::addLockCallback("auth", [get_called_class(), "onDestroy"]);
     }
 }
Beispiel #2
0
 public static function onDestroy()
 {
     if (static::$oConnection !== null) {
         if (!Runtime::hasLock("database")) {
             static::$oConnection->close();
         } else {
             Runtime::addLockCallback("database", [get_called_class(), "onDestroy"]);
         }
     }
 }
Beispiel #3
0
 public static function onDestroy()
 {
     if (Runtime::$SETTINGS->getString("CACHE_DRIVER") == "database") {
         if (!Runtime::hasLock("cache")) {
             Runtime::removeLock("database");
         } else {
             Runtime::addLockCallback("cache", [get_called_class(), "onDestroy"]);
         }
     }
 }
Beispiel #4
0
 /**
  * Callback for preparing output
  *
  * Used to allow page classes to give a final touch
  * on output before it is sent to the client.
  *
  * @ignore
  */
 public function onPrepareOutput()
 {
     if (!Runtime::hasLock("router")) {
         $controller = $this->getController();
         if ($controller !== null) {
             echo $controller->imOnPrepareOutput(ob_get_clean());
         } else {
             echo ob_get_clean();
         }
     } else {
         Runtime::addLockCallback("router", [$this, "onPrepareOutput"]);
     }
 }
Beispiel #5
0
 /** @ignore */
 public function writeBack()
 {
     if (!Runtime::hasLock("session")) {
         if ($this->mSessReady && !in_array(Runtime::$SYSTEM["REQUEST_CLIENT"], ["terminal", "crawler"])) {
             $data = serialize($this->mData);
             if (Runtime::$SETTINGS->getBoolean("SESSION_ENCRYPT_DATA")) {
                 $cryptKey = Runtime::$SETTINGS->getString("SECURITY_PASSWD");
                 if (!empty($cryptKey)) {
                     $data = Crypt::encrypt($data, $cryptKey, true);
                 }
             }
             $this->mSessHandler->write($data);
         }
         $this->mSessReady = false;
     } else {
         Runtime::addLockCallback("session", [$this, "writeBack"]);
     }
 }