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
Session resource returned from scache_open, scache_reset or scache_connect
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.

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";

}
?>