class DummyExternalReadOnlyWrapper

Same name in other branches
  1. 9 core/modules/file/tests/file_test/src/StreamWrapper/DummyExternalReadOnlyWrapper.php \Drupal\file_test\StreamWrapper\DummyExternalReadOnlyWrapper
  2. 11.x core/modules/file/tests/file_test/src/StreamWrapper/DummyExternalReadOnlyWrapper.php \Drupal\file_test\StreamWrapper\DummyExternalReadOnlyWrapper

Helper class for testing the stream wrapper registry.

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

Hierarchy

Expanded class hierarchy of DummyExternalReadOnlyWrapper

1 string reference to 'DummyExternalReadOnlyWrapper'
file_test.services.yml in core/modules/file/tests/file_test/file_test.services.yml
core/modules/file/tests/file_test/file_test.services.yml
1 service uses DummyExternalReadOnlyWrapper
stream_wrapper.dummy_external_readonly in core/modules/file/tests/file_test/file_test.services.yml
Drupal\file_test\StreamWrapper\DummyExternalReadOnlyWrapper

File

core/modules/file/tests/file_test/src/StreamWrapper/DummyExternalReadOnlyWrapper.php, line 13

Namespace

Drupal\file_test\StreamWrapper
View source
class DummyExternalReadOnlyWrapper extends ReadOnlyStream {
    
    /**
     * {@inheritdoc}
     */
    public static function getType() {
        return StreamWrapperInterface::READ_VISIBLE;
    }
    
    /**
     * {@inheritdoc}
     */
    public function getName() {
        return t('Dummy external stream wrapper (readonly)');
    }
    
    /**
     * {@inheritdoc}
     */
    public function getDescription() {
        return t('Dummy external read-only stream wrapper for testing.');
    }
    
    /**
     * {@inheritdoc}
     */
    public function getExternalUrl() {
        [
            ,
            $target,
        ] = explode('://', $this->uri, 2);
        return 'https://www.dummy-external-readonly.com/' . $target;
    }
    
    /**
     * {@inheritdoc}
     */
    public function realpath() {
        return FALSE;
    }
    
    /**
     * {@inheritdoc}
     */
    public function dirname($uri = NULL) {
        return FALSE;
    }
    
    /**
     * {@inheritdoc}
     */
    public function dir_closedir() {
        return FALSE;
    }
    
    /**
     * {@inheritdoc}
     */
    public function dir_opendir($path, $options) {
        return FALSE;
    }
    
    /**
     * {@inheritdoc}
     */
    public function dir_readdir() {
        return FALSE;
    }
    
    /**
     * {@inheritdoc}
     */
    public function dir_rewinddir() {
        return FALSE;
    }
    
    /**
     * {@inheritdoc}
     */
    public function stream_cast($cast_as) {
        return FALSE;
    }
    
    /**
     * {@inheritdoc}
     */
    public function stream_close() {
        return FALSE;
    }
    
    /**
     * {@inheritdoc}
     */
    public function stream_eof() {
        return FALSE;
    }
    
    /**
     * {@inheritdoc}
     */
    public function stream_read($count) {
        return FALSE;
    }
    
    /**
     * {@inheritdoc}
     */
    public function stream_seek($offset, $whence = SEEK_SET) {
        return FALSE;
    }
    
    /**
     * {@inheritdoc}
     */
    public function stream_set_option($option, $arg1, $arg2) {
        return FALSE;
    }
    
    /**
     * {@inheritdoc}
     */
    public function stream_stat() {
        return FALSE;
    }
    
    /**
     * {@inheritdoc}
     */
    public function stream_tell() {
        return FALSE;
    }
    
    /**
     * {@inheritdoc}
     */
    public function url_stat($path, $flags) {
        return FALSE;
    }

}

Members

Title Sort descending Modifiers Object type Summary Overriden Title
DummyExternalReadOnlyWrapper::dirname public function Gets the name of the directory from a given path. Overrides StreamWrapperInterface::dirname
DummyExternalReadOnlyWrapper::dir_closedir public function Close directory handle. Overrides PhpStreamWrapperInterface::dir_closedir
DummyExternalReadOnlyWrapper::dir_opendir public function Open directory handle. Overrides PhpStreamWrapperInterface::dir_opendir
DummyExternalReadOnlyWrapper::dir_readdir public function Read entry from directory handle. Overrides PhpStreamWrapperInterface::dir_readdir
DummyExternalReadOnlyWrapper::dir_rewinddir public function Rewind directory handle. Overrides PhpStreamWrapperInterface::dir_rewinddir
DummyExternalReadOnlyWrapper::getDescription public function Returns the description of the stream wrapper for use in the UI. Overrides StreamWrapperInterface::getDescription
DummyExternalReadOnlyWrapper::getExternalUrl public function Returns a web accessible URL for the resource. Overrides StreamWrapperInterface::getExternalUrl
DummyExternalReadOnlyWrapper::getName public function Returns the name of the stream wrapper for use in the UI. Overrides StreamWrapperInterface::getName
DummyExternalReadOnlyWrapper::getType public static function Returns the type of stream wrapper. Overrides StreamWrapperInterface::getType
DummyExternalReadOnlyWrapper::realpath public function Returns canonical, absolute path of the resource. Overrides StreamWrapperInterface::realpath
DummyExternalReadOnlyWrapper::stream_cast public function Retrieve the underlying stream resource. Overrides PhpStreamWrapperInterface::stream_cast
DummyExternalReadOnlyWrapper::stream_close public function Closes stream. Overrides PhpStreamWrapperInterface::stream_close
DummyExternalReadOnlyWrapper::stream_eof public function Tests for end-of-file on a file pointer. Overrides PhpStreamWrapperInterface::stream_eof
DummyExternalReadOnlyWrapper::stream_read public function Read from stream. Overrides PhpStreamWrapperInterface::stream_read
DummyExternalReadOnlyWrapper::stream_seek public function Seeks to specific location in a stream. Overrides PhpStreamWrapperInterface::stream_seek
DummyExternalReadOnlyWrapper::stream_set_option public function Change stream options. Overrides PhpStreamWrapperInterface::stream_set_option
DummyExternalReadOnlyWrapper::stream_stat public function Retrieve information about a file resource. Overrides PhpStreamWrapperInterface::stream_stat
DummyExternalReadOnlyWrapper::stream_tell public function Retrieve the current position of a stream. Overrides PhpStreamWrapperInterface::stream_tell
DummyExternalReadOnlyWrapper::url_stat public function Retrieve information about a file. Overrides PhpStreamWrapperInterface::url_stat
ReadOnlyStream::$context public property Stream context resource.
ReadOnlyStream::$handle public property A generic resource handle.
ReadOnlyStream::$uri protected property Instance URI (stream).
ReadOnlyStream::getLocalPath protected function Returns the canonical absolute path of the URI, if possible.
ReadOnlyStream::getUri public function Returns the stream resource URI. Overrides StreamWrapperInterface::getUri
ReadOnlyStream::mkdir public function Support for mkdir(). Overrides PhpStreamWrapperInterface::mkdir
ReadOnlyStream::rename public function Support for rename(). Overrides PhpStreamWrapperInterface::rename
ReadOnlyStream::rmdir public function Support for rmdir(). Overrides PhpStreamWrapperInterface::rmdir
ReadOnlyStream::setUri public function Sets the absolute stream resource URI. Overrides StreamWrapperInterface::setUri
ReadOnlyStream::stream_flush public function Support for fflush(). Overrides PhpStreamWrapperInterface::stream_flush
ReadOnlyStream::stream_lock public function Support for flock(). Overrides PhpStreamWrapperInterface::stream_lock
ReadOnlyStream::stream_metadata public function Does not change meta data as this is a read-only stream wrapper. Overrides PhpStreamWrapperInterface::stream_metadata
ReadOnlyStream::stream_open public function Support for fopen(), file_get_contents(), etc. Overrides PhpStreamWrapperInterface::stream_open
ReadOnlyStream::stream_truncate public function Truncate stream. Overrides PhpStreamWrapperInterface::stream_truncate
ReadOnlyStream::stream_write public function Support for fwrite(), file_put_contents() etc. Overrides PhpStreamWrapperInterface::stream_write
ReadOnlyStream::unlink public function Support for unlink(). Overrides PhpStreamWrapperInterface::unlink
StreamWrapperInterface::ALL constant A filter that matches all wrappers.
StreamWrapperInterface::HIDDEN constant Defines the stream wrapper bit flag for a hidden file.
StreamWrapperInterface::LOCAL constant Refers to a local file system location.
StreamWrapperInterface::LOCAL_HIDDEN constant Hidden, readable and writable using local files.
StreamWrapperInterface::LOCAL_NORMAL constant Visible, readable and writable using local files.
StreamWrapperInterface::NORMAL constant The default 'type' flag.
StreamWrapperInterface::READ constant Wrapper is readable (almost always true).
StreamWrapperInterface::READ_VISIBLE constant Visible and read-only.
StreamWrapperInterface::VISIBLE constant Exposed in the UI and potentially web accessible.
StreamWrapperInterface::WRITE constant Wrapper is writable.
StreamWrapperInterface::WRITE_VISIBLE constant Visible, readable and writable.

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