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

[Feature Idea] Modular Config #330

Closed
mayamcdougall opened this issue Feb 27, 2016 · 2 comments
Closed

[Feature Idea] Modular Config #330

mayamcdougall opened this issue Feb 27, 2016 · 2 comments

Comments

@mayamcdougall
Copy link
Collaborator

Here's a brainstorm of ideas for improving Pico's config system and making it modular.

  • Process all files in the config folder.
    • Loading order shouldn't matter. Any file should be of equal importance, and not nested together.
    • Depending on how this system works, Pico's core config could either be loaded at any time or prioritized to load first. If done right, I feel this shouldn't matter.
    • Rename Pico's core config to 'core-config.php' or whatever new file extension is decided on.
    • Make sure not to load any sample files. Perhaps standardize the naming scheme of samples for future plugins and themes. (For some reason, I really want to call 'plugins and themes' 'extensions').
    • Pros
      • This would allow users to update the config for their themes and plugins without touching their main Pico config.
      • It would also make removal of plugins and themes easier due to their config being stored separately and easily deleted.
    • Cons
      • This could result in unintentional loading of files (misplaced, misconfigured, or left behind).
  • Switch Pico's config to another format.
    • Use something more user-friendly than PHP for configuration?
    • Preferably something more error-tolerant? Something where a single missing comma cannot bring down an entire Pico site.
    • Despite format change, keep configuration just as powerful. Make sure not to lose abilities, such as making arrays, that plugin and theme developers may rely on.
    • Pros
      • A new format could make Pico's configuration easier for new users.
      • It could make plugin and theme development easier.
    • Cons
      • Changing it could estrange developers, especially if they found it less powerful than PHP.
@PhrozenByte PhrozenByte mentioned this issue Mar 3, 2016
41 tasks
PhrozenByte added a commit that referenced this issue Mar 6, 2016
Resolves #330

After loading the `config/config.php`, Pico proceeds with any existing `config/*.config.php` in alphabetical order. The file order is crucial: Config values which has been set already, cannot be overwritten by a succeeding file. This is also true for arrays, i.e. when specifying `$config['test'] = array('foo' => 'bar')` in `config/a.config.php` and `$config['test'] = array('baz' => 42)` in `config/b.config.php`, `$config['test']['baz']` will be undefined
@PhrozenByte PhrozenByte added this to the Version 1.1.0 milestone Mar 6, 2016
@PhrozenByte
Copy link
Collaborator

This feature will be shipped with Pico 1.1, see 988a23f for implementation details. For feedback about this feature, please refer to #334. Thanks @smcdougall for bringing this up!

@PhrozenByte
Copy link
Collaborator

Update: This feature will still be shipped with Pico 1.1 2.0, however, with a different approach. See 9b7523b for implementation details. For feedback about this feature, please refer to #334. Thanks @smcdougall for further feedback about this there!

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

2 participants