Example #1
0
 /**
  * Return a singleton instance of the class
  * 
  * @access public
  * @return Usu_Validator 
  */
 public static function i()
 {
     if (!self::$_singleton instanceof Usu_Validator) {
         self::$_singleton = new self();
     }
     return self::$_singleton;
 }
Example #2
0
 /**
  * Initiate the main bootstrapper methods, called by Usu_Main::initiate()
  * 
  * @param mixed $lng - instance of language / empty array
  * @see Usu_Main::initiate()
  * @see Usu5_Bootstrap::getRequestUri()
  * @see Usu5_Bootstrap::setPaths()
  * @see Usu5_Bootstrap::getConfigConstants()
  * @see Usu5_Bootstrap::adminInstalled()
  * @see Usu5_Bootstrap::turnOffBrokenUrls()
  * @see Usu5_Bootstrap::loadLanguageData()
  * @see Usu5_Bootstrap::actionMultiLanguageSupport()
  * @see Usu5_Bootstrap::loadCharacterConversions()
  * @see Usu5_Bootstrap::loadPageModules()
  * @see Usu5_Bootstrap::loadUriModules()
  * @see Usu5_Bootstrap::uriModulesParsePath()
  * @see Usu5_Bootstrap::cacheSystem()
  * @see Usu5_Bootstrap::setRegistry()
  * @see Usu_Main::getVar()
  * @see Usu_Main::setVar()
  * @see Usu_Validator::initiate();
  * 
  * @access public
  * @return void
  */
 public function bootStrapper($lng)
 {
     $this->getRequestUri();
     $this->setPaths();
     $this->getConfigConstants();
     $this->adminInstalled();
     // Dependent on getConfigConstants()
     Usu_Main::i()->setVar('enabled', USU5_ENABLED);
     // dependent on adminInstalled()
     // No point in loading a load of functions that will not be used
     if (Usu_Main::i()->getVar('enabled') == 'false') {
         return Usu_Main::i()->setVar('initiated', false);
     }
     $this->turnOffBrokenUrls();
     $this->loadLanguageData($lng);
     $this->actionMultiLanguageSupport();
     $this->loadCharacterConversions();
     // Dependent on language being set as final ( i.e. multi language functions must precede )
     $this->loadPageModules();
     $this->loadUriModules();
     $this->uriModulesParsePath();
     $this->cacheSystem();
     $this->setRegistry();
     Usu_Main::i()->setVar('initiated', true);
     Usu_Validator::i()->initiate();
 }