Beispiel #1
0
 /**
  * Constructor
  *
  * Initialize application. Potentially initializes include_paths, PHP
  * settings, and bootstrap class.
  *
  * @param  string                   $environment
  * @param  string|array|JO_Config $options String path to configuration file, or array/JO_Config of configuration options
  * @throws JO_Application_Exception When invalid options are provided
  * @return void
  */
 public function __construct($environment, $options = null, $argv = null)
 {
     if (version_compare(PHP_VERSION, '5.0.0', '<')) {
         exit("Sorry, this version of this system will only run on PHP version 5 or greater!\n");
     }
     $this->_environment = (string) $environment;
     require_once 'JO/Loader/Autoloader.php';
     $this->_autoloader = JO_Loader_Autoloader::getInstance();
     if (null !== $options) {
         if (is_string($options)) {
             $options = $this->_loadConfig($options);
         } elseif ($options instanceof JO_Config) {
             $options = $options->toArray();
         } elseif (!is_array($options)) {
             throw new JO_Exception('Invalid options provided; must be location of config file, a config object, or an array');
         }
         $this->setOptions($options);
         $this->setArgv($argv);
     }
 }
Beispiel #2
0
 private function setHelpersPath()
 {
     JO_Loader_Autoloader::getInstance()->registerNamespace(array('Model_', 'Helper_', 'Plugin_'));
     JO_Loader::setIncludePaths(array($this->getModuleDirectory() . DIRECTORY_SEPARATOR . JO_Request::getInstance()->getModule()));
 }
Beispiel #3
0
 /**
  * Reset the singleton instance
  *
  * @return void
  */
 public static function resetInstance()
 {
     self::$_instance = null;
 }