register_resource( self::$_resourceName, [ self::getInstance(), 'getTemplate', 'getTimestamp', 'getSecure', 'getTrusted', ] ); self::_assignVariables($data); $debug = Zend_Registry::get('debug'); $debug->setErrorReporting($debug->getErrorReporting() ^ E_NOTICE); $template = self::getObject()->fetch(self::$_resourceName . ':' . self::getTemplateName()); $debug->restoreErrorReporting(); return $template; } public function getTemplate($tpl_name, &$tpl_source, &$smarty_obj) { if (!file_exists(self::$_folder . self::$_template)) { throw new Qs_Exception('Template file not exists!'); } $tpl_source = file_get_contents(self::$_folder . self::$_template); return empty($tpl_source) ? false : true; } public static function getTemplateName() { return is_null(self::$_templateName) ? str_replace('/', '-', (string) self::$_template) : (string) self::$_templateName; } public function getTimestamp($tpl_name, &$tpl_timestamp, &$smarty_obj) { if (!file_exists(self::$_folder . self::$_template)) { throw new Qs_Exception('Template file not exists!'); } $tpl_timestamp = filemtime(self::$_folder . self::$_template); return true; } }