private function __construct() { $this->CAHCE = new SimpleDataCache(); $this->enabled = PsDefines::isProfilingEnabled(); $this->dirManager = DirManager::autogen('profilers'); if ($this->enabled) { PsShotdownSdk::registerDestructable($this, PsShotdownSdk::PsProfiler); } }
/** * Функция, выполняющая закрытие классов. * Должна быть именно public, иначе не будет вызвана! */ static final function _doShotdown() { PsCheck::arr(self::$DESTRUCTS); ksort(self::$DESTRUCTS); /* @var $inst Destructable */ foreach (self::$DESTRUCTS as $ord => $inst) { //Пишем в логгер до закрытия класса, так как логгер закрывается последним PsLogger::inst(__CLASS__)->info($ord . '. ' . get_class($inst) . ' - desctucted'); $inst->onDestruct(); } self::$DESTRUCTS = null; }
private function __construct() { $this->CACHE = new SimpleDataCache(); $this->emptyLogger = new PsLoggerEmpty(); /* * Вычислим признак включённости логирования. */ $this->enabled = PsDefines::isLoggingEnabled(); if ($this->enabled) { $this->writer = AbstractLogWriter::inst(PsDefines::getLoggingStream()); $this->writer->initAndWriteFirstLog(); PsShotdownSdk::registerDestructable($this, PsShotdownSdk::PsLogger); } }
protected function __construct() { $this->CACHE = new SimpleDataCache(); $this->LOGGER = PsLogger::inst(__CLASS__); if ($this->LOGGER->isEnabled()) { PsShotdownSdk::registerDestructable($this, PsShotdownSdk::FoldedResourcesManager); } }
protected function __construct() { $this->LOGGER = PsLogger::inst(__CLASS__); PsShotdownSdk::registerDestructable($this, PsShotdownSdk::PsLock); }