SO I have a simple file that I setup to define basic data which can vary from the site domain/name, to log constants. For some reason, if I don't include the file everything breaks due to undefined constants (which is correct). However, if I include the file, my cron job is crapping out and saying the constant is already defined. The site has no issue and the file is only included once.
What I've tried:
- Renaming the file and require statement to see if it was somewhere else and hope it would crap out saying the file could not be found, but no luck.
die(var_export(debug_backtrace(), true));in the config file, only reports the one time it's included when it should be.
if(defined("NAME")) return;in the top of the file (one of the constants in it). It just stops including and says the rest of the constants are missing.
- Searching the entire directory for another occurrence of NAME being defined, none for this project
This issue is driving me insane. I checked the file the cron job uses and it doesn't include anything, it's just a class. The way it used to be was a config.php was in the main www folder and was included by the front index.php file. For some reason, the cron job doesn't work properly and the index.php isn't executed, even though the code all runs.
The main core of the issue centralizes around cron jobs with CodeIgniter not running, which is stupid. The cron works if I run it via SSH, however the cron task itself doesn't seem to work correctly. Additionally, parameters are not passed via cron jobs, only by SSH. I don't know if this is CodeIgniter's fault or my hosting company, but I'd prefer to get a few other opinions before bugging my hosting provider about it again.