SCache::__construct
Description
Constructing SCache object prepares and opens socket level connection to scached backend but doesn't query anything. Creating SCache object equals and has same asides as connecting to backend with scache_connect.
Creating object does not initialize session itself. It just prepares connection to operate on already existing session on scached backend. If specified session is new and nonexistent, it must be initialized with SCache::open or SCache::reset before storing or retrieving values.
id is in most cases the cookie or whatever you send to browsers to distinguish them between. secret is meant to be web application specific check to be matched on a case where same scached is used between not so trustworthy apps and servers. If secret is set it must match on further opens. On a simple local-only scacheds secret has no sensible uses.
Parameters
Return values
As a successful result SCache-object is created. Created object has methods documented in class interface.
Object creation might fail on invalid parameters or if backend scached cannot be contacted. If creation fails, SCacheException is thrown.
Examples
<?php $my_session_identifier = $_COOKIE['MySessionIdentifier']; try { $conn = new SCache($my_session_identifier, 'scached.host.ip'); } catch (SCacheException $e) { die('Connection failed'); } ?>