-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
[5.1] Implement onAfterInitialiseRouter event #42692
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
LadySolveig
merged 18 commits into
joomla:5.1-dev
from
Hackwar:5.1-router-instantiation
Feb 25, 2024
Merged
Changes from 1 commit
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
bd148e7
Implement onAfterInitialiseRouter event
Hackwar 793ee88
Update libraries/src/Event/Router/RouterEvent.php
Hackwar 6fea9e7
Improving code
Hackwar fbf1268
Fixes
Hackwar e162698
Codestyle
Hackwar 1cb8bc3
Update LanguageFilter.php
Hackwar 2761333
Merge branch '5.1-dev' of https://github.com/joomla/joomla-cms into 5…
Hackwar 5c01e53
Refactoring to use service provider
Hackwar 5ef8538
Remove unused import
Hackwar 222e9ae
Load router from application
Hackwar 4fc0f7a
Reverting to internal router object
Hackwar 07c4e6a
Adding notice to global configuration for additional options in SEF p…
Hackwar 75cb319
Remove notification after rendering of SEO again.
Hackwar eafa7fa
Reverting changes for notice
Hackwar 7b1883d
Merge branch '5.1-dev' into 5.1-router-instantiation
LadySolveig 08cb516
Merge branch '5.1-dev' into 5.1-router-instantiation
LadySolveig 8448cd0
Merge branch '5.1-dev' into 5.1-router-instantiation
LadySolveig 7c49ff7
Merge branch '5.1-dev' into 5.1-router-instantiation
QuyTon File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,24 @@ | ||
| <?php | ||
|
|
||
| /** | ||
| * Joomla! Content Management System | ||
| * | ||
| * @copyright (C) 2024 Open Source Matters, Inc. <https://www.joomla.org> | ||
| * @license GNU General Public License version 2 or later; see LICENSE.txt | ||
| */ | ||
|
|
||
| namespace Joomla\CMS\Event\Router; | ||
|
|
||
| // phpcs:disable PSR1.Files.SideEffects | ||
|
|
||
| \defined('_JEXEC') or die; | ||
| // phpcs:enable PSR1.Files.SideEffects | ||
|
|
||
| /** | ||
| * Event class for AfterInitialiseRouter event | ||
| * | ||
| * @since __DEPLOY_VERSION__ | ||
| */ | ||
| class AfterInitialiseRouterEvent extends RouterEvent | ||
| { | ||
| } |
This file contains hidden or 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,70 @@ | ||
| <?php | ||
|
|
||
| /** | ||
| * Joomla! Content Management System | ||
| * | ||
| * @copyright (C) 2023 Open Source Matters, Inc. <https://www.joomla.org> | ||
| * @license GNU General Public License version 2 or later; see LICENSE.txt | ||
| */ | ||
|
|
||
| namespace Joomla\CMS\Event\Router; | ||
|
|
||
| use Joomla\CMS\Event\AbstractImmutableEvent; | ||
| use Joomla\CMS\Router\Router; | ||
|
|
||
| // phpcs:disable PSR1.Files.SideEffects | ||
| \defined('_JEXEC') or die; | ||
| // phpcs:enable PSR1.Files.SideEffects | ||
|
|
||
| /** | ||
| * Class for Application's Router events | ||
| * | ||
| * @since __DEPLOY_VERSION__ | ||
| */ | ||
| abstract class RouterEvent extends AbstractImmutableEvent | ||
| { | ||
| /** | ||
| * Constructor. | ||
| * | ||
| * @param string $name The event name. | ||
| * @param array $arguments The event arguments. | ||
| * | ||
| * @throws \BadMethodCallException | ||
| * | ||
| * @since __DEPLOY_VERSION__ | ||
| */ | ||
| public function __construct($name, array $arguments = []) | ||
| { | ||
| if (!\array_key_exists('router', $arguments)) { | ||
| throw new \BadMethodCallException("Argument 'router' of event {$name} is required but has not been provided"); | ||
| } | ||
|
|
||
| parent::__construct($name, $arguments); | ||
| } | ||
|
|
||
| /** | ||
| * Setter for the router argument. | ||
| * | ||
| * @param Router $value The value to set | ||
| * | ||
| * @return Router | ||
| * | ||
| * @since __DEPLOY_VERSION__ | ||
| */ | ||
| protected function onSetRouter(Router $value): Router | ||
| { | ||
| return $value; | ||
| } | ||
|
|
||
| /** | ||
| * Get the event's router object | ||
| * | ||
| * @return Router | ||
| * | ||
| * @since __DEPLOY_VERSION__ | ||
| */ | ||
| public function getRouter(): Router | ||
| { | ||
| return $this->arguments['router']; | ||
| } | ||
| } | ||
This file contains hidden or 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 hidden or 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 hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.