class DummyReadOnlyStreamWrapper

Helper class for testing the stream wrapper registry.

Dummy stream wrapper implementation (dummy-readonly://).

Hierarchy

Expanded class hierarchy of DummyReadOnlyStreamWrapper

File

drupal/core/modules/file/tests/file_test/lib/Drupal/file_test/DummyReadOnlyStreamWrapper.php, line 17
Definition of Drupal\file_test\DummyReadOnlyStreamWrapper.

Namespace

Drupal\file_test
View source
class DummyReadOnlyStreamWrapper extends LocalReadOnlyStream {
  function getDirectoryPath() {
    return variable_get('stream_public_path', 'sites/default/files');
  }

  /**
   * Override getInternalUri().
   *
   * Return a dummy path for testing.
   */
  function getInternalUri() {
    return '/dummy/example.txt';
  }

  /**
   * Override getExternalUrl().
   *
   * Return the HTML URI of a public file.
   */
  function getExternalUrl() {
    return '/dummy/example.txt';
  }

}

Members

Namesort descending Modifiers Type Description Overrides
DummyReadOnlyStreamWrapper::getDirectoryPath function Gets the path that the wrapper is responsible for. Overrides LocalStream::getDirectoryPath
DummyReadOnlyStreamWrapper::getExternalUrl function Override getExternalUrl(). Overrides StreamWrapperInterface::getExternalUrl
DummyReadOnlyStreamWrapper::getInternalUri function Override getInternalUri().
LocalReadOnlyStream::chmod public function Support for chmod(). Overrides LocalStream::chmod
LocalReadOnlyStream::mkdir public function Support for mkdir(). Overrides LocalStream::mkdir
LocalReadOnlyStream::rename public function Support for rename(). Overrides LocalStream::rename
LocalReadOnlyStream::rmdir public function Support for rmdir(). Overrides LocalStream::rmdir
LocalReadOnlyStream::stream_flush public function Support for fflush(). Overrides LocalStream::stream_flush
LocalReadOnlyStream::stream_lock public function Support for flock(). Overrides LocalStream::stream_lock
LocalReadOnlyStream::stream_open public function Support for fopen(), file_get_contents(), etc. Overrides LocalStream::stream_open
LocalReadOnlyStream::stream_write public function Support for fwrite(), file_put_contents() etc. Overrides LocalStream::stream_write
LocalReadOnlyStream::unlink public function Support for unlink(). Overrides LocalStream::unlink
LocalStream::$context public property Stream context resource.
LocalStream::$handle public property A generic resource handle.
LocalStream::$uri protected property Instance URI (stream).
LocalStream::dirname public function Gets the name of the directory from a given path. Overrides StreamWrapperInterface::dirname
LocalStream::dir_closedir public function Support for closedir(). Overrides PhpStreamWrapperInterface::dir_closedir
LocalStream::dir_opendir public function Support for opendir(). Overrides PhpStreamWrapperInterface::dir_opendir
LocalStream::dir_readdir public function Support for readdir(). Overrides PhpStreamWrapperInterface::dir_readdir
LocalStream::dir_rewinddir public function Support for rewinddir(). Overrides PhpStreamWrapperInterface::dir_rewinddir
LocalStream::getLocalPath protected function Returns the canonical absolute path of the URI, if possible.
LocalStream::getMimeType static function Implements Drupal\Core\StreamWrapper\StreamWrapperInterface::getMimeType(). Overrides StreamWrapperInterface::getMimeType
LocalStream::getTarget protected function Returns the local writable target of the resource within the stream.
LocalStream::getUri function Implements Drupal\Core\StreamWrapper\StreamWrapperInterface::getUri(). Overrides StreamWrapperInterface::getUri
LocalStream::realpath function Implements Drupal\Core\StreamWrapper\StreamWrapperInterface::realpath(). Overrides StreamWrapperInterface::realpath 1
LocalStream::setUri function Implements Drupal\Core\StreamWrapper\StreamWrapperInterface::setUri(). Overrides StreamWrapperInterface::setUri
LocalStream::stream_cast public function Gets the underlying stream resource for stream_select().
LocalStream::stream_close public function Support for fclose(). Overrides PhpStreamWrapperInterface::stream_close
LocalStream::stream_eof public function Support for feof(). Overrides PhpStreamWrapperInterface::stream_eof
LocalStream::stream_read public function Support for fread(), file_get_contents() etc. Overrides PhpStreamWrapperInterface::stream_read
LocalStream::stream_seek public function Support for fseek(). Overrides PhpStreamWrapperInterface::stream_seek
LocalStream::stream_stat public function Support for fstat(). Overrides PhpStreamWrapperInterface::stream_stat
LocalStream::stream_tell public function Support for ftell(). Overrides PhpStreamWrapperInterface::stream_tell
LocalStream::url_stat public function Support for stat(). Overrides PhpStreamWrapperInterface::url_stat