本文整理匯總了PHP中Model_Context::instance方法的典型用法代碼示例。如果您正苦於以下問題:PHP Model_Context::instance方法的具體用法?PHP Model_Context::instance怎麽用?PHP Model_Context::instance使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Model_Context
的用法示例。
在下文中一共展示了Model_Context::instance方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: logout
public static function logout()
{
$context = Model_Context::instance();
$JinboSession = new Model_Session();
$logout_url = $context->getProperty('service.jinbo_api_url') . "/logout/";
$api_key = $context->getProperty('service.jinbo_api_key');
$_j_sess_id = $_COOKIE[$context->getProperty('service.jinbonet_session_name')];
list($jinbo_sess_id, $jinbo_domain) = explode("/", $_j_sess_id);
if (!$_SESSION['user'][uid] && !$jinbo_sess_id) {
return false;
}
$params = "remote_addr=" . $_SERVER['REMOTE_ADDR'] . "&api_key=" . $api_key;
if ($_SESSION['user'][uid]) {
$params .= "&uid=" . $_SESSION['user'][uid];
}
if ($jinbo_sess_id) {
$params .= "&sessionid=" . $jinbo_sess_id;
}
$jinbo_session = $JinboSession->request($logout_url, $params);
unset($_SESSION);
session_destroy();
return true;
}
示例2: initialize
private static function initialize()
{
global $memcache;
self::$mc = $memcache;
self::$context = Model_Context::instance();
}