Quick search:

Warnings Wondering

pkellner
2005-08-11 21:09:35
 
For some reason, I'm not getting the error codes to report to the screen as I think I should based on settings in the classSite.php file.  So, trying to figure this out myself, I started debugging with Zend Studio which has been a big help for me in understanding php.  I'm getting crashes out of zend studio with errors like "can not redirect class pntpagepart" and others.  I notice that it reports tons of warnings.  Is this normal?  Is Zend Studio a reasonable way to find problems?

I've made a screen shot of my zend studio client with a typical list of warnings.  

http://www.73rdstreetdemo.com/misc/phpwarnings.jpg

Thanks again for the help.

-Peter
pkellner
2005-08-11 21:19:19
 
I forgot to mention that I did figure out my problem.  in classErrorHandler I need to change to localhost from 'ontwikkeling'.  My post above has more to do with wondering about the warnings and if they are affecting my debugging.

class ErrorHandler extends PntErrorHandler {
  var $developmentHost = 'ontwikkeling';
}
henk
2005-08-11 23:48:43
 
Hi Peter,

I can not resist to comment on these "warnings". If you tried pnt/unit you would also have seen tem. Formally they are "notifications" of type "E_STRICT". They are about our use of "depricated" php4 syntax and idiom. As you may have noticed phpPeanuts is currently in a trasitional state between php4 and php5: it runs on both, with equal functonality (hopefully). For portable code there is no way around most of these notifications: the new syntax is simply not going to compile on php4, some idioms have different functionality (also depending on zend.ze1_compatibility_mode setting)

It has surprised me that there has been so little attention for cross plafform code reuse on the www.php.net website and comp.lang.php. php.net seems to think of migration as a one way process. But for us it's not. The point is: phpPeanuts runs in many places and not everybody is ready to install php5, while others do not want to be stuck with php4. With respect to our own customers we can simply not force them to switch to php5. So let's face it: part of the applications are for some time going to be stuck in php4. But their maintenance does go on. Much of phpPeanuts' code is "factered out" from commercial applications, simply because of the "once and only once" requirement of Extreme Programming. This does not stop because one uses php4. Theoretically we could have chosen to maintain two code bases, but in practice that would heave resulted in part of the reusable code getting stuck in those application because nobody wants to spend time in porting it to the other platform, and later port the improvements back, etc etc.. This would substantially slow down phpPeanuts' development.

I suppose it is possible to configure Zend Studio not to schow E_STRICT notifications. Php itself has the error_reporting function for this. In  phpPeanuts' ErrorHandler you can set the reportingLevel the same way. If you set it to E_ALL, phpPeanuts' examples and tests should show no errors, warnings or notifications*. If you set it to (E_ALL | E_STRICT) the E_STRICT notifications will show up, but only those from you own code, the examples and tests. Those coming from the framework itself are allways filtered out. This allows you to make your own code conform to the strictest php5 standard while at the same time reuse the portable framework code without all those distracting E_STRICT notifications. Maybe if Zend Studio lets you define your own error handling you can do the same. If not i am afraid it is not an optimal environment for cross plafform code reuse.

Thanks for listening ;-)

Henk Verhoeven

* except for some tests that are meant to do so
Add a Reply
Loading form, please wait
The website will not send you an e-mail when a reply is added to this topic

Back to Topics List