Welcome to TheGillis.net

Consider this site a collection of random notes about a variety of topics. I hope this information helps you in some way.

24 September 2004 - 19:45PHP Irritation

I was researching the possible use of a piece of software that required network connections to access the data from it. My first idea was to create a single instance connection pool object that would remove the connection overhead and provide a locking mechanism to keep track of the items in the pool. The downside is that I was trying to write this in PHP and after finishing all of the code I discovered that no matter what I did to persist the pool object, it would still get destroyed and re-created. I attempted to use the $GLOBAL superglobal, a static class member, and even a static function object. Nothing would stop the object from getting destroyed. After days of searching, I have come across several people that hint at the fact that there is no way to achieve this. Most of them are connecting to databases so they suggest using one of the persistent connection functions. This does not work in my case. I have abandoned the idea unless someone can figure out if this can be done. PHP goes down another notch in my book :(

No Comments | Tags: Programming

Add a Comment