scache_exists
Description
bool scache_exists(resource session, string path)
bool $SCacheConnection->exists(string path)
scache_exists 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_stat 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('MyEasilyGuessableSecret');
scache_set($session, 'key', 'value');
if (scache_exists($session, 'key')) {
echo "It is still there!!\n";
} else {
echo "This software is pure crap.\n";
}
?>
