What is the best way to create a Singleton Webservice in PHP?

Posted by ChronoFish on Stack Overflow See other posts from Stack Overflow or by ChronoFish
Published on 2010-05-17T21:52:21Z Indexed on 2010/05/18 18:20 UTC
Read the original article Hit count: 159

Filed under:
|
|

Hello,

We have a need to access a DB that only allows one connection at a time. This screams "singleton" to me. The catch of course is that the singleton connection will be exposed (either directly or indirectly) via a web-service (most probable a SOAP based web-service - located on a separate server from the calling app(s) ) - which means that there may be more than one app / instance attempting to connect to the singleton class.

In PHP, what is the best way to create a global singleton or a web-service singleton?

TIA

© Stack Overflow or respective owner

Related posts about php

Related posts about singleton