function XXXtestRun()
 {
     $aConf = $GLOBALS['_MAX']['CONF'];
     $result = OA_Maintenance_Priority::run();
     $this->assertTrue($result);
     $phpPath = $aConf['test']['phpPath'] . ' -f';
     $testPath = MAX_PATH . '/lib/OA/Maintenance/tests/unit/PriorityFork.php';
     $host = $_SERVER['SERVER_NAME'];
     system("{$phpPath} {$testPath} {$host}", $result);
     // 0 means it executed successfully, meaning the test was successful
     $this->assertEqual($result, 0);
 }
Esempio n. 2
0
 function testForkRun()
 {
     require_once MAX_PATH . '/lib/OA/Maintenance/Priority.php';
     $pid = pcntl_fork();
     if ($pid == -1) {
         // something bad happened
     } else {
         if ($pid == 0) {
             $resultChild = OA_Maintenance_Priority::run();
         } else {
             $resultParent = OA_Maintenance_Priority::run();
         }
     }
     isset($resultParent) && $resultParent === true ? exit : exit(1);
 }
Esempio n. 3
0
 /**
  * A private method to run MPE.
  *
  * @access private
  */
 function _runMPE()
 {
     OA_Maintenance_Priority::run(true);
 }
| it under the terms of the GNU General Public License as published by      |
| the Free Software Foundation; either version 2 of the License, or         |
| (at your option) any later version.                                       |
|                                                                           |
| This program is distributed in the hope that it will be useful,           |
| but WITHOUT ANY WARRANTY; without even the implied warranty of            |
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the             |
| GNU General Public License for more details.                              |
|                                                                           |
| You should have received a copy of the GNU General Public License         |
| along with this program; if not, write to the Free Software               |
| Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA |
+---------------------------------------------------------------------------+
$Id: maintenance-priority-calculate.php 37157 2009-05-28 12:31:10Z andrew.hill $
*/
// Require the initialisation file
require_once '../../init.php';
// Required files
require_once MAX_PATH . '/www/admin/config.php';
require_once MAX_PATH . '/lib/OA/Maintenance/Priority.php';
// Security check
OA_Permission::enforceAccount(OA_ACCOUNT_ADMIN);
/*-------------------------------------------------------*/
/* Main code                                             */
/*-------------------------------------------------------*/
// Run the Maintenance Priority Engine process
OA_Maintenance_Priority::run();
// Rebuild cache
// include_once MAX_PATH . '/lib/max/deliverycache/cache-'.$conf['delivery']['cache'].'.inc.php';
// phpAds_cacheDelete();
OX_Admin_Redirect::redirect('maintenance-priority.php');
<?php

/*
+---------------------------------------------------------------------------+
| Revive Adserver                                                           |
| http://www.revive-adserver.com                                            |
|                                                                           |
| Copyright: See the COPYRIGHT.txt file.                                    |
| License: GPLv2 or later, see the LICENSE.txt file.                        |
+---------------------------------------------------------------------------+
*/
//$oMessages initialized by runner OA_Upgrade::runPostUpgradeTask
if (!class_exists('OA_Maintenance_Priority')) {
    require_once MAX_PATH . '/lib/OA/Maintenance/Priority.php';
}
$oMessages->logInfo('Starting Maintenance Prioritisation');
$upgradeTaskResult = OA_Maintenance_Priority::run();
if (PEAR::isError($upgradeTaskResult)) {
    $oMessages->logError($upgradeTaskResult->getCode() . ': ' . $upgradeTaskResult->getMessage());
}
$oMessages->logInfo('Maintenance Prioritisation: ' . ($upgradeTaskResult ? 'Complete' : 'Failed'));
| Copyright (c) 2003-2009 OpenX Limited                                     |
| For contact details, see: http://www.openx.org/                           |
|                                                                           |
| This program is free software; you can redistribute it and/or modify      |
| it under the terms of the GNU General Public License as published by      |
| the Free Software Foundation; either version 2 of the License, or         |
| (at your option) any later version.                                       |
|                                                                           |
| This program is distributed in the hope that it will be useful,           |
| but WITHOUT ANY WARRANTY; without even the implied warranty of            |
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the             |
| GNU General Public License for more details.                              |
|                                                                           |
| You should have received a copy of the GNU General Public License         |
| along with this program; if not, write to the Free Software               |
| Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA |
+---------------------------------------------------------------------------+
$Id: openads_upgrade_task_Maintenance_Priority.php 37157 2009-05-28 12:31:10Z andrew.hill $
*/
if (!class_exists('OA_Maintenance_Priority')) {
    require_once MAX_PATH . '/lib/OA/Maintenance/Priority.php';
}
if (!$upgradeTaskMessage) {
    $upgradeTaskMessage = array();
}
$upgradeTaskError[] = 'Starting Maintenance Prioritisation';
$result = OA_Maintenance_Priority::run();
if (is_null($upgradeTaskResult) || $upgradeTaskResult) {
    $upgradeTaskResult = $result;
}
$upgradeTaskError[] = ' Maintenance Prioritisation: ' . ($result ? 'Complete' : 'Failed');