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


PHP OA_Dal_Delivery_query函数代码示例

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


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

示例1: query

 function query($sql)
 {
     $ret = OA_Dal_Delivery_query($sql, 'rawDatabase');
     if (!$ret) {
         OA_bucketPrintError('rawDatabase');
     }
     return $ret;
 }
开发者ID:Spark-Eleven,项目名称:revive-adserver,代码行数:8,代码来源:db_buckets.php

示例2: Plugin_deliveryLog_oxLogConversion_logConversionVariable_Delivery_logConversionVariable

/**
 * This function logs the variable data passed in to a tracker impression
 *
 * @param array  $aVariables An array of the variable IDs and values to be logged.
 * @param int    $trackerId The tracker ID.
 * @param int    $serverConvId The associated conversion ID for these values.
 * @param string $serverRawIp The associated server identifier for these values.
 * @return bool True on success, false on failuer.
 */
function Plugin_deliveryLog_oxLogConversion_logConversionVariable_Delivery_logConversionVariable($aVariables, $trackerId, $serverConvId, $serverRawIp, $okToLog = true)
{
    if (!$okToLog) {
        return false;
    }
    // Initiate the connection to the database (before using mysql_real_escape_string)
    OA_Dal_Delivery_connect('rawDatabase');
    $table = $GLOBALS['_MAX']['CONF']['table']['prefix'] . 'data_bkt_a_var';
    if (empty($GLOBALS['_MAX']['NOW'])) {
        $GLOBALS['_MAX']['NOW'] = time();
    }
    $time = $GLOBALS['_MAX']['NOW'];
    $aRows = array();
    foreach ($aVariables as $aVariable) {
        $aRows[] = "(\n                        '" . OX_escapeString($serverConvId) . "',\n                        '" . OX_escapeString($serverRawIp) . "',\n                        '{$aVariable['variable_id']}',\n                        '" . OX_escapeString($aVariable['value']) . "',\n                        '" . gmdate('Y-m-d H:i:s', $time) . "'\n                    )";
    }
    if (empty($aRows)) {
        return;
    }
    $query = "\n        INSERT INTO\n            {$table}\n            (\n                server_conv_id,\n                server_ip,\n                tracker_variable_id,\n                value,\n                date_time\n            )\n        VALUES " . implode(',', $aRows);
    return OA_Dal_Delivery_query($query, 'rawDatabase');
}
开发者ID:Spark-Eleven,项目名称:revive-adserver,代码行数:31,代码来源:logConversionVariable.delivery.php

示例3: Plugin_deliveryLog_oxLogConversion_logConversion_Delivery_logConversion

/**
 * A function to log conversions.
 *
 * @param integer $trackerId The ID of the tracker for which the conversion is to be logged.
 * @param array $serverRawIp The "raw IP address" value to use for the conversion.
 * @param array $aConversion An array of the conversion details, as returned from the
 *                           MAX_trackerCheckForValidAction() function.
 * @return array An array...
 */
function Plugin_deliveryLog_oxLogConversion_logConversion_Delivery_logConversion($trackerId, $serverRawIp, $aConversion, $okToLog = true)
{
    if (!$okToLog) {
        return false;
    }
    // Initiate the connection to the database (before using mysql_real_escape_string)
    OA_Dal_Delivery_connect('rawDatabase');
    $table = $GLOBALS['_MAX']['CONF']['table']['prefix'] . 'data_bkt_a';
    if (empty($GLOBALS['_MAX']['NOW'])) {
        $GLOBALS['_MAX']['NOW'] = time();
    }
    $time = $GLOBALS['_MAX']['NOW'];
    $aValues = array('server_ip' => $serverRawIp, 'tracker_id' => (int) $trackerId, 'date_time' => gmdate('Y-m-d H:i:s', $time), 'action_date_time' => gmdate('Y-m-d H:i:s', $aConversion['dt']), 'creative_id' => (int) $aConversion['cid'], 'zone_id' => (int) $aConversion['zid'], 'ip_address' => $_SERVER['REMOTE_ADDR'], 'action' => $aConversion['action_type'], 'window' => $aConversion['window'], 'status' => $aConversion['status']);
    // Need to also escape identifier as "window" is reserved since PgSQL 8.4
    $aFields = array_map('OX_escapeIdentifier', array_keys($aValues));
    $aValues = array_map('OX_escapeString', $aValues);
    $query = "\n        INSERT INTO\n            {$table}\n            (" . implode(', ', $aFields) . ")\n        VALUES\n            ('" . implode("', '", $aValues) . "')\n    ";
    $result = OA_Dal_Delivery_query($query, 'rawDatabase');
    if (!$result) {
        return false;
    }
    $aResult = array('server_conv_id' => OA_Dal_Delivery_insertId('rawDatabase', $table, 'server_conv_id'), 'server_raw_ip' => $serverRawIp);
    return $aResult;
}
开发者ID:Spark-Eleven,项目名称:revive-adserver,代码行数:33,代码来源:logConversion.delivery.php

示例4: OA_Dal_Delivery_getMaintenanceInfo

/**
 * This function retrieves the last run timestamp from auto maintenance
 *
 * @return string            The timestamp for the last time auto maintenance ran
 */
function OA_Dal_Delivery_getMaintenanceInfo()
{
    $conf = $GLOBALS['_MAX']['CONF'];
    $result = OA_Dal_Delivery_query("\n        SELECT\n            value AS maintenance_timestamp\n        FROM\n            " . OX_escapeIdentifier($conf['table']['prefix'] . $conf['table']['application_variable']) . "\n        WHERE name = 'maintenance_timestamp'\n    ");
    if (!is_resource($result)) {
        return defined('OA_DELIVERY_CACHE_FUNCTION_ERROR') ? OA_DELIVERY_CACHE_FUNCTION_ERROR : null;
    } else {
        $result = OA_Dal_Delivery_fetchAssoc($result);
        return $result['maintenance_timestamp'];
    }
}
开发者ID:Spark-Eleven,项目名称:revive-adserver,代码行数:16,代码来源:Delivery.php

示例5: OX_bucket_updateTable

function OX_bucket_updateTable($tableName, $aQuery, $increment = true, $counter = 'count')
{
    $prefix = $GLOBALS['_MAX']['CONF']['table']['prefix'];
    $query = OX_bucket_prepareUpdateQuery($prefix . $tableName, $aQuery, $increment, $counter);
    $result = OA_Dal_Delivery_query($query, 'rawDatabase');
    return $result;
}
开发者ID:Spark-Eleven,项目名称:revive-adserver,代码行数:7,代码来源:pgsql.php

示例6: OA_bucketPrepareDb

function OA_bucketPrepareDb()
{
    if ($GLOBALS['_MAX']['CONF']['database']['type'] == 'pgsql') {
        OA_Dal_Delivery_query('SET SESSION synchronous_commit TO OFF', 'rawDatabase');
    }
}
开发者ID:ballistiq,项目名称:revive-adserver,代码行数:6,代码来源:db_prototype.php

示例7: OX_bucket_updateTable

function OX_bucket_updateTable($tableName, $aQuery, $increment = true, $counter = 'count')
{
    $prefix = $GLOBALS['_MAX']['CONF']['table']['prefix'];
    $query = OX_bucket_prepareUpdateQuery($prefix . $tableName, $aQuery, $increment, $counter);
    if (!empty($GLOBALS['_MAX']['CONF']['deliveryLog']['enabled'])) {
        require_once MAX_PATH . '/lib/OA.php';
        OA::debug('updating bucket ' . $query);
    }
    $result = OA_Dal_Delivery_query($query, 'rawDatabase');
    return $result;
}
开发者ID:villos,项目名称:tree_admin,代码行数:11,代码来源:pgsql.php


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