private function saveFileToCache(FileInterface $file)
    {
        $cachedPath = sys_get_temp_dir() . self::CACHE_DIR . $file->getRelativePath();

        if (! is_dir(dirname($cachedPath))) {
            mkdir(dirname($cachedPath), 0700, true);
        }

        $cmd = sprintf('git show :%s > %s', $file->getRelativePath(), $cachedPath);
        $process = new Process($cmd);
        $process->run();

        $file->setCachedPath($cachedPath);

        return $file;
    }
private function saveFileToCache(FileInterface $file)
    {
        $cachedPath = sys_get_temp_dir() . self::CACHE_DIR . $file->getRelativePath();

        if (! is_dir(dirname($cachedPath))) {
            mkdir(dirname($cachedPath), 0700, true);
        }

        $cmd = sprintf('git show :%s > %s', $file->getRelativePath(), $cachedPath);
        $process = new Process($cmd);
        $process->run();

        $file->setCachedPath($cachedPath);

        return $file;
    }
private function saveFileToCache ( FileInterface $ file ) { $ cachedPath = sys_get_temp_dir ( ) . self :: CACHE_DIR . $ file -> getRelativePath ( ) ; if ( ! is_dir ( dirname ( $ cachedPath ) ) ) { mkdir ( dirname ( $ cachedPath ) , 0700 , true ) ; } $ cmd = sprintf ( 'git show :%s > %s' , $ file -> getRelativePath ( ) , $ cachedPath ) ; $ process = new Process ( $ cmd ) ; $ process -> run ( ) ; $ file -> setCachedPath ( $ cachedPath ) ; return $ file ; }
Saves a copy of the cached version of the given file to a temp directory.

@param  FileInterface $file
@return FileInterface
Saves a copy of the cached version of the given file to a temp directory .