averyvery/freeway — Issue #4: Optionally load routes from a file
Author: averyvery
Created: 2011-11-05 04:36:45+00:00
State: open

As it stands, Freeway loads all config options from the settings page. This is good for EE beginners, but more advanced users will wail and gnash their teeth. Reasons a PHP file would be better:

- Files can be version-controlled.
- Files are easier to edit. You can edit it them a text editor, add comments.
- Code is more powerful than text. You can programmatically create many routes with very little code; and even generate them based on external criteria (like environment vars, info from the DB, etc)

Four ways to accomplish this, but I'm leaning towards the first:
- Ask users to add freeway_routes.php to their /system/expressionengine/config dir.
-- Pros: This is where configs go.
-- Cons: Routes get wiped out if you don't update EE carefully.
- Put freeway_routes into the actual extension dir.
-- Pros: Easy to find, easy to remember.
-- Cons: Get wiped out if you don't update Freeway carefully.
- Ask users to supply a path to their freeway_routes file
-- Pros: Users can fit routes into their preferred setup.
-- Cons: Configuring a file path seems completely ridiculous. Seriously, doesn't EE have enough config vars that go wrong?
- Put routes into the config.php itself, as a new config var.
-- Pros: No new files.
-- Config.php gets overwritten by CP changes. It's not pleasant.