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


PHP MAX_Delivery_log_ensureIntegerSet函数代码示例

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


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

示例1: _setLimitations

function _setLimitations($type, $index, $aItems, $aCaps)
{
    MAX_Delivery_log_ensureIntegerSet($aCaps['block'], $index);
    MAX_Delivery_log_ensureIntegerSet($aCaps['capping'], $index);
    MAX_Delivery_log_ensureIntegerSet($aCaps['session_capping'], $index);
    MAX_Delivery_cookie_setCapping($type, $aItems[$index], $aCaps['block'][$index], $aCaps['capping'][$index], $aCaps['session_capping'][$index]);
}
开发者ID:JackyKit,项目名称:revive-adserver,代码行数:7,代码来源:ti.php

示例2: MAX_Delivery_log_getArrGetVariable

$aCapCampaign['capping'] = MAX_Delivery_log_getArrGetVariable('capCampaign');
$aCapCampaign['session_capping'] = MAX_Delivery_log_getArrGetVariable('sessionCapCampaign');
$aCapZone['block'] = MAX_Delivery_log_getArrGetVariable('blockZone');
$aCapZone['capping'] = MAX_Delivery_log_getArrGetVariable('capZone');
$aCapZone['session_capping'] = MAX_Delivery_log_getArrGetVariable('sessionCapZone');
$aSetLastSeen = MAX_Delivery_log_getArrGetVariable('lastView');
// Loop over the ads to be logged (there may be more than one due to internal re-directs)
// and log each ad, and th  en set any capping cookies required
$countAdIds = count($aAdIds);
for ($index = 0; $index < $countAdIds; $index++) {
    // Ensure that each ad to be logged has campaign, creative and zone
    // values set, and that all values are integers
    MAX_Delivery_log_ensureIntegerSet($aAdIds, $index);
    MAX_Delivery_log_ensureIntegerSet($aCampaignIds, $index);
    MAX_Delivery_log_ensureIntegerSet($aCreativeIds, $index);
    MAX_Delivery_log_ensureIntegerSet($aZoneIds, $index);
    if ($aAdIds[$index] >= -1) {
        $adId = $aAdIds[$index];
        // Log the ad impression, if required
        if ($GLOBALS['_MAX']['CONF']['logging']['adImpressions']) {
            MAX_Delivery_log_logAdImpression($adId, $aZoneIds[$index]);
        }
        if ($aAdIds[$index] == $adId) {
            // Set the capping cookies, if required
            MAX_Delivery_log_setAdLimitations($index, $aAdIds, $aCapAd);
            MAX_Delivery_log_setCampaignLimitations($index, $aCampaignIds, $aCapCampaign);
            MAX_Delivery_log_setLastAction($index, $aAdIds, $aZoneIds, $aSetLastSeen);
            if ($aZoneIds[$index] != 0) {
                MAX_Delivery_log_setZoneLimitations($index, $aZoneIds, $aCapZone);
            }
        }
开发者ID:ballistiq,项目名称:revive-adserver,代码行数:31,代码来源:lg.php

示例3: _setLimitations

/**
 * A "private" function to set delivery blocking and/or capping cookies.
 *
 * @access private
 * @param string $type The type of blocking/capping cookies to set. One of
 *                     'Ad', 'Campaign' or 'Zone'.
 * @param integer $index The index to the item and item limitation
 *                       arrays that corresponds with the item to set capping
 *                       cookies for.
 * @param array $aItems An array of item IDs, indexed by $index.
 * @param array $aCaps An array of arrays, indexed by the strings
 *                     "block", "capping" and "session_capping", then
 *                     indexed by $index, containing the cap values.
 */
function _setLimitations($type, $index, $aItems, $aCaps)
{
    // Ensure that the capping values for this item are set
    MAX_Delivery_log_ensureIntegerSet($aCaps['block'], $index);
    MAX_Delivery_log_ensureIntegerSet($aCaps['capping'], $index);
    MAX_Delivery_log_ensureIntegerSet($aCaps['session_capping'], $index);
    // Set the capping cookies
    MAX_Delivery_cookie_setCapping($type, $aItems[$index], $aCaps['block'][$index], $aCaps['capping'][$index], $aCaps['session_capping'][$index]);
}
开发者ID:villos,项目名称:tree_admin,代码行数:23,代码来源:log.php

示例4: test_MAX_Delivery_log_ensureIntegerSet

 /**
  * A method to test the MAX_Delivery_log_ensureIntegerSet() function.
  *
  * Requirements:
  * Test 1: Test using something that is not an array, and ensure that
  *         array and value are set.
  * Test 2: Test with an array and nothing set, and ensure that value
  *         is set.
  * Test 3: Test with an array and integer set, and ensure nothing changed.
  * Test 4: Test with an array and string set, and ensure string converted.
  */
 function test_MAX_Delivery_log_ensureIntegerSet()
 {
     // Test 1
     $aArray = 'string';
     MAX_Delivery_log_ensureIntegerSet($aArray, 5);
     $this->assertTrue(is_array($aArray));
     $this->assertEqual(count($aArray), 1);
     $this->assertEqual($aArray[5], 0);
     // Test 2
     $aArray = array();
     MAX_Delivery_log_ensureIntegerSet($aArray, 5);
     $this->assertTrue(is_array($aArray));
     $this->assertEqual(count($aArray), 1);
     $this->assertEqual($aArray[5], 0);
     // Test 3
     $aArray = array();
     $aArray[5] = 10;
     MAX_Delivery_log_ensureIntegerSet($aArray, 5);
     $this->assertTrue(is_array($aArray));
     $this->assertEqual(count($aArray), 1);
     $this->assertEqual($aArray[5], 10);
     // Test 4
     $aArray = array();
     $aArray[5] = 'string';
     MAX_Delivery_log_ensureIntegerSet($aArray, 5);
     $this->assertTrue(is_array($aArray));
     $this->assertEqual(count($aArray), 1);
     $this->assertEqual($aArray[5], 0);
 }
开发者ID:ballistiq,项目名称:revive-adserver,代码行数:40,代码来源:log.del.test.php


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