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


PHP WebRequest::checkSessionCookie方法代碼示例

本文整理匯總了PHP中WebRequest::checkSessionCookie方法的典型用法代碼示例。如果您正苦於以下問題:PHP WebRequest::checkSessionCookie方法的具體用法?PHP WebRequest::checkSessionCookie怎麽用?PHP WebRequest::checkSessionCookie使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在WebRequest的用法示例。


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

示例1: wfGetMainCache

Profiler::instance()->scopedProfileOut($ps_misc);
$ps_memcached = Profiler::instance()->scopedProfileIn($fname . '-memcached');
$wgMemc = wfGetMainCache();
$messageMemc = wfGetMessageCacheStorage();
$parserMemc = wfGetParserCacheStorage();
wfDebugLog('caches', 'main: ' . get_class($wgMemc) . ', message: ' . get_class($messageMemc) . ', parser: ' . get_class($parserMemc));
Profiler::instance()->scopedProfileOut($ps_memcached);
// Most of the config is out, some might want to run hooks here.
Hooks::run('SetupAfterCache');
$ps_session = Profiler::instance()->scopedProfileIn($fname . '-session');
if (!defined('MW_NO_SESSION') && !$wgCommandLineMode) {
    // If session.auto_start is there, we can't touch session name
    if (!wfIniGetBool('session.auto_start')) {
        session_name($wgSessionName ? $wgSessionName : $wgCookiePrefix . '_session');
    }
    if ($wgRequest->checkSessionCookie() || isset($_COOKIE[$wgCookiePrefix . 'Token'])) {
        wfSetupSession();
    }
}
Profiler::instance()->scopedProfileOut($ps_session);
$ps_globals = Profiler::instance()->scopedProfileIn($fname . '-globals');
/**
 * @var Language $wgContLang
 */
$wgContLang = Language::factory($wgLanguageCode);
$wgContLang->initEncoding();
$wgContLang->initContLang();
// Now that variant lists may be available...
$wgRequest->interpolateTitle();
/**
 * @var User $wgUser
開發者ID:D66Ha,項目名稱:mediawiki,代碼行數:31,代碼來源:Setup.php

示例2: elseif

        $wgCookiePrefix = $wgSharedDB . '_' . $wgSharedPrefix;
    } elseif ($wgSharedDB && in_array('user', $wgSharedTables)) {
        $wgCookiePrefix = $wgSharedDB;
    } elseif ($wgDBprefix) {
        $wgCookiePrefix = $wgDBname . '_' . $wgDBprefix;
    } else {
        $wgCookiePrefix = $wgDBname;
    }
}
$wgCookiePrefix = strtr($wgCookiePrefix, "=,; +.\"'\\[", "__________");
# If session.auto_start is there, we can't touch session name
#
if (!wfIniGetBool('session.auto_start')) {
    session_name($wgSessionName ? $wgSessionName : $wgCookiePrefix . '_session');
}
if (!$wgCommandLineMode && ($wgRequest->checkSessionCookie() || isset($_COOKIE[$wgCookiePrefix . 'Token']))) {
    wfIncrStats('request_with_session');
    wfSetupSession();
    $wgSessionStarted = true;
} else {
    wfIncrStats('request_without_session');
    $wgSessionStarted = false;
}
wfProfileOut($fname . '-SetupSession');
wfProfileIn($fname . '-globals');
$wgContLang = new StubContLang();
// Now that variant lists may be available...
$wgRequest->interpolateTitle();
$wgUser = new StubUser();
$wgLang = new StubUserLang();
$wgOut = new StubObject('wgOut', 'OutputPage');
開發者ID:nzmichaelh,項目名稱:wrdk,代碼行數:31,代碼來源:Setup.php


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