當前位置: 首頁>>代碼示例>>PHP>>正文


PHP setupIncludePath函數代碼示例

本文整理匯總了PHP中setupIncludePath函數的典型用法代碼示例。如果您正苦於以下問題:PHP setupIncludePath函數的具體用法?PHP setupIncludePath怎麽用?PHP setupIncludePath使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了setupIncludePath函數的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: MAX_remotehostPrivateAddress

function MAX_remotehostPrivateAddress($ip)
{
    setupIncludePath();
    require_once 'Net/IPv4.php';
    $aPrivateNetworks = array('10.0.0.0/8', '172.16.0.0/12', '192.168.0.0/16', '127.0.0.0/24');
    foreach ($aPrivateNetworks as $privateNetwork) {
        if (Net_IPv4::ipInNetwork($ip, $privateNetwork)) {
            return true;
        }
    }
    return false;
}
開發者ID:Apeplazas,項目名稱:plazadelatecnologia,代碼行數:12,代碼來源:dxmlrpc.php

示例2: setupConstants


//.........這裏部分代碼省略.........
    define('MINUTES_PER_DAY', 1440);
    // Connection status types. Only the default conversion
    // status (MAX_CONNECTION_STATUS_APPROVED) is defined (4), which
    // is a conversion type that is approved by default.
    // Note also that only ignore, pending and approved
    // are used as possible starting values (ie. in the
    // campaigns_trackers table.
    define('MAX_CONNECTION_STATUS_IGNORE', 1);
    define('MAX_CONNECTION_STATUS_PENDING', 2);
    define('MAX_CONNECTION_STATUS_ONHOLD', 3);
    define('MAX_CONNECTION_STATUS_APPROVED', 4);
    define('MAX_CONNECTION_STATUS_DISAPPROVED', 5);
    define('MAX_CONNECTION_STATUS_DUPLICATE', 6);
    // Connection action type constants
    define('MAX_CONNECTION_TYPE_SALE', 1);
    define('MAX_CONNECTION_TYPE_LEAD', 2);
    define('MAX_CONNECTION_TYPE_SIGNUP', 3);
    // Financial constants
    define('MAX_FINANCE_CPM', 1);
    define('MAX_FINANCE_CPC', 2);
    define('MAX_FINANCE_CPA', 3);
    define('MAX_FINANCE_MT', 4);
    // Monthly Tennancy
    define('MAX_FINANCE_RS', 5);
    // % Revenue split     (zone-only)
    define('MAX_FINANCE_BV', 6);
    // % Basket value      (zone-only)
    define('MAX_FINANCE_AI', 7);
    // Amount per item     (zone-only)
    define('MAX_FINANCE_ANYVAR', 8);
    // % of any variable   (zone-only)
    define('MAX_FINANCE_VARSUM', 9);
    // % of a variable sum (zone-only)
    $GLOBALS['_MAX']['STATUSES'] = array(MAX_CONNECTION_STATUS_IGNORE => 'strStatusIgnore', MAX_CONNECTION_STATUS_PENDING => 'strStatusPending', MAX_CONNECTION_STATUS_ONHOLD => 'strStatusOnHold', MAX_CONNECTION_STATUS_APPROVED => 'strStatusApproved', MAX_CONNECTION_STATUS_DISAPPROVED => 'strStatusDisapproved', MAX_CONNECTION_STATUS_DUPLICATE => 'strStatusDuplicate');
    $GLOBALS['_MAX']['CONN_TYPES'] = array(MAX_CONNECTION_TYPE_SALE => 'strConnTypeSale', MAX_CONNECTION_TYPE_LEAD => 'strConnTypeLead', MAX_CONNECTION_TYPE_SIGNUP => 'strConnTypeSignUp');
    // IP Address used to determine which (if any) MaxMind databases are installed
    define('MAX_MIND_TEST_IP', '24.24.24.24');
    // Maximum random number
    define('MAX_RAND', mt_getrandmax());
    define('MAX_RAND_INV', 1 / MAX_RAND);
    // Maintenance Engine Constants: Number of days to keep old maintenance
    // data, before pruning, where a fixed retention value is appriopriate
    define('OA_MAINTENANCE_FIXED_PRUNING', 30);
    define('MAX_LIMITATION_EQUAL', 0);
    define('MAX_LIMITATION_NOT_EQUAL', 1);
    define('MAX_LIMITATION_BITWISE', 2);
    // Define the week to start on Sunday (0) so that the PEAR::Date and
    // PEAR::Date_Calc classes agree on what day is the start of the week
    define('DATE_CALC_BEGIN_WEEKDAY', 0);
    // Do not overload DataObjects as it allows us to work with 4.3.10
    define('DB_DATAOBJECT_NO_OVERLOAD', true);
    // Ensure that the initialisation has not been run before
    if (!isset($GLOBALS['_MAX']['CONF'])) {
        // Define the installation base path if not defined
        // since local mode will pre-define this value
        if (!defined('MAX_PATH')) {
            define('MAX_PATH', dirname(__FILE__));
        }
        if (!defined('OX_PATH')) {
            define('OX_PATH', MAX_PATH);
        }
        if (!defined('RV_PATH')) {
            define('RV_PATH', MAX_PATH);
        }
        if (!defined('LIB_PATH')) {
            define('LIB_PATH', MAX_PATH . DIRECTORY_SEPARATOR . 'lib' . DIRECTORY_SEPARATOR . 'OX');
        }
        define('IS_WINDOWS', DIRECTORY_SEPARATOR === '\\');
        // Setup the include path
        setupIncludePath();
        // Parse the configuration file
        $GLOBALS['_MAX']['CONF'] = parseIniFile();
        // Define the cache file location path (required trailing slash)
        define('MAX_CACHE', MAX_PATH . '/var/cache/');
        // Set the URL access mechanism
        if (!empty($GLOBALS['_MAX']['CONF']['openads']['requireSSL'])) {
            $GLOBALS['_MAX']['HTTP'] = 'https://';
        } else {
            if (isset($_SERVER['SERVER_PORT'])) {
                if (isset($GLOBALS['_MAX']['CONF']['openads']['sslPort']) && $_SERVER['SERVER_PORT'] == $GLOBALS['_MAX']['CONF']['openads']['sslPort']) {
                    $GLOBALS['_MAX']['HTTP'] = 'https://';
                } else {
                    $GLOBALS['_MAX']['HTTP'] = 'http://';
                }
            }
        }
        // Set the True Type Font path
        if (isset($GLOBALS['_MAX']['CONF']['graphs']['ttfDirectory'])) {
            define('IMAGE_CANVAS_SYSTEM_FONT_PATH', $GLOBALS['_MAX']['CONF']['graphs']['ttfDirectory']);
        }
        // Set the dbms type
        if (isset($GLOBALS['_MAX']['CONF']['database']) && $GLOBALS['_MAX']['CONF']['database']['type'] == 'mysql') {
            define('phpAds_dbmsname', 'MySQL');
        } else {
            if (isset($GLOBALS['_MAX']['CONF']['database']) && $GLOBALS['_MAX']['CONF']['database']['type'] == 'pgsql') {
                define('phpAds_dbmsname', 'Postgres');
            }
        }
    }
}
開發者ID:akirsch,項目名稱:revive-adserver,代碼行數:101,代碼來源:constants.php

示例3: setupIncludePath

<?php

/*
+---------------------------------------------------------------------------+
| Revive Adserver                                                           |
| http://www.revive-adserver.com                                            |
|                                                                           |
| Copyright: See the COPYRIGHT.txt file.                                    |
| License: GPLv2 or later, see the LICENSE.txt file.                        |
+---------------------------------------------------------------------------+
*/
setupIncludePath();
require_once MAX_PATH . '/lib/Max.php';
require_once MAX_PATH . '/lib/OA/DB/AdvisoryLock.php';
require_once MAX_PATH . '/lib/OA/Preferences.php';
require_once OX_PATH . '/lib/OX.php';
/**
 * A library class for providing automatic maintenance process methods.
 *
 * @static
 * @package    OpenXMaintenance
 */
class OA_Maintenance_Auto
{
    function run()
    {
        // Make sure that the output is sent to the browser before
        // loading libraries and connecting to the db
        flush();
        $aConf = $GLOBALS['_MAX']['CONF'];
        // Set longer time out, and ignore user abort
開發者ID:Jaree,項目名稱:revive-adserver,代碼行數:31,代碼來源:Auto.php


注:本文中的setupIncludePath函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。