Esempio n. 1
0
 function testParse()
 {
     $Conf = XConfig::factory('ini');
     $file = dirname(__FILE__) . '/data/test.ini';
     $Conf->load($file);
     $this->assertTrue($Conf->get('log.option.append'));
 }
Esempio n. 2
0
 public static function factory($conf, $option = array())
 {
     $Conf = XConfig::factory('ini');
     $Conf->load($conf);
     $Conf->set($option);
     $object = new XSystem($Conf);
     return $object;
 }
Esempio n. 3
0
 /**
  * setConfig
  *
  * @return boolean
  * @author timeout
  **/
 public static function getConfig($array, $debug = false)
 {
     $result = true;
     $debug = array();
     $cfgs = array();
     /*
     
     if ( Cache::has('config') )
     {
     	$cfgs = Cache::get('config');
     }
     else
     {
     	$cfgs = XConfig::all();
     	Cache::forget('config'
     	Cache::put('config',$cfgs,10);			
     }
     */
     $cfgs = XConfig::all();
     while ($config_valueTMP = current($array)) {
         foreach ($cfgs as $cfg) {
             if ($cfg->config_name == key($array)) {
                 if ($cfg->config_value != $config_valueTMP) {
                     $result = false;
                     if ($debug) {
                         array_push($debug, $cfg->config_name);
                     }
                 }
             }
         }
         next($array);
     }
     if ($debug && $result == false) {
         return $debug;
     } else {
         return $result;
     }
 }
Esempio n. 4
0
 public static function Delete($account_id, $family, $key)
 {
     return XConfig::Delete('a_' . $account_id, $family, $key);
 }
Esempio n. 5
0
 public function outputFilter($key, $value)
 {
     return parent::outputFilter($key, $value);
 }