aboutsummaryrefslogtreecommitdiffstats
path: root/includes/Rest/Stream.php
diff options
context:
space:
mode:
authorTim Starling <tstarling@wikimedia.org>2019-05-09 11:36:18 +1000
committerTim Starling <tstarling@wikimedia.org>2019-06-12 10:22:28 +1000
commit3f0056a252daa4e97396e0eb4b72651f33ce57b3 (patch)
tree406540d88dfa410c0bb8ce1bc9c8e67cc2b49ba9 /includes/Rest/Stream.php
parent1512a0d628a0b2ba8d6146a9d5de4ab0d82bcb52 (diff)
downloadmediawikicore-3f0056a252daa4e97396e0eb4b72651f33ce57b3.tar.gz
mediawikicore-3f0056a252daa4e97396e0eb4b72651f33ce57b3.zip
REST API initial commit
Add some of the basic REST API class hierarchies: * EntryPoint * Router * Request * Response * Handler The actual entry point file rest.php has been moved to a separate commit, so this is just an unused library and service. Bug: T221177 Change-Id: Ifca6bcb8a304e8e8b7f52b79c607bdcebf805cd1
Diffstat (limited to 'includes/Rest/Stream.php')
-rw-r--r--includes/Rest/Stream.php18
1 files changed, 18 insertions, 0 deletions
diff --git a/includes/Rest/Stream.php b/includes/Rest/Stream.php
new file mode 100644
index 000000000000..1169875923a2
--- /dev/null
+++ b/includes/Rest/Stream.php
@@ -0,0 +1,18 @@
+<?php
+
+namespace MediaWiki\Rest;
+
+use GuzzleHttp\Psr7;
+
+class Stream extends Psr7\Stream implements CopyableStreamInterface {
+ private $stream;
+
+ public function __construct( $stream, $options = [] ) {
+ $this->stream = $stream;
+ parent::__construct( $stream, $options );
+ }
+
+ public function copyToStream( $target ) {
+ stream_copy_to_stream( $this->stream, $target );
+ }
+}