69 lines
2.4 KiB
PHP
69 lines
2.4 KiB
PHP
#!/usr/bin/env php
|
|
<?php
|
|
/**
|
|
* OrangeHRM is a comprehensive Human Resource Management (HRM) System that captures
|
|
* all the essential functionalities required for any enterprise.
|
|
* Copyright (C) 2006 OrangeHRM Inc., http://www.orangehrm.com
|
|
*
|
|
* OrangeHRM is free software; you can redistribute it and/or modify it under the terms of
|
|
* the GNU General Public License as published by the Free Software Foundation; either
|
|
* version 2 of the License, or (at your option) any later version.
|
|
*
|
|
* OrangeHRM is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
|
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
* See the GNU General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License along with this program;
|
|
* if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
|
* Boston, MA 02110-1301, USA
|
|
*/
|
|
|
|
$pathToAutoload = realpath(__DIR__ . '/../src/vendor/autoload.php');
|
|
|
|
$errorMessage = "
|
|
Cannot find composer dependencies.
|
|
Run below command and try again;\n
|
|
$ cd %s
|
|
$ composer install -d src
|
|
";
|
|
|
|
if (!$pathToAutoload) {
|
|
echo sprintf($errorMessage, realpath(__DIR__ . '/../'));
|
|
exit(1);
|
|
}
|
|
|
|
use OrangeHRM\Framework\Console\Console;
|
|
use OrangeHRM\Framework\Http\Session\MemorySessionStorage;
|
|
use OrangeHRM\Framework\Http\Session\Session;
|
|
use OrangeHRM\Framework\ServiceContainer;
|
|
use OrangeHRM\Framework\Services;
|
|
use OrangeHRM\Installer\Command\InstallerCountryListCommand;
|
|
use OrangeHRM\Installer\Command\InstallOnExistingDatabaseCommand;
|
|
use OrangeHRM\Installer\Command\InstallOnNewDatabaseCommand;
|
|
use OrangeHRM\Installer\Command\UpgradeCommand;
|
|
use OrangeHRM\Installer\Framework\HttpKernel;
|
|
|
|
set_time_limit(0);
|
|
|
|
require_once $pathToAutoload;
|
|
|
|
$env = 'prod';
|
|
$debug = 'prod' !== $env;
|
|
|
|
$console = new Console();
|
|
new HttpKernel($env, $debug); // initializing kernel
|
|
$sessionStorage = new MemorySessionStorage();
|
|
ServiceContainer::getContainer()->set(Services::SESSION_STORAGE, $sessionStorage);
|
|
$session = new Session($sessionStorage);
|
|
$session->start();
|
|
ServiceContainer::getContainer()->set(Services::SESSION, $session);
|
|
|
|
$console->add(new InstallOnNewDatabaseCommand());
|
|
$console->add(new InstallOnExistingDatabaseCommand());
|
|
$console->add(new UpgradeCommand());
|
|
$console->add(new InstallerCountryListCommand());
|
|
|
|
$console->setName('OrangeHRM Command Line Installer');
|
|
$console->setVersion('1.0.0');
|
|
$console->run();
|