From 65f25dc9fe81986ee6b637506c4b4db59505f51a Mon Sep 17 00:00:00 2001 From: webchick <webchick@24967.no-reply.drupal.org> Date: Sat, 10 Mar 2012 12:16:01 -0800 Subject: [PATCH] Revert "Committing missing files to #1475020. I think. I hope." This reverts commit 2d6fdda1f01988cae782230638a41cda5217106a. --- .../PhpStreamWrapperInterface.php | 35 ----- .../Core/StreamWrapper/PrivateStream.php | 35 ----- .../Core/StreamWrapper/PublicStream.php | 35 ----- .../StreamWrapper/StreamWrapperInterface.php | 125 ------------------ .../Core/StreamWrapper/TemporaryStream.php | 32 ----- 5 files changed, 262 deletions(-) delete mode 100644 core/lib/Drupal/Core/StreamWrapper/PhpStreamWrapperInterface.php delete mode 100644 core/lib/Drupal/Core/StreamWrapper/PrivateStream.php delete mode 100644 core/lib/Drupal/Core/StreamWrapper/PublicStream.php delete mode 100644 core/lib/Drupal/Core/StreamWrapper/StreamWrapperInterface.php delete mode 100644 core/lib/Drupal/Core/StreamWrapper/TemporaryStream.php diff --git a/core/lib/Drupal/Core/StreamWrapper/PhpStreamWrapperInterface.php b/core/lib/Drupal/Core/StreamWrapper/PhpStreamWrapperInterface.php deleted file mode 100644 index 4cf41e08730a..000000000000 --- a/core/lib/Drupal/Core/StreamWrapper/PhpStreamWrapperInterface.php +++ /dev/null @@ -1,35 +0,0 @@ -<?php - -/** - * @file - * Definition of Drupal\Core\StreamWrapper\PhpStreamWrapperInterface. - */ - -namespace Drupal\Core\StreamWrapper; - -/** - * Defines a generic PHP stream wrapper interface. - * - * @see http://www.php.net/manual/en/class.streamwrapper.php - */ -interface PhpStreamWrapperInterface { - public function stream_open($uri, $mode, $options, &$opened_url); - public function stream_close(); - public function stream_lock($operation); - public function stream_read($count); - public function stream_write($data); - public function stream_eof(); - public function stream_seek($offset, $whence); - public function stream_flush(); - public function stream_tell(); - public function stream_stat(); - public function unlink($uri); - public function rename($from_uri, $to_uri); - public function mkdir($uri, $mode, $options); - public function rmdir($uri, $options); - public function url_stat($uri, $flags); - public function dir_opendir($uri, $options); - public function dir_readdir(); - public function dir_rewinddir(); - public function dir_closedir(); -} diff --git a/core/lib/Drupal/Core/StreamWrapper/PrivateStream.php b/core/lib/Drupal/Core/StreamWrapper/PrivateStream.php deleted file mode 100644 index 87316eb4f5f9..000000000000 --- a/core/lib/Drupal/Core/StreamWrapper/PrivateStream.php +++ /dev/null @@ -1,35 +0,0 @@ -<?php - -/** - * @file - * Definition of Drupal\Core\StreamWrapper\PrivateStream. - */ - -namespace Drupal\Core\StreamWrapper; - -/** - * Drupal private (private://) stream wrapper class. - * - * Provides support for storing privately accessible files with the Drupal file - * interface. - */ -class PrivateStream extends LocalStream { - - /** - * Implements Drupal\Core\StreamWrapper\LocalStream::getDirectoryPath() - */ - public function getDirectoryPath() { - return variable_get('file_private_path', ''); - } - - /** - * Implements Drupal\Core\StreamWrapper\StreamWrapperInterface::getExternalUrl(). - * - * @return string - * Returns the HTML URI of a private file. - */ - function getExternalUrl() { - $path = str_replace('\\', '/', $this->getTarget()); - return url('system/files/' . $path, array('absolute' => TRUE)); - } -} diff --git a/core/lib/Drupal/Core/StreamWrapper/PublicStream.php b/core/lib/Drupal/Core/StreamWrapper/PublicStream.php deleted file mode 100644 index 207b77a5b651..000000000000 --- a/core/lib/Drupal/Core/StreamWrapper/PublicStream.php +++ /dev/null @@ -1,35 +0,0 @@ -<?php - -/** - * @file - * Definition of Drupal\Core\StreamWrapper\PublicStream. - */ - -namespace Drupal\Core\StreamWrapper; - -/** - * Defines a Drupal public (public://) stream wrapper class. - * - * Provides support for storing publicly accessible files with the Drupal file - * interface. - */ -class PublicStream extends LocalStream { - - /** - * Implements Drupal\Core\StreamWrapper\LocalStream::getDirectoryPath() - */ - public function getDirectoryPath() { - return variable_get('file_public_path', conf_path() . '/files'); - } - - /** - * Implements Drupal\Core\StreamWrapper\StreamWrapperInterface::getExternalUrl(). - * - * @return string - * Returns the HTML URI of a public file. - */ - function getExternalUrl() { - $path = str_replace('\\', '/', $this->getTarget()); - return $GLOBALS['base_url'] . '/' . self::getDirectoryPath() . '/' . drupal_encode_path($path); - } -} diff --git a/core/lib/Drupal/Core/StreamWrapper/StreamWrapperInterface.php b/core/lib/Drupal/Core/StreamWrapper/StreamWrapperInterface.php deleted file mode 100644 index 15ba2cf1b074..000000000000 --- a/core/lib/Drupal/Core/StreamWrapper/StreamWrapperInterface.php +++ /dev/null @@ -1,125 +0,0 @@ -<?php - -/** - * @file - * Definition of Drupal\Core\StreamWrapper\StreamWrapperInterface. - * - * Provides a Drupal interface and classes to implement PHP stream wrappers for - * public, private, and temporary files. - * - * A stream wrapper is an abstraction of a file system that allows Drupal to - * use the same set of methods to access both local files and remote resources. - * - * Note that PHP 5.2 fopen() only supports URIs of the form "scheme://target" - * despite the fact that according to RFC 3986 a URI's scheme component - * delimiter is in general just ":", not "://". Because of this PHP limitation - * and for consistency Drupal will only accept URIs of form "scheme://target". - * - * @see http://www.faqs.org/rfcs/rfc3986.html - * @see http://bugs.php.net/bug.php?id=47070 - */ - -namespace Drupal\Core\StreamWrapper; - -/** - * Defines a Drupal stream wrapper extension. - * - * Extends the StreamWrapperInterface with methods expected by Drupal stream - * wrapper classes. - */ -interface StreamWrapperInterface extends PhpStreamWrapperInterface { - - /** - * Sets the absolute stream resource URI. - * - * This allows you to set the URI. Generally is only called by the factory - * method. - * - * @param string $uri - * A string containing the URI that should be used for this instance. - */ - function setUri($uri); - - /** - * Returns the stream resource URI. - * - * @return string - * Returns the current URI of the instance. - */ - public function getUri(); - - /** - * Returns a web accessible URL for the resource. - * - * This function should return a URL that can be embedded in a web page - * and accessed from a browser. For example, the external URL of - * "youtube://xIpLd0WQKCY" might be - * "http://www.youtube.com/watch?v=xIpLd0WQKCY". - * - * @return string - * Returns a string containing a web accessible URL for the resource. - */ - public function getExternalUrl(); - - /** - * Returns the MIME type of the resource. - * - * @param string $uri - * The URI, path, or filename. - * @param array $mapping - * An optional map of extensions to their mimetypes, in the form: - * - 'mimetypes': a list of mimetypes, keyed by an identifier, - * - 'extensions': the mapping itself, an associative array in which - * the key is the extension and the value is the mimetype identifier. - * - * @return string - * Returns a string containing the MIME type of the resource. - */ - public static function getMimeType($uri, $mapping = NULL); - - /** - * Changes permissions of the resource. - * - * PHP lacks this functionality and it is not part of the official stream - * wrapper interface. This is a custom implementation for Drupal. - * - * @param int $mode - * Integer value for the permissions. Consult PHP chmod() documentation - * for more information. - * - * @return bool - * Returns TRUE on success or FALSE on failure. - */ - public function chmod($mode); - - /** - * Returns canonical, absolute path of the resource. - * - * Implementation placeholder. PHP's realpath() does not support stream - * wrappers. We provide this as a default so that individual wrappers may - * implement their own solutions. - * - * @return string - * Returns a string with absolute pathname on success (implemented - * by core wrappers), or FALSE on failure or if the registered - * wrapper does not provide an implementation. - */ - public function realpath(); - - /** - * Gets the name of the directory from a given path. - * - * This method is usually accessed through drupal_dirname(), which wraps - * around the normal PHP dirname() function, which does not support stream - * wrappers. - * - * @param string $uri - * An optional URI. - * - * @return string - * A string containing the directory name, or FALSE if not applicable. - * - * @see drupal_dirname() - */ - public function dirname($uri = NULL); -} diff --git a/core/lib/Drupal/Core/StreamWrapper/TemporaryStream.php b/core/lib/Drupal/Core/StreamWrapper/TemporaryStream.php deleted file mode 100644 index 52a63212ffcf..000000000000 --- a/core/lib/Drupal/Core/StreamWrapper/TemporaryStream.php +++ /dev/null @@ -1,32 +0,0 @@ -<?php - -/** - * @file - * Definition of Drupal\Core\StreamWrapper\TemporaryStream. - */ - -namespace Drupal\Core\StreamWrapper; - -/** - * Defines a Drupal temporary (temporary://) stream wrapper class. - * - * Provides support for storing temporarily accessible files with the Drupal - * file interface. - */ -class TemporaryStream extends LocalStream { - - /** - * Implements Drupal\Core\StreamWrapper\LocalStream::getDirectoryPath() - */ - public function getDirectoryPath() { - return variable_get('file_temporary_path', file_directory_temp()); - } - - /** - * Implements Drupal\Core\StreamWrapper\StreamWrapperInterface::getExternalUrl(). - */ - public function getExternalUrl() { - $path = str_replace('\\', '/', $this->getTarget()); - return url('system/temporary/' . $path, array('absolute' => TRUE)); - } -} -- GitLab