ThemeStream.php in System stream wrapper 8
File
src/StreamWrapper/ThemeStream.php
View source
<?php
namespace Drupal\system_stream_wrapper\StreamWrapper;
class ThemeStream extends ExtensionStreamBase {
protected $themeHandler;
protected function getOwnerName() {
$name = parent::getOwnerName();
if (!$this
->getThemeHandler()
->themeExists($name)) {
throw new \InvalidArgumentException("Theme {$name} does not exist or is not installed");
}
return $name;
}
protected function getDirectoryPath() {
return $this
->getThemeHandler()
->getTheme($this
->getOwnerName())
->getPath();
}
public function getName() {
return $this
->t('Theme files');
}
public function getDescription() {
return $this
->t('Local files stored under theme directory.');
}
protected function getThemeHandler() {
if (!isset($this->themeHandler)) {
$this->themeHandler = \Drupal::service('theme_handler');
}
return $this->themeHandler;
}
}
Classes
Name |
Description |
ThemeStream |
Defines the read-only theme:// stream wrapper for theme files. |