Sagewire Logo

General Advice - objects, classes and coding style

5 Message(s) by 5 Author(s) originally posted in php programming


From: turnitup Date:   Wednesday, October 24, 2007
I am in the process of transforming a procedural code base into an OO
code base. The code lends itself to this refactoring and it is proving
an effective exercise.

However, I am running into a few irritations.

I am using __autoload to load class file s corresponding to code names.

I have cranked up error reporting, but if for some reason there is a
syntax error or whatever in a class, the application crashes with no
explanation. The bug hunt takes ages and lots of echoing.

Is there anything I can do to help myself? Use of assert, or exceptions,
or try-catch handling?


From: Jerry Stuckle Date:   Wednesday, October 24, 2007
wrote in message :
I am in the process of transforming a procedural code base into an OO
code base. The code lends itself to this refactoring and it is proving
an effective exercise.
However, I am running into a few irritations.
I am using __autoload to load class files corresponding to code names.
I have cranked up error reporting, but if for some reason there is a
syntax error or whatever in a class, the application crashes with no
explanation. The bug hunt takes ages and lots of echoing.
Is there anything I can do to help myself? Use of assert, or exceptions,
or try-catch handling?


Personally, I do not use __autoload. It is not that hard to add
require_once statements where necessary.--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@xxxxxxxxxxx
==================


From: AnrDaemon Date:   Wednesday, October 24, 2007
Greetings, turnitup.
In reply to Your message dated Thursday, October 25, 2007, 00:52:55,

t> I am in the process of transforming a procedural code base into an OO
t> code base. The code lends itself to this refactoring and it is proving
t> an effective exercise.

t> However, I am running into a few irritations.

t> I am using __autoload to load class files corresponding to code names.

t> I have cranked up error reporting, but if for some reason there is a
t> syntax error or whatever in a class, the application crashes with no
t> explanation. The bug hunt takes ages and lots of echoing.

t> Is there anything I can do to help myself? Use of assert, or exceptions,
t> or try-catch handling?

Did You read user comments on Autoloading Objects article?
http://ru2.php.net/autoload
There's some useful info and good examples.--
Sincerely Yours, AnrDaemon <anrdaemon@xxxxxxxxxxx>


From: ZeldorBlat Date:   Wednesday, October 24, 2007
wrote in message:
I am in the process of transforming a procedural code base into an OO
code base. The code lends itself to this refactoring and it is proving
an effective exercise.
However, I am running into a few irritations.
I am using __autoload to load class files corresponding to code names.
I have cranked up error reporting, but if for some reason there is a
syntax error or whatever in a class, the application crashes with no
explanation. The bug hunt takes ages and lots of echoing.
Is there anything I can do to help myself? Use of assert, or exceptions,
or try-catch handling?



You might've turned up error reporting, but did you enable display
errors? If not you won't see them. You should always enable
display_errors when developing, and disable it in production. In
production use log_errors so your error messages go to a file instead.


From: JustinCarmony Date:   Thursday, October 25, 2007
wrote in message:
I am in the process of transforming a procedural code base into an OO
code base. The code lends itself to this refactoring and it is proving
an effective exercise.
However, I am running into a few irritations.
I am using __autoload to load class files corresponding to code names.
I have cranked up error reporting, but if for some reason there is a
syntax error or whatever in a class, the application crashes with no
explanation. The bug hunt takes ages and lots of echoing.
Is there anything I can do to help myself? Use of assert, or exceptions,
or try-catch handling?



I'd definitely check your php.ini's Error Reporting settings. To
find out what your PHP's settings are, you can make a new php file and
put:

<?php
echo phpinfo();
?>


It'll show you where your php.ini file is, as well as your
display_error settings.



Next Message: What does @xxxxxxxxxxx do?


Blogs related to General Advice - objects, classes and coding style

RE: Zend_Service_PayPal - Shahar Evron
Zend_Currency, Zend_Auth, Zend_Log); Milestone 3: Working prototype for DoDirectPayment and ExpressCheckout calls, along with container classes for common data objects; Milestone 4: Unit tests exist, work, and are checked into SVN. ...

the documents are xoops only accessible for those they are shared ...
I much more worry about Fatal error: Call to a member function GetContent() on a non-object in /home/ext/html/o2redsea.com/modules/Cataloger/Cataloger.module.php on line 301 right now. svn version? because I’m looking at that code and ...

[Bakmadan Geçmeyin!:20947] Re: Web tasarımcısı için +479 Kaynak site
Net: Links; WebMonkey: PHP; Web Design Reference: PHP; DevShed - PHP Articles; PHP Coding Standard; PHP FAQ; Zend: PHP Tutorials; Easier Form Validation with PHP; alt.php faq; PHP Security Mistakes; Develop rock-solid code in PHP: Lay ...

action add book guest inurl org php site
action add book guest inurl nu php site action add book guest inurl org php site action add book guest inurl ph php site action add book guest inurl php pl site action add book guest inurl php sa site action add book guest inurl php ...

Training
tufts strong living program instructor training lynne jones midaswell training dog+training+classes%2c+college+park%2c+maryland strenght training workouts bidwell training center dog flyball training horse training northampton pa reliv ...

tvu work
There are several lines you can comment/uncomment to see the object magpierss returns. The current example is set to return the results of a blogger feed. With some extra code one can detect the feed and provide summaries accordingly… ...


Programming | Sports | Autos

copyright 2006
Valid XHTML 1.0 Transitional