phpmyadmin/bin/console
Maurício Meneghini Fauth bd2140576b
Remove the PHPMYADMIN constant
This constant was used to avoid non-entry-points scripts being called
directly. As phpMyAdmin has a public directory now, directly calling
scripts outside public is not possible anymore.

Introduced by afbb2a9dc2.

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2024-07-25 16:48:18 -03:00

44 lines
1.3 KiB
PHP
Executable File

#!/usr/bin/env php
<?php
use PhpMyAdmin\Command\CacheWarmupCommand;
use PhpMyAdmin\Command\FixPoTwigCommand;
use PhpMyAdmin\Command\SetVersionCommand;
use PhpMyAdmin\Command\WriteGitRevisionCommand;
use PhpMyAdmin\Command\TwigLintCommand;
use PhpMyAdmin\Config;
use PhpMyAdmin\Container\ContainerBuilder;
use PhpMyAdmin\DatabaseInterface;
use PhpMyAdmin\Tests\Stubs\DbiDummy;
use Symfony\Component\Console\Application;
if (! defined('ROOT_PATH')) {
define('ROOT_PATH', dirname(__DIR__) . DIRECTORY_SEPARATOR);
}
require_once ROOT_PATH . 'app/constants.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 = ContainerBuilder::getContainer();
$cfg['environment'] = 'production';
$config = new Config();
$config->loadAndCheck(CONFIG_FILE);
$config->set('environment', $cfg['environment']);
$dbi = new DatabaseInterface(new DbiDummy());
$application = new Application('phpMyAdmin Console Tool');
$application->add(new CacheWarmupCommand());
$application->add(new TwigLintCommand());
$application->add(new SetVersionCommand());
$application->add(new WriteGitRevisionCommand());
$application->add(new FixPoTwigCommand());
$application->run();