josegonzalez/cakephp-version

Bug: Bake Model fails with CakePHP 4

GrantAnt opened this issue · 1 comments

Executing bake model e.g. bin/cake bake model dms_auth_sessions fails.

Reason: Trait 'Cake\Event\EventManagerTrait' is depreated in CakePHP 3 and removed in Cakephp 4
You can see it here:
https://github.com/cakephp/cakephp/blob/3.9.8/src/Event/EventManagerTrait.php
@deprecated 3.0.10 Use Cake\Event\EventDispatcherTrait instead.

The following code is shown in the console:

One moment while associations are detected.
PHP Fatal error:  Trait 'Cake\Event\EventManagerTrait' not found in C:\code\xampp\htdocs\CRM_doxx\vendor\josegonzalez\cakephp-version\src\Event\EventListener.php on line 29

Fatal error: Trait 'Cake\Event\EventManagerTrait' not found in C:\code\xampp\htdocs\CRM_doxx\vendor\josegonzalez\cakephp-version\src\Event\EventListener.php on line 29
2021-04-12 10:52:06 Error: Fatal Error (1): Trait 'Cake\Event\EventManagerTrait' not found in [C:\code\xampp\htdocs\CRM_doxx\vendor\josegonzalez\cakephp-version\src\Event\EventListener.php, line 29]
Trace:
Cake\Error\BaseErrorHandler::handleFatalError() - CORE\src\Error\BaseErrorHandler.php, line 258
Cake\Error\BaseErrorHandler::Cake\Error\{closure}() - CORE\src\Error\BaseErrorHandler.php, line 122
[main] - [internal], line ??

Fatal Error: Trait 'Cake\Event\EventManagerTrait' not found
In [C:\code\xampp\htdocs\CRM_doxx\vendor\josegonzalez\cakephp-version\src\Event\EventListener.php, line 29]

2021-04-12 10:52:06 Error: [Cake\Error\FatalErrorException] Trait 'Cake\Event\EventManagerTrait' not found in C:\code\xampp\htdocs\CRM_doxx\vendor\josegonzalez\cakephp-version\src\Event\EventListener.php on line 29
Stack Trace:
- C:\code\xampp\htdocs\CRM_doxx\vendor\cakephp\cakephp\src\Error\BaseErrorHandler.php:122
- [main] - [internal], line ??

Pull requests welcome :)