public function generateCacheFilePath($fileID, $add_parameters = false)
    {
        if (empty($this->cache_extension)) {
            $this->cache_extension = config('images.cache_extension');
        }

        /* To do: fileID should be better secured */
        $fileID = str_replace('.', '', $fileID);

        $parameters = ['i'];
        if ($add_parameters) {
            if ($this->size()) {
                $parameters[] = $this->size();
            }
            if ($this->watermarkPath()) {
                $parameters[] = 'w-'.md5($this->watermarkPath());
            }
        }
        $path = config('images.cache_path');
        $path .= "images/{$fileID}/".implode('-', $parameters);
        $path .= '.'.$this->cache_extension;

        return $path;
    }
public function generateCacheFilePath($fileID, $add_parameters = false)
    {
        if (empty($this->cache_extension)) {
            $this->cache_extension = config('images.cache_extension');
        }

        /* To do: fileID should be better secured */
        $fileID = str_replace('.', '', $fileID);

        $parameters = ['i'];
        if ($add_parameters) {
            if ($this->size()) {
                $parameters[] = $this->size();
            }
            if ($this->watermarkPath()) {
                $parameters[] = 'w-'.md5($this->watermarkPath());
            }
        }
        $path = config('images.cache_path');
        $path .= "images/{$fileID}/".implode('-', $parameters);
        $path .= '.'.$this->cache_extension;

        return $path;
    }
public function generateCacheFilePath ( $ fileID , $ add_parameters = false ) { if ( empty ( $ this -> cache_extension ) ) { $ this -> cache_extension = config ( 'images.cache_extension' ) ; } /* To do: fileID should be better secured */ $ fileID = str_replace ( '.' , '' , $ fileID ) ; $ parameters = [ 'i' ] ; if ( $ add_parameters ) { if ( $ this -> size ( ) ) { $ parameters [ ] = $ this -> size ( ) ; } if ( $ this -> watermarkPath ( ) ) { $ parameters [ ] = 'w-' . md5 ( $ this -> watermarkPath ( ) ) ; } } $ path = config ( 'images.cache_path' ) ; $ path .= "images/{$fileID}/" . implode ( '-' , $ parameters ) ; $ path .= '.' . $ this -> cache_extension ; return $ path ; }
Generate path to cache file.

@param string $fileID         Unique file id
@param bool   $add_parameters Should cache file include parameters (if not its original file)

@return string Parth to cache file
Generate path to cache file .