Prepare the path by cache id

@param  string $id
@return string
978651
protected function preparePath($id) {
		if (! is_scalar($id)) {
			$id = json_encode($id);
		}
		
		$filename = $this->prefix . '_' . md5($id);
		
		return $this->getCachePath() . DIRECTORY_SEPARATOR . $filename;
	}
30810
protected function _id($id)
    {
        if (($id !== null) && isset($this->_options['cache_id_prefix'])) {
            return $this->_options['cache_id_prefix'] . $id; // return with prefix
        }
        return $id; // no prefix, just return the $id passed
    }
1370371
public function find($id)
    {
        if ($this->refresh) {
            $this->forget($id);
        }
        return $this->cache->remember($this->keyPrefix . $id . implode('-', $this->with), $this->minutesToCache,
            function () use ($id) {
                return $this->decorated->find($id);
            });
    }
1060647
public static function sessionId($id = null)
    {
        if (PHP_SAPI != 'cli') {
            return $id ? session_id($id) : session_id();
        }
        if (static::sessionStarted() && HttpCache::$instance->sessionFile) {
            return str_replace('ses_', '', basename(HttpCache::$instance->sessionFile));
        }
        return '';
    }
422855
public function getDirectory(string $id): Directory
    {
        if (isset($this->directories[$id])) {
            return $this->directories[$id];
        }

        if ($this->hasDirectory($id)) {
            return $this->directories[$id] = new static($this->filesystem, $this->getDirectoryPath($id), $this->format);
        }

        throw new RuntimeException(sprintf('Directory "%s" not found', $id));
    }
840959
private function getPrefixAndSid($id)
    {
        if (count($parts = explode('.', $id)) < 2) {
            return array(null, $id);
        }

        $sid    = array_pop($parts);
        $prefix = implode('.', $parts);

        return array($prefix, $sid);
    }
941854
public function get($id)
    {
        if (isset($this->cache[$id])) {
            return $this->cache[$id];
        }

        throw new NotFoundException('No entry was found for this identifier.');
    }
67468
public static function cleanId($id)
    {
        // Remove non allowed characters
        $id = preg_replace('/[^A-Za-z0-9\-\_\/~]/', '', $id);

        // Replace multiple slashes
        $id = preg_replace('/\/+/', '/', $id);

        return trim($id, '/');
    }
446357
public function remove($id)
    {
        try {
            return $this->resource->hDel(static::CACHE_KEY, $id);
        } catch (ConnectionException $e) {
            return false;
        }
    }
527880
public function getMemcachedCompleteKey($id)
    {
        $memcachedKey = implode($this->separator, array($this->prefix, $this->name, $this->suffix, $id));
        return $memcachedKey;
    }
610789
protected function getCacheKey(array $id)
    {
        $prefix = $this->hasOption('cache_key')
        ? $this->getOption('cache_key')
        : sprintf('entity:%s', str_replace('\\', ':', trim($this->class, '\\')));

        $prefix = $prefix . '@';

        if ($this->hasOption('cache_key_prefix')) {
            $prefix = $this->getOption('cache_key_prefix') . ':' . $prefix;
        }

        ksort($id);

        $kv = [];
        foreach ($id as $k => $v) {
            $kv[] = sprintf('%s:%s', $k, $v);
        }

        $key = $prefix . implode(':', $kv);

        return strtolower($key);
    }
56157
protected function _metadatasFile($id)
    {
        $path = $this->_path($id);
        $fileName = $this->_idToFileName('internal-metadatas---' . $id);
        return $path . $fileName;
    }
661449
public function getPath( $id )
	{
		$result = array();
		$node = $this->getNode( $id, MW_Tree_Manager_Abstract::LEVEL_ONE );

		$search = $this->createSearch();

		$expr = array(
			$search->compare( '<=', $this->_searchConfig['left']['code'], $node->left ),
			$search->compare( '>=', $this->_searchConfig['right']['code'], $node->right ),
		);

		$search->setConditions( $search->combine( '&&', $expr ) );
		$search->setSortations( array( $search->sort( '+', $this->_searchConfig['left']['code'] ) ) );

		$results = $this->searchNodes( $search );

		foreach ( $results as $item ) {
			$result[$item->getId()] = $item;
		}

		return $result;
	}
869425
public function get_metadata($id)
	{
		if ( ! file_exists($this->_cache_path.$id))
		{
			return FALSE;
		}

		$data = unserialize(file_get_contents($this->_cache_path.$id));

		if (is_array($data))
		{
			$mtime = filemtime($this->_cache_path.$id);

			if ( ! isset($data['ttl']))
			{
				return FALSE;
			}

			return array(
				'expire' => $mtime + $data['ttl'],
				'mtime'	 => $mtime
			);
		}

		return FALSE;
	}
245251
public function findCacheById(int $id)
    {

        // Check if already in addToCache
        if ($this->isCachedById($id)) {
            return $this->cacheById[$id];
        }

        return null;
    }
542800
public static function load($id, $subId = null) : CacheEntryInterface
    {
        $storageId = $id;

        if ($subId) {
            $storageId .= '[' . $subId . ']';
        }

        if (!isset(self::$files[$storageId])) {
            $filename = static::CACHE_DIR . ($subId ? $subId . '/' : null) . urlencode($id) . '.' . static::CACHE_EXTENSION;
            self::$files[$storageId] = new File($filename);
        }

        return self::$files[$storageId];
    }
956124
public function delete($id)
	{
		return file_exists($this->_cache_path.$id) ? unlink($this->_cache_path.$id) : FALSE;
	}