How to work with plugins in Cakephp 3.6 or 3.6.1

Asked

Viewed 130 times

0

How to work with plugins in Cakephp 3.6 or 3.6.1.

Until version 3.5.13 I worked without problem, installed via Poser and loaded with bin/cake plugin load Name

But in version 3.6 that was quite changed, I install without problem with Composer require user/plugin name

But when I’m gonna charge bin/cake plugin load Nameplate

He throws me this message:

Your Application class does not have a bootstrap() method. Please add one.

I received a tip to add the code below in src/Application.php

public function bootstrap()
{   
    parent::bootstrap();
}

I can load it. At least it doesn’t give an error message. It says it has. But when I try to run Bake to generate code it tells me:

bin/cake Bake

all groups -t CakeAclBr
PHP Fatal error:  Uncaught InvalidArgumentException: The plugin class `CakeAclBr\Plugin` cannot be found. Ensure your autoloader is correct. in /backup/www/cake361/vendor/cakephp/cakephp/src/Http/BaseApplication.php:127
Stack trace:
#0 /backup/www/cake361/vendor/cakephp/cakephp/src/Http/BaseApplication.php(95): Cake\Http\BaseApplication->makePlugin('CakeAclBr\\Plugi...', Array)
#1 /backup/www/cake361/src/Application.php(34): Cake\Http\BaseApplication->addPlugin('CakeAclBr', Array)
#2 /backup/www/cake361/vendor/cakephp/cakephp/src/Console/CommandRunner.php(188): App\Application->bootstrap()
#3 /backup/www/cake361/vendor/cakephp/cakephp/src/Console/CommandRunner.php(134): Cake\Console\CommandRunner->bootstrap()
#4 /backup/www/cake361/bin/cake.php(12): Cake\Console\CommandRunner->run(Array)
#5 {main}
  thrown in /backup/www/cake361/vendor/cakephp/cakephp/src/Http/BaseApplication.php on line 127

I couldn’t go through with it from here. There is some hint. Thank you!

  • You tested putting one Plugin::loadAll(); ?

  • I had not done it because now in version 3.6 it stores the plugin load information no longer in bootstrap.php but in src/Application.php. By consciousness-raising I added loadAll and then only the load for my plugin but the error is the same. And he added my plugin in Application.php, but it didn’t help. Thanks.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.