get_config

Verify a config is set and get it if it is

@param string $config_name	The name of our config option/property
@access private
@return mixed
545956
private function get_config( $config_name ) {
		// Check that we have our config_name defined in our config
		if ( isset( $this->config[ $config_name ] ) !== true ) {
			throw new \Exception(
				'No "' . $config_name . '" config set. I don\'t know what to load!'
			);
		}
		else {
			// If its set, just hand it over
			return $this->config[ $config_name ];
		}
	}
818040
public function getConfig($name)
    {
        $setting = $this->settings;
        return isset($setting[$name]) ? $setting[$name] : null;
    }
1215766
public function get_config($name, $default = NULL) {
        $this->load_config();
        return isset($this->config->$name) ? $this->config->$name : $default;
    }
614655
final public function getConfig($name = '')
    {
        static $_config = [];
        if (empty($name)) {
            $name = $this->getName();
        }
        if (isset($_config[$name])) {
            return $_config[$name];
        }
        $map['name']   = $name;
        $map['status'] = 1;
        $config        = [];
        if (is_file($this->config_file)) {
            $temp_arr = include $this->config_file;
            foreach ($temp_arr as $key => $value) {
                if ($value['type'] == 'group') {
                    foreach ($value['options'] as $gkey => $gvalue) {
                        foreach ($gvalue['options'] as $ikey => $ivalue) {
                            $config[$ikey] = $ivalue['value'];
                        }
                    }
                } else {
                    $config[$key] = $temp_arr[$key]['value'];
                }
            }
            unset($temp_arr);
        }
        $_config[$name] = $config;

        return $config;
    }
84087
public function getConfigValue($section,$name)
    {
        $values=$this->getConfigValues($section);
        if(array_key_exists($name, $values)){
            return $values[$name];
        }
        return null;
    }
1139000
public function setEnv($env_name, $config)
    {
        $method = 'setClient'.ucfirst(strtolower($env_name));
        $property = 'client_'.strtolower($env_name);
        $set_value = (getenv($this->env_name.strtoupper($env_name))) ? getenv($this->env_name.strtoupper($env_name)) : '';
        if (isset($config[$env_name])) {
            $set_value = $config[$env_name];
        }
        if (!empty($set_value)) {
            if (method_exists($this, $method)) {
                return $this->$method($set_value);
            } elseif (property_exists($this, $property)) {
                $this->$property = $set_value;
            }
        }
        return $this;
    }
110011
public static function instance($config_name)
    {
        if (!isset(DbConfig::$$config_name)) {
            echo "\\Config\\Db::$config_name not set\n";
            throw new Exception("\\Config\\Db::$config_name not set\n");
        }

        if (empty(self::$instance[$config_name])) {
            $config                       = DbConfig::$$config_name;
            self::$instance[$config_name] = new DbConnection($config['host'], $config['port'],
                $config['user'], $config['password'], $config['dbname']);
        }
        return self::$instance[$config_name];
    }
1286709
public function get_values( $service_name = false )
    {
	if( $service_name )
	{
	    $values = $this->_configs[$service_name];
	}
	else
	{
	    $values = $this->_configs;
	}

	return $values;
    }
1155036
public static function close($config_name)
    {
        if (isset(self::$instance[$config_name])) {
            self::$instance[$config_name]->closeConnection();
            self::$instance[$config_name] = null;
        }
    }
271669
public static function get_config($key = null, $connection_name = self::DEFAULT_CONNECTION) {
            if ($key) {
                return self::$_config[$connection_name][$key];
            } else {
                return self::$_config[$connection_name];
            }
        }
840856
def config_for(name)
      name = name.to_s
      check_for_changes(name) if auto_check?(name)
      data = get_config_data(name)
      logger.debug "config_for(#{name.inspect}) => #{data.inspect}"
      data
    end
973871
public function getOption($name){
        return (isset($this->configOptions->{$name})) ? $this->configOptions->{$name} : false;    
    }
520882
public static function get($key, $config_name = 'main')
    {
        // 获取值
        // 加载其他配制文件
        if ($config_name !== 'main' && !isset(self::$_config[$config_name])) {
            $filename = APP_PATH . '/conf/' . $config_name . '.php';
            if (file_exists($filename)) {
                self::$_config[$config_name] = include $filename;
            } else {
                \show_error("Config file {$filename} is not exists.");
            }
        }

        // 返回需要value
        if ($key === '') {
            return self::$_config[$config_name];
        } elseif (array_key_exists($key, self::$_config[$config_name])) {
            return self::$_config[$config_name][$key];
        } elseif (strpos($key, '.')) {
            $array = explode('.', $key);
            if (count($array) === 2) {
                return isset(self::$_config[$config_name][$array[0]][$array[1]]) ? self::$_config[$config_name][$array[0]][$array[1]] : false;
            } elseif (count($array) === 3) {
                return isset(self::$_config[$config_name][$array[0]][$array[1]][$array[2]]) ? self::$_config[$config_name][$array[0]][$array[1]][$array[2]] : false;
            } else {
                show_error('Config::get("a.b.c") Only 3 levels are allowed.');
            }
        } else {
            return false;
        }
    }
467450
public function getProperty($property_name)
    {
        $obj = $this->excel->getProperties();
        $method = "get$property_name";

        return method_exists($obj, $method) ? $obj->$method() : null;
    }
262134
public function get($name = null) {
		if ($name === null) {
			$result = [];
			$this->_configurations = array_filter($this->_configurations);

			foreach ($this->_configurations as $key => $value) {
				$result[$key] = $this->get($key);
			}
			return $result;
		}

		$settings = &$this->_configurations;

		if (!isset($settings[$name])) {
			return null;
		}

		if (isset($settings[$name][0])) {
			return $settings[$name][0];
		}
		$env = Environment::get();

		$config = isset($settings[$name][$env]) ? $settings[$name][$env] : $settings[$name];

		$method = is_callable($this->initConfig) ? $this->initConfig : null;
		$settings[$name][0] = $method ? $method($name, $config) : $config;
		return $settings[$name][0];
	}
564120
public function get($property_name) {
    if ($property_name === 'entity' && !isset($this->values[$property_name])) {
      $value = $this->values[$property_name] = SKU::loadFromSku($this->values['value'], $this->getLangcode());
      $this->properties[$property_name] = $this->getTypedDataManager()->getPropertyInstance($this, $property_name, $value);
    }
    return parent::get($property_name);
  }
614440
public function getOption($name) {
		if (array_key_exists($name, $this->configuration)) {
			return $this->configuration[$name];
		}
		
		return null;
	}