Tuesday 15 July 2014

.htaccess display_startup_errors setting depends on php script config file -


I am creating my own structure as a learning process, a config file, where people can set Whether the structure is in development or not.

  & lt; PHP $ project [security] [dev_mode] = true; ? & Gt;   

Display_startup_errors is defined in .htaccess, to indicate that syntax errors should be shown. I would like that if users do not need to mess with the .htaccess file, so that they can adjust the settings in the config file. Anyone if and how is any possible possible. Check the contents of the Htaccess php file and work accordingly?

A solution

try

  & lt ;? Php $ iDevMode = ($ project ['security'] ['dev_mode'])? 1: 0; Ini_set ('display_errors', $ iDevMode); ? & Gt;   

To toggle by definition This is an ugly ternary operation (you can convert it to a if statement for practice) and your program will need to process very soon.

Also keep in mind that a notice for encapsulating your associative array references in PHP quotation marks, as I have above.

No comments:

Post a Comment