Skip to content
This repository has been archived by the owner on Apr 4, 2024. It is now read-only.

Commit

Permalink
allow install of FusionInventory from CLI using the test context of GLPI
Browse files Browse the repository at this point in the history
  • Loading branch information
btry authored and David Durieux committed Feb 7, 2017
1 parent e87d994 commit e8bb67f
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions scripts/cli_install.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,27 +42,37 @@

chdir(dirname($_SERVER["SCRIPT_FILENAME"]));

include ("../../../inc/includes.php");

include ("./docopt.php");

$doc = <<<DOC
cli_install.php
Usage:
cli_install.php [--no-models-update] [--force-upgrade] [--as-user USER] [--optimize]
cli_install.php [--no-models-update] [--force-upgrade] [--as-user USER] [--optimize] [ --tests ]
Options:
--force-upgrade Force upgrade.
--no-models-update Do not perform SNMP models update.
--as-user USER Do install/upgrade as specified USER.
--optimize Optimize tables.
--tests Use GLPi test database
DOC;

$docopt = new \Docopt\Handler();
$args = $docopt->handle($doc);

if (isset($args)) {
if (isset($args['--tests']) && $args['--tests'] !== false) {
// Use test GLPi's database
// Requires use of cliinstall of GLPI with --tests argument
define('GLPI_ROOT', dirname(dirname(dirname(__DIR__))));
define("GLPI_CONFIG_DIR", GLPI_ROOT . "/tests");
}
}

include ("../../../inc/includes.php");

// Init debug variable
$_SESSION['glpi_use_mode'] = Session::DEBUG_MODE;
$_SESSION['glpilanguage'] = "en_GB";
Expand Down

0 comments on commit e8bb67f

Please sign in to comment.