sanya_php
Новичок
PEAR::raiseError
Глобально установлен флаг
PEAR_ERROR_DIE
Хочу некоторые ошибки чтобы обрабатывались а скрипт не умирал.
Делаю так:
(raiseError переопределена у меня в классе)
Может есть что-то красивей ?
Глобально установлен флаг
PEAR_ERROR_DIE
Хочу некоторые ошибки чтобы обрабатывались а скрипт не умирал.
Делаю так:
PHP:
PEAR::setErrorHandling(PEAR_ERROR_PRINT);
if(PEAR::isError($e = File::readAll($file))){
$this->raiseError('Cant find file');
} else {
$this->_array = @unserialize($e);
}
PEAR::setErrorHandling(PEAR_ERROR_DIE);
Может есть что-то красивей ?