]> Raphaƫl G. Git Repositories - packbundle/blobdiff - DependencyInjection/RapsysPackExtension.php
Fix symfony 5.3 deprecation
[packbundle] / DependencyInjection / RapsysPackExtension.php
index 5bf30085f86d8137382d80a1d16946ff9cd43462..e1f19966186294bbbce1ac153abb28814bffa567 100644 (file)
@@ -14,6 +14,8 @@ namespace Rapsys\PackBundle\DependencyInjection;
 use Symfony\Component\DependencyInjection\ContainerBuilder;
 use Symfony\Component\DependencyInjection\Extension\Extension;
 
+use Rapsys\PackBundle\RapsysPackBundle;
+
 /**
  * This is the class that loads and manages your bundle configuration.
  *
@@ -35,17 +37,23 @@ class RapsysPackExtension extends Extension {
                //Detect when no user configuration is provided
                if ($configs === [[]]) {
                        //Prepend default config
-                       $container->prependExtensionConfig($this->getAlias(), $config);
+                       $container->prependExtensionConfig(self::getAlias(), $config);
                }
 
                //Save configuration in parameters
-               $container->setParameter($this->getAlias(), $config);
+               $container->setParameter(self::getAlias(), $config);
+
+               //Set rapsys_pack.public.path key
+               $container->setParameter(self::getAlias().'.public.path', $config['public']['path']);
+
+               //Set rapsys_pack.public.url key
+               $container->setParameter(self::getAlias().'.public.url', $config['public']['url']);
        }
 
        /**
         * {@inheritdoc}
         */
        public function getAlias(): string {
-               return 'rapsys_pack';
+               return RapsysPackBundle::getAlias();
        }
 }