Esempio n. 1
0
 /**
  * Loads site configuration info
  *
  * @return null
  */
 public function loadConfig()
 {
     $this->config = Nexista_Config::singleton('Nexista_Config');
     $this->config->setMaster(NX_PATH_COMPILE . 'config.xml');
     $this->config->loadMasterConfig();
 }
Esempio n. 2
0
 /**
  * Read and writes the application config data
  *
  * This method loads the config data that holds the applciation
  * parameters such as paths, location of sitemap,
  * session preferences, db connections, etc...
  * Some of this data will be written directly in the gate files
  * during the compile process. It takes the config xml and ouputs
  * it as combnined xml file for runtime.
  *
  * @param string $master          master config file
  * @param string $local           optional local override configuration file
  * @param string $mode            optional mode
  * @param string $config_filename optional environment profile
  *
  * @return null
  */
 public function configure($master, $local = null, $mode = null, $config_filename = 'config.xml')
 {
     $config = Nexista_Config::singleton('Nexista_Config');
     $config->setMaster($master);
     if (is_file($local)) {
         $config->setLocal($local);
     }
     $config->setMode($mode);
     $config->load();
     if ($config->writeConfig($config, $config_filename)) {
         return true;
     } else {
         return false;
     }
     //init debug
     $configs = Nexista_Config::getSection('runtime');
     if ($configs['debug']) {
         $GLOBALS['debugTrack'] = true;
     }
 }