Welcome Guest, Not a member yet? Register   Sign In
Make definitions safer
#3

(10-18-2016, 11:56 AM)ciadmin Wrote: Have you modified index.php? The first line in the default CI3.1.0 one defines the ENVIRONMENT constant.

I did. It seemed like the best place to load my bootstrap file. (only line I added)
My bootstrap file does:
- Headers setup (allow-origin, allow-methods, allow-headers)
- 'die' for OPTIONS requests (preflight requests should not be processed)
- Load from a JSON config file that is generated using an init process, and is different between servers, into constant definitions

I understand this is not the most ordinary case, because I am basically running a bootstrap code outside/before CI is loading, but I still think, that the case doesn't matter, and like before every function you write `if(!function_exists('is_php'))` that before every definition there would be a `!defined`

Specifically for my case, if you are interested to know, I load the settings from a config file, because I bring up machines and replications and stuff with a very simple process, and modifying the JSON file is a piece of cake compared to htaccess, because I am working both with Apache and with nginx. So I wanna be prepared for every scenario
Reply


Messages In This Thread
Make definitions safer - by AmitMY - 10-18-2016, 10:50 AM
RE: Make definitions safer - by ciadmin - 10-18-2016, 11:56 AM
RE: Make definitions safer - by AmitMY - 10-20-2016, 02:02 PM



Theme © iAndrew 2016 - Forum software by © MyBB