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


PHP MAX_commonCompressInt函数代码示例

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


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

示例1: MAX_Delivery_log_setClickBlocked

function MAX_Delivery_log_setClickBlocked($index, $aAdIds)
{
    $aConf = $GLOBALS['_MAX']['CONF'];
    MAX_cookieAdd("_{$aConf['var']['blockLoggingClick']}[{$aAdIds[$index]}]", MAX_commonCompressInt(MAX_commonGetTimeNow()), _getTimeThirtyDaysFromNow());
}
开发者ID:JackyKit,项目名称:revive-adserver,代码行数:5,代码来源:ti.php

示例2: test_MAX_Delivery_log_isClickBlocked

 /**
  * A method to test the MAX_Delivery_log_isClickBlocked() function.
  *
  * Requirements:
  * Test 1: Test with a 0 seconds click block looging window (block logging no active)
  *         and ensure that false is returned.
  * Test 2: Test with a click block looging window bigger than 0 seconds and an add
  *         not clicked yet, and ensure that false is returned.
  * Test 3: Test with a click block looging window bigger than 0 seconds and an add
  *         clicked that still in the click block logging window, and ensure that
  *         true is returned.
  * Test 4: Test with a click block looging window bigger than 0 seconds and an add
  *         clicked the same time ago that the click block logging window's lenght,
  *         and ensure that true is returned.
  * Test 5: Test with a click block looging window bigger than 0 seconds and an add
  *         clicked with the click block logging window expired, and ensure that
  *         false is returned.
  */
 function test_MAX_Delivery_log_isClickBlocked()
 {
     $timeNow = MAX_commonGetTimeNow();
     $add1ClickTime = MAX_commonCompressInt($timeNow - 60);
     $add3ClickTime = MAX_commonCompressInt($timeNow - 30);
     $add9ClickTime = MAX_commonCompressInt($timeNow - 15);
     $aBlockLoggingClick = array(1 => $add1ClickTime, 3 => $add3ClickTime, 9 => $add9ClickTime);
     // Test 1
     $GLOBALS['conf']['logging']['blockAdClicksWindow'] = 0;
     $aReturn = MAX_Delivery_log_isClickBlocked(1, $aBlockLoggingClick);
     $this->assertTrue(!$aReturn);
     // Test 2
     $GLOBALS['conf']['logging']['blockAdClicksWindow'] = 30;
     $aReturn = MAX_Delivery_log_isClickBlocked(2, $aBlockLoggingClick);
     $this->assertTrue(!$aReturn);
     // Test 3
     $GLOBALS['conf']['logging']['blockAdClicksWindow'] = 30;
     $aReturn = MAX_Delivery_log_isClickBlocked(9, $aBlockLoggingClick);
     $this->assertTrue($aReturn);
     // Test 4
     $GLOBALS['conf']['logging']['blockAdClicksWindow'] = 30;
     $aReturn = MAX_Delivery_log_isClickBlocked(3, $aBlockLoggingClick);
     $this->assertTrue($aReturn);
     // Test 5
     $GLOBALS['conf']['logging']['blockAdClicksWindow'] = 30;
     $aReturn = MAX_Delivery_log_isClickBlocked(1, $aBlockLoggingClick);
     $this->assertTrue(!$aReturn);
 }
开发者ID:ballistiq,项目名称:revive-adserver,代码行数:46,代码来源:log.del.test.php


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