composer update
This commit is contained in:
85
vendor/symfony/http-kernel/Kernel.php
vendored
85
vendor/symfony/http-kernel/Kernel.php
vendored
@@ -16,6 +16,7 @@ use Symfony\Bridge\ProxyManager\LazyProxy\PhpDumper\ProxyDumper;
|
||||
use Symfony\Component\Config\ConfigCache;
|
||||
use Symfony\Component\Config\Loader\DelegatingLoader;
|
||||
use Symfony\Component\Config\Loader\LoaderResolver;
|
||||
use Symfony\Component\Debug\DebugClassLoader;
|
||||
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
|
||||
use Symfony\Component\DependencyInjection\Compiler\PassConfig;
|
||||
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
||||
@@ -41,6 +42,9 @@ use Symfony\Component\HttpKernel\DependencyInjection\MergeExtensionConfiguration
|
||||
*
|
||||
* It manages an environment made of bundles.
|
||||
*
|
||||
* Environment names must always start with a letter and
|
||||
* they must only contain letters and numbers.
|
||||
*
|
||||
* @author Fabien Potencier <fabien@symfony.com>
|
||||
*/
|
||||
abstract class Kernel implements KernelInterface, RebootableInterface, TerminableInterface
|
||||
@@ -51,10 +55,16 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl
|
||||
protected $bundles = array();
|
||||
|
||||
protected $container;
|
||||
/**
|
||||
* @deprecated since Symfony 4.2
|
||||
*/
|
||||
protected $rootDir;
|
||||
protected $environment;
|
||||
protected $debug;
|
||||
protected $booted = false;
|
||||
/**
|
||||
* @deprecated since Symfony 4.2
|
||||
*/
|
||||
protected $name;
|
||||
protected $startTime;
|
||||
|
||||
@@ -63,22 +73,22 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl
|
||||
private $requestStackSize = 0;
|
||||
private $resetServices = false;
|
||||
|
||||
const VERSION = '4.1.4';
|
||||
const VERSION_ID = 40104;
|
||||
const VERSION = '4.2.0';
|
||||
const VERSION_ID = 40200;
|
||||
const MAJOR_VERSION = 4;
|
||||
const MINOR_VERSION = 1;
|
||||
const RELEASE_VERSION = 4;
|
||||
const MINOR_VERSION = 2;
|
||||
const RELEASE_VERSION = 0;
|
||||
const EXTRA_VERSION = '';
|
||||
|
||||
const END_OF_MAINTENANCE = '01/2019';
|
||||
const END_OF_LIFE = '07/2019';
|
||||
const END_OF_MAINTENANCE = '07/2019';
|
||||
const END_OF_LIFE = '01/2020';
|
||||
|
||||
public function __construct(string $environment, bool $debug)
|
||||
{
|
||||
$this->environment = $environment;
|
||||
$this->debug = $debug;
|
||||
$this->rootDir = $this->getRootDir();
|
||||
$this->name = $this->getName();
|
||||
$this->rootDir = $this->getRootDir(false);
|
||||
$this->name = $this->getName(false);
|
||||
}
|
||||
|
||||
public function __clone()
|
||||
@@ -90,7 +100,7 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl
|
||||
}
|
||||
|
||||
/**
|
||||
* Boots the current kernel.
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function boot()
|
||||
{
|
||||
@@ -215,7 +225,10 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl
|
||||
public function getBundle($name)
|
||||
{
|
||||
if (!isset($this->bundles[$name])) {
|
||||
throw new \InvalidArgumentException(sprintf('Bundle "%s" does not exist or it is not enabled. Maybe you forgot to add it in the registerBundles() method of your %s.php file?', $name, \get_class($this)));
|
||||
$class = \get_class($this);
|
||||
$class = 'c' === $class[0] && 0 === strpos($class, "class@anonymous\0") ? get_parent_class($class).'@anonymous' : $class;
|
||||
|
||||
throw new \InvalidArgumentException(sprintf('Bundle "%s" does not exist or it is not enabled. Maybe you forgot to add it in the registerBundles() method of your %s.php file?', $name, $class));
|
||||
}
|
||||
|
||||
return $this->bundles[$name];
|
||||
@@ -244,19 +257,10 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl
|
||||
|
||||
$isResource = 0 === strpos($path, 'Resources') && null !== $dir;
|
||||
$overridePath = substr($path, 9);
|
||||
$resourceBundle = null;
|
||||
$bundle = $this->getBundle($bundleName);
|
||||
$files = array();
|
||||
|
||||
if ($isResource && file_exists($file = $dir.'/'.$bundle->getName().$overridePath)) {
|
||||
if (null !== $resourceBundle) {
|
||||
throw new \RuntimeException(sprintf('"%s" resource is hidden by a resource from the "%s" derived bundle. Create a "%s" file to override the bundle resource.',
|
||||
$file,
|
||||
$resourceBundle,
|
||||
$dir.'/'.$bundle->getName().$overridePath
|
||||
));
|
||||
}
|
||||
|
||||
$files[] = $file;
|
||||
}
|
||||
|
||||
@@ -265,7 +269,6 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl
|
||||
return $file;
|
||||
}
|
||||
$files[] = $file;
|
||||
$resourceBundle = $bundle->getName();
|
||||
}
|
||||
|
||||
if (\count($files) > 0) {
|
||||
@@ -277,9 +280,15 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @deprecated since Symfony 4.2
|
||||
*/
|
||||
public function getName()
|
||||
public function getName(/* $triggerDeprecation = true */)
|
||||
{
|
||||
if (0 === \func_num_args() || func_get_arg(0)) {
|
||||
@trigger_error(sprintf('The "%s()" method is deprecated since Symfony 4.2.', __METHOD__), E_USER_DEPRECATED);
|
||||
}
|
||||
|
||||
if (null === $this->name) {
|
||||
$this->name = preg_replace('/[^a-zA-Z0-9_]+/', '', basename($this->rootDir));
|
||||
if (ctype_digit($this->name[0])) {
|
||||
@@ -308,9 +317,15 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @deprecated since Symfony 4.2, use getProjectDir() instead
|
||||
*/
|
||||
public function getRootDir()
|
||||
public function getRootDir(/* $triggerDeprecation = true */)
|
||||
{
|
||||
if (0 === \func_num_args() || func_get_arg(0)) {
|
||||
@trigger_error(sprintf('The "%s()" method is deprecated since Symfony 4.2, use getProjectDir() instead.', __METHOD__), E_USER_DEPRECATED);
|
||||
}
|
||||
|
||||
if (null === $this->rootDir) {
|
||||
$r = new \ReflectionObject($this);
|
||||
$this->rootDir = \dirname($r->getFileName());
|
||||
@@ -370,7 +385,7 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl
|
||||
*/
|
||||
public function getCacheDir()
|
||||
{
|
||||
return $this->rootDir.'/cache/'.$this->environment;
|
||||
return $this->getProjectDir().'/var/cache/'.$this->environment;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -378,7 +393,7 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl
|
||||
*/
|
||||
public function getLogDir()
|
||||
{
|
||||
return $this->rootDir.'/logs';
|
||||
return $this->getProjectDir().'/var/log';
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -431,7 +446,10 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl
|
||||
*/
|
||||
protected function getContainerClass()
|
||||
{
|
||||
return $this->name.ucfirst($this->environment).($this->debug ? 'Debug' : '').'ProjectContainer';
|
||||
$class = \get_class($this);
|
||||
$class = 'c' === $class[0] && 0 === strpos($class, "class@anonymous\0") ? get_parent_class($class).ContainerBuilder::hash($class) : $class;
|
||||
|
||||
return $this->name.str_replace('\\', '_', $class).ucfirst($this->environment).($this->debug ? 'Debug' : '').'Container';
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -493,7 +511,7 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl
|
||||
return;
|
||||
}
|
||||
|
||||
$backtrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 3);
|
||||
$backtrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 5);
|
||||
// Clean the trace by removing first frames added by the error handler itself.
|
||||
for ($i = 0; isset($backtrace[$i]); ++$i) {
|
||||
if (isset($backtrace[$i]['file'], $backtrace[$i]['line']) && $backtrace[$i]['line'] === $line && $backtrace[$i]['file'] === $file) {
|
||||
@@ -501,13 +519,20 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl
|
||||
break;
|
||||
}
|
||||
}
|
||||
// Remove frames added by DebugClassLoader.
|
||||
for ($i = \count($backtrace) - 2; 0 < $i; --$i) {
|
||||
if (DebugClassLoader::class === ($backtrace[$i]['class'] ?? null)) {
|
||||
$backtrace = array($backtrace[$i + 1]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
$collectedLogs[$message] = array(
|
||||
'type' => $type,
|
||||
'message' => $message,
|
||||
'file' => $file,
|
||||
'line' => $line,
|
||||
'trace' => $backtrace,
|
||||
'trace' => array($backtrace[0]),
|
||||
'count' => 1,
|
||||
);
|
||||
});
|
||||
@@ -582,10 +607,16 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl
|
||||
}
|
||||
|
||||
return array(
|
||||
/*
|
||||
* @deprecated since Symfony 4.2, use kernel.project_dir instead
|
||||
*/
|
||||
'kernel.root_dir' => realpath($this->rootDir) ?: $this->rootDir,
|
||||
'kernel.project_dir' => realpath($this->getProjectDir()) ?: $this->getProjectDir(),
|
||||
'kernel.environment' => $this->environment,
|
||||
'kernel.debug' => $this->debug,
|
||||
/*
|
||||
* @deprecated since Symfony 4.2
|
||||
*/
|
||||
'kernel.name' => $this->name,
|
||||
'kernel.cache_dir' => realpath($cacheDir = $this->warmupDir ?: $this->getCacheDir()) ?: $cacheDir,
|
||||
'kernel.logs_dir' => realpath($this->getLogDir()) ?: $this->getLogDir(),
|
||||
|
Reference in New Issue
Block a user