protected function getStorageFolderZip($storage, $resource)
    {
        $resource = rtrim($resource, '/') . DIRECTORY_SEPARATOR;
        $zip = new \ZipArchive();
        $tmpDir = rtrim(sys_get_temp_dir(), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR;
        $zipFileName = $tmpDir . str_replace('/', '_', $resource) . time() . '.zip';

        if (true !== $zip->open($zipFileName, \ZipArchive::CREATE)) {
            throw new InternalServerErrorException('Could not create zip file for extracting ' . $resource);
        }

        if ($storage->folderExists($resource)) {
            $storage->getFolderAsZip($resource, $zip, $zipFileName, true);
        } else {
            return false;
        }

        $zip->close();

        return $zipFileName;
    }
protected function getStorageFolderZip($storage, $resource)
    {
        $resource = rtrim($resource, '/') . DIRECTORY_SEPARATOR;
        $zip = new \ZipArchive();
        $tmpDir = rtrim(sys_get_temp_dir(), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR;
        $zipFileName = $tmpDir . str_replace('/', '_', $resource) . time() . '.zip';

        if (true !== $zip->open($zipFileName, \ZipArchive::CREATE)) {
            throw new InternalServerErrorException('Could not create zip file for extracting ' . $resource);
        }

        if ($storage->folderExists($resource)) {
            $storage->getFolderAsZip($resource, $zip, $zipFileName, true);
        } else {
            return false;
        }

        $zip->close();

        return $zipFileName;
    }
protected function getStorageFolderZip ( $ storage , $ resource ) { $ resource = rtrim ( $ resource , '/' ) . DIRECTORY_SEPARATOR ; $ zip = new \ ZipArchive ( ) ; $ tmpDir = rtrim ( sys_get_temp_dir ( ) , DIRECTORY_SEPARATOR ) . DIRECTORY_SEPARATOR ; $ zipFileName = $ tmpDir . str_replace ( '/' , '_' , $ resource ) . time ( ) . '.zip' ; if ( true !== $ zip -> open ( $ zipFileName , \ ZipArchive :: CREATE ) ) { throw new InternalServerErrorException ( 'Could not create zip file for extracting ' . $ resource ) ; } if ( $ storage -> folderExists ( $ resource ) ) { $ storage -> getFolderAsZip ( $ resource , $ zip , $ zipFileName , true ) ; } else { return false ; } $ zip -> close ( ) ; return $ zipFileName ; }
Returns the path of the zip file containing
app files or other storage files.

@param FileServiceInterface $storage
@param                      $resource

@return bool|string
@throws \DreamFactory\Core\Exceptions\InternalServerErrorException
Returns the path of the zip file containing app files or other storage files .