mirror of
https://gitlab.com/TheGamecraft/c-cms.git
synced 2026-04-22 19:19:09 -04:00
ALPHA 3.0.2a
This commit is contained in:
60
vendor/symfony/http-kernel/Kernel.php
vendored
60
vendor/symfony/http-kernel/Kernel.php
vendored
@@ -13,28 +13,28 @@ namespace Symfony\Component\HttpKernel;
|
||||
|
||||
use Symfony\Bridge\ProxyManager\LazyProxy\Instantiator\RuntimeInstantiator;
|
||||
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\DependencyInjection\Compiler\CompilerPassInterface;
|
||||
use Symfony\Component\DependencyInjection\Compiler\PassConfig;
|
||||
use Symfony\Component\DependencyInjection\ContainerInterface;
|
||||
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
||||
use Symfony\Component\DependencyInjection\ContainerInterface;
|
||||
use Symfony\Component\DependencyInjection\Dumper\PhpDumper;
|
||||
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
|
||||
use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
|
||||
use Symfony\Component\DependencyInjection\Loader\ClosureLoader;
|
||||
use Symfony\Component\DependencyInjection\Loader\DirectoryLoader;
|
||||
use Symfony\Component\DependencyInjection\Loader\GlobFileLoader;
|
||||
use Symfony\Component\DependencyInjection\Loader\IniFileLoader;
|
||||
use Symfony\Component\DependencyInjection\Loader\PhpFileLoader;
|
||||
use Symfony\Component\DependencyInjection\Loader\GlobFileLoader;
|
||||
use Symfony\Component\DependencyInjection\Loader\DirectoryLoader;
|
||||
use Symfony\Component\DependencyInjection\Loader\ClosureLoader;
|
||||
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
|
||||
use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
|
||||
use Symfony\Component\Filesystem\Filesystem;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\HttpKernel\Bundle\BundleInterface;
|
||||
use Symfony\Component\HttpKernel\Config\FileLocator;
|
||||
use Symfony\Component\HttpKernel\DependencyInjection\MergeExtensionConfigurationPass;
|
||||
use Symfony\Component\HttpKernel\DependencyInjection\AddAnnotatedClassesToCachePass;
|
||||
use Symfony\Component\Config\Loader\LoaderResolver;
|
||||
use Symfony\Component\Config\Loader\DelegatingLoader;
|
||||
use Symfony\Component\Config\ConfigCache;
|
||||
use Symfony\Component\HttpKernel\DependencyInjection\MergeExtensionConfigurationPass;
|
||||
|
||||
/**
|
||||
* The Kernel is the heart of the Symfony system.
|
||||
@@ -63,11 +63,11 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl
|
||||
private $requestStackSize = 0;
|
||||
private $resetServices = false;
|
||||
|
||||
const VERSION = '4.1.1';
|
||||
const VERSION_ID = 40101;
|
||||
const VERSION = '4.1.4';
|
||||
const VERSION_ID = 40104;
|
||||
const MAJOR_VERSION = 4;
|
||||
const MINOR_VERSION = 1;
|
||||
const RELEASE_VERSION = 1;
|
||||
const RELEASE_VERSION = 4;
|
||||
const EXTRA_VERSION = '';
|
||||
|
||||
const END_OF_MAINTENANCE = '01/2019';
|
||||
@@ -215,7 +215,7 @@ 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)));
|
||||
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)));
|
||||
}
|
||||
|
||||
return $this->bundles[$name];
|
||||
@@ -268,7 +268,7 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl
|
||||
$resourceBundle = $bundle->getName();
|
||||
}
|
||||
|
||||
if (count($files) > 0) {
|
||||
if (\count($files) > 0) {
|
||||
return $first && $isResource ? $files[0] : $files;
|
||||
}
|
||||
|
||||
@@ -313,7 +313,7 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl
|
||||
{
|
||||
if (null === $this->rootDir) {
|
||||
$r = new \ReflectionObject($this);
|
||||
$this->rootDir = dirname($r->getFileName());
|
||||
$this->rootDir = \dirname($r->getFileName());
|
||||
}
|
||||
|
||||
return $this->rootDir;
|
||||
@@ -328,12 +328,12 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl
|
||||
{
|
||||
if (null === $this->projectDir) {
|
||||
$r = new \ReflectionObject($this);
|
||||
$dir = $rootDir = dirname($r->getFileName());
|
||||
$dir = $rootDir = \dirname($r->getFileName());
|
||||
while (!file_exists($dir.'/composer.json')) {
|
||||
if ($dir === dirname($dir)) {
|
||||
if ($dir === \dirname($dir)) {
|
||||
return $this->projectDir = $rootDir;
|
||||
}
|
||||
$dir = dirname($dir);
|
||||
$dir = \dirname($dir);
|
||||
}
|
||||
$this->projectDir = $dir;
|
||||
}
|
||||
@@ -481,7 +481,7 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl
|
||||
|
||||
if ($this->debug) {
|
||||
$collectedLogs = array();
|
||||
$previousHandler = defined('PHPUNIT_COMPOSER_INSTALL');
|
||||
$previousHandler = \defined('PHPUNIT_COMPOSER_INSTALL');
|
||||
$previousHandler = $previousHandler ?: set_error_handler(function ($type, $message, $file, $line) use (&$collectedLogs, &$previousHandler) {
|
||||
if (E_USER_DEPRECATED !== $type && E_DEPRECATED !== $type) {
|
||||
return $previousHandler ? $previousHandler($type, $message, $file, $line) : false;
|
||||
@@ -497,7 +497,7 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl
|
||||
// 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) {
|
||||
$backtrace = array_slice($backtrace, 1 + $i);
|
||||
$backtrace = \array_slice($backtrace, 1 + $i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -536,20 +536,20 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl
|
||||
error_reporting($errorLevel);
|
||||
}
|
||||
}
|
||||
$oldContainer = is_object($oldContainer) ? new \ReflectionClass($oldContainer) : false;
|
||||
$oldContainer = \is_object($oldContainer) ? new \ReflectionClass($oldContainer) : false;
|
||||
|
||||
$this->dumpContainer($cache, $container, $class, $this->getContainerBaseClass());
|
||||
$this->container = require $cache->getPath();
|
||||
$this->container->set('kernel', $this);
|
||||
|
||||
if ($oldContainer && get_class($this->container) !== $oldContainer->name) {
|
||||
if ($oldContainer && \get_class($this->container) !== $oldContainer->name) {
|
||||
// Because concurrent requests might still be using them,
|
||||
// old container files are not removed immediately,
|
||||
// but on a next dump of the container.
|
||||
static $legacyContainers = array();
|
||||
$oldContainerDir = dirname($oldContainer->getFileName());
|
||||
$oldContainerDir = \dirname($oldContainer->getFileName());
|
||||
$legacyContainers[$oldContainerDir.'.legacy'] = true;
|
||||
foreach (glob(dirname($oldContainerDir).DIRECTORY_SEPARATOR.'*.legacy') as $legacyContainer) {
|
||||
foreach (glob(\dirname($oldContainerDir).\DIRECTORY_SEPARATOR.'*.legacy') as $legacyContainer) {
|
||||
if (!isset($legacyContainers[$legacyContainer]) && @unlink($legacyContainer)) {
|
||||
(new Filesystem())->remove(substr($legacyContainer, 0, -7));
|
||||
}
|
||||
@@ -574,7 +574,7 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl
|
||||
$bundlesMetadata = array();
|
||||
|
||||
foreach ($this->bundles as $name => $bundle) {
|
||||
$bundles[$name] = get_class($bundle);
|
||||
$bundles[$name] = \get_class($bundle);
|
||||
$bundlesMetadata[$name] = array(
|
||||
'path' => $bundle->getPath(),
|
||||
'namespace' => $bundle->getNamespace(),
|
||||
@@ -705,14 +705,14 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl
|
||||
));
|
||||
|
||||
$rootCode = array_pop($content);
|
||||
$dir = dirname($cache->getPath()).'/';
|
||||
$dir = \dirname($cache->getPath()).'/';
|
||||
$fs = new Filesystem();
|
||||
|
||||
foreach ($content as $file => $code) {
|
||||
$fs->dumpFile($dir.$file, $code);
|
||||
@chmod($dir.$file, 0666 & ~umask());
|
||||
}
|
||||
@unlink(dirname($dir.$file).'.legacy');
|
||||
@unlink(\dirname($dir.$file).'.legacy');
|
||||
|
||||
$cache->write($rootCode, $container->getResources());
|
||||
}
|
||||
@@ -750,7 +750,7 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl
|
||||
*/
|
||||
public static function stripComments($source)
|
||||
{
|
||||
if (!function_exists('token_get_all')) {
|
||||
if (!\function_exists('token_get_all')) {
|
||||
return $source;
|
||||
}
|
||||
|
||||
@@ -778,7 +778,7 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl
|
||||
|
||||
// replace multiple new lines with a single newline
|
||||
$rawChunk .= preg_replace(array('/\n{2,}/S'), "\n", $token[1]);
|
||||
} elseif (in_array($token[0], array(T_COMMENT, T_DOC_COMMENT))) {
|
||||
} elseif (\in_array($token[0], array(T_COMMENT, T_DOC_COMMENT))) {
|
||||
$ignoreSpace = true;
|
||||
} else {
|
||||
$rawChunk .= $token[1];
|
||||
|
||||
Reference in New Issue
Block a user