Skip to content
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

[8.x] move maintenance mode logic #40072

Closed
wants to merge 1 commit into from
Closed

[8.x] move maintenance mode logic #40072

wants to merge 1 commit into from

Conversation

wimulkeman
Copy link
Contributor

Moving the maintenance mode logic to its own class. This enables users to extend/overwrite the class with their own logic.

Overwriting the logic may be needed if for example the application is run on multiple servers. In this case the developer would want to extend the storage logic for the maintenance mode to implement a solution that can change the maintenance state for all the servers at once and reverse the maintenance mode with one command.

By separating the maintenance mode logic the framework opens the door for packages that could handle the maintenance mode through different mechanisms like using the cache (as proposed in a blog https://www.raypold.com/posts/laravel-distributed-maintenance-mode/).

The need for this was shown within the discussions laravel/ideas#1944 and #36474.

Fixes #36474

This PR is a follow-up to the PR #40070 with suggested changes and pointed to the master instead of the 8.x branch because it contains backward incompatible changes.

Moving the maintenance mode logic to its own class. This enables users to extend/overwrite the class with their own logic.

Overwriting the logic may be needed if for example the application is running on multiple servers.

Fixes #36474
@wimulkeman wimulkeman closed this Dec 16, 2021
*
* @return \Illuminate\Foundation\MaintenanceMode
*/
public function maintenanceMode();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Forgot to mention but you'll need to remove this change since this is still a breaking change.

Copy link
Contributor Author

@wimulkeman wimulkeman Dec 16, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest in that case to leave the PR to 9.x open instead. Introducing the method without updating the interface feels invalid to me.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah that's okay 👍

@wimulkeman wimulkeman deleted the #36474_enable_overwriting_maintenance_methods branch January 7, 2022 16:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants