You are here

abstract class StreamWrapperBase in System stream wrapper 8

Provides a base class for all stream wrappers.

Hierarchy

Expanded class hierarchy of StreamWrapperBase

File

src/StreamWrapper/StreamWrapperBase.php, line 10

Namespace

Drupal\system_stream_wrapper\StreamWrapper
View source
abstract class StreamWrapperBase implements StreamWrapperInterface {

  /**
   * Stream context resource.
   *
   * @var resource
   */
  public $context;

  /**
   * A generic resource handle.
   *
   * @var resource
   */
  public $handle = NULL;

  /**
   * Instance URI (stream).
   *
   * A stream is referenced as "scheme://target".
   *
   * @var string
   */
  protected $uri;

  /**
   * {@inheritdoc}
   */
  function setUri($uri) {
    if (strpos($uri, '://') === FALSE) {

      // The delimiter ('://') was not found in $uri, malformed $uri passed.
      throw new \InvalidArgumentException("Malformed uri parameter passed: {$this->uri}");
    }
    $this->uri = $uri;
  }

  /**
   * {@inheritdoc}
   */
  function getUri() {
    return $this->uri;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
PhpStreamWrapperInterface::dir_closedir public function 1
PhpStreamWrapperInterface::dir_opendir public function 1
PhpStreamWrapperInterface::dir_readdir public function 1
PhpStreamWrapperInterface::dir_rewinddir public function 1
PhpStreamWrapperInterface::mkdir public function 2
PhpStreamWrapperInterface::rename public function 2
PhpStreamWrapperInterface::rmdir public function 2
PhpStreamWrapperInterface::stream_cast public function Retrieve the underlying stream resource. 1
PhpStreamWrapperInterface::stream_close public function Closes stream. 1
PhpStreamWrapperInterface::stream_eof public function 1
PhpStreamWrapperInterface::stream_flush public function 2
PhpStreamWrapperInterface::stream_lock public function 2
PhpStreamWrapperInterface::stream_metadata public function Sets metadata on the stream. 2
PhpStreamWrapperInterface::stream_open public function 2
PhpStreamWrapperInterface::stream_read public function 1
PhpStreamWrapperInterface::stream_seek public function Seeks to specific location in a stream. 1
PhpStreamWrapperInterface::stream_set_option public function Change stream options. 1
PhpStreamWrapperInterface::stream_stat public function 1
PhpStreamWrapperInterface::stream_tell public function 1
PhpStreamWrapperInterface::stream_truncate public function Truncate stream. 2
PhpStreamWrapperInterface::stream_write public function 2
PhpStreamWrapperInterface::unlink public function 2
PhpStreamWrapperInterface::url_stat public function 1
StreamWrapperBase::$context public property Stream context resource.
StreamWrapperBase::$handle public property A generic resource handle.
StreamWrapperBase::$uri protected property Instance URI (stream).
StreamWrapperBase::getUri function Returns the stream resource URI. Overrides StreamWrapperInterface::getUri
StreamWrapperBase::setUri function Sets the absolute stream resource URI. Overrides StreamWrapperInterface::setUri
StreamWrapperInterface::ALL constant A filter that matches all wrappers.
StreamWrapperInterface::dirname public function Gets the name of the directory from a given path. 1
StreamWrapperInterface::getDescription public function Returns the description of the stream wrapper for use in the UI. 6
StreamWrapperInterface::getExternalUrl public function Returns a web accessible URL for the resource. 6
StreamWrapperInterface::getName public function Returns the name of the stream wrapper for use in the UI. 6
StreamWrapperInterface::getType public static function Returns the type of stream wrapper. 1
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 This is the default 'type' flag. This does not include StreamWrapperInterface::LOCAL, because PHP grants a greater trust level to local files (for example, they can be used in an "include" statement, regardless of the…
StreamWrapperInterface::READ constant Wrapper is readable (almost always true).
StreamWrapperInterface::READ_VISIBLE constant Visible and read-only.
StreamWrapperInterface::realpath public function Returns canonical, absolute path of the resource. 1
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.