update v1.0.7.9 R.C.
This is a Release Candidate. We are still testing.
This commit is contained in:
58
vendor/barryvdh/laravel-debugbar/src/DataCollector/SessionCollector.php
vendored
Normal file
58
vendor/barryvdh/laravel-debugbar/src/DataCollector/SessionCollector.php
vendored
Normal file
@@ -0,0 +1,58 @@
|
||||
<?php
|
||||
|
||||
namespace Barryvdh\Debugbar\DataCollector;
|
||||
|
||||
use DebugBar\DataCollector\DataCollector;
|
||||
use DebugBar\DataCollector\DataCollectorInterface;
|
||||
use DebugBar\DataCollector\Renderable;
|
||||
|
||||
class SessionCollector extends DataCollector implements DataCollectorInterface, Renderable
|
||||
{
|
||||
/** @var \Symfony\Component\HttpFoundation\Session\SessionInterface $session */
|
||||
protected $session;
|
||||
|
||||
/**
|
||||
* Create a new SessionCollector
|
||||
*
|
||||
* @param \Symfony\Component\HttpFoundation\Session\SessionInterface $session
|
||||
*/
|
||||
public function __construct($session)
|
||||
{
|
||||
$this->session = $session;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function collect()
|
||||
{
|
||||
$data = array();
|
||||
foreach ($this->session->all() as $key => $value) {
|
||||
$data[$key] = is_string($value) ? $value : $this->formatVar($value);
|
||||
}
|
||||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function getName()
|
||||
{
|
||||
return 'session';
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function getWidgets()
|
||||
{
|
||||
return array(
|
||||
"session" => array(
|
||||
"icon" => "archive",
|
||||
"widget" => "PhpDebugBar.Widgets.VariableListWidget",
|
||||
"map" => "session",
|
||||
"default" => "{}"
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user