Skip to content

Commit

Permalink
Givning in and just using Configure directly in Request::createFromGl…
Browse files Browse the repository at this point in the history
…oabals()

This is the simplest and most understandable that does not disrupt the
application bootstrap entirely
  • Loading branch information
lorenzo committed May 19, 2014
1 parent 8e7eef7 commit 0cc2c24
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Network/Request.php
Expand Up @@ -164,7 +164,7 @@ public static function createFromGlobals() {
'environment' => $_SERVER + $_ENV,
'base' => $base,
'webroot' => $webroot,
'session' => null
'session' => Session::create(Configure::read('Session'))
);
$config['url'] = static::_url($config);
return new static($config);
Expand Down
3 changes: 3 additions & 0 deletions tests/TestCase/Network/RequestTest.php
Expand Up @@ -2260,6 +2260,9 @@ public function testSession() {
$session = new Session;
$request = new Request(['session' => $session]);
$this->assertSame($session, $request->session());

$request = Request::createFromGlobals();
$this->assertEquals($session, $request->session());
}

/**
Expand Down
2 changes: 1 addition & 1 deletion tests/TestCase/Network/SessionTest.php
Expand Up @@ -437,7 +437,7 @@ public function testCookieTimeoutFallback() {
'timeout' => 400,
];

$session = new Session($config);
new Session($config);
$this->assertEquals(400 * 60, ini_get('session.cookie_lifetime'));
$this->assertEquals(400 * 60, ini_get('session.gc_maxlifetime'));
}
Expand Down

0 comments on commit 0cc2c24

Please sign in to comment.