From 71ae82d13496c2a662cf493b3e48b17c27b43d34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Bar=C3=A1=C5=A1ek?= Date: Wed, 20 Jan 2021 10:33:11 +0100 Subject: [PATCH] Extension: Fix support for CLI. --- src/CmsExtension.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/CmsExtension.php b/src/CmsExtension.php index b40ccde..b1ff3d6 100644 --- a/src/CmsExtension.php +++ b/src/CmsExtension.php @@ -242,6 +242,9 @@ public function afterCompile(ClassType $class): void 'translate', '@' . TranslatorFilter::class, ]); + if (PHP_SAPI === 'cli') { + return; + } $class->getMethod('initialize')->addBody( '// admin (cms).' . "\n" . '(function () {' . "\n"