You are here

protected function elFinderVolumeDrupal::delTree in elFinder file manager 7.3

Same name and namespace in other branches
  1. 7.2 inc/elfinder.drupalfs.driver.inc \elFinderVolumeDrupal::delTree()

Delete dirctory trees and included files.

Clone of elfinderVolumeDriver::delTree().

Using elFinderVolumeLocalFileSystem::delTree to delete a folder with files in it would not update file_usage and file_managed tables. Using elfinderVolumeDriver::delTree makes it work better.

1 call to elFinderVolumeDrupal::delTree()
elFinderVolumeDrupal::remove in inc/elfinder.drupalfs.driver.inc
Taken from elFinderVolumeDriver::remove().

File

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

Class

elFinderVolumeDrupal
@file

Code

protected function delTree($localpath) {
  foreach ($this
    ->_scandir($localpath) as $p) {
    elFinder::extendTimeLimit();
    $stat = $this
      ->stat($this
      ->convEncOut($p));
    $this
      ->convEncIn();
    $stat['mime'] === 'directory' ? $this
      ->delTree($p) : $this
      ->_unlink($p);
  }
  $res = $this
    ->_rmdir($localpath);
  $res && $this
    ->clearstatcache();
  return $res;
}