/** * A method to test the getConfigVersion() method. */ function testGetConfigVersion() { $oSync = new RV_Sync(); // Prepare sample ascending versions $aVersions = array('v2.3.32-beta-rc10' => 2332.11, '2.3.32-beta-rc11' => 2332.111, 'v2.3.32-beta' => 2332.2, '2.3.33-beta-rc1' => 2333.101, 'v2.3.33-beta' => 2333.2, '2.4.0-rc1' => 2400.301, 'v2.4.0-rc2' => 2400.302, '2.4.0' => 2400.4, 'v2.4.0-stable' => 2400.4, '2.5.0-dev' => 2499.999, '2.5.99-dev-custom' => 2598.999, '2.6.0-beta-rc2-custom' => 2600.102, '2.6.0-beta-custom' => 2600.2, '2.6.0-rc57-custom' => 2600.357, '2.6.0-custom' => 2600.4, 'foo' => false); foreach ($aVersions as $version => $config_version) { $this->assertEqual($oSync->getConfigVersion($version), $config_version); } }
function getPluginVersion() { $version = OA_Dal_ApplicationVariables::get('apStatsGraphsUI_version'); if (class_exists('RV_Sync') || @(include MAX_PATH . '/lib/RV/Sync.php')) { return RV_Sync::getConfigVersion($version); } require_once MAX_PATH . '/lib/OA/Sync.php'; return OA_Sync::getConfigVersion($version); }
echo "<br />" . $current . ".<br /><br />"; phpAds_ShowBreak(); if (!isset($session['maint_update'])) { if (function_exists('xml_parser_create')) { // Show wait please text with rotating logo echo "<br />"; echo "<table border='0' cellspacing='1' cellpadding='2'><tr><td>"; echo "<img src='" . OX::assetPath() . "/images/install-busy.gif' width='16' height='16'>"; echo "</td><td class='install'>" . $strSearchingUpdates . "</td></tr></table>"; // Send the output to the browser if (false !== ob_get_contents()) { ob_flush(); } flush(); // Get updates info and store them into a session var $oSync = new RV_Sync(); $res = $oSync->checkForUpdates(); phpAds_SessionDataRegister('maint_update', $res); phpAds_SessionDataStore(); echo "<script language='JavaScript'>\n"; echo "<!--\n"; echo "document.location.replace('updates-product.php');\n"; echo "//-->\n"; echo "</script>\n"; exit; } else { echo "<br />" . $strNotAbleToCheck . "<br /><br />"; echo "<br /><br />" . $strForUpdatesLookOnWebsite . "<br /><br />"; echo "<b><img src='" . OX::assetPath() . "/images/caret-r.gif'> <a href='http://" . $phpAds_producturl . "' target='_blank'>" . $strClickToVisitWebsite . "</a></b>"; } } else {
/** * A private method to run Revive Adserver Sync. * * @access private */ function _runReviveSync() { $delay = mt_rand(0, 30); // Delay up to 30 seconds OA::debug(sprintf('Delaying ' . PRODUCT_NAME . ' sync process by %d seconds.', $delay), PEAR_LOG_INFO); sleep($delay); require_once MAX_PATH . '/lib/RV/Sync.php'; $oSync = new RV_Sync($this->aConf, $this->aPref); $oSync->checkForUpdates(0); OA::debug('Finished ' . PRODUCT_NAME . ' Sync process.', PEAR_LOG_INFO); }