Merge "Fix typo accessable --> accessible"
[lhc/web/wiklou.git] / includes / externalstore / ExternalStoreHttp.php
index 311e32b..879686f 100644 (file)
  */
 
 /**
- * Example class for HTTP accessable external objects.
+ * Example class for HTTP accessible external objects.
  * Only supports reading, not storing.
  *
  * @ingroup ExternalStorage
  */
-class ExternalStoreHttp {
+class ExternalStoreHttp extends ExternalStoreMedium {
+       public function fetchFromURL( $url ) {
+               return Http::get( $url, [], __METHOD__ );
+       }
 
-       /**
-        * Fetch data from given URL
-        *
-        * @param $url String: the URL
-        * @return String: the content at $url
-        */
-       function fetchFromURL( $url ) {
-               $ret = Http::get( $url );
-               return $ret;
+       public function store( $location, $data ) {
+               throw new MWException( "ExternalStoreHttp is read-only and does not support store()." );
        }
 
-       /* XXX: may require other methods, for store, delete,
-        * whatever, for initial ext storage
-        */
+       public function isReadOnly( $location ) {
+               return true;
+       }
 }