Inheritance: extends Migration
コード例 #1
0
        if ($red) {
            $msg = "** {$msg}";
        }
        echo str_pad($msg, 100) . "\n";
    }
}
/*---------------------------------------------------------------------*/
if (!TableExists("glpi_configs")) {
    die("GLPI not installed\n");
}
$plugin = new Plugin();
include GLPI_ROOT . "/plugins/timelineticket/install/update.php";
include GLPI_ROOT . "/plugins/timelineticket/locales/en_GB.php";
include GLPI_ROOT . "/plugins/timelineticket/hook.php";
$current_version = pluginTimelineticketGetCurrentVersion(PLUGIN_TIMELINETICKET_VERSION);
$migration = new CliMigration($current_version);
if (!isset($current_version)) {
    $current_version = 0;
}
if ($current_version == '0') {
    $migration->displayWarning("***** Install process of plugin TIMELINETICKET *****");
} else {
    $migration->displayWarning("***** Update process of plugin TIMELINETICKET *****");
}
$migration->displayWarning("Current Timelineticket version: {$current_version}");
$migration->displayWarning("Version to update: " . PLUGIN_TIMELINETICKET_VERSION);
// To prevent problem of execution time
ini_set("max_execution_time", "0");
ini_set("memory_limit", "-1");
$mess = '';
if ($current_version != PLUGIN_TIMELINETICKET_VERSION and $current_version != '0') {
コード例 #2
0
    function displayWarning($msg, $red = FALSE)
    {
        if ($red) {
            $msg = "** {$msg}";
        }
        echo str_pad($msg, 100) . "\n";
    }
}
/*---------------------------------------------------------------------*/
if (!TableExists("glpi_configs")) {
    die("GLPI not installed\n");
}
$plugin = new Plugin();
include GLPI_ROOT . "/plugins/monitoring/install/update.php";
$current_version = pluginMonitoringGetCurrentVersion(PLUGIN_MONITORING_VERSION);
$migration = new CliMigration($current_version);
if (!isset($current_version)) {
    $current_version = 0;
}
if ($current_version == '0') {
    $migration->displayWarning("***** Install process of plugin MONITORING *****");
} else {
    $migration->displayWarning("***** Update process of plugin MONITORING *****");
}
$migration->displayWarning("Current Monitoring version: {$current_version}");
$migration->displayWarning("Version to update: " . PLUGIN_MONITORING_VERSION);
// To prevent problem of execution time
ini_set("max_execution_time", "0");
ini_set("memory_limit", "-1");
$mess = '';
if ($current_version != PLUGIN_MONITORING_VERSION and $current_version != '0') {
コード例 #3
0
ファイル: cliupdate.php プロジェクト: btry/glpi
    $glpilanguage = trim($DB->result($result, 0, 1));
    // < 0.85
} else {
    if (FieldExists('glpi_configs', 'version')) {
        // Get current version and language
        $query = "SELECT `version`, `language`\n             FROM `glpi_configs`";
        $result = $DB->queryOrDie($query, "get current version");
        $current_version = trim($DB->result($result, 0, 0));
        $glpilanguage = trim($DB->result($result, 0, 1));
    } else {
        $configurationValues = Config::getConfigurationValues('core', array('version', 'language'));
        $current_version = $configurationValues['version'];
        $glpilanguage = $configurationValues['language'];
    }
}
$migration = new CliMigration(GLPI_VERSION);
$migration->displayWarning("Current GLPI Data version: {$current_version}");
$migration->displayWarning("Current GLPI Code version: " . GLPI_VERSION);
$migration->displayWarning("Default GLPI Language: {$glpilanguage}");
// To prevent problem of execution time
ini_set("max_execution_time", "0");
// for change name of the version - to delete in next version
if ($current_version != "0.91" && GLPI_VERSION != 9.1) {
    if (version_compare($current_version, GLPI_VERSION, 'ne') && !in_array('--upgrade', $_SERVER['argv'])) {
        die("Upgrade required\n");
    }
}
switch ($current_version) {
    case "0.72.3":
    case "0.72.4":
        include_once "../install/update_0723_078.php";
コード例 #4
0
ini_set('display_errors', 'On');
error_reporting(E_ALL | E_STRICT);
//set_error_handler('userErrorHandlerDebug');
$DB = new DB();
if (!$DB->connected) {
    die("No DB connection\n");
}
/*---------------------------------------------------------------------*/
if (!TableExists("glpi_configs")) {
    die("GLPI not installed\n");
}
$plugin = new Plugin();
require_once GLPI_ROOT . "/plugins/fusioninventory/install/climigration.class.php";
include GLPI_ROOT . "/plugins/fusioninventory/install/update.php";
$current_version = pluginFusioninventoryGetCurrentVersion();
$migration = new CliMigration($current_version);
if (!isset($current_version)) {
    $current_version = 0;
}
if ($current_version == '0') {
    $migration->displayWarning("***** Install process of plugin FUSIONINVENTORY *****");
} else {
    $migration->displayWarning("***** Update process of plugin FUSIONINVENTORY *****");
}
$migration->displayWarning("Current FusionInventory version: {$current_version}");
$migration->displayWarning("Version to update: " . PLUGIN_FUSIONINVENTORY_VERSION);
// To prevent problem of execution time
ini_set("max_execution_time", "0");
ini_set("memory_limit", "-1");
ini_set("session.use_cookies", "0");
$mess = '';