Commit 77122cc7 authored by Gaurav Kapoor's avatar Gaurav Kapoor Committed by Gaurav Kapoor
Browse files

Issue #3273267 by gaurav.kapoor: Removed PCLZip Dependency.

parent 01cb624e
Loading
Loading
Loading
Loading
+0 −3
Original line number Diff line number Diff line
@@ -8,8 +8,5 @@
  "minimum-stability": "dev",
  "support": {
    "issues": "https://www.drupal.org/project/issues/vfd"
  },
  "require": {
    "chamilo/pclzip": "^2.8.3"
  }
}
+0 −5
Original line number Diff line number Diff line
@@ -4,7 +4,6 @@ namespace Drupal\vfd\Controller;

use Drupal\Core\File\FileSystemInterface;
use Drupal\Core\Controller\ControllerBase;
use PclZip;

class DownloadNodeController extends ControllerBase {

@@ -20,8 +19,6 @@ class DownloadNodeController extends ControllerBase {
    $tmp_file->save();
    $file = $tmp_file;
    $path = \Drupal::service('file_system')->realpath($file->getFileUri());
    $archive = new PclZip($path);
    $archive->add($node_files, PCLZIP_OPT_REMOVE_ALL_PATH);
    header("Pragma: public");
    header("Expires: 0");
    header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
@@ -47,8 +44,6 @@ class DownloadNodeController extends ControllerBase {
    $tmp_file->save();
    $file = $tmp_file;
    $path = \Drupal::service('file_system')->realpath($file->getFileUri());
    $archive = new PclZip($path);
    $archive->add($node_files, PCLZIP_OPT_REMOVE_ALL_PATH);
    header("Pragma: public");
    header("Expires: 0");
    header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
+0 −3
Original line number Diff line number Diff line
@@ -4,7 +4,6 @@ namespace Drupal\vfd\Controller;

use Drupal\Core\File\FileSystemInterface;
use Drupal\Core\Controller\ControllerBase;
use PclZip;

class DownloadViewController extends ControllerBase {

@@ -27,8 +26,6 @@ class DownloadViewController extends ControllerBase {
    $tmp_file->save();
    $file = $tmp_file;
    $tmp_path = \Drupal::service('file_system')->realpath($file->getFileUri());
    $archive = new PclZip($tmp_path);
    $archive->add($view_files, PCLZIP_OPT_REMOVE_ALL_PATH);
    header("Pragma: public");
    header("Expires: 0");
    header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
+0 −3
Original line number Diff line number Diff line
@@ -2,6 +2,3 @@ name: Views File Downloader
description: Download files attached to a view or node in a Zip file.
type: module
core_version_requirement: ^8.8 || ^9

dependencies:
 - drupal:libraries

vfd.install

deleted100644 → 0
+0 −21
Original line number Diff line number Diff line
<?php

/**
 * @file Install file for vfd module.
 */

/**
 * Implemtents hook_requirement.
 */
function vfd_requirements($phase) {
  $requirements = [];
  if ($phase == 'install') {
    if (!class_exists('PclZip')) {
      $requirements['PclZip'] = [
        'description' => t('Views File Downloader requires the PclZip library file. Download <a href="http://www.phpconcept.net/pclzip/pclzip-downloads" target="_blank"> PclZip </a> library file over here and put library file in vendor/pclzip/pclzip/pclzip.lib.php'),
        'severity' => REQUIREMENT_ERROR,
      ];
    }
  }
  return $requirements;
}