Esempio n. 1
0
 /**
  * Used to set config absolute file path.
  * Leave constructor empty and use this.
  */
 public function set_abs_file($filename)
 {
     $this->name = $filename;
     if (!file_exists($this->name)) {
         ELog::error('Config file not existent: ' . $this->name);
     } else {
         $this->data = EConfig::parse_file($this->name);
     }
 }
Esempio n. 2
0
 public function actionIndex()
 {
     $model = new ConfigForm();
     $config = new EConfig();
     foreach ($model->attributes as $attr => $val) {
         $model->{$attr} = $config->get($attr);
     }
     if (isset($_POST['222'])) {
         $model->attributes = $_POST['222'];
         foreach ($model->attributes as $attr => $val) {
             $config->set($attr, $val);
         }
         Yii::app()->user->setFlash('successesSaveConfig', 'Все ОК!!!');
     }
     //$form = new CForm('admin.views.config.configForm', $model);
     //if ($form->submitted('configPage') && $form->validate()) {
     $this->render('configForm', array('model' => $model));
     //} else {
     //$this->render('config', array('form' => $form));
     //}
 }
Esempio n. 3
0
 public static function load_all()
 {
     EConfig::$data = array();
     //enters in conf directory
     chdir(ELoader::$config_path);
     //parse every single conf file and place it in an associative array
     foreach (glob("*") as $filename) {
         $name = EFileSystem::get_file_name($filename);
         EConfig::$data[$name] = EConfig::parse_file($filename);
     }
 }
Esempio n. 4
0
        }
        chdir(ELoader::$prev_path);
    }
}
class EUnloader
{
    public function __destruct()
    {
        EDatabase::unload();
    }
}
$unloader = new EUnloader();
//including all modules
ELoader::loadAllModules();
//loading current website configuration
EConfig::load();
//protecting whole website with auth and enabled
EProtect::load();
//rewrite url if needed
if (EConfig::$data['generic']['rewrite'] == "yes") {
    ERewriter::enable();
    ERewriter::load();
} else {
    ERewriter::disable();
}
//loading get/post
if (EConfig::$data['generic']['protectheaders'] == "yes") {
    EHeaderDataParser::load();
}
//loading database
if (EConfig::$data['generic']['database'] == "yes") {