@param string $type
@param string $config

@return array
163115
private function buildFirstDimensionOfContactsArray($type, $config)
    {
        $contacts = [];
        $websites = $this->helper->getWebsites(true);
        foreach ($websites as $website) {
            if (strpos($type, self::ORDER_STATUS_AUTOMATION) !== false) {
                $configValue = $this->helper->serializer->unserialize(
                    $this->helper->getWebsiteConfig($config, $website)
                );

                if (is_array($configValue) && !empty($configValue)) {
                    foreach ($configValue as $one) {
                        if (strpos($type, $one['status']) !== false) {
                            $contacts[$website->getId()]['programId']
                                = $one['automation'];
                        }
                    }
                }
            } else {
                $contacts[$website->getId()]['programId']
                    = $this->helper->getWebsiteConfig($config, $website);
            }
        }
        return $contacts;
    }
299718
public function generate(Config $config)
    {
        $parts = array();
        if ($config->parent) {
            $parts[] = str_replace(
                array('{id}', '.{_format}'),
                array(sprintf('{%sId}', $this->getPrefix($config->parent)), ''),
                $this->generate($config->parent)
            );
        }
        $parts[] = $this->getPrefix($config);

        $prefix = implode('/', array_filter($parts));
        $pattern = $this->getPattern($config);

        if (isset($pattern[0]) && '/' !== $pattern[0] && '.' !== $pattern[0]) {
            return rtrim($prefix, '/').'/'.$pattern;
        }

        return $prefix.$pattern;
    }
318368
protected function getOptionsFromConfig(Config $config)
    {
        $options = $this->options;

        if ($visibility = $config->get('visibility')) {
            // For local reference
            $options['visibility'] = $visibility;
            // For external reference
            $options['ACL'] = $visibility === AdapterInterface::VISIBILITY_PUBLIC ? 'public-read' : 'private';
        }

        if ($mimetype = $config->get('mimetype')) {
            // For local reference
            $options['mimetype'] = $mimetype;
            // For external reference
            $options['ContentType'] = $mimetype;
        }

        foreach (static::$metaOptions as $option) {
            if ( ! $config->has($option)) {
                continue;
            }
            $options[$option] = $config->get($option);
        }

        return $options;
    }
661400
private function register_constants( Config $config ) {
		$this->share( 'file', function() use ( $config ) {
			return $config->file;
		} );
		$this->share( 'url', function() use ( $config ) {
			return $config->url;
		} );
		$this->share( 'path', function() use ( $config ) {
			return $config->path;
		} );
		$this->share( 'basename', function() use ( $config ) {
			return $config->basename;
		} );
		$this->share( 'slug', function() use ( $config ) {
			return $config->slug;
		} );
		$this->share( 'version', static::VERSION );
	}
401729
protected function getRequestConfig(array $config) : array
    {
        if (!empty($this->defaultRequestOptions)) {
            $config = array_replace_recursive($this->defaultRequestOptions, $config);
        }

        return $config;
    }
245396
public function describe(Config $config)
    {
        $data = [];

        foreach ($this->getDescriptors() as $descriptorName => $descriptor) {
            $data = array_replace_recursive($data, $descriptor->describe($config));
        }

        return $data;
    }
805199
private function buildFallbackConfig(string $type, array $config): array
    {
        $type           = substr($type, 3);
        $fallbackConfig = $this->environment->getConfig()->get('form.layouts.' . $type, []);
        $fallbackConfig = ArrayUtil::merge($this->fallbackConfig, $fallbackConfig);

        foreach ($this->sections as $section) {
            $name = 'fallback' . ucfirst($section);

            if ($config[$name]) {
                $fallbackConfig['templates'][$section] = $config[$name];
            }
        }

        return $fallbackConfig;
    }
714876
public static function getManifestFile(array $config, string $type = 'modern')
    {
        $manifest = null;
        // Determine whether we should use the devServer for HMR or not
        $devMode = Craft::$app->getConfig()->getGeneral()->devMode;
        self::$isHot = ($devMode && $config['useDevServer']);
        // Try to get the manifest
        while ($manifest === null) {
            $manifestPath = self::$isHot
                ? $config['devServer']['manifestPath']
                : $config['server']['manifestPath'];
            // Normalize the path
            $path = self::combinePaths($manifestPath, $config['manifest'][$type]);
            $manifest = self::getJsonFile($path);
            // If the manifest isn't found, and it was hot, fall back on non-hot
            if ($manifest === null) {
                // We couldn't find a manifest; throw an error
                self::reportError(Craft::t(
                    'twigpack',
                    'Manifest file not found at: {manifestPath}',
                    ['manifestPath' => $manifestPath]
                ), true);
                if (self::$isHot) {
                    // Try again, but not with home module replacement
                    self::$isHot = false;
                } else {
                    // Give up and return null
                    return null;
                }
            }
        }

        return $manifest;
    }
856606
public function load(Config $config)
    {
        if (null === $config) {
            $config = new Config();
        }

        $this->loadExtensions($config);

        return $this
            ->applyCommands($config)
            ->applyHooks($config)
        ;
    }
803405
public function factory($type, array $config)
    {
        $this->setFactoryCreationOptions($type, $config);

        return $this->get($type, $config, false);
    }
552789
private function getFilters($type)
    {
        $filters = [];
        if ('contao' === $type) {
            $filters[] =
                function ($package) {
                    /** @var PackageInterface $package */
                    return in_array($package->getType(), ['contao-module', 'contao-bundle', 'legacy-contao-module']);
                };
        }

        return $filters;
    }
171988
private static function parseConfig($config)
    {
        if (empty($config)) {
            $config = Db::getConfig();
        } elseif (is_string($config) && false === strpos($config, '/')) {
            // 支持读取配置参数
            $config = Db::getConfig($config);
        }

        if (is_string($config)) {
            return self::parseDsnConfig($config);
        } else {
            return $config;
        }
    }
1185753
protected function stringToType($config)
    {
        list($typeName, $properties) = $this->splitTypeAndProperties($config);

        $type = $this->createType($typeName);

        if ($properties) {
            $type->fill($this->parseProperties($properties));
        }

        if (!$type instanceof ObjectType) {
            return $type;
        }

        if (!$type->hasKeyProvider()) {
            $type->provideKeysBy($this->buildKeyProvider($type));
        }

        return $type;
    }
916521
public static function clearCache(&$config, $type = "all") {
		$cacheDirectories = self::checkCache ( $config );
		$cacheDirs = [ "annotations","controllers","models","queries","views","contents" ];
		foreach ( $cacheDirs as $typeRef ) {
			self::_clearCache ( $cacheDirectories, $type, $typeRef );
		}
	}
1305097
public function getIdNameListByTypeGroup( $type, $group = false, $config = [] ) {

		$config[ 'conditions' ][ 'type' ] 	= $type;
		$config[ 'conditions' ][ 'group' ] 	= $group;

		return $this->getIdNameList( $config );
	}
1069512
public static function dumpToFile(Config $config, $type)
    {
        if ($type === Config::CONFIG_LOCAL) {
            $filename = $config->get('local_config');

            if (null === $filename) {
                throw new \RuntimeException('Local configuration is not loaded and therefore it cannot be dumped.');
            }
        } elseif ($type === Config::CONFIG_SYSTEM) {
            $filename = $config->get('home_config');
        } else {
            throw new \InvalidArgumentException(
                sprintf(
                    'Config slot "%s" is not valid for dumping to a file "%s", use either: '.
                    'Config::CONFIG_SYSTEM or Config::CONFIG_LOCAL.',
                    $type
                )
            );
        }

        // Testing compatibility, write directly as there is no risk of problems
        if ('vfs://' === substr($filename, 0, 6)) {
            file_put_contents($filename, Yaml::dump($config->toArray($type)));
        } else {
            self::getFilesystem()->dumpFile(
                $filename,
                "# Gush configuration file, any comments will be lost.\n".Yaml::dump($config->toArray($type), 2)
            );
        }

        return $filename;
    }
546247
public static function config($config = []) {
		if (!$config) {
			return ['classes' => static::$_classes, 'unicode' => static::$_unicode];
		}
		if (isset($config['classes'])) {
			static::$_classes = $config['classes'] + static::$_classes;
		}
		if (isset($config['unicode'])) {
			static::$_unicode = $config['unicode'];
		}
	}