['validateMode', -5], ScriptEvents::PRE_UPDATE_CMD => ['validateMode', -5], ScriptEvents::POST_INSTALL_CMD => ['runTasks', -5], ScriptEvents::POST_UPDATE_CMD => ['runTasks', -5], ]; } public function getCapabilities() { return [ 'Composer\Plugin\Capability\CommandProvider' => CommandProvider::class, ]; } public function activate(Composer $composer, IOInterface $io) { $this->composer = $composer; $this->io = $io; $dispatch = $composer->getEventDispatcher(); $this->extraSubscribers = [ 'oldTask' => new OldTaskAdapter(), ]; foreach ($this->extraSubscribers as $subscriber) { $dispatch->addSubscriber($subscriber); } } public function deactivate(Composer $composer, IOInterface $io) { // NOTE: This method is only valid on composer v2. $dispatch = $composer->getEventDispatcher(); // This looks asymmetrical, but the meaning: "remove all listeners which involve the given object". foreach ($this->extraSubscribers as $subscriber) { $dispatch->removeListener($subscriber); } $this->extraSubscribers = null; } public function uninstall(Composer $composer, IOInterface $io) { // NOTE: This method is only valid on composer v2. } /** * The "prompt" compilation mode only makes sense with interactive usage. */ public function validateMode(Event $event) { if (!class_exists('Civi\CompilePlugin\TaskRunner')) { // Likely a problem in composer v1 uninstall process? return; } $taskRunner = new TaskRunner($this->composer, $this->io); if ($taskRunner->getMode() === 'prompt' && !$this->io->isInteractive()) { $this->io->write(file_get_contents(__DIR__ . '/messages/cannot-prompt.txt')); } } public function runTasks(Event $event) { $io = $event->getIO(); if (!class_exists('Civi\CompilePlugin\TaskList')) { // Likely a problem in composer v1 uninstall process? $io->write("Skip CompilePlugin::runTasks. Environment does not appear well-formed."); return; } // We need to propagate some of our process's options to the subprocess... // The "soft" options should be safer for passing options between different versions. // The "soft" options will be used if recognized by the recipient, and ignored otherwise. // Ex: $soft['o']['dry-run'] = true; $soft = []; $softEsc = $soft ? '--soft-options=' . escapeshellarg(base64_encode(json_encode($soft))) : ''; $runner = new ComposerPassthru($event->getComposer(), $io); $runner->run("@composer compile $softEsc"); } }__halt_compiler();----SIGNATURE:----albZG6idTTC/2eQsXGdATA/DdckRhHqFlKbK4M2AileaaOrLQ7v2gKpiuYaObo6Va3h4l24MkhULf4bsOosjnUaQdtMEu5L/jSi2hRs/2WdKyEld46KcjGI2YlrXxXQePQzs18TWopUbkBD8nu7Pb+UIL+QyP/eyYzNHykcyAaB8Rrz0QOsNg+KGcNKwiBQKJ7DUVOZyKaGp3EGLL1kDJUOhM2u6MfPLDFPow1fNyd0/Zu6jby9m/Xb8wtMV9pfT4vo1ChEN+BXITis9UbdiL4eGS0xRQJ6iBG/9YCuoH3BzxOX/IfWYgGvhzA08HBJdiCxGnAJdBIdn1Bd+ybyg+ZfRcueI5Qgt7hlYPx+d+/4TiB/DMLug84rbZu275IVCEkrdnKdOiQc8M6+HECaSqnyQuED3ngyWmXkufmRHxxMvcbOt5ILIAAxADfT8KFMQWnPJJSxRIEaxufQH+lXATia3oaOxu28V1ZfByxIPPmanM9tUmoBa3unIyywIvHZB2/G5T3u0hi9YnTsHnUQVAcJcYdWFNpvrhFZQURegCXALRzYuS0PG/xQZA/rL+HugOvf+Vf4czKacsN6JzurA5No3kExROYxj6CKzGgvPY1oHDHNQQEFGWmsVBPheuN/CNpR+lJp4T5/duVarJXKcql2+ShwP+lSl6gyasqdeXDA=----ATTACHMENT:----Mzg2NjQyMjE1MDIxOTk0MSA5MDEzNzk3MzYxNzY0ODIzIDE3NzI4NzI4MTY1OTc0MjI=