ReviewOS

also looking at this

meemalabs/flysystem-meema

Initial implementation

#2
Merged harlekoy wants to merge develop into master
4 files +3827 -0

Review threads live on the whole diff, not on one commit, so none are shown here - a thread's line means something in the branch's final form, and painting it into an intermediate step would put it on code it is not about.

composer.lockmodified+4-4
Changes to composer.lock
@@ -729,12 +729,12 @@
729729 "source": {
730730 "type": "git",
731731 "url": "https://github.com/meemalabs/meema-client-php.git",
732 "reference": "70f01797984e47e55c90f76a71b9c26e28a1e407"
732 "reference": "e666b6951f2c5ce9526c4dab7f45e5df8f69f2cc"
733733 },
734734 "dist": {
735735 "type": "zip",
736 "url": "https://api.github.com/repos/meemalabs/meema-client-php/zipball/70f01797984e47e55c90f76a71b9c26e28a1e407",
737 "reference": "70f01797984e47e55c90f76a71b9c26e28a1e407",
736 "url": "https://api.github.com/repos/meemalabs/meema-client-php/zipball/e666b6951f2c5ce9526c4dab7f45e5df8f69f2cc",
737 "reference": "e666b6951f2c5ce9526c4dab7f45e5df8f69f2cc",
738738 "shasum": ""
739739 },
740740 "require": {
@@ -779,7 +779,7 @@
779779 "video conversions",
780780 "video converter"
781781 ],
782 "time": "2021-04-16T04:58:38+00:00"
782 "time": "2021-04-22T04:08:26+00:00"
783783 },
784784 {
785785 "name": "nesbot/carbon",
src/MeemaAdapter.phpmodified+18-18
Changes to src/MeemaAdapter.php
@@ -15,7 +15,7 @@ class MeemaAdapter extends AbstractAdapter
1515
1616 public function __construct()
1717 {
18 $this->client = new Client('pk_live|2|1|0dtrJyDb4FHoIIeKm4r0J9R9OX9WZyKlRpEamnEz', ['base_url' => 'http://meema-api.test/api/']);
18 $this->client = new Client(env('MEEMA_API_KEY'));
1919 }
2020
2121 /**
@@ -29,7 +29,7 @@ class MeemaAdapter extends AbstractAdapter
2929 */
3030 public function write($path, $contents, Config $config)
3131 {
32 return $this->client->media()->upload($path);
32 return $this->client->storage()->upload($path);
3333 }
3434
3535 /**
@@ -43,7 +43,7 @@ class MeemaAdapter extends AbstractAdapter
4343 */
4444 public function writeStream($path, $resource, Config $config)
4545 {
46 return $this->client->media()->upload($path);
46 return $this->client->storage()->upload($path);
4747 }
4848
4949 /**
@@ -57,21 +57,21 @@ class MeemaAdapter extends AbstractAdapter
5757 */
5858 public function update($path, $contents, Config $config)
5959 {
60 return [];
60 return $this->client->storage()->upload($path);
6161 }
6262
6363 /**
6464 * Update a file using a stream.
6565 *
66 * @param string $path
66 * @param string $path
6767 * @param resource $resource
68 * @param Config $config Config object
68 * @param Config $config Config object
6969 *
7070 * @return array|false false on failure file meta data on success
7171 */
7272 public function updateStream($path, $resource, Config $config)
7373 {
74 return [];
74 return $this->client->storage()->upload($path);
7575 }
7676
7777 /**
@@ -84,7 +84,7 @@ class MeemaAdapter extends AbstractAdapter
8484 */
8585 public function rename($path, $newpath)
8686 {
87 return [];
87 return $this->client->storage()->rename($path, $newpath);
8888 }
8989
9090 /**
@@ -97,7 +97,7 @@ class MeemaAdapter extends AbstractAdapter
9797 */
9898 public function copy($path, $newpath)
9999 {
100 return [];
100 return $this->client->storage()->copy($path, $newpath);
101101 }
102102
103103 /**
@@ -109,7 +109,7 @@ class MeemaAdapter extends AbstractAdapter
109109 */
110110 public function delete($path)
111111 {
112 return [];
112 return $this->client->storage()->delete($path);
113113 }
114114
115115 /**
@@ -121,7 +121,7 @@ class MeemaAdapter extends AbstractAdapter
121121 */
122122 public function deleteDir($dirname)
123123 {
124 return [];
124 return $this->client->storage()->deleteDirectory($dirname);
125125 }
126126
127127 /**
@@ -134,7 +134,7 @@ class MeemaAdapter extends AbstractAdapter
134134 */
135135 public function createDir($dirname, Config $config)
136136 {
137 return [];
137 return $this->client->storage()->makeDirectory($dirname);
138138 }
139139
140140 /**
@@ -147,7 +147,7 @@ class MeemaAdapter extends AbstractAdapter
147147 */
148148 public function setVisibility($path, $visibility)
149149 {
150 return $this->client->media()->setVisibility($path, $visibility);
150 return $this->client->storage()->setVisibility($path, $visibility);
151151 }
152152
153153 /**
@@ -159,7 +159,7 @@ class MeemaAdapter extends AbstractAdapter
159159 */
160160 public function has($path)
161161 {
162 return $this->client->media()->has($path);
162 return $this->client->storage()->has($path);
163163 }
164164
165165 /**
@@ -171,7 +171,7 @@ class MeemaAdapter extends AbstractAdapter
171171 */
172172 public function read($path)
173173 {
174 return false;
174 return $this->getMetadata($path);
175175 }
176176
177177 /**
@@ -184,7 +184,7 @@ class MeemaAdapter extends AbstractAdapter
184184 */
185185 public function listContents($directory = '', $recursive = false)
186186 {
187 return [];
187 return $this->client->storage()->listContents($directory, $recursive);
188188 }
189189
190190 /**
@@ -196,7 +196,7 @@ class MeemaAdapter extends AbstractAdapter
196196 */
197197 public function readStream($path)
198198 {
199 return [];
199 return $this->getMetadata($path);
200200 }
201201
202202 /**
@@ -208,7 +208,7 @@ class MeemaAdapter extends AbstractAdapter
208208 */
209209 public function getMetadata($path)
210210 {
211 return $this->client->media()->getMetadata($path);
211 return $this->client->storage()->getMetadata($path);
212212 }
213213
214214 /**