本文整理汇总了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;
}
示例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();