patternlab-php icon indicating copy to clipboard operation
patternlab-php copied to clipboard

Patternlab php not working with PHP 8.0

Open drcobel opened this issue 4 years ago • 3 comments

We use Patternlab PHP together with Azure, so the compilation is done on an Azure Ubuntu or Mac agent. They were recently updated by MS to run PHP 8.0 and Patternlab stopped working. This is the error message we get:

`Running "shell:patternlab" (shell) task Warning: Command failed: php core/console -gp PHP Fatal error: Uncaught Error: Class "\PatternLabListener" not found in /home/vsts/work/1/s/pattern-lab/vendor/pattern-lab/core/src/PatternLab/Dispatcher.php:61 Stack trace:

#0 /home/vsts/work/1/s/pattern-lab/vendor/pattern-lab/core/src/PatternLab/Dispatcher.php(39): PatternLab\Dispatcher::loadListeners()

#1 /home/vsts/work/1/s/pattern-lab/core/console(42): PatternLab\Dispatcher::init()

#2 {main} thrown in /home/vsts/work/1/s/pattern-lab/vendor/pattern-lab/core/src/PatternLab/Dispatcher.php on line 61 Use --force to continue.

Aborted due to warnings.`

drcobel avatar Jan 25 '21 13:01 drcobel

Bump.

lquessenberry avatar Feb 22 '22 20:02 lquessenberry

We have a similar issue. We us the PHP flavor with Drupal and WordPress and we desperately need php8 support asap.

rgracia avatar Jul 11 '22 14:07 rgracia

Check your configuration registration. I had to make two changes:

config/listeners.json

- {"listeners":["\\aleksip\\DataTransformPlugin\\PatternLabListener","\\PatternLab\\TwigNamespaces\\PatternLabListener","\\PatternLabListener"]} 
+ {"listeners":["\\aleksip\\DataTransformPlugin\\PatternLabListener","\\PatternLab\\TwigNamespaces\\PatternLabListener","\\PatternLab\\Listener"]}

config/patternengines.json

- {"patternengines":["\\PatternLab\\PatternEngine\\Twig\\PatternEngineRule","\\PatternEngineRule"]} 
+ {"patternengines":["\\PatternLab\\PatternEngine\\Twig\\PatternEngineRule","\\PatternLab\\PatternEngine\\Rule"]}

And I think this repository is deprecated.... See https://github.com/pattern-lab/patternlab-php-core/issues/177

agentrickard avatar Aug 01 '22 15:08 agentrickard