Plugin for external ACL Authorization of PHP applications

I’ve been commited to improve an older php application with a lot of
messy code. The client wants an ACL authorization scheme.

First I tried to implement PHP GACL library as the solution, but the
app’s code is so buggy that it’s a great effort to try it. I’m more
confortable programming with Ruby, so I’m planning to implement an
external ACL authorization system so the php app checks via REST
interface the perms. That’s easier than implement gacl directly.

Before coding myself a solution, I’ve checked several Authorization
plugins available, but all of them assumes they are used inside a
Rails applications, at a Controller and/or Model level.

Anyone knows a plugin which allows me to do the work or could be
modified to do it?