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


PHP OX_OperationInterval::checkDateIsStartDate方法代码示例

本文整理汇总了PHP中OX_OperationInterval::checkDateIsStartDate方法的典型用法代码示例。如果您正苦于以下问题:PHP OX_OperationInterval::checkDateIsStartDate方法的具体用法?PHP OX_OperationInterval::checkDateIsStartDate怎么用?PHP OX_OperationInterval::checkDateIsStartDate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在OX_OperationInterval的用法示例。


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

示例1: checkRangeData

 /**
  * A mathod to quickly check the data in the database for the date
  * range given, to ensure that the range being tested & corrected
  * seems reasonable.
  *
  * @param Date $oStartDate The start date/time of the range to test & correct.
  * @param Date $oEndDate   The end date/time of the range to test & correct.
  * @return boolean True if the date range seems okay, false otherwise.
  */
 function checkRangeData($oStartDate, $oEndDate)
 {
     // Test that there are no rows in the data_intermediate_ad table where the
     // operation interval value does not match that in the configuration file
     $doData_intermediate_ad = OA_Dal::factoryDO('data_intermediate_ad');
     $doData_intermediate_ad->whereAdd('date_time >= ' . $this->oDbh->quote($oStartDate->format('%Y-%m-%d %H:%M:%S'), 'timestamp'));
     $doData_intermediate_ad->whereAdd('date_time <= ' . $this->oDbh->quote($oEndDate->format('%Y-%m-%d %H:%M:%S'), 'timestamp'));
     $doData_intermediate_ad->whereAdd('operation_interval != ' . $this->oDbh->quote(OX_OperationInterval::getOperationInterval(), 'integer'));
     $doData_intermediate_ad->find();
     $rows = $doData_intermediate_ad->getRowCount();
     if ($rows > 0) {
         $message = "\n    Detected at least one row in the data_intermediate_ad table with operation interval != " . OX_OperationInterval::getOperationInterval() . ".\n";
         echo $message;
         return false;
     }
     // Test that all of the date/time values in the data_summary_ad_hourly
     // table align with the start of operation intervals
     $doData_summary_ad_hourly = OA_Dal::factoryDO('data_summary_ad_hourly');
     $doData_summary_ad_hourly->selectAdd();
     $doData_summary_ad_hourly->selectAdd('DISTINCT date_time');
     $doData_summary_ad_hourly->whereAdd('date_time >= ' . $this->oDbh->quote($oStartDate->format('%Y-%m-%d %H:%M:%S'), 'timestamp'));
     $doData_summary_ad_hourly->whereAdd('date_time <= ' . $this->oDbh->quote($oEndDate->format('%Y-%m-%d %H:%M:%S'), 'timestamp'));
     $doData_summary_ad_hourly->find();
     while ($doData_summary_ad_hourly->fetch()) {
         $oDate = new Date($doData_summary_ad_hourly->date_time);
         $result = OX_OperationInterval::checkDateIsStartDate($oDate);
         if (!$result) {
             $message = "\n    Detected at least one row in the data_summary_ad_hourly table with date_time value not on the hour start interval.\n";
             echo $message;
             return false;
         }
     }
     return true;
 }
开发者ID:villos,项目名称:tree_admin,代码行数:43,代码来源:TestAndCorrect.php

示例2: Date

    echo "\nPlease ensure that you have read the comments in the {$scriptName} script.\n\nYou will also find out how to make this script work by reading the comments. :-)\n";
    echo $haltMessage;
    exit;
}
// Initialise the script
RV::disableErrorHandling();
$result = OX_OperationInterval::checkOperationIntervalValue(OX_OperationInterval::getOperationInterval());
RV::enableErrorHandling();
if (PEAR::isError($result)) {
    $message = "\nThe operation interval in your OpenX configuration file is not valid. Please see the OpenX\ndocumentation for more details on valid operation interval values.\n";
    echo $message;
    echo $haltMessage;
    exit;
}
$oStartDate = new Date(INTERVAL_START);
$result = OX_OperationInterval::checkDateIsStartDate($oStartDate);
if (!$result) {
    $message = "\nThe start date defined in the {$scriptName} script is not a valid operation interval start date.\nPlease edit the statisticsTestAndCorrect.php script before running.\n";
    echo $message;
    echo $haltMessage;
    exit;
}
$oEndDate = new Date(INTERVAL_END);
$result = OX_OperationInterval::checkDateIsEndDate($oEndDate);
if (!$result) {
    $message = "\nThe end date defined in the {$scriptName} script is not a valid operation interval start date.\nPlease edit the statisticsTestAndCorrect.php script before running.\n";
    echo $message;
    echo $haltMessage;
    exit;
}
$oMigrateBucketData = new OX_Maintenance_Statistics_MigrateBucketData();
开发者ID:akirsch,项目名称:revive-adserver,代码行数:31,代码来源:migrateBucketData.php


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