also looking at this
Initial implementation
#2
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.
| @@ -729,12 +729,12 @@ | ||
| 729 | 729 | "source": { |
| 730 | 730 | "type": "git", |
| 731 | 731 | "url": "https://github.com/meemalabs/meema-client-php.git", |
| 732 | "reference": "70f01797984e47e55c90f76a71b9c26e28a1e407" | |
| 732 | "reference": "e666b6951f2c5ce9526c4dab7f45e5df8f69f2cc" | |
| 733 | 733 | }, |
| 734 | 734 | "dist": { |
| 735 | 735 | "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", | |
| 738 | 738 | "shasum": "" |
| 739 | 739 | }, |
| 740 | 740 | "require": { |
| @@ -779,7 +779,7 @@ | ||
| 779 | 779 | "video conversions", |
| 780 | 780 | "video converter" |
| 781 | 781 | ], |
| 782 | "time": "2021-04-16T04:58:38+00:00" | |
| 782 | "time": "2021-04-22T04:08:26+00:00" | |
| 783 | 783 | }, |
| 784 | 784 | { |
| 785 | 785 | "name": "nesbot/carbon", |
| @@ -15,7 +15,7 @@ class MeemaAdapter extends AbstractAdapter | ||
| 15 | 15 | |
| 16 | 16 | public function __construct() |
| 17 | 17 | { |
| 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')); | |
| 19 | 19 | } |
| 20 | 20 | |
| 21 | 21 | /** |
| @@ -29,7 +29,7 @@ class MeemaAdapter extends AbstractAdapter | ||
| 29 | 29 | */ |
| 30 | 30 | public function write($path, $contents, Config $config) |
| 31 | 31 | { |
| 32 | return $this->client->media()->upload($path); | |
| 32 | return $this->client->storage()->upload($path); | |
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | /** |
| @@ -43,7 +43,7 @@ class MeemaAdapter extends AbstractAdapter | ||
| 43 | 43 | */ |
| 44 | 44 | public function writeStream($path, $resource, Config $config) |
| 45 | 45 | { |
| 46 | return $this->client->media()->upload($path); | |
| 46 | return $this->client->storage()->upload($path); | |
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | /** |
| @@ -57,21 +57,21 @@ class MeemaAdapter extends AbstractAdapter | ||
| 57 | 57 | */ |
| 58 | 58 | public function update($path, $contents, Config $config) |
| 59 | 59 | { |
| 60 | return []; | |
| 60 | return $this->client->storage()->upload($path); | |
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | /** |
| 64 | 64 | * Update a file using a stream. |
| 65 | 65 | * |
| 66 | * @param string $path | |
| 66 | * @param string $path | |
| 67 | 67 | * @param resource $resource |
| 68 | * @param Config $config Config object | |
| 68 | * @param Config $config Config object | |
| 69 | 69 | * |
| 70 | 70 | * @return array|false false on failure file meta data on success |
| 71 | 71 | */ |
| 72 | 72 | public function updateStream($path, $resource, Config $config) |
| 73 | 73 | { |
| 74 | return []; | |
| 74 | return $this->client->storage()->upload($path); | |
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | /** |
| @@ -84,7 +84,7 @@ class MeemaAdapter extends AbstractAdapter | ||
| 84 | 84 | */ |
| 85 | 85 | public function rename($path, $newpath) |
| 86 | 86 | { |
| 87 | return []; | |
| 87 | return $this->client->storage()->rename($path, $newpath); | |
| 88 | 88 | } |
| 89 | 89 | |
| 90 | 90 | /** |
| @@ -97,7 +97,7 @@ class MeemaAdapter extends AbstractAdapter | ||
| 97 | 97 | */ |
| 98 | 98 | public function copy($path, $newpath) |
| 99 | 99 | { |
| 100 | return []; | |
| 100 | return $this->client->storage()->copy($path, $newpath); | |
| 101 | 101 | } |
| 102 | 102 | |
| 103 | 103 | /** |
| @@ -109,7 +109,7 @@ class MeemaAdapter extends AbstractAdapter | ||
| 109 | 109 | */ |
| 110 | 110 | public function delete($path) |
| 111 | 111 | { |
| 112 | return []; | |
| 112 | return $this->client->storage()->delete($path); | |
| 113 | 113 | } |
| 114 | 114 | |
| 115 | 115 | /** |
| @@ -121,7 +121,7 @@ class MeemaAdapter extends AbstractAdapter | ||
| 121 | 121 | */ |
| 122 | 122 | public function deleteDir($dirname) |
| 123 | 123 | { |
| 124 | return []; | |
| 124 | return $this->client->storage()->deleteDirectory($dirname); | |
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | /** |
| @@ -134,7 +134,7 @@ class MeemaAdapter extends AbstractAdapter | ||
| 134 | 134 | */ |
| 135 | 135 | public function createDir($dirname, Config $config) |
| 136 | 136 | { |
| 137 | return []; | |
| 137 | return $this->client->storage()->makeDirectory($dirname); | |
| 138 | 138 | } |
| 139 | 139 | |
| 140 | 140 | /** |
| @@ -147,7 +147,7 @@ class MeemaAdapter extends AbstractAdapter | ||
| 147 | 147 | */ |
| 148 | 148 | public function setVisibility($path, $visibility) |
| 149 | 149 | { |
| 150 | return $this->client->media()->setVisibility($path, $visibility); | |
| 150 | return $this->client->storage()->setVisibility($path, $visibility); | |
| 151 | 151 | } |
| 152 | 152 | |
| 153 | 153 | /** |
| @@ -159,7 +159,7 @@ class MeemaAdapter extends AbstractAdapter | ||
| 159 | 159 | */ |
| 160 | 160 | public function has($path) |
| 161 | 161 | { |
| 162 | return $this->client->media()->has($path); | |
| 162 | return $this->client->storage()->has($path); | |
| 163 | 163 | } |
| 164 | 164 | |
| 165 | 165 | /** |
| @@ -171,7 +171,7 @@ class MeemaAdapter extends AbstractAdapter | ||
| 171 | 171 | */ |
| 172 | 172 | public function read($path) |
| 173 | 173 | { |
| 174 | return false; | |
| 174 | return $this->getMetadata($path); | |
| 175 | 175 | } |
| 176 | 176 | |
| 177 | 177 | /** |
| @@ -184,7 +184,7 @@ class MeemaAdapter extends AbstractAdapter | ||
| 184 | 184 | */ |
| 185 | 185 | public function listContents($directory = '', $recursive = false) |
| 186 | 186 | { |
| 187 | return []; | |
| 187 | return $this->client->storage()->listContents($directory, $recursive); | |
| 188 | 188 | } |
| 189 | 189 | |
| 190 | 190 | /** |
| @@ -196,7 +196,7 @@ class MeemaAdapter extends AbstractAdapter | ||
| 196 | 196 | */ |
| 197 | 197 | public function readStream($path) |
| 198 | 198 | { |
| 199 | return []; | |
| 199 | return $this->getMetadata($path); | |
| 200 | 200 | } |
| 201 | 201 | |
| 202 | 202 | /** |
| @@ -208,7 +208,7 @@ class MeemaAdapter extends AbstractAdapter | ||
| 208 | 208 | */ |
| 209 | 209 | public function getMetadata($path) |
| 210 | 210 | { |
| 211 | return $this->client->media()->getMetadata($path); | |
| 211 | return $this->client->storage()->getMetadata($path); | |
| 212 | 212 | } |
| 213 | 213 | |
| 214 | 214 | /** |