本文整理汇总了PHP中Mecha::UVR方法的典型用法代码示例。如果您正苦于以下问题:PHP Mecha::UVR方法的具体用法?PHP Mecha::UVR怎么用?PHP Mecha::UVR使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mecha
的用法示例。
在下文中一共展示了Mecha::UVR方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: kill
public static function kill($session = null)
{
if (is_null($session)) {
session_destroy();
} else {
if ($session === 'cookies') {
$_COOKIE = array();
if (isset($_SERVER['HTTP_COOKIE'])) {
$cookies = explode(';', $_SERVER['HTTP_COOKIE']);
foreach ($cookies as $cookie) {
$parts = explode('=', $cookie, 2);
$name = trim($parts[0]);
setcookie($name, null, -1);
setcookie($name, null, -1, '/');
}
}
} else {
if (strpos($session, 'cookie:') === 0) {
$name = substr($session, 7);
if (strpos($session, '.') !== false) {
$name_a = explode('.', $name);
if (isset($_COOKIE[$name_a[0]])) {
$old = Converter::strEval($_COOKIE[$name_a[0]]);
Mecha::UVR($old, $name);
foreach ($old as $key => $value) {
$_COOKIE[$name_a[0]][$key] = is_array($value) ? base64_encode(json_encode($value, true)) : $value;
}
$c = Converter::strEval($_COOKIE['__' . $name_a[0]]);
setcookie($name_a[0], base64_encode(json_encode($old, true)), $c[0], $c[1], $c[2], $c[3], $c[4]);
}
} else {
unset($_COOKIE[$name]);
self::set($session, null, -1);
}
} else {
Mecha::UVR($_SESSION, $session);
}
}
}
}
示例2: reset
/**
* =============================================================
* REMOVE CONFIGURATION DATA BY ITS KEY
* =============================================================
*
* -- CODE: ----------------------------------------------------
*
* Config::reset();
*
* -------------------------------------------------------------
*
* Config::reset('foo');
*
* -------------------------------------------------------------
*
*/
public static function reset($key = null)
{
if (!is_null($key)) {
Mecha::UVR(self::$bucket, $key);
} else {
self::$bucket = array();
}
return new static();
}