}
// session does not exist, create it
$this->createNewSession($id);
return '';
} catch (\PDOException $e) {
throw new \RuntimeException(sprintf('PDOException was thrown when trying to read the session data: %s', $e->getMessage()), 0, $e);
}
}
public function close()
{
$this->active = false;
return (bool) $this->handler->close();
}
public function read($id)
{
return (string) $this->handler->read($id);
}
public function write($id, $data)
}
if (version_compare(phpversion(), '5.4.0', '<') && isset($_SESSION) && session_id()) {
throw new \RuntimeException('Failed to start the session: already started by PHP ($_SESSION is set).');
}
if (ini_get('session.use_cookies') && headers_sent($file, $line)) {
throw new \RuntimeException(sprintf('Failed to start the session because headers have already been sent by "%s" at line %d.', $file, $line));
}
if (!session_start()) {
throw new \RuntimeException('Failed to start the session');
}
$this->registerBag($attributes);
$flashes = $flashes ?: new FlashBag();
$this->flashName = $flashes->getName();
$this->registerBag($flashes);
}
public function start()
{
return $this->storage->start();
}
public function has($name)
namespace Illuminate\Session;
use Symfony\Component\HttpFoundation\Session\Session as SymfonySession;
class Store extends SymfonySession
{
public function start()
{
parent::start();
if (!$this->has('_token')) {
$this->put('_token', str_random(40));
$this->registerBootingEvent();
$this->registerCloseEvent();
}
}
protected function registerBootingEvent()
{
$this->app->booting(function ($app) {
$app['session']->start();
});
}
public function booted($callback)
{
$this->bootedCallbacks[] = $callback;
}
protected function fireAppCallbacks(array $callbacks)
{
foreach ($callbacks as $callback) {
call_user_func($callback, $this);
}
}
{
if ($this->booted) {
return;
}
foreach ($this->serviceProviders as $provider) {
$provider->boot();
}
$this->fireAppCallbacks($this->bootingCallbacks);
$this->booted = true;
$this->fireAppCallbacks($this->bootedCallbacks);
|
| Before we handle the requests we need to make sure the application has
| been booted up. The boot process will call the "boot" method on all
| service provider giving all a chance to register their overrides.
|
*/
$app->boot();
/*
| separate location so we can isolate the creation of an application
| from the actual running of the application with a given request.
|
*/
$framework = $app['path.base'].'/vendor/laravel/framework/src';
require $framework.'/Illuminate/Foundation/start.php';
/*
| We need to illuminate PHP development, so let's turn on the lights.
| This bootstraps the framework and gets it ready for use, then it
| will load up this application so that we can run it and send
| the responses back to the browser and delight these users.
|
*/
$app = require_once __DIR__.'/../bootstrap/start.php';
/*