Wrench for FuelPHP
If you have been following what I've been up to lately you would see that many of my recent projects are based on FuelPHP. Since Fuel is so awesome and allows you to create "packages" that can be dropped into your application, I have created a few that help me quickly piece together apps. The first package I'm "releasing" is called Wrench.
Wrench is a simple command line task to take your app offline for a period of maintenance. Using the oil utility included in fuel, simply run "php oil r wrench" to toggle your app offline/online. This command takes the current state of the site into account and will switch to the opposite when run.
If you would like more control of which action is actually being run (in case of command failure), you can add :start (to take down) or :finish (to bring back online your site).
Your front end users will see a screen similar to this when viewing your app, allowing you to run any migrations, deployment scripts, or configuration changes before you want users interacting with the codebase.
To add this package to your fuel install you must do a few things,
- add github.com/tomschlick to the "sources" array in your app/config/package.php config file (if it does not exist yet use this one).
- run "php oil package install wrench"
- add "wrench" to the "always_load" packages & classes arrays
- use it!