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


PHP wfFixSessionID函数代码示例

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


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

示例1: wfSetupSession

/**
 * Initialise php session
 *
 * @param bool $sessionId
 */
function wfSetupSession($sessionId = false)
{
    global $wgSessionsInMemcached, $wgSessionsInObjectCache, $wgCookiePath, $wgCookieDomain, $wgCookieSecure, $wgCookieHttpOnly, $wgSessionHandler;
    if ($wgSessionsInObjectCache || $wgSessionsInMemcached) {
        ObjectCacheSessionHandler::install();
    } elseif ($wgSessionHandler && $wgSessionHandler != ini_get('session.save_handler')) {
        # Only set this if $wgSessionHandler isn't null and session.save_handler
        # hasn't already been set to the desired value (that causes errors)
        ini_set('session.save_handler', $wgSessionHandler);
    }
    session_set_cookie_params(0, $wgCookiePath, $wgCookieDomain, $wgCookieSecure, $wgCookieHttpOnly);
    session_cache_limiter('private, must-revalidate');
    if ($sessionId) {
        session_id($sessionId);
    } else {
        wfFixSessionID();
    }
    MediaWiki\suppressWarnings();
    session_start();
    MediaWiki\restoreWarnings();
}
开发者ID:D66Ha,项目名称:mediawiki,代码行数:26,代码来源:GlobalFunctions.php

示例2: wfSetupSession

/**
 * Initialise php session
 *
 * @param $sessionId Bool
 */
function wfSetupSession($sessionId = false)
{
    global $wgSessionsInMemcached, $wgCookiePath, $wgCookieDomain, $wgCookieSecure, $wgCookieHttpOnly, $wgSessionHandler;
    if ($wgSessionsInMemcached) {
        if (!defined('MW_COMPILED')) {
            global $IP;
            require_once "{$IP}/includes/cache/MemcachedSessions.php";
        }
        session_set_save_handler('memsess_open', 'memsess_close', 'memsess_read', 'memsess_write', 'memsess_destroy', 'memsess_gc');
        // It's necessary to register a shutdown function to call session_write_close(),
        // because by the time the request shutdown function for the session module is
        // called, $wgMemc has already been destroyed. Shutdown functions registered
        // this way are called before object destruction.
        register_shutdown_function('memsess_write_close');
    } elseif ($wgSessionHandler && $wgSessionHandler != ini_get('session.save_handler')) {
        # Only set this if $wgSessionHandler isn't null and session.save_handler
        # hasn't already been set to the desired value (that causes errors)
        ini_set('session.save_handler', $wgSessionHandler);
    }
    $httpOnlySafe = wfHttpOnlySafe() && $wgCookieHttpOnly;
    wfDebugLog('cookie', 'session_set_cookie_params: "' . implode('", "', array(0, $wgCookiePath, $wgCookieDomain, $wgCookieSecure, $httpOnlySafe)) . '"');
    session_set_cookie_params(0, $wgCookiePath, $wgCookieDomain, $wgCookieSecure, $httpOnlySafe);
    session_cache_limiter('private, must-revalidate');
    if ($sessionId) {
        session_id($sessionId);
    } else {
        wfFixSessionID();
    }
    wfSuppressWarnings();
    session_start();
    wfRestoreWarnings();
}
开发者ID:schwarer2006,项目名称:wikia,代码行数:37,代码来源:GlobalFunctions.php

示例3: wfSetupSession

/**
 * Initialise php session
 *
 * @param $sessionId Bool
 */
function wfSetupSession($sessionId = false)
{
    global $wgSessionsInMemcached, $wgSessionsInObjectCache, $wgCookiePath, $wgCookieDomain, $wgCookieSecure, $wgCookieHttpOnly, $wgSessionHandler;
    if ($wgSessionsInObjectCache || $wgSessionsInMemcached) {
        ObjectCacheSessionHandler::install();
    } elseif ($wgSessionHandler && $wgSessionHandler != ini_get('session.save_handler')) {
        # Only set this if $wgSessionHandler isn't null and session.save_handler
        # hasn't already been set to the desired value (that causes errors)
        ini_set('session.save_handler', $wgSessionHandler);
    }
    $httpOnlySafe = wfHttpOnlySafe() && $wgCookieHttpOnly;
    wfDebugLog('cookie', 'session_set_cookie_params: "' . implode('", "', array(0, $wgCookiePath, $wgCookieDomain, $wgCookieSecure, $httpOnlySafe)) . '"');
    session_set_cookie_params(0, $wgCookiePath, $wgCookieDomain, $wgCookieSecure, $httpOnlySafe);
    session_cache_limiter('private, must-revalidate');
    if ($sessionId) {
        session_id($sessionId);
    } else {
        wfFixSessionID();
    }
    wfSuppressWarnings();
    session_start();
    wfRestoreWarnings();
}
开发者ID:nischayn22,项目名称:mediawiki-core,代码行数:28,代码来源:GlobalFunctions.php

示例4: wfSetupSession

/**
 * Initialise php session
 *
 * @param $sessionId Bool
 */
function wfSetupSession($sessionId = false)
{
    global $wgSessionsInMemcached, $wgCookiePath, $wgCookieDomain, $wgCookieSecure, $wgCookieHttpOnly, $wgSessionHandler;
    if ($wgSessionsInMemcached) {
        if (!defined('MW_COMPILED')) {
            global $IP;
            require_once "{$IP}/includes/cache/MemcachedSessions.php";
        }
        session_set_save_handler('memsess_open', 'memsess_close', 'memsess_read', 'memsess_write', 'memsess_destroy', 'memsess_gc');
        // It's necessary to register a shutdown function to call session_write_close(),
        // because by the time the request shutdown function for the session module is
        // called, $wgMemc has already been destroyed. Shutdown functions registered
        // this way are called before object destruction.
        register_shutdown_function('memsess_write_close');
    } elseif ($wgSessionHandler && $wgSessionHandler != ini_get('session.save_handler')) {
        # Only set this if $wgSessionHandler isn't null and session.save_handler
        # hasn't already been set to the desired value (that causes errors)
        ini_set('session.save_handler', $wgSessionHandler);
    }
    $httpOnlySafe = wfHttpOnlySafe() && $wgCookieHttpOnly;
    wfDebugLog('cookie', 'session_set_cookie_params: "' . implode('", "', array(0, $wgCookiePath, $wgCookieDomain, $wgCookieSecure, $httpOnlySafe)) . '"');
    session_set_cookie_params(0, $wgCookiePath, $wgCookieDomain, $wgCookieSecure, $httpOnlySafe);
    session_cache_limiter('private, must-revalidate');
    if ($sessionId) {
        session_id($sessionId);
    } else {
        wfFixSessionID();
    }
    wfSuppressWarnings();
    session_start();
    wfRestoreWarnings();
    // Wikia change - start
    // log all sessions started with 1% sampling (PLATFORM-1266)
    if ((new Wikia\Util\Statistics\BernoulliTrial(0.01))->shouldSample()) {
        Wikia\Logger\WikiaLogger::instance()->info(__METHOD__, ['caller' => wfGetAllCallers(), 'exception' => new Exception()]);
    }
    // Wikia change - end
}
开发者ID:Tjorriemorrie,项目名称:app,代码行数:43,代码来源:GlobalFunctions.php


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