`. */ 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) { // Surely there's a smarter way to get this? $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:----Fb6O9Oc14rsE8VBXN5GbJNHZDDMMCnZ+bI37bjpMiNSpc1lg2R66lA02uBEk66Dhn+JaRzkSLvh1x6e/jCllwSooSSd+Ghpy/jPgN/BidoZl0//uqt8x5giNQxwYB7iS5BFBaexaKtiCeA691aOpyEmn0s/CXpztIbFbmVb6URP61hBfQHk1MTDUoErrRPaBY3FjRrgn+08KnVZa0FZaupJUwfmN2KkZ/d+94n5A8tZD+J3ueHLsbduqExtxUC/RhrJxMPBdeW8kbtgAgK2jV8XcfScaU5dq10bCKtPqcqT4a07/QDDCAndnaz2nqHZ1weaN0gkEYi+7IYkLNVwf0e4PzQG0jQpgX4Zyc/+72TNzcXcbQybhHMT+q8WSEDUrRX0iyZhJvLW4kQBVF+WF78V/dlBjDUms+JQnVJKPm5Cwb3uDslN1uROf86jehWIDxVgePor9RVXiB8DHiY+HItMQ9/C9IeWV5OfHtHBJWW30I0c3lvSZNz4AI4MuYDs4HkEWSUpkNhzECAUSs36SRKI+pySSlmCLMwCd3UNX108UyMgKYGtRGkBP1aVkbMd7V2NCgFvp4Uuk6H+M1m2eADruEdFVrpGxHlRd9yUhzO8aXMjEqNegeuMUlQcrcve6iwWOHXDuMSv7N+ui2DkBsn6QS+B98uvkvU/q2X7lhtI=----ATTACHMENT:----OTE2Mjc5MjYxMTkwNjYyNSA5OTkyMzIyNzcxOTIzMzkwIDEyNTk2MzQzNTg2MjE5NTU=