public function read($id) { atsumi_Debug::startTimer('SESSION_READ'); $result = $this->cache->get($id, null, 'SESSION'); if (is_null($result)) { return ''; } atsumi_Debug::record('Session loaded from cache', sf('Session ID: %s', $id), $result, 'SESSION_READ', atsumi_Debug::AREA_SESSION, $result); return $result; }
/** * Constructor - Must use getInstance to get a session singalton object */ protected function __construct($options = array()) { // Start timer for constructor complete time atsumi_Debug::startTimer(); $this->configure($options); // Fetch the session storage handler $storage = isset($options['storage']) ? $options['storage'] : self::DEFAULT_STORAGE; if (is_subclass_of($storage, 'session_AbstractStorage')) { $this->storage = new $storage($options); } // Start the session $this->start($options); // Add debug information atsumi_Debug::record('Session Created', 'The atsumi session constructor completed', null, true, atsumi_Debug::AREA_SESSION); }
/** * Calls render on the processed controller * Note: process method must be execute before this method * @access public */ public function render() { // Time and execute the pre render atsumi_Debug::startTimer('app:controller:preRender'); $this->controller->publishFlashData(); $this->controller->preRender(); atsumi_Debug::record('Controller PreRender', 'Before rendering was processed the pre-render function was executed', null, 'app:controller:preRender'); $viewHandler = $this->controller->getViewHandler(); $view = $this->controller->getView(); if (!in_array('mvc_ViewHandlerInterface', class_implements($viewHandler))) { throw new Exception('View handler must implement mvc_ViewHandlerInterface'); } if (is_string($viewHandler)) { $viewHandler = new $viewHandler(); } if (is_null($view)) { throw new mvc_NoViewSpecifiedException('A view has not been declared', $this->parserData['method']); } // Get the debugger and start a timer for rendering atsumi_Debug::startTimer('app:controller:rendering'); $viewData = $this->controller->getViewData(); atsumi_Debug::setViewData($viewData); // Time and execute the view handler atsumi_Debug::startTimer('app:controller:render'); $viewHandler->render($view, $viewData); atsumi_Debug::record('Rendering', sf('Rendering was performed by the %s view handler', get_class($viewHandler)), null, 'app:controller:render'); // tell the debug to print if required as connection will be closed by __destruct atsumi_Debug::printIfRequired(); // Time and execute the post render atsumi_Debug::startTimer('app:controller:postRender'); $this->controller->postRender(); atsumi_Debug::record('Controller PostRender', 'After the rendering was processed the post-render function was executed', null, 'app:controller:postRender'); // Log the whole processing time atsumi_Debug::record('Rendering Complete', 'All rendering was completed successfully', null, 'app:controller:rendering'); }