Annoyed with lack of debugging features in CodeIgniter. Am I doing something wrong?
I am doing a lot of development with CodeIgniter these days and I am extremely开发者_高级运维 irriated with the lack of debugging features in CI.
It does throw errors if a view file is missing and so on. But when I forget to put a semicolon somewhere it simply does not throw any error.
I ensured now and again that error level is set to E_ALL, I checked the logs but nowhere the syntax errors are getting captured. This wastes a lot of my time.
I find that the best way to deal with this situation is to use an editor with PHP syntax checking. From the command line you can also run
php -l filename.php
to syntax check your file.
You can turn on syntax error reporting in your php.ini, but it is disabled by default.
set
display_errors on
along with your
error_reporting E_ALL
One alternative is to use an IDE like Eclipse in debug mode to step through the code. Once Eclipse is set up properly, it can step through trace points and display the status of each operation, line by line. It can be a real time saver.
If you have actual syntax errors in your PHP, I don't think there's any way for a PHP framework, such as CodeIgniter, to catch them.
精彩评论