Пример #1
0
 /**
  * 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'));
 }
Пример #2
0
 /**
  * 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;
 }
Пример #3
0
 /**
  * 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);
 }
Пример #4
0
 /**
  * dispose affected Variables
  * 
  * @param \IDS\Report $oIdsReport
  * @access public
  * @static
  */
 public static function dispose(\IDS\Report $oIdsReport)
 {
     $aName = array();
     $aDisposed = array();
     // get Name of Variables
     foreach ($oIdsReport->getIterator() as $oEvent) {
         $aName[] = $oEvent->getName();
     }
     // iterate infected and dispose those
     foreach ($aName as $sName) {
         // get Type and Key
         $aType = explode('.', $sName);
         $sType = isset($aType[0]) ? $aType[0] : '';
         $sKey = isset($aType[1]) ? $aType[1] : '';
         $aAffected = isset($GLOBALS['_' . $sType][$sKey]) ? $GLOBALS['_' . $sType][$sKey] : array();
         if (!empty($aAffected)) {
             if ('GET' == $sType) {
                 if (isset($_GET[$sKey])) {
                     $_GET[$sKey] = null;
                     unset($_GET[$sKey]);
                 }
             }
             if ('POST' == $sType) {
                 if (isset($_POST[$sKey])) {
                     $_POST[$sKey] = null;
                     unset($_POST[$sKey]);
                 }
             }
             if ('COOKIE' == $sType) {
                 if (isset($_COOKIE[$sKey])) {
                     $_COOKIE[$sKey] = null;
                     unset($_COOKIE[$sKey]);
                 }
             }
             $aDisposed[] = $sType . '[' . $sKey . ']';
             \MVC\Log::WRITE("INFO\tdisposed: " . $sType . '[' . $sKey . ']', 'ids.log');
             // overwrite
             $oRequest = Request::getInstance();
             $oRequest->saveRequest();
         }
     }
     \MVC\Registry::set('MVC_IDS_DISPOSED', $aDisposed);
 }
Пример #5
0
 /**
  * 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;
 }