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

[5.x] Add hook into the multisite command #11458

Merged
merged 3 commits into from
Feb 17, 2025
Merged

Conversation

duncanmcclean
Copy link
Member

@duncanmcclean duncanmcclean commented Feb 14, 2025

This pull request adds a hook to the php please multisite command, allowing addon developers to run their own code when a site is being converted from a single site to a multisite.

For example:

// ServiceProvider.php

public function bootAddon()
{
    Multisite::hook('after', function ($payload, $next) {
        // Maybe move some files around...
        // Update a config file or two...

        $this->components->info('Done some multisite magic!');

        return $next($payload);
    });
}

I'm not totally sold on the name of the hook (end). I'm sure we can come up with a better name. Named it after.

@edalzell
Copy link
Contributor

after?

@jasonvarga jasonvarga merged commit 69fb5f5 into 5.x Feb 17, 2025
20 checks passed
@jasonvarga jasonvarga deleted the multisite-command-hook branch February 17, 2025 21:39
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.

3 participants