original_string: 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;
      }
code: 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;
      }
code_tokens: 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 ; }
docstring: 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
docstring_tokens: Returns the path of the zip file containing app files or other storage files .