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


PHP OA_Dal_Delivery_getMaintenanceInfo函数代码示例

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


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

示例1: MAX_cacheCheckIfMaintenanceShouldRun

function MAX_cacheCheckIfMaintenanceShouldRun($cached = true)
{
    $interval = $GLOBALS['_MAX']['CONF']['maintenance']['operationInterval'] * 60;
    $delay = intval($GLOBALS['_MAX']['CONF']['maintenance']['operationInterval'] / 12 * 60);
    $now = MAX_commonGetTimeNow();
    $today = strtotime(date('Y-m-d'), $now);
    $nextRunTime = $today + (floor(($now - $today) / $interval) + 1) * $interval + $delay;
    if ($nextRunTime - $now > $interval) {
        $nextRunTime -= $interval;
    }
    $cName = OA_Delivery_Cache_getName(__FUNCTION__);
    if (!$cached || ($lastRunTime = OA_Delivery_Cache_fetch($cName)) === false) {
        MAX_Dal_Delivery_Include();
        $lastRunTime = OA_Dal_Delivery_getMaintenanceInfo();
        if ($lastRunTime >= $nextRunTime - $delay) {
            $nextRunTime += $interval;
        }
        OA_Delivery_Cache_store($cName, $lastRunTime, false, $nextRunTime);
    }
    return $lastRunTime < $nextRunTime - $interval;
}
开发者ID:JackyKit,项目名称:revive-adserver,代码行数:21,代码来源:ti.php

示例2: MAX_cacheCheckIfMaintenanceShouldRun

/**
 * Check if maintenance should run using cached information
 *
 * This function gets maintenance's last run info
 *
 * @param boolean $cached   Should a cache lookup be performed?
 * @return array            The array of tracker properties
 */
function MAX_cacheCheckIfMaintenanceShouldRun($cached = true)
{
    // Default delay is 5 minutes
    $interval = $GLOBALS['_MAX']['CONF']['maintenance']['operationInterval'] * 60;
    $delay = intval($GLOBALS['_MAX']['CONF']['maintenance']['operationInterval'] / 12 * 60);
    $now = MAX_commonGetTimeNow();
    $today = strtotime(date('Y-m-d'), $now);
    $nextRunTime = $today + (floor(($now - $today) / $interval) + 1) * $interval + $delay;
    // Adding the delay could shift the time to the next operation interval,
    // make sure to fix it in case it happens
    if ($nextRunTime - $now > $interval) {
        $nextRunTime -= $interval;
    }
    $cName = OA_Delivery_Cache_getName(__FUNCTION__);
    if (!$cached || ($lastRunTime = OA_Delivery_Cache_fetch($cName)) === false) {
        MAX_Dal_Delivery_Include();
        $lastRunTime = OA_Dal_Delivery_getMaintenanceInfo();
        // Cache until the next operation interval if scheduled maintenance was run
        // during the delay
        if ($lastRunTime >= $nextRunTime - $delay) {
            $nextRunTime += $interval;
        }
        OA_Delivery_Cache_store($cName, $lastRunTime, false, $nextRunTime);
    }
    return $lastRunTime < $nextRunTime - $interval;
}
开发者ID:Apeplazas,项目名称:plazadelatecnologia,代码行数:34,代码来源:cache.php


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