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

Load config and register providers #15

Merged
merged 2 commits into from
May 13, 2019

Conversation

kellymears
Copy link
Member

Added two private methods to SageServiceProvider in order to load the Sage app configuration and register the providers from the providers array.

Addresses #14 .

Added two private methods to SageServiceProvider to load the Sage app configuration and register the providers from the 'Providers' array.

Addresses roots#14.
@QWp6t
Copy link
Sponsor Member

QWp6t commented May 12, 2019

ServiceProvider already has a mergeConfigFrom() method that can be used (sidenote: there's also loadViewsFrom()). I want there to be a single authority where a user can override any config files, and it needs to be configurable. Right now that's supposed to be <basepath>/config, and when Sage is found, the basepath is set to the theme folder. In short, we should use $this->mergeConfigFrom() as needed, but in this case, it's actually not needed since the config file is already getting loaded.

As for app providers not being loaded, that was a bug that I accidentally introduced a couple months ago when I pushed a bunch of updates. It should probably be handled either in a separate Bootstrap or within Application.php itself (or both). Feel free to refactor the PR if you want and I'll be happy to merge it. (note: this is how I used to handle it)

Registration of configurable service providers is removed from `Acorn\Sage\SageServiceProvider` and added to `Acorn\Application`.

Adds a new bootstrap class to call this method: `Acorn\Bootstrap\RegisterProviders`. This bootstrap class has been added to the `$bootstrap` array in the `bootloader()` function of `src/helpers.php`.

With this change configurable service providers are successfully registered and booted based on the `providers` inventory in `config/app.php`.
@kellymears
Copy link
Member Author

It's straight up a privilege to have a chance to contribute to this awesome thing you've built.

As requested (let me know if I've misinterpreted anything):

Registration of configurable service providers is removed from Acorn\Sage\SageServiceProvider and added to Acorn\Application.

Adds a new bootstrap class to call this method: Acorn\Bootstrap\RegisterProviders. This bootstrap class has been added to the $bootstrap array in the bootloader() function of src/helpers.php.

With this change configurable service providers are successfully registered and booted based on the providers inventory in config/app.php.

@QWp6t
Copy link
Sponsor Member

QWp6t commented May 13, 2019

Awesome dude! Thanks a bunch for helping with this. I haven't had a chance to revisit the Acorn stuff for a while, but I plan on getting to it sometime next week.

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.

None yet

2 participants