Drupal 8.0.0 beta 12. More info: https://www.drupal.org/node/2514176
This commit is contained in:
commit
9921556621
13277 changed files with 1459781 additions and 0 deletions
57
core/modules/locale/src/StreamWrapper/TranslationsStream.php
Normal file
57
core/modules/locale/src/StreamWrapper/TranslationsStream.php
Normal file
|
@ -0,0 +1,57 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\locale\StreamWrapper\TranslationsStream.
|
||||
*/
|
||||
|
||||
namespace Drupal\locale\StreamWrapper;
|
||||
|
||||
use Drupal\Core\Annotation\StreamWrapper;
|
||||
use Drupal\Core\Annotation\Translation;
|
||||
use Drupal\Core\StreamWrapper\LocalStream;
|
||||
use Drupal\Core\StreamWrapper\StreamWrapperInterface;
|
||||
|
||||
/**
|
||||
* Defines a Drupal translations (translations://) stream wrapper class.
|
||||
*
|
||||
* Provides support for storing translation files.
|
||||
*/
|
||||
class TranslationsStream extends LocalStream {
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public static function getType() {
|
||||
return StreamWrapperInterface::LOCAL_HIDDEN;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getName() {
|
||||
return t('Translation files');
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getDescription() {
|
||||
return t('Translation files');
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Core\StreamWrapper\LocalStream::getDirectoryPath()
|
||||
*/
|
||||
function getDirectoryPath() {
|
||||
return \Drupal::config('locale.settings')->get('translation.path');
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements Drupal\Core\StreamWrapper\StreamWrapperInterface::getExternalUrl().
|
||||
* @throws \LogicException PO files URL should not be public.
|
||||
*/
|
||||
function getExternalUrl() {
|
||||
throw new \LogicException('PO files URL should not be public.');
|
||||
}
|
||||
}
|
Reference in a new issue