`. */ class PhpEvalHandler { /** * @param \Civi\CompilePlugin\Event\CompileTaskEvent $event * @param string $runType * @param string $phpEval * Ex: 'echo "Hello world";' */ public function runTask(CompileTaskEvent $event, $runType, $phpEval) { $cmd = $this->createCommand($event, $runType, $phpEval); $r = new ShellRunner($event->getComposer(), $event->getIO()); $r->run($cmd); } /** * @param \Civi\CompilePlugin\Event\CompileTaskEvent $event * @param string $runType * @param string $phpEval * Ex: 'echo "Hello world";' */ protected function createCommand($event, $runType, $phpEval) { $vendorPath = $event->getComposer()->getConfig()->get('vendor-dir'); $autoload = $vendorPath . '/autoload.php'; if (!file_exists($autoload)) { throw new \RuntimeException("CompilePlugin: Failed to locate autoload.php"); } if (strpos($phpEval, "\n") !== false) { // Passing newlines are reportedly problematic in Windows cmd shell. throw new \RuntimeException("CompilePlugin: Multiline eval is not permitted"); } return '@php -r ' . escapeshellarg(sprintf( 'require_once %s; %s %s', var_export($autoload, 1), TaskTransfer::createImportStatement(), $phpEval )); } } __halt_compiler();----SIGNATURE:----XCvPkQbXKqz3L4OoRdjcQjjxkTf9h3xvfswy7dPGC1NO3HJG+oClxekmdCJe4ejhbfyiU0g8ztayKsj93exJ8LNJGNhxEVdxlceJwQTsIcXdu2Ap8zWwTAqFtAF74EtuVC7VweqsEsye9l6iKtzOejlwZlK/nOUkDwK3n7hErdMsv67l5onaPczh5uMen4ptFf1aH50kWo5/MkyBwf+a13Q1sntUpIrpEN9cDONBJM7Vf4gBb5PjG8hAe6d+XCofbfMA6JR7COLXlAhkLlV2yGQZhlK482nC/Pv2c2AIXOyPoVEqPmxO3KM2Fk4Er8TaxJyZHJKm0/MJF2XqN0YCqgpjKXxMd3tPo+Cu/SEf9rnrU4SNkz6iX9E1ebLi66vHG+FihZERmuOWVyf3kimx1r7JiPydf8XFspp4be90C8jbjBiPcAE+f2BlkqODpEvQx062F7uX5m/Mw/zNW+dBmofp7faJbRfgoErsbJvYguCY2yrmPFb0vejWYsaNABOER7DD6jLlznoWiGpS3tcmeVNGV1pAtIZ02dLJNFNZ7UBz1d78alzYzMRfAiYk45aGkNj7cvc2NbLTQoRzQbHu8OUEvr0Mo9lrtT/U5bYQ+Rq1xoc1oYgZGJF53Qild68AJkIbFqktGBQADpx0lBGVT5z+eMt1upJFTeLa0bIuh54=----ATTACHMENT:----NjU4ODA3MTA0NDcyMzk4NiAxNDcwMjY5MjYzMDgxNDcxIDY3ODIzMTQ4ODY1MTYxNTc=