Re: [PHP-DEV] Re: [RFC] Autoloader Error Handling

2011-11-25 Thread Larry Garfield
On 11/25/2011 04:21 AM, Sebastian Krebs wrote: 2011/11/25 Ferenc Kovacs The problem with fatal, that you have no way (by the standard means, but you can somehow manage it through the usage of output buffers or register_shutdown_function, but thats ugly, and can change in the future) to intercep

Re: [PHP-DEV] Re: [RFC] Autoloader Error Handling

2011-11-25 Thread Christian Kaps
Am 25.11.2011 13:34, schrieb Ferenc Kovacs: On Fri, Nov 25, 2011 at 1:28 PM, Christian Kaps wrote: Am 25.11.2011 13:13, schrieb Ferenc Kovacs: On Fri, Nov 25, 2011 at 12:56 PM, Christian Kaps **wrote: I surround my application with a try/catch block to catch uncaught exceptions. An autoloa

Re: [PHP-DEV] Re: [RFC] Autoloader Error Handling

2011-11-25 Thread Ferenc Kovacs
On Fri, Nov 25, 2011 at 1:28 PM, Christian Kaps wrote: > Am 25.11.2011 13:13, schrieb Ferenc Kovacs: > >> On Fri, Nov 25, 2011 at 12:56 PM, Christian Kaps >> **wrote: >> >> I surround my application with a try/catch block to catch uncaught >>> exceptions. An autoloader exception could be one of t

Re: [PHP-DEV] Re: [RFC] Autoloader Error Handling

2011-11-25 Thread Christian Kaps
Am 25.11.2011 13:13, schrieb Ferenc Kovacs: On Fri, Nov 25, 2011 at 12:56 PM, Christian Kaps wrote: I surround my application with a try/catch block to catch uncaught exceptions. An autoloader exception could be one of them. But I use also similar calls to reformat error messages. try { $cl

Re: [PHP-DEV] Re: [RFC] Autoloader Error Handling

2011-11-25 Thread Ferenc Kovacs
On Fri, Nov 25, 2011 at 12:56 PM, Christian Kaps wrote: > I surround my application with a try/catch block to catch uncaught > exceptions. An autoloader exception could be one of them. > > But I use also similar calls to reformat error messages. > > try { > $class = new ReflectionClass($**annota

Re: [PHP-DEV] Re: [RFC] Autoloader Error Handling

2011-11-25 Thread Christian Kaps
Can we stay on topic please. At this time I count a vast number of mails, but never has talked about the RFC. Fact is that these three cases, how a autoloader terminates, exists in PHP. If all these cases are useful is an other topic. Can we all agree on this? Am 25.11.2011 11:21, schrieb S

Re: [PHP-DEV] Re: [RFC] Autoloader Error Handling

2011-11-25 Thread Christian Kaps
I surround my application with a try/catch block to catch uncaught exceptions. An autoloader exception could be one of them. But I use also similar calls to reformat error messages. try { $class = new ReflectionClass($annotationName); } catch (ClassNotFoundException $e) { $message = "The

Re: [PHP-DEV] Re: [RFC] Autoloader Error Handling

2011-11-25 Thread Ferenc Kovacs
On Fri, Nov 25, 2011 at 11:21 AM, Sebastian Krebs wrote: > 2011/11/25 Ferenc Kovacs > > > The problem with fatal, that you have no way (by the standard means, but > > you can somehow manage it through the usage of output buffers or > > register_shutdown_function, but thats ugly, and can change in

Re: [PHP-DEV] Re: [RFC] Autoloader Error Handling

2011-11-25 Thread Sebastian Krebs
2011/11/25 Ferenc Kovacs > The problem with fatal, that you have no way (by the standard means, but > you can somehow manage it through the usage of output buffers or > register_shutdown_function, but thats ugly, and can change in the future) > to intercept and gracefully terminate your applicati

Re: [PHP-DEV] Re: [RFC] Autoloader Error Handling

2011-11-25 Thread Ferenc Kovacs
The problem with fatal, that you have no way (by the standard means, but you can somehow manage it through the usage of output buffers or register_shutdown_function, but thats ugly, and can change in the future) to intercept and gracefully terminate your application, which is an often needed featur

Re: [PHP-DEV] Re: [RFC] Autoloader Error Handling

2011-11-25 Thread Rafael Kassner
If your autoloader throws an exception, you need to try/catch entire application. It doesn't sounds useful. On my view, if you want to be mailed about an autoloader fail, this have to be coded inside of your own single autoloader. On Fri, Nov 25, 2011 at 7:46 AM, Christian Kaps wrote: > Am 25.11.

Re: [PHP-DEV] Re: [RFC] Autoloader Error Handling

2011-11-25 Thread Christian Kaps
Am 25.11.2011 10:34, schrieb Rafael Kassner: I think an autoloader can't be raise any kind of error. If the class will be loaded by another autoloader on the stack and the first throws an Exception, this will be a wrong behavior. Indeed, if autoloader can't include the class, PHP throws a fatal

Re: [PHP-DEV] Re: [RFC] Autoloader Error Handling

2011-11-25 Thread Christian Kaps
Hi, comments inline. Am 25.11.2011 09:56, schrieb Sebastian Krebs: Hi, Just to throw my 2 cent in: Im with Micheal. An application, that tries to access a class, that doesn't exists, is broken and a FATAL is valid. This application doesn't need try-catch, but a bugfix (and if it is already

Re: [PHP-DEV] Re: [RFC] Autoloader Error Handling

2011-11-25 Thread Rafael Kassner
I think an autoloader can't be raise any kind of error. If the class will be loaded by another autoloader on the stack and the first throws an Exception, this will be a wrong behavior. Indeed, if autoloader can't include the class, PHP throws a fatal error, and you can avoid it using class_exists f

Re: [PHP-DEV] Re: [RFC] Autoloader Error Handling

2011-11-25 Thread Christian Kaps
Am 25.11.2011 09:55, schrieb Sebastian Bergmann: Am 25.11.2011 09:06, schrieb Christian Kaps: Or am i wrong here? Yes you are. The idea is that you can have multiple autoload callbacks which are invoked in sequence. The first one that is able to load the requested class will end that sequ

Re: [PHP-DEV] Re: [RFC] Autoloader Error Handling

2011-11-25 Thread Sebastian Krebs
Hi, Just to throw my 2 cent in: Im with Micheal. An application, that tries to access a class, that doesn't exists, is broken and a FATAL is valid. This application doesn't need try-catch, but a bugfix (and if it is already released: A better testing management). On the other side an application,

Re: [PHP-DEV] Re: [RFC] Autoloader Error Handling

2011-11-25 Thread Sebastian Bergmann
Am 25.11.2011 09:06, schrieb Christian Kaps: > Or am i wrong here? Yes you are. The idea is that you can have multiple autoload callbacks which are invoked in sequence. The first one that is able to load the requested class will end that sequence. If you throw exceptions in one autoloader that

Re: [PHP-DEV] Re: [RFC] Autoloader Error Handling

2011-11-25 Thread Christian Kaps
Am 25.11.2011 08:24, schrieb Michael Wallner: On Thu, 24 Nov 2011 23:28:35 +0100, Christian Kaps wrote: https://wiki.php.net/rfc/autoloader_error_handling Throwing an exception or fatal error in an autoloader absolutely does not make any sense in my eyes. Projects doing this should step bac

[PHP-DEV] Re: [RFC] Autoloader Error Handling

2011-11-24 Thread Michael Wallner
On Thu, 24 Nov 2011 23:28:35 +0100, Christian Kaps wrote: > > https://wiki.php.net/rfc/autoloader_error_handling > Throwing an exception or fatal error in an autoloader absolutely does not make any sense in my eyes. Projects doing this should step back and think a minute about what they dare.