コード例 #1
0
ファイル: database.php プロジェクト: joelpittet/database
 /**
  * Query the configuration table for all values for this group and
  * unserialize each of the values.
  *
  * @param   string  group name
  * @param   array   configuration array
  * @return  $this   clone of the current object
  */
 public function load($group, array $config = NULL)
 {
     if ($config === NULL and $group !== 'database') {
         // Load all of the configuration values for this group
         $query = DB::select('config_key', 'config_value')->from($this->_database_table)->where('group_name', '=', $group)->execute($this->_database_instance);
         if (count($query) > 0) {
             // Unserialize the configuration values
             $config = array_map('unserialize', $query->as_array('config_key', 'config_value'));
         }
     }
     return parent::load($group, $config);
 }
コード例 #2
0
ファイル: file.php プロジェクト: azuya/Wi3
 /**
  * Load and merge all of the configuration files in this group.
  *
  *     $config->load($name);
  *
  * @param   string  configuration group name
  * @param   array   configuration array
  * @return  $this   clone of the current object
  * @uses    Kohana::load
  */
 public function load($group, array $config = NULL)
 {
     if ($files = Kohana::find_file($this->_directory, $group, NULL, TRUE)) {
         // Initialize the config array
         $config = array();
         foreach ($files as $file) {
             // Merge each file to the configuration array
             $config = Arr::merge($config, Kohana::load($file));
         }
     }
     return parent::load($group, $config);
 }