Get config data as array

@throws ConfigException
@return array Parsed resource data array
359330
final public function getArray()
    {
        $res = $this->getArrayInternal();
        if (!$this->isArray($res) && !$this->isArrayObject($res)) {
            $errorMessage = 'AbstractDriver method _getArray() must return array or ArrayObject.';
            $errorMessage .= ' Make sure you have provided a valid config file path with file extension.';
            throw new ConfigException($errorMessage);
        }

        return StdObjectWrapper::toArray($res);
    }
649597
public function load() : array
    {
        if (!$this->exists()){
            throw new ConfigFileNotFoundException($this);
        }
        if (!$this->canRead()){
            throw new ConfigFileNotReadableException($this);
        }
    
        $contents = NULL;
        try{
            $contents = $this->getContents();
        }
        catch( FileSystemExceptionInterface $e ){
            throw new ConfigFileInputException($this, $e);
        }
        
        $data = Yaml::parse($contents);
        
        return $data;
    }
456213
public function getData()
    {
        $result = [
            'type' => $this->type
        ];

        switch($this->type)
        {

            case self::TYPE_WEB:
              $result['url'] = $this->url;

              if ($this->webview_height_ratio) {
                  $result['webview_height_ratio'] = $this->webview_height_ratio;
              }

              if ($this->messenger_extensions){
                  $result['messenger_extensions'] = $this->messenger_extensions;
                  $result['fallback_url'] = $this->fallback_url;
              }
            break;

        }

        return $result;
    }
937333
public function get_raw_config() {
		if(preg_match('/\.xml/', $this->configFile)) {
//			$rawConfig = _parseXml();
			$xml = new SimpleXMLElement(file_get_contents($this->configFile));
			$rawConfig = array();
			foreach($xml as $x => $y) {
				foreach($y as $i => $d) {
					$rawConfig["$x"]["$i"] = "$d";
				}
			}
		}
		elseif(preg_match('/\.ini/', strtolower($this->configFile))) {
			$rawConfig = parse_ini_file($this->configFile,true);
		}
		else {
			throw new exception(__METHOD__ .": unsupported filetype (". $this->configFile .")");
		}
		return $rawConfig;
	}
618834
protected function requestData() : array
    {
        switch ($this->method) {
            case 'post':
                return Yii::$app->request->post();
            case 'get':
                return Yii::$app->request->getQueryParams();
            default:
                throw new InvalidConfigException('Request method is not defined');
        }
    }
1362883
public static function config_get_configuration_array($data) {
        $return = array(
            'server' => $data->server,
            'database' => $data->database,
            'extendedmode' => (!empty($data->extendedmode))
        );
        if (!empty($data->username)) {
            $return['username'] = $data->username;
        }
        if (!empty($data->password)) {
            $return['password'] = $data->password;
        }
        if (!empty($data->replicaset)) {
            $return['replicaset'] = $data->replicaset;
        }
        if (!empty($data->usesafe)) {
            $return['usesafe'] = true;
            if (!empty($data->usesafevalue)) {
                $return['usesafe'] = (int)$data->usesafevalue;
                $return['usesafevalue'] = $return['usesafe'];
            }
        }
        return $return;
    }
1200865
private function _getConfigArray()
    {
        $keyId = Craft::parseEnv($this->keyId);
        $secret = Craft::parseEnv($this->secret);
        $region = Craft::parseEnv($this->region);

        return self::_buildConfigArray($keyId, $secret, $region);
    }
887407
protected static function getConfig()
    {
        if (static::$config) {
            return static::$config;
        }

        $config = Registry::get('config');
        if (!isset($config['log'])) {
            throw new ConfigException('log config not exists');
        }
        $config = $config['log'];

        if (!isset($config['level'])) {
            $config['level'] = 'info';
        }
        $config['level'] = isset(static::$logLevels[$config['level']])
            ? static::$logLevels[$config['level']]
            : Logger::INFO;

        if (!isset($config['channel'])) {
            $config['channel'] = static::$defaultChannel;
        }

        return static::$config = $config;
    }
26581
public function getDataArray()
    {
        $arr = array(
            '@context' => $this->context,
            '@type' => $this->type,
        );

        foreach($this->properties as $name => $property) {
            if ($property instanceof Interfaces\IElement) {
                $arr[$name] = $property->getDataArray();
            } else {
                $arr[$name] = $property;
            }
        }
        return $arr;
    }
554651
private function getConfigObject()
    {
        if (!isset($this->config)) {
            $config = [];
            $file = $this->appRoot . '/' . $this->cliConfig->get('service.app_config_file');
            if (file_exists($file)) {
                $config = (array) (new YamlParser())->parseFile($file);
            }
            $this->config = new AppConfig($config);
        }

        return $this->config;
    }
313710
public function toArray()
    {
        $array = array();
        $data = $this->data;

        foreach ($data as $key => $value) {
            if ($value instanceof Config) {
                $array[$key] = $value->toArray();
            } else {
                $array[$key] = $value;
            }
        }

        return $array;
    }
401829
public function getBucket(string $name): array
    {
        if (!$this->hasBucket($name)) {
            throw new ConfigException("Undefined bucket `{$name}`");
        }

        $bucket = $this->config['buckets'][$name];

        if (!array_key_exists('options', $bucket)) {
            throw new ConfigException("Bucket `{$name}` must specify `options`");
        }

        if (!array_key_exists('prefix', $bucket)) {
            throw new ConfigException("Bucket `{$name}` must specify `prefix`");
        }

        if (!array_key_exists('server', $bucket)) {
            throw new ConfigException("Bucket `{$name}` must specify `server` name.");
        }

        return $bucket;
    }
1137130
public function load()
    {
        $config = new UserConfiguration();
        if (!file_exists($this->storagePath)) {
            return $config;
        }

        try {
            $data = Yaml::parse(file_get_contents($this->storagePath));
        } catch (ParseException $e) {
            throw new ConfigException(sprintf('The config file "%s" is not a valid YAML.', $this->storagePath), 0, $e);
        }

        if (is_array($data)) {
            $config->load($data);
        }

        return $config;
    }
1098704
public static function configGetAll()
    {
		$data = self::getDbConnection()->fetchAll('SELECT * FROM config WHERE `class` = ?', array( get_called_class() ));
		$res = array();
		foreach ($data as $id => $v)
		{
			$res[$v['key']] = unserialize($v['value']);
		}
		return $res;
    }
90863
public function toArray()
    {
        return array(
            "resourceId" => $this->resourceId,
            "operation" => $this->operation,
            "specTypes" => $this->specTypes,
            "storeName" => $this->storeName,
            "podName" => $this->podName
        );
    }
461552
public function toArray()
    {
        $data = [];

        foreach ($this->config as $key => $value) {
            if ($value instanceof self) {
                $value = $value->toArray();
            }

            $data[$key] = $value;
        }

        return $data;
    }
84659
public function toArray()
    {
        $array = array();
        $data = $this->_data;
        foreach ($data as $key => $value) {
            if ($value instanceof Zend_Config) {
                $array[$key] = $value->toArray();
            } else {
                $array[$key] = $value;
            }
        }
        return $array;
    }