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


PHP set_magic_quotes_runtime函数代码示例

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


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

示例1: init_env

 /**
  * 初始化环境
  */
 public function init_env()
 {
     if (PHP_VERSION < '5.3.0') {
         set_magic_quotes_runtime(0);
     }
     define('MAGIC_QUOTES_GPC', function_exists('get_magic_quotes_gpc') && get_magic_quotes_gpc());
     define('ICONV_ENABLE', function_exists('iconv'));
     define('MB_ENABLE', function_exists('mb_convert_encoding'));
     define('EXT_OBGZIP', function_exists('ob_gzhandler'));
     define('TIMESTAMP', time());
     $this->_timezone_set();
     define('SITE_URL', site_url());
     define('BASE_URL', base_url());
     define('CURRENT_URL', current_url());
     define('PAGESIZE', 10);
     //页码大小
     define('DATETIMEFROMAT', 'Y/m/d H:i:s');
     // 常用的日期格式
     // authkey
     $authkey = trim(config_item('auth_key'));
     define('AUTHKEY', $authkey ? $authkey : 'vxcfhwqpordhfadvs');
     $site_name = trim(strip_tags(config_item('site_name')));
     define('SITENAME', $site_name ? $site_name : '老虎游戏');
     if (!defined('CHARSET')) {
         $charset = strtoupper(config_item('charset'));
         define('CHARSET', $charset);
     }
     define('IMGDIR', 'http://img.laohu.com/ls/images/');
 }
开发者ID:Git-Host,项目名称:dotachuanqi,代码行数:32,代码来源:env_model.php

示例2: index

 public function index()
 {
     //note 普通的 http 通知方式
     if (!defined('IN_UC')) {
         error_reporting(0);
         set_magic_quotes_runtime(0);
         defined('MAGIC_QUOTES_GPC') || define('MAGIC_QUOTES_GPC', get_magic_quotes_gpc());
         service("Passport");
         $_DCACHE = $get = $post = array();
         $code = @$_GET['code'];
         parse_str(_authcode($code, 'DECODE', UC_KEY), $get);
         if (MAGIC_QUOTES_GPC) {
             $get = _stripslashes($get);
         }
         $timestamp = time();
         if ($timestamp - $get['time'] > 3600) {
             exit('Authracation has expiried');
         }
         if (empty($get)) {
             exit('Invalid Request');
         }
         $action = $get['action'];
         require_once DISCUZ_ROOT . './uc_client/lib/xml.class.php';
         $post = xml_unserialize(file_get_contents('php://input'));
         if (in_array($get['action'], array('test', 'deleteuser', 'renameuser', 'gettag', 'synlogin', 'synlogout', 'updatepw', 'updatebadwords', 'updatehosts', 'updateapps', 'updateclient', 'updatecredit', 'getcreditsettings', 'updatecreditsettings'))) {
             exit($this->{$get}['action']($get, $post));
         } else {
             exit(API_RETURN_FAILED);
         }
     }
 }
开发者ID:BGCX262,项目名称:ztoa-svn-to-git,代码行数:31,代码来源:UcenterAction.class.php

示例3: session

function session($configfile)
{
    if (get_magic_quotes_runtime()) {
        set_magic_quotes_runtime(0);
    }
    $ini = readINIfile("" . $configfile . "", ";");
    // dabei ist ; das zeichen für einen kommentar. kann geändert werden.
    for ($i = 0; $i <= 7; $i++) {
        $_SESSION["color_ch" . $i] = $ini['plotter']['color_ch' . $i];
        $_SESSION["temp_min" . $i] = $ini['temp_min']['temp_min' . $i];
        $_SESSION["temp_max" . $i] = $ini['temp_max']['temp_max' . $i];
        $_SESSION["ch_name" . $i] = $ini['ch_name']['ch_name' . $i];
        $_SESSION["alert" . $i] = $ini['web_alert']['ch' . $i];
        $_SESSION["ch_show" . $i] = $ini['ch_show']['ch' . $i];
    }
    $_SESSION["plot_start"] = $ini['ToDo']['plot_start'];
    $_SESSION["plotname"] = $ini['plotter']['plotname'];
    $_SESSION["plotsize"] = $ini['plotter']['plotsize'];
    $_SESSION["plotbereich_min"] = $ini['plotter']['plotbereich_min'];
    $_SESSION["plotbereich_max"] = $ini['plotter']['plotbereich_max'];
    $_SESSION["keybox"] = $ini['plotter']['keybox'];
    $_SESSION["keyboxframe"] = $ini['plotter']['keyboxframe'];
    $_SESSION["pit_on"] = $ini['ToDo']['pit_on'];
    $_SESSION["pit_ch"] = $ini['Pitmaster']['pit_ch'];
    $_SESSION["webcam_start"] = $ini['webcam']['webcam_start'];
    $_SESSION["current_temp"] = $ini['filepath']['current_temp'];
    $_SESSION["pitmaster"] = $ini['filepath']['pitmaster'];
    if (!isset($_SESSION["websoundalert"])) {
        $_SESSION["websoundalert"] = "True";
    }
}
开发者ID:hirschberg,项目名称:WLANThermo_redis_node,代码行数:31,代码来源:function.php

示例4: _init_env

 function _init_env()
 {
     error_reporting(E_ERROR);
     if (phpversion() < '5.3.0') {
         set_magic_quotes_runtime(0);
     }
     define('DISCUZ_ROOT', substr(dirname(__FILE__), 0, -12));
     define('MAGIC_QUOTES_GPC', function_exists('get_magic_quotes_gpc') && get_magic_quotes_gpc());
     define('ICONV_ENABLE', function_exists('iconv'));
     define('MB_ENABLE', function_exists('mb_convert_encoding'));
     define('EXT_OBGZIP', function_exists('ob_gzhandler'));
     define('TIMESTAMP', time());
     discuz_core::timezone_set();
     if (!defined('DISCUZ_CORE_FUNCTION') && !@(include DISCUZ_ROOT . './source/function/function_core.php')) {
         $this->error('function_core.php is missing');
     }
     define('IS_ROBOT', checkrobot());
     foreach ($GLOBALS as $key => $value) {
         if (!isset($this->superglobal[$key])) {
             $GLOBALS[$key] = null;
             unset($GLOBALS[$key]);
         }
     }
     global $_G;
     $_G = array('uid' => 0, 'username' => '', 'adminid' => 0, 'groupid' => 1, 'sid' => '', 'formhash' => '', 'timestamp' => TIMESTAMP, 'starttime' => dmicrotime(), 'clientip' => $this->_get_client_ip(), 'referer' => '', 'charset' => '', 'gzipcompress' => '', 'authkey' => '', 'timenow' => array(), 'PHP_SELF' => '', 'siteurl' => '', 'siteroot' => '', 'config' => array(), 'setting' => array(), 'member' => array(), 'group' => array(), 'cookie' => array(), 'style' => array(), 'cache' => array(), 'session' => array(), 'lang' => array(), 'my_app' => array(), 'my_userapp' => array(), 'fid' => 0, 'tid' => 0, 'forum' => array(), 'rssauth' => '', 'home' => array(), 'space' => array(), 'block' => array(), 'article' => array(), 'action' => array('action' => APPTYPEID, 'fid' => 0, 'tid' => 0));
     $_G['PHP_SELF'] = htmlspecialchars($_SERVER['SCRIPT_NAME'] ? $_SERVER['SCRIPT_NAME'] : $_SERVER['PHP_SELF']);
     $_G['basescript'] = CURSCRIPT;
     $_G['siteurl'] = htmlspecialchars('http://' . $_SERVER['HTTP_HOST'] . preg_replace("/\\/+(api)?\\/*\$/i", '', substr($_G['PHP_SELF'], 0, strrpos($_G['PHP_SELF'], '/'))) . '/');
     $uri = $_SERVER['REQUEST_URI'] ? $_SERVER['REQUEST_URI'] : ($_SERVER['PHP_SELF'] ? $_SERVER['PHP_SELF'] : $_SERVER['SCRIPT_NAME']);
     $_G['siteroot'] = substr($_G['PHP_SELF'], 0, -strlen(basename($_G['PHP_SELF'])));
     $this->var =& $_G;
 }
开发者ID:Kingson4Wu,项目名称:php_demo,代码行数:32,代码来源:class_core.php

示例5: __construct

 private function __construct()
 {
     //-----------需要页面显示调试信息,	注释掉下面两行即可---
     //-------------------------------------------------------
     set_error_handler(array("Core", 'appError'));
     set_exception_handler(array("Core", 'appException'));
     date_default_timezone_set("Asia/Shanghai");
     if (version_compare(PHP_VERSION, '5.4.0', '<')) {
         @set_magic_quotes_runtime(0);
         define('MAGIC_QUOTES_GPC', get_magic_quotes_gpc() ? True : False);
     }
     if (!defined('WEB_PATH')) {
         //define("WEB_PATH","D:/wamp/www/pc2.valsun.cn/");
         define("WEB_PATH", "/data/web/erpNew/pc.valsun.cn/");
     }
     include WEB_PATH . "lib/common.php";
     //加载全局配置信息
     C(include WEB_PATH . 'conf/common.php');
     include WEB_PATH . "lib/auth.php";
     //鉴权
     include WEB_PATH . "lib/authuser.class.php";
     //新鉴权
     //Auth::setAccess(include WEB_PATH.'conf/access.php');
     include WEB_PATH . "lib/log.php";
     //加载数据接口层及所需支撑
     include WEB_PATH . "lib/service/http.php";
     //网络接口
     include WEB_PATH . "lib/functions.php";
     include WEB_PATH . "lib/page.php";
     include WEB_PATH . "lib/template.php";
     //PHPLIB 的模板类
     include WEB_PATH . "lib/cache/cache.php";
     //memcache
     include WEB_PATH . "lib/PHPExcel.php";
     //PHPExcel
     //include WEB_PATH."lib/rabbitmq/rabbitmq.class.php";
     //加载语言包
     //$lang	=	WEB_PATH."lang/".C("LANG").".php";		//memcache
     if (file_exists($lang)) {
         //echo $lang;
         //C(include $lang);
     }
     if (C("DATAGATE") == "db") {
         $db = C("DB_TYPE");
         include WEB_PATH . "lib/db/" . $db . ".php";
         //db直连
         if ($db == "mysql") {
             global $dbConn;
             $db_config = C("DB_CONFIG");
             $dbConn = new mysql();
             $dbConn->connect($db_config["master1"][0], $db_config["master1"][1], $db_config["master1"][2]);
             $dbConn->select_db($db_config["master1"][4]);
         }
         if (DB_TYPE == "mongodb") {
             //.......
         }
     }
     //自动加载类
     spl_autoload_register(array('Core', 'autoload'));
 }
开发者ID:ohjack,项目名称:newErp,代码行数:60,代码来源:framework.php

示例6: __construct

 public function __construct()
 {
     if (get_magic_quotes_runtime()) {
         @set_magic_quotes_runtime(0);
     }
     if (get_magic_quotes_gpc()) {
         $_POST = $this->strip_slashes($_POST);
         $_GET = $this->strip_slashes($_GET);
         $_SESSION = $this->strip_slashes($_SESSION);
         $_COOKIE = $this->strip_slashes($_COOKIE);
     }
     if (defined('XIAOCMS_ADMIN') || defined('XIAOCMS_MEMBER')) {
         define('SITE_PATH', self::get_a_url());
     } else {
         define('SITE_PATH', self::get_base_url());
     }
     if (!is_file(XIAOCMS_PATH . 'data/install.lock')) {
         self::redirect(url('install/index'));
     }
     if (is_file(XIAOCMS_PATH . 'member' . DIRECTORY_SEPARATOR . 'index.php')) {
         define('XIAOCMS_MEMBER', XIAOCMS_PATH . 'member' . DIRECTORY_SEPARATOR);
     }
     $this->db = xiaocms::load_class('Model');
     $this->view = xiaocms::load_class('view');
     $this->cookie = xiaocms::load_class('cookie');
     $this->session = xiaocms::load_class('session');
     $this->site_config = xiaocms::load_config('config');
     $this->category_cache = get_cache('category');
     $this->content_model = get_cache('content_model');
     $this->member_info = self::get_member_info();
     $this->view->assign(array('cats' => $this->category_cache, 'member' => $this->member_info, 'site_url' => self::get_http_host() . SITE_PATH, 'site_name' => $this->site_config['site_name'], 'page' => (int) self::get('page') ? (int) self::get('page') : 1, 'site_template' => SITE_PATH . basename(TEMPLATE_DIR) . '/' . basename(SYS_THEME_DIR) . '/'));
 }
开发者ID:43431655,项目名称:qizhongbao,代码行数:32,代码来源:Base.class.php

示例7: MagicQuotesRuntimeSetting

function MagicQuotesRuntimeSetting()
{
    @ini_set("magic_quotes_runtime", 0);
    if (version_compare('5.4', PHP_VERSION, '>') && function_exists('set_magic_quotes_runtime') && get_magic_quotes_runtime()) {
        @set_magic_quotes_runtime(false);
    }
}
开发者ID:max-severin,项目名称:sample_products,代码行数:7,代码来源:functions.php

示例8: Pommo_Db

 function Pommo_Db($username = NULL, $password = NULL, $database = NULL, $hostname = NULL, $tablePrefix = NULL)
 {
     // turn off magic quotes runtime
     if (get_magic_quotes_runtime()) {
         if (!set_magic_quotes_runtime(0)) {
             Pommo::kill('Could not turn off PHP\'s magic_quotes_runtime');
         }
     }
     $this->_prefix = $tablePrefix;
     $this->_database = $database;
     $this->table = array('config' => '`' . $tablePrefix . 'config`', 'fields' => '`' . $tablePrefix . 'fields`', 'group_rules' => '`' . $tablePrefix . 'group_rules`', 'groups' => '`' . $tablePrefix . 'groups`', 'mailing_notices' => '`' . $tablePrefix . 'mailing_notices`', 'mailing_current' => '`' . $tablePrefix . 'mailing_current`', 'mailings' => '`' . $tablePrefix . 'mailings`', 'scratch' => '`' . $tablePrefix . 'scratch`', 'subscriber_data' => '`' . $tablePrefix . 'subscriber_data`', 'subscriber_pending' => '`' . $tablePrefix . 'subscriber_pending`', 'subscriber_update' => '`' . $tablePrefix . 'subscriber_update`', 'subscribers' => '`' . $tablePrefix . 'subscribers`', 'templates' => '`' . $tablePrefix . 'templates`', 'queue' => '`' . $tablePrefix . 'queue`', 'updates' => '`' . $tablePrefix . 'updates`');
     $this->_dieOnQuery = TRUE;
     $this->_debug = FALSE;
     $this->_results = array();
     // connect to mysql database using config variables from poMMo class (set in setup/config.php).
     // supress errors to hide login information...
     $this->_link = mysql_connect($hostname, $username, $password);
     if (!$this->_link) {
         Pommo::kill(Pommo::_T('Could not establish database connection.') . ' ' . Pommo::_T('Verify your settings in config.php'));
     }
     if (!@mysql_select_db($database, $this->_link)) {
         Pommo::kill(sprintf(Pommo::_T('Connected to database server but could not select database (%s). Does it exist?'), $database) . ' ' . Pommo::_T('Verify your settings in config.php'));
     }
     // Make sure any results we retrieve or commands we send use the same charset and collation as the database:
     //  code taken from Juliette Reinders Folmer; http://www.adviesenzo.nl/examples/php_mysql_charset_fix/
     //  TODO: Cache the charset?
     $db_charset = mysql_query("SHOW VARIABLES LIKE 'character_set_database'", $this->_link);
     $charset_row = mysql_fetch_assoc($db_charset);
     mysql_query("SET NAMES '" . $charset_row['Value'] . "'", $this->_link);
     unset($db_charset, $charset_row);
     // setup safeSQL class
     $this->_safeSQL = new SafeSQL_MySQL($this->_link);
 }
开发者ID:systemfirez,项目名称:poMMo,代码行数:33,代码来源:Pommo_Db.php

示例9: get_entries

 function get_entries($process_comment_func = NULL)
 {
     if (function_exists('set_magic_quotes_runtime')) {
         set_magic_quotes_runtime(0);
     }
     $xml = simplexml_load_file('compress.zlib://' . $this->file);
     // simple "are we a disqus export?" check
     if (!$xml || $xml->getName() !== 'disqus') {
         return false;
     }
     foreach ($xml->thread as $thread) {
         $attributes = $thread->attributes('dsq', true);
         $threadid = (int) $attributes['id'];
         $link = (string) $thread->link;
         if (empty($this->thread_to_post_id[$threadid])) {
             if (trailingslashit($link) == trailingslashit(get_option('siteurl'))) {
                 $this->thread_to_post_id[$threadid] = (int) get_option('page_on_front');
             } else {
                 $this->thread_to_post_id[$threadid] = url_to_postid($link);
                 // echo "<li>URL to postid: <code>", $link, "</code> - <code>", $this->thread_to_post_id[$threadid], "</code></li>";
             }
         }
     }
     if ($process_comment_func) {
         foreach ($xml->post as $comment) {
             call_user_func($process_comment_func, $comment);
         }
     }
     return true;
 }
开发者ID:kemayo,项目名称:wp-disqus-importer,代码行数:30,代码来源:disqus-importer.php

示例10: startInit

 /** startInit() initiates the environment
  * @return void
  */
 public static function startInit()
 {
     @set_time_limit(0);
     @error_reporting(E_ALL & ~E_DEPRECATED & ~E_NOTICE);
     @ini_set('session.save_handler', 'mm');
     @ini_set('session.cookie_httponly', true);
     @ob_start('sanitize_output');
     @session_start();
     @session_cache_limiter('no-cache');
     @session_set_cookie_params(0, null, null, true, true);
     @set_magic_quotes_runtime(0);
     self::verCheck();
     self::extCheck();
     foreach ($_REQUEST as $key => $val) {
         $_REQUEST[$key] = is_array($val) ? filter_var_array($val, FILTER_SANITIZE_STRING) : filter_var($val, FILTER_SANITIZE_STRING);
     }
     foreach ($_GET as $key => $val) {
         $_GET[$key] = is_array($val) ? filter_var_array($val, FILTER_SANITIZE_STRING) : filter_var($val, FILTER_SANITIZE_STRING);
     }
     foreach ($_POST as $key => $val) {
         $_POST[$key] = is_array($val) ? filter_var_array($val, FILTER_SANITIZE_STRING) : filter_var($val, FILTER_SANITIZE_STRING);
     }
     foreach (array('node', 'sub', 'printertype', 'id', 'sub', 'crit', 'sort', 'confirm', 'tab') as $x) {
         global ${$x};
         ${$x} = isset($_REQUEST[$x]) ? filter_var($_REQUEST[$x], FILTER_SANITIZE_STRING) : '';
     }
     unset($x);
     new System();
     new Config();
 }
开发者ID:bramverstraten,项目名称:fogproject,代码行数:33,代码来源:init.php

示例11: initialize_inputs

/**
 * Initialization step. Called at each request.
 * It either sets up variables for other steps, or handle a few requests on its own.
 */
function initialize_inputs()
{
    // Turn off magic quotes runtime and enable error reporting.
    if (function_exists('set_magic_quotes_runtime')) {
        @set_magic_quotes_runtime(0);
    }
    error_reporting(E_ALL);
    // This is the test for support of compression
    if (isset($_GET['obgz'])) {
        ob_start('ob_gzhandler');
        if (ini_get('session.save_handler') == 'user') {
            @ini_set('session.save_handler', 'files');
        }
        session_start();
        if (!headers_sent()) {
            echo '<!DOCTYPE html>
<html>
	<head>
		<title>', htmlspecialchars($_GET['pass_string'], ENT_COMPAT, 'UTF-8'), '</title>
	</head>
	<body style="background: #d4d4d4; margin-top: 16%; font-size: 16pt;">
		<strong>', htmlspecialchars($_GET['pass_string'], ENT_COMPAT, 'UTF-8'), '</strong>
	</body>
</html>';
        }
        exit;
    } else {
        ob_start();
        if (ini_get('session.save_handler') == 'user') {
            @ini_set('session.save_handler', 'files');
        }
        if (function_exists('session_start')) {
            @session_start();
        }
    }
    // Reject magic_quotes_sybase='on'.
    if (ini_get('magic_quotes_sybase') || strtolower(ini_get('magic_quotes_sybase')) == 'on') {
        die('magic_quotes_sybase=on was detected: your host is using an unsecure PHP configuration, deprecated and removed in current versions. Please upgrade PHP.');
    }
    if (function_exists('get_magic_quotes_gpc') && get_magic_quotes_gpc() != 0) {
        die('magic_quotes_gpc=on was detected: your host is using an unsecure PHP configuration, deprecated and removed in current versions. Please upgrade PHP.');
    }
    // Add slashes, as long as they aren't already being added.
    foreach ($_POST as $k => $v) {
        if (strpos($k, 'password') === false && strpos($k, 'passwd') === false) {
            $_POST[$k] = addslashes($v);
        } else {
            $_POST[$k] = addcslashes($v, '\'');
        }
    }
    // This is really quite simple; if ?delete is on the URL, delete the installer...
    if (isset($_GET['delete'])) {
        action_deleteInstaller();
    }
    // PHP 5 might cry if we don't do this now.
    $server_offset = @mktime(0, 0, 0, 1, 1, 1970);
    date_default_timezone_set('Etc/GMT' . ($server_offset > 0 ? '+' : '') . $server_offset / 3600);
    // Force an integer step, defaulting to 0.
    $_GET['step'] = isset($_GET['step']) ? (int) $_GET['step'] : 0;
}
开发者ID:joshuaadickerson,项目名称:Elkarte,代码行数:64,代码来源:install.php

示例12: satispress_send_file

/**
 * Send a download.
 *
 * @since 0.1.0
 *
 * @param string $file An absolute file path.
 */
function satispress_send_file($file)
{
    @session_write_close();
    if (function_exists('apache_setenv')) {
        @apache_setenv('no-gzip', 1);
    }
    if (get_magic_quotes_runtime()) {
        @set_magic_quotes_runtime(0);
    }
    @ini_set('zlib.output_compression', 'Off');
    @set_time_limit(0);
    @ob_end_clean();
    if (ob_get_level()) {
        @ob_end_clean();
        // Zip corruption fix.
    }
    nocache_headers();
    header('Robots: none');
    header('Content-Type: application/force-download');
    header('Content-Description: File Transfer');
    header('Content-Disposition: attachment; filename="' . basename($file) . '";');
    header('Content-Transfer-Encoding: binary');
    if ($size = @filesize($file)) {
        header('Content-Length: ' . $size);
    }
    @readfile_chunked($file) or wp_die(__('File not found', 'satispress'));
    exit;
}
开发者ID:blazersix,项目名称:satispress,代码行数:35,代码来源:functions.php

示例13: init

 public static function init()
 {
     // Get rid of magic_quotes
     if (function_exists('get_magic_quotes_gpc') && get_magic_quotes_gpc() || ini_get('magic_quotes_sybase')) {
         $_POST = Bootstrap::multidimensionalArrayMap('stripslashes', $_POST);
         $_REQUEST = Bootstrap::multidimensionalArrayMap('stripslashes', $_REQUEST);
         $_GET = Bootstrap::multidimensionalArrayMap('stripslashes', $_GET);
         $_COOKIE = Bootstrap::multidimensionalArrayMap('stripslashes', $_COOKIE);
     }
     if (ini_get('magic_quotes_runtime') && function_exists('set_magic_quotes_runtime')) {
         @set_magic_quotes_runtime(0);
     }
     // This is needed to encode json correctly, because of the floating point
     setlocale(LC_ALL, 'en_US.utf8');
     // Each MMap plugin should decide waht type of response needs.
     //ob_start('mb_output_handler');
     // The environment is safe now, start the system
     Bootstrap::load(EYE_ROOT . '/' . SYSTEM_DIR . '/' . KERNEL_DIR . '/Kernel.php');
     //get the priority
     $priorities = Bootstrap::loadPriorities();
     // Load all libraries
     Bootstrap::loadLibraries($priorities);
     // Initialize self::$Logger for next steps
     self::$Logger = Logger::getLogger('bootstrap.Bootstrap');
     // Load all services
     Bootstrap::loadServices($priorities);
     // Load all frameworks
     Bootstrap::loadFrameworks($priorities);
 }
开发者ID:sebasalons,项目名称:eyeos-u1db,代码行数:29,代码来源:Bootstrap.php

示例14: _init_env

 function _init_env()
 {
     error_reporting(E_ERROR);
     if (phpversion() < '5.3.0') {
         set_magic_quotes_runtime(0);
     }
     define('MAGIC_QUOTES_GPC', function_exists('get_magic_quotes_gpc') && get_magic_quotes_gpc());
     define('ICONV_ENABLE', function_exists('iconv'));
     define('MB_ENABLE', function_exists('mb_convert_encoding'));
     define('FORMHASH', formhash());
     define('TIMESTAMP', time());
     $_SERVER['HTTP_USER_AGENT'] = empty($_SERVER['HTTP_USER_AGENT']) ? '' : $_SERVER['HTTP_USER_AGENT'];
     foreach ($GLOBALS as $key => $value) {
         if (!isset($this->superglobal[$key])) {
             $GLOBALS[$key] = null;
             unset($GLOBALS[$key]);
         }
     }
     global $_G;
     $_G = array('uid' => 0, 'username' => 'Guest', 'formhash' => '', 'timestamp' => TIMESTAMP, 'starttime' => array_sum(explode(' ', microtime())), 'clientip' => $this->_get_client_ip(), 'referer' => '', 'charset' => '', 'timenow' => array(), 'cookiepre' => '', 'PHP_SELF' => '', 'siteurl' => '', 'siteroot' => '', 'authkey' => '', 'config' => array(), 'setting' => array('sitetheme' => 'default'), 'member' => array(), 'cookie' => array(), 'style' => array(), 'cache' => array());
     $_G['PHP_SELF'] = htmlspecialchars($_SERVER['SCRIPT_NAME'] ? $_SERVER['SCRIPT_NAME'] : $_SERVER['PHP_SELF']);
     $_G['basescript'] = CURSCRIPT;
     $_G['basefilename'] = basename($_G['PHP_SELF']);
     $_G['siteurl'] = htmlspecialchars('http://' . $_SERVER['HTTP_HOST'] . preg_replace("/\\/+(api)?\\/*\$/i", '', substr($_G['PHP_SELF'], 0, strrpos($_G['PHP_SELF'], '/'))) . '/');
     $_G['siteroot'] = substr($_G['PHP_SELF'], 0, -strlen($_G['basefilename']));
 }
开发者ID:pan289091315,项目名称:Discuz,代码行数:26,代码来源:brand.class.php

示例15: _init_env

 function _init_env()
 {
     error_reporting(E_ERROR);
     if (PHP_VERSION < '5.3.0') {
         set_magic_quotes_runtime(0);
     }
     /*vot*/
     if (!defined('DISCUZ_ROOT')) {
         /*vot*/
         define('DISCUZ_ROOT', preg_replace("/^\\w\\:/i", '', str_replace("\\", '/', substr(dirname(__FILE__), 0, -12))));
         /*vot*/
     }
     define('MAGIC_QUOTES_GPC', function_exists('get_magic_quotes_gpc') && get_magic_quotes_gpc());
     define('ICONV_ENABLE', function_exists('iconv'));
     define('MB_ENABLE', function_exists('mb_convert_encoding'));
     define('EXT_OBGZIP', function_exists('ob_gzhandler'));
     define('TIMESTAMP', time());
     $this->timezone_set();
     /*vot*/
     if (!defined('DISCUZ_CORE_FUNCTION') && !@(include_once DISCUZ_ROOT . './source/function/function_core.php')) {
         exit('function_core.php is missing');
     }
     if (function_exists('ini_get')) {
         $memorylimit = @ini_get('memory_limit');
         if ($memorylimit && return_bytes($memorylimit) < 33554432 && function_exists('ini_set')) {
             ini_set('memory_limit', '128m');
         }
     }
     define('IS_ROBOT', checkrobot());
     foreach ($GLOBALS as $key => $value) {
         if (!isset($this->superglobal[$key])) {
             $GLOBALS[$key] = null;
             unset($GLOBALS[$key]);
         }
     }
     global $_G;
     $_G = array('uid' => 0, 'username' => '', 'adminid' => 0, 'groupid' => 1, 'sid' => '', 'formhash' => '', 'timestamp' => TIMESTAMP, 'starttime' => dmicrotime(), 'clientip' => $this->_get_client_ip(), 'referer' => '', 'charset' => '', 'gzipcompress' => '', 'authkey' => '', 'timenow' => array(), 'PHP_SELF' => '', 'siteurl' => '', 'siteroot' => '', 'siteport' => '', 'config' => array(), 'setting' => array(), 'member' => array(), 'group' => array(), 'cookie' => array(), 'style' => array(), 'cache' => array(), 'session' => array(), 'lang' => array(), 'my_app' => array(), 'my_userapp' => array(), 'fid' => 0, 'tid' => 0, 'forum' => array(), 'thread' => array(), 'rssauth' => '', 'home' => array(), 'space' => array(), 'block' => array(), 'article' => array(), 'action' => array('action' => APPTYPEID, 'fid' => 0, 'tid' => 0), 'mobile' => '');
     $_G['PHP_SELF'] = htmlspecialchars($this->_get_script_url());
     $_G['basescript'] = CURSCRIPT;
     $_G['basefilename'] = basename($_G['PHP_SELF']);
     $sitepath = substr($_G['PHP_SELF'], 0, strrpos($_G['PHP_SELF'], '/'));
     if (defined('IN_API')) {
         $sitepath = preg_replace("/\\/api\\/?.*?\$/i", '', $sitepath);
     } elseif (defined('IN_ARCHIVER')) {
         $sitepath = preg_replace("/\\/archiver/i", '', $sitepath);
     }
     $_G['siteurl'] = htmlspecialchars('http://' . $_SERVER['HTTP_HOST'] . $sitepath . '/');
     $url = parse_url($_G['siteurl']);
     $_G['siteroot'] = isset($url['path']) ? $url['path'] : '';
     $_G['siteport'] = empty($_SERVER['SERVER_PORT']) || $_SERVER['SERVER_PORT'] == '80' ? '' : ':' . $_SERVER['SERVER_PORT'];
     if (defined('SUB_DIR')) {
         $_G['siteurl'] = str_replace(SUB_DIR, '/', $_G['siteurl']);
         $_G['siteroot'] = str_replace(SUB_DIR, '/', $_G['siteroot']);
     }
     /*vot*/
     $_G['siteurl'] = str_replace("\\", '/', $_G['siteurl']);
     /*vot*/
     $_G['siteroot'] = str_replace("\\", '/', $_G['siteroot']);
     $this->var =& $_G;
 }
开发者ID:v998,项目名称:discuzx-en,代码行数:60,代码来源:class_core.php


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