Sounds like a cool proposal. I've been handling PHP errors as exception for
years, even in my ZF projects In my ZF projects I've developed a plug-in that I
use as standard procedure. It helps tremendously during development to be able
to hook into an error/exception when an error occurs and format it nicely to
display the entire exception stack, i.e. line, file, msg, etc and even display
the file and code itself in real time. Like to see what you come up with. My
plugin is as simple as below. The Exception controller simply grabs all the
exception data and manipulates and displays it according to debug env or
however you want to set it up. I had read somewhere that Exceptions should only
be used during development but PHP provides enough tools to use it at any time
even as a user message system.
class App_Plugin_Error_Handler extends Zend_Controller_Plugin_Abstract
{
/**
* Enter description here...
*
*/
public function __construct()
{
set_error_handler(array($this,'handler'));
}
/**
* Enter description here...
*
* @param unknown_type $errno
* @param unknown_type $errstr
*/
public function handler($errno, $errstr)
{
if (error_reporting()) {
throw new Zend_Exception($errstr,$errno);
}
}
}
Tom
[email protected]
-----Original Message-----
From: Ben Scholzen 'DASPRiD' [mailto:[email protected]]
Sent: Thursday, July 23, 2009 7:46 AM
To: [email protected]
Subject: [fw-general] Re: Your DokuWiki password
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hello,
I'd like to create a proposal about error-handling as exceptions in PHP,
and thus required write access to the RFC section of the php wiki. Could
you enable my user account "dasprid" to do so?
Thanks in advance,
Ben Scholzen
...................................
: ___ _ ___ ___ ___ _ ___ :
: | \ /_\ / __| _ \ _ (_) \ :
: | |) / _ \\__ \ _/ / | |) | :
: |___/_/:\_\___/_| |_|_\_|___/ :
:........:........................:
: Web : http://www.dasprids.de :
: E-mail : [email protected] :
: Jabber : [email protected] :
: ICQ : 105677955 :
:........:........................:
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iEYEARECAAYFAkpoW20ACgkQ0HfT5Ws789AzPwCfZXnxVuHzf6dCRNDr6fmTI2S4
OnoAoL8DvDTiMmhkuD6CrANkCaCkhRRO
=2tRQ
-----END PGP SIGNATURE-----