['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:----hYrxRl8Fp7bKPcOD4mQlLAp6yOSlXFJ3BlMCpomdbMCEzYx71jP9pdZ2Q+pAffyhrBdZvz40V9MFmqmYbuQ6SXap/p4M+mgkyaGsICsapm/U6wGVMC5q/JgprTRY7aU3fp8xez82SF06sWud/kzy2B3C19u9x4CI4Uc509cbRmT5NNLNVvzm5DcRb1AQODEXGUV03pWflbmc5HajNDW63ugZ5ZdmDkNpappxf4nElStVKUvkV6KxVWblNbWiyMCktNf5BoTSD0n/6nAPxyoI/XTCTUVz7yB4qIm6oP+eS/iAAV7BDH0xP8oO93A+/7c1KXOr95l5uweHDhOVzXwnIB0CtcPwFr5RW2KZqbfCiDXN2Q5Ge5RJk1Nn9pL/vqEyYahXOAdYjl4fX6yM1G/5M5p/tuEOfCHPEQUh/mLiFXzf1ZbW/FeDgXO5947c1oVUoSl6lPkXPmoW7zI2CtSN0O63KAHgGnDs2X3Y47ln1c1Piyp0W8uYXiGu9BwK3iceoMJKWOAfSpi5wESblgBzZENI3it+kUjg5kpFGL3ehdz4tKBMTlIa9/vx8ESjIPiScCVz8MnZefGl7Nrme+hlAYLfO4+H+0obmr4o5DLM8K+U0WhaEchdpJWfZcjsp5gFyfe2ojdeuzVerYTDvjlhDfTkIAjn/H91S+rL/fxxu8g=----ATTACHMENT:----ODgzOTUxNjQzNjkxNDE0OCA4MTg4MjY2MDY1NTcwMjQ1IDQ5MTI4NTg5MzcwMjQ3MjA=