protected function getPath(/*# string */ $key)/*# : string */
    {
        // get directory first
        if (($pos = strrpos($key, '/')) !== false) {
            $dir  = $this->dir_root . DIRECTORY_SEPARATOR .
                    substr($key, 0, $pos) . DIRECTORY_SEPARATOR;
            $key  = substr($key, $pos + 1);
        } else {
            $dir  = $this->dir_root . DIRECTORY_SEPARATOR;
        }

        // get file path
        if (is_callable($this->path_func)) {
            $func = $this->path_func;
            $file = $func($key);

        // hashed version
        } else {
            $file = $key ? $this->hashIt($key) : '';
        }

        return $dir . $file;
    }
protected function getPath(/*# string */ $key)/*# : string */
    {
        // get directory first
        if (($pos = strrpos($key, '/')) !== false) {
            $dir  = $this->dir_root . DIRECTORY_SEPARATOR .
                    substr($key, 0, $pos) . DIRECTORY_SEPARATOR;
            $key  = substr($key, $pos + 1);
        } else {
            $dir  = $this->dir_root . DIRECTORY_SEPARATOR;
        }

        // get file path
        if (is_callable($this->path_func)) {
            $func = $this->path_func;
            $file = $func($key);

        // hashed version
        } else {
            $file = $key ? $this->hashIt($key) : '';
        }

        return $dir . $file;
    }
protected function getPath ( /*# string */ $ key ) /*# : string */ { // get directory first if ( ( $ pos = strrpos ( $ key , '/' ) ) !== false ) { $ dir = $ this -> dir_root . DIRECTORY_SEPARATOR . substr ( $ key , 0 , $ pos ) . DIRECTORY_SEPARATOR ; $ key = substr ( $ key , $ pos + 1 ) ; } else { $ dir = $ this -> dir_root . DIRECTORY_SEPARATOR ; } // get file path if ( is_callable ( $ this -> path_func ) ) { $ func = $ this -> path_func ; $ file = $ func ( $ key ) ; // hashed version } else { $ file = $ key ? $ this -> hashIt ( $ key ) : '' ; } return $ dir . $ file ; }
Get path base on key.

$key may contain '/' to signal a path

@param  string $key item key
@return string
@access protected
Get path base on key .