update to laravel 5.7 and try getting autologin saved

This commit is contained in:
Kode
2018-10-14 20:50:32 +01:00
parent c3da17befc
commit 6501aacb1b
2402 changed files with 79064 additions and 28971 deletions

View File

@@ -30,11 +30,9 @@ class FileProfilerStorage implements ProfilerStorageInterface
*
* Example : "file:/path/to/the/storage/folder"
*
* @param string $dsn The DSN
*
* @throws \RuntimeException
*/
public function __construct($dsn)
public function __construct(string $dsn)
{
if (0 !== strpos($dsn, 'file:')) {
throw new \RuntimeException(sprintf('Please check your configuration. You are trying to use FileStorage with an invalid dsn "%s". The expected format is "file:/path/to/the/storage/folder".', $dsn));
@@ -61,7 +59,7 @@ class FileProfilerStorage implements ProfilerStorageInterface
fseek($file, 0, SEEK_END);
$result = array();
while (count($result) < $limit && $line = $this->readLineFromFile($file)) {
while (\count($result) < $limit && $line = $this->readLineFromFile($file)) {
$values = str_getcsv($line);
list($csvToken, $csvIp, $csvMethod, $csvUrl, $csvTime, $csvParent, $csvStatusCode) = $values;
$csvTime = (int) $csvTime;
@@ -136,7 +134,7 @@ class FileProfilerStorage implements ProfilerStorageInterface
$profileIndexed = is_file($file);
if (!$profileIndexed) {
// Create directory
$dir = dirname($file);
$dir = \dirname($file);
if (!is_dir($dir) && false === @mkdir($dir, 0777, true) && !is_dir($dir)) {
throw new \RuntimeException(sprintf('Unable to create the storage directory (%s).', $dir));
}
@@ -146,7 +144,7 @@ class FileProfilerStorage implements ProfilerStorageInterface
// when there are errors in sub-requests, the parent and/or children tokens
// may equal the profile token, resulting in infinite loops
$parentToken = $profile->getParentToken() !== $profileToken ? $profile->getParentToken() : null;
$childrenToken = array_filter(array_map(function ($p) use ($profileToken) {
$childrenToken = array_filter(array_map(function (Profile $p) use ($profileToken) {
return $profileToken !== $p->getToken() ? $p->getToken() : null;
}, $profile->getChildren()));

View File

@@ -43,10 +43,7 @@ class Profile
*/
private $children = array();
/**
* @param string $token The token
*/
public function __construct($token)
public function __construct(string $token)
{
$this->token = $token;
}
@@ -74,7 +71,7 @@ class Profile
/**
* Sets the parent token.
*/
public function setParent(Profile $parent)
public function setParent(self $parent)
{
$this->parent = $parent;
}
@@ -92,7 +89,7 @@ class Profile
/**
* Returns the parent token.
*
* @return null|string The parent token
* @return string|null The parent token
*/
public function getParentToken()
{
@@ -213,12 +210,23 @@ class Profile
/**
* Adds the child token.
*/
public function addChild(Profile $child)
public function addChild(self $child)
{
$this->children[] = $child;
$child->setParent($this);
}
public function getChildByToken(string $token): ?self
{
foreach ($this->children as $child) {
if ($token === $child->getToken()) {
return $child;
}
}
return null;
}
/**
* Gets a Collector by name.
*

View File

@@ -11,12 +11,12 @@
namespace Symfony\Component\HttpKernel\Profiler;
use Psr\Log\LoggerInterface;
use Symfony\Component\HttpFoundation\Exception\ConflictingHeadersException;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\DataCollector\DataCollectorInterface;
use Symfony\Component\HttpKernel\DataCollector\LateDataCollectorInterface;
use Psr\Log\LoggerInterface;
/**
* Profiler.
@@ -36,14 +36,11 @@ class Profiler
private $initiallyEnabled = true;
private $enabled = true;
/**
* @param bool $enable The initial enabled state
*/
public function __construct(ProfilerStorageInterface $storage, LoggerInterface $logger = null, $enable = true)
public function __construct(ProfilerStorageInterface $storage, LoggerInterface $logger = null, bool $enable = true)
{
$this->storage = $storage;
$this->logger = $logger;
$this->initiallyEnabled = $this->enabled = (bool) $enable;
$this->initiallyEnabled = $this->enabled = $enable;
}
/**
@@ -103,7 +100,7 @@ class Profiler
}
if (!($ret = $this->storage->write($profile)) && null !== $this->logger) {
$this->logger->warning('Unable to store the profiler information.', array('configured_storage' => get_class($this->storage)));
$this->logger->warning('Unable to store the profiler information.', array('configured_storage' => \get_class($this->storage)));
}
return $ret;
@@ -159,6 +156,10 @@ class Profiler
$profile->setIp('Unknown');
}
if ($prevToken = $response->headers->get('X-Debug-Token')) {
$response->headers->set('X-Previous-Debug-Token', $prevToken);
}
$response->headers->set('X-Debug-Token', $profile->getToken());
foreach ($this->collectors as $collector) {
@@ -174,10 +175,6 @@ class Profiler
public function reset()
{
foreach ($this->collectors as $collector) {
if (!method_exists($collector, 'reset')) {
continue;
}
$collector->reset();
}
$this->enabled = $this->initiallyEnabled;
@@ -211,10 +208,6 @@ class Profiler
*/
public function add(DataCollectorInterface $collector)
{
if (!method_exists($collector, 'reset')) {
@trigger_error(sprintf('Implementing "%s" without the "reset()" method is deprecated since Symfony 3.4 and will be unsupported in 4.0 for class "%s".', DataCollectorInterface::class, \get_class($collector)), E_USER_DEPRECATED);
}
$this->collectors[$collector->getName()] = $collector;
}