scache_shexists
Description
bool scache_shexists(resource session, string path)
bool $SCacheConnection->shexists(string path)
scache_shexists is operationally equal to session spesific scache_exists but unlike it, scache_shexists operates on shared storage that is common and accessible for all clients. Shared storage is for operating data common to all clients and for inter-client communication.
scache_shexists tests whether path exists and contains value.
Parameters
session
path
Slash (/) separated path on backend's session tree. Path parameter is not binary safe.
Return values
TRUE if path exists, FALSE if not. Internally function is local wrapper over scache_shstat and return same error values if error.
- SCERR_NO_SESSION Connected session does not exist or has been expired. Connection is not valid any more.
- SCERR_NOT_CONNECTED Connection to backend is broken and cannot be reconnected.
- SCERR_PROTOCOL Internal protocol error has occurred when communicating to backend. This indicates something is severely broken.
Examples
<?php /* get connection */ $session = scache_reset('IdIsIrrelevantBecauseStorageIsShared'); scache_shset($session, 'key', 'value'); if (scache_shexists($session, 'key')) { echo "It is still there!!\n"; } else { echo "This software is pure crap.\n"; } ?>