Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Idea: maintenance flag file
  • This is an idea that I came across through Magento which I think is great and I'm using in all my apps now. When you drop a file called maintenance.flag into the public_html folder, Magento shows a 503 when any page is requested. I modified it so that any IP addresses listed in the file would still be allowed to view the site. Would there be any call for a feature in Fuel, that when maintenance.flag (or whatever) is dropped into public, it would throw a 503 in a defined view, so when you're making big changes there's no problems, especially useful for ecommerce sites. It's pretty much the first thing I do when I start a new project, so it would be nice if it came built in. Poo-poo it if you think it's pointless though!
  • I wouldn't be for it, as it would mean extra file I/O for every page request, ever for users that are never going to use it.
    If such a feature would be part of the core, the information has to go into the config file. But I think this should be an application level feature, not a framework feature. Most often you would want to display more than just an error, that's not very user friendly. Personally I use a rewrite rule, that I can activate in my .htaccess, that loads a stand-alone PHP file which displays a page using the correct site look-and-feel, and information about the maintenance period.
  • I'm agree with WanWizard. This is an application level feature ... you can store this option in a Db table with a maintenance page layout ( using something like WYSIWIG editor from and admin panel ) and then check this value on every page load ... if maintenance is true call layout from db table field and set 503 with response->status
  • The advantage of using a different file is that if say you happened to edit your .htaccess file, then you uploaded a new one, soon as it went through your site would be back open again, but I appreciate you'd remember that and not make changes to your .htaccess file like that. From what I could tell, a read request to a file is quicker than doing a database lookup. Thanks for the feedback, I'll keep it to myself ;)
  • Thomas Edwards wrote on Monday 13th of June 2011:
    The advantage of using a different file is that if say you happened to edit your .htaccess file, then you uploaded a new one, soon as it went through your site would be back open again, but I appreciate you'd remember that and not make changes to your .htaccess file like that. From what I could tell, a read request to a file is quicker than doing a database lookup. Thanks for the feedback, I'll keep it to myself ;)

    Well if you really need that you can always add a few lines of code in your app bootstrap.php file. That won't get overwritten when you update Fuel.
  • Daniel 0xff wrote on Monday 13th of June 2011:
    Thomas Edwards wrote on Monday 13th of June 2011:
    The advantage of using a different file is that if say you happened to edit your .htaccess file, then you uploaded a new one, soon as it went through your site would be back open again, but I appreciate you'd remember that and not make changes to your .htaccess file like that. From what I could tell, a read request to a file is quicker than doing a database lookup. Thanks for the feedback, I'll keep it to myself ;)

    Well if you really need that you can always add a few lines of code in your app bootstrap.php file. That won't get overwritten when you update Fuel.
    Neat idea, forgot that was in the app directory!

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion