/** * Constructor * * @access public * @return void */ public function __construct() { $this->_oMVCSession = \MVC\Registry::get('MVC_SESSION'); $this->_aRoutingCurrent = \MVC\Registry::get('MVC_ROUTING_CURRENT'); $this->_oStandardEventIndex = \Standard\Event\Index::getInstance(); $this->_oStandardModelIndex = new \Standard\Model\Index(); $this->oStandardViewIndex = new \Standard\View\Index(); // we want the Routing array assigned to the View for any request, so we assign it here $this->oStandardViewIndex->assign('aRouting', \MVC\Registry::get('MVC_ROUTING')); }
/** * Starts IDS with the Config * defined in /application/config/staging/{MVC_ENV}/ids.ini * * @return \IDS\Init $oIdsInit */ public static function init() { // By Binding to this Event you // could e.g. load a different config and save to Registry::set ('MVC_IDS_CONFIG', array([..])) Event::RUN('mvc.ids.init.before'); $oIdsInit = Init::init(Registry::get('MVC_IDS_CONFIG')); // By Binding to this Event you // could modify the loaded config; // The Config you could access by $oIdsInit->config Event::RUN('mvc.ids.init.after', $oIdsInit); return $oIdsInit; }
/** * set absolute Path to Smarty Template Dir and saves this into includePath * * @access public * @param string $sAbsolutePathToTemplateDir * @return void */ public function setAbsolutePathToTemplateDir($sAbsolutePathToTemplateDir = '') { if ($sAbsolutePathToTemplateDir === '') { $aQueryArray = \MVC\Request::getInstance()->getQueryArray(); array_key_exists(Registry::get('MVC_GET_PARAM_MODULE'), $aQueryArray['GET']) ? $sAbsolutePathToTemplateDir = realpath(\MVC\Registry::get('MVC_MODULES') . '/' . $aQueryArray['GET'][Registry::get('MVC_GET_PARAM_MODULE')] . '/templates/') : false; } if (is_dir($sAbsolutePathToTemplateDir)) { $aIncludePath = explode(PATH_SEPARATOR, get_include_path()); if (!in_array($sAbsolutePathToTemplateDir, $aIncludePath)) { $aIncludePath[] = $sAbsolutePathToTemplateDir; } $sImplodePaths = implode(PATH_SEPARATOR, $aIncludePath); set_include_path($sImplodePaths); } $this->setTemplateDir($sAbsolutePathToTemplateDir); }
/** * get cachefiles * * @access private * @return array $aCache */ private function getCaches() { $aCache = array(); $oObjects = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator(\MVC\Registry::get('MVC_CACHE_DIR'), 0), \RecursiveIteratorIterator::SELF_FIRST, 0); foreach ($oObjects as $sName => $oObject) { $sTmp = str_replace(\MVC\Registry::get('MVC_CACHE_DIR'), '', $sName); if ($sTmp != '.' && $sTmp != '..') { $aCache[] = $sTmp; } } return $aCache; }