Update to Drupal 8.2.0. For more information, see https://www.drupal.org/project/drupal/releases/8.2.0
This commit is contained in:
parent
2f563ab520
commit
f1c8716f57
1732 changed files with 52334 additions and 11780 deletions
|
@ -23,24 +23,7 @@ abstract class LocalReadOnlyStream extends LocalStream {
|
|||
}
|
||||
|
||||
/**
|
||||
* Support for fopen(), file_get_contents(), etc.
|
||||
*
|
||||
* Any write modes will be rejected, as this is a read-only stream wrapper.
|
||||
*
|
||||
* @param string $uri
|
||||
* A string containing the URI to the file to open.
|
||||
* @param int $mode
|
||||
* The file mode, only strict readonly modes are supported.
|
||||
* @param int $options
|
||||
* A bit mask of STREAM_USE_PATH and STREAM_REPORT_ERRORS.
|
||||
* @param string $opened_path
|
||||
* A string containing the path actually opened.
|
||||
*
|
||||
* @return bool
|
||||
* TRUE if $mode denotes a readonly mode and the file was opened
|
||||
* successfully, FALSE otherwise.
|
||||
*
|
||||
* @see http://php.net/manual/streamwrapper.stream-open.php
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function stream_open($uri, $mode, $options, &$opened_path) {
|
||||
if (!in_array($mode, array('r', 'rb', 'rt'))) {
|
||||
|
@ -49,15 +32,7 @@ abstract class LocalReadOnlyStream extends LocalStream {
|
|||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
$this->uri = $uri;
|
||||
$path = $this->getLocalPath();
|
||||
$this->handle = ($options & STREAM_REPORT_ERRORS) ? fopen($path, $mode) : @fopen($path, $mode);
|
||||
if ($this->handle !== FALSE && ($options & STREAM_USE_PATH)) {
|
||||
$opened_path = $path;
|
||||
}
|
||||
|
||||
return (bool) $this->handle;
|
||||
return parent::stream_open($uri, $mode, $options, $opened_path);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -66,7 +66,7 @@ class PublicStream extends LocalStream {
|
|||
public static function baseUrl() {
|
||||
$settings_base_url = Settings::get('file_public_base_url', '');
|
||||
if ($settings_base_url) {
|
||||
return (string) $settings_base_url;
|
||||
return (string) $settings_base_url;
|
||||
}
|
||||
else {
|
||||
return $GLOBALS['base_url'] . '/' . static::basePath();
|
||||
|
|
|
@ -2,14 +2,17 @@
|
|||
|
||||
namespace Drupal\Core\StreamWrapper;
|
||||
|
||||
use Symfony\Component\DependencyInjection\ContainerAware;
|
||||
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
|
||||
use Symfony\Component\DependencyInjection\ContainerAwareTrait;
|
||||
|
||||
/**
|
||||
* Provides a StreamWrapper manager.
|
||||
*
|
||||
* @see \Drupal\Core\StreamWrapper\StreamWrapperInterface
|
||||
*/
|
||||
class StreamWrapperManager extends ContainerAware implements StreamWrapperManagerInterface {
|
||||
class StreamWrapperManager implements ContainerAwareInterface, StreamWrapperManagerInterface {
|
||||
|
||||
use ContainerAwareTrait;
|
||||
|
||||
/**
|
||||
* Contains stream wrapper info.
|
||||
|
|
Reference in a new issue