]> Raphaël G. Git Repositories - packbundle/commitdiff
Handle assets in /web/ or /public/ 0.0.4
authorRaphaël Gertz <git@rapsys.eu>
Fri, 25 Oct 2019 13:39:07 +0000 (15:39 +0200)
committerRaphaël Gertz <git@rapsys.eu>
Fri, 25 Oct 2019 13:39:07 +0000 (15:39 +0200)
DependencyInjection/RapsysPackExtension.php

index 7d660000e870b6679c0c9658c5cd714f87bcd336..27b499ac0882ffd73d781619623f9458781f27d2 100644 (file)
@@ -36,7 +36,11 @@ class RapsysPackExtension extends Extension {
         */
        public function getConfiguration(array $configs, ContainerBuilder $container) {
                //Get configuration instance with resolved web path
-               return new Configuration($container->getParameter('kernel.project_dir').'/web/');
+               return new Configuration(
+                       is_dir($webDir = ($projectDir = $container->getParameter('kernel.project_dir')).'/web/')?
+                       $webDir:
+                       $projectDir.'/public/'
+               );
        }
 
        /**