#!/usr/bin/env php getParameterOption(['--env', '-e'], getenv('SILEX_ENV') ?: 'dev'); $debug = getenv('SILEX_DEBUG') !== '0' && !$input->hasParameterOption(['--no-debug', '']) && $env !== 'prod'; if($debug){ Debug::enable(); } $application = new Application('Yamaha AV Console', '0.0.x-dev'); $connection = new \Doctrine\DBAL\Connection([ 'driver' => 'pdo_sqlite', 'path' => __DIR__.'/../config/app.db', 'charset' => 'utf8mb4', 'collate' => 'utf8mb4_unicode_ci', ], new Doctrine\DBAL\Driver\PDOSqlite\Driver()); \Doctrine\DBAL\Types\Type::addType('uuid', \Ramsey\Uuid\Doctrine\UuidType::class); $application->getDefinition() ->addOptions([new \Symfony\Component\Console\Input\InputOption('zone', 'z', \Symfony\Component\Console\Input\InputOption::VALUE_REQUIRED, 'Which zone to interact with', 'main')]); $application->add(new \Sikofitt\Yamaha\AV\Console\Command\MuteCommand()); $application->add(new \Sikofitt\Yamaha\AV\Console\Command\VolumeCommand()); $application->add(new \Sikofitt\Yamaha\AV\Console\Command\StatusCommand($connection)); $application->add(new \Sikofitt\Yamaha\AV\Console\Command\InputCommand()); $application->add(new \Sikofitt\Yamaha\AV\Command\ConfigurationCommand(__DIR__.'/..')); $application->add(new \Sikofitt\Yamaha\AV\Console\Command\CreateDatabaseCommand($connection)); $application->add(new \Sikofitt\Yamaha\AV\Console\Command\CreateUserCommand($connection)); $application->add(new \Sikofitt\Yamaha\AV\Console\Command\CreateApiTokenCommand(new \Sikofitt\Yamaha\AV\Repository\UserRepository($connection))); $application->run($input);