scache_unset, scache_clear

Description

bool scache_unset(resource session, string path)
bool scache_clear(resource session, string path)
bool $SCacheConnection->clear(string path)

scache_unset removes entry from given path on scached's session-private storage, scache_clear is alias to scache_unset 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_set($session, 'today/i', '..work..work..always..work');
scache_set($session, 'today/did', '..work..work..always..work');
scache_set($session, 'today/enourmous', '..work..work..always..work');
scache_set($session, 'today/amounts', '..work..work..always..work');
scache_set($session, 'today/of', '..work..work..always..work');
scache_set($session, 'today/hard', '..work..work..always..work');
scache_set($session, 'today/and', '..work..work..always..work');
scache_set($session, 'today/dull', '..work..work..always..work');
scache_set($session, 'today/and', '..work..work..always..work');
scache_set($session, 'today/boring', '..work..work..always..work');
scache_set($session, 'today/work', '..work..work..always..work');
	
scache_unset($session, 'today');
echo "..and now its all gone!\n";
?>