Dump autoloaders.

@throws \Bolt\Exception\PackageManagerException

@return int 0 on success or a positive error code on failure
977604
public function execute()
    {
        /** @var $composer \Composer\Composer */
        $composer = $this->getComposer();
        $installationManager = $composer->getInstallationManager();
        $localRepo = $composer->getRepositoryManager()->getLocalRepository();
        $package = $composer->getPackage();
        $config = $composer->getConfig();

        $optimize = $this->getOptions()->optimize() || $this->getOptions()->optimizeAutoloader();
        $authoritative = $this->getOptions()->classmapAuthoritative() || $config->get('classmap-authoritative');

        if ($optimize || $authoritative) {
            $this->getIO()->writeError('<info>Generating optimized autoload files</info>');
        } else {
            $this->getIO()->writeError('<info>Generating autoload files</info>');
        }

        $generator = $composer->getAutoloadGenerator();
        $generator->setDevMode(!$this->getOptions()->noDev());
        $generator->setClassMapAuthoritative($authoritative);
        $generator->setRunScripts(!$this->getOptions()->noScripts());

        try {
            $generator->dump($config, $localRepo, $package, $installationManager, 'composer', $optimize);
        } catch (\Exception $e) {
            $msg = sprintf('%s received an error from Composer: %s in %s::%s', __METHOD__, $e->getMessage(), $e->getFile(), $e->getLine());
            $this->app['logger.system']->critical($msg, ['event' => 'exception', 'exception' => $e]);

            throw new PackageManagerException($e->getMessage(), $e->getCode(), $e);
        }

        return 0;
    }
347797
private function userInputPackages($only_packages)
    {
        $found = ['total' => 0];
        $ignore = [];

        if (!\count($only_packages)) {
            $this->output->writeln('');
        } else {
            foreach ($only_packages as $only_package) {
                $find = $this->gpm->findPackage($only_package);

                if (!$find || (!$this->overwrite && !$this->gpm->isUpdatable($find->slug))) {
                    $name = $find->slug ?? $only_package;
                    $ignore[$name] = $name;
                } else {
                    $found[$find->slug] = $find;
                    $found['total']++;
                }
            }

            if ($found['total']) {
                $list = $found;
                unset($list['total']);
                $list = array_keys($list);

                if ($found['total'] !== $this->data['total']) {
                    $this->output->write(", only <magenta>{$found['total']}</magenta> will be updated");
                }

                $this->output->writeln('');
                $this->output->writeln('Limiting updates for only <cyan>' . implode('</cyan>, <cyan>',
                        $list) . '</cyan>');
            }

            if (\count($ignore)) {
                $this->output->writeln('');
                $this->output->writeln('Packages not found or not requiring updates: <red>' . implode('</red>, <red>',
                        $ignore) . '</red>');

            }
        }

        return $found;
    }
571989
public function getSupportedPackages()
    {
        try {
            return $this->getSupportedAddonsLoader()->getAddonNames() ?: [];
        } catch (RuntimeException $exception) {
            echo $exception->getMessage() . PHP_EOL;
        }

        return null;
    }
527477
public function dump()
    {
        if (!method_exists($this->filesystem, 'dumpFile')) {
            throw new \RuntimeException('Method dumpFile() is not available on your Filesystem component version, you should upgrade it.');
        }

        $this->initDirection();
        $feed = $this->feedManager->get($this->name);

        if ($this->entity) {
            $repository = $this->em->getRepository($this->entity);
            $items = $repository->findBy([], $this->orderBy, $this->limit);
            $feed->addFromArray($items);
        } elseif ($feed->hasItems()) {
            throw new \LogicException(sprintf('An entity should be set OR you should use setItems() first'));
        }

        $dump = $feed->render($this->format);
        $filepath = $this->rootDir.$this->filename;

        $this->filesystem->dumpFile($filepath, $dump);
    }
1094161
protected function dump() {
    $str = '';
    foreach (array_values($this->loadedObjects) as $curObject) {
      $str .= $curObject->dump();
    }
    return $str;
  }
54328
public function getInstallTargetManager()
    {
        if (!$this->installTargetManager) {
            $this->installTargetManager = new PackageFileInstallTargetManager(
                $this->getPuli()->getRootPackageFileManager(),
                $this->getInstallerManager()
            );
        }

        return $this->installTargetManager;
    }
1158303
public function installAll()
    {
        try {
            $response = $this->manager()->installPackages();
        } catch (\Exception $e) {
            return $this->getJsonException($e);
        }

        if ($response === 0) {
            return new Response($this->manager()->getOutput());
        }

        return $this->getJsonException(new PackageManagerException($this->manager()->getOutput(), $response));
    }
29516
public static function registerAutoloader()
	{
		if (null !== static::$loader) {
			return static::$loader;
		}

		static::$loader = $loader = new \Composer\Autoload\ClassLoader();
		$vendorDir = dirname(__DIR__);
		$baseDir = dirname($vendorDir);

		$map = require 'phar://'.__DIR__.'/../../../composer.phar/vendor/composer/autoload_namespaces.php';
		foreach ($map as $namespace => $path) {
			$loader->set($namespace, $path);
		}

		$map = require 'phar://'.__DIR__.'/../../../composer.phar/vendor/composer/autoload_psr4.php';
		foreach ($map as $namespace => $path) {
			$loader->setPsr4($namespace, $path);
		}

		$classMap = require 'phar://'.__DIR__.'/../../../composer.phar/vendor/composer/autoload_classmap.php';
		if ($classMap) {
			$loader->addClassMap($classMap);
		}

		$loader->register();

		return $loader;
	}
936801
protected function getAutoloaderFile()
    {
        $app_path = $this->getPlainPath();
        $root_path = dirname($this->getPlainPath());
        $autoloader_file = str_replace($root_path, '', $app_path) . DIRECTORY_SEPARATOR . 'autoloader.php';
        return trim($autoloader_file, "/");
    }
827962
public function postAutoloadDump()
    {
        $graph = $this->getGraph();

        $this->io->write('<info>Pass 3/3: Performing individual generation</info>');
        $this->generateConcreteIndividualCode($graph);
    }
1132091
public function getPackageHandle()
    {
        $pkgID = $this->getPackageID();

        return $pkgID ? PackageList::getHandle($this->pkgID) : null;
    }
223787
public function getClassLoaders()
    {
        if (null !== static::$classLoaders) {
            return static::$classLoaders;
        }

        static::$classLoaders = array();

        foreach (spl_autoload_functions() as $function) {
            if (is_array($function) && count($function[0]) > 0 && is_object($function[0]) && 'Composer\Autoload\ClassLoader' === get_class($function[0])) {
                static::$classLoaders[] = $function[0];
            }
        }

        return static::$classLoaders;
    }
1178805
public function dumpAutoloads($extra = '')
    {
        $command = $this->findComposer() .' dump-autoload';

        if (! empty($extra)) {
            $command = trim($command .' ' .$extra);
        }

        $process = $this->getProcess();

        $process->setCommandLine($command);

        $process->run();
    }
1256738
public static function postAutoloadDump(Event $event): void
    {
        $event->getIO()->write('<info>    Packages Auto-Discovery [Executed]</info>');
        $vendorPath = $event->getComposer()->getConfig()->get('vendor-dir');
        $manifestPath = $vendorPath . '/../bootstrap/cache/packages.php';

        self::discoverPackages($vendorPath, $manifestPath);
    }
1201916
protected function doExecute()
    {
        $env      = $this->getOption('env');
        $resolver = ConsoleHelper::getAllPackagesResolver($env, $this->console);
        $names    = $this->io->getArguments();

        if (!$names) {
            throw new \InvalidArgumentException('No package input.');
        }

        foreach ($names as $name) {
            $this->out()
                ->out('Start installing package: <info>' . $name . '</info>')
                ->out('---------------------------');

            $package = $resolver->getPackage($name);

            if (!$package) {
                $this->err('<comment>Package: ' . $name . ' not found.</comment>');

                continue;
            }

            $this->installConfig($package);
            $this->installRouting($package);
            $this->copyMigration($package);
            $this->copySeeders($package);
            $this->syncAssets($package);

            if (is_callable([$package, 'install'])) {
                $package->install($this);
            }
        }

        return true;
    }
988801
public static function dump()
    {
        $modules = array();
        static::select('name', 'type', 'updated_at')->get()->each(function($module) use (&$modules) {
            if (!isset($modules[ $module->type ])) {
                $modules[ $module->type ] = array();
            }
            $modules[ $module->type ][ $module->name ] = $module->updated_at->timestamp;
        });
        return $modules;
    }
493265
protected function autoRetry()
    {
        if ($this->attempts() <= $this->config['retry']) {
            return $this->connector->release($this, $this->config['delay']);
        }
    }