Skip to content
This repository was archived by the owner on Nov 27, 2020. It is now read-only.

Commit f3f0fea

Browse files
committed
feature #641 Add new directory structure hook (romainneutron)
This PR was squashed before being merged into the 2.4-dev branch (closes #641). Discussion ---------- Add new directory structure hook | Q | A | ------------- | --- | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Fixed tickets | #584 | License | MIT This requires sensiolabs/SensioDistributionBundle#118 to be merged Commits ------- bffde32 Add new directory structure hook
2 parents 450796a + bffde32 commit f3f0fea

File tree

3 files changed

+15
-5
lines changed

3 files changed

+15
-5
lines changed

app/SymfonyStandard/Composer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515

1616
class Composer
1717
{
18-
public static function hookInstallAcmeDemoBundle(CommandEvent $event)
18+
public static function hookRootPackageInstall(CommandEvent $event)
1919
{
20-
$event->getComposer()->getEventDispatcher()->addSubscriber(new InstallAcmeDemoBundleSubscriber());
20+
$event->getComposer()->getEventDispatcher()->addSubscriber(new RootPackageInstallSubscriber());
2121
}
2222
}

app/SymfonyStandard/InstallAcmeDemoBundleSubscriber.php renamed to app/SymfonyStandard/RootPackageInstallSubscriber.php

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,25 @@
1616
use Composer\Script\CommandEvent;
1717
use Sensio\Bundle\DistributionBundle\Composer\ScriptHandler;
1818

19-
class InstallAcmeDemoBundleSubscriber implements EventSubscriberInterface
19+
class RootPackageInstallSubscriber implements EventSubscriberInterface
2020
{
2121
public static function installAcmeDemoBundle(CommandEvent $event)
2222
{
2323
ScriptHandler::installAcmeDemoBundle($event);
2424
}
2525

26+
public static function setupNewDirectoryStructure(CommandEvent $event)
27+
{
28+
ScriptHandler::defineDirectoryStructure($event);
29+
}
30+
2631
public static function getSubscribedEvents()
2732
{
28-
return array(ScriptEvents::POST_INSTALL_CMD => 'installAcmeDemoBundle');
33+
return array(
34+
ScriptEvents::POST_INSTALL_CMD => array(
35+
array('setupNewDirectoryStructure', 512),
36+
array('installAcmeDemoBundle', 0)
37+
),
38+
);
2939
}
3040
}

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
},
2525
"scripts": {
2626
"post-root-package-install": [
27-
"SymfonyStandard\\Composer::hookInstallAcmeDemoBundle"
27+
"SymfonyStandard\\Composer::hookRootPackageInstall"
2828
],
2929
"post-install-cmd": [
3030
"Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",

0 commit comments

Comments
 (0)