Update to drupal 8.0.0-rc1. For more information, see https://www.drupal.org/node/2582663

This commit is contained in:
Greg Anderson 2015-10-08 11:40:12 -07:00
parent eb34d130a8
commit f32e58e4b1
8476 changed files with 211648 additions and 170042 deletions

View file

@ -59,6 +59,10 @@ class PrivateStream extends LocalStream {
/**
* Returns the base path for private://.
*
* Note that this static method is used by \Drupal\system\Form\FileSystemForm
* so you should alter that form or substitute a different form if you change
* the class providing the stream_wrapper.private service.
*
* @return string
* The base path for private://.
*/

View file

@ -53,7 +53,29 @@ class PublicStream extends LocalStream {
*/
public function getExternalUrl() {
$path = str_replace('\\', '/', $this->getTarget());
return $GLOBALS['base_url'] . '/' . self::getDirectoryPath() . '/' . UrlHelper::encodePath($path);
return static::baseUrl() . '/' . UrlHelper::encodePath($path);
}
/**
* Finds and returns the base URL for public://.
*
* Defaults to the current site's base URL plus directory path.
*
* Note that this static method is used by \Drupal\system\Form\FileSystemForm
* so you should alter that form or substitute a different form if you change
* the class providing the stream_wrapper.public service.
*
* @return string
* The external base URL for public://
*/
public static function baseUrl() {
$settings_base_url = Settings::get('file_public_base_url', '');
if ($settings_base_url) {
return (string) $settings_base_url;
}
else {
return $GLOBALS['base_url'] . '/' . static::basePath();
}
}
/**
@ -63,6 +85,10 @@ class PublicStream extends LocalStream {
* Otherwise we build a reasonable default based on the site.path service if
* it's available, or a default behavior based on the request.
*
* Note that this static method is used by \Drupal\system\Form\FileSystemForm
* so you should alter that form or substitute a different form if you change
* the class providing the stream_wrapper.public service.
*
* The site path is injectable from the site.path service:
* @code
* $base_path = PublicStream::basePath(\Drupal::service('site.path'));