mirror of
https://github.com/Sylius/Sylius.git
synced 2026-07-14 09:02:12 +00:00
Remove broken methods from Sylius < 1.3 old Kernel class (#13524)
This commit is contained in:
parent
d530080774
commit
f43c86cc5c
2 changed files with 3 additions and 147 deletions
|
|
@ -3,14 +3,6 @@
|
|||
"null", "true", "false",
|
||||
"static", "self", "parent",
|
||||
"array", "string", "int", "float", "bool", "iterable", "callable", "void", "object", "mixed", "never",
|
||||
"Symfony\\Bundle\\DebugBundle\\DebugBundle",
|
||||
"Symfony\\Bundle\\WebProfilerBundle\\WebProfilerBundle",
|
||||
"Symfony\\Bundle\\WebServerBundle\\WebServerBundle",
|
||||
"Doctrine\\Bundle\\DoctrineCacheBundle\\DoctrineCacheBundle",
|
||||
"Doctrine\\Bundle\\FixturesBundle\\DoctrineFixturesBundle",
|
||||
"Sonata\\CoreBundle\\SonataCoreBundle",
|
||||
"Sonata\\IntlBundle\\SonataIntlBundle",
|
||||
"PSS\\SymfonyMockerContainer\\DependencyInjection\\MockerContainer",
|
||||
"Swift_Message",
|
||||
"Behat\\Behat\\Tester\\ScenarioTester",
|
||||
"Behat\\Behat\\Tester\\ServiceContainer\\TesterExtension",
|
||||
|
|
|
|||
|
|
@ -13,24 +13,13 @@ declare(strict_types=1);
|
|||
|
||||
namespace Sylius\Bundle\CoreBundle\Application;
|
||||
|
||||
use PSS\SymfonyMockerContainer\DependencyInjection\MockerContainer;
|
||||
use Symfony\Component\Config\Loader\DelegatingLoader;
|
||||
use Symfony\Component\Config\Loader\LoaderInterface;
|
||||
use Symfony\Component\Config\Loader\LoaderResolver;
|
||||
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
||||
use Symfony\Component\DependencyInjection\ContainerInterface;
|
||||
use Symfony\Component\DependencyInjection\Loader\ClosureLoader;
|
||||
use Symfony\Component\DependencyInjection\Loader\DirectoryLoader;
|
||||
use Symfony\Component\DependencyInjection\Loader\IniFileLoader;
|
||||
use Symfony\Component\DependencyInjection\Loader\PhpFileLoader;
|
||||
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
|
||||
use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
|
||||
use Symfony\Component\HttpKernel\Config\FileLocator;
|
||||
use Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait;
|
||||
use Symfony\Component\HttpKernel\Kernel as HttpKernel;
|
||||
use Webmozart\Assert\Assert;
|
||||
|
||||
class Kernel extends HttpKernel
|
||||
{
|
||||
use MicroKernelTrait;
|
||||
|
||||
public const VERSION = '1.12.0-DEV';
|
||||
|
||||
public const VERSION_ID = '11200';
|
||||
|
|
@ -49,129 +38,4 @@ class Kernel extends HttpKernel
|
|||
|
||||
parent::__construct($environment, $debug);
|
||||
}
|
||||
|
||||
public function registerBundles(): array
|
||||
{
|
||||
$bundles = [
|
||||
new \Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
|
||||
new \Symfony\Bundle\MonologBundle\MonologBundle(),
|
||||
new \Symfony\Bundle\SecurityBundle\SecurityBundle(),
|
||||
new \Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(),
|
||||
new \Symfony\Bundle\TwigBundle\TwigBundle(),
|
||||
new \Doctrine\Bundle\DoctrineBundle\DoctrineBundle(),
|
||||
new \Doctrine\Bundle\DoctrineCacheBundle\DoctrineCacheBundle(),
|
||||
|
||||
new \Sylius\Bundle\OrderBundle\SyliusOrderBundle(),
|
||||
new \Sylius\Bundle\MoneyBundle\SyliusMoneyBundle(),
|
||||
new \Sylius\Bundle\CurrencyBundle\SyliusCurrencyBundle(),
|
||||
new \Sylius\Bundle\LocaleBundle\SyliusLocaleBundle(),
|
||||
new \Sylius\Bundle\ProductBundle\SyliusProductBundle(),
|
||||
new \Sylius\Bundle\ChannelBundle\SyliusChannelBundle(),
|
||||
new \Sylius\Bundle\AttributeBundle\SyliusAttributeBundle(),
|
||||
new \Sylius\Bundle\TaxationBundle\SyliusTaxationBundle(),
|
||||
new \Sylius\Bundle\ShippingBundle\SyliusShippingBundle(),
|
||||
new \Sylius\Bundle\PaymentBundle\SyliusPaymentBundle(),
|
||||
new \Sylius\Bundle\MailerBundle\SyliusMailerBundle(),
|
||||
new \Sylius\Bundle\PromotionBundle\SyliusPromotionBundle(),
|
||||
new \Sylius\Bundle\AddressingBundle\SyliusAddressingBundle(),
|
||||
new \Sylius\Bundle\InventoryBundle\SyliusInventoryBundle(),
|
||||
new \Sylius\Bundle\TaxonomyBundle\SyliusTaxonomyBundle(),
|
||||
new \Sylius\Bundle\UserBundle\SyliusUserBundle(),
|
||||
new \Sylius\Bundle\CustomerBundle\SyliusCustomerBundle(),
|
||||
new \Sylius\Bundle\UiBundle\SyliusUiBundle(),
|
||||
new \Sylius\Bundle\ReviewBundle\SyliusReviewBundle(),
|
||||
new \Sylius\Bundle\CoreBundle\SyliusCoreBundle(),
|
||||
new \Sylius\Bundle\ResourceBundle\SyliusResourceBundle(),
|
||||
new \Sylius\Bundle\GridBundle\SyliusGridBundle(),
|
||||
new \winzou\Bundle\StateMachineBundle\winzouStateMachineBundle(),
|
||||
|
||||
new \Sonata\CoreBundle\SonataCoreBundle(),
|
||||
new \Sonata\BlockBundle\SonataBlockBundle(),
|
||||
new \Sonata\IntlBundle\SonataIntlBundle(),
|
||||
new \Bazinga\Bundle\HateoasBundle\BazingaHateoasBundle(),
|
||||
new \JMS\SerializerBundle\JMSSerializerBundle(),
|
||||
new \FOS\RestBundle\FOSRestBundle(),
|
||||
|
||||
new \Knp\Bundle\GaufretteBundle\KnpGaufretteBundle(),
|
||||
new \Knp\Bundle\MenuBundle\KnpMenuBundle(),
|
||||
new \Liip\ImagineBundle\LiipImagineBundle(),
|
||||
new \Payum\Bundle\PayumBundle\PayumBundle(),
|
||||
new \Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle(),
|
||||
new \BabDev\PagerfantaBundle\BabDevPagerfantaBundle(),
|
||||
|
||||
new \Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle(),
|
||||
new \Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle(),
|
||||
new \Sylius\Bundle\FixturesBundle\SyliusFixturesBundle(),
|
||||
new \Sylius\Bundle\PayumBundle\SyliusPayumBundle(), // must be added after PayumBundle.
|
||||
new \Sylius\Bundle\ThemeBundle\SyliusThemeBundle(), // must be added after FrameworkBundle
|
||||
];
|
||||
|
||||
if (in_array($this->getEnvironment(), ['dev', 'test', 'test_cached'], true)) {
|
||||
$bundles[] = new \Symfony\Bundle\DebugBundle\DebugBundle();
|
||||
$bundles[] = new \Symfony\Bundle\WebProfilerBundle\WebProfilerBundle();
|
||||
$bundles[] = new \Symfony\Bundle\WebServerBundle\WebServerBundle();
|
||||
}
|
||||
|
||||
return $bundles;
|
||||
}
|
||||
|
||||
protected function getContainerBaseClass(): string
|
||||
{
|
||||
if (in_array($this->getEnvironment(), ['test', 'test_cached'], true)) {
|
||||
return MockerContainer::class;
|
||||
}
|
||||
|
||||
return parent::getContainerBaseClass();
|
||||
}
|
||||
|
||||
protected function getContainerLoader(ContainerInterface $container): LoaderInterface
|
||||
{
|
||||
/** @var ContainerBuilder $container */
|
||||
Assert::isInstanceOf($container, ContainerBuilder::class);
|
||||
|
||||
$locator = new FileLocator($this, $this->getRootDir() . '/Resources');
|
||||
$resolver = new LoaderResolver([
|
||||
new XmlFileLoader($container, $locator),
|
||||
new YamlFileLoader($container, $locator),
|
||||
new IniFileLoader($container, $locator),
|
||||
new PhpFileLoader($container, $locator),
|
||||
new DirectoryLoader($container, $locator),
|
||||
new ClosureLoader($container),
|
||||
]);
|
||||
|
||||
return new DelegatingLoader($resolver);
|
||||
}
|
||||
|
||||
public function registerContainerConfiguration(LoaderInterface $loader): void
|
||||
{
|
||||
$loader->load($this->getRootDir() . '/config/config_' . $this->getEnvironment() . '.yml');
|
||||
|
||||
$file = $this->getRootDir() . '/config/config_' . $this->getEnvironment() . '.local.yml';
|
||||
if (is_file($file)) {
|
||||
$loader->load($file);
|
||||
}
|
||||
}
|
||||
|
||||
public function getCacheDir(): string
|
||||
{
|
||||
if ($this->isVagrantEnvironment()) {
|
||||
return '/dev/shm/sylius/cache/' . $this->getEnvironment();
|
||||
}
|
||||
|
||||
return dirname($this->getRootDir()) . '/var/cache/' . $this->getEnvironment();
|
||||
}
|
||||
|
||||
public function getLogDir(): string
|
||||
{
|
||||
if ($this->isVagrantEnvironment()) {
|
||||
return '/dev/shm/sylius/logs';
|
||||
}
|
||||
|
||||
return dirname($this->getRootDir()) . '/var/logs';
|
||||
}
|
||||
|
||||
protected function isVagrantEnvironment(): bool
|
||||
{
|
||||
return (getenv('HOME') === '/home/vagrant' || getenv('VAGRANT') === 'VAGRANT') && is_dir('/dev/shm');
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue