We need to access a database that allows only one connection at a time. It screams singleton for me. The trick, of course, is that a singleton connection will be opened (directly or indirectly) through a web service (the most likely SOAP-based web service) located on a separate server from the calling application (s)), which means that there may be more than one application / instance trying to connect to the singleton class.
In PHP, what's the best way to create a global singleton or singleton web service?
TIA
PHP , "" , . - java " ". php "" ( ) - . -, $_SESSION, , php "". , , - .
, , Singleton, , , , , . , php, , , . Edit: , , , singleton, -, ? , , , . , , . , , 2 : 1) , .
2) , , , .
" DB SERVER" .;-), ...
SoapServer , 1
$s1 = sem_get(123, 1); sem_acquire($s1); // soapserver code here sem_release($s1);
Source: https://habr.com/ru/post/1745882/More articles:Does Silverlight 4 support wshttpbinding? - silverlightLogging Out (ASP.NET) - asp.netDynamically moving div, for example, Yelp displacement map - javascriptASP.NET AJAX and keeping the session alive - What is the standard way to do this? - ajaxRunning an activity in its current state - androidHow to improve override / rewrite variable in XSL? - xmlActually XSLT Lookup (store variables during the loop and use a different template in it) - xsltOneWay binding transfer "TwoWay binding is not valid for a read-only property" - data-bindingIs there a universal version control client? - version-controlHow to apply browser height to CSS class? - javascriptAll Articles