Translated using Weblate (Slovenian)
[phpmyadmin.git] / scripts / console
blob018e8f47082caad91c96925c880f767278fccc8a
1 #!/usr/bin/env php
2 <?php
4 use PhpMyAdmin\Command\CacheWarmupCommand;
5 use PhpMyAdmin\Command\FixPoTwigCommand;
6 use PhpMyAdmin\Command\SetVersionCommand;
7 use PhpMyAdmin\Command\WriteGitRevisionCommand;
8 use PhpMyAdmin\Command\TwigLintCommand;
9 use PhpMyAdmin\Config;
10 use PhpMyAdmin\Core;
11 use PhpMyAdmin\DatabaseInterface;
12 use PhpMyAdmin\Tests\Stubs\DbiDummy;
13 use Symfony\Component\Console\Application;
15 if (! defined('ROOT_PATH')) {
16 define('ROOT_PATH', dirname(__DIR__) . DIRECTORY_SEPARATOR);
19 define('PHPMYADMIN', true);
20 require_once ROOT_PATH . 'libraries/constants.php';
21 require_once AUTOLOAD_FILE;
23 if (! class_exists(Application::class)) {
24 echo 'Be sure to have dev-dependencies installed.' . PHP_EOL;
25 echo 'Command aborted.' . PHP_EOL;
26 exit(1);
29 $containerBuilder = Core::getContainerBuilder();
30 $cfg['environment'] = 'production';
31 $config = new Config();
32 $config->loadAndCheck(CONFIG_FILE);
33 $config->set('environment', $cfg['environment']);
34 $dbi = new DatabaseInterface(new DbiDummy());
36 $application = new Application('phpMyAdmin Console Tool');
38 $application->add(new CacheWarmupCommand());
39 $application->add(new TwigLintCommand());
40 $application->add(new SetVersionCommand());
41 $application->add(new WriteGitRevisionCommand());
42 $application->add(new FixPoTwigCommand());
44 $application->run();