Skip to content

Commit

Permalink
Extension: Fix support for CLI.
Browse files Browse the repository at this point in the history
  • Loading branch information
janbarasek authored Jan 20, 2021
1 parent 9fe7826 commit 71ae82d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/CmsExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 71ae82d

Please sign in to comment.