Ian: I have seen and considered installing phpaspect (or similar
alternative on our development site).
Lee: Not so much auditing although an interesting idea as well.
Basically I was looking to catch and log all fatal errors however it's
occured to me that this will not work.

We end up with fatal errors in our application (no body's fault but
our own) by attempting to use a method on a null.  For example:

$user = UsersPeer::doSelectOne(new Criteria());
$user->getId();

if the select one did not return a user object calling the method
getId on a null will throw a fatal.  My intention was to insert a test
before all get calls that would go:

catchFatal($object, $method){
    if(method_exists($object,$method) && is_callable()){
        return call_user_func(...);
    }else{
        /** log enough information to track where to solve this error
and 404 the page **/
    }
}

The reason this will not work is if the select one returned null the
mixin can't possibly be called (I think).  I suppose I'll just have to
keep an eye on my error logs unless someone else can offer a
suggestion.

Anyone know how to change
$user = UsersPeer::doSelectOne(new Criteria());
$user->getId();
to
$user = UsersPeer::doSelectOne(new Criteria());
catchFatal($user,'getId');
$user->getId();

perhaps overriding the basepeer would help in someway.... suggestions
welcomed.

- Colin

On Apr 2, 5:12 am, "Ian P. Christian" <[EMAIL PROTECTED]> wrote:
> hutchic wrote:
> > If I had access to aspect programming I'd be in the zone
> > unfortunately.....
>
> Wondering off topic a tiny bit.....
>
> Have you used/seenhttp://phpaspect.org/ ?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to