josegonzalez / cakephp-version

CakePHP3: plugin that facilitates versioned database entities
MIT License
51 stars 22 forks source link

Bug: Bake Model fails with CakePHP 4 #42

Closed GrantAnt closed 3 years ago

GrantAnt commented 3 years ago

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 ??
josegonzalez commented 3 years ago

Pull requests welcome :)