wintercms / winter

Free, open-source, self-hosted CMS platform based on the Laravel PHP Framework.
https://wintercms.com
MIT License
1.38k stars 195 forks source link

"Call to undefined method Event::listen()" while installation #1076

Closed Jurek-Raben closed 9 months ago

Jurek-Raben commented 9 months ago

Winter CMS Build

dev-develop

PHP Version

8.1

Database engine

MySQL 5.7.30 arm

Plugins installed

none

Issue description

While installation on a docker setup (php 8.1/apache/mysql), I always getting this error:

> @php artisan winter:version

In ServiceProvider.php line 245:

  Call to undefined method Event::listen()  

Script @php artisan winter:version handling the post-update-cmd event returned with error code 1

Steps to replicate

Use these docker images: biarms/mysql:5.7.30 chialab/php:8.1-apache

Install wintercms with (where composer runs inside the php image): bin/composer create-project wintercms/winter my-project "dev-develop" or bin/composer create-project wintercms/winter my-project

Workaround

None

Jurek-Raben commented 9 months ago

Fixed by disabling this php extension in the chialab php8.x-apache image: /usr/local/etc/php/conf.d/xx-php-ext-event.ini

Jurek-Raben commented 9 months ago

Maybe this should be finally fixed, by renaming the Event alias, since Event is common PHP base class.

mjauvin commented 9 months ago

Maybe this should be finally fixed, by renaming the Event alias, since Event is common PHP base class.

No way, all hell would break loose...

LukeTowers commented 9 months ago

At very least we should be using the fully namespaced version of all facades rather than the class aliased global versions we use sporadically throughout the codebase right now. That would be better for IDE support as well.