I have a rather interesting problem. I use FileZilla and Notepad++ to edit my PHP scripts. One script, called
functions.php, is edited and changed a lot. Unfortunately, everytime I edit it and reupload it, I check my error log and find that about 5 errors were thrown across my site every time I reupload. It only takes a few seconds, but since the script is included in about every page on my website, that few seconds is enough to throw errors.
I was thinking that, perhaps, I could have a
functions2.php that would be basically the same. Would there be a way for the scripts on my site to grab
functions.php is not available? Thanks.
EDIT: The error I get is usually something like “Parse error: syntax error, unexpected $end…” which I believe implies that the script is just partially uploaded. This might make file_exists not the best solution, since the file is THERE but it is only ‘halfway’ there.
Uploading and renaming seems like a good solution, but it is a bit tedious for every upload I reupload and test a lot.
Is there a way to check a php file for PHP syntax errors? This would be quite handy in thise case…