Gets [[packages]].
@return \Composer\Package\PackageInterface[]
543679
public function getPackages()
    {
        if ($this->packages === null) {
            $this->packages = $this->composer->getRepositoryManager()->getLocalRepository()->getCanonicalPackages();
            $this->packages[] = $this->composer->getPackage();
        }

        return $this->packages;
    }
123978
protected function getPackages(array $vendors)
    {
        $packagist = new Packagist();

        $client = new Client($packagist);

        $packages = $client->packages($vendors);

        return new PackagesPresenter($packages);
    }
1309909
protected function getPackages()
    {
        if (! is_null($package = $this->input->getArgument('package'))) {
            if (Str::length($package) > 3) {
                $package = Str::snake($package, '-');
            } else {
                $package = Str::lower($package);
            }

            return array($package);
        }

        return $this->findAllAssetPackages();
    }
819996
private function create_packages() {
		$packages = array();
		foreach ( $this->translations as $translation ) {
			$package = array();
			foreach ( $this->directory_list as $file ) {
				if ( false !== stripos( $file, $translation ) ) {
					$package[] = $this->language_files_dir . '/' . $file;
				}
			}
			$packages[ $translation ] = $package;
		}

		return $packages;
	}
442656
protected function getPackagesData()
    {
        $composer = $this->event->getComposer();
        $locker = $composer->getLocker();
        if (isset($locker)) {
            $lockData = $locker->getLockData();
            $allPackages = isset($lockData['packages']) ? $lockData['packages'] : array();
        }

        $packages = array();
        // Only add those packages that we can reasonably
        // assume are components into our packages list
        foreach ($allPackages as $package) {
            if (isset($package['extra']['c33s-building-blocks']) && is_array($package['extra']['c33s-building-blocks'])) {
                $packages[] = $package;
            }
        }

        // Add the root package to the packages list.
        $root = $composer->getPackage();
        if ($root) {
            $dumper = new ArrayDumper();
            $package = $dumper->dump($root);

            if (isset($package['extra']['c33s-building-blocks']) && is_array($package['extra']['c33s-building-blocks'])) {
                $packages[] = $package;
            }
        }

        return $packages;
    }
1308821
public function package()
    {
        $package = [];
        $package['id'] = $this->id;
        $package['instructions'] = $this->instructions;
        $package['filterQuery'] = $this->filterQuery;
        $package['type'] = $this->type;
        $package['typeOptions'] = $this->typeOptions;
        $package['total'] = $this->total;
        $package['bundle'] = false;
        $package['bundle'] = ['offset' => $this->offset, 'size' => count($this->_items), 'items' => []];
        foreach ($this->_items as $item) {
            $package['bundle']['items'][$item->id] = $item->package();
        }

        return $package;
    }
1196140
public function getLocalPackages() {
		$composer = $this->getComposer();
		$dispatcher = new EventDispatcher($composer, $this->io);
		$autoloadGenerator = new \Composer\Autoload\AutoloadGenerator($dispatcher);
		
		if ($this->selfEdit) {
			chdir(__DIR__."/../../..");
			\putenv('COMPOSER=composer-mouf.json');
		} else {
			chdir(__DIR__."/../../../../../..");
		}
		//TODO: this call is strange because it will return the same isntance as above.
		$composer = $this->getComposer();
				
		$localRepos = new CompositeRepository(array($composer->getRepositoryManager()->getLocalRepository()));
		$package = $composer->getPackage();
		$packagesList = $localRepos->getPackages();
		$packagesList[] = $package;
		
		return $packagesList;
	}
1040297
protected function getOptions()
    {
        $options = [
            ['package', null, InputOption::VALUE_OPTIONAL, 'The package to migrate.', null],
        ];

        return array_merge($options, parent::getOptions());
    }
606720
public function getDependencyPackages()
    {
        $this->_dependencyPackages = array();
        if (!isset($this->_packageXml->dependencies->required->package)) {
            return $this->_dependencyPackages;
        }
        foreach($this->_packageXml->dependencies->required->package as $_package) {
            $add = array(
                'name'    => (string)$_package->name,
                'channel' => (string)$_package->channel,
                'min'     => (string)$_package->min,
                'max'     => (string)$_package->max,
            );
            if(isset($_package->files)) {
                $add['files'] = array();
                foreach($_package->files as $node) {
                    if(isset($node->file)) {

                        $add['files'][] = array('target' => (string) $node->file['target'], 'path'=> (string) $node->file['path']);
                    }
                }
            }
            $this->_dependencyPackages[] = $add;
        }
        return $this->_dependencyPackages;
    }
815466
public static function getAvailablePackages()
	{
		$availablePackages = self::getRemotePackages();
		$localPackages = self::getLocalPackages();
		foreach ($localPackages as $installedPackage)
		{
			unset($availablePackages[$installedPackage->getName()]);
		}
		return $availablePackages;
	}
276041
protected function generateRequirePackages(array $packagePairs)
    {
        $requires = [];

        foreach ($packagePairs as $packagePair) {
            $requires[$packagePair->getName()] = $packagePair->getVersion();
        }

        return $requires;
    }
229736
public function getRequiredPackages()
    {
        $packages = [];

        $content = $this->getFileContents('composer.json');

        foreach (['require', 'require-dev'] as $key) {
            if (!isset($content[$key])) {
                continue;
            }

            foreach ($content[$key] as $name => $version) {
                if (!strstr($name, '/')) {
                    continue;
                }

                $packages[$name] = [
                    'name' => $name,
                    'version' => $version,
                    'devDependency' => $key === 'require-dev',
                ];
            }
        }

        if (empty($packages)) {
            throw new LogicException('We couldn\'t find any required packages.');
        }

        return $packages;
    }
1359538
public function getVendorModules()
    {
        $repos = $this->getComposer()->getRepositoryManager()->getLocalRepository();

        $packages = array_filter($repos->getPackages(), function ($package) {
            /** @var CompletePackage $package */
            return $package->getType() === 'melisplatform-module' &&
                array_key_exists('module-name', $package->getExtra());
        });

        $modules = array_map(function ($package) {
            /** @var CompletePackage $package */
            return $package->getExtra()['module-name'];
        }, $packages);

        sort($modules);

        return $modules;
    }
276868
public function package()
    {
        return [
            'type' => $this->type,
            'id' => $this->id,
            'descriptor' => $this->descriptor,
            'subdescriptor' => $this->subdescriptor,
            'hasChildren' => $this->hasChildren,
            'isSelectable' => $this->isSelectable,
        ];
    }
413151
public function getInstallers()
    {
        $this->orderedInstallers = [];

        if ($this->orderInstallersByNumber) {
            $this->orderInstallersByNumber();
        }

        if ($this->orderInstallersByDependencies) {
            $this->orderInstallersByDependencies();
        }

        if (!$this->orderInstallersByNumber && !$this->orderInstallersByDependencies) {
            $this->orderedInstallers = $this->installers;
        }

        return $this->orderedInstallers;
    }
674441
protected function getLocalRepositoryPackages($excludeRootPackage = false)
    {
        $repositoryManager = $this->composer->getRepositoryManager();
        $localRepository = $repositoryManager->getLocalRepository();
        $packages = $localRepository->getPackages();
        if ($excludeRootPackage) {
            $result = array();
            foreach ($packages as $package) {
                if (!$package instanceof RootPackageInterface) {
                    $result[] = $package;
                }
            }
        } else {
            $result = $packages;
        }

        return $result;
    }
791672
public static function getDirectories() {
        Logger::info("Resolving dependencies for project");
        $packages = array();
        $root = dirname(dirname(dirname(dirname(dirname(dirname(dirname(__FILE__)))))));
        $composer = file_get_contents($root . DIRECTORY_SEPARATOR . 'composer.json');
        $composer = json_decode($composer, true);
        if (array_key_exists('require', $composer) && !empty($composer['require'])) {
            foreach ($composer['require'] as $requirement => $version) {
                $packages = array_merge(self::readFile($requirement), $packages);
            }
        } else {
            Logger::trace("Project has no dependencies");
        }
        foreach ($packages as $package) {
            Logger::debug("Project references package %s", $package);
        }
        Logger::info("%d dependencies found", count($packages));
        return $packages;
    }