Post by chomp » Mon Feb 26, 2007 1:32 am

use output buffer w/ gz handler
turn off e_all error reporting
stop using @ to supress errors write a custom error handler

New member

Posts

Joined
Sat Feb 24, 2007 7:19 am

Post by chomp » Thu Mar 01, 2007 7:05 am

when using glob, use *.php so things like file.php.bak are not included.

glob(DIR_MODULE . '*.php')

New member

Posts

Joined
Sat Feb 24, 2007 7:19 am

Post by Daniel » Thu Mar 08, 2007 7:20 pm

The output buffer  with gz handler is a good idea.

I don't feel there is anything wrong with using @ for stopping errors. PHP would not have included this feature if they did not want us to use it.

I only use it for vaiables that and might not be set.

error reporting full on is good because it shows you coding mistakes and can stop hackers exploiting open variables.

OpenCart®
Project Owner & Developer.


User avatar
Administrator

Posts

Joined
Fri Nov 03, 2006 6:57 pm

Post by chomp » Sat Mar 17, 2007 4:43 pm

well, that's what i don't understand, why not turn error reporting off (in the admin config) for a live site? I'm talking about php's function to display errors or to silently log them. the only good time to use @ is when you want to be lazy and allow an error rather than trap it. for example, instead of doing something like if (!$var) { do or don't do something } you'd prefer @$var.

New member

Posts

Joined
Sat Feb 24, 2007 7:19 am

Post by Mark Dyer » Fri Jun 01, 2007 1:40 pm

I would recommened that the error_reporting is E_ALL and have an optional option that when site is live that it is turned off.

The reason is so you can address any issues and not be a lazy programmer.. @ works but it not a good habbit.. I suggest the following as a suggestion maybe. It's rough but it shows the point



or if you doing if statements if(is_defined('content',$value)){

Just have the function look after the error checking isset and comparasion etc.

User avatar
New member

Posts

Joined
Thu May 31, 2007 10:07 pm

Post by chomp » Sun Jun 10, 2007 9:05 am

or just define all of your vars

$data = array();
$config_item = null;

Then if you catch a notice you can debug it.

New member

Posts

Joined
Sat Feb 24, 2007 7:19 am

Post by Mark Dyer » Mon Jun 11, 2007 2:49 am

If output buffer w/ gz handler was setup. Please can it be optional as our server does this by default..

Thanks

User avatar
New member

Posts

Joined
Thu May 31, 2007 10:07 pm

Post by Daniel » Mon Jun 11, 2007 8:41 pm

This feature has been added aswell.

OpenCart®
Project Owner & Developer.


User avatar
Administrator

Posts

Joined
Fri Nov 03, 2006 6:57 pm
Who is online

Users browsing this forum: No registered users and 1 guest