本文整理汇总了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;
}
示例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');
}
}
}
}
示例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