scache_stat

Description

long scache_stat(resource session, string path)
long $SCacheConnection->stat(string path)

scache_stat queries node given path and returns existence and type of it. Return value is :

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

Node type success, FALSE on failure. Node types are :

In case of failure, error codes resolvable by scache_lasterr is one of below :

Examples

<?php

/* get connection */
$session = scache_reset('MyEasilyGuessableSecret');

scache_set($session, 'this/is/my/path', 'value');

if (scache_stat($session, 'this/is/my/path') == SCNODE_VALUE) 
    echo "Yes, this is SCNODE_VALUE...\n";

if (scache_stat($session, 'this/is/my') == SCNODE_BRANCH) 
    echo "..and yes, you are right, this is SCNODE_BRANCH..\n";
?>