Skip to content

Commit d19bdb0

Browse files
committed
<feature> Check public directory in SF 4
1 parent 607e6a1 commit d19bdb0

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

Composer/ScriptHandler.php

+6-3
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
use Symfony\Component\Process\Process;
1414
use Symfony\Component\Process\PhpExecutableFinder;
1515
use Composer\Script\Event;
16-
16+
use Symfony\Component\HttpKernel\Kernel;
1717
/**
1818
* ScriptHandler
1919
*
@@ -36,14 +36,17 @@ class ScriptHandler
3636
*/
3737
private static $options = [
3838
'symfony-app-dir' => 'app',
39-
'symfony-web-dir' => 'web',
39+
'symfony-web-dir' => (Kernel::VERSION_ID < 40000 ? 'web' : 'public'),
4040
];
4141

4242
protected static function getOptions(Event $event)
4343
{
4444
$options = array_merge(self::$options, $event->getComposer()->getPackage()->getExtra());
4545

46-
$options['symfony-assets-install'] = getenv('SYMFONY_ASSETS_INSTALL') ?: $options['symfony-assets-install'];
46+
if(Kernel::VERSION_ID < 40000)
47+
{
48+
$options['symfony-assets-install'] = getenv('SYMFONY_ASSETS_INSTALL') ?: $options['symfony-assets-install'];
49+
}
4750

4851
$options['process-timeout'] = $event->getComposer()->getConfig()->get('process-timeout');
4952

0 commit comments

Comments
 (0)