$config['history_db_host'], 'port' => $config['history_db_port'], 'name' => $config['history_db_name'], 'user' => $config['history_db_user'], 'pass' => $config['history_db_pass'], ] ); $historical_dbh = $dbm->getDBH(); } $current_mr = db_get_value('value', 'tconfig', 'token', 'MR'); echo 'MR: '.$current_mr."\n"; if ((bool) $historical_dbh === true) { echo 'current historyDB MR: '.Config::get('MR', 'unknown', true)."\n"; } global $pandora_version; if (isset($pandora_version) === true && empty($pandora_version) === false ) { $version_array = explode('.', $pandora_version); if (is_array($version_array) === true) { $current_package = $version_array[2]; if (count($version_array) > 2) { foreach ($version_array as $key => $value) { if ($key > 2) { $current_package .= '.'.$value; } } } } } $umc = new UpdateManager\Client( [ 'homedir' => $config['homedir'], 'dbconnection' => $config['dbconnection'], 'historydb' => $historical_dbh, 'MR' => (int) $current_mr, 'current_package' => ($current_package ?? ''), ] ); if ($umc->applyAllMRPending() !== true) { echo ($umc->getMR() + 1).': '.$umc->getLastError(); } $current_mr = $umc->getMR(); echo 'current MR: '.$current_mr."\n"; if ((bool) $historical_dbh === true) { echo 'current historyDB MR: '.Config::get('MR', 'unknown', true)."\n"; } } catch (Exception $e) { echo $e->getMessage().' in '.$e->getFile().':'.$e->getLine()."\n"; }