ReviewOS

also looking at this

meemalabs/flysystem-meema

Master

#10
Merged glennmichael123 wants to merge master into main
3 files +1400 -487

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": "~2.0"
22 "guzzlehttp/guzzle": "^7.3",
23 "league/flysystem": "^1.0.70"
2324 },
2425 "require-dev": {
2526 "symfony/var-dumper": "^5.2",
composer.lockmodified+271-156
Changes to composer.lock
@@ -4,6 +4,7 @@
44 "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
55 "This file is @generated automatically"
66 ],
7<<<<<<< HEAD
78 "content-hash": "2b03d73ce355901d9cd04b9ba1a36c9a",
89 "packages": [
910 {
@@ -97,6 +98,11 @@
9798 "time": "2021-04-14T18:16:00+00:00"
9899 },
99100 {
101=======
102 "content-hash": "893d46f29d9bf2809e2cf7fb9eb11a7a",
103 "packages": [
104 {
105>>>>>>> 4e890c5... initial functions
100106 "name": "guzzlehttp/guzzle",
101107 "version": "7.3.0",
102108 "source": {
@@ -175,10 +181,13 @@
175181 "rest",
176182 "web service"
177183 ],
184<<<<<<< HEAD
178185 "support": {
179186 "issues": "https://github.com/guzzle/guzzle/issues",
180187 "source": "https://github.com/guzzle/guzzle/tree/7.3.0"
181188 },
189=======
190>>>>>>> 4e890c5... initial functions
182191 "funding": [
183192 {
184193 "url": "https://github.com/GrahamCampbell",
@@ -248,10 +257,13 @@
248257 "keywords": [
249258 "promise"
250259 ],
260<<<<<<< HEAD
251261 "support": {
252262 "issues": "https://github.com/guzzle/promises/issues",
253263 "source": "https://github.com/guzzle/promises/tree/1.4.1"
254264 },
265=======
266>>>>>>> 4e890c5... initial functions
255267 "time": "2021-03-07T09:25:29+00:00"
256268 },
257269 {
@@ -323,10 +335,13 @@
323335 "uri",
324336 "url"
325337 ],
338<<<<<<< HEAD
326339 "support": {
327340 "issues": "https://github.com/guzzle/psr7/issues",
328341 "source": "https://github.com/guzzle/psr7/tree/1.8.1"
329342 },
343=======
344>>>>>>> 4e890c5... initial functions
330345 "time": "2021-03-21T16:25:00+00:00"
331346 },
332347 {
@@ -393,10 +408,13 @@
393408 "sftp",
394409 "storage"
395410 ],
411<<<<<<< HEAD
396412 "support": {
397413 "issues": "https://github.com/thephpleague/flysystem/issues",
398414 "source": "https://github.com/thephpleague/flysystem/tree/2.0.5"
399415 },
416=======
417>>>>>>> 4e890c5... initial functions
400418 "funding": [
401419 {
402420 "url": "https://offset.earth/frankdejonge",
@@ -414,6 +432,7 @@
414432 "time": "2021-04-11T15:03:35+00:00"
415433 },
416434 {
435<<<<<<< HEAD
417436 "name": "league/flysystem-aws-s3-v3",
418437 "version": "2.0.5",
419438 "source": {
@@ -469,6 +488,8 @@
469488 "time": "2021-04-11T09:05:38+00:00"
470489 },
471490 {
491=======
492>>>>>>> 4e890c5... initial functions
472493 "name": "league/mime-type-detection",
473494 "version": "1.7.0",
474495 "source": {
@@ -508,10 +529,6 @@
508529 }
509530 ],
510531 "description": "Mime-type detection for Flysystem",
511 "support": {
512 "issues": "https://github.com/thephpleague/mime-type-detection/issues",
513 "source": "https://github.com/thephpleague/mime-type-detection/tree/1.7.0"
514 },
515532 "funding": [
516533 {
517534 "url": "https://github.com/frankdejonge",
@@ -524,67 +541,6 @@
524541 ],
525542 "time": "2021-01-18T20:58:21+00:00"
526543 },
527 {
528 "name": "mtdowling/jmespath.php",
529 "version": "2.6.0",
530 "source": {
531 "type": "git",
532 "url": "https://github.com/jmespath/jmespath.php.git",
533 "reference": "42dae2cbd13154083ca6d70099692fef8ca84bfb"
534 },
535 "dist": {
536 "type": "zip",
537 "url": "https://api.github.com/repos/jmespath/jmespath.php/zipball/42dae2cbd13154083ca6d70099692fef8ca84bfb",
538 "reference": "42dae2cbd13154083ca6d70099692fef8ca84bfb",
539 "shasum": ""
540 },
541 "require": {
542 "php": "^5.4 || ^7.0 || ^8.0",
543 "symfony/polyfill-mbstring": "^1.17"
544 },
545 "require-dev": {
546 "composer/xdebug-handler": "^1.4",
547 "phpunit/phpunit": "^4.8.36 || ^7.5.15"
548 },
549 "bin": [
550 "bin/jp.php"
551 ],
552 "type": "library",
553 "extra": {
554 "branch-alias": {
555 "dev-master": "2.6-dev"
556 }
557 },
558 "autoload": {
559 "psr-4": {
560 "JmesPath\\": "src/"
561 },
562 "files": [
563 "src/JmesPath.php"
564 ]
565 },
566 "notification-url": "https://packagist.org/downloads/",
567 "license": [
568 "MIT"
569 ],
570 "authors": [
571 {
572 "name": "Michael Dowling",
573 "email": "mtdowling@gmail.com",
574 "homepage": "https://github.com/mtdowling"
575 }
576 ],
577 "description": "Declaratively specify how to extract elements from a JSON document",
578 "keywords": [
579 "json",
580 "jsonpath"
581 ],
582 "support": {
583 "issues": "https://github.com/jmespath/jmespath.php/issues",
584 "source": "https://github.com/jmespath/jmespath.php/tree/2.6.0"
585 },
586 "time": "2020-07-31T21:01:56+00:00"
587 },
588544 {
589545 "name": "psr/http-client",
590546 "version": "1.0.1",
@@ -632,9 +588,6 @@
632588 "psr",
633589 "psr-18"
634590 ],
635 "support": {
636 "source": "https://github.com/php-fig/http-client/tree/master"
637 },
638591 "time": "2020-06-29T06:28:15+00:00"
639592 },
640593 {
@@ -685,9 +638,6 @@
685638 "request",
686639 "response"
687640 ],
688 "support": {
689 "source": "https://github.com/php-fig/http-message/tree/master"
690 },
691641 "time": "2016-08-06T14:39:51+00:00"
692642 },
693643 {
@@ -728,91 +678,7 @@
728678 }
729679 ],
730680 "description": "A polyfill for getallheaders.",
731 "support": {
732 "issues": "https://github.com/ralouphie/getallheaders/issues",
733 "source": "https://github.com/ralouphie/getallheaders/tree/develop"
734 },
735681 "time": "2019-03-08T08:55:37+00:00"
736 },
737 {
738 "name": "symfony/polyfill-mbstring",
739 "version": "v1.22.1",
740 "source": {
741 "type": "git",
742 "url": "https://github.com/symfony/polyfill-mbstring.git",
743 "reference": "5232de97ee3b75b0360528dae24e73db49566ab1"
744 },
745 "dist": {
746 "type": "zip",
747 "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/5232de97ee3b75b0360528dae24e73db49566ab1",
748 "reference": "5232de97ee3b75b0360528dae24e73db49566ab1",
749 "shasum": ""
750 },
751 "require": {
752 "php": ">=7.1"
753 },
754 "suggest": {
755 "ext-mbstring": "For best performance"
756 },
757 "type": "library",
758 "extra": {
759 "branch-alias": {
760 "dev-main": "1.22-dev"
761 },
762 "thanks": {
763 "name": "symfony/polyfill",
764 "url": "https://github.com/symfony/polyfill"
765 }
766 },
767 "autoload": {
768 "psr-4": {
769 "Symfony\\Polyfill\\Mbstring\\": ""
770 },
771 "files": [
772 "bootstrap.php"
773 ]
774 },
775 "notification-url": "https://packagist.org/downloads/",
776 "license": [
777 "MIT"
778 ],
779 "authors": [
780 {
781 "name": "Nicolas Grekas",
782 "email": "p@tchwork.com"
783 },
784 {
785 "name": "Symfony Community",
786 "homepage": "https://symfony.com/contributors"
787 }
788 ],
789 "description": "Symfony polyfill for the Mbstring extension",
790 "homepage": "https://symfony.com",
791 "keywords": [
792 "compatibility",
793 "mbstring",
794 "polyfill",
795 "portable",
796 "shim"
797 ],
798 "support": {
799 "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.22.1"
800 },
801 "funding": [
802 {
803 "url": "https://symfony.com/sponsor",
804 "type": "custom"
805 },
806 {
807 "url": "https://github.com/fabpot",
808 "type": "github"
809 },
810 {
811 "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
812 "type": "tidelift"
813 }
814 ],
815 "time": "2021-01-22T09:19:47+00:00"
816682 }
817683 ],
818684 "packages-dev": [
@@ -1400,10 +1266,13 @@
14001266 "testing",
14011267 "xunit"
14021268 ],
1269<<<<<<< HEAD
14031270 "support": {
14041271 "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues",
14051272 "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.6"
14061273 },
1274=======
1275>>>>>>> 4e890c5... initial functions
14071276 "funding": [
14081277 {
14091278 "url": "https://github.com/sebastianbergmann",
@@ -1460,10 +1329,13 @@
14601329 "filesystem",
14611330 "iterator"
14621331 ],
1332<<<<<<< HEAD
14631333 "support": {
14641334 "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues",
14651335 "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/3.0.5"
14661336 },
1337=======
1338>>>>>>> 4e890c5... initial functions
14671339 "funding": [
14681340 {
14691341 "url": "https://github.com/sebastianbergmann",
@@ -1523,6 +1395,7 @@
15231395 "keywords": [
15241396 "process"
15251397 ],
1398<<<<<<< HEAD
15261399 "support": {
15271400 "issues": "https://github.com/sebastianbergmann/php-invoker/issues",
15281401 "source": "https://github.com/sebastianbergmann/php-invoker/tree/3.1.1"
@@ -1534,6 +1407,9 @@
15341407 }
15351408 ],
15361409 "time": "2020-09-28T05:58:55+00:00"
1410=======
1411 "time": "2015-06-21T13:50:34+00:00"
1412>>>>>>> 4e890c5... initial functions
15371413 },
15381414 {
15391415 "name": "phpunit/php-text-template",
@@ -1582,10 +1458,13 @@
15821458 "keywords": [
15831459 "template"
15841460 ],
1461<<<<<<< HEAD
15851462 "support": {
15861463 "issues": "https://github.com/sebastianbergmann/php-text-template/issues",
15871464 "source": "https://github.com/sebastianbergmann/php-text-template/tree/2.0.4"
15881465 },
1466=======
1467>>>>>>> 4e890c5... initial functions
15891468 "funding": [
15901469 {
15911470 "url": "https://github.com/sebastianbergmann",
@@ -1641,10 +1520,13 @@
16411520 "keywords": [
16421521 "timer"
16431522 ],
1523<<<<<<< HEAD
16441524 "support": {
16451525 "issues": "https://github.com/sebastianbergmann/php-timer/issues",
16461526 "source": "https://github.com/sebastianbergmann/php-timer/tree/5.0.3"
16471527 },
1528=======
1529>>>>>>> 4e890c5... initial functions
16481530 "funding": [
16491531 {
16501532 "url": "https://github.com/sebastianbergmann",
@@ -1655,6 +1537,7 @@
16551537 },
16561538 {
16571539 "name": "phpunit/phpunit",
1540<<<<<<< HEAD
16581541 "version": "9.5.4",
16591542 "source": {
16601543 "type": "git",
@@ -1665,6 +1548,18 @@
16651548 "type": "zip",
16661549 "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/c73c6737305e779771147af66c96ca6a7ed8a741",
16671550 "reference": "c73c6737305e779771147af66c96ca6a7ed8a741",
1551=======
1552 "version": "8.5.15",
1553 "source": {
1554 "type": "git",
1555 "url": "https://github.com/sebastianbergmann/phpunit.git",
1556 "reference": "038d4196d8e8cb405cd5e82cedfe413ad6eef9ef"
1557 },
1558 "dist": {
1559 "type": "zip",
1560 "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/038d4196d8e8cb405cd5e82cedfe413ad6eef9ef",
1561 "reference": "038d4196d8e8cb405cd5e82cedfe413ad6eef9ef",
1562>>>>>>> 4e890c5... initial functions
16681563 "shasum": ""
16691564 },
16701565 "require": {
@@ -1740,10 +1635,13 @@
17401635 "testing",
17411636 "xunit"
17421637 ],
1638<<<<<<< HEAD
17431639 "support": {
17441640 "issues": "https://github.com/sebastianbergmann/phpunit/issues",
17451641 "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.4"
17461642 },
1643=======
1644>>>>>>> 4e890c5... initial functions
17471645 "funding": [
17481646 {
17491647 "url": "https://phpunit.de/donate.html",
@@ -1754,6 +1652,7 @@
17541652 "type": "github"
17551653 }
17561654 ],
1655<<<<<<< HEAD
17571656 "time": "2021-03-23T07:16:29+00:00"
17581657 },
17591658 {
@@ -1867,6 +1766,9 @@
18671766 }
18681767 ],
18691768 "time": "2020-10-26T13:08:54+00:00"
1769=======
1770 "time": "2021-03-17T07:27:54+00:00"
1771>>>>>>> 4e890c5... initial functions
18701772 },
18711773 {
18721774 "name": "sebastian/code-unit-reverse-lookup",
@@ -1911,10 +1813,13 @@
19111813 ],
19121814 "description": "Looks up which function or method a line of code belongs to",
19131815 "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/",
1816<<<<<<< HEAD
19141817 "support": {
19151818 "issues": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/issues",
19161819 "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/2.0.3"
19171820 },
1821=======
1822>>>>>>> 4e890c5... initial functions
19181823 "funding": [
19191824 {
19201825 "url": "https://github.com/sebastianbergmann",
@@ -1985,10 +1890,13 @@
19851890 "compare",
19861891 "equality"
19871892 ],
1893<<<<<<< HEAD
19881894 "support": {
19891895 "issues": "https://github.com/sebastianbergmann/comparator/issues",
19901896 "source": "https://github.com/sebastianbergmann/comparator/tree/4.0.6"
19911897 },
1898=======
1899>>>>>>> 4e890c5... initial functions
19921900 "funding": [
19931901 {
19941902 "url": "https://github.com/sebastianbergmann",
@@ -2108,10 +2016,13 @@
21082016 "unidiff",
21092017 "unified diff"
21102018 ],
2019<<<<<<< HEAD
21112020 "support": {
21122021 "issues": "https://github.com/sebastianbergmann/diff/issues",
21132022 "source": "https://github.com/sebastianbergmann/diff/tree/4.0.4"
21142023 },
2024=======
2025>>>>>>> 4e890c5... initial functions
21152026 "funding": [
21162027 {
21172028 "url": "https://github.com/sebastianbergmann",
@@ -2171,10 +2082,13 @@
21712082 "environment",
21722083 "hhvm"
21732084 ],
2085<<<<<<< HEAD
21742086 "support": {
21752087 "issues": "https://github.com/sebastianbergmann/environment/issues",
21762088 "source": "https://github.com/sebastianbergmann/environment/tree/5.1.3"
21772089 },
2090=======
2091>>>>>>> 4e890c5... initial functions
21782092 "funding": [
21792093 {
21802094 "url": "https://github.com/sebastianbergmann",
@@ -2248,10 +2162,13 @@
22482162 "export",
22492163 "exporter"
22502164 ],
2165<<<<<<< HEAD
22512166 "support": {
22522167 "issues": "https://github.com/sebastianbergmann/exporter/issues",
22532168 "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.3"
22542169 },
2170=======
2171>>>>>>> 4e890c5... initial functions
22552172 "funding": [
22562173 {
22572174 "url": "https://github.com/sebastianbergmann",
@@ -2312,10 +2229,13 @@
23122229 "keywords": [
23132230 "global state"
23142231 ],
2232<<<<<<< HEAD
23152233 "support": {
23162234 "issues": "https://github.com/sebastianbergmann/global-state/issues",
23172235 "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.2"
23182236 },
2237=======
2238>>>>>>> 4e890c5... initial functions
23192239 "funding": [
23202240 {
23212241 "url": "https://github.com/sebastianbergmann",
@@ -2426,10 +2346,13 @@
24262346 ],
24272347 "description": "Traverses array structures and object graphs to enumerate all referenced objects",
24282348 "homepage": "https://github.com/sebastianbergmann/object-enumerator/",
2349<<<<<<< HEAD
24292350 "support": {
24302351 "issues": "https://github.com/sebastianbergmann/object-enumerator/issues",
24312352 "source": "https://github.com/sebastianbergmann/object-enumerator/tree/4.0.4"
24322353 },
2354=======
2355>>>>>>> 4e890c5... initial functions
24332356 "funding": [
24342357 {
24352358 "url": "https://github.com/sebastianbergmann",
@@ -2481,10 +2404,13 @@
24812404 ],
24822405 "description": "Allows reflection of object attributes, including inherited and non-public ones",
24832406 "homepage": "https://github.com/sebastianbergmann/object-reflector/",
2407<<<<<<< HEAD
24842408 "support": {
24852409 "issues": "https://github.com/sebastianbergmann/object-reflector/issues",
24862410 "source": "https://github.com/sebastianbergmann/object-reflector/tree/2.0.4"
24872411 },
2412=======
2413>>>>>>> 4e890c5... initial functions
24882414 "funding": [
24892415 {
24902416 "url": "https://github.com/sebastianbergmann",
@@ -2544,10 +2470,13 @@
25442470 ],
25452471 "description": "Provides functionality to recursively process PHP variables",
25462472 "homepage": "http://www.github.com/sebastianbergmann/recursion-context",
2473<<<<<<< HEAD
25472474 "support": {
25482475 "issues": "https://github.com/sebastianbergmann/recursion-context/issues",
25492476 "source": "https://github.com/sebastianbergmann/recursion-context/tree/4.0.4"
25502477 },
2478=======
2479>>>>>>> 4e890c5... initial functions
25512480 "funding": [
25522481 {
25532482 "url": "https://github.com/sebastianbergmann",
@@ -2599,10 +2528,13 @@
25992528 ],
26002529 "description": "Provides a list of PHP built-in functions that operate on resources",
26012530 "homepage": "https://www.github.com/sebastianbergmann/resource-operations",
2531<<<<<<< HEAD
26022532 "support": {
26032533 "issues": "https://github.com/sebastianbergmann/resource-operations/issues",
26042534 "source": "https://github.com/sebastianbergmann/resource-operations/tree/3.0.3"
26052535 },
2536=======
2537>>>>>>> 4e890c5... initial functions
26062538 "funding": [
26072539 {
26082540 "url": "https://github.com/sebastianbergmann",
@@ -2655,10 +2587,13 @@
26552587 ],
26562588 "description": "Collection of value objects that represent the types of the PHP type system",
26572589 "homepage": "https://github.com/sebastianbergmann/type",
2590<<<<<<< HEAD
26582591 "support": {
26592592 "issues": "https://github.com/sebastianbergmann/type/issues",
26602593 "source": "https://github.com/sebastianbergmann/type/tree/2.3.1"
26612594 },
2595=======
2596>>>>>>> 4e890c5... initial functions
26622597 "funding": [
26632598 {
26642599 "url": "https://github.com/sebastianbergmann",
@@ -2708,6 +2643,7 @@
27082643 ],
27092644 "description": "Library that helps with managing the version number of Git-hosted PHP projects",
27102645 "homepage": "https://github.com/sebastianbergmann/version",
2646<<<<<<< HEAD
27112647 "support": {
27122648 "issues": "https://github.com/sebastianbergmann/version/issues",
27132649 "source": "https://github.com/sebastianbergmann/version/tree/3.0.2"
@@ -2719,6 +2655,9 @@
27192655 }
27202656 ],
27212657 "time": "2020-09-28T06:39:44+00:00"
2658=======
2659 "time": "2016-10-03T07:35:21+00:00"
2660>>>>>>> 4e890c5... initial functions
27222661 },
27232662 {
27242663 "name": "symfony/polyfill-ctype",
@@ -2800,6 +2739,162 @@
28002739 "time": "2021-01-07T16:49:33+00:00"
28012740 },
28022741 {
2742<<<<<<< HEAD
2743=======
2744 "name": "symfony/polyfill-mbstring",
2745 "version": "v1.22.1",
2746 "source": {
2747 "type": "git",
2748 "url": "https://github.com/symfony/polyfill-mbstring.git",
2749 "reference": "5232de97ee3b75b0360528dae24e73db49566ab1"
2750 },
2751 "dist": {
2752 "type": "zip",
2753 "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/5232de97ee3b75b0360528dae24e73db49566ab1",
2754 "reference": "5232de97ee3b75b0360528dae24e73db49566ab1",
2755 "shasum": ""
2756 },
2757 "require": {
2758 "php": ">=7.1"
2759 },
2760 "suggest": {
2761 "ext-mbstring": "For best performance"
2762 },
2763 "type": "library",
2764 "extra": {
2765 "branch-alias": {
2766 "dev-main": "1.22-dev"
2767 },
2768 "thanks": {
2769 "name": "symfony/polyfill",
2770 "url": "https://github.com/symfony/polyfill"
2771 }
2772 },
2773 "autoload": {
2774 "psr-4": {
2775 "Symfony\\Polyfill\\Mbstring\\": ""
2776 },
2777 "files": [
2778 "bootstrap.php"
2779 ]
2780 },
2781 "notification-url": "https://packagist.org/downloads/",
2782 "license": [
2783 "MIT"
2784 ],
2785 "authors": [
2786 {
2787 "name": "Nicolas Grekas",
2788 "email": "p@tchwork.com"
2789 },
2790 {
2791 "name": "Symfony Community",
2792 "homepage": "https://symfony.com/contributors"
2793 }
2794 ],
2795 "description": "Symfony polyfill for the Mbstring extension",
2796 "homepage": "https://symfony.com",
2797 "keywords": [
2798 "compatibility",
2799 "mbstring",
2800 "polyfill",
2801 "portable",
2802 "shim"
2803 ],
2804 "support": {
2805 "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.22.1"
2806 },
2807 "funding": [
2808 {
2809 "url": "https://symfony.com/sponsor",
2810 "type": "custom"
2811 },
2812 {
2813 "url": "https://github.com/fabpot",
2814 "type": "github"
2815 },
2816 {
2817 "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
2818 "type": "tidelift"
2819 }
2820 ],
2821 "time": "2021-01-22T09:19:47+00:00"
2822 },
2823 {
2824 "name": "symfony/polyfill-php72",
2825 "version": "v1.22.1",
2826 "source": {
2827 "type": "git",
2828 "url": "https://github.com/symfony/polyfill-php72.git",
2829 "reference": "cc6e6f9b39fe8075b3dabfbaf5b5f645ae1340c9"
2830 },
2831 "dist": {
2832 "type": "zip",
2833 "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/cc6e6f9b39fe8075b3dabfbaf5b5f645ae1340c9",
2834 "reference": "cc6e6f9b39fe8075b3dabfbaf5b5f645ae1340c9",
2835 "shasum": ""
2836 },
2837 "require": {
2838 "php": ">=7.1"
2839 },
2840 "type": "library",
2841 "extra": {
2842 "branch-alias": {
2843 "dev-main": "1.22-dev"
2844 },
2845 "thanks": {
2846 "name": "symfony/polyfill",
2847 "url": "https://github.com/symfony/polyfill"
2848 }
2849 },
2850 "autoload": {
2851 "psr-4": {
2852 "Symfony\\Polyfill\\Php72\\": ""
2853 },
2854 "files": [
2855 "bootstrap.php"
2856 ]
2857 },
2858 "notification-url": "https://packagist.org/downloads/",
2859 "license": [
2860 "MIT"
2861 ],
2862 "authors": [
2863 {
2864 "name": "Nicolas Grekas",
2865 "email": "p@tchwork.com"
2866 },
2867 {
2868 "name": "Symfony Community",
2869 "homepage": "https://symfony.com/contributors"
2870 }
2871 ],
2872 "description": "Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions",
2873 "homepage": "https://symfony.com",
2874 "keywords": [
2875 "compatibility",
2876 "polyfill",
2877 "portable",
2878 "shim"
2879 ],
2880 "funding": [
2881 {
2882 "url": "https://symfony.com/sponsor",
2883 "type": "custom"
2884 },
2885 {
2886 "url": "https://github.com/fabpot",
2887 "type": "github"
2888 },
2889 {
2890 "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
2891 "type": "tidelift"
2892 }
2893 ],
2894 "time": "2021-01-07T16:49:33+00:00"
2895 },
2896 {
2897>>>>>>> 4e890c5... initial functions
28032898 "name": "symfony/polyfill-php80",
28042899 "version": "v1.22.1",
28052900 "source": {
@@ -2884,6 +2979,7 @@
28842979 },
28852980 {
28862981 "name": "symfony/var-dumper",
2982<<<<<<< HEAD
28872983 "version": "v5.2.6",
28882984 "source": {
28892985 "type": "git",
@@ -2894,6 +2990,18 @@
28942990 "type": "zip",
28952991 "url": "https://api.github.com/repos/symfony/var-dumper/zipball/89412a68ea2e675b4e44f260a5666729f77f668e",
28962992 "reference": "89412a68ea2e675b4e44f260a5666729f77f668e",
2993=======
2994 "version": "v4.4.21",
2995 "source": {
2996 "type": "git",
2997 "url": "https://github.com/symfony/var-dumper.git",
2998 "reference": "0da0e174f728996f5d5072d6a9f0a42259dbc806"
2999 },
3000 "dist": {
3001 "type": "zip",
3002 "url": "https://api.github.com/repos/symfony/var-dumper/zipball/0da0e174f728996f5d5072d6a9f0a42259dbc806",
3003 "reference": "0da0e174f728996f5d5072d6a9f0a42259dbc806",
3004>>>>>>> 4e890c5... initial functions
28973005 "shasum": ""
28983006 },
28993007 "require": {
@@ -2951,9 +3059,12 @@
29513059 "debug",
29523060 "dump"
29533061 ],
3062<<<<<<< HEAD
29543063 "support": {
29553064 "source": "https://github.com/symfony/var-dumper/tree/v5.2.6"
29563065 },
3066=======
3067>>>>>>> 4e890c5... initial functions
29573068 "funding": [
29583069 {
29593070 "url": "https://symfony.com/sponsor",
@@ -2968,7 +3079,11 @@
29683079 "type": "tidelift"
29693080 }
29703081 ],
3082<<<<<<< HEAD
29713083 "time": "2021-03-28T09:42:18+00:00"
3084=======
3085 "time": "2021-03-27T19:49:03+00:00"
3086>>>>>>> 4e890c5... initial functions
29723087 },
29733088 {
29743089 "name": "theseer/tokenizer",
@@ -3088,5 +3203,5 @@
30883203 "php": "^7.0 || ^8.0"
30893204 },
30903205 "platform-dev": [],
3091 "plugin-api-version": "2.0.0"
3206 "plugin-api-version": "1.1.0"
30923207}
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}