You are here

public function elFinderVolumeDrupal::extract in elFinder file manager 7.2

Same name and namespace in other branches
  1. 8.2 src/Controller/elFinderVolumeDrupal.php \elFinderVolumeDrupal::extract()
  2. 6.2 inc/elfinder.drupalfs.driver.inc \elFinderVolumeDrupal::extract()
  3. 7.3 inc/elfinder.drupalfs.driver.inc \elFinderVolumeDrupal::extract()

Extract files from archive.

Run the parent extract() then add the files to the Drupal db.

Parameters

string $hash: Archive filename hash.

bool $makedir: Extract the files into a new folder.

Return value

array|bool

File

inc/elfinder.drupalfs.driver.inc, line 481
elFinder driver for Drupal filesystem.

Class

elFinderVolumeDrupal
@file

Code

public function extract($hash, $makedir = NULL) {
  if (!$this
    ->CheckUserQuota()) {
    return FALSE;
  }
  $fstat = array();
  if ($makedir == NULL) {
    $fstat = parent::extract($hash);
  }
  else {
    $fstat = parent::extract($hash, $makedir);
  }
  if ($fstat != FALSE) {
    $path = $this
      ->decode($fstat['hash']);
    $this
      ->AddToDrupalDB($path);
    $file = $this
      ->_drupalfileobject($path);
    if ($fstat['mime'] !== 'directory') {
      $this
        ->FileUsageAdd($file);
    }
  }
  return $fstat;
}