| 1 |  |  | <?php | 
            
                                                                                                            
                            
            
                                    
            
            
                | 2 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 3 |  |  | /* | 
            
                                                                                                            
                            
            
                                    
            
            
                | 4 |  |  |  * This file is part of the Sylius package. | 
            
                                                                                                            
                            
            
                                    
            
            
                | 5 |  |  |  * | 
            
                                                                                                            
                            
            
                                    
            
            
                | 6 |  |  |  * (c) Paweł Jędrzejewski | 
            
                                                                                                            
                            
            
                                    
            
            
                | 7 |  |  |  * | 
            
                                                                                                            
                            
            
                                    
            
            
                | 8 |  |  |  * For the full copyright and license information, please view the LICENSE | 
            
                                                                                                            
                            
            
                                    
            
            
                | 9 |  |  |  * file that was distributed with this source code. | 
            
                                                                                                            
                            
            
                                    
            
            
                | 10 |  |  |  */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 11 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 12 |  |  | declare(strict_types=1); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 13 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 14 |  |  | namespace Sylius\Bundle\CoreBundle\Application; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 15 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 16 |  |  | use PSS\SymfonyMockerContainer\DependencyInjection\MockerContainer; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 17 |  |  | use Symfony\Component\Config\Loader\DelegatingLoader; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 18 |  |  | use Symfony\Component\Config\Loader\LoaderInterface; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 19 |  |  | use Symfony\Component\Config\Loader\LoaderResolver; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 20 |  |  | use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 21 |  |  | use Symfony\Component\DependencyInjection\ContainerBuilder; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 22 |  |  | use Symfony\Component\DependencyInjection\ContainerInterface; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 23 |  |  | use Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 24 |  |  | use Symfony\Component\DependencyInjection\Loader\ClosureLoader; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 25 |  |  | use Symfony\Component\DependencyInjection\Loader\DirectoryLoader; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 26 |  |  | use Symfony\Component\DependencyInjection\Loader\IniFileLoader; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 27 |  |  | use Symfony\Component\DependencyInjection\Loader\PhpFileLoader; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 28 |  |  | use Symfony\Component\DependencyInjection\Loader\XmlFileLoader; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 29 |  |  | use Symfony\Component\DependencyInjection\Loader\YamlFileLoader; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 30 |  |  | use Symfony\Component\HttpKernel\Config\FileLocator; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 31 |  |  | use Symfony\Component\HttpKernel\Kernel as HttpKernel; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 32 |  |  | use Webmozart\Assert\Assert; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 33 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 34 |  |  | class Kernel extends HttpKernel implements CompilerPassInterface | 
            
                                                                                                            
                            
            
                                    
            
            
                | 35 |  |  | { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 36 |  |  |     public const VERSION = '1.2.0-DEV'; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 37 |  |  |     public const VERSION_ID = '10200'; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 38 |  |  |     public const MAJOR_VERSION = '1'; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 39 |  |  |     public const MINOR_VERSION = '2'; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 40 |  |  |     public const RELEASE_VERSION = '0'; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 41 |  |  |     public const EXTRA_VERSION = 'DEV'; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 42 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 43 |  |  |     /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 44 |  |  |      * {@inheritdoc} | 
            
                                                                                                            
                            
            
                                    
            
            
                | 45 |  |  |      */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 46 |  |  |     public function registerBundles(): array | 
            
                                                                                                            
                            
            
                                    
            
            
                | 47 |  |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 48 |  |  |         $bundles = [ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 49 |  |  |             new \Sylius\Bundle\OrderBundle\SyliusOrderBundle(), | 
            
                                                                                                            
                            
            
                                    
            
            
                | 50 |  |  |             new \Sylius\Bundle\MoneyBundle\SyliusMoneyBundle(), | 
            
                                                                                                            
                            
            
                                    
            
            
                | 51 |  |  |             new \Sylius\Bundle\CurrencyBundle\SyliusCurrencyBundle(), | 
            
                                                                                                            
                            
            
                                    
            
            
                | 52 |  |  |             new \Sylius\Bundle\LocaleBundle\SyliusLocaleBundle(), | 
            
                                                                                                            
                            
            
                                    
            
            
                | 53 |  |  |             new \Sylius\Bundle\ProductBundle\SyliusProductBundle(), | 
            
                                                                                                            
                            
            
                                    
            
            
                | 54 |  |  |             new \Sylius\Bundle\ChannelBundle\SyliusChannelBundle(), | 
            
                                                                                                            
                            
            
                                    
            
            
                | 55 |  |  |             new \Sylius\Bundle\AttributeBundle\SyliusAttributeBundle(), | 
            
                                                                                                            
                            
            
                                    
            
            
                | 56 |  |  |             new \Sylius\Bundle\TaxationBundle\SyliusTaxationBundle(), | 
            
                                                                                                            
                            
            
                                    
            
            
                | 57 |  |  |             new \Sylius\Bundle\ShippingBundle\SyliusShippingBundle(), | 
            
                                                                                                            
                            
            
                                    
            
            
                | 58 |  |  |             new \Sylius\Bundle\PaymentBundle\SyliusPaymentBundle(), | 
            
                                                                                                            
                            
            
                                    
            
            
                | 59 |  |  |             new \Sylius\Bundle\MailerBundle\SyliusMailerBundle(), | 
            
                                                                                                            
                            
            
                                    
            
            
                | 60 |  |  |             new \Sylius\Bundle\PromotionBundle\SyliusPromotionBundle(), | 
            
                                                                                                            
                            
            
                                    
            
            
                | 61 |  |  |             new \Sylius\Bundle\AddressingBundle\SyliusAddressingBundle(), | 
            
                                                                                                            
                            
            
                                    
            
            
                | 62 |  |  |             new \Sylius\Bundle\InventoryBundle\SyliusInventoryBundle(), | 
            
                                                                                                            
                            
            
                                    
            
            
                | 63 |  |  |             new \Sylius\Bundle\TaxonomyBundle\SyliusTaxonomyBundle(), | 
            
                                                                                                            
                            
            
                                    
            
            
                | 64 |  |  |             new \Sylius\Bundle\UserBundle\SyliusUserBundle(), | 
            
                                                                                                            
                            
            
                                    
            
            
                | 65 |  |  |             new \Sylius\Bundle\CustomerBundle\SyliusCustomerBundle(), | 
            
                                                                                                            
                            
            
                                    
            
            
                | 66 |  |  |             new \Sylius\Bundle\UiBundle\SyliusUiBundle(), | 
            
                                                                                                            
                            
            
                                    
            
            
                | 67 |  |  |             new \Sylius\Bundle\ReviewBundle\SyliusReviewBundle(), | 
            
                                                                                                            
                            
            
                                    
            
            
                | 68 |  |  |             new \Sylius\Bundle\CoreBundle\SyliusCoreBundle(), | 
            
                                                                                                            
                            
            
                                    
            
            
                | 69 |  |  |             new \Sylius\Bundle\ResourceBundle\SyliusResourceBundle(), | 
            
                                                                                                            
                            
            
                                    
            
            
                | 70 |  |  |             new \Sylius\Bundle\GridBundle\SyliusGridBundle(), | 
            
                                                                                                            
                            
            
                                    
            
            
                | 71 |  |  |             new \winzou\Bundle\StateMachineBundle\winzouStateMachineBundle(), | 
            
                                                                                                            
                            
            
                                    
            
            
                | 72 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 73 |  |  |             new \Doctrine\Bundle\DoctrineBundle\DoctrineBundle(), | 
            
                                                                                                            
                            
            
                                    
            
            
                | 74 |  |  |             new \Doctrine\Bundle\DoctrineCacheBundle\DoctrineCacheBundle(), | 
            
                                                                                                            
                            
            
                                    
            
            
                | 75 |  |  |             new \Symfony\Bundle\FrameworkBundle\FrameworkBundle(), | 
            
                                                                                                            
                            
            
                                    
            
            
                | 76 |  |  |             new \Symfony\Bundle\MonologBundle\MonologBundle(), | 
            
                                                                                                            
                            
            
                                    
            
            
                | 77 |  |  |             new \Symfony\Bundle\SecurityBundle\SecurityBundle(), | 
            
                                                                                                            
                            
            
                                    
            
            
                | 78 |  |  |             new \Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(), | 
            
                                                                                                            
                            
            
                                    
            
            
                | 79 |  |  |             new \Symfony\Bundle\TwigBundle\TwigBundle(), | 
            
                                                                                                            
                            
            
                                    
            
            
                | 80 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 81 |  |  |             new \Sonata\CoreBundle\SonataCoreBundle(), | 
            
                                                                                                            
                            
            
                                    
            
            
                | 82 |  |  |             new \Sonata\BlockBundle\SonataBlockBundle(), | 
            
                                                                                                            
                            
            
                                    
            
            
                | 83 |  |  |             new \Sonata\IntlBundle\SonataIntlBundle(), | 
            
                                                                                                            
                            
            
                                    
            
            
                | 84 |  |  |             new \Bazinga\Bundle\HateoasBundle\BazingaHateoasBundle(), | 
            
                                                                                                            
                            
            
                                    
            
            
                | 85 |  |  |             new \JMS\SerializerBundle\JMSSerializerBundle(), | 
            
                                                                                                            
                            
            
                                    
            
            
                | 86 |  |  |             new \FOS\RestBundle\FOSRestBundle(), | 
            
                                                                                                            
                            
            
                                    
            
            
                | 87 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 88 |  |  |             new \Knp\Bundle\GaufretteBundle\KnpGaufretteBundle(), | 
            
                                                                                                            
                            
            
                                    
            
            
                | 89 |  |  |             new \Knp\Bundle\MenuBundle\KnpMenuBundle(), | 
            
                                                                                                            
                            
            
                                    
            
            
                | 90 |  |  |             new \Liip\ImagineBundle\LiipImagineBundle(), | 
            
                                                                                                            
                            
            
                                    
            
            
                | 91 |  |  |             new \Payum\Bundle\PayumBundle\PayumBundle(), | 
            
                                                                                                            
                            
            
                                    
            
            
                | 92 |  |  |             new \Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle(), | 
            
                                                                                                            
                            
            
                                    
            
            
                | 93 |  |  |             new \WhiteOctober\PagerfantaBundle\WhiteOctoberPagerfantaBundle(), | 
            
                                                                                                            
                            
            
                                    
            
            
                | 94 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 95 |  |  |             new \Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle(), | 
            
                                                                                                            
                            
            
                                    
            
            
                | 96 |  |  |             new \Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle(), | 
            
                                                                                                            
                            
            
                                    
            
            
                | 97 |  |  |             new \Sylius\Bundle\FixturesBundle\SyliusFixturesBundle(), | 
            
                                                                                                            
                            
            
                                    
            
            
                | 98 |  |  |             new \Sylius\Bundle\PayumBundle\SyliusPayumBundle(), // must be added after PayumBundle. | 
            
                                                                                                            
                            
            
                                    
            
            
                | 99 |  |  |             new \Sylius\Bundle\ThemeBundle\SyliusThemeBundle(), // must be added after FrameworkBundle | 
            
                                                                                                            
                            
            
                                    
            
            
                | 100 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 101 |  |  |             new \Symfony\Bundle\WebServerBundle\WebServerBundle(), // allows to run build in web server. Not recommended for prod environment | 
            
                                                                                                            
                            
            
                                    
            
            
                | 102 |  |  |         ]; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 103 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 104 |  |  |         if (in_array($this->getEnvironment(), ['dev', 'test', 'test_cached'], true)) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 105 |  |  |             $bundles[] = new \Sensio\Bundle\DistributionBundle\SensioDistributionBundle(); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 106 |  |  |             $bundles[] = new \Symfony\Bundle\DebugBundle\DebugBundle(); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 107 |  |  |             $bundles[] = new \Symfony\Bundle\WebProfilerBundle\WebProfilerBundle(); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 108 |  |  |         } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 109 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 110 |  |  |         return $bundles; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 111 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 112 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 113 |  |  |     /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 114 |  |  |      * Hotfix for https://github.com/symfony/symfony/issues/27494, will be removed after Symfony ^4.1.1 is required. | 
            
                                                                                                            
                            
            
                                    
            
            
                | 115 |  |  |      * | 
            
                                                                                                            
                            
            
                                    
            
            
                | 116 |  |  |      * @internal | 
            
                                                                                                            
                                                                
            
                                    
            
            
                | 117 |  |  |      */ | 
            
                                                                        
                            
            
                                    
            
            
                | 118 |  |  |     public function process(ContainerBuilder $container): void | 
            
                                                                        
                            
            
                                    
            
            
                | 119 |  |  |     { | 
            
                                                                        
                            
            
                                    
            
            
                | 120 |  |  |         if (HttpKernel::VERSION_ID !== 40100) { | 
            
                                                                        
                            
            
                                    
            
            
                | 121 |  |  |             return; | 
            
                                                                        
                            
            
                                    
            
            
                | 122 |  |  |         } | 
            
                                                                        
                            
            
                                    
            
            
                | 123 |  |  |  | 
            
                                                                        
                            
            
                                    
            
            
                | 124 |  |  |         try { | 
            
                                                                        
                            
            
                                    
            
            
                | 125 |  |  |             $clientDefinition = $container->findDefinition('test.client'); | 
            
                                                                        
                            
            
                                    
            
            
                | 126 |  |  |  | 
            
                                                                        
                            
            
                                    
            
            
                | 127 |  |  |             if (count($clientDefinition->getArguments()) >= 5) { | 
            
                                                                        
                            
            
                                    
            
            
                | 128 |  |  |                 $clientDefinition->replaceArgument(4, null); | 
            
                                                                        
                            
            
                                    
            
            
                | 129 |  |  |             } | 
            
                                                                        
                            
            
                                    
            
            
                | 130 |  |  |         } catch (ServiceNotFoundException $exception) { | 
                            
                    |  |  |  | 
                                                                                        
                                                                                            
                                                                                     | 
            
                                                                        
                            
            
                                    
            
            
                | 131 |  |  |         } | 
            
                                                                        
                            
            
                                    
            
            
                | 132 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 133 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 134 |  |  |     /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 135 |  |  |      * {@inheritdoc} | 
            
                                                                                                            
                            
            
                                    
            
            
                | 136 |  |  |      */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 137 |  |  |     protected function getContainerBaseClass(): string | 
                            
                    |  |  |  | 
                                                                                        
                                                                                     | 
            
                                                                                                            
                            
            
                                    
            
            
                | 138 |  |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 139 |  |  |         if (in_array($this->getEnvironment(), ['test', 'test_cached'], true)) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 140 |  |  |             return MockerContainer::class; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 141 |  |  |         } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 142 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 143 |  |  |         return parent::getContainerBaseClass(); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 144 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 145 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 146 |  |  |     /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 147 |  |  |      * {@inheritdoc} | 
            
                                                                                                            
                            
            
                                    
            
            
                | 148 |  |  |      */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 149 |  |  |     protected function getContainerLoader(ContainerInterface $container): LoaderInterface | 
            
                                                                                                            
                            
            
                                    
            
            
                | 150 |  |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 151 |  |  |         /** @var ContainerBuilder $container */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 152 |  |  |         Assert::isInstanceOf($container, ContainerBuilder::class); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 153 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 154 |  |  |         $locator = new FileLocator($this, $this->getRootDir() . '/Resources'); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 155 |  |  |         $resolver = new LoaderResolver([ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 156 |  |  |             new XmlFileLoader($container, $locator), | 
            
                                                                                                            
                            
            
                                    
            
            
                | 157 |  |  |             new YamlFileLoader($container, $locator), | 
            
                                                                                                            
                            
            
                                    
            
            
                | 158 |  |  |             new IniFileLoader($container, $locator), | 
            
                                                                                                            
                            
            
                                    
            
            
                | 159 |  |  |             new PhpFileLoader($container, $locator), | 
            
                                                                                                            
                            
            
                                    
            
            
                | 160 |  |  |             new DirectoryLoader($container, $locator), | 
            
                                                                                                            
                            
            
                                    
            
            
                | 161 |  |  |             new ClosureLoader($container), | 
            
                                                                                                            
                            
            
                                    
            
            
                | 162 |  |  |         ]); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 163 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 164 |  |  |         return new DelegatingLoader($resolver); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 165 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 166 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 167 |  |  |     /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 168 |  |  |      * {@inheritdoc} | 
            
                                                                                                            
                            
            
                                    
            
            
                | 169 |  |  |      */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 170 |  |  |     public function registerContainerConfiguration(LoaderInterface $loader): void | 
            
                                                                                                            
                            
            
                                    
            
            
                | 171 |  |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 172 |  |  |         $loader->load($this->getRootDir() . '/config/config_' . $this->getEnvironment() . '.yml'); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 173 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 174 |  |  |         $file = $this->getRootDir() . '/config/config_' . $this->getEnvironment() . '.local.yml'; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 175 |  |  |         if (is_file($file)) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 176 |  |  |             $loader->load($file); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 177 |  |  |         } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 178 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 179 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 180 |  |  |     /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 181 |  |  |      * {@inheritdoc} | 
            
                                                                                                            
                            
            
                                    
            
            
                | 182 |  |  |      */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 183 |  |  |     public function getCacheDir(): string | 
            
                                                                                                            
                            
            
                                    
            
            
                | 184 |  |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 185 |  |  |         if ($this->isVagrantEnvironment()) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 186 |  |  |             return '/dev/shm/sylius/cache/' . $this->getEnvironment(); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 187 |  |  |         } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 188 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 189 |  |  |         return dirname($this->getRootDir()) . '/var/cache/' . $this->getEnvironment(); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 190 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 191 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 192 |  |  |     /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 193 |  |  |      * {@inheritdoc} | 
            
                                                                                                            
                            
            
                                    
            
            
                | 194 |  |  |      */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 195 |  |  |     public function getLogDir(): string | 
            
                                                                                                            
                            
            
                                    
            
            
                | 196 |  |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 197 |  |  |         if ($this->isVagrantEnvironment()) { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 198 |  |  |             return '/dev/shm/sylius/logs'; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 199 |  |  |         } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 200 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 201 |  |  |         return dirname($this->getRootDir()) . '/var/logs'; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 202 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 203 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 204 |  |  |     /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 205 |  |  |      * @return bool | 
            
                                                                                                            
                            
            
                                    
            
            
                | 206 |  |  |      */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 207 |  |  |     protected function isVagrantEnvironment(): bool | 
            
                                                                                                            
                            
            
                                    
            
            
                | 208 |  |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 209 |  |  |         return (getenv('HOME') === '/home/vagrant' || getenv('VAGRANT') === 'VAGRANT') && is_dir('/dev/shm'); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 210 |  |  |     } | 
            
                                                                                                            
                                                                
            
                                    
            
            
                | 211 |  |  | } | 
            
                                                        
            
                                    
            
            
                | 212 |  |  |  |