Gets a list of the asset groups as an array of options.

@param   array  $config  An array of options for the options
@return  mixed  An array or false if an error occurs
185859
public static function assetgroups($config = array())
	{
		if (empty(self::$asset_groups))
		{
			$db = App::get('db');

			$query = $db->getQuery()
				->select('a.id', 'value')
				->select('a.title', 'text')
				->from('#__viewlevels', 'a')
				->group('a.id')
				->group('a.title')
				->group('a.ordering')
				->order('a.ordering', 'asc');

			$db->setQuery($query->toString());
			self::$asset_groups = $db->loadObjectList();

			// Check for a database error.
			if ($db->getErrorNum())
			{
				throw new Exception($db->getErrorMsg(), 500, E_WARNING);
				return false;
			}
		}

		return self::$asset_groups;
	}
379976
protected function convertValueTypes(array $config)
	{
		foreach ($config as $k => $v)
		{
			if (is_array($v))
			{
				$config[$k] = $this->convertValueTypes($v);
			}
			else
			{
				$config[$k] = $this->castConfigValue($k, $v);
			}
		}

		return $config;
	}
963119
public static function config($config = null)
	{
		if(is_array($config)) {

            # Setting Configurations
			static::$config = $config + static::$config;
			$pathWithoutTrailingSlash = rtrim(static::$config['directory'], '/');
			static::$config['directory'] = $pathWithoutTrailingSlash.'/';

		} elseif(is_string($config)) {

            # Getting Single Config item
			return isset(static::$config[$config]) ? static::$config[$config] : null;

		} elseif(!$config) {

            # Getting All configurations
			return static::$config;
		} else {
			throw new CacheException('Invalid parameter provided for Cache::config()');
		}
	}
734991
protected function parseConfig(array $config)
    {
        $config = $this->setHost($config);
        $config = $this->setPort($config);
        $config = $this->setProtocol($config);
        $config = $this->setServiceId($config);
        $config = $this->setTNS($config);
        $config = $this->setCharset($config);

        return $config;
    }
1229553
public function build(array $config)
    {
        $output = [];

        // Fix path in output dir
        if ('/' !== substr($config['output_dir'], -1) && strlen($config['output_dir']) > 0) {
            $config['output_dir'] .= '/';
        }

        $output['fontawesome_css'] = $this->buildCssWithoutLess($config);

        /*if ('none' !== $config['less_filter']) {
            $output['fontawesome_css'] = $this->buildCssWithLess($config);
        } else {
            $output['fontawesome_css'] = $this->buildCssWithoutLess($config);
        }*/

        return $output;
    }
966032
protected function parseConfig(string $config): array
    {
        $config = json_decode($config, true);
        if ($config === null) {
            throw new ConfigFileFormatException("Config files should be written in valid JSON");
        }
        return $config;
    }
179787
public function assetConfig($config = null)
    {
        if ($config === null) {
            return $this->config;
        }
        $this->config = $config;
    }
580223
public function checksGroups(array $config)
    {
        $this->writeln('<info>Updating groups and their rights.</info>', OutputInterface::VERBOSITY_VERBOSE);

        foreach ($config as $identifier => $rights) {
            $group = $this->em->getRepository(Group::class)->findOneBy(['_name' => $identifier]);
            if (null === $group) {
                $group = new Group();
                $group->setName($identifier)
                    ->setDescription(Collection::get($rights, 'description', $identifier));
                $this->em->persist($group);
                $this->em->flush($group);
            }

            $this->writeln(sprintf(' - Group `%s`', $identifier), OutputInterface::VERBOSITY_VERY_VERBOSE);
            $this->updateRights($group, $rights);
        }

        return $this;
    }
816044
protected function getOptionsFromConfig(Config $config)
    {
        $options = $this->options;
        foreach (static::$mappingOptions as $option => $ossOption) {
            if (! $config->has($option)) {
                continue;
            }
            $options[$ossOption] = $config->get($option);
        }

        return $options;
    }
812164
protected function getDebugOption(array $config)
    {
        if (isset($config['debug'])) {
            return ($config['debug'] === true) ? fopen('php://stderr', 'ab') : $config['debug'];
        }

        if ($this->debugOverride && $this->debug) {
            return ($this->debug === true) ? fopen('php://stderr', 'ab') : $this->debug;
        } elseif (!$this->debugOverride && static::$staticDebug) {
            return (static::$staticDebug === true) ? fopen('php://stderr', 'ab') : static::$staticDebug;
        }

        return false;
    }
1038107
public function check(array $config): bool
    {
        $this->extensions = Collection::make(Arr::get($config, 'extensions', []));
        if (Arr::get($config, 'include_composer_extensions', false)) {
            $this->extensions = $this->extensions->merge($this->getExtensionsRequiredInComposerFile());
            $this->extensions = $this->extensions->unique();
        }
        $this->extensions = $this->extensions->reject(function ($ext) {
            return extension_loaded($ext);
        });

        return $this->extensions->isEmpty();
    }
1090951
protected function parseConfig($config)
    {
        $parsed = [];

        foreach ($config as $key=>$value) {
            if ($value instanceof XType) {
                $parsed[$key] = $value;
                continue;
            }
            $parsed[$key] = $this->stringToType($value);
        }

        return $parsed;
    }
282260
protected function getValues( array $config )
	{
		$values = array(
			'package' => 'Aimeos.Shop',
			'subpackage' => null,
			'absoluteUri' => false,
			'format' => 'html',
		);

		if( isset( $config['package'] ) ) {
			$values['package'] = (string) $config['package'];
		}

		if( isset( $config['subpackage'] ) ) {
			$values['subpackage'] = (string) $config['subpackage'];
		}

		if( isset( $config['absoluteUri'] ) ) {
			$values['absoluteUri'] = (bool) $config['absoluteUri'];
		}

		if( isset( $config['format'] ) ) {
			$values['format'] = (string) $config['format'];
		}

		return $values;
	}
940451
private function configureOptions(array $config): array
    {
        $resolver = new OptionsResolver();
        $resolver->setDefaults([
            'device' => [],
        ]);

        $resolver->setRequired(['message']);
        $resolver->setAllowedTypes('message', 'array');
        $resolver->setAllowedTypes('device', 'array');

        $options = $resolver->resolve($config);

        $deviceResolver = new OptionsResolver();
        $options['device'] = $deviceResolver->resolve($options['device']);

        $messageResolver = new OptionsResolver();
        $messageResolver->setRequired(['defaultTitle', 'defaultMediaUrl', 'defaultActionUrl']);

        $messageResolver->setAllowedTypes('defaultTitle', 'string');
        $messageResolver->setAllowedTypes('defaultMediaUrl', 'string');
        $messageResolver->setAllowedTypes('defaultActionUrl', 'string');

        $options['message'] = $messageResolver->resolve($options['message']);

        return $options;
    }
129434
protected function getConfig(array $config): array
    {
        $keys = [
            'auth_key',
            'secret',
            'app_id',
            'options',
            'host',
            'port',
            'timeout',
        ];

        foreach ($keys as $key) {
            if (!array_key_exists($key, $config)) {
                throw new InvalidArgumentException("Missing configuration key [$key].");
            }
        }

        foreach ($config['options'] as $option => $value) {
            if (is_null($value)) {
                unset($config['options'][$option]);
            }
        }

        return array_only($config, $keys);
    }
1057933
protected function createPartOfStructure(array $config)
  {
    $return_properties    = array();
    $return_configuration = array();

    foreach ($config as $configuration)
    {
      $value = null;
      switch ($configuration->getType())
      {
        case TypeEnum::COLLECTION_TYPE:
          $value = array($this->createPartOfStructure($configuration->getChildren()));
          break;
        case TypeEnum::OBJECT_TYPE:
          $value = $this->createPartOfStructure($configuration->getChildren());
          break;
        case TypeEnum::ARRAY_TYPE:
          $value = array();
          break;
        default:
          break;
      }
      $this->modifyConfiguration($configuration);
      $parameter = new Parameter($configuration->getKey(), $value);

      $return_properties[$configuration->getKey()]    = $parameter;
      $return_configuration[$configuration->getKey()] = $configuration;
    }

    return $this->classBuilder->build('\stdClass', $return_configuration, $return_properties);
  }
766770
private function getOptions(array $config = []): array
    {
        $resolver = new OptionsResolver();

        $resolver->setDefaults([
            'timeout' => 5,
            'verify_peer' => true,
            'verify_host' => 2,
            'proxy' => null,
        ]);

        $resolver->setAllowedTypes('timeout', 'int');
        $resolver->setAllowedTypes('verify_peer', 'bool');
        $resolver->setAllowedTypes('verify_host', 'int');
        $resolver->setAllowedTypes('proxy', ['string', 'null']);

        return $resolver->resolve($config);
    }