PhileCMS / Phile

A flat file CMS with a swappable parser and template engine.
https://philecms.github.io/
Other
255 stars 48 forks source link

[FEATURE] Set content directory and extension in config #310

Closed Schlaefer closed 6 years ago

Schlaefer commented 6 years ago

Content directory (content/) and extension (.md) are currently set as a global constant via define(). This makes it cumbersome to change them in a local installation. It would be much more convenient to set them as config.php parameter. This also opens up additional opportunities for plugins and allows testing.

As both of those parameters are used late in the request cycle/after the core bootstrapped, I don't see any problem to set them as config.php parameter.

The only drawback is that it may break existing plugin code. On the other hand it's easy to fix, just replace CONTENT_DIR with Registry::get('Phile_Settings')['content_dir'] or CONTENT_EXT with Registry::get('Phile_Settings')['content_ext'].