scache_shexists

Description

bool scache_shexists(resource session, string path)
bool $SCacheConnection->shexists(string path)

scache_shexists is operationally equal to session spesific scache_exists but unlike it, scache_shexists 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_shexists tests whether path exists and contains value.

Parameters

session
Session resource returned from scache_open, scache_reset or scache_connect
path
Slash (/) separated path on backend's session tree. Path parameter is not binary safe.

Return values

TRUE if path exists, FALSE if not. Internally function is local wrapper over scache_shstat and return same error values if error.

Examples

<?php

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

scache_shset($session, 'key', 'value');
if (scache_shexists($session, 'key')) {

    echo "It is still there!!\n";

} else {

    echo "This software is pure crap.\n";

}
?>