Files
Phraseanet/bin/setup
Aina Sitraka 71ef4bf1dd PHRAS-4011 : Moving cmd from console to setup - system:clear-cache system:clear-session (#4460)
* cmd clear cache in bin/setup

* Change maintenance state wording
2024-01-22 10:34:13 +01:00

94 lines
3.6 KiB
PHP
Executable File

#!/usr/bin/env php
<?php
/*
* This file is part of Phraseanet
*
* (c) 2005-2016 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace KonsoleKommander;
use Alchemy\Phrasea\Command\Setup\ConfigurationEditor;
use Alchemy\Phrasea\Command\Setup\FixAutoincrements;
use Alchemy\Phrasea\Command\Setup\FixLogCollId;
use Alchemy\Phrasea\Command\Setup\SystemClearCacheCommand;
use Alchemy\Phrasea\Command\Setup\SystemClearSessionCacheCommand;
use Alchemy\Phrasea\Core\Version;
use Alchemy\Phrasea\Command\UpgradeDBDatas;
use Alchemy\Phrasea\Command\Setup\Install;
use Alchemy\Phrasea\Command\Setup\CrossDomainGenerator;
use Alchemy\Phrasea\Command\Setup\PluginsReset;
use Alchemy\Phrasea\Command\Plugin\ListPlugin;
use Alchemy\Phrasea\Command\Plugin\AddPlugin;
use Alchemy\Phrasea\Command\Plugin\RemovePlugin;
use Alchemy\Phrasea\Command\Plugin\EnablePlugin;
use Alchemy\Phrasea\Command\Plugin\DisablePlugin;
use Alchemy\Phrasea\Command\Plugin\DownloadPlugin;
use Alchemy\Phrasea\CLI;
use Alchemy\Phrasea\Command\Setup\CheckEnvironment;
use Alchemy\Phrasea\Core\CLIProvider\DoctrineMigrationServiceProvider;
use Alchemy\Phrasea\Setup\ConfigurationTester;
require_once __DIR__ . '/../vendor/autoload.php';
$version = new Version();
$app = new CLI("
_____ _ _ _____ _____ ______ _ _ ______ _______
| __ \| | | | __ \ /\ / ____| ____| /\ | \ | | ____|__ __|
| |__) | |__| | |__) | / \ | (___ | |__ / \ | \| | |__ | |
| ___/| __ | _ / / /\ \ \___ \| __| / /\ \ | . ` | __| | |
| | | | | | | \ \ / ____ \ ____) | |____ / ____ \| |\ | |____ | |
|_| |_| |_|_| \_|_/ \_\_____/|______/_/ \_\_| \_|______| |_|
__
________ / /___ ______
/ ___/ _ \/ __/ / / / __ \
(__ ) __/ /_/ /_/ / /_/ /
/____/\___/\__/\__,_/ .___/
/_/
Phraseanet Copyright (C) 2004 Alchemy
This program comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to redistribute it
under certain conditions; type `about:license' for details.\n\n"
. ' SETUP', $version->getName() . ' ' . $version->getNumber());
$app->register(new DoctrineMigrationServiceProvider());
$app->command(new \module_console_aboutAuthors('about:authors'));
$app->command(new \module_console_aboutLicense('about:license'));
/** @var ConfigurationTester $configurationTester */
$configurationTester = $app['phraseanet.configuration-tester'];
if($configurationTester->isMigrable() || $configurationTester->isUpgradable() || $configurationTester->isInstalled()) {
$app->command(new \module_console_systemUpgrade('system:upgrade'));
}
if ($configurationTester->isInstalled()) {
$app->command(new UpgradeDBDatas('system:upgrade-datas'));
$app->command(new ConfigurationEditor('system:config'));
}
$app->command(new AddPlugin());
$app->command(new DownloadPlugin());
$app->command(new ListPlugin());
$app->command(new RemovePlugin());
$app->command(new PluginsReset());
$app->command(new EnablePlugin());
$app->command(new DisablePlugin());
$app->command(new CheckEnvironment('check:system'));
$app->command(new Install('system:install', $app['phraseanet.structure-template']));
$app->command(new CrossDomainGenerator());
$app->command(new FixAutoincrements('system:fix-autoincrements'));
$app->command(new FixLogCollId());
$app->command(new SystemClearCacheCommand());
$app->command(new SystemClearSessionCacheCommand());
$app['phraseanet.setup_mode'] = true;
$app->run();