Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This adds consistency between application hooks and plugin hooks.
- Loading branch information
Showing
9 changed files
with
71 additions
and
12 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,9 +18,9 @@ | |
interface PluginInterface | ||
{ | ||
/** | ||
* The list of valid hooks | ||
* List of valid hooks. | ||
*/ | ||
const VALID_HOOKS = ['routes', 'bootstrap', 'console', 'middleware']; | ||
const VALID_HOOKS = ['routes', 'bootstrap', 'console', 'middleware', 'events']; | ||
|
||
/** | ||
* Get the name of this plugin. | ||
|
@@ -60,29 +60,37 @@ public function getClassPath(); | |
public function bootstrap(); | ||
|
||
/** | ||
* Add a plugins console commands | ||
* Add console commands for the plugin. | ||
* | ||
* @param \Cake\Console\CommandCollection $commands The command collection to update | ||
* @return \Cake\Console\CommandCollection | ||
*/ | ||
public function console($commands); | ||
|
||
/** | ||
* Add a plugins middleware | ||
* Add middleware for the plugin. | ||
* | ||
* @param \Cake\Http\MiddlewareQueue $middleware The middleware queue to update. | ||
* @return \Cake\Http\MiddlewareQueue | ||
*/ | ||
public function middleware($middleware); | ||
|
||
/** | ||
* Add a routes | ||
* Add routes for the plugin. | ||
* | ||
* @param \Cake\Routing\RouteBuilder $routes The route builder to update. | ||
* @return \Cake\Routing\RouteBuilder | ||
*/ | ||
public function routes($routes); | ||
|
||
/** | ||
* Add events for the plugin. | ||
* | ||
* @param \Cake\Event\EventManager $events The application's event manager | ||
* @return void | ||
This comment has been minimized.
Sorry, something went wrong.
robertpustulka
Member
|
||
*/ | ||
public function events($events); | ||
This comment has been minimized.
Sorry, something went wrong.
robertpustulka
Member
|
||
|
||
/** | ||
* Disables the named hook | ||
* | ||
|
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
This should be added to the Server class bootstrap as well.