I am looking for something like this:

if (error($anything)) {
    $method = Array('show_on_page', 'email', 'file');
    $my_error_message = 'We are in trouble!';
    $severity = 'Light';
    $error_class->LogError($method, $my_own_error_message,
$natural_error_message, $severity, $file_where_happened, $line, $etc...);
}

  So...

class Error_Class
{
    function LogError($method, $etc...)
    {
        if (in_array('email', $method)) {
            mail ('There was an error, bla bla bla', $etc...);
        }
        if (in_array('file', $method)) {
            fwrite('file.txt', $etc....);
        }
        if ($severity == 'CRITICAL STUFF!!!')
            // Do everything that's possible!
        }
    }
}

  Something like this, where errors messages and the actions I may take
could be *more easily* personalized. ;-)

  Or maybe instead of $method and $severity and etc, pre-confifured vars,
like if I pass to $error_class->LogError() an $var = '1':

class Error_Class
{
    if ($var == '1') {
        $this->WarningMethod('email', 'file');
    }
}

  And etc, etc, etc.... :-D

  I understand there's a lot of "etc" on my post, that's because I am still
thinking about all the features that I think that would be useful on a such
class... ;-)

--

Julio Nobrega.

Um dia eu chego lá:
http://sourceforge.net/projects/toca

Ajudei? Salvei? Que tal um presentinho?
http://www.submarino.com.br/wishlistclient.asp?wlid=664176742884


"Manuel Lemos" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hello,
>
>
> PHP built-in error handling support functions are very powerful and
> capable. What do you miss in them that you still need a class to handle
> it?
>
> Regards,
> Manuel Lemos



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to