function session_cache_file_session_cache_get in Session Cache API 7
Same name and namespace in other branches
- 8 session_cache_file/session_cache_file.module \session_cache_file_session_cache_get()
Implements hook_session_cache_get().
File
- session_cache_file/
session_cache_file.module, line 84 - session_cache_file.module
Code
function session_cache_file_session_cache_get($method, $bin) {
if ($method != SESSION_CACHE_FILE_STORAGE_FILE) {
return NULL;
}
$path = session_cache_file_directory($bin);
$sid = session_cache_get_sid();
$data = $path && $sid && file_exists("{$path}/{$sid}") ? json_decode(file_get_contents("{$path}/{$sid}"), TRUE) : NULL;
return $data;
}