DummyReadOnlyStreamWrapper.php in Drupal 10
File
core/modules/file/tests/file_test/src/StreamWrapper/DummyReadOnlyStreamWrapper.php
View source
<?php
namespace Drupal\file_test\StreamWrapper;
use Drupal\Core\StreamWrapper\LocalReadOnlyStream;
class DummyReadOnlyStreamWrapper extends LocalReadOnlyStream {
public function getName() {
return t('Dummy files (readonly)');
}
public function getDescription() {
return t('Dummy wrapper for testing (readonly).');
}
public function getDirectoryPath() {
return \Drupal::getContainer()
->getParameter('site.path') . '/files';
}
public function getInternalUri() {
return '/dummy/example.txt';
}
public function getExternalUrl() {
return '/dummy/example.txt';
}
}