Example #1
0
$current_step = Get::gReq('cur_step', DOTY_INT);
$upg_step = Get::gReq('upg_step', DOTY_INT);
if ($_SESSION['start_version'] >= 3000 && $_SESSION['start_version'] < 4000) {
    echo 'error: version (' . $_SESSION['start_version'] . ') not supported for upgrade: too old (v3)';
    die;
}
if ($current_step != $enabled_step) {
    echo 'error: procedure must be called from upgrade step ' . $enabled_step . ' only!!';
    die;
}
if (!empty($_SESSION['to_upgrade_arr'])) {
    $to_upgrade_arr = $_SESSION['to_upgrade_arr'];
} else {
    $to_upgrade_arr = getToUpgradeArray();
}
$last_ver = getVersionIntNumber($GLOBALS['cfg']['endversion']);
if ($_SESSION['upgrade_ok']) {
    $current_ver = $to_upgrade_arr[$upg_step - 1];
    if ($current_ver != $last_ver) {
        $formalms_version = $GLOBALS['cfg']['versions'][$current_ver];
    } else {
        $formalms_version = $GLOBALS['cfg']['versions'][$GLOBALS['cfg']['endversion']];
    }
    $upgrade_msg .= " <br/>" . "Upgrading to version: " . $formalms_version;
    // --- pre upgrade -----------------------------------------------------------
    $fn = _upgrader_ . '/data/upg_data/' . $current_ver . '_pre.php';
    if (file_exists($fn)) {
        $GLOBALS['debug'] .= " <br/>" . "Source pre-upgrade file: " . $fn;
        require $fn;
        $func = 'preUpgrade' . $current_ver;
        if (function_exists($func)) {
Example #2
0
 function checkRequirements()
 {
     $res = array();
     // phpversion();
     // PHP_VERSION version supported 5.2.x 5.3.x 5.4.x -- experimental 5.5.x 5.6.x
     $res['php'] = version_compare(PHP_VERSION, '5.2.0', '>=') && version_compare(PHP_VERSION, '5.5.0', '<') ? 'ok' : (version_compare(PHP_VERSION, '5.5.0', '>=') && version_compare(PHP_VERSION, '5.7.0', '<') ? 'warn' : 'err');
     // mysql client version, in php the version number is a string regcut it
     preg_match('/([0-9]+\\.[\\.0-9]+)/', mysql_get_client_info(), $version);
     if (empty($version[1])) {
         $res['mysql'] = 'ok';
     } else {
         $res['mysql'] = version_compare($version[1], '5.0') >= 0 ? 'ok' : 'err';
     }
     $res['xml'] = extension_loaded('domxml') ? 'ok' : 'err';
     $res['ldap'] = extension_loaded('ldap') ? 'ok' : 'err';
     $res['mbstring'] = extension_loaded('mbstring') ? 'ok' : 'err';
     $res['strict_mode'] = $this->checkStrictMode() ? 'ok' : 'err';
     $res['openssl'] = extension_loaded('openssl') ? 'ok' : 'err';
     $res['allow_url_fopen'] = $php_conf['allow_url_fopen']['local_value'] ? 'ok' : 'err';
     $res['allow_url_include'] = $php_conf['allow_url_include']['local_value'] ? 'err' : 'ok';
     $res['mime_ct'] = function_exists('mime_content_type') || class_exists('file') && method_exists('finfo', 'file') ? 'ok' : 'err';
     $current_version = $this->getCurrentVersion();
     $end_version = getVersionIntNumber($GLOBALS['cfg']['endversion']);
     if ($current_version == $end_version) {
         $res['upg_not_needed'] = true;
     }
     if (version_compare($current_version, '3600', '>=') && version_compare($current_version, '4000', '<')) {
         // docebo ce versions series 3.x.x.x
         // Upgrader: we check if we are starting from a valid (old) config.php file:
         require_once _base_ . '/config.php';
         $res['config_v3'] = !empty($GLOBALS['dbhost']) ? 'ok' : 'err';
         $res['config_v4'] = 'err';
         $res['config_v1'] = 'err';
     } else {
         require_once _base_ . '/config.php';
         $res['config_v4'] = !empty($GLOBALS['cfg']['db_host']) ? 'ok' : 'err';
         $res['config_v3'] = 'err';
         $res['config_v1'] = 'ok';
     }
     return $res;
 }