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

Optionally load routes from a file #4

Open
averyvery opened this issue Nov 5, 2011 · 4 comments
Open

Optionally load routes from a file #4

averyvery opened this issue Nov 5, 2011 · 4 comments

Comments

@averyvery
Copy link
Owner

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. By iterating, you can make a ton of routes with very little code; 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.
    • Cons: Adding non-standard config vars seems like a recipe for trouble. Config.php gets automatically rewritten sometimes.
@sjelfull
Copy link

sjelfull commented Nov 5, 2011

The first point works the best with my bootstrap setup, based on NSM Bootstrap config. You put it in the config/ folder, and include the bootstrap at the end of the config file. Then you override any of the variables at will.

@jeremygimbel
Copy link

I would agree with the first option. And as a second choice, the last one.

@averyvery
Copy link
Owner Author

You guys are the best kind of issue commenters — the kind that agree with me. THANKS!

@averyvery
Copy link
Owner Author

This feature is coming in the next version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants