/** * @param string $Key * * @return mixed|false */ public function getValue($Key) { $this->Timing = Debugger::getTimeGap(); if (array_key_exists($this->Partition . $Key, self::$Memory)) { $Value = self::$Memory[$this->Partition . $Key]; self::$HitCount++; $this->Timing = number_format((Debugger::getTimeGap() - $this->Timing) * 1000, 3, ',', ''); return $Value; } self::$MissCount++; $this->Timing = number_format((Debugger::getTimeGap() - $this->Timing) * 1000, 3, ',', ''); return false; }
use SPHERE\System\Extension\Repository\Debugger; /** * Setup: Php */ header('Content-type: text/html; charset=utf-8'); error_reporting(E_ALL); ini_set('display_errors', 1); date_default_timezone_set('Europe/Berlin'); session_start(); session_write_close(); set_time_limit(240); ob_implicit_flush(); ini_set('memory_limit', '1024M'); /** * Setup: Loader */ require_once __DIR__ . '/Library/MOC-V/Core/AutoLoader/AutoLoader.php'; AutoLoader::getNamespaceAutoLoader('MOC\\V', __DIR__ . '/Library/MOC-V'); AutoLoader::getNamespaceAutoLoader('SPHERE', __DIR__ . '/', 'SPHERE'); $Main = new Main(); if (false) { (new Cache(new ApcSma()))->getCache()->clearCache(); (new Cache(new Apcu()))->getCache()->clearCache(); (new Cache(new ApcUser()))->getCache()->clearCache(); (new Cache(new Memcached()))->getCache()->clearCache(); (new Cache(new Memory()))->getCache()->clearCache(); (new Cache(new OpCache()))->getCache()->clearCache(); (new Cache(new TwigCache()))->getCache()->clearCache(); } Debugger::$Enabled = false; $Main->runPlatform();
/** * @param string $__METHOD__ * @param array|object $EntityList * @param array |string|int $Parameter * @param string $Timing */ private function debugCache($__METHOD__, $EntityList, $Parameter, $Timing) { if ($this->Debug) { Debugger::protocolDump('Cache: ' . $__METHOD__ . ' [' . implode('], [', (array) $Parameter) . '] Result: ' . ($EntityList ? 'Ok' : (null === $EntityList ? 'None' : 'Error')) . ' ~' . $Timing . 'ms'); } }
/** * @param string $Key * * @return mixed|false */ public function getValue($Key) { $this->Timing = Debugger::getTimeGap(); if (null !== self::$Server) { $Value = self::$Server->get($Key); // 0 = MEMCACHED_SUCCESS if (self::$Server->getResultCode() == 0) { $this->Timing = number_format((Debugger::getTimeGap() - $this->Timing) * 1000, 3, ',', ''); return $Value; } } $this->Timing = number_format((Debugger::getTimeGap() - $this->Timing) * 1000, 3, ',', ''); return false; }