function LocalStream::rmdir

Same name in other branches
  1. 8.9.x core/lib/Drupal/Core/StreamWrapper/LocalStream.php \Drupal\Core\StreamWrapper\LocalStream::rmdir()
  2. 10 core/lib/Drupal/Core/StreamWrapper/LocalStream.php \Drupal\Core\StreamWrapper\LocalStream::rmdir()
  3. 11.x core/lib/Drupal/Core/StreamWrapper/LocalStream.php \Drupal\Core\StreamWrapper\LocalStream::rmdir()

Overrides PhpStreamWrapperInterface::rmdir

1 method overrides LocalStream::rmdir()
LocalReadOnlyStream::rmdir in core/lib/Drupal/Core/StreamWrapper/LocalReadOnlyStream.php
Support for rmdir().

File

core/lib/Drupal/Core/StreamWrapper/LocalStream.php, line 356

Class

LocalStream
Defines a Drupal stream wrapper base class for local files.

Namespace

Drupal\Core\StreamWrapper

Code

public function rmdir($uri, $options) {
    $this->uri = $uri;
    
    /** @var \Drupal\Core\File\FileSystemInterface $file_system */
    $file_system = \Drupal::service('file_system');
    if ($options & STREAM_REPORT_ERRORS) {
        return $file_system->rmdir($this->getLocalPath());
    }
    else {
        return @$file_system->rmdir($this->getLocalPath());
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.