You are here

public function SessionStreamWrapper::rmdir in Examples for Developers 3.x

Same name and namespace in other branches
  1. 8 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.

Overrides PhpStreamWrapperInterface::rmdir

See also

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

File

modules/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;
}