scache_vset

Description

long scache_vset(resource session, string path, int value)
long $SCacheConnection->vset(string path, long value)

scache_vadd, scache_vsub, scache_vset, scache_vunset operate shared counters on scached backend.

Differences are :

Parameters

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

Return values

On success resulting value is returned, on failure return value is FALSE. Nonexisting values are considered as value zero.

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/unexistent/path', 2);
?>