Welcome Guest, Not a member yet? Register   Sign In
problems implementing post_controller hook [SOLVED]
#1

[eluser]b.rad[/eluser]
I'm removing this post so as to avoid wasting anyone's time reading it... After taking a break and revisiting the errors, I solved my problem.
#2

[eluser]b.rad[/eluser]
Ok, I figured it out. I won't bore everyone with the details, but suffice it to say it was my fault -- in short, I forgot a comma at the end of one item in an array definition.

I'd still be interested to know if anyone has any insight re: how best to track down these types of errors...
#3

[eluser]tonanbarbarian[/eluser]
turning on full error reporting in PHP would have found the issue in this case
it would have come back with something like unexpected T_STRING
this assumes that the error was caused by something like
Code:
$x = array(
'first'=>'value1',
'second'=>'value2'
'third'=>'value3'
);
If however you mistakingly had a full stop rather than a comma it would not have been able to be found anyway except for a code review

There are a few rules that ALL PHP developers should use when developing
1. set error reporting to E_ALL, and fix or resolve all error, i.e. do not use @ to suppress an error if possible
2. disable asp and short tags in PHP.ini to ensure you always use full PHP tags, i.e. <?php ?>. This ensures that the code you write will function on any PHP configuration
3. optionally try setting your memory_limit in PHP down as low as possible. For code that might run on old hosting servers try setting this back to the PHP 4 default of 8M.
This last one is probably controversial but if you code for the least amount of memory possible your site will run fast and should run on any server config.




Theme © iAndrew 2016 - Forum software by © MyBB