-
Notifications
You must be signed in to change notification settings - Fork 296
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
Configuration issue with bootstrapping activated #753
Comments
I don't think we need to create a Configuration class, we could place it at Plugin class. We could also use a normal check before loading the files at bootstrap. if (Configure::read('Users.skipLoadConfiguration') !== true ) {
......
} @ravage84 when are you planning to send a pull request? |
@rochamarcelo something like this could work, too. |
It seems that with Application::pluginBootstrap you should be able to handle this fine. I would say we good to close this one, what do you think @ravage84 ? |
To be honest, I'm not quite sure what you mean by that. Currently, the solution proposed at #753 (comment) seems to be the best. |
You can load your configuration before or after plugin bootstrap |
Unfortunately, this is not really an option. This would mean our application(s) has to wrap around the way CakeDC users plugin wants to work. 😞 |
You can also manually bootstrap the plugin but the bootstrap logic only makes sense to be hooked for configurations setup. So for your case the bootstrap logic does not add much. https://github.com/CakeDC/users/blob/master/config/bootstrap.php |
Was this or can this be improved in the newer version(s)? I would appreciate if we wouldn't need to do a manual bootstrap or some workaround. |
@rochamarcelo is this still valid? should we make a improvement here? |
In our applications, we have a three level configuration system:
The latter merges with and overwrites the former.
We load these configuration settings during the application bootstrap process, before loading any plugins.
By the time we load the users plugin at the end of the application's
bootstrap.php
, we have loaded all configuration settings. That could include settings specific to plugins.By loading the users plugin with bootstrapping activated as recommended in the documentation:
It will also load a) the plugin default configuration and b) custom configuration files specified in the
config
key:https://github.com/CakeDC/users/blob/8.0.3/config/bootstrap.php#L20-L23
This leads to our configuration settings being reset by the plugin's default configuration:
https://github.com/CakeDC/users/blob/master/config/users.php
I'm aware that there are currently two solutions for us:
Both solutions aren't very nice, though.
Could we extract the two lines loading the configuration from the current
bootstrap.php
to methods available through a class within the plugin? All the rest within this file stays the same.https://github.com/CakeDC/users/blob/8.0.3/config/bootstrap.php#L20-L23
So loading the plugin, bootstrapping it and loading its configuration would become this:
Alternatively, we could use a new plugin specific key like
config
:The text was updated successfully, but these errors were encountered: