Exemplo n.º 1
0
 /**
  * @return LBoxCacheLoader
  * @throws LBoxExceptionCache
  */
 public static function getInstance($fileName = "")
 {
     $className = __CLASS__;
     try {
         if (!self::$instance instanceof $className) {
             self::$instance = new $className();
         }
         return self::$instance;
     } catch (Exception $e) {
         throw $e;
     }
 }
Exemplo n.º 2
0
 /**
  * autosave - pohodlnejsi nez nutne volat store
  * @throws Exception
  */
 public function __destruct()
 {
     try {
         if (LBoxConfigManagerProperties::getPropertyContentByName("log_access") < 1) {
             return;
         }
         $this->params["queries"] = DbControl::getQueryCount() + 1;
         $this->params["time_execution"] = LBoxTimer::getInstance()->getTimeOfLife();
         $this->params["cache_read"] = LBoxCache::getInstance()->getFilesOpenedRead();
         $this->params["cache_write"] = LBoxCache::getInstance()->getFilesOpenedWrite();
         $this->params["memory"] = memory_get_peak_usage(true);
         $this->params["memory_limit"] = ini_get("memory_limit") * 1024 * 1024;
         $this->synchronized = false;
         $this->store();
     } catch (Exception $e) {
         throw $e;
     }
 }