Further modules included.
[yaffs-website] / web / modules / contrib / libraries / src / StreamWrapper / PrivateStreamTrait.php
1 <?php
2
3 namespace Drupal\libraries\StreamWrapper;
4
5 /**
6  * Provides a trait for local streams that are not publicly accessible.
7  *
8  * @see \Drupal\locale\StreamWrapper\TranslationsStream
9  */
10 trait PrivateStreamTrait {
11
12   /**
13    * Returns a web accessible URL for the resource.
14    *
15    * This function should return a URL that can be embedded in a web page
16    * and accessed from a browser. For example, the external URL of
17    * "youtube://xIpLd0WQKCY" might be
18    * "http://www.youtube.com/watch?v=xIpLd0WQKCY".
19    *
20    * @return string
21    *   Returns a string containing a web accessible URL for the resource.
22    *
23    * @see \Drupal\Core\StreamWrapper\StreamWrapperInterface::getExternalUrl()
24    */
25   function getExternalUrl() {
26     throw new \LogicException("{$this->getName()} should not be public.");
27   }
28
29   /**
30    * Returns the name of the stream wrapper for use in the UI.
31    *
32    * @return string
33    *   The stream wrapper name.
34    *
35    * @see \Drupal\Core\StreamWrapper\StreamWrapperInterface::getName()
36    */
37   abstract public function getName();
38
39 }