if you want to build something REALLY cool, check out popen on php.net.
php can launch and issue commands to external apps, before you close that pipe, you can check for the pipes pointer status using something like while( !feof( $pipe ) ) and return all output text of the external app using fgets ( $pipe, [len] )
later, after my work cools down a bit, I plan on thinking about an app to utilize the above..
the main purpose is to use this idea as a dual purpose proxy for data. you'll be able to query the running server using pipes OR sockets and query w/e sql db using the app, then return info to php... making your site much quicker, and expanding it's possibilities of adding much more complex things much more easily.
but now you have a new idea as you asked, have fun with it
I'll most likely end up doing a full site in cshtml/asp because the way items are stored in Trinity's database isn't safe for PHP to handle.
mind if i ask what ide you use?