get package from config.

@param $name

@return array
503495
private function getPackageFromConfig($name)
    {
        //Check if package name is a composer package name
        if (str_contains($name, '/')) {
            return $this->config->get($this->getPackageNameByComposerName($name));
        }

        return $this->config->get($name);
    }
421382
protected function createServiceConfig(string $name): array
    {
        $config = [];
        if ($this->has($name)) {
            $config = $this->config[$name];
        }

        $class = $name;

        if (isset($config['use'])) {
            if (!is_string($config['use'])) {
                throw new Exception\InvalidConfiguration('use must be a string for service '.$name);
            }

            $class = $config['use'] = $this->getEnv($config['use']);
        }

        if (preg_match('#^\{([^{}]+)\}$#', $class)) {
            $config = array_merge($this->getServiceDefaults(), $config);

            return $config;
        }

        $config = $this->mergeServiceConfig($name, $class, $config);

        if (isset($config['use'])) {
            $class = $config['use'] = $this->getEnv($config['use']);
        }

        if (!class_exists($class)) {
            throw new Exception\InvalidConfiguration('class '.$class.' is either not a class or can not be found');
        }

        return $config;
    }
237763
public function getCustomConfig($name = '')
    {
        $custom_config = $this->getConfigByName('custom');
        return $name ? ($custom_config[$name] ?? null) : $custom_config;
    }
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;
    }
442652
public function getArray($name)
    {
        return isset($this->arguments[$name]) ? $this->arguments[$name]->values() : [];
    }
603777
public function getPackage($name = null)
    {
        /** @var PackageResolver $resolver */
        $resolver = $this->container->get('package.resolver');

        return $resolver->getPackage($name);
    }
244878
protected function getGroup(string $name): array
    {
        if (!$this->container->has('config_'.$name)) {
            $this->loadGroup($name);
        }

        return $this->container->get('config_'.$name);
    }
854399
protected function getCacheConfig(string $name)
    {
        $cache = $this->config->get($this->getConfigName().'.cache');

        if (!is_array($config = array_get($cache, $name)) && !$config) {
            throw new InvalidArgumentException("Cache [$name] not configured.");
        }

        $config['name'] = $name;

        return $config;
    }
1321979
protected Package getPackage(String name) {
        Package pkg;
        synchronized (packages) {
            pkg = packages.get(name);
        }
        return pkg;
    }
350501
public function getConfig(string $name)
	{
		if (isset($this->store[$name])) {
			return $this->store[$name];
		}
		return null;
	}
759978
protected function configFor($name)
    {
        // Return cached result
        if (array_key_exists($name, $this->configs)) {
            return $this->configs[$name];
        }

        $config = Config::inst()->get(Injector::class, $name);
        $this->configs[$name] = $config;
        return $config;
    }
608373
public function getVar($name)
    {
		$this->loadVars();
    
        if (isset($this->_config[$name])) {
            return $this->_config[$name];
        } else {
            return false;
        }
    }
645484
public function quessByName(string $name)
    {
        return $this->first(function(ExtensionContract $extension) use($name) {
            $package = $extension->getPackageName();

            return (str_contains($package, 'module-')) ? $package === 'module-' . $name : $package === 'component-' . $name;
        });
    }
1268781
protected function getConfig($name)
	{
		$config = $this->app['config']['remote.connections.'.$name];

		if ( ! is_null($config)) return $config;

		throw new \InvalidArgumentException("Remote connection [$name] not defined.");
	}
438560
public function resolvePackage($name)
	{
		$packages = $this->getPackages();

		//most commonly we have Foobar or SupraPackageFoobar, which maps directly to package class
		//the other options is "foobar", which is mapped to AbstractPackage::getName
		foreach ($packages as $instance) {
			$class = get_class($instance);
			$classParts = explode('\\', $class);
			$className = $classParts[count($classParts) - 1];

			if ($name == $className || 'SupraPackage' . $name == $className) {
				return $class;
			}

			if ($name == $instance->getName()) {
				return $class;
			}
		}

		throw new \Exception(sprintf('Package "%s" can not be resolved', $name));
	}
998319
public function getPackage($name = null)
    {
        if (!$name) {
            return $this->getCurrentPackage();
        }

        if (isset($this->packages[$name])) {
            return $this->packages[$name];
        }

        return null;
    }
139292
protected function findWhatProvides($name)
    {
        $assetPrefix = $this->assetType->getComposerVendorName().'/';

        if (false === strpos($name, $assetPrefix)) {
            return array();
        }

        if (isset($this->providers[$name])) {
            return $this->providers[$name];
        }

        $data = null;
        if ($this->hasVcsRepository($name)) {
            $this->providers[$name] = array();
            $data = $this->providers[$name];
        }

        return $data;
    }