1
0
mirror of https://github.com/php/pie.git synced 2026-03-23 23:12:17 +01:00
Files
archived-pie/bin/pie
2025-10-14 19:44:55 +01:00

64 lines
2.2 KiB
PHP
Executable File

#!/usr/bin/env php
<?php
declare(strict_types=1);
namespace Php\Pie;
use Php\Pie\Command\BuildCommand;
use Php\Pie\Command\DownloadCommand;
use Php\Pie\Command\InfoCommand;
use Php\Pie\Command\InstallCommand;
use Php\Pie\Command\InstallExtensionsForProjectCommand;
use Php\Pie\Command\RepositoryAddCommand;
use Php\Pie\Command\RepositoryListCommand;
use Php\Pie\Command\RepositoryRemoveCommand;
use Php\Pie\Command\SelfUpdateCommand;
use Php\Pie\Command\SelfVerifyCommand;
use Php\Pie\Command\ShowCommand;
use Php\Pie\Command\UninstallCommand;
use Php\Pie\Util\PieVersion;
use Symfony\Component\Console\Application;
use Symfony\Component\Console\CommandLoader\ContainerCommandLoader;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\EventDispatcher\EventDispatcher;
use function error_reporting;
use const E_DEPRECATED;
require_once __DIR__ . '/../src/Util/PieVersion.php';
if (PieVersion::isPharBuild()) {
error_reporting(error_reporting() & ~E_DEPRECATED);
}
// phpcs:ignore Squiz.NamingConventions.ValidVariableName.NotCamelCaps
include $_composer_autoload_path ?? __DIR__ . '/../vendor/autoload.php';
$container = Container::factory();
$application = new Application('🥧 PHP Installer for Extensions (PIE)', PieVersion::get());
$application->setDispatcher($container->get(EventDispatcher::class));
$application->setCommandLoader(new ContainerCommandLoader(
$container,
[
'download' => DownloadCommand::class,
'build' => BuildCommand::class,
'install' => InstallCommand::class,
'info' => InfoCommand::class,
'show' => ShowCommand::class,
'repository:list' => RepositoryListCommand::class,
'repository:add' => RepositoryAddCommand::class,
'repository:remove' => RepositoryRemoveCommand::class,
'uninstall' => UninstallCommand::class,
'self-update' => SelfUpdateCommand::class,
'self-verify' => SelfVerifyCommand::class,
'install-extensions-for-project' => InstallExtensionsForProjectCommand::class,
],
));
$application->run($container->get(InputInterface::class), $container->get(OutputInterface::class));