1 file_example_session_streams.inc public FileExampleSessionStreamWrapper::rmdir($uri, $options)

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 StreamWrapperInterface::rmdir

See also

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

File

modules/examples/file_example/file_example_session_streams.inc, line 563
Provides a demonstration session:// stream-wrapper.

Class

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

Code

public function rmdir($uri, $options) {
  $path = $this->getLocalPath($uri);
  $path_components = preg_split('/\//', $path);
  $fail = FALSE;
  $unset = '$_SESSION[\'file_example\']';
  foreach ($path_components as $component) {
    $unset .= '[\'' . $component . '\']';
  }
  // TODO: I really don't like this eval.
  debug($unset, 'array element to be unset');
  eval("unset($unset);");

  return TRUE;
}