|
|
dkLab | Constructor | PHP_Exceptionizer: converting E_NOTICE to Exception
2009-01-21
Simple, but a very useful library PHP_Exceptionizer automatically converts notices (E_NOTICE), warnings (E_WARNING) etc. into PHP exceptions. Usage sample
Value for script debuggingIt is handy to use this library during web script development process. You should develop in error_reporting = E_ALL mode and keep in mind that even a small notice during the developement often causes a fatal error.
Of course, on production server you must not turn notices into exceptions (to be on a safe side), but just read them in log files. Value for mass mailing generationImagine that you have created a script which sends mails to millions of site subscribers, and the mail text is generated dynamically, depending on user's profile or their friends. Once you upon could think that it is very dangerous to run this script... What if a small mistake would cause millions of persons to receive mails with empty fields or even broken? PHP_Exceptionizer allows to minimize this risk greatly if you turn on
the library before generating and sending of each mail.
Срочно продам квартиру тут | Kia Cerato в Москве: киа серато. | Бытовки и блок-контейнеры: мобильные здания. |