|
@@ -89,9 +89,7 @@ class Http
|
|
|
$_POST = $_GET = $_COOKIE = $_REQUEST = $_SESSION = $_FILES = array();
|
|
$_POST = $_GET = $_COOKIE = $_REQUEST = $_SESSION = $_FILES = array();
|
|
|
$GLOBALS['HTTP_RAW_POST_DATA'] = '';
|
|
$GLOBALS['HTTP_RAW_POST_DATA'] = '';
|
|
|
// Clear cache.
|
|
// Clear cache.
|
|
|
- HttpCache::$header = HttpCache::$default;
|
|
|
|
|
- HttpCache::$cookie = array();
|
|
|
|
|
- HttpCache::$instance = new HttpCache();
|
|
|
|
|
|
|
+ HttpCache::reset();
|
|
|
// $_SERVER
|
|
// $_SERVER
|
|
|
$_SERVER = array(
|
|
$_SERVER = array(
|
|
|
'QUERY_STRING' => '',
|
|
'QUERY_STRING' => '',
|
|
@@ -237,8 +235,7 @@ class Http
|
|
|
public static function encode($content, TcpConnection $connection)
|
|
public static function encode($content, TcpConnection $connection)
|
|
|
{
|
|
{
|
|
|
// http-code status line.
|
|
// http-code status line.
|
|
|
- $header = (HttpCache::$status ?: 'HTTP/1.1 200 OK') . "\r\n";
|
|
|
|
|
- HttpCache::$status = '';
|
|
|
|
|
|
|
+ $header = HttpCache::$status . "\r\n";
|
|
|
|
|
|
|
|
// Cookie headers
|
|
// Cookie headers
|
|
|
if(HttpCache::$cookie) {
|
|
if(HttpCache::$cookie) {
|
|
@@ -690,6 +687,14 @@ class HttpCache
|
|
|
public $sessionStarted = false;
|
|
public $sessionStarted = false;
|
|
|
public $sessionFile = '';
|
|
public $sessionFile = '';
|
|
|
|
|
|
|
|
|
|
+ public static function reset()
|
|
|
|
|
+ {
|
|
|
|
|
+ self::$status = 'HTTP/1.1 200 OK';
|
|
|
|
|
+ self::$header = self::$default;
|
|
|
|
|
+ self::$cookie = array();
|
|
|
|
|
+ self::$instance = new HttpCache();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
public static function init()
|
|
public static function init()
|
|
|
{
|
|
{
|
|
|
if (!self::$sessionName) {
|
|
if (!self::$sessionName) {
|