Hi,
I can convert this script to php extension using Zephir. It will improve a performance. After this the script can be used like any other PHP extension.
If my proposal is interesting for you, please, mail me and we can discuss the details.
Sincerely, Anton.