Why not just implement the __autoload function and handle the require_once for the Exception class there?
On Dec 14, 2007 4:19 PM, Jordan Moore <[EMAIL PROTECTED]> wrote: > It's at the throw, not at instantiation. > > On Dec 14, 2007 12:14 PM, Ralph Schindler <[EMAIL PROTECTED]> wrote: > > I'm just going off memory right now, but I think stack traces for > > exception objects are wound up from the point which they are created, > > not the point which they are thrown from. So this would mean that when > > you look at the trace from the exception, it originates from the > > getException method, rather than the place you are wanting to throw it > from. > > > > > > -ralph > > > > > > Shekar C Reddy wrote: > > > I would suggest to incorporate a method that serves as a central > > > location to instantiate exception objects - a *consistent > > > *object-instantiation system, if you will. This method could go inside > > > a class that is always required/loaded so we don't have to include > > > another file just for this purpose. Zend_Loader, maybe? This approach > > > allows us to add more processing/error-handling logic to the method in > > > future that ripples across the framework: > > > > > > > ////////////////////////////////////////////////////////////////////////// > > > static function getException( $class, $message = 'ERROR', $code = 0, > ... ) > > > > ////////////////////////////////////////////////////////////////////////// > > > { > > > self::loadClass( $class ); > > > // > > > // Or straight require_once for performance, but then format the > > > class-name to instantiate... > > > // require_once( $class ); > > > // > > > return new $class( $message, $code, ... ); > > > -- Craig Slusher [EMAIL PROTECTED]