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.jsonmodified+2-1
Changes to composer.json
@@ -19,7 +19,8 @@
1919 ],
2020 "require": {
2121 "php": "^7.0 || ^8.0",
22 "league/flysystem-aws-s3-v3": "~1.0"
22 "guzzlehttp/guzzle": "^7.3",
23 "league/flysystem": "^1.0.70"
2324 },
2425 "require-dev": {
2526 "symfony/var-dumper": "^4.3",
composer.lockmodified+137-441
Changes to composer.lock
@@ -4,116 +4,26 @@
44 "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
55 "This file is @generated automatically"
66 ],
7 "content-hash": "fa3208137dda33ecab31d1070450b28a",
7 "content-hash": "893d46f29d9bf2809e2cf7fb9eb11a7a",
88 "packages": [
9 {
10 "name": "aws/aws-sdk-php",
11 "version": "3.173.9",
12 "source": {
13 "type": "git",
14 "url": "https://github.com/aws/aws-sdk-php.git",
15 "reference": "d15688cfe291767ba203c97d5833b963f544412f"
16 },
17 "dist": {
18 "type": "zip",
19 "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/d15688cfe291767ba203c97d5833b963f544412f",
20 "reference": "d15688cfe291767ba203c97d5833b963f544412f",
21 "shasum": ""
22 },
23 "require": {
24 "ext-json": "*",
25 "ext-pcre": "*",
26 "ext-simplexml": "*",
27 "guzzlehttp/guzzle": "^5.3.3|^6.2.1|^7.0",
28 "guzzlehttp/promises": "^1.0",
29 "guzzlehttp/psr7": "^1.4.1",
30 "mtdowling/jmespath.php": "^2.5",
31 "php": ">=5.5"
32 },
33 "require-dev": {
34 "andrewsville/php-token-reflection": "^1.4",
35 "aws/aws-php-sns-message-validator": "~1.0",
36 "behat/behat": "~3.0",
37 "doctrine/cache": "~1.4",
38 "ext-dom": "*",
39 "ext-openssl": "*",
40 "ext-pcntl": "*",
41 "ext-sockets": "*",
42 "nette/neon": "^2.3",
43 "paragonie/random_compat": ">= 2",
44 "phpunit/phpunit": "^4.8.35|^5.4.3",
45 "psr/cache": "^1.0",
46 "psr/simple-cache": "^1.0",
47 "sebastian/comparator": "^1.2.3"
48 },
49 "suggest": {
50 "aws/aws-php-sns-message-validator": "To validate incoming SNS notifications",
51 "doctrine/cache": "To use the DoctrineCacheAdapter",
52 "ext-curl": "To send requests using cURL",
53 "ext-openssl": "Allows working with CloudFront private distributions and verifying received SNS messages",
54 "ext-sockets": "To use client-side monitoring"
55 },
56 "type": "library",
57 "extra": {
58 "branch-alias": {
59 "dev-master": "3.0-dev"
60 }
61 },
62 "autoload": {
63 "psr-4": {
64 "Aws\\": "src/"
65 },
66 "files": [
67 "src/functions.php"
68 ]
69 },
70 "notification-url": "https://packagist.org/downloads/",
71 "license": [
72 "Apache-2.0"
73 ],
74 "authors": [
75 {
76 "name": "Amazon Web Services",
77 "homepage": "http://aws.amazon.com"
78 }
79 ],
80 "description": "AWS SDK for PHP - Use Amazon Web Services in your PHP project",
81 "homepage": "http://aws.amazon.com/sdkforphp",
82 "keywords": [
83 "amazon",
84 "aws",
85 "cloud",
86 "dynamodb",
87 "ec2",
88 "glacier",
89 "s3",
90 "sdk"
91 ],
92 "support": {
93 "forum": "https://forums.aws.amazon.com/forum.jspa?forumID=80",
94 "issues": "https://github.com/aws/aws-sdk-php/issues",
95 "source": "https://github.com/aws/aws-sdk-php/tree/3.173.9"
96 },
97 "time": "2021-02-15T19:28:47+00:00"
98 },
999 {
10010 "name": "guzzlehttp/guzzle",
101 "version": "7.2.0",
11 "version": "7.3.0",
10212 "source": {
10313 "type": "git",
10414 "url": "https://github.com/guzzle/guzzle.git",
105 "reference": "0aa74dfb41ae110835923ef10a9d803a22d50e79"
15 "reference": "7008573787b430c1c1f650e3722d9bba59967628"
10616 },
10717 "dist": {
10818 "type": "zip",
109 "url": "https://api.github.com/repos/guzzle/guzzle/zipball/0aa74dfb41ae110835923ef10a9d803a22d50e79",
110 "reference": "0aa74dfb41ae110835923ef10a9d803a22d50e79",
19 "url": "https://api.github.com/repos/guzzle/guzzle/zipball/7008573787b430c1c1f650e3722d9bba59967628",
20 "reference": "7008573787b430c1c1f650e3722d9bba59967628",
11121 "shasum": ""
11222 },
11323 "require": {
11424 "ext-json": "*",
11525 "guzzlehttp/promises": "^1.4",
116 "guzzlehttp/psr7": "^1.7",
26 "guzzlehttp/psr7": "^1.7 || ^2.0",
11727 "php": "^7.2.5 || ^8.0",
11828 "psr/http-client": "^1.0"
11929 },
@@ -121,6 +31,7 @@
12131 "psr/http-client-implementation": "1.0"
12232 },
12333 "require-dev": {
34 "bamarni/composer-bin-plugin": "^1.4.1",
12435 "ext-curl": "*",
12536 "php-http/client-integration-tests": "^3.0",
12637 "phpunit/phpunit": "^8.5.5 || ^9.3.5",
@@ -134,7 +45,7 @@
13445 "type": "library",
13546 "extra": {
13647 "branch-alias": {
137 "dev-master": "7.1-dev"
48 "dev-master": "7.3-dev"
13849 }
13950 },
14051 "autoload": {
@@ -174,10 +85,6 @@
17485 "rest",
17586 "web service"
17687 ],
177 "support": {
178 "issues": "https://github.com/guzzle/guzzle/issues",
179 "source": "https://github.com/guzzle/guzzle/tree/7.2.0"
180 },
18188 "funding": [
18289 {
18390 "url": "https://github.com/GrahamCampbell",
@@ -196,20 +103,20 @@
196103 "type": "github"
197104 }
198105 ],
199 "time": "2020-10-10T11:47:56+00:00"
106 "time": "2021-03-23T11:33:13+00:00"
200107 },
201108 {
202109 "name": "guzzlehttp/promises",
203 "version": "1.4.0",
110 "version": "1.4.1",
204111 "source": {
205112 "type": "git",
206113 "url": "https://github.com/guzzle/promises.git",
207 "reference": "60d379c243457e073cff02bc323a2a86cb355631"
114 "reference": "8e7d04f1f6450fef59366c399cfad4b9383aa30d"
208115 },
209116 "dist": {
210117 "type": "zip",
211 "url": "https://api.github.com/repos/guzzle/promises/zipball/60d379c243457e073cff02bc323a2a86cb355631",
212 "reference": "60d379c243457e073cff02bc323a2a86cb355631",
118 "url": "https://api.github.com/repos/guzzle/promises/zipball/8e7d04f1f6450fef59366c399cfad4b9383aa30d",
119 "reference": "8e7d04f1f6450fef59366c399cfad4b9383aa30d",
213120 "shasum": ""
214121 },
215122 "require": {
@@ -247,24 +154,20 @@
247154 "keywords": [
248155 "promise"
249156 ],
250 "support": {
251 "issues": "https://github.com/guzzle/promises/issues",
252 "source": "https://github.com/guzzle/promises/tree/1.4.0"
253 },
254 "time": "2020-09-30T07:37:28+00:00"
157 "time": "2021-03-07T09:25:29+00:00"
255158 },
256159 {
257160 "name": "guzzlehttp/psr7",
258 "version": "1.7.0",
161 "version": "1.8.1",
259162 "source": {
260163 "type": "git",
261164 "url": "https://github.com/guzzle/psr7.git",
262 "reference": "53330f47520498c0ae1f61f7e2c90f55690c06a3"
165 "reference": "35ea11d335fd638b5882ff1725228b3d35496ab1"
263166 },
264167 "dist": {
265168 "type": "zip",
266 "url": "https://api.github.com/repos/guzzle/psr7/zipball/53330f47520498c0ae1f61f7e2c90f55690c06a3",
267 "reference": "53330f47520498c0ae1f61f7e2c90f55690c06a3",
169 "url": "https://api.github.com/repos/guzzle/psr7/zipball/35ea11d335fd638b5882ff1725228b3d35496ab1",
170 "reference": "35ea11d335fd638b5882ff1725228b3d35496ab1",
268171 "shasum": ""
269172 },
270173 "require": {
@@ -322,11 +225,7 @@
322225 "uri",
323226 "url"
324227 ],
325 "support": {
326 "issues": "https://github.com/guzzle/psr7/issues",
327 "source": "https://github.com/guzzle/psr7/tree/1.7.0"
328 },
329 "time": "2020-09-30T07:37:11+00:00"
228 "time": "2021-03-21T16:25:00+00:00"
330229 },
331230 {
332231 "name": "league/flysystem",
@@ -411,10 +310,6 @@
411310 "sftp",
412311 "storage"
413312 ],
414 "support": {
415 "issues": "https://github.com/thephpleague/flysystem/issues",
416 "source": "https://github.com/thephpleague/flysystem/tree/1.x"
417 },
418313 "funding": [
419314 {
420315 "url": "https://offset.earth/frankdejonge",
@@ -423,57 +318,6 @@
423318 ],
424319 "time": "2020-08-23T07:39:11+00:00"
425320 },
426 {
427 "name": "league/flysystem-aws-s3-v3",
428 "version": "1.0.29",
429 "source": {
430 "type": "git",
431 "url": "https://github.com/thephpleague/flysystem-aws-s3-v3.git",
432 "reference": "4e25cc0582a36a786c31115e419c6e40498f6972"
433 },
434 "dist": {
435 "type": "zip",
436 "url": "https://api.github.com/repos/thephpleague/flysystem-aws-s3-v3/zipball/4e25cc0582a36a786c31115e419c6e40498f6972",
437 "reference": "4e25cc0582a36a786c31115e419c6e40498f6972",
438 "shasum": ""
439 },
440 "require": {
441 "aws/aws-sdk-php": "^3.20.0",
442 "league/flysystem": "^1.0.40",
443 "php": ">=5.5.0"
444 },
445 "require-dev": {
446 "henrikbjorn/phpspec-code-coverage": "~1.0.1",
447 "phpspec/phpspec": "^2.0.0"
448 },
449 "type": "library",
450 "extra": {
451 "branch-alias": {
452 "dev-master": "1.0-dev"
453 }
454 },
455 "autoload": {
456 "psr-4": {
457 "League\\Flysystem\\AwsS3v3\\": "src/"
458 }
459 },
460 "notification-url": "https://packagist.org/downloads/",
461 "license": [
462 "MIT"
463 ],
464 "authors": [
465 {
466 "name": "Frank de Jonge",
467 "email": "info@frenky.net"
468 }
469 ],
470 "description": "Flysystem adapter for the AWS S3 SDK v3.x",
471 "support": {
472 "issues": "https://github.com/thephpleague/flysystem-aws-s3-v3/issues",
473 "source": "https://github.com/thephpleague/flysystem-aws-s3-v3/tree/1.0.29"
474 },
475 "time": "2020-10-08T18:58:37+00:00"
476 },
477321 {
478322 "name": "league/mime-type-detection",
479323 "version": "1.7.0",
@@ -514,10 +358,6 @@
514358 }
515359 ],
516360 "description": "Mime-type detection for Flysystem",
517 "support": {
518 "issues": "https://github.com/thephpleague/mime-type-detection/issues",
519 "source": "https://github.com/thephpleague/mime-type-detection/tree/1.7.0"
520 },
521361 "funding": [
522362 {
523363 "url": "https://github.com/frankdejonge",
@@ -530,67 +370,6 @@
530370 ],
531371 "time": "2021-01-18T20:58:21+00:00"
532372 },
533 {
534 "name": "mtdowling/jmespath.php",
535 "version": "2.6.0",
536 "source": {
537 "type": "git",
538 "url": "https://github.com/jmespath/jmespath.php.git",
539 "reference": "42dae2cbd13154083ca6d70099692fef8ca84bfb"
540 },
541 "dist": {
542 "type": "zip",
543 "url": "https://api.github.com/repos/jmespath/jmespath.php/zipball/42dae2cbd13154083ca6d70099692fef8ca84bfb",
544 "reference": "42dae2cbd13154083ca6d70099692fef8ca84bfb",
545 "shasum": ""
546 },
547 "require": {
548 "php": "^5.4 || ^7.0 || ^8.0",
549 "symfony/polyfill-mbstring": "^1.17"
550 },
551 "require-dev": {
552 "composer/xdebug-handler": "^1.4",
553 "phpunit/phpunit": "^4.8.36 || ^7.5.15"
554 },
555 "bin": [
556 "bin/jp.php"
557 ],
558 "type": "library",
559 "extra": {
560 "branch-alias": {
561 "dev-master": "2.6-dev"
562 }
563 },
564 "autoload": {
565 "psr-4": {
566 "JmesPath\\": "src/"
567 },
568 "files": [
569 "src/JmesPath.php"
570 ]
571 },
572 "notification-url": "https://packagist.org/downloads/",
573 "license": [
574 "MIT"
575 ],
576 "authors": [
577 {
578 "name": "Michael Dowling",
579 "email": "mtdowling@gmail.com",
580 "homepage": "https://github.com/mtdowling"
581 }
582 ],
583 "description": "Declaratively specify how to extract elements from a JSON document",
584 "keywords": [
585 "json",
586 "jsonpath"
587 ],
588 "support": {
589 "issues": "https://github.com/jmespath/jmespath.php/issues",
590 "source": "https://github.com/jmespath/jmespath.php/tree/2.6.0"
591 },
592 "time": "2020-07-31T21:01:56+00:00"
593 },
594373 {
595374 "name": "psr/http-client",
596375 "version": "1.0.1",
@@ -638,9 +417,6 @@
638417 "psr",
639418 "psr-18"
640419 ],
641 "support": {
642 "source": "https://github.com/php-fig/http-client/tree/master"
643 },
644420 "time": "2020-06-29T06:28:15+00:00"
645421 },
646422 {
@@ -691,9 +467,6 @@
691467 "request",
692468 "response"
693469 ],
694 "support": {
695 "source": "https://github.com/php-fig/http-message/tree/master"
696 },
697470 "time": "2016-08-06T14:39:51+00:00"
698471 },
699472 {
@@ -734,91 +507,7 @@
734507 }
735508 ],
736509 "description": "A polyfill for getallheaders.",
737 "support": {
738 "issues": "https://github.com/ralouphie/getallheaders/issues",
739 "source": "https://github.com/ralouphie/getallheaders/tree/develop"
740 },
741510 "time": "2019-03-08T08:55:37+00:00"
742 },
743 {
744 "name": "symfony/polyfill-mbstring",
745 "version": "v1.22.1",
746 "source": {
747 "type": "git",
748 "url": "https://github.com/symfony/polyfill-mbstring.git",
749 "reference": "5232de97ee3b75b0360528dae24e73db49566ab1"
750 },
751 "dist": {
752 "type": "zip",
753 "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/5232de97ee3b75b0360528dae24e73db49566ab1",
754 "reference": "5232de97ee3b75b0360528dae24e73db49566ab1",
755 "shasum": ""
756 },
757 "require": {
758 "php": ">=7.1"
759 },
760 "suggest": {
761 "ext-mbstring": "For best performance"
762 },
763 "type": "library",
764 "extra": {
765 "branch-alias": {
766 "dev-main": "1.22-dev"
767 },
768 "thanks": {
769 "name": "symfony/polyfill",
770 "url": "https://github.com/symfony/polyfill"
771 }
772 },
773 "autoload": {
774 "psr-4": {
775 "Symfony\\Polyfill\\Mbstring\\": ""
776 },
777 "files": [
778 "bootstrap.php"
779 ]
780 },
781 "notification-url": "https://packagist.org/downloads/",
782 "license": [
783 "MIT"
784 ],
785 "authors": [
786 {
787 "name": "Nicolas Grekas",
788 "email": "p@tchwork.com"
789 },
790 {
791 "name": "Symfony Community",
792 "homepage": "https://symfony.com/contributors"
793 }
794 ],
795 "description": "Symfony polyfill for the Mbstring extension",
796 "homepage": "https://symfony.com",
797 "keywords": [
798 "compatibility",
799 "mbstring",
800 "polyfill",
801 "portable",
802 "shim"
803 ],
804 "support": {
805 "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.22.1"
806 },
807 "funding": [
808 {
809 "url": "https://symfony.com/sponsor",
810 "type": "custom"
811 },
812 {
813 "url": "https://github.com/fabpot",
814 "type": "github"
815 },
816 {
817 "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
818 "type": "tidelift"
819 }
820 ],
821 "time": "2021-01-22T09:19:47+00:00"
822511 }
823512 ],
824513 "packages-dev": [
@@ -1011,16 +700,16 @@
1011700 },
1012701 {
1013702 "name": "phar-io/version",
1014 "version": "3.0.4",
703 "version": "3.1.0",
1015704 "source": {
1016705 "type": "git",
1017706 "url": "https://github.com/phar-io/version.git",
1018 "reference": "e4782611070e50613683d2b9a57730e9a3ba5451"
707 "reference": "bae7c545bef187884426f042434e561ab1ddb182"
1019708 },
1020709 "dist": {
1021710 "type": "zip",
1022 "url": "https://api.github.com/repos/phar-io/version/zipball/e4782611070e50613683d2b9a57730e9a3ba5451",
1023 "reference": "e4782611070e50613683d2b9a57730e9a3ba5451",
711 "url": "https://api.github.com/repos/phar-io/version/zipball/bae7c545bef187884426f042434e561ab1ddb182",
712 "reference": "bae7c545bef187884426f042434e561ab1ddb182",
1024713 "shasum": ""
1025714 },
1026715 "require": {
@@ -1056,9 +745,9 @@
1056745 "description": "Library for handling version information and constraints",
1057746 "support": {
1058747 "issues": "https://github.com/phar-io/version/issues",
1059 "source": "https://github.com/phar-io/version/tree/3.0.4"
748 "source": "https://github.com/phar-io/version/tree/3.1.0"
1060749 },
1061 "time": "2020-12-13T23:18:30+00:00"
750 "time": "2021-02-23T14:00:09+00:00"
1062751 },
1063752 {
1064753 "name": "phpdocumentor/reflection-common",
@@ -1220,16 +909,16 @@
1220909 },
1221910 {
1222911 "name": "phpspec/prophecy",
1223 "version": "1.12.2",
912 "version": "1.13.0",
1224913 "source": {
1225914 "type": "git",
1226915 "url": "https://github.com/phpspec/prophecy.git",
1227 "reference": "245710e971a030f42e08f4912863805570f23d39"
916 "reference": "be1996ed8adc35c3fd795488a653f4b518be70ea"
1228917 },
1229918 "dist": {
1230919 "type": "zip",
1231 "url": "https://api.github.com/repos/phpspec/prophecy/zipball/245710e971a030f42e08f4912863805570f23d39",
1232 "reference": "245710e971a030f42e08f4912863805570f23d39",
920 "url": "https://api.github.com/repos/phpspec/prophecy/zipball/be1996ed8adc35c3fd795488a653f4b518be70ea",
921 "reference": "be1996ed8adc35c3fd795488a653f4b518be70ea",
1233922 "shasum": ""
1234923 },
1235924 "require": {
@@ -1281,9 +970,9 @@
1281970 ],
1282971 "support": {
1283972 "issues": "https://github.com/phpspec/prophecy/issues",
1284 "source": "https://github.com/phpspec/prophecy/tree/1.12.2"
973 "source": "https://github.com/phpspec/prophecy/tree/1.13.0"
1285974 },
1286 "time": "2020-12-19T10:15:11+00:00"
975 "time": "2021-03-17T13:42:18+00:00"
1287976 },
1288977 {
1289978 "name": "phpunit/php-code-coverage",
@@ -1346,10 +1035,6 @@
13461035 "testing",
13471036 "xunit"
13481037 ],
1349 "support": {
1350 "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues",
1351 "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/7.0.14"
1352 },
13531038 "funding": [
13541039 {
13551040 "url": "https://github.com/sebastianbergmann",
@@ -1406,10 +1091,6 @@
14061091 "filesystem",
14071092 "iterator"
14081093 ],
1409 "support": {
1410 "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues",
1411 "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/2.0.3"
1412 },
14131094 "funding": [
14141095 {
14151096 "url": "https://github.com/sebastianbergmann",
@@ -1457,10 +1138,6 @@
14571138 "keywords": [
14581139 "template"
14591140 ],
1460 "support": {
1461 "issues": "https://github.com/sebastianbergmann/php-text-template/issues",
1462 "source": "https://github.com/sebastianbergmann/php-text-template/tree/1.2.1"
1463 },
14641141 "time": "2015-06-21T13:50:34+00:00"
14651142 },
14661143 {
@@ -1510,10 +1187,6 @@
15101187 "keywords": [
15111188 "timer"
15121189 ],
1513 "support": {
1514 "issues": "https://github.com/sebastianbergmann/php-timer/issues",
1515 "source": "https://github.com/sebastianbergmann/php-timer/tree/2.1.3"
1516 },
15171190 "funding": [
15181191 {
15191192 "url": "https://github.com/sebastianbergmann",
@@ -1569,10 +1242,6 @@
15691242 "keywords": [
15701243 "tokenizer"
15711244 ],
1572 "support": {
1573 "issues": "https://github.com/sebastianbergmann/php-token-stream/issues",
1574 "source": "https://github.com/sebastianbergmann/php-token-stream/tree/master"
1575 },
15761245 "funding": [
15771246 {
15781247 "url": "https://github.com/sebastianbergmann",
@@ -1584,16 +1253,16 @@
15841253 },
15851254 {
15861255 "name": "phpunit/phpunit",
1587 "version": "8.5.14",
1256 "version": "8.5.15",
15881257 "source": {
15891258 "type": "git",
15901259 "url": "https://github.com/sebastianbergmann/phpunit.git",
1591 "reference": "c25f79895d27b6ecd5abfa63de1606b786a461a3"
1260 "reference": "038d4196d8e8cb405cd5e82cedfe413ad6eef9ef"
15921261 },
15931262 "dist": {
15941263 "type": "zip",
1595 "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/c25f79895d27b6ecd5abfa63de1606b786a461a3",
1596 "reference": "c25f79895d27b6ecd5abfa63de1606b786a461a3",
1264 "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/038d4196d8e8cb405cd5e82cedfe413ad6eef9ef",
1265 "reference": "038d4196d8e8cb405cd5e82cedfe413ad6eef9ef",
15971266 "shasum": ""
15981267 },
15991268 "require": {
@@ -1663,10 +1332,6 @@
16631332 "testing",
16641333 "xunit"
16651334 ],
1666 "support": {
1667 "issues": "https://github.com/sebastianbergmann/phpunit/issues",
1668 "source": "https://github.com/sebastianbergmann/phpunit/tree/8.5.14"
1669 },
16701335 "funding": [
16711336 {
16721337 "url": "https://phpunit.de/donate.html",
@@ -1677,7 +1342,7 @@
16771342 "type": "github"
16781343 }
16791344 ],
1680 "time": "2021-01-17T07:37:30+00:00"
1345 "time": "2021-03-17T07:27:54+00:00"
16811346 },
16821347 {
16831348 "name": "sebastian/code-unit-reverse-lookup",
@@ -1722,10 +1387,6 @@
17221387 ],
17231388 "description": "Looks up which function or method a line of code belongs to",
17241389 "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/",
1725 "support": {
1726 "issues": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/issues",
1727 "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/1.0.2"
1728 },
17291390 "funding": [
17301391 {
17311392 "url": "https://github.com/sebastianbergmann",
@@ -1796,10 +1457,6 @@
17961457 "compare",
17971458 "equality"
17981459 ],
1799 "support": {
1800 "issues": "https://github.com/sebastianbergmann/comparator/issues",
1801 "source": "https://github.com/sebastianbergmann/comparator/tree/3.0.3"
1802 },
18031460 "funding": [
18041461 {
18051462 "url": "https://github.com/sebastianbergmann",
@@ -1862,10 +1519,6 @@
18621519 "unidiff",
18631520 "unified diff"
18641521 ],
1865 "support": {
1866 "issues": "https://github.com/sebastianbergmann/diff/issues",
1867 "source": "https://github.com/sebastianbergmann/diff/tree/3.0.3"
1868 },
18691522 "funding": [
18701523 {
18711524 "url": "https://github.com/sebastianbergmann",
@@ -1925,10 +1578,6 @@
19251578 "environment",
19261579 "hhvm"
19271580 ],
1928 "support": {
1929 "issues": "https://github.com/sebastianbergmann/environment/issues",
1930 "source": "https://github.com/sebastianbergmann/environment/tree/4.2.4"
1931 },
19321581 "funding": [
19331582 {
19341583 "url": "https://github.com/sebastianbergmann",
@@ -2002,10 +1651,6 @@
20021651 "export",
20031652 "exporter"
20041653 ],
2005 "support": {
2006 "issues": "https://github.com/sebastianbergmann/exporter/issues",
2007 "source": "https://github.com/sebastianbergmann/exporter/tree/3.1.3"
2008 },
20091654 "funding": [
20101655 {
20111656 "url": "https://github.com/sebastianbergmann",
@@ -2066,10 +1711,6 @@
20661711 "keywords": [
20671712 "global state"
20681713 ],
2069 "support": {
2070 "issues": "https://github.com/sebastianbergmann/global-state/issues",
2071 "source": "https://github.com/sebastianbergmann/global-state/tree/3.0.1"
2072 },
20731714 "funding": [
20741715 {
20751716 "url": "https://github.com/sebastianbergmann",
@@ -2123,10 +1764,6 @@
21231764 ],
21241765 "description": "Traverses array structures and object graphs to enumerate all referenced objects",
21251766 "homepage": "https://github.com/sebastianbergmann/object-enumerator/",
2126 "support": {
2127 "issues": "https://github.com/sebastianbergmann/object-enumerator/issues",
2128 "source": "https://github.com/sebastianbergmann/object-enumerator/tree/3.0.4"
2129 },
21301767 "funding": [
21311768 {
21321769 "url": "https://github.com/sebastianbergmann",
@@ -2178,10 +1815,6 @@
21781815 ],
21791816 "description": "Allows reflection of object attributes, including inherited and non-public ones",
21801817 "homepage": "https://github.com/sebastianbergmann/object-reflector/",
2181 "support": {
2182 "issues": "https://github.com/sebastianbergmann/object-reflector/issues",
2183 "source": "https://github.com/sebastianbergmann/object-reflector/tree/1.1.2"
2184 },
21851818 "funding": [
21861819 {
21871820 "url": "https://github.com/sebastianbergmann",
@@ -2241,10 +1874,6 @@
22411874 ],
22421875 "description": "Provides functionality to recursively process PHP variables",
22431876 "homepage": "http://www.github.com/sebastianbergmann/recursion-context",
2244 "support": {
2245 "issues": "https://github.com/sebastianbergmann/recursion-context/issues",
2246 "source": "https://github.com/sebastianbergmann/recursion-context/tree/3.0.1"
2247 },
22481877 "funding": [
22491878 {
22501879 "url": "https://github.com/sebastianbergmann",
@@ -2293,10 +1922,6 @@
22931922 ],
22941923 "description": "Provides a list of PHP built-in functions that operate on resources",
22951924 "homepage": "https://www.github.com/sebastianbergmann/resource-operations",
2296 "support": {
2297 "issues": "https://github.com/sebastianbergmann/resource-operations/issues",
2298 "source": "https://github.com/sebastianbergmann/resource-operations/tree/2.0.2"
2299 },
23001925 "funding": [
23011926 {
23021927 "url": "https://github.com/sebastianbergmann",
@@ -2349,10 +1974,6 @@
23491974 ],
23501975 "description": "Collection of value objects that represent the types of the PHP type system",
23511976 "homepage": "https://github.com/sebastianbergmann/type",
2352 "support": {
2353 "issues": "https://github.com/sebastianbergmann/type/issues",
2354 "source": "https://github.com/sebastianbergmann/type/tree/1.1.4"
2355 },
23561977 "funding": [
23571978 {
23581979 "url": "https://github.com/sebastianbergmann",
@@ -2402,10 +2023,6 @@
24022023 ],
24032024 "description": "Library that helps with managing the version number of Git-hosted PHP projects",
24042025 "homepage": "https://github.com/sebastianbergmann/version",
2405 "support": {
2406 "issues": "https://github.com/sebastianbergmann/version/issues",
2407 "source": "https://github.com/sebastianbergmann/version/tree/master"
2408 },
24092026 "time": "2016-10-03T07:35:21+00:00"
24102027 },
24112028 {
@@ -2487,6 +2104,86 @@
24872104 ],
24882105 "time": "2021-01-07T16:49:33+00:00"
24892106 },
2107 {
2108 "name": "symfony/polyfill-mbstring",
2109 "version": "v1.22.1",
2110 "source": {
2111 "type": "git",
2112 "url": "https://github.com/symfony/polyfill-mbstring.git",
2113 "reference": "5232de97ee3b75b0360528dae24e73db49566ab1"
2114 },
2115 "dist": {
2116 "type": "zip",
2117 "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/5232de97ee3b75b0360528dae24e73db49566ab1",
2118 "reference": "5232de97ee3b75b0360528dae24e73db49566ab1",
2119 "shasum": ""
2120 },
2121 "require": {
2122 "php": ">=7.1"
2123 },
2124 "suggest": {
2125 "ext-mbstring": "For best performance"
2126 },
2127 "type": "library",
2128 "extra": {
2129 "branch-alias": {
2130 "dev-main": "1.22-dev"
2131 },
2132 "thanks": {
2133 "name": "symfony/polyfill",
2134 "url": "https://github.com/symfony/polyfill"
2135 }
2136 },
2137 "autoload": {
2138 "psr-4": {
2139 "Symfony\\Polyfill\\Mbstring\\": ""
2140 },
2141 "files": [
2142 "bootstrap.php"
2143 ]
2144 },
2145 "notification-url": "https://packagist.org/downloads/",
2146 "license": [
2147 "MIT"
2148 ],
2149 "authors": [
2150 {
2151 "name": "Nicolas Grekas",
2152 "email": "p@tchwork.com"
2153 },
2154 {
2155 "name": "Symfony Community",
2156 "homepage": "https://symfony.com/contributors"
2157 }
2158 ],
2159 "description": "Symfony polyfill for the Mbstring extension",
2160 "homepage": "https://symfony.com",
2161 "keywords": [
2162 "compatibility",
2163 "mbstring",
2164 "polyfill",
2165 "portable",
2166 "shim"
2167 ],
2168 "support": {
2169 "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.22.1"
2170 },
2171 "funding": [
2172 {
2173 "url": "https://symfony.com/sponsor",
2174 "type": "custom"
2175 },
2176 {
2177 "url": "https://github.com/fabpot",
2178 "type": "github"
2179 },
2180 {
2181 "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
2182 "type": "tidelift"
2183 }
2184 ],
2185 "time": "2021-01-22T09:19:47+00:00"
2186 },
24902187 {
24912188 "name": "symfony/polyfill-php72",
24922189 "version": "v1.22.1",
@@ -2544,9 +2241,6 @@
25442241 "portable",
25452242 "shim"
25462243 ],
2547 "support": {
2548 "source": "https://github.com/symfony/polyfill-php72/tree/v1.22.1"
2549 },
25502244 "funding": [
25512245 {
25522246 "url": "https://symfony.com/sponsor",
@@ -2648,16 +2342,16 @@
26482342 },
26492343 {
26502344 "name": "symfony/var-dumper",
2651 "version": "v4.4.19",
2345 "version": "v4.4.21",
26522346 "source": {
26532347 "type": "git",
26542348 "url": "https://github.com/symfony/var-dumper.git",
2655 "reference": "a1eab2f69906dc83c5ddba4632180260d0ab4f7f"
2349 "reference": "0da0e174f728996f5d5072d6a9f0a42259dbc806"
26562350 },
26572351 "dist": {
26582352 "type": "zip",
2659 "url": "https://api.github.com/repos/symfony/var-dumper/zipball/a1eab2f69906dc83c5ddba4632180260d0ab4f7f",
2660 "reference": "a1eab2f69906dc83c5ddba4632180260d0ab4f7f",
2353 "url": "https://api.github.com/repos/symfony/var-dumper/zipball/0da0e174f728996f5d5072d6a9f0a42259dbc806",
2354 "reference": "0da0e174f728996f5d5072d6a9f0a42259dbc806",
26612355 "shasum": ""
26622356 },
26632357 "require": {
@@ -2716,9 +2410,6 @@
27162410 "debug",
27172411 "dump"
27182412 ],
2719 "support": {
2720 "source": "https://github.com/symfony/var-dumper/tree/v4.4.19"
2721 },
27222413 "funding": [
27232414 {
27242415 "url": "https://symfony.com/sponsor",
@@ -2733,7 +2424,7 @@
27332424 "type": "tidelift"
27342425 }
27352426 ],
2736 "time": "2021-01-27T09:09:26+00:00"
2427 "time": "2021-03-27T19:49:03+00:00"
27372428 },
27382429 {
27392430 "name": "theseer/tokenizer",
@@ -2787,30 +2478,35 @@
27872478 },
27882479 {
27892480 "name": "webmozart/assert",
2790 "version": "1.9.1",
2481 "version": "1.10.0",
27912482 "source": {
27922483 "type": "git",
27932484 "url": "https://github.com/webmozarts/assert.git",
2794 "reference": "bafc69caeb4d49c39fd0779086c03a3738cbb389"
2485 "reference": "6964c76c7804814a842473e0c8fd15bab0f18e25"
27952486 },
27962487 "dist": {
27972488 "type": "zip",
2798 "url": "https://api.github.com/repos/webmozarts/assert/zipball/bafc69caeb4d49c39fd0779086c03a3738cbb389",
2799 "reference": "bafc69caeb4d49c39fd0779086c03a3738cbb389",
2489 "url": "https://api.github.com/repos/webmozarts/assert/zipball/6964c76c7804814a842473e0c8fd15bab0f18e25",
2490 "reference": "6964c76c7804814a842473e0c8fd15bab0f18e25",
28002491 "shasum": ""
28012492 },
28022493 "require": {
2803 "php": "^5.3.3 || ^7.0 || ^8.0",
2494 "php": "^7.2 || ^8.0",
28042495 "symfony/polyfill-ctype": "^1.8"
28052496 },
28062497 "conflict": {
28072498 "phpstan/phpstan": "<0.12.20",
2808 "vimeo/psalm": "<3.9.1"
2499 "vimeo/psalm": "<4.6.1 || 4.6.2"
28092500 },
28102501 "require-dev": {
2811 "phpunit/phpunit": "^4.8.36 || ^7.5.13"
2502 "phpunit/phpunit": "^8.5.13"
28122503 },
28132504 "type": "library",
2505 "extra": {
2506 "branch-alias": {
2507 "dev-master": "1.10-dev"
2508 }
2509 },
28142510 "autoload": {
28152511 "psr-4": {
28162512 "Webmozart\\Assert\\": "src/"
@@ -2834,9 +2530,9 @@
28342530 ],
28352531 "support": {
28362532 "issues": "https://github.com/webmozarts/assert/issues",
2837 "source": "https://github.com/webmozarts/assert/tree/1.9.1"
2533 "source": "https://github.com/webmozarts/assert/tree/1.10.0"
28382534 },
2839 "time": "2020-07-08T17:02:28+00:00"
2535 "time": "2021-03-09T10:59:23+00:00"
28402536 }
28412537 ],
28422538 "aliases": [],
@@ -2845,8 +2541,8 @@
28452541 "prefer-stable": false,
28462542 "prefer-lowest": false,
28472543 "platform": {
2848 "php": "^7.3"
2544 "php": "^7.0 || ^8.0"
28492545 },
28502546 "platform-dev": [],
2851 "plugin-api-version": "2.0.0"
2547 "plugin-api-version": "1.1.0"
28522548}
src/Client.phpadded+51-0
Changes to src/Client.php
@@ -0,0 +1,51 @@
1<?php
2
3namespace Meema\Flysystem;
4
5use GuzzleHttp\Client as GuzzleClient;
6
7class Client
8{
9 /**
10 * Construct Meema client.
11 *
12 * @param string $accessKey
13 */
14 public function __construct($accessKey, $config = [])
15 {
16 $this->accessKey = $accessKey;
17
18 $this->config = $config;
19
20 $this->client = new GuzzleClient([
21 'base_uri' => $url ?? 'http://meema-api.test/api/',
22 ]);
23 }
24
25 /**
26 * Handle the API request.
27 *
28 * @param string $method
29 * @param string $path
30 */
31 public function request($method, $path, $data = null)
32 {
33 $content = $this->client->request($method, $path, [
34 'query' => $data,
35 'headers' => [
36 'Content-Type' => 'application/json',
37 'Authorization' => "Bearer {$this->accessKey}",
38 ],
39 ])
40 ->getBody()
41 ->getContents();
42
43 $body = json_decode($content, true);
44
45 if ($body && array_key_exists('data', $body)) {
46 return $body['data'];
47 }
48
49 return $body;
50 }
51}
src/MeemaAdapter.phpadded+327-0
Changes to src/MeemaAdapter.php
@@ -0,0 +1,327 @@
1<?php
2
3namespace Meema\Flysystem;
4
5use GuzzleHttp\Client as GuzzleClient;
6use GuzzleHttp\Psr7;
7use GuzzleHttp\Psr7\Request;
8use League\Flysystem\Adapter\AbstractAdapter;
9use League\Flysystem\Config;
10
11class MeemaAdapter extends AbstractAdapter
12{
13 /**
14 * @var \Meema\Flysystem\Client
15 */
16 protected $client;
17
18 public function __construct()
19 {
20 $this->client = new Client('pk_live|2|1|kDLnNyPvkdlA8sXJky7SJePO1IdabMzncYxypyC2');
21 }
22 /**
23 * Write a new file.
24 *
25 * @param string $path
26 * @param string $contents
27 * @param Config $config Config object
28 *
29 * @return false|array false on failure file meta data on success
30 */
31 public function write($path, $contents, Config $config)
32 {
33 return $this->upload($path);
34 }
35
36 /**
37 * Write a new file using a stream.
38 *
39 * @param string $path
40 * @param resource $resource
41 * @param Config $config Config object
42 *
43 * @return array|false false on failure file meta data on success
44 */
45 public function writeStream($path, $resource, Config $config)
46 {
47 return $this->upload($path);
48 }
49
50 /**
51 * Update a file.
52 *
53 * @param string $path
54 * @param string $contents
55 * @param Config $config Config object
56 *
57 * @return array|false false on failure file meta data on success
58 */
59 public function update($path, $contents, Config $config)
60 {
61 return [];
62 }
63
64 /**
65 * Update a file using a stream.
66 *
67 * @param string $path
68 * @param resource $resource
69 * @param Config $config Config object
70 *
71 * @return array|false false on failure file meta data on success
72 */
73 public function updateStream($path, $resource, Config $config)
74 {
75 return [];
76 }
77
78 /**
79 * Rename a file.
80 *
81 * @param string $path
82 * @param string $newpath
83 *
84 * @return bool
85 */
86 public function rename($path, $newpath)
87 {
88 return [];
89 }
90
91 /**
92 * Copy a file.
93 *
94 * @param string $path
95 * @param string $newpath
96 *
97 * @return bool
98 */
99 public function copy($path, $newpath)
100 {
101 return [];
102 }
103
104 /**
105 * Delete a file.
106 *
107 * @param string $path
108 *
109 * @return bool
110 */
111 public function delete($path)
112 {
113 return [];
114 }
115
116 /**
117 * Delete a directory.
118 *
119 * @param string $dirname
120 *
121 * @return bool
122 */
123 public function deleteDir($dirname)
124 {
125 return [];
126 }
127
128 /**
129 * Create a directory.
130 *
131 * @param string $dirname directory name
132 * @param Config $config
133 *
134 * @return array|false
135 */
136 public function createDir($dirname, Config $config)
137 {
138 return [];
139 }
140
141 /**
142 * Set the visibility for a file.
143 *
144 * @param string $path
145 * @param string $visibility
146 *
147 * @return array|false file meta data
148 */
149 public function setVisibility($path, $visibility)
150 {
151 return $this->client->request('POST', 'aws/set-visibility', compact('path', 'visibility'));
152 }
153
154 /**
155 * Check whether a file exists.
156 *
157 * @param string $path
158 *
159 * @return bool
160 */
161 public function has($path)
162 {
163 $data = $this->client->request('POST', 'aws/has', compact('path'));
164
165 return $data['exists'] ?? false;
166 }
167
168 /**
169 * Read a file.
170 *
171 * @param string $path
172 *
173 * @return false|array
174 */
175 public function read($path)
176 {
177 return false;
178 }
179
180 /**
181 * List contents of a directory.
182 *
183 * @param string $directory
184 * @param bool $recursive
185 *
186 * @return array
187 */
188 public function listContents($directory = '', $recursive = false)
189 {
190 return [];
191 }
192
193 /**
194 * Read a file as a stream.
195 *
196 * @param string $path
197 *
198 * @return array|false
199 */
200 public function readStream($path)
201 {
202 return [];
203 }
204
205 /**
206 * Get all the meta data of a file or directory.
207 *
208 * @param string $path
209 *
210 * @return false|array
211 */
212 public function getMetadata($path)
213 {
214 return $this->client->request('POST', 'aws/metadata', compact('path'));
215 }
216
217 /**
218 * Get all the meta data of a file or directory.
219 *
220 * @param string $path
221 *
222 * @return false|array
223 */
224 public function getSize($path)
225 {
226 return $this->getMetadata($path);
227 }
228
229 /**
230 * Get the mimetype of a file.
231 *
232 * @param string $path
233 *
234 * @return false|array
235 */
236 public function getMimetype($path)
237 {
238 return $this->getMetadata($path);
239 }
240
241 /**
242 * Get the timestamp of a file.
243 *
244 * @param string $path
245 *
246 * @return false|array
247 */
248 public function getTimestamp($path)
249 {
250 return $this->getMetadata($path);
251 }
252
253 /**
254 * Get the visibility of a file.
255 *
256 * @param string $path
257 *
258 * @return array|false
259 */
260 public function getVisibility($path)
261 {
262 return $this->getMetadata($path);
263 }
264
265 /**
266 * Upload a media file.
267 *
268 * @param string $path
269 *
270 * @return array
271 */
272 protected function upload($path)
273 {
274 $file = fopen($path, 'r');
275 $stream = Psr7\stream_for($file);
276
277 $fileName = basename($path);
278 $mimeType = mime_content_type($file);
279
280 $vaporParams = ['content_type' => $mimeType];
281
282 $signedUrl = $this->client->request('POST', 'vapor/signed-storage-url', $vaporParams);
283
284 if (is_array($signedUrl) && $signedUrl['url']) {
285 $headers = $signedUrl['headers'];
286 unset($headers['Host']);
287
288 $this->uploadToS3($signedUrl['url'], $headers, $fileName, $stream);
289
290 $uploadData = ['key' => $signedUrl['key'], 'file_name' => $fileName];
291
292 $response = $this->client->request('POST', 'upload', $uploadData);
293 }
294
295 return $response;
296 }
297
298 /**
299 * Upload the file stream to s3.
300 *
301 * @param string $signedUrl
302 * @param array $headers
303 * @param string $fileName
304 * @param GuzzleHttp\Psr7 $stream
305 *
306 * @return void
307 */
308 protected function uploadToS3($signedUrl, $headers, $fileName, $stream)
309 {
310 $client = new GuzzleClient();
311 $request = new Request(
312 'PUT',
313 $signedUrl,
314 ['headers' => json_encode($headers)],
315 new Psr7\MultipartStream(
316 [
317 [
318 'name' => $fileName,
319 'contents' => $stream,
320 ],
321 ]
322 )
323 );
324
325 $client->send($request);
326 }
327}