@@ 33-43 (lines=11) @@ | ||
30 | * @param \Composer\Script\Event $event |
|
31 | * @param string $config |
|
32 | */ |
|
33 | public static function configure(Event $event, $config = '') |
|
34 | { |
|
35 | $app = self::createApplication($event, $config); |
|
36 | $configuration = new Configuration(); |
|
37 | $configuration->setIO($app->getIO()); |
|
38 | $input = new ArrayInput( |
|
39 | ['command' => 'configure', '--configuration' => $config, '-f' => '-f', '-e' => '-e'] |
|
40 | ); |
|
41 | $app->add($configuration); |
|
42 | $app->run($input); |
|
43 | } |
|
44 | ||
45 | /** |
|
46 | * Installs the hooks to your local repository. |
|
@@ 51-59 (lines=9) @@ | ||
48 | * @param \Composer\Script\Event $event |
|
49 | * @param string $config |
|
50 | */ |
|
51 | public static function install(Event $event, string $config = '') |
|
52 | { |
|
53 | $app = self::createApplication($event, $config); |
|
54 | $install = new Install(); |
|
55 | $install->setIO($app->getIO()); |
|
56 | $input = new ArrayInput(['command' => 'install', '--configuration' => $config, '-f' => '-f']); |
|
57 | $app->add($install); |
|
58 | $app->run($input); |
|
59 | } |
|
60 | ||
61 | /** |
|
62 | * Create a CaptainHook Composer application. |