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


PHP MAX_remotehostSetInfo函数代码示例

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


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

示例1: OA_cacheGetPublisherZones

}
function OA_cacheGetPublisherZones($affiliateid, $cached = true)
{
    $sName = OA_Delivery_Cache_getName(__FUNCTION__, $affiliateid);
    if (!$cached || ($output = OA_Delivery_Cache_fetch($sName)) === false) {
        MAX_Dal_Delivery_Include();
        $output = OA_Dal_Delivery_getPublisherZones($affiliateid);
        $output = OA_Delivery_Cache_store_return($sName, $output);
    }
    return $output;
}
OX_Delivery_logMessage('starting delivery script: ' . basename($_SERVER['REQUEST_URI']), 7);
if (!empty($_REQUEST[$conf['var']['trace']])) {
    OX_Delivery_logMessage('trace enabled: ' . $_REQUEST[$conf['var']['trace']], 7);
}
MAX_remotehostSetInfo();
MAX_commonInitVariables();
MAX_cookieLoad();
MAX_cookieUnpackCapping();
if (empty($GLOBALS['_OA']['invocationType']) || $GLOBALS['_OA']['invocationType'] != 'xmlrpc') {
    OX_Delivery_Common_hook('postInit');
}
function MAX_javascriptToHTML($string, $varName, $output = true, $localScope = true)
{
    $jsLines = array();
    $search[] = "\\";
    $replace[] = "\\\\";
    $search[] = "\r";
    $replace[] = '';
    $search[] = '"';
    $replace[] = '\\"';
开发者ID:JackyKit,项目名称:revive-adserver,代码行数:31,代码来源:ti.php

示例2: OA_Delivery_XmlRpc_SPC

/**
 * A function to handle XML-RPC advertisement SPC requests.
 *
 * @param XML_RPC_Message $params An XML_RPC_Message containing the parameters. The expected parameters
 *                              are (in order):
 *                              - An XML_RPC_Value of type "struct"  containing remote informations
 *                                which needs at least two members:
 *                                - remote_addr (string) and
 *                                - cookies     (struct);
 *                              - An XML_RPC_Value of type "string"  containing the "what" value;
 *                              - An XML_RPC_Value of type "string"  containing the "target" value;
 *                              - An XML_RPC_Value of type "string"  containing the "source" value;
 *                              - An XML_RPC_Value of type "boolean" containing the "withtext" value;
 *                              - An XML_RPC_Value of type "boolean" containing the "block" value;
 *                              - An XML_RPC_Value of type "boolean" containing the "blockcampaign" value;
 * @return XML_RPC_Response The response. The XML_RPC_Value of the response can be one of
 *                          a number of different values:
 *                          - Error Code 21: wrong number of parameters.
 *                          - Error Code 22: remote_addr element missing from the remote info struct.
 *                          - Error Code 23: cookies element missing from the remote info struct.
 *                          - An XML_RPC_Value of type "struct" with the HTML details required
 *                            for displaying the advertisement stored as in XML_RPC_Value of
 *                            type "string" in the "html" index, and other elements returned by the
 *                            MAX_asSelect call. A special "cookies" element is either:
 *                            - An empty XML_RPC_Value if there are no cookies to be set, or
 *                            - An XML_RPC_Value of type "array", containing a number of XML_RPC_Values
 *                              of tpye "array", each with 3 items:
 *                              - An XML_RPC_Value of type "string" with the cookie name;
 *                              - An XML_RPC_Value of type "string" with the cookie value; and
 *                              - An XML_RPC_Value of type "string" with the cookie expiration time.
 */
function OA_Delivery_XmlRpc_SPC($params)
{
    global $XML_RPC_erruser;
    global $XML_RPC_String, $XML_RPC_Struct, $XML_RPC_Array;
    // Check the parameters exist
    $numParams = $params->getNumParams();
    if ($numParams != 7) {
        // Return an error
        $errorCode = $XML_RPC_erruser + 21;
        $errorMsg = 'Incorrect number of parameters';
        return new XML_RPC_Response(0, $errorCode, $errorMsg);
    }
    // Set the XML values into their correct variables to make life easier
    $vars = array(1 => 'what', 2 => 'target', 3 => 'source', 4 => 'withtext', 5 => 'block', 6 => 'blockcampaign');
    // Parse parameters
    for ($i = 0; $i < $numParams; $i++) {
        $p = $params->getParam($i);
        if ($i) {
            // Put the decoded value the view arg array
            ${$vars}[$i] = XML_RPC_decode($p);
        } else {
            // First parameter: environment information supplied be XML-RPC client
            $p = XML_RPC_decode($p);
            if (!isset($p['remote_addr'])) {
                // Return an error
                $errorCode = $XML_RPC_erruser + 22;
                $errorMsg = "Missing 'remote_addr' member";
                return new XML_RPC_Response(0, $errorCode, $errorMsg);
            }
            if (!isset($p['cookies']) || !is_array($p['cookies'])) {
                // Return an error
                $errorCode = $XML_RPC_erruser + 23;
                $errorMsg = "Missing 'cookies' member";
                return new XML_RPC_Response(0, $errorCode, $errorMsg);
            }
            $aServerVars = array('remote_addr' => 'REMOTE_ADDR', 'remote_host' => 'REMOTE_HOST', 'request_uri' => 'REQUEST_URI', 'https' => 'HTTPS', 'server_name' => 'SERVER_NAME', 'http_host' => 'HTTP_HOST', 'accept_language' => 'HTTP_ACCEPT_LANGUAGE', 'referer' => 'HTTP_REFERER', 'user_agent' => 'HTTP_USER_AGENT', 'via' => 'HTTP_VIA', 'forwarded' => 'HTTP_FORWARDED', 'forwarded_for' => 'HTTP_FORWARDED_FOR', 'x_forwarded' => 'HTTP_X_FORWARDED', 'x_forwarded_for' => 'HTTP_X_FORWARDED_FOR', 'client_ip' => 'HTTP_CLIENT_IP');
            // Extract environment vars to $_SERVER
            foreach ($aServerVars as $xmlName => $varName) {
                if (isset($p[$xmlName])) {
                    $_SERVER[$varName] = $p[$xmlName];
                }
            }
            // Extract cookie vars to $_COOKIE
            foreach ($p['cookies'] as $key => $value) {
                $_COOKIE[$key] = MAX_commonAddslashesRecursive($value);
            }
            MAX_remotehostSetInfo(true);
            OX_Delivery_Common_hook('postInit');
            MAX_cookieUnpackCapping();
        }
    }
    // Add defaults for not-applicable values
    $richmedia = true;
    $ct0 = '';
    $context = array();
    // Make loc and referer global to ensure that the delivery limitations work correctly
    global $loc, $referer;
    $loc = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on' ? 'https' : 'http') . '://' . OX_getHostName() . $_SERVER['REQUEST_URI'];
    // Add $referer parameter
    $referer = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '';
    // If the what parameter is an int, it is the affiliateid, otherwise it's a serialized array of name=zone pairs
    // This convention is inline with the parameters passed into local-mode SPC
    if (is_numeric($what)) {
        $zones = OA_cacheGetPublisherZones($what);
        $nz = false;
    } else {
        $zones = unserialize($what);
        $nz = true;
    }
//.........这里部分代码省略.........
开发者ID:Spark-Eleven,项目名称:revive-adserver,代码行数:101,代码来源:XML-RPC.php

示例3: OA_Delivery_XmlRpc_View

/**
 * A function to handle XML-RPC advertisement view requests.
 *
 * @param XML_RPC_Message $params An XML_RPC_Message containing the parameters. The expected parameters
 *                              are (in order):
 *                              - An XML_RPC_Value of type "struct"  containing remote informations
 *                                which needs at least two members:
 *                                - remote_addr (string) and
 *                                - cookies     (struct);
 *                              - An XML_RPC_Value of type "string"  containing the "what" value;
 *                              - An XML_RPC_Value of type "int"     containing the "campaignid" value;
 *                              - An XML_RPC_Value of type "string"  containing the "target" value;
 *                              - An XML_RPC_Value of type "string"  containing the "source" value;
 *                              - An XML_RPC_Value of type "boolean" containing the "withText" value;
 *                              - An XML_RPC_Value of type "array"   containing the "context" value.
 * @return XML_RPC_Response The response. The XML_RPC_Value of the response can be one of
 *                          a number of different values:
 *                          - Error Code 21: wrong number of parameters.
 *                          - Error Code 22: remote_addr element missing from the remote info struct.
 *                          - Error Code 23: cookies element missing from the remote info struct.
 *                          - An XML_RPC_Value of type "struct" with the HTML details required
 *                            for displaying the advertisement stored as in XML_RPC_Value of
 *                            type "string" in the "html" index, and other elements returned by the
 *                            MAX_asSelect call. A special "cookies" element is either:
 *                            - An empty XML_RPC_Value if there are no cookies to be set, or
 *                            - An XML_RPC_Value of type "array", containing a number of XML_RPC_Values
 *                              of tpye "array", each with 3 items:
 *                              - An XML_RPC_Value of type "string" with the cookie name;
 *                              - An XML_RPC_Value of type "string" with the cookie value; and
 *                              - An XML_RPC_Value of type "string" with the cookie expiration time.
 */
function OA_Delivery_XmlRpc_View($params)
{
    global $XML_RPC_erruser;
    global $XML_RPC_String, $XML_RPC_Struct, $XML_RPC_Array;
    // Check the parameters exist
    $numParams = $params->getNumParams();
    if ($numParams != 7) {
        // Return an error
        $errorCode = $XML_RPC_erruser + 21;
        $errorMsg = 'Incorrect number of parameters';
        return new XML_RPC_Response(0, $errorCode, $errorMsg);
    }
    // Parse parameters
    for ($i = 0; $i < $numParams; $i++) {
        $p = $params->getParam($i);
        // Bump the params array to account for the inserted $charset parameter
        if ($i == 6) {
            $view_params[] = '';
        }
        if ($i) {
            // Put the decoded value the view arg array
            $view_params[] = XML_RPC_decode($p);
        } else {
            // First parameter: environment information supplied be XML-RPC client
            $p = XML_RPC_decode($p);
            if (!isset($p['remote_addr'])) {
                // Return an error
                $errorCode = $XML_RPC_erruser + 22;
                $errorMsg = "Missing 'remote_addr' member";
                return new XML_RPC_Response(0, $errorCode, $errorMsg);
            }
            if (!isset($p['cookies']) || !is_array($p['cookies'])) {
                // Return an error
                $errorCode = $XML_RPC_erruser + 23;
                $errorMsg = "Missing 'cookies' member";
                return new XML_RPC_Response(0, $errorCode, $errorMsg);
            }
            $aServerVars = array('remote_addr' => 'REMOTE_ADDR', 'remote_host' => 'REMOTE_HOST', 'request_uri' => 'REQUEST_URI', 'https' => 'HTTPS', 'server_name' => 'SERVER_NAME', 'http_host' => 'HTTP_HOST', 'accept_language' => 'HTTP_ACCEPT_LANGUAGE', 'referer' => 'HTTP_REFERER', 'user_agent' => 'HTTP_USER_AGENT', 'via' => 'HTTP_VIA', 'forwarded' => 'HTTP_FORWARDED', 'forwarded_for' => 'HTTP_FORWARDED_FOR', 'x_forwarded' => 'HTTP_X_FORWARDED', 'x_forwarded_for' => 'HTTP_X_FORWARDED_FOR', 'client_ip' => 'HTTP_CLIENT_IP');
            // Extract environment vars to $_SERVER
            foreach ($aServerVars as $xmlName => $varName) {
                if (isset($p[$xmlName])) {
                    $_SERVER[$varName] = $p[$xmlName];
                }
            }
            // Extract cookie vars to $_COOKIE
            foreach ($p['cookies'] as $key => $value) {
                $_COOKIE[$key] = MAX_commonAddslashesRecursive($value);
            }
            MAX_remotehostSetInfo(true);
            MAX_cookieUnpackCapping();
        }
    }
    // Add $richMedia parameter
    $view_params[] = true;
    // Add $ct0 parameter
    $view_params[] = '';
    // Add $loc param
    $view_params[] = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on' ? 'https' : 'http') . '://' . OX_getHostName() . $_SERVER['REQUEST_URI'];
    // Add $referer parameter
    $view_params[] = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '';
    // Call MAX_adSelect with supplied parameters
    $output = call_user_func_array('MAX_adSelect', $view_params);
    // Prepare output as PHP array
    if (!is_array($output)) {
        $output = array();
    } elseif (isset($output['contenttype']) && $output['contenttype'] == 'swf') {
        $output['html'] = MAX_flashGetFlashObjectExternal() . $output['html'];
    }
    MAX_cookieFlush();
//.........这里部分代码省略.........
开发者ID:villos,项目名称:tree_admin,代码行数:101,代码来源:XML-RPC.php

示例4: OA_Delivery_XmlRpc_SPC

function OA_Delivery_XmlRpc_SPC($params)
{
    global $XML_RPC_erruser;
    global $XML_RPC_String, $XML_RPC_Struct, $XML_RPC_Array;
    $numParams = $params->getNumParams();
    if ($numParams != 7) {
        $errorCode = $XML_RPC_erruser + 21;
        $errorMsg = 'Incorrect number of parameters';
        return new XML_RPC_Response(0, $errorCode, $errorMsg);
    }
    $vars = array(1 => 'what', 2 => 'target', 3 => 'source', 4 => 'withtext', 5 => 'block', 6 => 'blockcampaign');
    for ($i = 0; $i < $numParams; $i++) {
        $p = $params->getParam($i);
        if ($i) {
            ${$vars}[$i] = XML_RPC_decode($p);
        } else {
            $p = XML_RPC_decode($p);
            if (!isset($p['remote_addr'])) {
                $errorCode = $XML_RPC_erruser + 22;
                $errorMsg = "Missing 'remote_addr' member";
                return new XML_RPC_Response(0, $errorCode, $errorMsg);
            }
            if (!isset($p['cookies']) || !is_array($p['cookies'])) {
                $errorCode = $XML_RPC_erruser + 23;
                $errorMsg = "Missing 'cookies' member";
                return new XML_RPC_Response(0, $errorCode, $errorMsg);
            }
            $aServerVars = array('remote_addr' => 'REMOTE_ADDR', 'remote_host' => 'REMOTE_HOST', 'request_uri' => 'REQUEST_URI', 'https' => 'HTTPS', 'server_name' => 'SERVER_NAME', 'http_host' => 'HTTP_HOST', 'accept_language' => 'HTTP_ACCEPT_LANGUAGE', 'referer' => 'HTTP_REFERER', 'user_agent' => 'HTTP_USER_AGENT', 'via' => 'HTTP_VIA', 'forwarded' => 'HTTP_FORWARDED', 'forwarded_for' => 'HTTP_FORWARDED_FOR', 'x_forwarded' => 'HTTP_X_FORWARDED', 'x_forwarded_for' => 'HTTP_X_FORWARDED_FOR', 'client_ip' => 'HTTP_CLIENT_IP');
            foreach ($aServerVars as $xmlName => $varName) {
                if (isset($p[$xmlName])) {
                    $_SERVER[$varName] = $p[$xmlName];
                }
            }
            foreach ($p['cookies'] as $key => $value) {
                $_COOKIE[$key] = MAX_commonAddslashesRecursive($value);
            }
            MAX_remotehostSetInfo(true);
            OX_Delivery_Common_hook('postInit');
            MAX_cookieUnpackCapping();
        }
    }
    $richmedia = true;
    $ct0 = '';
    $context = array();
    global $loc, $referer;
    $loc = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on' ? 'https' : 'http') . '://' . OX_getHostName() . $_SERVER['REQUEST_URI'];
    $referer = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '';
    if (is_numeric($what)) {
        $zones = OA_cacheGetPublisherZones($what);
        $nz = false;
    } else {
        $zones = unserialize($what);
        $nz = true;
    }
    $spc_output = array();
    foreach ($zones as $zone => $data) {
        if (empty($zone)) {
            continue;
        }
        if ($nz) {
            $varname = $zone;
            $zoneid = $data;
        } else {
            $varname = $zoneid = $zone;
        }
        unset($GLOBALS['_MAX']['deliveryData']);
        $output = MAX_adSelect('zone:' . $zoneid, '', $target, $source, $withtext, '', $context, $richmedia, $ct0, $GLOBALS['loc'], $GLOBALS['referer']);
        $spc_output[$varname] = $output;
        if (!empty($block) && !empty($output['bannerid'])) {
            $output['context'][] = array('!=' => 'bannerid:' . $output['bannerid']);
        }
        if (!empty($blockcampaign) && !empty($output['campaignid'])) {
            $output['context'][] = array('!=' => 'campaignid:' . $output['campaignid']);
        }
        if (!empty($output['context'])) {
            foreach ($output['context'] as $id => $contextArray) {
                if (!in_array($contextArray, $context)) {
                    $context[] = $contextArray;
                }
            }
        }
    }
    return new XML_RPC_Response(XML_RPC_encode($spc_output));
    $output = call_user_func_array('MAX_adSelect', $view_params);
    if (!is_array($output)) {
        $output = array();
    } elseif (isset($output['contenttype']) && $output['contenttype'] == 'swf') {
        $output['html'] = MAX_flashGetFlashObjectExternal() . $output['html'];
    }
    MAX_cookieFlush();
    $output['cookies'] = $GLOBALS['_OA']['COOKIE']['XMLRPC_CACHE'];
    return new XML_RPC_Response(XML_RPC_encode($output));
}
开发者ID:Apeplazas,项目名称:plazadelatecnologia,代码行数:93,代码来源:axmlrpc.php


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