class DummyPublicStreamWrapper

Same name and namespace in other branches
  1. 11.x core/modules/file/tests/file_test/src/StreamWrapper/DummyPublicStreamWrapper.php \Drupal\file_test\StreamWrapper\DummyPublicStreamWrapper

Helper class for testing the stream wrapper registry.

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

Hierarchy

Expanded class hierarchy of DummyPublicStreamWrapper

1 string reference to 'DummyPublicStreamWrapper'
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 DummyPublicStreamWrapper
stream_wrapper.dummy_public in core/modules/file/tests/file_test/file_test.services.yml
Drupal\file_test\StreamWrapper\DummyPublicStreamWrapper

File

core/modules/file/tests/file_test/src/StreamWrapper/DummyPublicStreamWrapper.php, line 14

Namespace

Drupal\file_test\StreamWrapper
View source
class DummyPublicStreamWrapper extends DummyStreamWrapper {
  
  /**
   * {@inheritdoc}
   */
  public function getExternalUrl() : string {
    $path = str_replace('\\', '/', $this->getTarget());
    return Url::fromRoute('file_test.public', [
      'filepath' => $path,
    ], [
      'absolute' => TRUE,
      'path_processing' => FALSE,
      'query' => [
        'file' => $path,
      ],
    ])->toString();
  }

}

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