Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Plugins can load other plugins. Support this use case by implementing the `Iterator` interface instead of `IteratorAggregate`. Using the basic interface lets us extend the collection as it is being iterated, which `IteratorAggregate` cannot do. Refs #11787
- Loading branch information
Showing
5 changed files
with
126 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
namespace ParentPlugin; | ||
|
||
use Cake\Core\BasePlugin; | ||
use Cake\Core\Configure; | ||
use Cake\Core\PluginApplicationInterface; | ||
use Cake\Core\Plugin as CorePlugin; | ||
|
||
class Plugin extends BasePlugin | ||
{ | ||
public function bootstrap(PluginApplicationInterface $app) | ||
{ | ||
Configure::write('ParentPlugin.bootstrap', true); | ||
|
||
CorePlugin::load('TestPluginTwo', ['bootstrap' => true]); | ||
$app->addPlugin('TestPlugin', ['bootstrap' => true]); | ||
} | ||
} |