Skip to content

Commit

Permalink
Merge pull request #41 from blankse/patch-1
Browse files Browse the repository at this point in the history
Add generateAutoloads composer command
  • Loading branch information
bdunogier committed Dec 23, 2015
2 parents d9f75c2 + 5d85092 commit 45310a4
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions bundle/Composer/ScriptHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,32 @@ public static function installLegacyBundlesExtensions(CommandEvent $event)

static::executeCommand($event, $appDir, 'ezpublish:legacybundles:install_extensions ' . $symlink);
}

public static function generateAutoloads(CommandEvent $event)
{
$options = self::getOptions($event);
$appDir = $options['symfony-app-dir'];

if (!is_dir($appDir)) {
echo 'The symfony-app-dir (' . $appDir . ') specified in composer.json was not found in ' . getcwd() . ', can not generate autoloads.' . PHP_EOL;

return;
}

static::executeCommand($event, $appDir, 'ezpublish:legacy:script bin/php/ezpgenerateautoloads.php');
}

public static function generateKernelOverrideAutoloads(CommandEvent $event)
{
$options = self::getOptions($event);
$appDir = $options['symfony-app-dir'];

if (!is_dir($appDir)) {
echo 'The symfony-app-dir (' . $appDir . ') specified in composer.json was not found in ' . getcwd() . ', can not generate kernel override autoloads.' . PHP_EOL;

return;
}

static::executeCommand($event, $appDir, 'ezpublish:legacy:script bin/php/ezpgenerateautoloads.php -o');
}
}

0 comments on commit 45310a4

Please sign in to comment.