44 lines
1.3 KiB
PHP
Executable File
44 lines
1.3 KiB
PHP
Executable File
#!/usr/bin/env php
|
|
<?php
|
|
|
|
use PhpMyAdmin\Command\CacheWarmupCommand;
|
|
use PhpMyAdmin\Command\SetVersionCommand;
|
|
use PhpMyAdmin\Command\WriteGitRevisionCommand;
|
|
use PhpMyAdmin\Config;
|
|
use PhpMyAdmin\Core;
|
|
use PhpMyAdmin\DatabaseInterface;
|
|
use PhpMyAdmin\Template;
|
|
use PhpMyAdmin\Tests\Stubs\DbiDummy;
|
|
use Symfony\Bridge\Twig\Command\LintCommand;
|
|
use Symfony\Component\Console\Application;
|
|
|
|
if (! defined('ROOT_PATH')) {
|
|
define('ROOT_PATH', dirname(__DIR__) . DIRECTORY_SEPARATOR);
|
|
}
|
|
|
|
define('PHPMYADMIN', true);
|
|
require_once ROOT_PATH . 'libraries/vendor_config.php';
|
|
require_once AUTOLOAD_FILE;
|
|
|
|
if (! class_exists(Application::class)) {
|
|
echo 'Be sure to have dev-dependencies installed.' . PHP_EOL;
|
|
echo 'Command aborted.' . PHP_EOL;
|
|
exit(1);
|
|
}
|
|
|
|
$containerBuilder = Core::getContainerBuilder();
|
|
$cfg['environment'] = 'production';
|
|
$config = new Config(CONFIG_FILE);
|
|
$config->set('environment', $cfg['environment']);
|
|
$dbi = new DatabaseInterface(new DbiDummy());
|
|
$twig = Template::getTwigEnvironment(ROOT_PATH . 'twig-templates');
|
|
|
|
$application = new Application('phpMyAdmin Console Tool');
|
|
|
|
$application->add(new CacheWarmupCommand());
|
|
$application->add(new LintCommand($twig));
|
|
$application->add(new SetVersionCommand());
|
|
$application->add(new WriteGitRevisionCommand());
|
|
|
|
$application->run();
|