scache_chget

Description

mixed scache_chget(resource session, string path)
mixed $SCacheConnection->chget(string path)

scache_chget retrieves values to shared cache. Values can be set with scache_chput and removed with scache_chclear.

Previously stored value might not be found because scached backend is allowed to drop values in any time if memory limits are exceeded. Values are dropped by oldest accessed first. If you want to store values permanently, use scache_sh* functions that keep data until explicitly changed or removed.

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

Stored value on success, FALSE on fail. On FALSE scache_lasterr returns last error code which is one of below :

<?php

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

scache_chput($session, 'freely_droppable_value', 'for cache only');
if (scache_chget($session, 'freely_droppable_value')) {

    echo "Value found, but might also have not\n";
}
?>