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

Commit

Permalink
Update test tu use glpi 9.1.1 database.
Browse files Browse the repository at this point in the history
Enhance error text when not have compatible GLPI version.
Add error to deny install witj cli_install script if GLPI version not compatible.
  • Loading branch information
David Durieux authored and trasher committed Nov 17, 2016
1 parent 7d117a7 commit 15270f0
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion phpunit/0_Install/GLPIInstallTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function installDatabase() {
} else if ($glpi_version == '0.85/bugfixes') {
$glpisql = '0.85.5';
} else {
$glpisql = '9.1';
$glpisql = '9.1.1';
}

$result = load_mysql_file(
Expand Down
5 changes: 5 additions & 0 deletions scripts/cli_install.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,11 @@

$migration = new CliMigration($current_version);

if (!plugin_fusioninventory_check_prerequisites()) {
echo "\n";
exit(1);
}

if (!isset($current_version)) {
$current_version = 0;
}
Expand Down
8 changes: 4 additions & 4 deletions setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -491,10 +491,10 @@ function plugin_version_fusioninventory() {
'version' => PLUGIN_FUSIONINVENTORY_VERSION,
'license' => 'AGPLv3+',
'oldname' => 'tracker',
'author' =>'<a href="mailto:[email protected]">David DURIEUX</a>
'author' =>'<a href="mailto:[email protected]">David DURIEUX</a>
& FusionInventory team',
'homepage' =>'http://forge.fusioninventory.org/projects/fusioninventory-for-glpi/',
'minGlpiVersion' => '9.1'
'minGlpiVersion' => '9.1.1'
);
}

Expand All @@ -513,8 +513,8 @@ function plugin_fusioninventory_check_prerequisites() {
$_SESSION['glpi_plugins'] = array();
}

if (version_compare(GLPI_VERSION, '9.1', 'lt') || version_compare(GLPI_VERSION, '9.2', 'ge')) {
echo __('Your GLPI version not compatible, require >= 9.1', 'fusioninventory');
if (version_compare(GLPI_VERSION, '9.1.1', 'lt') || version_compare(GLPI_VERSION, '9.2', 'ge')) {
echo __('Your GLPI version not compatible, require >= 9.1.1 and < 9.2', 'fusioninventory');
return FALSE;
}

Expand Down

0 comments on commit 15270f0

Please sign in to comment.