Closed mayamcdougall closed 8 years ago
Pico's sample config is 58 lines... NotePaper's is 98 lines! :laughing:
No specific plans for that at the moment, but maybe we'll replace the config.php
in a future release with a config.ini
or config.yml
. A more generic/better solution for Pico's core may be to include all files in the config/
directory with a specific file extension (i.e. Pico loads a config/NotePaper.config.php
automatically). Do you want to create a new Issue for that?
Well, I'm glad you like the idea, but I actually meant just for NotePaper. I just wanted to check if it was okay to use something like include 'NotePaper-Config.php';
for my upcoming release or if you saw / knew of any problem with that. It should be fine then?
If it's something you'd like to create an issue about, I'll do that. One thing to keep in mind though, users may keep a backup of config-sample.php
in their config folder and you wouldn't want to load that accidentally. (It could be renamed something like config.sample though).
Also, if something like this were implemented, plugins could also have their own config files, since they often seem to have some variables that need adding. This could be handy for upgrading individual components as well, since you wouldn't need to touch your Pico config if you're only updating a plugin or theme.
Also, perhaps a more user-friendly scheme like you suggested... as long as I can still make arrays. config.NotePaper.feature.option
is very easy to remember when coding. :wink:
I'll make a Pico issue of it sometime tomorrow when I can write something more coherent (it's late for me). On a side note, I just realized your timezone is 6 hours ahead of mine. I knew there was a difference, but I'd never thought about how big it was. Definitely explains why I only see you on here at certain times of day. :sweat_smile:
Just a final check though. You have no problems with me suggesting include 'NotePaper-Config.php';
in my readme? :+1: :question:
Well, I'm glad you like the idea, but I actually meant just for NotePaper.
Sure, I had understood that :wink: That's why feedback is so important. Feedback stimulates a discussion and brings up new ideas (even for completely different things) and alternative solutions :smiley:
I just realized your timezone is 6 hours ahead of mine
Yeah. :smile: In practice the difference usually is no big problem, I often work very late at night, so it's evening for you.
Just a final check though. You have no problems with me suggesting
include 'NotePaper-Config.php';
in my readme?
In the meantime that's just fine, yes :+1:
Yeah, but it could be confusing when I say "tomorrow" but you're already at 4am. :laughing: Thanks for clarifying that. I think I'm going to put both the "includes" and the "copy and paste" method in the readme and leave it up to the user.
I'll write up the Modular Config idea as an Issue in a little bit.
Okay, I created https://github.com/picocms/Pico/issues/330. :+1:
Thank you! :+1:
So, NotePaper has a lot of configuration options. They're in an array to make it easier to reference them in Twig, and also to make them a little neater. In preview versions, the sample config was part of the readme. In
1.5
, it's going to be a separate sample file.When writing the readme, I felt it sounded really messy to say "Copy the config snippet from the sample file and paste it into your Pico config".
So then I had an idea: Why not use PHP's
include
to import a second config file, keeping all the NotePaper stuff separate? Instead of copying a large array of options, you could simply add something like this to your Pico Config:include 'NotePaper-Config.php';
@PhrozenByte Would this be acceptable / in line with your idea* of how Pico should work? (*couldn't think of a better way to phrase that). If so, are there any downsides or catches I should be aware of? Thanks in advance. :wink: