示例#1
0
 /** @test */
 public function endShouldEmitEndEvent()
 {
     $dog = new Dog();
     $session = new Session(0, $dog);
     $session->on('end', $this->expectCallableOnce());
     $session->end();
 }
示例#2
0
 public static function end($type)
 {
     if (static::get('type')) {
         return;
     }
     Session::end();
     static::set('type', $type);
     static::set('duration', microtime(true) - static::get('start'));
     static::set('memory', memory_get_peak_usage(true));
     static::set('classes', Loader::getFiles());
 }
 static function to($url, $permanent = false)
 {
     $_POST = null;
     //Generalize this
     if (!preg_match("/^https?:/", $url)) {
         $url = UrlHelper::localized($url);
     }
     if ($permanent) {
         header("HTTP/1.1 301 Moved Permanently");
     }
     PluginManager::getInstance()->onRedirect($url);
     Session::end(true);
     header('Location: ' . $url);
     exit;
 }
示例#4
0
    echo file_get_contents(PATH . 'system/admin/theme/error_config.php');
    exit(1);
}
// Register the default timezone for the application.
date_default_timezone_set(Config::get('application.timezone'));
// set locale
if (setlocale(LC_ALL, Config::get('application.language') . '.utf8') === false) {
    Log::warning('setlocate failed, please check your system has ' . Config::get('application.language') . ' installed.');
}
// Register the PHP exception handler.
set_exception_handler(array('Error', 'exception'));
// Register the PHP error handler.
set_error_handler(array('Error', 'native'));
// Register the shutdown handler.
register_shutdown_function(array('Error', 'shutdown'));
/**
	Start session handler
*/
Session::start();
/**
	Handle routing
*/
Anchor::run();
/**
	Close and end session
*/
Session::end();
/**
	Output awesomeness!
*/
Response::send();
示例#5
0
文件: session.php 项目: dapepe/tymio
 /**
  * Sets a session variable.
  * The function will temporarily reopen the session for the duration
  * of the call if it is closed.
  *
  * @param string $name The name of the variable to set.
  * @param mixed $value The value to set the variable to.
  * @return void
  */
 public static function set($name, $value)
 {
     if (self::$opened) {
         $_SESSION[$name] = $value;
     } else {
         Session::start();
         $_SESSION[$name] = $value;
         Session::end();
     }
 }
示例#6
0
<?php

/**
 * ==============================
 * Aegis Framework | MIT License
 * http://www.aegisframework.com/
 * ==============================
 */
$session = new Session();
$session->end();
header("location:/");
示例#7
0
<?php

require 'Models/Session.php';
$S = new Session();
$S->end();
header('Location: /#loggedout' . session_id());
die;