scache_vget

Description

long scache_vget(resource session, string path)
long $SCacheConnection->vget(string path)

scache_vget gets value from given path

Parameters

session
Session resource returned from scache_open, scache_reset or scache_connect
path
Slash (/) separated null-terminated path on backend's session tree

Return values

Path's current value is returned. Unexistent values are created on fly with initial value 0

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

Notes

Nonexistent value is considered as 0.

Note also that these are not session specific but common to all clients. Shared counters might be useful for mutual modifications tracking or incremental transient numbering.

Examples

<?php

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

scache_vset($session, 'my/path', 2);
if (scache_vget($session, 'my/path') !== 2) {
    echo "This software is crap!\n";
}
?>