Returns all the packages

@param string|null $name Name of package

@return array
483668
public function getPackages(string $name = null): array
    {
        if (isset($this->packages[$name])) {
            return $this->packages[$name];
        }

        return $this->packages;
    }
857785
protected function getList($name)
    {
        if (null === ($list = $this->cache->get($name)) || !\is_array($list)) {
            return [];
        }

        return $list;
    }
1209982
public function findPackages($name, $version)
    {
        $packages = array();

        foreach ($this->repositories as $repository) {
            $packages = array_merge($packages, $repository->findPackages($name, $version));
        }

        return $packages;
    }
1321979
protected Package getPackage(String name) {
        Package pkg;
        synchronized (packages) {
            pkg = packages.get(name);
        }
        return pkg;
    }
469545
public static function get_all() {
		$skeletons = parent::get_all();
		$packages = [];
		foreach ($skeletons as $skeleton) {
			if (strpos($skeleton->name, 'skeleton') !== 0) {
				continue;
			}
			$packages[] = $skeleton;
		}
		return $packages;
	}
5251
public function get($name = null)
    {
        if (is_null($name)) {
            return $this->all();
        }

        return $this->find($name);
    }
1335728
public static function fetchInstalledVersion($name)
    {
        self::__buildExtensionList();

        return (isset(self::$_extensions[$name]) ? self::$_extensions[$name]['version'] : null);
    }
947268
protected function collectExtensions($name)
    {

        $extensions = [];

        foreach ($this->extensions() as $pattern) {
            if ($this->patternMatches($pattern, $name)) {
                $extensions[] = $this->getExtension($pattern);
            }
        }

        return $extensions;

    }
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;
    }
103747
public function getRepository($name)
    {
        return array_key_exists($name, $this->repositoryList) ? $this->repositoryList[$name] : null;
    }
471421
public function getPackagesByName($name, $type = '')
    {
        $query = ['q' => $name];

        if ($type != '') {
            $query['type'] = $type;
        }

        return $this->makeRequest('/search.json', $query);
    }
262134
public function get($name = null) {
		if ($name === null) {
			$result = [];
			$this->_configurations = array_filter($this->_configurations);

			foreach ($this->_configurations as $key => $value) {
				$result[$key] = $this->get($key);
			}
			return $result;
		}

		$settings = &$this->_configurations;

		if (!isset($settings[$name])) {
			return null;
		}

		if (isset($settings[$name][0])) {
			return $settings[$name][0];
		}
		$env = Environment::get();

		$config = isset($settings[$name][$env]) ? $settings[$name][$env] : $settings[$name];

		$method = is_callable($this->initConfig) ? $this->initConfig : null;
		$settings[$name][0] = $method ? $method($name, $config) : $config;
		return $settings[$name][0];
	}
970780
public function get($name = '')
	{
		// This needs to be extended by somebody else!
		if(!$this->_app->name)
			return [];

		// Not defined huh?
		if (!$this->_config)
			$this->getConfig();

		return $name ? (isset($this->_config['_'. $name]) ? $this->_config['_'. $name] : []) : $this->_config;
	}
272150
public function getAll($name)
    {
        $s = $this->getNormalizedHeaderName($name);
        $ret = [];
        if (!empty($this->headerMap[$s])) {
            foreach ($this->headerMap[$s] as $index) {
                $ret[] = $this->getByIndex($index);
            }
        }
        return $ret;
    }
1113469
public function getAggregatePackageContaining($packageName)
    {
        foreach ($this->packages as $packageNode) {
            if ($packageNode->replaces($packageName)) {
                return $packageNode;
            }
        }

        return null;
    }
99040
public function getAll($name = null)
    {
        if (!isset($name)) {
            $headers = [];
            foreach ($this->headers as $collection) {
                $headers = array_merge($headers, $collection);
            }

            return $headers;
        }

        $lowerName = strtolower($name);
        if (!array_key_exists($lowerName, $this->headers)) {
            return [];
        }

        return $this->headers[$lowerName];
    }
809442
public function getAllPackages()
    {
        $collection = new PackageCollection();

        if ($this->started === false) {
            return $collection;
        }

        // Installed
        $installed = $this->app['extend.action']['show']->execute('installed');
        foreach ($installed as $composerPackage) {
            /** @var CompletePackageInterface $composerPackage */
            $composerPackage = $composerPackage['package'];
            $package = Package::createFromComposerPackage($composerPackage);
            $name = $package->getName();
            $extension = $this->app['extensions']->getResolved($name);

            // Handle non-Bolt packages
            if ($extension instanceof ResolvedExtension) {
                $title = $extension->getDisplayName();
                $descriptor = $extension->getDescriptor();
                $constraint = $descriptor ? $descriptor->getConstraint() : null;
                $readme = $this->linkReadMe($extension);
                $config = $this->linkConfig($extension);
                $valid = $extension->isValid();
                $enabled = $extension->isEnabled();
            } else {
                $title = $name;
                $constraint = null;
                $readme = null;
                $config = null;
                $valid = true;
                $enabled = true;
            }

            $package->setStatus('installed');
            $package->setTitle($title);
            $package->setReadmeLink($readme);
            $package->setConfigLink($config);
            $package->setRepositoryLink($composerPackage->getSourceUrl());
            $package->setConstraint($constraint);
            $package->setValid($valid);
            $package->setEnabled($enabled);

            $collection->add($package);
        }

        // Pending
        $requires = isset($this->json['require']) ? $this->json['require'] : [];
        foreach ($requires as $name => $version) {
            if ($collection->get($name)) {
                continue;
            }
            $package = new Package();
            $package->setStatus('pending');
            $package->setName($name);
            $package->setTitle($name);
            $package->setReadmeLink(null);
            $package->setConfigLink(null);
            $package->setVersion($version);
            $package->setType('unknown');
            $package->setDescription(Trans::__('general.phrase.not-installed-yet'));

            $collection->add($package);
        }

        return $collection;
    }