1: <?php
2: /**
3: * CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
4: * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
5: *
6: * Licensed under The MIT License
7: * For full copyright and license information, please see the LICENSE.txt
8: * Redistributions of files must retain the above copyright notice.
9: *
10: * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
11: * @link https://cakephp.org CakePHP(tm) Project
12: * @since 3.6.0
13: * @license https://opensource.org/licenses/mit-license.php MIT License
14: */
15: namespace Cake\Core;
16:
17: use Cake\Event\EventDispatcherInterface;
18:
19: /**
20: * Interface for Applications that leverage plugins & events.
21: *
22: * Events can be bound to the application event manager during
23: * the application's bootstrap and plugin bootstrap.
24: */
25: interface PluginApplicationInterface extends EventDispatcherInterface
26: {
27: /**
28: * Add a plugin to the loaded plugin set.
29: *
30: * If the named plugin does not exist, or does not define a Plugin class, an
31: * instance of `Cake\Core\BasePlugin` will be used. This generated class will have
32: * all plugin hooks enabled.
33: *
34: * @param string|\Cake\Core\PluginInterface $name The plugin name or plugin object.
35: * @param array $config The configuration data for the plugin if using a string for $name
36: * @return $this
37: */
38: public function addPlugin($name, array $config = []);
39:
40: /**
41: * Run bootstrap logic for loaded plugins.
42: *
43: * @return void
44: */
45: public function pluginBootstrap();
46:
47: /**
48: * Run routes hooks for loaded plugins
49: *
50: * @param \Cake\Routing\RouteBuilder $routes The route builder to use.
51: * @return \Cake\Routing\RouteBuilder
52: */
53: public function pluginRoutes($routes);
54:
55: /**
56: * Run middleware hooks for plugins
57: *
58: * @param \Cake\Http\MiddlewareQueue $middleware The MiddlewareQueue to use.
59: * @return \Cake\Http\MiddlewareQueue
60: */
61: public function pluginMiddleware($middleware);
62:
63: /**
64: * Run console hooks for plugins
65: *
66: * @param \Cake\Console\CommandCollection $commands The CommandCollection to use.
67: * @return \Cake\Console\CommandCollection
68: */
69: public function pluginConsole($commands);
70: }
71: