scache_shunset, scache_shclear

Description

bool scache_shunset(resource session, string path)
bool scache_shclear(resource session, string path)
bool $SCacheConnection->shclear(string path)

scache_shunset is operationally equal to session spesific scache_unset but unlike it, scache_shunset operates on shared storage that is common and accessible for all clients. Shared storage is for operating data common to all clients and for inter-client communication.

scache_shunset removes entry from given path on scached's shared storage, scache_shclear is alias to scache_shunset to keep symmetry with class interface.

Parameters

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

Return values

TRUE on success. FALSE on failure. If node was already empty or nonexisting one, TRUE is returned, but error code is set to SCERR_NOTEXIST.

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

Generally you can ignore the returned value.

Examples

<?php

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

scache_shset($session, 'today/i', '..work..work..always..work');
scache_shset($session, 'today/did', '..work..work..always..work');
scache_shset($session, 'today/enourmous', '..work..work..always..work');
scache_shset($session, 'today/amounts', '..work..work..always..work');
scache_shset($session, 'today/of', '..work..work..always..work');
scache_shset($session, 'today/hard', '..work..work..always..work');
scache_shset($session, 'today/and', '..work..work..always..work');
scache_shset($session, 'today/dull', '..work..work..always..work');
scache_shset($session, 'today/and', '..work..work..always..work');
scache_shset($session, 'today/boring', '..work..work..always..work');
scache_shset($session, 'today/work', '..work..work..always..work');

if (scache_shunset($session, 'today')) {
    echo "..and now its all gone!\n";
}
?>