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
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 :
- SCERR_NOTEXIST Path given does not exist.
- SCERR_NO_SESSION Connected session does not exist or has been expired. Connection is not valid any more.
- SCERR_NO_ACCESS Caching is not allowed on assigned partition.
- SCERR_NOT_CONNECTED Connection to backend is broken and cannot be reconnected.
- SCERR_PROTOCOL Internal protocol error has occurred when communicating to backend. This indicates something is severely broken.
<?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"; } ?>