protected function _GetKeyPath($Key, $Flags = 0) { $KeyHash = $this->_HashKey($Key); $SplitValue = intval('0x' . substr($KeyHash, 0, 8), 16); $TargetFolder = (string) ($SplitValue % Gdn_Filecache::OPT_MOD_SPLIT); $Container = $this->_GetContainer($KeyHash); if ($Container === Gdn_Cache::CACHEOP_FAILURE) { return $this->Failure("Trying to fetch a container for hash '{$KeyHash}' but got back CACHEOP_FAILURE instead"); } $CacheLocation = $Container[Gdn_Cache::CONTAINER_LOCATION]; $SplitCacheLocation = CombinePaths(array($CacheLocation, $TargetFolder)); $Flags = $Flags & Gdn_Filecache::O_CREATE ? Gdn_FileSystem::O_CREATE | Gdn_FileSystem::O_WRITE : 0; $CacheLocationOK = Gdn_FileSystem::CheckFolderR($SplitCacheLocation, $Flags); if (!$CacheLocationOK) { return $this->Failure("Computed cache folder '{$SplitCacheLocation}' could not be found, or created."); } $CacheFile = rtrim(CombinePaths(array($SplitCacheLocation, $KeyHash)), '/'); return array_merge($Container, array(Gdn_Filecache::CONTAINER_CACHEFILE => $CacheFile)); }