Loads and returns the configuration data.

@return ArrayResolver
429283
public function load()
    {
        if (empty($this->data)) {
            $this->data = $this->doLoad();
        }

        return $this->data;
    }
212945
protected function loadDynamicConfig()
    {
        $className = $this->dynamicConfigClass();
        if ($className) {
            $config = $this->modelFactory()->get($className);

            if ($config instanceof StorableInterface && !$config->id()) {
                $config->load(1);
            }

            return $config;
        }

        return null;
    }
113345
public function getArray()
    {
        $config = @include $this->location;
        if (!is_array($config)) {
            throw new \Exception('Config not found');
        }

        $this->config = $config;

        return $config;
    }
1339578
public function getConfig()
    {
        if ($this->config) {
            return $this->config;
        }

        $config = $this->getDefaultConfig();

        // read from database
        $result = $this->connection->fetchAll('SELECT type, class FROM fusio_provider ORDER BY class ASC');
        foreach ($result as $row) {
            $this->mergeClass($config, $row['type'], $row['class']);
        }

        // read from file
        if (!empty($this->file)) {
            $result = include($this->file);

            if (is_array($result)) {
                foreach ($result as $type => $classes) {
                    foreach ($classes as $class) {
                        $this->mergeClass($config, $type, $class);
                    }
                }
            }
        }

        return $this->config = new ProviderConfig($config);
    }
308417
public function getPatchResolvers()
    {
        $resolvers = [];
        $plugin_manager = $this->composer->getPluginManager();
        foreach ($plugin_manager->getPluginCapabilities(
            'cweagans\Composer\Capability\ResolverProvider',
            ['composer' => $this->composer, 'io' => $this->io]
        ) as $capability) {
            /** @var ResolverProvider $capability */
            $newResolvers = $capability->getResolvers();
            if (!is_array($newResolvers)) {
                throw new \UnexpectedValueException(
                    'Plugin capability ' . get_class($capability) . ' failed to return an array from getResolvers().'
                );
            }
            foreach ($newResolvers as $resolver) {
                if (!$resolver instanceof ResolverBase) {
                    throw new \UnexpectedValueException(
                        'Plugin capability ' . get_class($capability) . ' returned an invalid value.'
                    );
                }
            }
            $resolvers = array_merge($resolvers, $newResolvers);
        }

        return $resolvers;
    }
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;
    }
1290886
protected function getConfig(): array
    {
        $loader = null;
        if ($this->isCacheEnabled() === true) {
            $loader = $this->getLoader();
            $cached = $loader->load();
            if (empty($cached) === false) {
                return $cached;
            }
        }

        if ($this->isFrameworkEnabled() === true) {
            $this->addFrameworkConfigs();
        }

        $merged = [];
        $merger = $this->getMerger();
        foreach ($this->getConfigs() as $config) {
            $merged = $merger->merge(
                $merged,
                $config->load()
            );
        }

        foreach ($this->getGlobalConfig() as $global) {
            $merged = $merger->merge($merged, $global);
        }

        foreach ($this->getModuleConfig() as $module) {
            $merged = $merger->merge($merged, $module);
        }

        if ($this->isCacheEnabled() === true) {
            if ($loader instanceof CacheLoader) {
                $loader->save($merged);
            }
        }

        return $merged;
    }
1093146
protected function _load()
    {
        if (empty($this->_plugins)) {
            $this->_plugins = AnService::get('repos:settings.plugin')
                              ->getQuery()
                              ->where('enabled', '=', 1)
                              ->toEntityset();
        }

        return $this->_plugins;
    }
718185
protected function readConfig()
    {
        if ($this->loaded == false) {
            $this->config = $this->loader->getDatas();
            $this->loaded = true;
        }

        return $this;
    }
591380
public function getConfigData() {
		// Lazy load if necessary
		$data = null;
		if(!$this->Config && ($data = $this->Environment()->loadPipelineConfig())) {
			$this->Config = serialize($data);
		}

		// Merge with defaults
		if($this->Config) {
			if(!$this->mergedConfig) {
				$this->mergedConfig = $data ?: unserialize($this->Config);
				if($default = self::config()->default_config) {
					Config::merge_array_low_into_high($this->mergedConfig, $default);
				}
			}
			return $this->mergedConfig;
		}

		// Fail if no data available
		$path = $this->Environment()->getPipelineFilename();
		throw new Exception(sprintf('YAML configuration for pipeline not found at path "%s"', $path));
	}
4885
public function loadData()
    {
        try {
            LoggerFactory::$file = $this->config['logFile'];
            LoggerFactory::$level = $this->config['logLevel'];
            $data = $this->getDataSync();
            $data->setDefaults();
            $data->cacheDir = $this->config['cacheDir'];
            $data->cacheOnly = $this->config['cacheOnly'];
            $data->dataExpire = $this->config['dataExpire'];
            $data->refreshInterval = $this->config['dataRefresh'];
            $data->forceRefresh = $this->config['forceDataRefresh'];

            // use statussync for non-cache mode
            if (!$data->cacheOnly) {
                $status = $this->prepareSync();
                $data->registerUrlFromStatus($status, 'dataUrls');
            }

            $this->results = $data->loadData();
        } catch (\Exception $e) {
            $this->exceptionStack[] = $e;

            return false;
        }

        return true;
    }
1365566
public function getAsArray()
    {
        if ($result = $this->getDecodedContent() === null) {
            throw new Doozr_Configuration_Reader_Exception(
                'Please read() a configuration file before you try to access it as array.'
            );
        }

        if ($result !== null) {
            $result = object_to_array($result);
        }

        return $result;
    }
136276
public function loadConfigs()
    {
        $configs = [];
        foreach ($this->getRepository()->findAll() as $config) {
            $configs[$config->getName()] = $config;
        }

        $this->configs = $configs;

        return $configs;
    }
739509
public function load()
    {
        $data = [];
        $routes = $this->getRoutes();
        foreach($routes as $route) {
            $parsedRoute = $this->parseRoute($route);
            $routeData = $this->requestService($route, $parsedRoute);

            if ($routeData !== null) {
                // When the routeData contains more entry. (if it's a numeric array)
                if (array_values($routeData) === $routeData) {
                    $data = array_merge($data, $routeData);
                }
                else {
                    $data[] = $routeData;
                }
            }
        }
        $this->returnData($data);
    }
155035
public function getFields()
    {
        $fields = $this->fields();
        $allFields = [];

        foreach ($fields as $name => $field) {
            $resolver = $this->getFieldResolver($name, $field);
            if ($resolver) {
                $field['resolve'] = $resolver;
            }
            $allFields[$name] = $field;
        }

        return $allFields;
    }
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;
    }