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

Per-site extenders #1559

Closed
franzliedke opened this issue Aug 23, 2018 · 1 comment
Closed

Per-site extenders #1559

franzliedke opened this issue Aug 23, 2018 · 1 comment

Comments

@franzliedke
Copy link
Contributor

Add an extend.php file to the flarum/flarum skeleton as well, that will allow quickly plugging in some custom assets or even bits of functionality that's specific to an individual installation of Flarum.

This will replace the need for packaging up custom extensions just to install them on one site. (Useful for branding and site integrations, I hope.)

For bigger things, we can even add a src directory with PSR-0 autoloading support (because we cannot know the namespace of the individual site).

These extenders will be loaded in Site and passed to our InstalledSite class, which will merge them with the extenders from all enabled extensions. A hypothetical Laravel integration could load them from somewhere else (a file, tagged bindings in the IoC container), before instantiating that InstalledSite class.

@franzliedke
Copy link
Contributor Author

Implemented this for beta.8, because it makes starting simple easier in the extension docs (#1000).

If we decide we want to offer a directory with autoloading by default, we can add that in a later release.

franzliedke added a commit to flarum/docs that referenced this issue Sep 21, 2018
I want this to start with the most simple example possible. And since
the introduction of flarum/framework#1559 (per-site extenders), this does not
even require explaining extensions.

After that, I'd like to continue with the most simple extensions
possible (everything in one extender file), before moving on to where to
put classes if you want to structure your extension code as it gets
larger.

Refs flarum/framework#1000.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant