function SessionStreamWrapper::rmdir

Same name in other branches
  1. 3.x modules/stream_wrapper_example/src/StreamWrapper/SessionStreamWrapper.php \Drupal\stream_wrapper_example\StreamWrapper\SessionStreamWrapper::rmdir()
  2. 4.0.x modules/stream_wrapper_example/src/StreamWrapper/SessionStreamWrapper.php \Drupal\stream_wrapper_example\StreamWrapper\SessionStreamWrapper::rmdir()

Support for rmdir().

Parameters

string $uri: A string containing the URI to the directory to delete.

int $options: A bit mask of STREAM_REPORT_ERRORS.

Return value

bool TRUE if directory was successfully removed.

See also

http://php.net/manual/en/streamwrapper.rmdir.php

File

stream_wrapper_example/src/StreamWrapper/SessionStreamWrapper.php, line 711

Class

SessionStreamWrapper
Example stream wrapper class to handle session:// streams.

Namespace

Drupal\stream_wrapper_example\StreamWrapper

Code

public function rmdir($uri, $options) {
    $path = $this->getLocalPath($uri);
    if (!$this->sessionHelper
        ->checkPath($path) or !is_array($this->sessionHelper
        ->getPath($path))) {
        return FALSE;
    }
    $this->sessionHelper
        ->clearPath($path);
    return TRUE;
}