TemporaryStream.php in Zircon Profile 8.0
File
core/lib/Drupal/Core/StreamWrapper/TemporaryStream.php
View source
<?php
namespace Drupal\Core\StreamWrapper;
use Drupal\Core\Url;
class TemporaryStream extends LocalStream {
public static function getType() {
return StreamWrapperInterface::LOCAL_HIDDEN;
}
public function getName() {
return t('Temporary files');
}
public function getDescription() {
return t('Temporary local files for upload and previews.');
}
public function getDirectoryPath() {
return file_directory_temp();
}
public function getExternalUrl() {
$path = str_replace('\\', '/', $this
->getTarget());
return Url::fromRoute('system.temporary', [], [
'absolute' => TRUE,
'query' => [
'file' => $path,
],
])
->toString();
}
}
Classes
Name |
Description |
TemporaryStream |
Defines a Drupal temporary (temporary://) stream wrapper class. |