当前位置: 首页>>代码示例>>PHP>>正文


PHP OX_getMinimumRequiredMemory函数代码示例

本文整理汇总了PHP中OX_getMinimumRequiredMemory函数的典型用法代码示例。如果您正苦于以下问题:PHP OX_getMinimumRequiredMemory函数的具体用法?PHP OX_getMinimumRequiredMemory怎么用?PHP OX_getMinimumRequiredMemory使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了OX_getMinimumRequiredMemory函数的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: run

 /**
  * A method to run maintenance.
  */
 function run()
 {
     // Print a blank line in the debug log file when maintenance starts
     OA::debug();
     // Do not run if distributed stats are enabled
     if (!empty($this->aConf['lb']['enabled'])) {
         OA::debug('Distributed stats enabled, not running maintenance tasks', PEAR_LOG_INFO);
         return;
     }
     // Acquire the maintenance lock
     $oLock =& OA_DB_AdvisoryLock::factory();
     if ($oLock->get(OA_DB_ADVISORYLOCK_MAINTENANCE)) {
         OA::switchLogIdent('maintenance');
         OA::debug();
         OA::debug('Running Maintenance Engine', PEAR_LOG_INFO);
         // Attempt to increase PHP memory
         OX_increaseMemoryLimit(OX_getMinimumRequiredMemory('maintenance'));
         // Set UTC timezone
         OA_setTimeZoneUTC();
         // Get last run
         $oLastRun = $this->getLastRun();
         // Update the timestamp for old maintenance code and auto-maintenance
         $this->updateLastRun();
         // Record the current time, and register with the OA_ServiceLocator
         $oDate = new Date();
         $oServiceLocator =& OA_ServiceLocator::instance();
         $oServiceLocator->register('now', $oDate);
         // Check the operation interval is valid
         $result = OX_OperationInterval::checkOperationIntervalValue($this->aConf['maintenance']['operationInterval']);
         if (PEAR::isError($result)) {
             // Unable to continue!
             $oLock->release();
             OA::debug('Aborting maintenance: Invalid Operation Interval length', PEAR_LOG_CRIT);
             exit;
         }
         // Run the Maintenance Statistics Engine (MSE) process
         $this->_runMSE();
         // Run the "midnight" tasks, if required
         if ($this->isMidnightMaintenance($oLastRun)) {
             $this->_runMidnightTasks();
         }
         // Release lock before starting MPE
         $oLock->release();
         // Run the Maintenance Priority Engine (MPE) process, ensuring that the
         // process always runs, even if instant update of priorities is disabled
         $this->_runMPE();
         // Log the completion of the entire ME process
         OA::switchLogIdent('maintenance');
         $oEndDate = new Date();
         $oDateSpan = new Date_Span();
         $oDateSpan->setFromDateDiff($oDate, $oEndDate);
         OA::debug('Maintenance Engine Completed (Started at ' . $oDate->format('%Y-%m-%d %H:%M:%S') . ' ' . $oDate->tz->getShortName() . ', taking ' . $oDateSpan->format('%H:%M:%S') . ')', PEAR_LOG_INFO);
         OA::switchLogIdent();
     } else {
         OA::switchLogIdent('maintenance');
         OA::debug('Maintenance Engine not run: could not acquire lock', PEAR_LOG_INFO);
         OA::switchLogIdent();
     }
 }
开发者ID:Apeplazas,项目名称:plazadelatecnologia,代码行数:62,代码来源:Maintenance.php

示例2: init

 function init()
 {
     $aConf = $GLOBALS['_MAX']['CONF'];
     $this->pathPackages = $aConf['pluginPaths']['packages'];
     $this->pathPlugins = $aConf['pluginPaths']['plugins'];
     $this->pathPluginsAdmin = $aConf['pluginPaths']['admin'];
     $this->pathDataObjects = $aConf['pluginPaths']['var'] . 'DataObjects/';
     // Attempt to increase the memory limit when using the plugin manager
     OX_increaseMemoryLimit(OX_getMinimumRequiredMemory('plugin'));
     $this->basePath = MAX_PATH;
 }
开发者ID:villos,项目名称:tree_admin,代码行数:11,代码来源:ComponentGroupManager.php

示例3: run

 /**
  * A method to run distributed maintenance.
  */
 function run()
 {
     if (empty($GLOBALS['_MAX']['CONF']['lb']['enabled'])) {
         OA::debug('Distributed stats disabled, not running Maintenance Distributed Engine', PEAR_LOG_INFO);
         return;
     }
     if (!empty($GLOBALS['_MAX']['CONF']['rawDatabase'])) {
         $GLOBALS['_MAX']['CONF']['database'] = $GLOBALS['_MAX']['CONF']['rawDatabase'] + $GLOBALS['_MAX']['CONF']['database'];
         OA::debug('rawDatabase functionality is being used, switching settings', PEAR_LOG_INFO);
     }
     $oLock =& OA_DB_AdvisoryLock::factory();
     if (!$oLock->get(OA_DB_ADVISORYLOCK_DISTRIBUTED)) {
         OA::debug('Maintenance Distributed Engine Already Running', PEAR_LOG_INFO);
         return;
     }
     OA::debug('Running Maintenance Distributed Engine', PEAR_LOG_INFO);
     // Attempt to increase PHP memory
     OX_increaseMemoryLimit(OX_getMinimumRequiredMemory('maintenance'));
     // Ensure the current time is registered with the OA_ServiceLocator
     $oServiceLocator =& OA_ServiceLocator::instance();
     $oNow =& $oServiceLocator->get('now');
     if (!$oNow) {
         // Record the current time, and register with the OA_ServiceLocator
         $oNow = new Date();
         $oServiceLocator->register('now', $oNow);
     }
     OA::debug(' - Current time is ' . $oNow->format('%Y-%m-%d %H:%M:%S') . ' ' . $oNow->tz->getShortName(), PEAR_LOG_DEBUG);
     // Get the components of the deliveryLog extension
     $aBuckets = OX_Component::getComponents('deliveryLog');
     // Copy buckets' records with "interval_start" up to and including previous OI start,
     // and then prune the data processed
     $aPreviousOperationIntervalDates = OX_OperationInterval::convertDateToPreviousOperationIntervalStartAndEndDates($oNow);
     OA::debug(' - Will process data for all operation intervals before and up to start', PEAR_LOG_DEBUG);
     OA::debug('   time of ' . $aPreviousOperationIntervalDates['start']->format('%Y-%m-%d %H:%M:%S') . ' ' . $aPreviousOperationIntervalDates['start']->tz->getShortName(), PEAR_LOG_DEBUG);
     foreach ($aBuckets as $sBucketName => $oBucketClass) {
         if ($oBucketClass->testStatisticsMigration($oBucketClass->getStatisticsMigration())) {
             $oBucketClass->processBucket($aPreviousOperationIntervalDates['start']);
             $oBucketClass->pruneBucket($aPreviousOperationIntervalDates['start']);
         } else {
             OA::debug('  - Skipping ' . $sBucketName, PEAR_LOG_DEBUG);
         }
     }
     $oLock->release();
     OA::debug('Maintenance Distributed Engine Completed', PEAR_LOG_INFO);
 }
开发者ID:akirsch,项目名称:revive-adserver,代码行数:48,代码来源:Distributed.php

示例4: setupIncludePath

        }
    }
    return $host;
}
function setupIncludePath()
{
    static $checkIfAlreadySet;
    if (isset($checkIfAlreadySet)) {
        return;
    }
    $checkIfAlreadySet = true;
    $oxPearPath = MAX_PATH . DIRECTORY_SEPARATOR . 'lib' . DIRECTORY_SEPARATOR . 'pear';
    $oxZendPath = MAX_PATH . DIRECTORY_SEPARATOR . 'lib';
    set_include_path($oxPearPath . PATH_SEPARATOR . $oxZendPath . PATH_SEPARATOR . get_include_path());
}
OX_increaseMemoryLimit(OX_getMinimumRequiredMemory());
if (!defined('E_DEPRECATED')) {
    define('E_DEPRECATED', 0);
}
setupServerVariables();
setupDeliveryConfigVariables();
$conf = $GLOBALS['_MAX']['CONF'];
$GLOBALS['_OA']['invocationType'] = array_search(basename($_SERVER['SCRIPT_FILENAME']), $conf['file']);
if (!empty($conf['debug']['production'])) {
    error_reporting(E_ALL & ~(E_NOTICE | E_WARNING | E_DEPRECATED | E_STRICT));
} else {
    error_reporting(E_ALL & ~(E_DEPRECATED | E_STRICT));
}
$file = '/lib/max/Delivery/common.php';
$GLOBALS['_MAX']['FILES'][$file] = true;
$file = '/lib/max/Delivery/cookie.php';
开发者ID:JackyKit,项目名称:revive-adserver,代码行数:31,代码来源:ti.php

示例5: checkOriginalMemory

 /**
  * Check if the original memory_limit had to be worked around to allow
  * OpenX to work
  *
  * @return boolean True if the original memory_limit was okay, false otherwise
  */
 function checkOriginalMemory()
 {
     if ($this->aInfo['PHP']['actual']['original_memory_limit'] != OA_MEMORY_UNLIMITED && $this->aInfo['PHP']['actual']['original_memory_limit'] > 0 && $this->aInfo['PHP']['actual']['original_memory_limit'] < OX_getMinimumRequiredMemory()) {
         return false;
     }
     return true;
 }
开发者ID:Jaree,项目名称:revive-adserver,代码行数:13,代码来源:EnvironmentManager.php

示例6: phpAds_PageHeader

phpAds_PageHeader("maintenance-index");
phpAds_MaintenanceSelection("acls");
/*-------------------------------------------------------*/
/* Main code                                             */
/*-------------------------------------------------------*/
if (!empty($action) && $action == 'Recompile') {
    MAX_AclReCompileAll();
    echo "<strong>{$strAllBannerChannelCompiled}</strong><br />";
}
echo $strBannerChannelResult;
phpAds_ShowBreak();
// Check the ACLs in the database against the compiled limitation strings...
echo "<strong>" . $strChannels . ":</strong>";
phpAds_showBreak();
// Check all the channels...
OX_increaseMemoryLimit(OX_getMinimumRequiredMemory('maintenance'));
$dalChannel = OA_Dal::factoryDAL('channel');
$rsChannel = $dalChannel->getChannelsAndAffiliates();
$rsChannel->find();
$allChannelsValid = true;
while ($rsChannel->fetch() && ($row = $rsChannel->toArray())) {
    if (!MAX_AclValidate('channel-acl.php', array('channelid' => $row['channelid']))) {
        $allChannelsValid = false;
        $affiliateName = !empty($row['affiliatename']) ? $row['affiliatename'] : $strUntitled;
        echo "<a href='channel-acl.php?affiliateid={$row['affiliateid']}&channelid={$row['channelid']}'>{$row['name']}</a><br />";
    }
}
if ($allChannelsValid) {
    echo $strChannelCompiledLimitationsValid;
}
phpAds_showBreak();
开发者ID:Spark-Eleven,项目名称:revive-adserver,代码行数:31,代码来源:maintenance-acl-check.php

示例7: run

 /**
  * The method to run the Maintenance Priority Engine process.
  *
  * @static
  * @param boolean $alwaysRun Default value is false. If true, the Maintenance
  *                           Priority Engine process will always run, even if
  *                           instant priority updates have been disabled in the
  *                           configuration. Used to ensure that the maintenance
  *                           script process can always update priorities.
  * @return boolean True on MPE running correctly, false otherwise.
  */
 function run($alwaysRun = false)
 {
     OA::switchLogIdent('maintenance');
     // Get the configuration
     $aConf = $GLOBALS['_MAX']['CONF'];
     // Should the MPE process run?
     if (!$alwaysRun) {
         // Is instant update for priority set?
         if (!$aConf['priority']['instantUpdate']) {
             OA::debug('Instant update of priorities disabled, not running MPE', PEAR_LOG_INFO);
             return false;
         }
         OA::debug();
     }
     // Log the start of the process
     OA::debug('Running Maintenance Priority Engine', PEAR_LOG_INFO);
     // Set longer time out, and ignore user abort
     if (!ini_get('safe_mode')) {
         @set_time_limit($aConf['maintenance']['timeLimitScripts']);
         @ignore_user_abort(true);
     }
     // Attempt to increase PHP memory
     OX_increaseMemoryLimit(OX_getMinimumRequiredMemory('maintenance'));
     // Run the following code as the "Maintenance" user
     OA_Permission::switchToSystemProcessUser('Maintenance');
     // Create a Maintenance DAL object
     $oDal = new OA_Dal_Maintenance_Priority();
     // Try to get the MPE database-level lock
     $lock = $oDal->obtainPriorityLock();
     if (!$lock) {
         OA::debug('Unable to obtain database-level lock, not running MPE', PEAR_LOG_ERR);
         return false;
     }
     // Ensure the the current time is registered with the OA_ServiceLocator
     $oServiceLocator =& OA_ServiceLocator::instance();
     $oDate =& $oServiceLocator->get('now');
     if (!$oDate) {
         // Record the current time, and register with the OA_ServiceLocator
         $oDate = new Date();
         $oServiceLocator->register('now', $oDate);
     }
     // Run the MPE process for the AdServer module
     require_once MAX_PATH . '/lib/OA/Maintenance/Priority/AdServer.php';
     $oMaintenancePriority = new OA_Maintenance_Priority_AdServer();
     // TODO: OA_Maintenance_Priority_AdServer::updatePriorities
     //       should be refactored to return a boolean we can check here.
     $oMaintenancePriority->updatePriorities();
     // Release the MPE database-level lock
     $result = $oDal->releasePriorityLock();
     if (PEAR::isError($result)) {
         // Unable to continue!
         OA::debug('Unable to release database-level lock', PEAR_LOG_ERR);
         return false;
     }
     // Return to the "normal" user
     OA_Permission::switchToSystemProcessUser();
     // Log the end of the process
     OA::debug('Maintenance Priority Engine Completed (Started at ' . $oDate->format('%Y-%m-%d %H:%M:%S') . ' ' . $oDate->tz->getShortName() . ')', PEAR_LOG_INFO);
     OA::switchLogIdent();
     return true;
 }
开发者ID:akirsch,项目名称:revive-adserver,代码行数:72,代码来源:Priority.php

示例8: RV_checkSystemInitialRequirements


//.........这里部分代码省略.........
        return -1;
    }
    // Test for existence of "parse_url" and "strpos", which are
    // special cases required for the display of the error message
    // in the event of anything failing in this test!
    if (!function_exists('parse_url')) {
        $aErrors[] = $errorString1 . 'parse_url' . $errorString2;
        $isSystemOK = false;
        if ($return === true) {
            $return = -2;
        }
    }
    if (!function_exists('strpos')) {
        $aErrors[] = $errorString1 . 'strpos' . $errorString2;
        $isSystemOK = false;
        if ($return === true) {
            $return = -2;
        }
    }
    // Test for existence of "array_intersect", "explode", "ini_get"
    // and "trim", which are all required as part of the code to test
    // which functions are in the "disabled_functions" list below...
    if (!function_exists('array_intersect')) {
        $aErrors[] = $errorString1 . 'array_intersect' . $errorString2;
        $isSystemOK = false;
        if ($return === true) {
            $return = -3;
        }
    }
    if (!function_exists('explode')) {
        $aErrors[] = $errorString1 . 'explode' . $errorString2;
        $isSystemOK = false;
        if ($return === true) {
            $return = -3;
        }
    }
    if (!function_exists('ini_get')) {
        $aErrors[] = $errorString1 . 'ini_get' . $errorString2;
        $isSystemOK = false;
        if ($return === true) {
            $return = -3;
        }
    }
    if (!function_exists('trim')) {
        $aErrors[] = $errorString1 . 'trim' . $errorString2;
        $isSystemOK = false;
        if ($return === true) {
            $return = -3;
        }
    }
    // Test the disabled functons list with required functions list
    // defined above in $aRequiredFunctions
    $aDisabledFunctions = explode(',', ini_get('disable_functions'));
    foreach ($aDisabledFunctions as $key => $value) {
        $aDisabledFunctions[$key] = trim($value);
    }
    $aNeededFunctions = array_intersect($aDisabledFunctions, $aRequiredFunctions);
    if (count($aNeededFunctions) > 0) {
        $isSystemOK = false;
        if ($return === true) {
            $return = -3;
        }
        foreach ($aNeededFunctions as $functionName) {
            $aErrors[] = $errorString1 . $functionName . $errorString2;
        }
    }
    // Check PHP version, as use of the minimum required version of PHP > 5.5.9
    // may result in parse errors, which we want to avoid
    $errorMessage = "PHP version 5.5.9, or greater, was not detected.";
    if (function_exists('version_compare')) {
        $result = version_compare(phpversion(), '5.5.9', '<');
        if ($result) {
            $aErrors[] = $errorMessage;
            $isSystemOK = false;
            if ($return === true) {
                $return = -3;
            }
        }
    }
    // Check minimum memory requirements are okay (24MB)
    $minimumRequiredMemory = OX_getMinimumRequiredMemory();
    $phpMemoryLimit = OX_getMemoryLimitSizeInBytes();
    if ($phpMemoryLimit > 0 && $phpMemoryLimit < $minimumRequiredMemory) {
        // The memory limit is too low, but can it be increased?
        $memoryCanBeSet = OX_checkMemoryCanBeSet();
        if (!$memoryCanBeSet) {
            $minimumRequiredMemoryInMB = $minimumRequiredMemory / 1048576;
            $errorMessage = 'The PHP "memory_limit" value is set to less than the required minimum of ' . $minimumRequiredMemoryInMB . 'MB, but because the built in PHP function "ini_set" ' . 'has been disabled, the memory limit cannot be automatically increased.';
            $aErrors[] = $errorMessage;
            $isSystemOK = false;
            if ($return === true) {
                $return = -4;
            }
        }
    }
    if (!$isSystemOK) {
        return $return;
    }
    return true;
}
开发者ID:Spark-Eleven,项目名称:revive-adserver,代码行数:101,代码来源:pre-check.php


注:本文中的OX_getMinimumRequiredMemory函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。