From 76695a032ae6f364384523092ac9f131d32b9edc Mon Sep 17 00:00:00 2001 From: Alex Weininger Date: Fri, 4 Jun 2021 13:35:59 -0700 Subject: [PATCH 01/44] Add information about _APP_STORAGE_LIMIT environment variable Discussed in discord, adding this for give the _APP_STORAGE_LIMIT env variable more exposure. Since users might come to this doc page looking for information on max file size. --- docs/services/storage.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/services/storage.md b/docs/services/storage.md index 0de9eb891..436fffb3e 100644 --- a/docs/services/storage.md +++ b/docs/services/storage.md @@ -2,4 +2,6 @@ The Storage service allows you to manage your project files. Using the Storage s Each file in the service is granted with read and write permissions to manage who has access to view or edit it. You can also learn more about how to manage your [resources permissions](/docs/permissions). -The preview endpoint allows you to generate preview images for your files. Using the preview endpoint, you can also manipulate the resulting image so that it will fit perfectly inside your app in terms of dimensions, file size, and style. The preview endpoint also allows you to change the resulting image file format for better compression or image quality for better delivery over the network. \ No newline at end of file +The preview endpoint allows you to generate preview images for your files. Using the preview endpoint, you can also manipulate the resulting image so that it will fit perfectly inside your app in terms of dimensions, file size, and style. The preview endpoint also allows you to change the resulting image file format for better compression or image quality for better delivery over the network. + +The maximum file size allowed for file upload is controlled by the `_APP_STORAGE_LIMIT` environment variable, which defaults to 10 MB. See [Environment Variables](https://appwrite.io/docs/environment-variables#storage) for more information. From 9df694a253c5cef46cedb956f0a7485fe434ec37 Mon Sep 17 00:00:00 2001 From: Alex Weininger Date: Fri, 4 Jun 2021 13:41:31 -0700 Subject: [PATCH 02/44] Avoid hardcoding URL Co-authored-by: kodumbeats --- docs/services/storage.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/services/storage.md b/docs/services/storage.md index 436fffb3e..5b046d318 100644 --- a/docs/services/storage.md +++ b/docs/services/storage.md @@ -4,4 +4,4 @@ Each file in the service is granted with read and write permissions to manage wh The preview endpoint allows you to generate preview images for your files. Using the preview endpoint, you can also manipulate the resulting image so that it will fit perfectly inside your app in terms of dimensions, file size, and style. The preview endpoint also allows you to change the resulting image file format for better compression or image quality for better delivery over the network. -The maximum file size allowed for file upload is controlled by the `_APP_STORAGE_LIMIT` environment variable, which defaults to 10 MB. See [Environment Variables](https://appwrite.io/docs/environment-variables#storage) for more information. +The maximum file size allowed for file upload is controlled by the `_APP_STORAGE_LIMIT` environment variable, which defaults to 10 MB. See [Environment Variables](/docs/environment-variables#storage) for more information. From 53982458cd7d6be56699dc8e6796ca581dd8b3d8 Mon Sep 17 00:00:00 2001 From: Bishwajeet Parhi <62933155+2002Bishwajeet@users.noreply.github.com> Date: Wed, 22 Sep 2021 21:28:44 +0530 Subject: [PATCH 03/44] Update GETTING_START.md for flutter --- docs/sdks/flutter/GETTING_STARTED.md | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/docs/sdks/flutter/GETTING_STARTED.md b/docs/sdks/flutter/GETTING_STARTED.md index 28899ff18..22bbc9a8b 100644 --- a/docs/sdks/flutter/GETTING_STARTED.md +++ b/docs/sdks/flutter/GETTING_STARTED.md @@ -10,11 +10,15 @@ If you are building your Flutter application for multiple devices, you have to f ### Android For **Android** first add your app name and package name, Your package name is generally the **applicationId** in your app-level build.gradle file. By registering your new app platform, you are allowing your app to communicate with the Appwrite API. -In order to capture the Appwrite OAuth callback url, the following activity needs to be added to your [AndroidManifest.xml](https://github.com/appwrite/playground-for-flutter/blob/master/android/app/src/main/AndroidManifest.xml). Be sure to replace the **[PROJECT_ID]** string with your actual Appwrite project ID. You can find your Appwrite project ID in your project settings screen in the console. +In order to capture the Appwrite OAuth callback url, the following activity needs to be added inside the `` tag, along side the existing `` tags in your [AndroidManifest.xml](https://github.com/appwrite/playground-for-flutter/blob/master/android/app/src/main/AndroidManifest.xml). Be sure to replace the **[PROJECT_ID]** string with your actual Appwrite project ID. You can find your Appwrite project ID in your project settings screen in the console. ```xml - - + + .... + + .... + + From 8b170cbbd2febc121a238b59af59cd16028d1ccd Mon Sep 17 00:00:00 2001 From: Gireesh Puthumana Date: Sun, 26 Sep 2021 17:33:36 -0400 Subject: [PATCH 04/44] Fix for #1662. Corrected the spelling in the logs. --- app/http.php | 4 ++-- app/realtime.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/http.php b/app/http.php index 9a3a5459d..2f042ba99 100644 --- a/app/http.php +++ b/app/http.php @@ -30,7 +30,7 @@ $http ; $http->on('WorkerStart', function($serv, $workerId) { - Console::success('Worker '.++$workerId.' started succefully'); + Console::success('Worker '.++$workerId.' started successfully'); }); $http->on('BeforeReload', function($serv, $workerId) { @@ -43,7 +43,7 @@ $http->on('AfterReload', function($serv, $workerId) { $http->on('start', function (Server $http) use ($payloadSize) { - Console::success('Server started succefully (max payload is '.number_format($payloadSize).' bytes)'); + Console::success('Server started successfully (max payload is '.number_format($payloadSize).' bytes)'); Console::info("Master pid {$http->master_pid}, manager pid {$http->manager_pid}"); diff --git a/app/realtime.php b/app/realtime.php index 70eacc0d4..6a771d490 100644 --- a/app/realtime.php +++ b/app/realtime.php @@ -49,7 +49,7 @@ $adapter->setPackageMaxLength(64000); // Default maximum Package Size (64kb) $server = new Server($adapter); $server->onStart(function () use ($stats, $register, $containerId, &$documentId) { - Console::success('Server started succefully'); + Console::success('Server started successfully'); $getConsoleDb = function () use ($register) { $db = $register->get('dbPool')->get(); @@ -164,7 +164,7 @@ $server->onStart(function () use ($stats, $register, $containerId, &$documentId) }); $server->onWorkerStart(function (int $workerId) use ($server, $register, $stats, $realtime) { - Console::success('Worker ' . $workerId . ' started succefully'); + Console::success('Worker ' . $workerId . ' started successfully'); $attempts = 0; $start = time(); From 1e5e84b10ad0b11df36af11840f850741ba20d20 Mon Sep 17 00:00:00 2001 From: Bishwajeet Parhi <62933155+2002Bishwajeet@users.noreply.github.com> Date: Sun, 3 Oct 2021 14:24:56 +0530 Subject: [PATCH 05/44] removing a blank space --- docs/sdks/flutter/GETTING_STARTED.md | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/sdks/flutter/GETTING_STARTED.md b/docs/sdks/flutter/GETTING_STARTED.md index 22bbc9a8b..745db5b8a 100644 --- a/docs/sdks/flutter/GETTING_STARTED.md +++ b/docs/sdks/flutter/GETTING_STARTED.md @@ -17,7 +17,6 @@ In order to capture the Appwrite OAuth callback url, the following activity need .... .... - From 6bc186512e22c14cff41959df5cc8cda46eb6354 Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Mon, 30 May 2022 14:01:39 +0200 Subject: [PATCH 06/44] fix: increase subquery limit --- app/init.php | 79 ++++++++++++++++++++++++++++------------------------ 1 file changed, 42 insertions(+), 37 deletions(-) diff --git a/app/init.php b/app/init.php index 7e501b84a..7f2ecc2ac 100644 --- a/app/init.php +++ b/app/init.php @@ -77,6 +77,7 @@ const APP_LIMIT_ANTIVIRUS = 20000000; //20MB const APP_LIMIT_ENCRYPTION = 20000000; //20MB const APP_LIMIT_COMPRESSION = 20000000; //20MB const APP_LIMIT_ARRAY_PARAMS_SIZE = 100; // Default maximum of how many elements can there be in API parameter that expects array value +const APP_LIMIT_SUBQUERY = 1000; const APP_CACHE_BUSTER = 305; const APP_VERSION_STABLE = '0.14.2'; const APP_DATABASE_ATTRIBUTE_EMAIL = 'email'; @@ -189,44 +190,48 @@ if(!empty($user) || !empty($pass)) { * New DB Filters */ Database::addFilter('casting', - function($value) { + function(mixed $value) { return json_encode(['value' => $value], JSON_PRESERVE_ZERO_FRACTION); }, - function($value) { + function(mixed $value) { if (is_null($value)) { return null; } + return json_decode($value, true)['value']; } ); Database::addFilter('enum', - function($value, Document $attribute) { + function(mixed $value, Document $attribute) { if ($attribute->isSet('elements')) { $attribute->removeAttribute('elements'); } + return $value; }, - function($value, Document $attribute) { + function(mixed $value, Document $attribute) { $formatOptions = json_decode($attribute->getAttribute('formatOptions', '[]'), true); if (isset($formatOptions['elements'])) { $attribute->setAttribute('elements', $formatOptions['elements']); } + return $value; } ); Database::addFilter('range', - function($value, Document $attribute) { + function(mixed $value, Document $attribute) { if ($attribute->isSet('min')) { $attribute->removeAttribute('min'); } if ($attribute->isSet('max')) { $attribute->removeAttribute('max'); } + return $value; }, - function($value, Document $attribute) { + function(mixed $value, Document $attribute) { $formatOptions = json_decode($attribute->getAttribute('formatOptions', '[]'), true); if (isset($formatOptions['min']) || isset($formatOptions['max'])) { $attribute @@ -234,15 +239,16 @@ Database::addFilter('range', ->setAttribute('max', $formatOptions['max']) ; } + return $value; } ); Database::addFilter('subQueryAttributes', - function($value) { + function(mixed $value) { return null; }, - function($value, Document $document, Database $database) { + function(mixed $value, Document $document, Database $database) { return $database ->find('attributes', [ new Query('collectionId', Query::TYPE_EQUAL, [$document->getId()]) @@ -251,10 +257,10 @@ Database::addFilter('subQueryAttributes', ); Database::addFilter('subQueryIndexes', - function($value) { + function(mixed $value) { return null; }, - function($value, Document $document, Database $database) { + function(mixed $value, Document $document, Database $database) { return $database ->find('indexes', [ new Query('collectionId', Query::TYPE_EQUAL, [$document->getId()]) @@ -263,95 +269,94 @@ Database::addFilter('subQueryIndexes', ); Database::addFilter('subQueryPlatforms', - function($value) { + function(mixed $value) { return null; }, - function($value, Document $document, Database $database) { + function(mixed $value, Document $document, Database $database) { return $database ->find('platforms', [ new Query('projectId', Query::TYPE_EQUAL, [$document->getId()]) - ], $database->getIndexLimit(), 0, []); + ], APP_LIMIT_SUBQUERY, 0, []); } ); Database::addFilter('subQueryDomains', - function($value) { + function(mixed $value) { return null; }, - function($value, Document $document, Database $database) { + function(mixed $value, Document $document, Database $database) { return $database ->find('domains', [ new Query('projectId', Query::TYPE_EQUAL, [$document->getId()]) - ], $database->getIndexLimit(), 0, []); + ], APP_LIMIT_SUBQUERY, 0, []); } ); Database::addFilter('subQueryKeys', - function($value) { + function(mixed $value) { return null; }, - function($value, Document $document, Database $database) { + function(mixed $value, Document $document, Database $database) { return $database ->find('keys', [ new Query('projectId', Query::TYPE_EQUAL, [$document->getId()]) - ], $database->getIndexLimit(), 0, []); + ], APP_LIMIT_SUBQUERY, 0, []); } ); Database::addFilter('subQueryWebhooks', - function($value) { + function(mixed $value) { return null; }, - function($value, Document $document, Database $database) { + function(mixed $value, Document $document, Database $database) { return $database ->find('webhooks', [ new Query('projectId', Query::TYPE_EQUAL, [$document->getId()]) - ], $database->getIndexLimit(), 0, []); + ], APP_LIMIT_SUBQUERY, 0, []); } ); Database::addFilter('subQuerySessions', - function($value) { + function(mixed $value) { return null; }, - function($value, Document $document, Database $database) { - $sessions = Authorization::skip(fn () => $database->find('sessions', [ + function(mixed $value, Document $document, Database $database) { + return Authorization::skip(fn () => $database->find('sessions', [ new Query('userId', Query::TYPE_EQUAL, [$document->getId()]) - ], $database->getIndexLimit(), 0, [])); - - return $sessions; + ], APP_LIMIT_SUBQUERY, 0, [])); } ); Database::addFilter('subQueryTokens', - function($value) { + function(mixed $value) { return null; }, - function($value, Document $document, Database $database) { + function(mixed $value, Document $document, Database $database) { return Authorization::skip(fn() => $database ->find('tokens', [ new Query('userId', Query::TYPE_EQUAL, [$document->getId()]) - ], $database->getIndexLimit(), 0, [])); + ], APP_LIMIT_SUBQUERY, 0, [])); } ); - + Database::addFilter('subQueryMemberships', - function($value) { + function(mixed $value) { return null; }, - function($value, Document $document, Database $database) { + function(mixed $value, Document $document, Database $database) { return Authorization::skip(fn() => $database ->find('memberships', [ new Query('userId', Query::TYPE_EQUAL, [$document->getId()]) - ], $database->getIndexLimit(), 0, [])); + ], APP_LIMIT_SUBQUERY, 0, [])); } ); Database::addFilter('encrypt', - function($value) { + function(mixed $value) { $key = App::getEnv('_APP_OPENSSL_KEY_V1'); $iv = OpenSSL::randomPseudoBytes(OpenSSL::cipherIVLength(OpenSSL::CIPHER_AES_128_GCM)); $tag = null; + return json_encode([ 'data' => OpenSSL::encrypt($value, OpenSSL::CIPHER_AES_128_GCM, $key, 0, $iv, $tag), 'method' => OpenSSL::CIPHER_AES_128_GCM, @@ -360,7 +365,7 @@ Database::addFilter('encrypt', 'version' => '1', ]); }, - function($value) { + function(mixed $value) { if(is_null($value)) { return null; } From e056dc15c95df0885560650e0461633a27732b28 Mon Sep 17 00:00:00 2001 From: adityaoberai Date: Tue, 31 May 2022 20:26:15 +0530 Subject: [PATCH 07/44] Fix .NET logo --- public/images/runtimes/dotnet.png | Bin 27220 -> 5079 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/public/images/runtimes/dotnet.png b/public/images/runtimes/dotnet.png index 824721f2006f7e9c8101d9b2b10601b4613650c6..aa003d5c3c04a034b8adfdd470c4496e400aa178 100644 GIT binary patch literal 5079 zcmeHK`#;nD`>(s(t-HHY-E>gM-F=4?rPQq%x0sbfipn8}TSU$Zld-9UqRe?YF6UGx z=OUzok;Cqp)5c6WY-5b=&1|;$zTZCI`(OC{^8M~{dAwhH?K(WK=XJfV*W2Su7m?ex zC~w)YVZ*iy=gn+4Y}mwx{x)v{chH#M2RCf^fp*F23gWVMzwOa}+hhH9#|EzG3|!G2 zxO#lx+KGW{dIR=)gAOML9ZwB9>JK`d9=v`Alpz;`A(yj5uCO6DLr{kQh7Y?N4Z9l; z-}r0T!vqwX=Q-L=`HrMz|v*+=+45X)MBdEYfW( z%8iNnn~8B}Vs9{`J($s+%zK{W_iv6r@E(u3H6G(L{?O-Jtnartzi)B=-{J$lJqrB( zIOuyq@b`q<-xKeAe*#L##M97;q_Bx3)C4YkA~}3AC1NraJ((6cnHDvf9yOJLnaaRU zWkyfo?@i(FPh~xr&Wf4NemI>IH=P^D%8O^^J!0iQW)TutghbZ!M0UXwcHvWYVG_Ft z$1Y9=g;SEkDNW^+rg6&BIWICmnJLeld5NES`E2HOHYl?dIkUvvSz_L7W&Z3N!fX|R zTlJhWj4P|o;FXrBs&%G<3fA?~}@zs3O>-naN`S-;6 zW+Jb-lGpNv*ILEL!)vQq_*lE}v2Nj0{le#lg)eUx+utp=H!hNz7CYX9!tZS6 ze{JD^ZRK};;CHw2d)fp&9|gUi1mw>G@)yBB?E*?WKp_Er9RRfxpne7VyMTeNrNN%1 zq28q-^3w1>OSFHMX_RGp-|`4`d9;6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b z$-R}Ty#hyd%-LJ1W}yt3X3v&oB{{A$T(QpouAjh|RY$W})nEGU<*EPr|NVEJz{jA# t3B9rgLISiS1y$ux3GrVVt0(yD Date: Tue, 31 May 2022 17:09:45 +0200 Subject: [PATCH 08/44] ci: introduce linter --- .github/workflows/linter.yml | 26 ++++++++++++ composer.lock | 80 +++++++++++++++++++----------------- phpcs.xml | 9 ++++ 3 files changed, 77 insertions(+), 38 deletions(-) create mode 100644 .github/workflows/linter.yml create mode 100644 phpcs.xml diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml new file mode 100644 index 000000000..a18e22720 --- /dev/null +++ b/.github/workflows/linter.yml @@ -0,0 +1,26 @@ +name: "Linter" + +on: [pull_request] +jobs: + tests: + name: Linter + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + with: + # We must fetch at least the immediate parents so that if this is + # a pull request then we can checkout the head. + fetch-depth: 2 + + # If this run was triggered by a pull request event, then checkout + # the head of the pull request instead of the merge commit. + - run: git checkout HEAD^2 + if: ${{ github.event_name == 'pull_request' }} + + - name: Install Dependencies + uses: php-actions/composer@v6 + run: composer install --ignore-platform-reqs --no-cache + + - name: Run Linter + run: ./vendor/bin/phpcs -p || true diff --git a/composer.lock b/composer.lock index 8bef73637..685b4948b 100644 --- a/composer.lock +++ b/composer.lock @@ -481,16 +481,16 @@ }, { "name": "guzzlehttp/guzzle", - "version": "7.4.2", + "version": "7.4.3", "source": { "type": "git", "url": "https://github.com/guzzle/guzzle.git", - "reference": "ac1ec1cd9b5624694c3a40be801d94137afb12b4" + "reference": "74a8602c6faec9ef74b7a9391ac82c5e65b1cdab" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/ac1ec1cd9b5624694c3a40be801d94137afb12b4", - "reference": "ac1ec1cd9b5624694c3a40be801d94137afb12b4", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/74a8602c6faec9ef74b7a9391ac82c5e65b1cdab", + "reference": "74a8602c6faec9ef74b7a9391ac82c5e65b1cdab", "shasum": "" }, "require": { @@ -585,7 +585,7 @@ ], "support": { "issues": "https://github.com/guzzle/guzzle/issues", - "source": "https://github.com/guzzle/guzzle/tree/7.4.2" + "source": "https://github.com/guzzle/guzzle/tree/7.4.3" }, "funding": [ { @@ -601,7 +601,7 @@ "type": "tidelift" } ], - "time": "2022-03-20T14:16:28+00:00" + "time": "2022-05-25T13:24:33+00:00" }, { "name": "guzzlehttp/promises", @@ -1639,25 +1639,25 @@ }, { "name": "symfony/deprecation-contracts", - "version": "v3.0.1", + "version": "v3.1.0", "source": { "type": "git", "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "26954b3d62a6c5fd0ea8a2a00c0353a14978d05c" + "reference": "07f1b9cc2ffee6aaafcf4b710fbc38ff736bd918" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/26954b3d62a6c5fd0ea8a2a00c0353a14978d05c", - "reference": "26954b3d62a6c5fd0ea8a2a00c0353a14978d05c", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/07f1b9cc2ffee6aaafcf4b710fbc38ff736bd918", + "reference": "07f1b9cc2ffee6aaafcf4b710fbc38ff736bd918", "shasum": "" }, "require": { - "php": ">=8.0.2" + "php": ">=8.1" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "3.0-dev" + "dev-main": "3.1-dev" }, "thanks": { "name": "symfony/contracts", @@ -1686,7 +1686,7 @@ "description": "A generic function and convention to trigger deprecation notices", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/v3.0.1" + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.1.0" }, "funding": [ { @@ -1702,7 +1702,7 @@ "type": "tidelift" } ], - "time": "2022-01-02T09:55:41+00:00" + "time": "2022-02-25T11:15:52+00:00" }, { "name": "symfony/polyfill-ctype", @@ -5767,20 +5767,21 @@ }, { "name": "symfony/console", - "version": "v6.0.8", + "version": "v6.1.0", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "0d00aa289215353aa8746a31d101f8e60826285c" + "reference": "c9646197ef43b0e2ff44af61e7f0571526fd4170" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/0d00aa289215353aa8746a31d101f8e60826285c", - "reference": "0d00aa289215353aa8746a31d101f8e60826285c", + "url": "https://api.github.com/repos/symfony/console/zipball/c9646197ef43b0e2ff44af61e7f0571526fd4170", + "reference": "c9646197ef43b0e2ff44af61e7f0571526fd4170", "shasum": "" }, "require": { - "php": ">=8.0.2", + "php": ">=8.1", + "symfony/deprecation-contracts": "^2.1|^3", "symfony/polyfill-mbstring": "~1.0", "symfony/service-contracts": "^1.1|^2|^3", "symfony/string": "^5.4|^6.0" @@ -5842,7 +5843,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v6.0.8" + "source": "https://github.com/symfony/console/tree/v6.1.0" }, "funding": [ { @@ -5858,7 +5859,7 @@ "type": "tidelift" } ], - "time": "2022-04-20T15:01:42+00:00" + "time": "2022-05-27T06:34:22+00:00" }, { "name": "symfony/polyfill-intl-grapheme", @@ -6110,20 +6111,20 @@ }, { "name": "symfony/service-contracts", - "version": "v3.0.1", + "version": "v3.1.0", "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "e517458f278c2131ca9f262f8fbaf01410f2c65c" + "reference": "d66cd8ab656780f62c4215b903a420eb86358957" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/e517458f278c2131ca9f262f8fbaf01410f2c65c", - "reference": "e517458f278c2131ca9f262f8fbaf01410f2c65c", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/d66cd8ab656780f62c4215b903a420eb86358957", + "reference": "d66cd8ab656780f62c4215b903a420eb86358957", "shasum": "" }, "require": { - "php": ">=8.0.2", + "php": ">=8.1", "psr/container": "^2.0" }, "conflict": { @@ -6135,7 +6136,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "3.0-dev" + "dev-main": "3.1-dev" }, "thanks": { "name": "symfony/contracts", @@ -6145,7 +6146,10 @@ "autoload": { "psr-4": { "Symfony\\Contracts\\Service\\": "" - } + }, + "exclude-from-classmap": [ + "/Test/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -6172,7 +6176,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/service-contracts/tree/v3.0.1" + "source": "https://github.com/symfony/service-contracts/tree/v3.1.0" }, "funding": [ { @@ -6188,24 +6192,24 @@ "type": "tidelift" } ], - "time": "2022-03-13T20:10:05+00:00" + "time": "2022-05-07T08:07:09+00:00" }, { "name": "symfony/string", - "version": "v6.0.8", + "version": "v6.1.0", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "ac0aa5c2282e0de624c175b68d13f2c8f2e2649d" + "reference": "d3edc75baf9f1d4f94879764dda2e1ac33499529" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/ac0aa5c2282e0de624c175b68d13f2c8f2e2649d", - "reference": "ac0aa5c2282e0de624c175b68d13f2c8f2e2649d", + "url": "https://api.github.com/repos/symfony/string/zipball/d3edc75baf9f1d4f94879764dda2e1ac33499529", + "reference": "d3edc75baf9f1d4f94879764dda2e1ac33499529", "shasum": "" }, "require": { - "php": ">=8.0.2", + "php": ">=8.1", "symfony/polyfill-ctype": "~1.8", "symfony/polyfill-intl-grapheme": "~1.0", "symfony/polyfill-intl-normalizer": "~1.0", @@ -6257,7 +6261,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v6.0.8" + "source": "https://github.com/symfony/string/tree/v6.1.0" }, "funding": [ { @@ -6273,7 +6277,7 @@ "type": "tidelift" } ], - "time": "2022-04-22T08:18:02+00:00" + "time": "2022-04-22T08:18:23+00:00" }, { "name": "textalk/websocket", @@ -6632,5 +6636,5 @@ "platform-overrides": { "php": "8.0" }, - "plugin-api-version": "2.2.0" + "plugin-api-version": "2.3.0" } diff --git a/phpcs.xml b/phpcs.xml new file mode 100644 index 000000000..d4efd6f52 --- /dev/null +++ b/phpcs.xml @@ -0,0 +1,9 @@ + + + A custom coding standard + ./app + ./src + ./tests + + + \ No newline at end of file From 981e82eb45ed643f610d6c84531a6e7a8d9764cd Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Tue, 31 May 2022 17:16:27 +0200 Subject: [PATCH 09/44] ci: fix php sniffer configuration --- app/config/scopes.php | 1 - phpcs.xml | 9 +++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/config/scopes.php b/app/config/scopes.php index c1d3bb73f..0b9879b64 100644 --- a/app/config/scopes.php +++ b/app/config/scopes.php @@ -71,4 +71,3 @@ return [ // List of publicly visible scopes 'description' => 'Access to read your project\'s health status', ], ]; - diff --git a/phpcs.xml b/phpcs.xml index d4efd6f52..3f38d29d5 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -1,9 +1,10 @@ - - A custom coding standard + + ./app ./src ./tests - - + + + ./app/sdks \ No newline at end of file From 30ffcafc04aabcd6edb0d45426a6b882c77c593d Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Tue, 31 May 2022 17:18:12 +0200 Subject: [PATCH 10/44] ci: fix linter os --- .github/workflows/linter.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index a18e22720..90931e53a 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -4,6 +4,7 @@ on: [pull_request] jobs: tests: name: Linter + runs-on: ubuntu-latest steps: - name: Checkout repository From 2d58f48b7281318f7725bb98b7b4dfc82c29bac5 Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Tue, 31 May 2022 17:22:40 +0200 Subject: [PATCH 11/44] ci: fix linter --- .github/workflows/linter.yml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index 90931e53a..dcfd27f2f 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -19,9 +19,13 @@ jobs: - run: git checkout HEAD^2 if: ${{ github.event_name == 'pull_request' }} - - name: Install Dependencies - uses: php-actions/composer@v6 - run: composer install --ignore-platform-reqs --no-cache - + - name: Install dependencies + uses: php-actions/composer@v7 + with: + php_version: '8.0' + args: --profile --ignore-platform-reqs - name: Run Linter + uses: shivammathur/setup-php@v2 + with: + php-version: '8.0' run: ./vendor/bin/phpcs -p || true From f58aa0c81896e6936020d97ea8fa4726017e2f82 Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Tue, 31 May 2022 17:26:45 +0200 Subject: [PATCH 12/44] Update linter.yml --- .github/workflows/linter.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index dcfd27f2f..e5e191592 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -19,13 +19,16 @@ jobs: - run: git checkout HEAD^2 if: ${{ github.event_name == 'pull_request' }} + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: '8.0' + - name: Install dependencies uses: php-actions/composer@v7 with: php_version: '8.0' args: --profile --ignore-platform-reqs + - name: Run Linter - uses: shivammathur/setup-php@v2 - with: - php-version: '8.0' run: ./vendor/bin/phpcs -p || true From 70286f57dc9b1df6fbfb53688e07e03797e22b41 Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Tue, 31 May 2022 17:27:40 +0200 Subject: [PATCH 13/44] ci: update php composer version for linter --- .github/workflows/linter.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index e5e191592..a185f3fcd 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -25,7 +25,7 @@ jobs: php-version: '8.0' - name: Install dependencies - uses: php-actions/composer@v7 + uses: php-actions/composer@v6 with: php_version: '8.0' args: --profile --ignore-platform-reqs From ff949392edc804207fdde1b5a5f2f0c313204918 Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Tue, 31 May 2022 17:36:38 +0200 Subject: [PATCH 14/44] linter: exclude max line width rule --- phpcs.xml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/phpcs.xml b/phpcs.xml index 3f38d29d5..9c8ced28e 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -7,4 +7,8 @@ ./app/sdks + + + * + \ No newline at end of file From f645c2ce5320b0e220fb26fbff1a592253218c82 Mon Sep 17 00:00:00 2001 From: Steven Nguyen Date: Sat, 21 May 2022 23:57:59 -0700 Subject: [PATCH 15/44] Update service checks to ignore server app users --- app/controllers/general.php | 3 +- .../Projects/ProjectsConsoleClientTest.php | 98 +++++++++++++++++++ 2 files changed, 100 insertions(+), 1 deletion(-) diff --git a/app/controllers/general.php b/app/controllers/general.php index 84d158714..747799e36 100644 --- a/app/controllers/general.php +++ b/app/controllers/general.php @@ -292,10 +292,11 @@ App::init(function (App $utopia, Request $request, Response $response, Document $service = $route->getLabel('sdk.namespace', ''); if (!empty($service)) { + $roles = Authorization::getRoles(); if ( array_key_exists($service, $project->getAttribute('services', [])) && !$project->getAttribute('services', [])[$service] - && !Auth::isPrivilegedUser(Authorization::getRoles()) + && !(Auth::isPrivilegedUser($roles) || Auth::isAppUser($roles)) ) { throw new AppwriteException('Service is disabled', 503, AppwriteException::GENERAL_SERVICE_DISABLED); } diff --git a/tests/e2e/Services/Projects/ProjectsConsoleClientTest.php b/tests/e2e/Services/Projects/ProjectsConsoleClientTest.php index 115451564..b55045669 100644 --- a/tests/e2e/Services/Projects/ProjectsConsoleClientTest.php +++ b/tests/e2e/Services/Projects/ProjectsConsoleClientTest.php @@ -786,6 +786,104 @@ class ProjectsConsoleClientTest extends Scope } } + /** @depends testUpdateProjectServiceStatusAdmin */ + public function testUpdateProjectServiceStatusServer($data): void + { + $id = $data['projectId']; + + $services = require('app/config/services.php'); + + /** + * Test for Disabled + */ + foreach ($services as $service) { + if (!$service['optional']) { + continue; + } + + $key = $service['key'] ?? ''; + + $response = $this->client->call(Client::METHOD_PATCH, '/projects/' . $id . '/service', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'cookie' => 'a_session_console=' . $this->getRoot()['session'], + ]), [ + 'service' => $key, + 'status' => false, + ]); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertNotEmpty($response['body']['$id']); + + $response = $this->client->call(Client::METHOD_GET, '/projects/' . $id, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'cookie' => 'a_session_console=' . $this->getRoot()['session'], + ])); + + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertNotEmpty($response['body']['$id']); + $this->assertEquals(false, $response['body']['serviceStatusFor' . ucfirst($key)]); + } + + // Create API Key + $response = $this->client->call(Client::METHOD_POST, '/projects/' . $id . '/keys', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'cookie' => 'a_session_console=' . $this->getRoot()['session'], + ]), [ + 'name' => 'Key Test', + 'scopes' => ['functions.read', 'teams.write'], + ]); + + $this->assertEquals(201, $response['headers']['status-code']); + + $keyId = $response['body']['$id']; + $keySecret = $response['body']['secret']; + + /** + * Request with API Key must succeed + */ + $response = $this->client->call(Client::METHOD_GET, '/functions', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $id, + 'x-appwrite-key' => $keySecret, + ])); + + $this->assertEquals(200, $response['headers']['status-code']); + + $response = $this->client->call(Client::METHOD_POST, '/teams', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $id, + 'x-appwrite-key' => $keySecret, + ]), [ + 'teamId' => 'unique()', + 'name' => 'Arsenal' + ]); + + $this->assertEquals(201, $response['headers']['status-code']); + + // Cleanup + + $response = $this->client->call(Client::METHOD_DELETE, '/projects/' . $id . '/keys/' . $keyId, array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'cookie' => 'a_session_console=' . $this->getRoot()['session'], + ]), []); + + $this->assertEquals(204, $response['headers']['status-code']); + + foreach ($services as $service) { + $response = $this->client->call(Client::METHOD_PATCH, '/projects/' . $id . '/service/', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'service' => $service, + 'status' => true, + ]); + } + } + /** * @depends testCreateProject */ From ec1c4fd5c3c729c4ecb8cab65344927aa735d69c Mon Sep 17 00:00:00 2001 From: Steven Date: Fri, 27 May 2022 05:45:38 +0000 Subject: [PATCH 16/44] Bypass SMTP host check for admins adding team members Since no email is sent when adding team members for admins, there shouldn't be any need to check the SMTP host. --- app/controllers/api/teams.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/controllers/api/teams.php b/app/controllers/api/teams.php index 7244c4e24..03b4c4105 100644 --- a/app/controllers/api/teams.php +++ b/app/controllers/api/teams.php @@ -295,13 +295,13 @@ App::post('/v1/teams/:teamId/memberships') ->inject('events') ->action(function (string $teamId, string $email, array $roles, string $url, string $name, Response $response, Document $project, Document $user, Database $dbForProject, Locale $locale, EventAudit $audits, Mail $mails, Event $events) { - if (empty(App::getEnv('_APP_SMTP_HOST'))) { - throw new Exception('SMTP Disabled', 503, Exception::GENERAL_SMTP_DISABLED); - } - $isPrivilegedUser = Auth::isPrivilegedUser(Authorization::getRoles()); $isAppUser = Auth::isAppUser(Authorization::getRoles()); + if (!$isPrivilegedUser && !$isAppUser && empty(App::getEnv('_APP_SMTP_HOST'))) { + throw new Exception('SMTP Disabled', 503, Exception::GENERAL_SMTP_DISABLED); + } + $email = \strtolower($email); $name = (empty($name)) ? $email : $name; $team = $dbForProject->getDocument('teams', $teamId); From 4a87e73a453c6ad51548e9aa6cba20d92caf2f6d Mon Sep 17 00:00:00 2001 From: Steven Date: Fri, 27 May 2022 05:33:13 +0000 Subject: [PATCH 17/44] Update success, loading, and error message for add team member Remove text indicating invitations since no emails are sent when adding a user via the Admin console. --- app/controllers/api/teams.php | 2 +- app/views/console/users/team.phtml | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/controllers/api/teams.php b/app/controllers/api/teams.php index 7244c4e24..1e799a8a5 100644 --- a/app/controllers/api/teams.php +++ b/app/controllers/api/teams.php @@ -380,7 +380,7 @@ App::post('/v1/teams/:teamId/memberships') try { $membership = Authorization::skip(fn() => $dbForProject->createDocument('memberships', $membership)); } catch (Duplicate $th) { - throw new Exception('User has already been invited or is already a member of this team', 409, Exception::TEAM_INVITE_ALREADY_EXISTS); + throw new Exception('User is already a member of this team', 409, Exception::TEAM_INVITE_ALREADY_EXISTS); } $team->setAttribute('total', $team->getAttribute('total', 0) + 1); $team = Authorization::skip(fn() => $dbForProject->updateDocument('teams', $team->getId(), $team)); diff --git a/app/views/console/users/team.phtml b/app/views/console/users/team.phtml index c7c3f84b8..1fbe5d622 100644 --- a/app/views/console/users/team.phtml +++ b/app/views/console/users/team.phtml @@ -137,12 +137,12 @@ data-analytics-label="Create Team Membership" data-service="teams.createMembership" data-event="submit" - data-loading="Sending invitation, please wait..." + data-loading="Adding user, please wait..." data-success="alert,trigger,reset" - data-success-param-alert-text="Invitation sent successfully" + data-success-param-alert-text="User added successfully" data-success-param-trigger-events="teams.createMembership" data-failure="alert" - data-failure-param-alert-text="Failed to send invite" + data-failure-param-alert-text="Failed to add user" data-failure-param-alert-classname="error"> From cc57a9f3474bff3cf3cdc3fd52d5a80fa4d45e9e Mon Sep 17 00:00:00 2001 From: Everly Precia Suresh <77877486+everly-gif@users.noreply.github.com> Date: Wed, 1 Jun 2022 19:15:35 +0530 Subject: [PATCH 18/44] introduce formatting + linting in CONTRIBUTING.MD --- CONTRIBUTING.md | 38 +++++++++++++++++++++++++++----------- 1 file changed, 27 insertions(+), 11 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ae04e7732..e1e0b868f 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -43,18 +43,34 @@ $ git checkout -b [name_of_your_new_branch] ``` 3. Work - commit - repeat ( be sure to be in your branch ) -4. Push changes to GitHub +4. Before you push your changes, make sure your code follows the `PSR12` coding standards , which is the standard Appwrite follows currently. + You can easily do this by running the formatter +``` +./vendor/bin/phpcbf --standard=PSR12 +``` +This will format the code according to the `PSR12` coding standard. + +Now, go a step further by running the linter by the following command to manually fix the issues the formatter wasn't able to fix +``` +./vendor/bin/phpcs --standard=PSR12 +``` +This will give you a list of errors for you to rectify , if there is an instance you need more information on the errors being displayed you can pass in additional command line arguments. More list of available arguments can be found [here](https://github.com/squizlabs/PHP_CodeSniffer/wiki/Usage). A very useful command line argument is `--report=diff`. This will give you the expected changes by the linter for easy fixing of formatting issues + +``` +./vendor/bin/phpcs --standard=PSR12 --report=diff +``` + +5. Push changes to GitHub ``` $ git push origin [name_of_your_new_branch] ``` - -5. Submit your changes for review -If you go to your repository on GitHub, you'll see a `Compare & pull request` button. Click on that button. -6. Start a Pull Request -Now submit the pull request and click on `Create pull request`. -7. Get a code review approval/reject -8. After approval, merge your PR -9. GitHub will automatically delete the branch after the merge is done. (they can still be restored). +6. Submit your changes for review +If you go to your repository on GitHub, you'll see a `Compare & pull request` button. Click on that button. +7. Start a Pull Request +Now submit the pull request and click on `Create pull request`. +8. Get a code review approval/reject +9. After approval, merge your PR +10. GitHub will automatically delete the branch after the merge is done. (they can still be restored). ## Setup From Source @@ -96,7 +112,7 @@ We love to create issues that are good for beginners and label them as `good fir ##### Tools and Libs - [Docker](https://www.docker.com/get-started) -- [PHP FIG](https://www.php-fig.org/) - [PSR-1](https://www.php-fig.org/psr/psr-1/) and [PSR-4](https://www.php-fig.org/psr/psr-4/) +- [PHP FIG](https://www.php-fig.org/) - [PSR-12](https://www.php-fig.org/psr/psr-12/) - [PHP Swoole](https://www.swoole.co.uk/) Learn more at our [Technology Stack](#technology-stack) section. @@ -224,7 +240,7 @@ Appwrite uses [PHP's Composer](https://getcomposer.org/) for managing dependenci ## Coding Standards -Appwrite is following the [PHP-FIG standards](https://www.php-fig.org/). Currently, we are using both PSR-0 and PSR-4 for coding standards and autoloading standards. Soon we will also review the project for support with PSR-12 (Extended Coding Style). +Appwrite is following the [PHP-FIG standards](https://www.php-fig.org/). Currently, we are using _PSR-12_ for coding standards and autoloading standards. We use prettier for our JS coding standards and auto-formatting our code. From 52b7bb50d023b0fc469b7632741082c1f9f83f3d Mon Sep 17 00:00:00 2001 From: Everly Precia Suresh <77877486+everly-gif@users.noreply.github.com> Date: Wed, 1 Jun 2022 19:21:17 +0530 Subject: [PATCH 19/44] Update CONTRIBUTING.md --- CONTRIBUTING.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e1e0b868f..d41ead904 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -45,18 +45,18 @@ $ git checkout -b [name_of_your_new_branch] 4. Before you push your changes, make sure your code follows the `PSR12` coding standards , which is the standard Appwrite follows currently. You can easily do this by running the formatter -``` +```php ./vendor/bin/phpcbf --standard=PSR12 ``` This will format the code according to the `PSR12` coding standard. Now, go a step further by running the linter by the following command to manually fix the issues the formatter wasn't able to fix -``` +```php ./vendor/bin/phpcs --standard=PSR12 ``` This will give you a list of errors for you to rectify , if there is an instance you need more information on the errors being displayed you can pass in additional command line arguments. More list of available arguments can be found [here](https://github.com/squizlabs/PHP_CodeSniffer/wiki/Usage). A very useful command line argument is `--report=diff`. This will give you the expected changes by the linter for easy fixing of formatting issues -``` +```php ./vendor/bin/phpcs --standard=PSR12 --report=diff ``` @@ -66,7 +66,7 @@ $ git push origin [name_of_your_new_branch] ``` 6. Submit your changes for review If you go to your repository on GitHub, you'll see a `Compare & pull request` button. Click on that button. -7. Start a Pull Request +7. Start a Pull Request Now submit the pull request and click on `Create pull request`. 8. Get a code review approval/reject 9. After approval, merge your PR From d352c8a8d596daafa659c086c45532c572925116 Mon Sep 17 00:00:00 2001 From: Everly Precia Suresh <77877486+everly-gif@users.noreply.github.com> Date: Wed, 1 Jun 2022 19:31:35 +0530 Subject: [PATCH 20/44] Update CONTRIBUTING.md --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d41ead904..44546bcce 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -66,7 +66,7 @@ $ git push origin [name_of_your_new_branch] ``` 6. Submit your changes for review If you go to your repository on GitHub, you'll see a `Compare & pull request` button. Click on that button. -7. Start a Pull Request +7. Start a Pull Request Now submit the pull request and click on `Create pull request`. 8. Get a code review approval/reject 9. After approval, merge your PR From 958c8910391d9119202767df77e418ce92ff1658 Mon Sep 17 00:00:00 2001 From: Everly Precia Suresh <77877486+everly-gif@users.noreply.github.com> Date: Wed, 1 Jun 2022 19:40:08 +0530 Subject: [PATCH 21/44] update code maintenance section --- CONTRIBUTING.md | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 44546bcce..5a16daa35 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -45,18 +45,18 @@ $ git checkout -b [name_of_your_new_branch] 4. Before you push your changes, make sure your code follows the `PSR12` coding standards , which is the standard Appwrite follows currently. You can easily do this by running the formatter -```php +```bash ./vendor/bin/phpcbf --standard=PSR12 ``` This will format the code according to the `PSR12` coding standard. Now, go a step further by running the linter by the following command to manually fix the issues the formatter wasn't able to fix -```php +```bash ./vendor/bin/phpcs --standard=PSR12 ``` This will give you a list of errors for you to rectify , if there is an instance you need more information on the errors being displayed you can pass in additional command line arguments. More list of available arguments can be found [here](https://github.com/squizlabs/PHP_CodeSniffer/wiki/Usage). A very useful command line argument is `--report=diff`. This will give you the expected changes by the linter for easy fixing of formatting issues -```php +```bash ./vendor/bin/phpcs --standard=PSR12 --report=diff ``` @@ -395,20 +395,14 @@ docker run --rm skandyla/wrk -t3 -c100 -d30 https://[APPWRITE_HOSTNAME_OR_IP] We use some automation tools to help us keep a healthy codebase. -Improve PHP execution time by using [fully-qualified function calls](https://veewee.github.io/blog/optimizing-php-performance-by-fq-function-calls/): - -```bash -php-cs-fixer fix src/ --rules=native_function_invocation --allow-risky=yes -``` - Coding Standards: ```bash -php-cs-fixer fix app/controllers --rules='{"braces": {"allow_single_line_closure": true}}' +./vendor/bin/phpcbf --standard=PSR12 ``` ```bash -php-cs-fixer fix src --rules='{"braces": {"allow_single_line_closure": true}}' +./vendor/bin/phpcs --standard=PSR12 ``` Static Code Analysis: From 426e7cb77b0f21c2350f13f902f92038072380ed Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Wed, 1 Jun 2022 16:39:12 +0200 Subject: [PATCH 22/44] feat: remove unused psalm --- CONTRIBUTING.md | 6 - composer.json | 3 +- composer.lock | 1281 +------------------------------------------- docker-compose.yml | 1 - psalm.xml | 15 - 5 files changed, 8 insertions(+), 1298 deletions(-) delete mode 100644 psalm.xml diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 5a16daa35..1a5ceb891 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -405,12 +405,6 @@ Coding Standards: ./vendor/bin/phpcs --standard=PSR12 ``` -Static Code Analysis: - -```bash -docker-compose exec appwrite /usr/src/code/vendor/bin/psalm -``` - ## Tutorials From time to time, our team will add tutorials that will help contributors find their way in the Appwrite source code. Below is a list of currently available tutorials: diff --git a/composer.json b/composer.json index 0c2919129..6ce1bd218 100644 --- a/composer.json +++ b/composer.json @@ -75,8 +75,7 @@ "appwrite/sdk-generator": "0.18.8", "phpunit/phpunit": "9.5.20", "swoole/ide-helper": "4.8.9", - "textalk/websocket": "1.5.7", - "vimeo/psalm": "4.13.1" + "textalk/websocket": "1.5.7" }, "provide": { "ext-phpiredis": "*" diff --git a/composer.lock b/composer.lock index 685b4948b..df0981a8c 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "33d139681a16da8436756e9b5a27f745", + "content-hash": "9450d0e08c0f21141af8d99232d37df9", "packages": [ { "name": "adhocore/jwt", @@ -2963,172 +2963,6 @@ } ], "packages-dev": [ - { - "name": "amphp/amp", - "version": "v2.6.2", - "source": { - "type": "git", - "url": "https://github.com/amphp/amp.git", - "reference": "9d5100cebffa729aaffecd3ad25dc5aeea4f13bb" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/amphp/amp/zipball/9d5100cebffa729aaffecd3ad25dc5aeea4f13bb", - "reference": "9d5100cebffa729aaffecd3ad25dc5aeea4f13bb", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "require-dev": { - "amphp/php-cs-fixer-config": "dev-master", - "amphp/phpunit-util": "^1", - "ext-json": "*", - "jetbrains/phpstorm-stubs": "^2019.3", - "phpunit/phpunit": "^7 | ^8 | ^9", - "psalm/phar": "^3.11@dev", - "react/promise": "^2" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.x-dev" - } - }, - "autoload": { - "files": [ - "lib/functions.php", - "lib/Internal/functions.php" - ], - "psr-4": { - "Amp\\": "lib" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Daniel Lowrey", - "email": "rdlowrey@php.net" - }, - { - "name": "Aaron Piotrowski", - "email": "aaron@trowski.com" - }, - { - "name": "Bob Weinand", - "email": "bobwei9@hotmail.com" - }, - { - "name": "Niklas Keller", - "email": "me@kelunik.com" - } - ], - "description": "A non-blocking concurrency framework for PHP applications.", - "homepage": "https://amphp.org/amp", - "keywords": [ - "async", - "asynchronous", - "awaitable", - "concurrency", - "event", - "event-loop", - "future", - "non-blocking", - "promise" - ], - "support": { - "irc": "irc://irc.freenode.org/amphp", - "issues": "https://github.com/amphp/amp/issues", - "source": "https://github.com/amphp/amp/tree/v2.6.2" - }, - "funding": [ - { - "url": "https://github.com/amphp", - "type": "github" - } - ], - "time": "2022-02-20T17:52:18+00:00" - }, - { - "name": "amphp/byte-stream", - "version": "v1.8.1", - "source": { - "type": "git", - "url": "https://github.com/amphp/byte-stream.git", - "reference": "acbd8002b3536485c997c4e019206b3f10ca15bd" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/amphp/byte-stream/zipball/acbd8002b3536485c997c4e019206b3f10ca15bd", - "reference": "acbd8002b3536485c997c4e019206b3f10ca15bd", - "shasum": "" - }, - "require": { - "amphp/amp": "^2", - "php": ">=7.1" - }, - "require-dev": { - "amphp/php-cs-fixer-config": "dev-master", - "amphp/phpunit-util": "^1.4", - "friendsofphp/php-cs-fixer": "^2.3", - "jetbrains/phpstorm-stubs": "^2019.3", - "phpunit/phpunit": "^6 || ^7 || ^8", - "psalm/phar": "^3.11.4" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - } - }, - "autoload": { - "files": [ - "lib/functions.php" - ], - "psr-4": { - "Amp\\ByteStream\\": "lib" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Aaron Piotrowski", - "email": "aaron@trowski.com" - }, - { - "name": "Niklas Keller", - "email": "me@kelunik.com" - } - ], - "description": "A stream abstraction to make working with non-blocking I/O simple.", - "homepage": "http://amphp.org/byte-stream", - "keywords": [ - "amp", - "amphp", - "async", - "io", - "non-blocking", - "stream" - ], - "support": { - "irc": "irc://irc.freenode.org/amphp", - "issues": "https://github.com/amphp/byte-stream/issues", - "source": "https://github.com/amphp/byte-stream/tree/v1.8.1" - }, - "funding": [ - { - "url": "https://github.com/amphp", - "type": "github" - } - ], - "time": "2021-03-30T17:13:30+00:00" - }, { "name": "appwrite/sdk-generator", "version": "0.18.8", @@ -3179,261 +3013,6 @@ }, "time": "2022-05-19T10:34:06+00:00" }, - { - "name": "composer/pcre", - "version": "1.0.1", - "source": { - "type": "git", - "url": "https://github.com/composer/pcre.git", - "reference": "67a32d7d6f9f560b726ab25a061b38ff3a80c560" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/composer/pcre/zipball/67a32d7d6f9f560b726ab25a061b38ff3a80c560", - "reference": "67a32d7d6f9f560b726ab25a061b38ff3a80c560", - "shasum": "" - }, - "require": { - "php": "^5.3.2 || ^7.0 || ^8.0" - }, - "require-dev": { - "phpstan/phpstan": "^1.3", - "phpstan/phpstan-strict-rules": "^1.1", - "symfony/phpunit-bridge": "^4.2 || ^5" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "Composer\\Pcre\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "http://seld.be" - } - ], - "description": "PCRE wrapping library that offers type-safe preg_* replacements.", - "keywords": [ - "PCRE", - "preg", - "regex", - "regular expression" - ], - "support": { - "issues": "https://github.com/composer/pcre/issues", - "source": "https://github.com/composer/pcre/tree/1.0.1" - }, - "funding": [ - { - "url": "https://packagist.com", - "type": "custom" - }, - { - "url": "https://github.com/composer", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/composer/composer", - "type": "tidelift" - } - ], - "time": "2022-01-21T20:24:37+00:00" - }, - { - "name": "composer/semver", - "version": "3.3.2", - "source": { - "type": "git", - "url": "https://github.com/composer/semver.git", - "reference": "3953f23262f2bff1919fc82183ad9acb13ff62c9" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/composer/semver/zipball/3953f23262f2bff1919fc82183ad9acb13ff62c9", - "reference": "3953f23262f2bff1919fc82183ad9acb13ff62c9", - "shasum": "" - }, - "require": { - "php": "^5.3.2 || ^7.0 || ^8.0" - }, - "require-dev": { - "phpstan/phpstan": "^1.4", - "symfony/phpunit-bridge": "^4.2 || ^5" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "3.x-dev" - } - }, - "autoload": { - "psr-4": { - "Composer\\Semver\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nils Adermann", - "email": "naderman@naderman.de", - "homepage": "http://www.naderman.de" - }, - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "http://seld.be" - }, - { - "name": "Rob Bast", - "email": "rob.bast@gmail.com", - "homepage": "http://robbast.nl" - } - ], - "description": "Semver library that offers utilities, version constraint parsing and validation.", - "keywords": [ - "semantic", - "semver", - "validation", - "versioning" - ], - "support": { - "irc": "irc://irc.freenode.org/composer", - "issues": "https://github.com/composer/semver/issues", - "source": "https://github.com/composer/semver/tree/3.3.2" - }, - "funding": [ - { - "url": "https://packagist.com", - "type": "custom" - }, - { - "url": "https://github.com/composer", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/composer/composer", - "type": "tidelift" - } - ], - "time": "2022-04-01T19:23:25+00:00" - }, - { - "name": "composer/xdebug-handler", - "version": "2.0.5", - "source": { - "type": "git", - "url": "https://github.com/composer/xdebug-handler.git", - "reference": "9e36aeed4616366d2b690bdce11f71e9178c579a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/9e36aeed4616366d2b690bdce11f71e9178c579a", - "reference": "9e36aeed4616366d2b690bdce11f71e9178c579a", - "shasum": "" - }, - "require": { - "composer/pcre": "^1", - "php": "^5.3.2 || ^7.0 || ^8.0", - "psr/log": "^1 || ^2 || ^3" - }, - "require-dev": { - "phpstan/phpstan": "^1.0", - "phpstan/phpstan-strict-rules": "^1.1", - "symfony/phpunit-bridge": "^4.2 || ^5.0 || ^6.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "Composer\\XdebugHandler\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "John Stevenson", - "email": "john-stevenson@blueyonder.co.uk" - } - ], - "description": "Restarts a process without Xdebug.", - "keywords": [ - "Xdebug", - "performance" - ], - "support": { - "irc": "irc://irc.freenode.org/composer", - "issues": "https://github.com/composer/xdebug-handler/issues", - "source": "https://github.com/composer/xdebug-handler/tree/2.0.5" - }, - "funding": [ - { - "url": "https://packagist.com", - "type": "custom" - }, - { - "url": "https://github.com/composer", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/composer/composer", - "type": "tidelift" - } - ], - "time": "2022-02-24T20:20:32+00:00" - }, - { - "name": "dnoegel/php-xdg-base-dir", - "version": "v0.1.1", - "source": { - "type": "git", - "url": "https://github.com/dnoegel/php-xdg-base-dir.git", - "reference": "8f8a6e48c5ecb0f991c2fdcf5f154a47d85f9ffd" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/dnoegel/php-xdg-base-dir/zipball/8f8a6e48c5ecb0f991c2fdcf5f154a47d85f9ffd", - "reference": "8f8a6e48c5ecb0f991c2fdcf5f154a47d85f9ffd", - "shasum": "" - }, - "require": { - "php": ">=5.3.2" - }, - "require-dev": { - "phpunit/phpunit": "~7.0|~6.0|~5.0|~4.8.35" - }, - "type": "library", - "autoload": { - "psr-4": { - "XdgBaseDir\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "implementation of xdg base directory specification for php", - "support": { - "issues": "https://github.com/dnoegel/php-xdg-base-dir/issues", - "source": "https://github.com/dnoegel/php-xdg-base-dir/tree/v0.1.1" - }, - "time": "2019-12-04T15:06:13+00:00" - }, { "name": "doctrine/instantiator", "version": "1.4.1", @@ -3504,107 +3083,6 @@ ], "time": "2022-03-03T08:28:38+00:00" }, - { - "name": "felixfbecker/advanced-json-rpc", - "version": "v3.2.1", - "source": { - "type": "git", - "url": "https://github.com/felixfbecker/php-advanced-json-rpc.git", - "reference": "b5f37dbff9a8ad360ca341f3240dc1c168b45447" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/felixfbecker/php-advanced-json-rpc/zipball/b5f37dbff9a8ad360ca341f3240dc1c168b45447", - "reference": "b5f37dbff9a8ad360ca341f3240dc1c168b45447", - "shasum": "" - }, - "require": { - "netresearch/jsonmapper": "^1.0 || ^2.0 || ^3.0 || ^4.0", - "php": "^7.1 || ^8.0", - "phpdocumentor/reflection-docblock": "^4.3.4 || ^5.0.0" - }, - "require-dev": { - "phpunit/phpunit": "^7.0 || ^8.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "AdvancedJsonRpc\\": "lib/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "ISC" - ], - "authors": [ - { - "name": "Felix Becker", - "email": "felix.b@outlook.com" - } - ], - "description": "A more advanced JSONRPC implementation", - "support": { - "issues": "https://github.com/felixfbecker/php-advanced-json-rpc/issues", - "source": "https://github.com/felixfbecker/php-advanced-json-rpc/tree/v3.2.1" - }, - "time": "2021-06-11T22:34:44+00:00" - }, - { - "name": "felixfbecker/language-server-protocol", - "version": "v1.5.2", - "source": { - "type": "git", - "url": "https://github.com/felixfbecker/php-language-server-protocol.git", - "reference": "6e82196ffd7c62f7794d778ca52b69feec9f2842" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/felixfbecker/php-language-server-protocol/zipball/6e82196ffd7c62f7794d778ca52b69feec9f2842", - "reference": "6e82196ffd7c62f7794d778ca52b69feec9f2842", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "require-dev": { - "phpstan/phpstan": "*", - "squizlabs/php_codesniffer": "^3.1", - "vimeo/psalm": "^4.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "LanguageServerProtocol\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "ISC" - ], - "authors": [ - { - "name": "Felix Becker", - "email": "felix.b@outlook.com" - } - ], - "description": "PHP classes for the Language Server Protocol", - "keywords": [ - "language", - "microsoft", - "php", - "server" - ], - "support": { - "issues": "https://github.com/felixfbecker/php-language-server-protocol/issues", - "source": "https://github.com/felixfbecker/php-language-server-protocol/tree/v1.5.2" - }, - "time": "2022-03-02T22:36:06+00:00" - }, { "name": "matthiasmullie/minify", "version": "1.3.68", @@ -3787,69 +3265,18 @@ ], "time": "2022-03-03T13:19:32+00:00" }, - { - "name": "netresearch/jsonmapper", - "version": "v4.0.0", - "source": { - "type": "git", - "url": "https://github.com/cweiske/jsonmapper.git", - "reference": "8bbc021a8edb2e4a7ea2f8ad4fa9ec9dce2fcb8d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/cweiske/jsonmapper/zipball/8bbc021a8edb2e4a7ea2f8ad4fa9ec9dce2fcb8d", - "reference": "8bbc021a8edb2e4a7ea2f8ad4fa9ec9dce2fcb8d", - "shasum": "" - }, - "require": { - "ext-json": "*", - "ext-pcre": "*", - "ext-reflection": "*", - "ext-spl": "*", - "php": ">=7.1" - }, - "require-dev": { - "phpunit/phpunit": "~7.5 || ~8.0 || ~9.0", - "squizlabs/php_codesniffer": "~3.5" - }, - "type": "library", - "autoload": { - "psr-0": { - "JsonMapper": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "OSL-3.0" - ], - "authors": [ - { - "name": "Christian Weiske", - "email": "cweiske@cweiske.de", - "homepage": "http://github.com/cweiske/jsonmapper/", - "role": "Developer" - } - ], - "description": "Map nested JSON structures onto PHP classes", - "support": { - "email": "cweiske@cweiske.de", - "issues": "https://github.com/cweiske/jsonmapper/issues", - "source": "https://github.com/cweiske/jsonmapper/tree/v4.0.0" - }, - "time": "2020-12-01T19:48:11+00:00" - }, { "name": "nikic/php-parser", - "version": "v4.13.2", + "version": "v4.14.0", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "210577fe3cf7badcc5814d99455df46564f3c077" + "reference": "34bea19b6e03d8153165d8f30bba4c3be86184c1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/210577fe3cf7badcc5814d99455df46564f3c077", - "reference": "210577fe3cf7badcc5814d99455df46564f3c077", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/34bea19b6e03d8153165d8f30bba4c3be86184c1", + "reference": "34bea19b6e03d8153165d8f30bba4c3be86184c1", "shasum": "" }, "require": { @@ -3890,62 +3317,9 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v4.13.2" + "source": "https://github.com/nikic/PHP-Parser/tree/v4.14.0" }, - "time": "2021-11-30T19:35:32+00:00" - }, - { - "name": "openlss/lib-array2xml", - "version": "1.0.0", - "source": { - "type": "git", - "url": "https://github.com/nullivex/lib-array2xml.git", - "reference": "a91f18a8dfc69ffabe5f9b068bc39bb202c81d90" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nullivex/lib-array2xml/zipball/a91f18a8dfc69ffabe5f9b068bc39bb202c81d90", - "reference": "a91f18a8dfc69ffabe5f9b068bc39bb202c81d90", - "shasum": "" - }, - "require": { - "php": ">=5.3.2" - }, - "type": "library", - "autoload": { - "psr-0": { - "LSS": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "Apache-2.0" - ], - "authors": [ - { - "name": "Bryan Tong", - "email": "bryan@nullivex.com", - "homepage": "https://www.nullivex.com" - }, - { - "name": "Tony Butler", - "email": "spudz76@gmail.com", - "homepage": "https://www.nullivex.com" - } - ], - "description": "Array2XML conversion library credit to lalit.org", - "homepage": "https://www.nullivex.com", - "keywords": [ - "array", - "array conversion", - "xml", - "xml conversion" - ], - "support": { - "issues": "https://github.com/nullivex/lib-array2xml/issues", - "source": "https://github.com/nullivex/lib-array2xml/tree/master" - }, - "time": "2019-03-29T20:06:56+00:00" + "time": "2022-05-31T20:59:12+00:00" }, { "name": "phar-io/manifest", @@ -4706,59 +4080,6 @@ ], "time": "2022-04-01T12:37:26+00:00" }, - { - "name": "psr/container", - "version": "2.0.2", - "source": { - "type": "git", - "url": "https://github.com/php-fig/container.git", - "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/container/zipball/c71ecc56dfe541dbd90c5360474fbc405f8d5963", - "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963", - "shasum": "" - }, - "require": { - "php": ">=7.4.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Container\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" - } - ], - "description": "Common Container Interface (PHP FIG PSR-11)", - "homepage": "https://github.com/php-fig/container", - "keywords": [ - "PSR-11", - "container", - "container-interface", - "container-interop", - "psr" - ], - "support": { - "issues": "https://github.com/php-fig/container/issues", - "source": "https://github.com/php-fig/container/tree/2.0.2" - }, - "time": "2021-11-05T16:47:00+00:00" - }, { "name": "sebastian/cli-parser", "version": "1.0.1", @@ -5765,267 +5086,6 @@ ], "time": "2022-04-18T20:38:04+00:00" }, - { - "name": "symfony/console", - "version": "v6.1.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/console.git", - "reference": "c9646197ef43b0e2ff44af61e7f0571526fd4170" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/c9646197ef43b0e2ff44af61e7f0571526fd4170", - "reference": "c9646197ef43b0e2ff44af61e7f0571526fd4170", - "shasum": "" - }, - "require": { - "php": ">=8.1", - "symfony/deprecation-contracts": "^2.1|^3", - "symfony/polyfill-mbstring": "~1.0", - "symfony/service-contracts": "^1.1|^2|^3", - "symfony/string": "^5.4|^6.0" - }, - "conflict": { - "symfony/dependency-injection": "<5.4", - "symfony/dotenv": "<5.4", - "symfony/event-dispatcher": "<5.4", - "symfony/lock": "<5.4", - "symfony/process": "<5.4" - }, - "provide": { - "psr/log-implementation": "1.0|2.0|3.0" - }, - "require-dev": { - "psr/log": "^1|^2|^3", - "symfony/config": "^5.4|^6.0", - "symfony/dependency-injection": "^5.4|^6.0", - "symfony/event-dispatcher": "^5.4|^6.0", - "symfony/lock": "^5.4|^6.0", - "symfony/process": "^5.4|^6.0", - "symfony/var-dumper": "^5.4|^6.0" - }, - "suggest": { - "psr/log": "For using the console logger", - "symfony/event-dispatcher": "", - "symfony/lock": "", - "symfony/process": "" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\Console\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Eases the creation of beautiful and testable command line interfaces", - "homepage": "https://symfony.com", - "keywords": [ - "cli", - "command line", - "console", - "terminal" - ], - "support": { - "source": "https://github.com/symfony/console/tree/v6.1.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2022-05-27T06:34:22+00:00" - }, - { - "name": "symfony/polyfill-intl-grapheme", - "version": "v1.25.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-intl-grapheme.git", - "reference": "81b86b50cf841a64252b439e738e97f4a34e2783" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/81b86b50cf841a64252b439e738e97f4a34e2783", - "reference": "81b86b50cf841a64252b439e738e97f4a34e2783", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "suggest": { - "ext-intl": "For best performance" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.23-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Intl\\Grapheme\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for intl's grapheme_* functions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "grapheme", - "intl", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.25.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2021-11-23T21:10:46+00:00" - }, - { - "name": "symfony/polyfill-intl-normalizer", - "version": "v1.25.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-intl-normalizer.git", - "reference": "8590a5f561694770bdcd3f9b5c69dde6945028e8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/8590a5f561694770bdcd3f9b5c69dde6945028e8", - "reference": "8590a5f561694770bdcd3f9b5c69dde6945028e8", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "suggest": { - "ext-intl": "For best performance" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.23-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Intl\\Normalizer\\": "" - }, - "classmap": [ - "Resources/stubs" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for intl's Normalizer class and related functions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "intl", - "normalizer", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.25.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2021-02-19T12:13:01+00:00" - }, { "name": "symfony/polyfill-mbstring", "version": "v1.25.0", @@ -6109,176 +5169,6 @@ ], "time": "2021-11-30T18:21:41+00:00" }, - { - "name": "symfony/service-contracts", - "version": "v3.1.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/service-contracts.git", - "reference": "d66cd8ab656780f62c4215b903a420eb86358957" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/d66cd8ab656780f62c4215b903a420eb86358957", - "reference": "d66cd8ab656780f62c4215b903a420eb86358957", - "shasum": "" - }, - "require": { - "php": ">=8.1", - "psr/container": "^2.0" - }, - "conflict": { - "ext-psr": "<1.1|>=2" - }, - "suggest": { - "symfony/service-implementation": "" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "3.1-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Contracts\\Service\\": "" - }, - "exclude-from-classmap": [ - "/Test/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Generic abstractions related to writing services", - "homepage": "https://symfony.com", - "keywords": [ - "abstractions", - "contracts", - "decoupling", - "interfaces", - "interoperability", - "standards" - ], - "support": { - "source": "https://github.com/symfony/service-contracts/tree/v3.1.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2022-05-07T08:07:09+00:00" - }, - { - "name": "symfony/string", - "version": "v6.1.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/string.git", - "reference": "d3edc75baf9f1d4f94879764dda2e1ac33499529" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/d3edc75baf9f1d4f94879764dda2e1ac33499529", - "reference": "d3edc75baf9f1d4f94879764dda2e1ac33499529", - "shasum": "" - }, - "require": { - "php": ">=8.1", - "symfony/polyfill-ctype": "~1.8", - "symfony/polyfill-intl-grapheme": "~1.0", - "symfony/polyfill-intl-normalizer": "~1.0", - "symfony/polyfill-mbstring": "~1.0" - }, - "conflict": { - "symfony/translation-contracts": "<2.0" - }, - "require-dev": { - "symfony/error-handler": "^5.4|^6.0", - "symfony/http-client": "^5.4|^6.0", - "symfony/translation-contracts": "^2.0|^3.0", - "symfony/var-exporter": "^5.4|^6.0" - }, - "type": "library", - "autoload": { - "files": [ - "Resources/functions.php" - ], - "psr-4": { - "Symfony\\Component\\String\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Provides an object-oriented API to strings and deals with bytes, UTF-8 code points and grapheme clusters in a unified way", - "homepage": "https://symfony.com", - "keywords": [ - "grapheme", - "i18n", - "string", - "unicode", - "utf-8", - "utf8" - ], - "support": { - "source": "https://github.com/symfony/string/tree/v6.1.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2022-04-22T08:18:23+00:00" - }, { "name": "textalk/websocket", "version": "1.5.7", @@ -6453,163 +5343,6 @@ } ], "time": "2022-05-17T05:48:52+00:00" - }, - { - "name": "vimeo/psalm", - "version": "4.13.1", - "source": { - "type": "git", - "url": "https://github.com/vimeo/psalm.git", - "reference": "5cf660f63b548ccd4a56f62d916ee4d6028e01a3" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/vimeo/psalm/zipball/5cf660f63b548ccd4a56f62d916ee4d6028e01a3", - "reference": "5cf660f63b548ccd4a56f62d916ee4d6028e01a3", - "shasum": "" - }, - "require": { - "amphp/amp": "^2.4.2", - "amphp/byte-stream": "^1.5", - "composer/package-versions-deprecated": "^1.8.0", - "composer/semver": "^1.4 || ^2.0 || ^3.0", - "composer/xdebug-handler": "^1.1 || ^2.0", - "dnoegel/php-xdg-base-dir": "^0.1.1", - "ext-ctype": "*", - "ext-dom": "*", - "ext-json": "*", - "ext-libxml": "*", - "ext-mbstring": "*", - "ext-simplexml": "*", - "ext-tokenizer": "*", - "felixfbecker/advanced-json-rpc": "^3.0.3", - "felixfbecker/language-server-protocol": "^1.5", - "netresearch/jsonmapper": "^1.0 || ^2.0 || ^3.0 || ^4.0", - "nikic/php-parser": "^4.13", - "openlss/lib-array2xml": "^1.0", - "php": "^7.1|^8", - "sebastian/diff": "^3.0 || ^4.0", - "symfony/console": "^3.4.17 || ^4.1.6 || ^5.0 || ^6.0", - "webmozart/path-util": "^2.3" - }, - "provide": { - "psalm/psalm": "self.version" - }, - "require-dev": { - "bamarni/composer-bin-plugin": "^1.2", - "brianium/paratest": "^4.0||^6.0", - "ext-curl": "*", - "php-parallel-lint/php-parallel-lint": "^1.2", - "phpdocumentor/reflection-docblock": "^5", - "phpmyadmin/sql-parser": "5.1.0||dev-master", - "phpspec/prophecy": ">=1.9.0", - "phpunit/phpunit": "^9.0", - "psalm/plugin-phpunit": "^0.16", - "slevomat/coding-standard": "^7.0", - "squizlabs/php_codesniffer": "^3.5", - "symfony/process": "^4.3 || ^5.0 || ^6.0", - "weirdan/prophecy-shim": "^1.0 || ^2.0" - }, - "suggest": { - "ext-curl": "In order to send data to shepherd", - "ext-igbinary": "^2.0.5 is required, used to serialize caching data" - }, - "bin": [ - "psalm", - "psalm-language-server", - "psalm-plugin", - "psalm-refactor", - "psalter" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.x-dev", - "dev-3.x": "3.x-dev", - "dev-2.x": "2.x-dev", - "dev-1.x": "1.x-dev" - } - }, - "autoload": { - "files": [ - "src/functions.php", - "src/spl_object_id.php" - ], - "psr-4": { - "Psalm\\": "src/Psalm/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Matthew Brown" - } - ], - "description": "A static analysis tool for finding errors in PHP applications", - "keywords": [ - "code", - "inspection", - "php" - ], - "support": { - "issues": "https://github.com/vimeo/psalm/issues", - "source": "https://github.com/vimeo/psalm/tree/4.13.1" - }, - "time": "2021-11-23T23:52:49+00:00" - }, - { - "name": "webmozart/path-util", - "version": "2.3.0", - "source": { - "type": "git", - "url": "https://github.com/webmozart/path-util.git", - "reference": "d939f7edc24c9a1bb9c0dee5cb05d8e859490725" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/webmozart/path-util/zipball/d939f7edc24c9a1bb9c0dee5cb05d8e859490725", - "reference": "d939f7edc24c9a1bb9c0dee5cb05d8e859490725", - "shasum": "" - }, - "require": { - "php": ">=5.3.3", - "webmozart/assert": "~1.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.6", - "sebastian/version": "^1.0.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.3-dev" - } - }, - "autoload": { - "psr-4": { - "Webmozart\\PathUtil\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Bernhard Schussek", - "email": "bschussek@gmail.com" - } - ], - "description": "A robust cross-platform utility for normalizing, comparing and modifying file paths.", - "support": { - "issues": "https://github.com/webmozart/path-util/issues", - "source": "https://github.com/webmozart/path-util/tree/2.3.0" - }, - "abandoned": "symfony/filesystem", - "time": "2015-12-17T08:42:14+00:00" } ], "aliases": [], diff --git a/docker-compose.yml b/docker-compose.yml index fd34920d6..b6e1ed68b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -101,7 +101,6 @@ services: - appwrite-certificates:/storage/certificates:rw - appwrite-functions:/storage/functions:rw - ./phpunit.xml:/usr/src/code/phpunit.xml - - ./psalm.xml:/usr/src/code/psalm.xml - ./tests:/usr/src/code/tests - ./app:/usr/src/code/app # - ./vendor:/usr/src/code/vendor diff --git a/psalm.xml b/psalm.xml deleted file mode 100644 index 30258a709..000000000 --- a/psalm.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - From c451c9a2687268663eb97d93d1614178d8e914bf Mon Sep 17 00:00:00 2001 From: Everly Precia Suresh <77877486+everly-gif@users.noreply.github.com> Date: Wed, 1 Jun 2022 20:52:35 +0530 Subject: [PATCH 23/44] Update CONTRIBUTING.md --- CONTRIBUTING.md | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1a5ceb891..aa7152a64 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -44,20 +44,20 @@ $ git checkout -b [name_of_your_new_branch] 3. Work - commit - repeat ( be sure to be in your branch ) 4. Before you push your changes, make sure your code follows the `PSR12` coding standards , which is the standard Appwrite follows currently. - You can easily do this by running the formatter + You can easily do this by running the formatter. ```bash -./vendor/bin/phpcbf --standard=PSR12 +./vendor/bin/phpcbf ``` This will format the code according to the `PSR12` coding standard. -Now, go a step further by running the linter by the following command to manually fix the issues the formatter wasn't able to fix +Now, go a step further by running the linter by the following command to manually fix the issues the formatter wasn't able to fix. ```bash -./vendor/bin/phpcs --standard=PSR12 +./vendor/bin/phpcs ``` -This will give you a list of errors for you to rectify , if there is an instance you need more information on the errors being displayed you can pass in additional command line arguments. More list of available arguments can be found [here](https://github.com/squizlabs/PHP_CodeSniffer/wiki/Usage). A very useful command line argument is `--report=diff`. This will give you the expected changes by the linter for easy fixing of formatting issues +This will give you a list of errors for you to rectify , if there is an instance you need more information on the errors being displayed you can pass in additional command line arguments. More list of available arguments can be found [here](https://github.com/squizlabs/PHP_CodeSniffer/wiki/Usage). A very useful command line argument is `--report=diff`. This will give you the expected changes by the linter for easy fixing of formatting issues. ```bash -./vendor/bin/phpcs --standard=PSR12 --report=diff +./vendor/bin/phpcs --report=diff ``` 5. Push changes to GitHub @@ -240,7 +240,7 @@ Appwrite uses [PHP's Composer](https://getcomposer.org/) for managing dependenci ## Coding Standards -Appwrite is following the [PHP-FIG standards](https://www.php-fig.org/). Currently, we are using _PSR-12_ for coding standards and autoloading standards. +Appwrite is following the [PHP-FIG standards](https://www.php-fig.org/). Currently, we are using PSR-0 and PSR-12 for coding standards and autoloading standards. We use prettier for our JS coding standards and auto-formatting our code. @@ -397,10 +397,14 @@ We use some automation tools to help us keep a healthy codebase. Coding Standards: +`Run Formatter` : + ```bash ./vendor/bin/phpcbf --standard=PSR12 ``` +`Run Linter` : + ```bash ./vendor/bin/phpcs --standard=PSR12 ``` From b0f2e2a1fbfc1d3f7f30f68c0930df68233b7237 Mon Sep 17 00:00:00 2001 From: Everly Precia Suresh <77877486+everly-gif@users.noreply.github.com> Date: Wed, 1 Jun 2022 20:56:46 +0530 Subject: [PATCH 24/44] Update CONTRIBUTING.md --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index aa7152a64..7d8f11a53 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -240,7 +240,7 @@ Appwrite uses [PHP's Composer](https://getcomposer.org/) for managing dependenci ## Coding Standards -Appwrite is following the [PHP-FIG standards](https://www.php-fig.org/). Currently, we are using PSR-0 and PSR-12 for coding standards and autoloading standards. +Appwrite is following the [PHP-FIG standards](https://www.php-fig.org/). Currently, we are using both PSR-0 and PSR-12 for coding standards and autoloading standards. We use prettier for our JS coding standards and auto-formatting our code. From 55dbe184663f9899a01c1944ad8e96a20db78039 Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Wed, 1 Jun 2022 17:54:19 +0200 Subject: [PATCH 25/44] lint: add new rule --- phpcs.xml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/phpcs.xml b/phpcs.xml index 9c8ced28e..550678584 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -11,4 +11,8 @@ * + + + * + \ No newline at end of file From 94f63e67ef3bf86993d0d9affd02880c0281d1a9 Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Wed, 1 Jun 2022 17:57:00 +0200 Subject: [PATCH 26/44] style: format contributing guide --- CONTRIBUTING.md | 147 ++++++++++++++++++++++++++---------------------- 1 file changed, 80 insertions(+), 67 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7d8f11a53..e59e7e8a4 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -12,11 +12,12 @@ Help us keep Appwrite open and inclusive. Please read and follow our [Code of Co ## Submit a Pull Request 🚀 -Branch naming convention is as following +Branch naming convention is as following `TYPE-ISSUE_ID-DESCRIPTION` example: + ``` doc-548-submit-a-pull-request-section-to-contribution-guide ``` @@ -29,48 +30,55 @@ When `TYPE` can be: - **fix** - a bug fix - **refactor** - code change that neither fixes a bug nor adds a feature -**All PRs must include a commit message with the changes description!** +**All PRs must include a commit message with the changes description!** For the initial start, fork the project and use git clone command to download the repository to your computer. A standard procedure for working on an issue would be to: 1. `git pull`, before creating a new branch, pull the changes from upstream. Your master needs to be up to date. + ``` $ git pull ``` + 2. Create new branch from `master` like: `doc-548-submit-a-pull-request-section-to-contribution-guide`
+ ``` $ git checkout -b [name_of_your_new_branch] ``` + 3. Work - commit - repeat ( be sure to be in your branch ) -4. Before you push your changes, make sure your code follows the `PSR12` coding standards , which is the standard Appwrite follows currently. - You can easily do this by running the formatter. +4. Before you push your changes, make sure your code follows the `PSR12` coding standards , which is the standard Appwrite follows currently. You can easily do this by running the formatter. + ```bash ./vendor/bin/phpcbf ``` -This will format the code according to the `PSR12` coding standard. Now, go a step further by running the linter by the following command to manually fix the issues the formatter wasn't able to fix. + ```bash ./vendor/bin/phpcs ``` + This will give you a list of errors for you to rectify , if there is an instance you need more information on the errors being displayed you can pass in additional command line arguments. More list of available arguments can be found [here](https://github.com/squizlabs/PHP_CodeSniffer/wiki/Usage). A very useful command line argument is `--report=diff`. This will give you the expected changes by the linter for easy fixing of formatting issues. ```bash ./vendor/bin/phpcs --report=diff ``` -5. Push changes to GitHub +5. Push changes to GitHub + ``` $ git push origin [name_of_your_new_branch] ``` -6. Submit your changes for review -If you go to your repository on GitHub, you'll see a `Compare & pull request` button. Click on that button. -7. Start a Pull Request -Now submit the pull request and click on `Create pull request`. -8. Get a code review approval/reject -9. After approval, merge your PR -10. GitHub will automatically delete the branch after the merge is done. (they can still be restored). + +6. Submit your changes for review + If you go to your repository on GitHub, you'll see a `Compare & pull request` button. Click on that button. +7. Start a Pull Request + Now submit the pull request and click on `Create pull request`. +8. Get a code review approval/reject +9. After approval, merge your PR +10. GitHub will automatically delete the branch after the merge is done. (they can still be restored). ## Setup From Source @@ -106,11 +114,12 @@ Appwrite uses an internal micro-framework called Litespeed.js to build simple UI After finishing the installation process, you can start writing and editing code. - #### Advanced Topics + We love to create issues that are good for beginners and label them as `good first issue` or `hacktoberfest`, but some more advanced topics might require extra knowledge. Below is a list of links you can use to learn more about some of the more advance topics that will help you master the Appwrite codebase. ##### Tools and Libs + - [Docker](https://www.docker.com/get-started) - [PHP FIG](https://www.php-fig.org/) - [PSR-12](https://www.php-fig.org/psr/psr-12/) - [PHP Swoole](https://www.swoole.co.uk/) @@ -118,6 +127,7 @@ We love to create issues that are good for beginners and label them as `good fir Learn more at our [Technology Stack](#technology-stack) section. ##### Network and Protocols + - [OSI Model](https://en.wikipedia.org/wiki/OSI_model) - [TCP vs UDP](https://www.guru99.com/tcp-vs-udp-understanding-the-difference.html#:~:text=TCP%20is%20a%20connection%2Doriented,speed%20of%20UDP%20is%20faster&text=TCP%20does%20error%20checking%20and,but%20it%20discards%20erroneous%20packets.) - [HTTP](https://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol) @@ -126,10 +136,12 @@ Learn more at our [Technology Stack](#technology-stack) section. - [gRPC](https://en.wikipedia.org/wiki/GRPC) ##### Architecture + - [Microservices vs Monolithic](https://www.mulesoft.com/resources/api/microservices-vs-monolithic#:~:text=Microservices%20architecture%20vs%20monolithic%20architecture&text=A%20monolithic%20application%20is%20built%20as%20a%20single%20unit.&text=To%20make%20any%20alterations%20to,formally%20with%20business%2Doriented%20APIs.) - [MVVM](https://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93viewmodel) - Appwrite console architecture ##### Security + - [Appwrite Auth and ACL](https://github.com/appwrite/appwrite/blob/0.7.x/docs/specs/authentication.drawio.svg) - [OAuth](https://en.wikipedia.org/wiki/OAuth) - [Encryption](https://medium.com/searchencrypt/what-is-encryption-how-does-it-work-e8f20e340537#:~:text=Encryption%20is%20a%20process%20that,%2C%20or%20decrypt%2C%20the%20information.) @@ -140,8 +152,8 @@ Learn more at our [Technology Stack](#technology-stack) section. Appwrite's current structure is a combination of both [Monolithic](https://en.wikipedia.org/wiki/Monolithic_application) and [Microservice](https://en.wikipedia.org/wiki/Microservices) architectures, but our final goal, as we grow, is to be using only microservices. --- -![Appwrite](docs/specs/overview.drawio.svg) ---- + +## ![Appwrite](docs/specs/overview.drawio.svg) ### File Structure @@ -220,15 +232,15 @@ Appwrite stack is combined from a variety of open-source technologies and tools. ### Other Technologies -* Redis - for managing cache and in-memory data (currently, we do not use Redis for persistent data) -* MariaDB - for database storage and queries -* InfluxDB - for managing stats and time-series based data -* Statsd - for sending data over UDP protocol (using Telegraf) -* ClamAV - for validating and scanning storage files -* Imagemagick - for manipulating and managing image media files. -* Webp - for better compression of images on supporting clients -* SMTP - for sending email messages and alerts -* Resque - for managing data queues and scheduled tasks over a Redis server +- Redis - for managing cache and in-memory data (currently, we do not use Redis for persistent data) +- MariaDB - for database storage and queries +- InfluxDB - for managing stats and time-series based data +- Statsd - for sending data over UDP protocol (using Telegraf) +- ClamAV - for validating and scanning storage files +- Imagemagick - for manipulating and managing image media files. +- Webp - for better compression of images on supporting clients +- SMTP - for sending email messages and alerts +- Resque - for managing data queues and scheduled tasks over a Redis server ## Package Managers @@ -252,14 +264,14 @@ We wish Appwrite will be as easy to set up and in a single, localhost, and easy When contributing code, please take into account the following considerations: -* Response Time -* Throughput -* Requests per Seconds -* Network Usage -* Memory Usage -* Browser Rendering -* Background Jobs -* Task Execution Time +- Response Time +- Throughput +- Requests per Seconds +- Network Usage +- Memory Usage +- Browser Rendering +- Background Jobs +- Task Execution Time ## Security & Privacy @@ -296,6 +308,7 @@ Before running the command, make sure you have proper write permissions to the A ```bash docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v6,linux/arm/v7,linux/arm64/v8,linux/ppc64le,linux/s390x -t appwrite/appwrite:dev --push . ``` + **Build Functions Runtimes** The Runtimes for all supported cloud functions (multicore builds) can be found at the [open-runtimes/open-runtimes](https://github.com/open-runtimes/open-runtimes) repository. @@ -315,11 +328,11 @@ For generating a new console SDK follow the next steps: Things to remember when releasing SDKs -* Update the Changelogs in **docs/sdks** (right now only Dart and Flutter are using these) -* Update **GETTING_STARTED.md** in **docs/sdks** for each SDKs if any changes in the related APIs in there -* Update SDK versions as required on **app/config/platforms.php** -* Generate SDKs using the command `php app/cli.php sdks` and follow the instructions -* Release new tags on GitHub repository for each SDKs +- Update the Changelogs in **docs/sdks** (right now only Dart and Flutter are using these) +- Update **GETTING_STARTED.md** in **docs/sdks** for each SDKs if any changes in the related APIs in there +- Update SDK versions as required on **app/config/platforms.php** +- Generate SDKs using the command `php app/cli.php sdks` and follow the instructions +- Release new tags on GitHub repository for each SDKs ## Debug @@ -331,13 +344,13 @@ First, you need to create an init file. Duplicate **dev/yasd_init.php.stub** fil ```json { - "name": "Listen for Xdebug", - "type": "php", - "request": "launch", - "port": 9005, - "pathMappings": { - "/usr/src/code": "${workspaceRoot}" - }, + "name": "Listen for Xdebug", + "type": "php", + "request": "launch", + "port": 9005, + "pathMappings": { + "/usr/src/code": "${workspaceRoot}" + } } ``` @@ -370,57 +383,58 @@ To run end-2-end tests for a spcific service use: ```bash docker-compose exec appwrite test /usr/src/code/tests/e2e/Services/[ServiceName] ``` + ## Benchmarking You can use WRK Docker image to benchmark the server performance. Benchmarking is extremely useful when you want to compare how the server behaves before and after a change has been applied. Replace [APPWRITE_HOSTNAME_OR_IP] with your Appwrite server hostname or IP. Note that localhost is not accessible from inside the WRK container. ``` - Options: - -c, --connections Connections to keep open - -d, --duration Duration of test - -t, --threads Number of threads to use - - -s, --script Load Lua script file - -H, --header Add header to request - --latency Print latency statistics - --timeout Socket/request timeout - -v, --version Print version details -``` + Options: + -c, --connections Connections to keep open + -d, --duration Duration of test + -t, --threads Number of threads to use + + -s, --script Load Lua script file + -H, --header Add header to request + --latency Print latency statistics + --timeout Socket/request timeout + -v, --version Print version details +``` ```bash docker run --rm skandyla/wrk -t3 -c100 -d30 https://[APPWRITE_HOSTNAME_OR_IP] ``` -## Code Maintenance +## Code Maintenance We use some automation tools to help us keep a healthy codebase. Coding Standards: -`Run Formatter` : +**Run Formatter:** ```bash -./vendor/bin/phpcbf --standard=PSR12 +./vendor/bin/phpcbf ``` -`Run Linter` : +**Run Linter:** ```bash -./vendor/bin/phpcs --standard=PSR12 +./vendor/bin/phpcs ``` ## Tutorials From time to time, our team will add tutorials that will help contributors find their way in the Appwrite source code. Below is a list of currently available tutorials: -* [Adding Support for a New OAuth2 Provider](./docs/tutorials/add-oauth2-provider.md) -* [Appwrite Environment Variables](./docs/tutorials/environment-variables.md) -* [Running in Production](./docs/tutorials/running-in-production.md) -* [Adding Storage Adapter](./docs/tutorials/add-storage-adapter.md) +- [Adding Support for a New OAuth2 Provider](./docs/tutorials/add-oauth2-provider.md) +- [Appwrite Environment Variables](./docs/tutorials/environment-variables.md) +- [Running in Production](./docs/tutorials/running-in-production.md) +- [Adding Storage Adapter](./docs/tutorials/add-storage-adapter.md) ## Other Ways to Help -Pull requests are great, but there are many other areas where you can help Appwrite. +Pull requests are great, but there are many other areas where you can help Appwrite. ### Blogging & Speaking @@ -445,4 +459,3 @@ Submitting documentation updates, enhancements, designs, or bug fixes. Spelling ### Helping Someone Searching for Appwrite on Discord, GitHub, or StackOverflow and helping someone else who needs help. You can also help by teaching others how to contribute to Appwrite's repo! - From 5670ba0578f923c17544e501c405a60870a2d12e Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Wed, 1 Jun 2022 17:59:17 +0200 Subject: [PATCH 27/44] docs: update some phrases --- CONTRIBUTING.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e59e7e8a4..0e0cedeb9 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -409,17 +409,21 @@ docker run --rm skandyla/wrk -t3 -c100 -d30 https://[APPWRITE_HOSTNAME_OR_IP] We use some automation tools to help us keep a healthy codebase. -Coding Standards: - **Run Formatter:** ```bash +# Run on all files +./vendor/bin/phpcbf +# Run on single file or folder ./vendor/bin/phpcbf ``` **Run Linter:** ```bash +# Run on all files +./vendor/bin/phpcs +# Run on single file or folder ./vendor/bin/phpcs ``` From 24ed82c460fa546e3fdf048c96f33a4028366a20 Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Wed, 1 Jun 2022 17:59:55 +0200 Subject: [PATCH 28/44] docs: update phrase --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 0e0cedeb9..b8f13b353 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -422,7 +422,7 @@ We use some automation tools to help us keep a healthy codebase. ```bash # Run on all files -./vendor/bin/phpcs +./vendor/bin/phpcs # Run on single file or folder ./vendor/bin/phpcs ``` From 2255c789dff40d58286f1647434e6f445d7a4208 Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Wed, 1 Jun 2022 19:13:15 +0200 Subject: [PATCH 29/44] fix: subquery return for sessions --- app/init.php | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/app/init.php b/app/init.php index 7e03ed192..0e1848b2c 100644 --- a/app/init.php +++ b/app/init.php @@ -257,7 +257,7 @@ Database::addFilter( return $database ->find('attributes', [ new Query('collectionId', Query::TYPE_EQUAL, [$document->getId()]) - ], $database->getAttributeLimit(), 0, []); + ], $database->getAttributeLimit()); } ); @@ -270,7 +270,7 @@ Database::addFilter( return $database ->find('indexes', [ new Query('collectionId', Query::TYPE_EQUAL, [$document->getId()]) - ], 64, 0, []); + ], 64); } ); @@ -283,7 +283,7 @@ Database::addFilter( return $database ->find('platforms', [ new Query('projectId', Query::TYPE_EQUAL, [$document->getId()]) - ], APP_LIMIT_SUBQUERY, 0, []); + ], APP_LIMIT_SUBQUERY); } ); @@ -296,7 +296,7 @@ Database::addFilter( return $database ->find('domains', [ new Query('projectId', Query::TYPE_EQUAL, [$document->getId()]) - ], APP_LIMIT_SUBQUERY, 0, []); + ], APP_LIMIT_SUBQUERY); } ); @@ -309,7 +309,7 @@ Database::addFilter( return $database ->find('keys', [ new Query('projectId', Query::TYPE_EQUAL, [$document->getId()]) - ], APP_LIMIT_SUBQUERY, 0, []); + ], APP_LIMIT_SUBQUERY); } ); @@ -322,7 +322,7 @@ Database::addFilter( return $database ->find('webhooks', [ new Query('projectId', Query::TYPE_EQUAL, [$document->getId()]) - ], APP_LIMIT_SUBQUERY, 0, []); + ], APP_LIMIT_SUBQUERY); } ); @@ -332,9 +332,9 @@ Database::addFilter( return null; }, function (mixed $value, Document $document, Database $database) { - $sessions = Authorization::skip(fn () => $database->find('sessions', [ + return Authorization::skip(fn () => $database->find('sessions', [ new Query('userId', Query::TYPE_EQUAL, [$document->getId()]) - ], APP_LIMIT_SUBQUERY, 0, [])); + ], APP_LIMIT_SUBQUERY)); } ); @@ -347,7 +347,7 @@ Database::addFilter( return Authorization::skip(fn() => $database ->find('tokens', [ new Query('userId', Query::TYPE_EQUAL, [$document->getId()]) - ], APP_LIMIT_SUBQUERY, 0, [])); + ], APP_LIMIT_SUBQUERY)); } ); @@ -360,7 +360,7 @@ Database::addFilter( return Authorization::skip(fn() => $database ->find('memberships', [ new Query('userId', Query::TYPE_EQUAL, [$document->getId()]) - ], APP_LIMIT_SUBQUERY, 0, [])); + ], APP_LIMIT_SUBQUERY)); } ); From 8108bf033211d38c567935267aef8218ae0d5e3c Mon Sep 17 00:00:00 2001 From: Wen Yu Ge Date: Wed, 1 Jun 2022 15:43:46 -0400 Subject: [PATCH 30/44] fix function deploy directory --- app/views/console/functions/function.phtml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/console/functions/function.phtml b/app/views/console/functions/function.phtml index 68779e886..17bb873ee 100644 --- a/app/views/console/functions/function.phtml +++ b/app/views/console/functions/function.phtml @@ -703,7 +703,7 @@ sort($patterns); --functionId={{project-function.$id}} \ --activate=true \ --entrypoint='scriptFile' \ - --code='/myrepo/myfunction'" data-forms-code="bash" data-lang="bash" data-lang-label="Bash"> + --code='.'" data-forms-code="bash" data-lang="bash" data-lang-label="Bash">

PowerShell

@@ -713,7 +713,7 @@ sort($patterns); --functionId={{project-function.$id}} ` --activate=true ` --entrypoint='scriptFile' ` - --code='/myrepo/myfunction'" data-forms-code="powershell" data-lang="powershell" data-lang-label="PowerShell"> + --code='.'" data-forms-code="powershell" data-lang="powershell" data-lang-label="PowerShell">

Learn more about creating deployments, installing and using the Appwrite CLI.

From 69607b4ade677f40c843428e0cb977369ca98bcf Mon Sep 17 00:00:00 2001 From: Everly Precia Suresh Date: Thu, 2 Jun 2022 12:14:58 +0000 Subject: [PATCH 31/44] fix linitng issues in WebhooksCustomServerTest.php --- .../Services/Webhooks/WebhooksCustomServerTest.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/e2e/Services/Webhooks/WebhooksCustomServerTest.php b/tests/e2e/Services/Webhooks/WebhooksCustomServerTest.php index 7c815595f..aa9d0fbd2 100644 --- a/tests/e2e/Services/Webhooks/WebhooksCustomServerTest.php +++ b/tests/e2e/Services/Webhooks/WebhooksCustomServerTest.php @@ -173,7 +173,7 @@ class WebhooksCustomServerTest extends Scope $this->assertEquals($webhook['headers']['User-Agent'], 'Appwrite-Server vdev. Please report abuse at security@appwrite.io'); $this->assertStringContainsString('collections.*', $webhook['headers']['X-Appwrite-Webhook-Events']); $this->assertStringContainsString('collections.*.delete', $webhook['headers']['X-Appwrite-Webhook-Events']); - $this->assertStringContainsString("collections.{$id}", $webhook['headers']['X-Appwrite-Webhook-Events'],); + $this->assertStringContainsString("collections.{$id}", $webhook['headers']['X-Appwrite-Webhook-Events']); $this->assertStringContainsString("collections.{$id}.delete", $webhook['headers']['X-Appwrite-Webhook-Events']); $this->assertEquals($webhook['headers']['X-Appwrite-Webhook-Signature'], 'not-yet-implemented'); $this->assertEquals($webhook['headers']['X-Appwrite-Webhook-Id'] ?? '', $this->getProject()['webhookId']); @@ -220,7 +220,7 @@ class WebhooksCustomServerTest extends Scope $this->assertEquals($webhook['headers']['User-Agent'], 'Appwrite-Server vdev. Please report abuse at security@appwrite.io'); $this->assertStringContainsString('users.*', $webhook['headers']['X-Appwrite-Webhook-Events']); $this->assertStringContainsString('users.*.create', $webhook['headers']['X-Appwrite-Webhook-Events']); - $this->assertStringContainsString("users.{$id}", $webhook['headers']['X-Appwrite-Webhook-Events'],); + $this->assertStringContainsString("users.{$id}", $webhook['headers']['X-Appwrite-Webhook-Events']); $this->assertStringContainsString("users.{$id}.create", $webhook['headers']['X-Appwrite-Webhook-Events']); $this->assertEquals($webhook['headers']['X-Appwrite-Webhook-Signature'], 'not-yet-implemented'); $this->assertEquals($webhook['headers']['X-Appwrite-Webhook-Id'] ?? '', $this->getProject()['webhookId']); @@ -402,7 +402,7 @@ class WebhooksCustomServerTest extends Scope $this->assertEquals($webhook['headers']['X-Appwrite-Webhook-Project-Id'] ?? '', $this->getProject()['$id']); /** - * Test for FAILURE + * Test for FAILURE */ return [ @@ -542,7 +542,7 @@ class WebhooksCustomServerTest extends Scope $this->assertEquals($webhook['headers']['X-Appwrite-Webhook-Project-Id'] ?? '', $this->getProject()['$id']); /** - * Test for FAILURE + * Test for FAILURE */ return $data; @@ -610,14 +610,14 @@ class WebhooksCustomServerTest extends Scope $this->assertEquals($webhook['headers']['X-Appwrite-Webhook-Project-Id'] ?? '', $this->getProject()['$id']); /** - * Test for FAILURE + * Test for FAILURE */ return $data; } /** - * @depends testExecutions + * @depends testExecutions */ public function testDeleteDeployment($data): array { From 5a5c11ac16cb33d46531fadea24f4f0617a84628 Mon Sep 17 00:00:00 2001 From: Everly Precia Suresh Date: Thu, 2 Jun 2022 12:19:02 +0000 Subject: [PATCH 32/44] fix linting issues --- tests/e2e/Services/Webhooks/WebhooksCustomClientTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/e2e/Services/Webhooks/WebhooksCustomClientTest.php b/tests/e2e/Services/Webhooks/WebhooksCustomClientTest.php index 6290c6e76..211dff937 100644 --- a/tests/e2e/Services/Webhooks/WebhooksCustomClientTest.php +++ b/tests/e2e/Services/Webhooks/WebhooksCustomClientTest.php @@ -45,7 +45,7 @@ class WebhooksCustomClientTest extends Scope $this->assertEquals($webhook['headers']['User-Agent'], 'Appwrite-Server vdev. Please report abuse at security@appwrite.io'); $this->assertStringContainsString('users.*', $webhook['headers']['X-Appwrite-Webhook-Events']); $this->assertStringContainsString('users.*.create', $webhook['headers']['X-Appwrite-Webhook-Events']); - $this->assertStringContainsString("users.{$id}", $webhook['headers']['X-Appwrite-Webhook-Events'],); + $this->assertStringContainsString("users.{$id}", $webhook['headers']['X-Appwrite-Webhook-Events']); $this->assertStringContainsString("users.{$id}.create", $webhook['headers']['X-Appwrite-Webhook-Events']); $this->assertEquals($webhook['headers']['X-Appwrite-Webhook-Signature'], 'not-yet-implemented'); $this->assertEquals($webhook['headers']['X-Appwrite-Webhook-Id'] ?? '', $this->getProject()['webhookId']); From e95be7d92219973f522955085cf5883e13bb2e25 Mon Sep 17 00:00:00 2001 From: Everly Precia Suresh Date: Thu, 2 Jun 2022 12:47:07 +0000 Subject: [PATCH 33/44] fix linting issues AccountBase.php --- tests/e2e/Services/Account/AccountBase.php | 212 ++++++++++----------- 1 file changed, 105 insertions(+), 107 deletions(-) diff --git a/tests/e2e/Services/Account/AccountBase.php b/tests/e2e/Services/Account/AccountBase.php index 301ffff8a..7ffa9eb7c 100644 --- a/tests/e2e/Services/Account/AccountBase.php +++ b/tests/e2e/Services/Account/AccountBase.php @@ -6,9 +6,9 @@ use Tests\E2E\Client; trait AccountBase { - public function testCreateAccount():array + public function testCreateAccount(): array { - $email = uniqid().'user@localhost.test'; + $email = uniqid() . 'user@localhost.test'; $password = 'password'; $name = 'User Name'; @@ -98,7 +98,7 @@ trait AccountBase /** * @depends testCreateAccount */ - public function testCreateAccountSession($data):array + public function testCreateAccountSession($data): array { $email = $data['email'] ?? ''; $password = $data['password'] ?? ''; @@ -118,7 +118,7 @@ trait AccountBase $this->assertEquals($response['headers']['status-code'], 201); $sessionId = $response['body']['$id']; - $session = $this->client->parseCookie((string)$response['headers']['set-cookie'])['a_session_'.$this->getProject()['$id']]; + $session = $this->client->parseCookie((string)$response['headers']['set-cookie'])['a_session_' . $this->getProject()['$id']]; /** * Test for FAILURE @@ -128,7 +128,7 @@ trait AccountBase 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], ]), [ - 'email' => $email.'x', + 'email' => $email . 'x', 'password' => $password, ]); @@ -140,7 +140,7 @@ trait AccountBase 'x-appwrite-project' => $this->getProject()['$id'], ]), [ 'email' => $email, - 'password' => $password.'x', + 'password' => $password . 'x', ]); $this->assertEquals($response['headers']['status-code'], 401); @@ -165,7 +165,7 @@ trait AccountBase /** * @depends testCreateAccountSession */ - public function testGetAccount($data):array + public function testGetAccount($data): array { $email = $data['email'] ?? ''; $name = $data['name'] ?? ''; @@ -178,7 +178,7 @@ trait AccountBase 'origin' => 'http://localhost', 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], - 'cookie' => 'a_session_'.$this->getProject()['$id'].'=' . $session, + 'cookie' => 'a_session_' . $this->getProject()['$id'] . '=' . $session, ])); $this->assertEquals($response['headers']['status-code'], 200); @@ -200,7 +200,7 @@ trait AccountBase $response = $this->client->call(Client::METHOD_GET, '/account', [ 'content-type' => 'application/json', - 'cookie' => 'a_session_'.$this->getProject()['$id'].'=' . $session.'xx', + 'cookie' => 'a_session_' . $this->getProject()['$id'] . '=' . $session . 'xx', 'x-appwrite-project' => $this->getProject()['$id'], ]); @@ -212,7 +212,7 @@ trait AccountBase /** * @depends testCreateAccountSession */ - public function testGetAccountPrefs($data):array + public function testGetAccountPrefs($data): array { $session = $data['session'] ?? ''; @@ -223,7 +223,7 @@ trait AccountBase 'origin' => 'http://localhost', 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], - 'cookie' => 'a_session_'.$this->getProject()['$id'].'=' . $session, + 'cookie' => 'a_session_' . $this->getProject()['$id'] . '=' . $session, ])); $this->assertEquals($response['headers']['status-code'], 200); @@ -248,7 +248,7 @@ trait AccountBase /** * @depends testCreateAccountSession */ - public function testGetAccountSessions($data):array + public function testGetAccountSessions($data): array { $session = $data['session'] ?? ''; $sessionId = $data['sessionId'] ?? ''; @@ -260,7 +260,7 @@ trait AccountBase 'origin' => 'http://localhost', 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], - 'cookie' => 'a_session_'.$this->getProject()['$id'].'=' . $session, + 'cookie' => 'a_session_' . $this->getProject()['$id'] . '=' . $session, ])); $this->assertEquals($response['headers']['status-code'], 200); @@ -269,7 +269,7 @@ trait AccountBase $this->assertCount(2, $response['body']); $this->assertEquals(1, $response['body']['total']); $this->assertEquals($sessionId, $response['body']['sessions'][0]['$id']); - + $this->assertEquals('Windows', $response['body']['sessions'][0]['osName']); $this->assertEquals('WIN', $response['body']['sessions'][0]['osCode']); $this->assertEquals('10', $response['body']['sessions'][0]['osVersion']); @@ -306,7 +306,7 @@ trait AccountBase /** * @depends testCreateAccountSession */ - public function testGetAccountLogs($data):array + public function testGetAccountLogs($data): array { sleep(10); $session = $data['session'] ?? ''; @@ -319,7 +319,7 @@ trait AccountBase 'origin' => 'http://localhost', 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], - 'cookie' => 'a_session_'.$this->getProject()['$id'].'=' . $session, + 'cookie' => 'a_session_' . $this->getProject()['$id'] . '=' . $session, ])); $this->assertEquals($response['headers']['status-code'], 200); @@ -375,7 +375,7 @@ trait AccountBase 'origin' => 'http://localhost', 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], - 'cookie' => 'a_session_'.$this->getProject()['$id'].'=' . $session, + 'cookie' => 'a_session_' . $this->getProject()['$id'] . '=' . $session, ]), [ 'limit' => 1 ]); @@ -392,7 +392,7 @@ trait AccountBase 'origin' => 'http://localhost', 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], - 'cookie' => 'a_session_'.$this->getProject()['$id'].'=' . $session, + 'cookie' => 'a_session_' . $this->getProject()['$id'] . '=' . $session, ]), [ 'offset' => 1 ]); @@ -409,7 +409,7 @@ trait AccountBase 'origin' => 'http://localhost', 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], - 'cookie' => 'a_session_'.$this->getProject()['$id'].'=' . $session, + 'cookie' => 'a_session_' . $this->getProject()['$id'] . '=' . $session, ]), [ 'limit' => 1, 'offset' => 1 @@ -441,7 +441,7 @@ trait AccountBase /** * @depends testCreateAccountSession */ - public function testUpdateAccountName($data):array + public function testUpdateAccountName($data): array { $email = $data['email'] ?? ''; $session = $data['session'] ?? ''; @@ -454,7 +454,7 @@ trait AccountBase 'origin' => 'http://localhost', 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], - 'cookie' => 'a_session_'.$this->getProject()['$id'].'=' . $session, + 'cookie' => 'a_session_' . $this->getProject()['$id'] . '=' . $session, ]), [ 'name' => $newName ]); @@ -482,7 +482,7 @@ trait AccountBase 'origin' => 'http://localhost', 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], - 'cookie' => 'a_session_'.$this->getProject()['$id'].'=' . $session, + 'cookie' => 'a_session_' . $this->getProject()['$id'] . '=' . $session, ]), [ ]); @@ -492,7 +492,7 @@ trait AccountBase 'origin' => 'http://localhost', 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], - 'cookie' => 'a_session_'.$this->getProject()['$id'].'=' . $session, + 'cookie' => 'a_session_' . $this->getProject()['$id'] . '=' . $session, ]), [ 'name' => 'ocSRq1d3QphHivJyUmYY7WMnrxyjdk5YvVwcDqx2zS0coxESN8RmsQwLWw5Whnf0WbVohuFWTRAaoKgCOO0Y0M7LwgFnZmi8881Y72222222222222222222222222222' ]); @@ -507,7 +507,7 @@ trait AccountBase /** * @depends testUpdateAccountName */ - public function testUpdateAccountPassword($data):array + public function testUpdateAccountPassword($data): array { $email = $data['email'] ?? ''; $password = $data['password'] ?? ''; @@ -520,7 +520,7 @@ trait AccountBase 'origin' => 'http://localhost', 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], - 'cookie' => 'a_session_'.$this->getProject()['$id'].'=' . $session, + 'cookie' => 'a_session_' . $this->getProject()['$id'] . '=' . $session, ]), [ 'password' => 'new-password', 'oldPassword' => $password, @@ -554,15 +554,14 @@ trait AccountBase ])); $this->assertEquals($response['headers']['status-code'], 401); - $response = $this->client->call(Client::METHOD_PATCH, '/account/password', array_merge([ 'origin' => 'http://localhost', 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], - 'cookie' => 'a_session_'.$this->getProject()['$id'].'=' . $session, + 'cookie' => 'a_session_' . $this->getProject()['$id'] . '=' . $session, ]), [ ]); - + $this->assertEquals($response['headers']['status-code'], 400); /** @@ -572,7 +571,7 @@ trait AccountBase 'origin' => 'http://localhost', 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], - 'cookie' => 'a_session_'.$this->getProject()['$id'].'=' . $session, + 'cookie' => 'a_session_' . $this->getProject()['$id'] . '=' . $session, ]), [ 'password' => 'new-password', 'oldPassword' => $password, @@ -580,13 +579,13 @@ trait AccountBase $this->assertEquals($response['headers']['status-code'], 401); /** - * Existing user tries to update password without passing old password -> SHOULD FAIL + * Existing user tries to update password without passing old password -> SHOULD FAIL */ $response = $this->client->call(Client::METHOD_PATCH, '/account/password', array_merge([ 'origin' => 'http://localhost', 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], - 'cookie' => 'a_session_'.$this->getProject()['$id'].'=' . $session, + 'cookie' => 'a_session_' . $this->getProject()['$id'] . '=' . $session, ]), [ 'password' => 'new-password' ]); @@ -600,9 +599,9 @@ trait AccountBase /** * @depends testUpdateAccountPassword */ - public function testUpdateAccountEmail($data):array + public function testUpdateAccountEmail($data): array { - $newEmail = uniqid().'new@localhost.test'; + $newEmail = uniqid() . 'new@localhost.test'; $session = $data['session'] ?? ''; /** @@ -612,7 +611,7 @@ trait AccountBase 'origin' => 'http://localhost', 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], - 'cookie' => 'a_session_'.$this->getProject()['$id'].'=' . $session, + 'cookie' => 'a_session_' . $this->getProject()['$id'] . '=' . $session, ]), [ 'email' => $newEmail, 'password' => 'new-password', @@ -640,7 +639,7 @@ trait AccountBase 'origin' => 'http://localhost', 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], - 'cookie' => 'a_session_'.$this->getProject()['$id'].'=' . $session, + 'cookie' => 'a_session_' . $this->getProject()['$id'] . '=' . $session, ]), [ ]); @@ -667,8 +666,8 @@ trait AccountBase $this->assertNotEmpty($response['body']['$id']); $this->assertIsNumeric($response['body']['registration']); $this->assertEquals($response['body']['email'], $data['email']); - $this->assertEquals($response['body']['name'], $data['name'],); - + $this->assertEquals($response['body']['name'], $data['name']); + $data['email'] = $newEmail; @@ -678,9 +677,9 @@ trait AccountBase /** * @depends testUpdateAccountEmail */ - public function testUpdateAccountPrefs($data):array + public function testUpdateAccountPrefs($data): array { - $newEmail = uniqid().'new@localhost.test'; + $newEmail = uniqid() . 'new@localhost.test'; $session = $data['session'] ?? ''; /** @@ -690,7 +689,7 @@ trait AccountBase 'origin' => 'http://localhost', 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], - 'cookie' => 'a_session_'.$this->getProject()['$id'].'=' . $session, + 'cookie' => 'a_session_' . $this->getProject()['$id'] . '=' . $session, ]), [ 'prefs' => [ 'prefKey1' => 'prefValue1', @@ -714,35 +713,35 @@ trait AccountBase ])); $this->assertEquals($response['headers']['status-code'], 401); - + $response = $this->client->call(Client::METHOD_PATCH, '/account/prefs', array_merge([ 'origin' => 'http://localhost', 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], - 'cookie' => 'a_session_'.$this->getProject()['$id'].'=' . $session, + 'cookie' => 'a_session_' . $this->getProject()['$id'] . '=' . $session, ]), [ 'prefs' => '{}' ]); $this->assertEquals($response['headers']['status-code'], 400); - - + + $response = $this->client->call(Client::METHOD_PATCH, '/account/prefs', array_merge([ 'origin' => 'http://localhost', 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], - 'cookie' => 'a_session_'.$this->getProject()['$id'].'=' . $session, + 'cookie' => 'a_session_' . $this->getProject()['$id'] . '=' . $session, ]), [ 'prefs' => '[]' ]); $this->assertEquals($response['headers']['status-code'], 400); - + $response = $this->client->call(Client::METHOD_PATCH, '/account/prefs', array_merge([ 'origin' => 'http://localhost', 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], - 'cookie' => 'a_session_'.$this->getProject()['$id'].'=' . $session, + 'cookie' => 'a_session_' . $this->getProject()['$id'] . '=' . $session, ]), [ 'prefs' => '{"test": "value"}' ]); @@ -758,7 +757,7 @@ trait AccountBase 'origin' => 'http://localhost', 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], - 'cookie' => 'a_session_'.$this->getProject()['$id'].'=' . $session, + 'cookie' => 'a_session_' . $this->getProject()['$id'] . '=' . $session, ]), [ 'prefs' => $prefsObject ]); @@ -772,7 +771,7 @@ trait AccountBase 'origin' => 'http://localhost', 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], - 'cookie' => 'a_session_'.$this->getProject()['$id'].'=' . $session, + 'cookie' => 'a_session_' . $this->getProject()['$id'] . '=' . $session, ]), [ 'prefs' => $prefsObject ]); @@ -785,7 +784,7 @@ trait AccountBase /** * @depends testUpdateAccountPrefs */ - public function testCreateAccountVerification($data):array + public function testCreateAccountVerification($data): array { $email = $data['email'] ?? ''; $name = $data['name'] ?? ''; @@ -798,8 +797,8 @@ trait AccountBase 'origin' => 'http://localhost', 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], - 'cookie' => 'a_session_'.$this->getProject()['$id'].'=' . $session, - + 'cookie' => 'a_session_' . $this->getProject()['$id'] . '=' . $session, + ]), [ 'url' => 'http://localhost/verification', ]); @@ -817,15 +816,15 @@ trait AccountBase $verification = substr($lastEmail['text'], strpos($lastEmail['text'], '&secret=', 0) + 8, 256); - $expireTime = strpos($lastEmail['text'], 'expire='.$response['body']['expire'], 0); + $expireTime = strpos($lastEmail['text'], 'expire=' . $response['body']['expire'], 0); $this->assertNotFalse($expireTime); - - $secretTest = strpos($lastEmail['text'], 'secret='.$response['body']['secret'], 0); + + $secretTest = strpos($lastEmail['text'], 'secret=' . $response['body']['secret'], 0); $this->assertNotFalse($secretTest); - $userIDTest = strpos($lastEmail['text'], 'userId='.$response['body']['userId'], 0); + $userIDTest = strpos($lastEmail['text'], 'userId=' . $response['body']['userId'], 0); $this->assertNotFalse($userIDTest); @@ -836,7 +835,7 @@ trait AccountBase 'origin' => 'http://localhost', 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], - 'cookie' => 'a_session_'.$this->getProject()['$id'].'=' . $session, + 'cookie' => 'a_session_' . $this->getProject()['$id'] . '=' . $session, ]), [ 'url' => 'localhost/verification', ]); @@ -847,7 +846,7 @@ trait AccountBase 'origin' => 'http://localhost', 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], - 'cookie' => 'a_session_'.$this->getProject()['$id'].'=' . $session, + 'cookie' => 'a_session_' . $this->getProject()['$id'] . '=' . $session, ]), [ 'url' => 'http://remotehost/verification', ]); @@ -862,12 +861,12 @@ trait AccountBase /** * @depends testCreateAccountVerification */ - public function testUpdateAccountVerification($data):array + public function testUpdateAccountVerification($data): array { $id = $data['id'] ?? ''; $session = $data['session'] ?? ''; $verification = $data['verification'] ?? ''; - + /** * Test for SUCCESS */ @@ -875,14 +874,14 @@ trait AccountBase 'origin' => 'http://localhost', 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], - 'cookie' => 'a_session_'.$this->getProject()['$id'].'=' . $session, + 'cookie' => 'a_session_' . $this->getProject()['$id'] . '=' . $session, ]), [ 'userId' => $id, 'secret' => $verification, ]); $this->assertEquals(200, $response['headers']['status-code']); - + /** * Test for FAILURE */ @@ -890,7 +889,7 @@ trait AccountBase 'origin' => 'http://localhost', 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], - 'cookie' => 'a_session_'.$this->getProject()['$id'].'=' . $session, + 'cookie' => 'a_session_' . $this->getProject()['$id'] . '=' . $session, ]), [ 'userId' => 'ewewe', 'secret' => $verification, @@ -902,7 +901,7 @@ trait AccountBase 'origin' => 'http://localhost', 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], - 'cookie' => 'a_session_'.$this->getProject()['$id'].'=' . $session, + 'cookie' => 'a_session_' . $this->getProject()['$id'] . '=' . $session, ]), [ 'userId' => $id, 'secret' => 'sdasdasdasd', @@ -916,7 +915,7 @@ trait AccountBase /** * @depends testUpdateAccountVerification */ - public function testDeleteAccountSession($data):array + public function testDeleteAccountSession($data): array { $email = $data['email'] ?? ''; $password = $data['password'] ?? ''; @@ -935,7 +934,7 @@ trait AccountBase ]); $sessionNewId = $response['body']['$id']; - $sessionNew = $this->client->parseCookie((string)$response['headers']['set-cookie'])['a_session_'.$this->getProject()['$id']]; + $sessionNew = $this->client->parseCookie((string)$response['headers']['set-cookie'])['a_session_' . $this->getProject()['$id']]; $this->assertEquals($response['headers']['status-code'], 201); @@ -943,16 +942,16 @@ trait AccountBase 'origin' => 'http://localhost', 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], - 'cookie' => 'a_session_'.$this->getProject()['$id'].'=' . $sessionNew, + 'cookie' => 'a_session_' . $this->getProject()['$id'] . '=' . $sessionNew, ]); $this->assertEquals($response['headers']['status-code'], 200); - $response = $this->client->call(Client::METHOD_DELETE, '/account/sessions/'.$sessionNewId, array_merge([ + $response = $this->client->call(Client::METHOD_DELETE, '/account/sessions/' . $sessionNewId, array_merge([ 'origin' => 'http://localhost', 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], - 'cookie' => 'a_session_'.$this->getProject()['$id'].'=' . $sessionNew, + 'cookie' => 'a_session_' . $this->getProject()['$id'] . '=' . $sessionNew, ])); $this->assertEquals($response['headers']['status-code'], 204); @@ -961,7 +960,7 @@ trait AccountBase 'origin' => 'http://localhost', 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], - 'cookie' => 'a_session_'.$this->getProject()['$id'].'=' . $session, + 'cookie' => 'a_session_' . $this->getProject()['$id'] . '=' . $session, ])); $this->assertEquals($response['headers']['status-code'], 200); @@ -973,7 +972,7 @@ trait AccountBase 'origin' => 'http://localhost', 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], - 'cookie' => 'a_session_'.$this->getProject()['$id'].'=' . $sessionNew, + 'cookie' => 'a_session_' . $this->getProject()['$id'] . '=' . $sessionNew, ]); $this->assertEquals($response['headers']['status-code'], 401); @@ -984,7 +983,7 @@ trait AccountBase /** * @depends testUpdateAccountVerification */ - public function testDeleteAccountSessionCurrent($data):array + public function testDeleteAccountSessionCurrent($data): array { $email = $data['email'] ?? ''; $password = $data['password'] ?? ''; @@ -1001,14 +1000,14 @@ trait AccountBase 'password' => $password, ]); - $sessionNew = $this->client->parseCookie((string)$response['headers']['set-cookie'])['a_session_'.$this->getProject()['$id']]; + $sessionNew = $this->client->parseCookie((string)$response['headers']['set-cookie'])['a_session_' . $this->getProject()['$id']]; $this->assertEquals($response['headers']['status-code'], 201); $response = $this->client->call(Client::METHOD_GET, '/account', [ 'origin' => 'http://localhost', 'content-type' => 'application/json', - 'cookie' => 'a_session_'.$this->getProject()['$id'].'=' . $sessionNew, + 'cookie' => 'a_session_' . $this->getProject()['$id'] . '=' . $sessionNew, 'x-appwrite-project' => $this->getProject()['$id'], ]); @@ -1017,7 +1016,7 @@ trait AccountBase $response = $this->client->call(Client::METHOD_DELETE, '/account/sessions/current', [ 'origin' => 'http://localhost', 'content-type' => 'application/json', - 'cookie' => 'a_session_'.$this->getProject()['$id'].'=' . $sessionNew, + 'cookie' => 'a_session_' . $this->getProject()['$id'] . '=' . $sessionNew, 'x-appwrite-project' => $this->getProject()['$id'], ]); @@ -1029,7 +1028,7 @@ trait AccountBase $response = $this->client->call(Client::METHOD_GET, '/account', [ 'origin' => 'http://localhost', 'content-type' => 'application/json', - 'cookie' => 'a_session_'.$this->getProject()['$id'].'=' . $sessionNew, + 'cookie' => 'a_session_' . $this->getProject()['$id'] . '=' . $sessionNew, 'x-appwrite-project' => $this->getProject()['$id'], ]); @@ -1041,7 +1040,7 @@ trait AccountBase /** * @depends testUpdateAccountVerification */ - public function testDeleteAccountSessions($data):array + public function testDeleteAccountSessions($data): array { $session = $data['session'] ?? ''; @@ -1052,7 +1051,7 @@ trait AccountBase 'origin' => 'http://localhost', 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], - 'cookie' => 'a_session_'.$this->getProject()['$id'].'=' . $session, + 'cookie' => 'a_session_' . $this->getProject()['$id'] . '=' . $session, ])); $this->assertEquals($response['headers']['status-code'], 204); @@ -1083,7 +1082,7 @@ trait AccountBase 'password' => $password, ]); - $data['session'] = $this->client->parseCookie((string)$response['headers']['set-cookie'])['a_session_'.$this->getProject()['$id']]; + $data['session'] = $this->client->parseCookie((string)$response['headers']['set-cookie'])['a_session_' . $this->getProject()['$id']]; return $data; } @@ -1091,7 +1090,7 @@ trait AccountBase /** * @depends testDeleteAccountSession */ - public function testCreateAccountRecovery($data):array + public function testCreateAccountRecovery($data): array { $email = $data['email'] ?? ''; $name = $data['name'] ?? ''; @@ -1121,15 +1120,15 @@ trait AccountBase $recovery = substr($lastEmail['text'], strpos($lastEmail['text'], '&secret=', 0) + 8, 256); - $expireTime = strpos($lastEmail['text'], 'expire='.$response['body']['expire'], 0); + $expireTime = strpos($lastEmail['text'], 'expire=' . $response['body']['expire'], 0); $this->assertNotFalse($expireTime); - - $secretTest = strpos($lastEmail['text'], 'secret='.$response['body']['secret'], 0); + + $secretTest = strpos($lastEmail['text'], 'secret=' . $response['body']['secret'], 0); $this->assertNotFalse($secretTest); - $userIDTest = strpos($lastEmail['text'], 'userId='.$response['body']['userId'], 0); + $userIDTest = strpos($lastEmail['text'], 'userId=' . $response['body']['userId'], 0); $this->assertNotFalse($userIDTest); @@ -1177,12 +1176,12 @@ trait AccountBase /** * @depends testCreateAccountRecovery */ - public function testUpdateAccountRecovery($data):array + public function testUpdateAccountRecovery($data): array { $id = $data['id'] ?? ''; $recovery = $data['recovery'] ?? ''; $newPassowrd = 'test-recovery'; - + /** * Test for SUCCESS */ @@ -1198,7 +1197,7 @@ trait AccountBase ]); $this->assertEquals(200, $response['headers']['status-code']); - + /** * Test for FAILURE */ @@ -1235,18 +1234,18 @@ trait AccountBase ]), [ 'userId' => $id, 'secret' => $recovery, - 'password' => $newPassowrd.'x', + 'password' => $newPassowrd . 'x', 'passwordAgain' => $newPassowrd, ]); $this->assertEquals(400, $response['headers']['status-code']); - + return $data; } - public function testCreateMagicUrl():array + public function testCreateMagicUrl(): array { - $email = \time().'user@appwrite.io'; + $email = \time() . 'user@appwrite.io'; /** * Test for SUCCESS @@ -1274,15 +1273,15 @@ trait AccountBase $token = substr($lastEmail['text'], strpos($lastEmail['text'], '&secret=', 0) + 8, 256); - $expireTime = strpos($lastEmail['text'], 'expire='.$response['body']['expire'], 0); + $expireTime = strpos($lastEmail['text'], 'expire=' . $response['body']['expire'], 0); $this->assertNotFalse($expireTime); - $secretTest = strpos($lastEmail['text'], 'secret='.$response['body']['secret'], 0); + $secretTest = strpos($lastEmail['text'], 'secret=' . $response['body']['secret'], 0); $this->assertNotFalse($secretTest); - $userIDTest = strpos($lastEmail['text'], 'userId='.$response['body']['userId'], 0); + $userIDTest = strpos($lastEmail['text'], 'userId=' . $response['body']['userId'], 0); $this->assertNotFalse($userIDTest); @@ -1333,7 +1332,7 @@ trait AccountBase /** * @depends testCreateMagicUrl */ - public function testCreateSessionWithMagicUrl($data):array + public function testCreateSessionWithMagicUrl($data): array { $id = $data['id'] ?? ''; $token = $data['token'] ?? ''; @@ -1358,13 +1357,13 @@ trait AccountBase $this->assertNotEmpty($response['body']['userId']); $sessionId = $response['body']['$id']; - $session = $this->client->parseCookie((string)$response['headers']['set-cookie'])['a_session_'.$this->getProject()['$id']]; + $session = $this->client->parseCookie((string)$response['headers']['set-cookie'])['a_session_' . $this->getProject()['$id']]; $response = $this->client->call(Client::METHOD_GET, '/account', array_merge([ 'origin' => 'http://localhost', 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], - 'cookie' => 'a_session_'.$this->getProject()['$id'].'=' . $session, + 'cookie' => 'a_session_' . $this->getProject()['$id'] . '=' . $session, ])); $this->assertEquals($response['headers']['status-code'], 200); @@ -1409,7 +1408,7 @@ trait AccountBase /** * @depends testCreateSessionWithMagicUrl */ - public function testUpdateAccountPasswordWithMagicUrl($data):array + public function testUpdateAccountPasswordWithMagicUrl($data): array { $email = $data['email'] ?? ''; $session = $data['session'] ?? ''; @@ -1421,7 +1420,7 @@ trait AccountBase 'origin' => 'http://localhost', 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], - 'cookie' => 'a_session_'.$this->getProject()['$id'].'=' . $session, + 'cookie' => 'a_session_' . $this->getProject()['$id'] . '=' . $session, ]), [ 'password' => 'new-password' ]); @@ -1454,15 +1453,15 @@ trait AccountBase ])); $this->assertEquals($response['headers']['status-code'], 401); - + $response = $this->client->call(Client::METHOD_PATCH, '/account/password', array_merge([ 'origin' => 'http://localhost', 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], - 'cookie' => 'a_session_'.$this->getProject()['$id'].'=' . $session, + 'cookie' => 'a_session_' . $this->getProject()['$id'] . '=' . $session, ]), [ ]); - + $this->assertEquals($response['headers']['status-code'], 400); /** @@ -1472,7 +1471,7 @@ trait AccountBase 'origin' => 'http://localhost', 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], - 'cookie' => 'a_session_'.$this->getProject()['$id'].'=' . $session, + 'cookie' => 'a_session_' . $this->getProject()['$id'] . '=' . $session, ]), [ 'password' => 'new-password', 'oldPassword' => 'wrong-password', @@ -1480,13 +1479,13 @@ trait AccountBase $this->assertEquals($response['headers']['status-code'], 401); /** - * Existing user tries to update password without passing old password -> SHOULD FAIL + * Existing user tries to update password without passing old password -> SHOULD FAIL */ $response = $this->client->call(Client::METHOD_PATCH, '/account/password', array_merge([ 'origin' => 'http://localhost', 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], - 'cookie' => 'a_session_'.$this->getProject()['$id'].'=' . $session, + 'cookie' => 'a_session_' . $this->getProject()['$id'] . '=' . $session, ]), [ 'password' => 'new-password' ]); @@ -1496,5 +1495,4 @@ trait AccountBase return $data; } - -} \ No newline at end of file +} From 8d0581e401cf6a756a2f58b1c5c1c73ac7e2b260 Mon Sep 17 00:00:00 2001 From: Everly Precia Suresh Date: Thu, 2 Jun 2022 12:49:01 +0000 Subject: [PATCH 34/44] fix linting issues in client.php --- tests/e2e/Client.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/tests/e2e/Client.php b/tests/e2e/Client.php index 63b6f3019..226556b78 100644 --- a/tests/e2e/Client.php +++ b/tests/e2e/Client.php @@ -6,15 +6,15 @@ use Exception; class Client { - const METHOD_GET = 'GET'; - const METHOD_POST = 'POST'; - const METHOD_PUT = 'PUT'; - const METHOD_PATCH = 'PATCH'; - const METHOD_DELETE = 'DELETE'; - const METHOD_HEAD = 'HEAD'; - const METHOD_OPTIONS = 'OPTIONS'; - const METHOD_CONNECT = 'CONNECT'; - const METHOD_TRACE = 'TRACE'; + public const METHOD_GET = 'GET'; + public const METHOD_POST = 'POST'; + public const METHOD_PUT = 'PUT'; + public const METHOD_PATCH = 'PATCH'; + public const METHOD_DELETE = 'DELETE'; + public const METHOD_HEAD = 'HEAD'; + public const METHOD_OPTIONS = 'OPTIONS'; + public const METHOD_CONNECT = 'CONNECT'; + public const METHOD_TRACE = 'TRACE'; /** * Is Self Signed Certificates Allowed? From d41aff1861523fbc61cbbc08ffe25a3d908cbcfc Mon Sep 17 00:00:00 2001 From: Everly Precia Suresh Date: Thu, 2 Jun 2022 13:03:37 +0000 Subject: [PATCH 35/44] fix linting issues --- src/Appwrite/Auth/Auth.php | 40 ++--- src/Appwrite/Auth/OAuth2/Tradeshift.php | 4 +- src/Appwrite/Auth/OAuth2/Twitter.php | 0 src/Appwrite/Event/Event.php | 32 ++-- src/Appwrite/Extend/Exception.php | 186 ++++++++++++------------ src/Appwrite/Resque/Worker.php | 4 +- src/Appwrite/Utopia/Response.php | 178 +++++++++++------------ src/Appwrite/Utopia/Response/Model.php | 10 +- src/Executor/Executor.php | 18 +-- 9 files changed, 236 insertions(+), 236 deletions(-) delete mode 100644 src/Appwrite/Auth/OAuth2/Twitter.php diff --git a/src/Appwrite/Auth/Auth.php b/src/Appwrite/Auth/Auth.php index 8b1687102..40560371f 100644 --- a/src/Appwrite/Auth/Auth.php +++ b/src/Appwrite/Auth/Auth.php @@ -10,38 +10,38 @@ class Auth /** * User Roles. */ - const USER_ROLE_ALL = 'all'; - const USER_ROLE_GUEST = 'guest'; - const USER_ROLE_MEMBER = 'member'; - const USER_ROLE_ADMIN = 'admin'; - const USER_ROLE_DEVELOPER = 'developer'; - const USER_ROLE_OWNER = 'owner'; - const USER_ROLE_APP = 'app'; - const USER_ROLE_SYSTEM = 'system'; + public const USER_ROLE_ALL = 'all'; + public const USER_ROLE_GUEST = 'guest'; + public const USER_ROLE_MEMBER = 'member'; + public const USER_ROLE_ADMIN = 'admin'; + public const USER_ROLE_DEVELOPER = 'developer'; + public const USER_ROLE_OWNER = 'owner'; + public const USER_ROLE_APP = 'app'; + public const USER_ROLE_SYSTEM = 'system'; /** * Token Types. */ - const TOKEN_TYPE_LOGIN = 1; // Deprecated - const TOKEN_TYPE_VERIFICATION = 2; - const TOKEN_TYPE_RECOVERY = 3; - const TOKEN_TYPE_INVITE = 4; - const TOKEN_TYPE_MAGIC_URL = 5; + public const TOKEN_TYPE_LOGIN = 1; // Deprecated + public const TOKEN_TYPE_VERIFICATION = 2; + public const TOKEN_TYPE_RECOVERY = 3; + public const TOKEN_TYPE_INVITE = 4; + public const TOKEN_TYPE_MAGIC_URL = 5; /** * Session Providers. */ - const SESSION_PROVIDER_EMAIL = 'email'; - const SESSION_PROVIDER_ANONYMOUS = 'anonymous'; - const SESSION_PROVIDER_MAGIC_URL = 'magic-url'; + public const SESSION_PROVIDER_EMAIL = 'email'; + public const SESSION_PROVIDER_ANONYMOUS = 'anonymous'; + public const SESSION_PROVIDER_MAGIC_URL = 'magic-url'; /** * Token Expiration times. */ - const TOKEN_EXPIRATION_LOGIN_LONG = 31536000; /* 1 year */ - const TOKEN_EXPIRATION_LOGIN_SHORT = 3600; /* 1 hour */ - const TOKEN_EXPIRATION_RECOVERY = 3600; /* 1 hour */ - const TOKEN_EXPIRATION_CONFIRM = 3600 * 24 * 7; /* 7 days */ + public const TOKEN_EXPIRATION_LOGIN_LONG = 31536000; /* 1 year */ + public const TOKEN_EXPIRATION_LOGIN_SHORT = 3600; /* 1 hour */ + public const TOKEN_EXPIRATION_RECOVERY = 3600; /* 1 hour */ + public const TOKEN_EXPIRATION_CONFIRM = 3600 * 24 * 7; /* 7 days */ /** * @var string diff --git a/src/Appwrite/Auth/OAuth2/Tradeshift.php b/src/Appwrite/Auth/OAuth2/Tradeshift.php index fb12493d4..8d0bfa878 100644 --- a/src/Appwrite/Auth/OAuth2/Tradeshift.php +++ b/src/Appwrite/Auth/OAuth2/Tradeshift.php @@ -9,8 +9,8 @@ use Appwrite\Auth\OAuth2; class Tradeshift extends OAuth2 { - const TRADESHIFT_SANDBOX_API_DOMAIN = 'api-sandbox.tradeshift.com'; - const TRADESHIFT_API_DOMAIN = 'api.tradeshift.com'; + public const TRADESHIFT_SANDBOX_API_DOMAIN = 'api-sandbox.tradeshift.com'; + public const TRADESHIFT_API_DOMAIN = 'api.tradeshift.com'; private array $apiDomain = [ 'sandbox' => self::TRADESHIFT_SANDBOX_API_DOMAIN, diff --git a/src/Appwrite/Auth/OAuth2/Twitter.php b/src/Appwrite/Auth/OAuth2/Twitter.php deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/Appwrite/Event/Event.php b/src/Appwrite/Event/Event.php index 45fefb3b1..af98b0a43 100644 --- a/src/Appwrite/Event/Event.php +++ b/src/Appwrite/Event/Event.php @@ -8,29 +8,29 @@ use Utopia\Database\Document; class Event { - const DATABASE_QUEUE_NAME = 'v1-database'; - const DATABASE_CLASS_NAME = 'DatabaseV1'; + public const DATABASE_QUEUE_NAME = 'v1-database'; + public const DATABASE_CLASS_NAME = 'DatabaseV1'; - const DELETE_QUEUE_NAME = 'v1-deletes'; - const DELETE_CLASS_NAME = 'DeletesV1'; + public const DELETE_QUEUE_NAME = 'v1-deletes'; + public const DELETE_CLASS_NAME = 'DeletesV1'; - const AUDITS_QUEUE_NAME = 'v1-audits'; - const AUDITS_CLASS_NAME = 'AuditsV1'; + public const AUDITS_QUEUE_NAME = 'v1-audits'; + public const AUDITS_CLASS_NAME = 'AuditsV1'; - const MAILS_QUEUE_NAME = 'v1-mails'; - const MAILS_CLASS_NAME = 'MailsV1'; + public const MAILS_QUEUE_NAME = 'v1-mails'; + public const MAILS_CLASS_NAME = 'MailsV1'; - const FUNCTIONS_QUEUE_NAME = 'v1-functions'; - const FUNCTIONS_CLASS_NAME = 'FunctionsV1'; + public const FUNCTIONS_QUEUE_NAME = 'v1-functions'; + public const FUNCTIONS_CLASS_NAME = 'FunctionsV1'; - const WEBHOOK_QUEUE_NAME = 'v1-webhooks'; - const WEBHOOK_CLASS_NAME = 'WebhooksV1'; + public const WEBHOOK_QUEUE_NAME = 'v1-webhooks'; + public const WEBHOOK_CLASS_NAME = 'WebhooksV1'; - const CERTIFICATES_QUEUE_NAME = 'v1-certificates'; - const CERTIFICATES_CLASS_NAME = 'CertificatesV1'; + public const CERTIFICATES_QUEUE_NAME = 'v1-certificates'; + public const CERTIFICATES_CLASS_NAME = 'CertificatesV1'; - const BUILDS_QUEUE_NAME = 'v1-builds'; - const BUILDS_CLASS_NAME = 'BuildsV1'; + public const BUILDS_QUEUE_NAME = 'v1-builds'; + public const BUILDS_CLASS_NAME = 'BuildsV1'; protected string $queue = ''; protected string $class = ''; diff --git a/src/Appwrite/Extend/Exception.php b/src/Appwrite/Extend/Exception.php index a74ec609d..62695742f 100644 --- a/src/Appwrite/Extend/Exception.php +++ b/src/Appwrite/Extend/Exception.php @@ -32,135 +32,135 @@ class Exception extends \Exception */ /** General */ - const GENERAL_UNKNOWN = 'general_unknown'; - const GENERAL_MOCK = 'general_mock'; - const GENERAL_ACCESS_FORBIDDEN = 'general_access_forbidden'; - const GENERAL_UNKNOWN_ORIGIN = 'general_unknown_origin'; - const GENERAL_SERVICE_DISABLED = 'general_service_disabled'; - const GENERAL_UNAUTHORIZED_SCOPE = 'general_unauthorized_scope'; - const GENERAL_RATE_LIMIT_EXCEEDED = 'general_rate_limit_exceeded'; - const GENERAL_SMTP_DISABLED = 'general_smtp_disabled'; - const GENERAL_ARGUMENT_INVALID = 'general_argument_invalid'; - const GENERAL_QUERY_LIMIT_EXCEEDED = 'general_query_limit_exceeded'; - const GENERAL_QUERY_INVALID = 'general_query_invalid'; - const GENERAL_ROUTE_NOT_FOUND = 'general_route_not_found'; - const GENERAL_CURSOR_NOT_FOUND = 'general_cursor_not_found'; - const GENERAL_SERVER_ERROR = 'general_server_error'; - const GENERAL_PROTOCOL_UNSUPPORTED = 'general_protocol_unsupported'; + public const GENERAL_UNKNOWN = 'general_unknown'; + public const GENERAL_MOCK = 'general_mock'; + public const GENERAL_ACCESS_FORBIDDEN = 'general_access_forbidden'; + public const GENERAL_UNKNOWN_ORIGIN = 'general_unknown_origin'; + public const GENERAL_SERVICE_DISABLED = 'general_service_disabled'; + public const GENERAL_UNAUTHORIZED_SCOPE = 'general_unauthorized_scope'; + public const GENERAL_RATE_LIMIT_EXCEEDED = 'general_rate_limit_exceeded'; + public const GENERAL_SMTP_DISABLED = 'general_smtp_disabled'; + public const GENERAL_ARGUMENT_INVALID = 'general_argument_invalid'; + public const GENERAL_QUERY_LIMIT_EXCEEDED = 'general_query_limit_exceeded'; + public const GENERAL_QUERY_INVALID = 'general_query_invalid'; + public const GENERAL_ROUTE_NOT_FOUND = 'general_route_not_found'; + public const GENERAL_CURSOR_NOT_FOUND = 'general_cursor_not_found'; + public const GENERAL_SERVER_ERROR = 'general_server_error'; + public const GENERAL_PROTOCOL_UNSUPPORTED = 'general_protocol_unsupported'; /** Users */ - const USER_COUNT_EXCEEDED = 'user_count_exceeded'; - const USER_JWT_INVALID = 'user_jwt_invalid'; - const USER_ALREADY_EXISTS = 'user_already_exists'; - const USER_BLOCKED = 'user_blocked'; - const USER_INVALID_TOKEN = 'user_invalid_token'; - const USER_PASSWORD_RESET_REQUIRED = 'user_password_reset_required'; - const USER_EMAIL_NOT_WHITELISTED = 'user_email_not_whitelisted'; - const USER_IP_NOT_WHITELISTED = 'user_ip_not_whitelisted'; - const USER_INVALID_CREDENTIALS = 'user_invalid_credentials'; - const USER_ANONYMOUS_CONSOLE_PROHIBITED = 'user_anonymous_console_prohibited'; - const USER_SESSION_ALREADY_EXISTS = 'user_session_already_exists'; - const USER_NOT_FOUND = 'user_not_found'; - const USER_EMAIL_ALREADY_EXISTS = 'user_email_already_exists'; - const USER_PASSWORD_MISMATCH = 'user_password_mismatch'; - const USER_SESSION_NOT_FOUND = 'user_session_not_found'; - const USER_UNAUTHORIZED = 'user_unauthorized'; - const USER_AUTH_METHOD_UNSUPPORTED = 'user_auth_method_unsupported'; + public const USER_COUNT_EXCEEDED = 'user_count_exceeded'; + public const USER_JWT_INVALID = 'user_jwt_invalid'; + public const USER_ALREADY_EXISTS = 'user_already_exists'; + public const USER_BLOCKED = 'user_blocked'; + public const USER_INVALID_TOKEN = 'user_invalid_token'; + public const USER_PASSWORD_RESET_REQUIRED = 'user_password_reset_required'; + public const USER_EMAIL_NOT_WHITELISTED = 'user_email_not_whitelisted'; + public const USER_IP_NOT_WHITELISTED = 'user_ip_not_whitelisted'; + public const USER_INVALID_CREDENTIALS = 'user_invalid_credentials'; + public const USER_ANONYMOUS_CONSOLE_PROHIBITED = 'user_anonymous_console_prohibited'; + public const USER_SESSION_ALREADY_EXISTS = 'user_session_already_exists'; + public const USER_NOT_FOUND = 'user_not_found'; + public const USER_EMAIL_ALREADY_EXISTS = 'user_email_already_exists'; + public const USER_PASSWORD_MISMATCH = 'user_password_mismatch'; + public const USER_SESSION_NOT_FOUND = 'user_session_not_found'; + public const USER_UNAUTHORIZED = 'user_unauthorized'; + public const USER_AUTH_METHOD_UNSUPPORTED = 'user_auth_method_unsupported'; /** Teams */ - const TEAM_NOT_FOUND = 'team_not_found'; - const TEAM_INVITE_ALREADY_EXISTS = 'team_invite_already_exists'; - const TEAM_INVITE_NOT_FOUND = 'team_invite_not_found'; - const TEAM_INVALID_SECRET = 'team_invalid_secret'; - const TEAM_MEMBERSHIP_MISMATCH = 'team_membership_mismatch'; - const TEAM_INVITE_MISMATCH = 'team_invite_mismatch'; + public const TEAM_NOT_FOUND = 'team_not_found'; + public const TEAM_INVITE_ALREADY_EXISTS = 'team_invite_already_exists'; + public const TEAM_INVITE_NOT_FOUND = 'team_invite_not_found'; + public const TEAM_INVALID_SECRET = 'team_invalid_secret'; + public const TEAM_MEMBERSHIP_MISMATCH = 'team_membership_mismatch'; + public const TEAM_INVITE_MISMATCH = 'team_invite_mismatch'; /** Membership */ - const MEMBERSHIP_NOT_FOUND = 'membership_not_found'; + public const MEMBERSHIP_NOT_FOUND = 'membership_not_found'; /** Avatars */ - const AVATAR_SET_NOT_FOUND = 'avatar_set_not_found'; - const AVATAR_NOT_FOUND = 'avatar_not_found'; - const AVATAR_IMAGE_NOT_FOUND = 'avatar_image_not_found'; - const AVATAR_REMOTE_URL_FAILED = 'avatar_remote_url_failed'; - const AVATAR_ICON_NOT_FOUND = 'avatar_icon_not_found'; + public const AVATAR_SET_NOT_FOUND = 'avatar_set_not_found'; + public const AVATAR_NOT_FOUND = 'avatar_not_found'; + public const AVATAR_IMAGE_NOT_FOUND = 'avatar_image_not_found'; + public const AVATAR_REMOTE_URL_FAILED = 'avatar_remote_url_failed'; + public const AVATAR_ICON_NOT_FOUND = 'avatar_icon_not_found'; /** Storage */ - const STORAGE_FILE_NOT_FOUND = 'storage_file_not_found'; - const STORAGE_DEVICE_NOT_FOUND = 'storage_device_not_found'; - const STORAGE_FILE_EMPTY = 'storage_file_empty'; - const STORAGE_FILE_TYPE_UNSUPPORTED = 'storage_file_type_unsupported'; - const STORAGE_INVALID_FILE_SIZE = 'storage_invalid_file_size'; - const STORAGE_INVALID_FILE = 'storage_invalid_file'; - const STORAGE_BUCKET_ALREADY_EXISTS = 'storage_bucket_already_exists'; - const STORAGE_BUCKET_NOT_FOUND = 'storage_bucket_not_found'; - const STORAGE_INVALID_CONTENT_RANGE = 'storage_invalid_content_range'; - const STORAGE_INVALID_RANGE = 'storage_invalid_range'; + public const STORAGE_FILE_NOT_FOUND = 'storage_file_not_found'; + public const STORAGE_DEVICE_NOT_FOUND = 'storage_device_not_found'; + public const STORAGE_FILE_EMPTY = 'storage_file_empty'; + public const STORAGE_FILE_TYPE_UNSUPPORTED = 'storage_file_type_unsupported'; + public const STORAGE_INVALID_FILE_SIZE = 'storage_invalid_file_size'; + public const STORAGE_INVALID_FILE = 'storage_invalid_file'; + public const STORAGE_BUCKET_ALREADY_EXISTS = 'storage_bucket_already_exists'; + public const STORAGE_BUCKET_NOT_FOUND = 'storage_bucket_not_found'; + public const STORAGE_INVALID_CONTENT_RANGE = 'storage_invalid_content_range'; + public const STORAGE_INVALID_RANGE = 'storage_invalid_range'; /** Functions */ - const FUNCTION_NOT_FOUND = 'function_not_found'; - const FUNCTION_RUNTIME_UNSUPPORTED = 'function_runtime_unsupported'; + public const FUNCTION_NOT_FOUND = 'function_not_found'; + public const FUNCTION_RUNTIME_UNSUPPORTED = 'function_runtime_unsupported'; /** Deployments */ - const DEPLOYMENT_NOT_FOUND = 'deployment_not_found'; + public const DEPLOYMENT_NOT_FOUND = 'deployment_not_found'; /** Builds */ - const BUILD_NOT_FOUND = 'build_not_found'; - const BUILD_NOT_READY = 'build_not_ready'; - const BUILD_IN_PROGRESS = 'build_in_progress'; + public const BUILD_NOT_FOUND = 'build_not_found'; + public const BUILD_NOT_READY = 'build_not_ready'; + public const BUILD_IN_PROGRESS = 'build_in_progress'; /** Execution */ - const EXECUTION_NOT_FOUND = 'execution_not_found'; + public const EXECUTION_NOT_FOUND = 'execution_not_found'; /** Collections */ - const COLLECTION_NOT_FOUND = 'collection_not_found'; - const COLLECTION_ALREADY_EXISTS = 'collection_already_exists'; - const COLLECTION_LIMIT_EXCEEDED = 'collection_limit_exceeded'; + public const COLLECTION_NOT_FOUND = 'collection_not_found'; + public const COLLECTION_ALREADY_EXISTS = 'collection_already_exists'; + public const COLLECTION_LIMIT_EXCEEDED = 'collection_limit_exceeded'; /** Documents */ - const DOCUMENT_NOT_FOUND = 'document_not_found'; - const DOCUMENT_INVALID_STRUCTURE = 'document_invalid_structure'; - const DOCUMENT_MISSING_PAYLOAD = 'document_missing_payload'; - const DOCUMENT_ALREADY_EXISTS = 'document_already_exists'; + public const DOCUMENT_NOT_FOUND = 'document_not_found'; + public const DOCUMENT_INVALID_STRUCTURE = 'document_invalid_structure'; + public const DOCUMENT_MISSING_PAYLOAD = 'document_missing_payload'; + public const DOCUMENT_ALREADY_EXISTS = 'document_already_exists'; /** Attribute */ - const ATTRIBUTE_NOT_FOUND = 'attribute_not_found'; - const ATTRIBUTE_UNKNOWN = 'attribute_unknown'; - const ATTRIBUTE_NOT_AVAILABLE = 'attribute_not_available'; - const ATTRIBUTE_FORMAT_UNSUPPORTED = 'attribute_format_unsupported'; - const ATTRIBUTE_DEFAULT_UNSUPPORTED = 'attribute_default_unsupported'; - const ATTRIBUTE_ALREADY_EXISTS = 'attribute_already_exists'; - const ATTRIBUTE_LIMIT_EXCEEDED = 'attribute_limit_exceeded'; - const ATTRIBUTE_VALUE_INVALID = 'attribute_value_invalid'; + public const ATTRIBUTE_NOT_FOUND = 'attribute_not_found'; + public const ATTRIBUTE_UNKNOWN = 'attribute_unknown'; + public const ATTRIBUTE_NOT_AVAILABLE = 'attribute_not_available'; + public const ATTRIBUTE_FORMAT_UNSUPPORTED = 'attribute_format_unsupported'; + public const ATTRIBUTE_DEFAULT_UNSUPPORTED = 'attribute_default_unsupported'; + public const ATTRIBUTE_ALREADY_EXISTS = 'attribute_already_exists'; + public const ATTRIBUTE_LIMIT_EXCEEDED = 'attribute_limit_exceeded'; + public const ATTRIBUTE_VALUE_INVALID = 'attribute_value_invalid'; /** Indexes */ - const INDEX_NOT_FOUND = 'index_not_found'; - const INDEX_LIMIT_EXCEEDED = 'index_limit_exceeded'; - const INDEX_ALREADY_EXISTS = 'index_already_exists'; + public const INDEX_NOT_FOUND = 'index_not_found'; + public const INDEX_LIMIT_EXCEEDED = 'index_limit_exceeded'; + public const INDEX_ALREADY_EXISTS = 'index_already_exists'; /** Projects */ - const PROJECT_NOT_FOUND = 'project_not_found'; - const PROJECT_UNKNOWN = 'project_unknown'; - const PROJECT_PROVIDER_DISABLED = 'project_provider_disabled'; - const PROJECT_PROVIDER_UNSUPPORTED = 'project_provider_unsupported'; - const PROJECT_INVALID_SUCCESS_URL = 'project_invalid_success_url'; - const PROJECT_INVALID_FAILURE_URL = 'project_invalid_failure_url'; - const PROJECT_MISSING_USER_ID = 'project_missing_user_id'; - const PROJECT_RESERVED_PROJECT = 'project_reserved_project'; + public const PROJECT_NOT_FOUND = 'project_not_found'; + public const PROJECT_UNKNOWN = 'project_unknown'; + public const PROJECT_PROVIDER_DISABLED = 'project_provider_disabled'; + public const PROJECT_PROVIDER_UNSUPPORTED = 'project_provider_unsupported'; + public const PROJECT_INVALID_SUCCESS_URL = 'project_invalid_success_url'; + public const PROJECT_INVALID_FAILURE_URL = 'project_invalid_failure_url'; + public const PROJECT_MISSING_USER_ID = 'project_missing_user_id'; + public const PROJECT_RESERVED_PROJECT = 'project_reserved_project'; /** Webhooks */ - const WEBHOOK_NOT_FOUND = 'webhook_not_found'; + public const WEBHOOK_NOT_FOUND = 'webhook_not_found'; /** Keys */ - const KEY_NOT_FOUND = 'key_not_found'; + public const KEY_NOT_FOUND = 'key_not_found'; /** Platform */ - const PLATFORM_NOT_FOUND = 'platform_not_found'; + public const PLATFORM_NOT_FOUND = 'platform_not_found'; /** Domain */ - const DOMAIN_NOT_FOUND = 'domain_not_found'; - const DOMAIN_ALREADY_EXISTS = 'domain_already_exists'; - const DOMAIN_VERIFICATION_FAILED = 'domain_verification_failed'; + public const DOMAIN_NOT_FOUND = 'domain_not_found'; + public const DOMAIN_ALREADY_EXISTS = 'domain_already_exists'; + public const DOMAIN_VERIFICATION_FAILED = 'domain_verification_failed'; private $type = ''; diff --git a/src/Appwrite/Resque/Worker.php b/src/Appwrite/Resque/Worker.php index 0b3e4db1a..84feb0f96 100644 --- a/src/Appwrite/Resque/Worker.php +++ b/src/Appwrite/Resque/Worker.php @@ -81,8 +81,8 @@ abstract class Worker throw new Exception("Please implement shutdown method in worker"); } - const DATABASE_PROJECT = 'project'; - const DATABASE_CONSOLE = 'console'; + public const DATABASE_PROJECT = 'project'; + public const DATABASE_CONSOLE = 'console'; /** * A wrapper around 'init' function with non-worker-specific code diff --git a/src/Appwrite/Utopia/Response.php b/src/Appwrite/Utopia/Response.php index baef255d4..8a876ecb4 100644 --- a/src/Appwrite/Utopia/Response.php +++ b/src/Appwrite/Utopia/Response.php @@ -76,116 +76,116 @@ use Appwrite\Utopia\Response\Model\UsageUsers; class Response extends SwooleResponse { // General - const MODEL_NONE = 'none'; - const MODEL_ANY = 'any'; - const MODEL_LOG = 'log'; - const MODEL_LOG_LIST = 'logList'; - const MODEL_ERROR = 'error'; - const MODEL_METRIC = 'metric'; - const MODEL_METRIC_LIST = 'metricList'; - const MODEL_ERROR_DEV = 'errorDev'; - const MODEL_BASE_LIST = 'baseList'; - const MODEL_USAGE_DATABASE = 'usageDatabase'; - const MODEL_USAGE_COLLECTION = 'usageCollection'; - const MODEL_USAGE_USERS = 'usageUsers'; - const MODEL_USAGE_BUCKETS = 'usageBuckets'; - const MODEL_USAGE_STORAGE = 'usageStorage'; - const MODEL_USAGE_FUNCTIONS = 'usageFunctions'; - const MODEL_USAGE_PROJECT = 'usageProject'; + public const MODEL_NONE = 'none'; + public const MODEL_ANY = 'any'; + public const MODEL_LOG = 'log'; + public const MODEL_LOG_LIST = 'logList'; + public const MODEL_ERROR = 'error'; + public const MODEL_METRIC = 'metric'; + public const MODEL_METRIC_LIST = 'metricList'; + public const MODEL_ERROR_DEV = 'errorDev'; + public const MODEL_BASE_LIST = 'baseList'; + public const MODEL_USAGE_DATABASE = 'usageDatabase'; + public const MODEL_USAGE_COLLECTION = 'usageCollection'; + public const MODEL_USAGE_USERS = 'usageUsers'; + public const MODEL_USAGE_BUCKETS = 'usageBuckets'; + public const MODEL_USAGE_STORAGE = 'usageStorage'; + public const MODEL_USAGE_FUNCTIONS = 'usageFunctions'; + public const MODEL_USAGE_PROJECT = 'usageProject'; // Database - const MODEL_COLLECTION = 'collection'; - const MODEL_COLLECTION_LIST = 'collectionList'; - const MODEL_INDEX = 'index'; - const MODEL_INDEX_LIST = 'indexList'; - const MODEL_DOCUMENT = 'document'; - const MODEL_DOCUMENT_LIST = 'documentList'; + public const MODEL_COLLECTION = 'collection'; + public const MODEL_COLLECTION_LIST = 'collectionList'; + public const MODEL_INDEX = 'index'; + public const MODEL_INDEX_LIST = 'indexList'; + public const MODEL_DOCUMENT = 'document'; + public const MODEL_DOCUMENT_LIST = 'documentList'; // Database Attributes - const MODEL_ATTRIBUTE = 'attribute'; - const MODEL_ATTRIBUTE_LIST = 'attributeList'; - const MODEL_ATTRIBUTE_STRING = 'attributeString'; - const MODEL_ATTRIBUTE_INTEGER = 'attributeInteger'; - const MODEL_ATTRIBUTE_FLOAT = 'attributeFloat'; - const MODEL_ATTRIBUTE_BOOLEAN = 'attributeBoolean'; - const MODEL_ATTRIBUTE_EMAIL = 'attributeEmail'; - const MODEL_ATTRIBUTE_ENUM = 'attributeEnum'; - const MODEL_ATTRIBUTE_IP = 'attributeIp'; - const MODEL_ATTRIBUTE_URL = 'attributeUrl'; + public const MODEL_ATTRIBUTE = 'attribute'; + public const MODEL_ATTRIBUTE_LIST = 'attributeList'; + public const MODEL_ATTRIBUTE_STRING = 'attributeString'; + public const MODEL_ATTRIBUTE_INTEGER = 'attributeInteger'; + public const MODEL_ATTRIBUTE_FLOAT = 'attributeFloat'; + public const MODEL_ATTRIBUTE_BOOLEAN = 'attributeBoolean'; + public const MODEL_ATTRIBUTE_EMAIL = 'attributeEmail'; + public const MODEL_ATTRIBUTE_ENUM = 'attributeEnum'; + public const MODEL_ATTRIBUTE_IP = 'attributeIp'; + public const MODEL_ATTRIBUTE_URL = 'attributeUrl'; // Users - const MODEL_USER = 'user'; - const MODEL_USER_LIST = 'userList'; - const MODEL_SESSION = 'session'; - const MODEL_SESSION_LIST = 'sessionList'; - const MODEL_TOKEN = 'token'; - const MODEL_JWT = 'jwt'; - const MODEL_PREFERENCES = 'preferences'; + public const MODEL_USER = 'user'; + public const MODEL_USER_LIST = 'userList'; + public const MODEL_SESSION = 'session'; + public const MODEL_SESSION_LIST = 'sessionList'; + public const MODEL_TOKEN = 'token'; + public const MODEL_JWT = 'jwt'; + public const MODEL_PREFERENCES = 'preferences'; // Storage - const MODEL_FILE = 'file'; - const MODEL_FILE_LIST = 'fileList'; - const MODEL_BUCKET = 'bucket'; - const MODEL_BUCKET_LIST = 'bucketList'; + public const MODEL_FILE = 'file'; + public const MODEL_FILE_LIST = 'fileList'; + public const MODEL_BUCKET = 'bucket'; + public const MODEL_BUCKET_LIST = 'bucketList'; // Locale - const MODEL_LOCALE = 'locale'; - const MODEL_COUNTRY = 'country'; - const MODEL_COUNTRY_LIST = 'countryList'; - const MODEL_CONTINENT = 'continent'; - const MODEL_CONTINENT_LIST = 'continentList'; - const MODEL_CURRENCY = 'currency'; - const MODEL_CURRENCY_LIST = 'currencyList'; - const MODEL_LANGUAGE = 'language'; - const MODEL_LANGUAGE_LIST = 'languageList'; - const MODEL_PHONE = 'phone'; - const MODEL_PHONE_LIST = 'phoneList'; + public const MODEL_LOCALE = 'locale'; + public const MODEL_COUNTRY = 'country'; + public const MODEL_COUNTRY_LIST = 'countryList'; + public const MODEL_CONTINENT = 'continent'; + public const MODEL_CONTINENT_LIST = 'continentList'; + public const MODEL_CURRENCY = 'currency'; + public const MODEL_CURRENCY_LIST = 'currencyList'; + public const MODEL_LANGUAGE = 'language'; + public const MODEL_LANGUAGE_LIST = 'languageList'; + public const MODEL_PHONE = 'phone'; + public const MODEL_PHONE_LIST = 'phoneList'; // Teams - const MODEL_TEAM = 'team'; - const MODEL_TEAM_LIST = 'teamList'; - const MODEL_MEMBERSHIP = 'membership'; - const MODEL_MEMBERSHIP_LIST = 'membershipList'; + public const MODEL_TEAM = 'team'; + public const MODEL_TEAM_LIST = 'teamList'; + public const MODEL_MEMBERSHIP = 'membership'; + public const MODEL_MEMBERSHIP_LIST = 'membershipList'; // Functions - const MODEL_FUNCTION = 'function'; - const MODEL_FUNCTION_LIST = 'functionList'; - const MODEL_RUNTIME = 'runtime'; - const MODEL_RUNTIME_LIST = 'runtimeList'; - const MODEL_DEPLOYMENT = 'deployment'; - const MODEL_DEPLOYMENT_LIST = 'deploymentList'; - const MODEL_EXECUTION = 'execution'; - const MODEL_EXECUTION_LIST = 'executionList'; - const MODEL_BUILD = 'build'; - const MODEL_BUILD_LIST = 'buildList'; // Not used anywhere yet - const MODEL_FUNC_PERMISSIONS = 'funcPermissions'; + public const MODEL_FUNCTION = 'function'; + public const MODEL_FUNCTION_LIST = 'functionList'; + public const MODEL_RUNTIME = 'runtime'; + public const MODEL_RUNTIME_LIST = 'runtimeList'; + public const MODEL_DEPLOYMENT = 'deployment'; + public const MODEL_DEPLOYMENT_LIST = 'deploymentList'; + public const MODEL_EXECUTION = 'execution'; + public const MODEL_EXECUTION_LIST = 'executionList'; + public const MODEL_BUILD = 'build'; + public const MODEL_BUILD_LIST = 'buildList'; // Not used anywhere yet + public const MODEL_FUNC_PERMISSIONS = 'funcPermissions'; // Project - const MODEL_PROJECT = 'project'; - const MODEL_PROJECT_LIST = 'projectList'; - const MODEL_WEBHOOK = 'webhook'; - const MODEL_WEBHOOK_LIST = 'webhookList'; - const MODEL_KEY = 'key'; - const MODEL_KEY_LIST = 'keyList'; - const MODEL_PLATFORM = 'platform'; - const MODEL_PLATFORM_LIST = 'platformList'; - const MODEL_DOMAIN = 'domain'; - const MODEL_DOMAIN_LIST = 'domainList'; + public const MODEL_PROJECT = 'project'; + public const MODEL_PROJECT_LIST = 'projectList'; + public const MODEL_WEBHOOK = 'webhook'; + public const MODEL_WEBHOOK_LIST = 'webhookList'; + public const MODEL_KEY = 'key'; + public const MODEL_KEY_LIST = 'keyList'; + public const MODEL_PLATFORM = 'platform'; + public const MODEL_PLATFORM_LIST = 'platformList'; + public const MODEL_DOMAIN = 'domain'; + public const MODEL_DOMAIN_LIST = 'domainList'; // Health - const MODEL_HEALTH_STATUS = 'healthStatus'; - const MODEL_HEALTH_VERSION = 'healthVersion'; - const MODEL_HEALTH_QUEUE = 'healthQueue'; - const MODEL_HEALTH_TIME = 'healthTime'; - const MODEL_HEALTH_ANTIVIRUS = 'healthAntivirus'; + public const MODEL_HEALTH_STATUS = 'healthStatus'; + public const MODEL_HEALTH_VERSION = 'healthVersion'; + public const MODEL_HEALTH_QUEUE = 'healthQueue'; + public const MODEL_HEALTH_TIME = 'healthTime'; + public const MODEL_HEALTH_ANTIVIRUS = 'healthAntivirus'; // Deprecated - const MODEL_PERMISSIONS = 'permissions'; - const MODEL_RULE = 'rule'; - const MODEL_TASK = 'task'; + public const MODEL_PERMISSIONS = 'permissions'; + public const MODEL_RULE = 'rule'; + public const MODEL_TASK = 'task'; // Tests (keep last) - const MODEL_MOCK = 'mock'; + public const MODEL_MOCK = 'mock'; /** * @var Filter @@ -302,7 +302,7 @@ class Response extends SwooleResponse /** * HTTP content types */ - const CONTENT_TYPE_YAML = 'application/x-yaml'; + public const CONTENT_TYPE_YAML = 'application/x-yaml'; /** * List of defined output objects diff --git a/src/Appwrite/Utopia/Response/Model.php b/src/Appwrite/Utopia/Response/Model.php index 6aefe1fc9..6407c8511 100644 --- a/src/Appwrite/Utopia/Response/Model.php +++ b/src/Appwrite/Utopia/Response/Model.php @@ -6,11 +6,11 @@ use Utopia\Database\Document; abstract class Model { - const TYPE_STRING = 'string'; - const TYPE_INTEGER = 'integer'; - const TYPE_FLOAT = 'double'; - const TYPE_BOOLEAN = 'boolean'; - const TYPE_JSON = 'json'; + public const TYPE_STRING = 'string'; + public const TYPE_INTEGER = 'integer'; + public const TYPE_FLOAT = 'double'; + public const TYPE_BOOLEAN = 'boolean'; + public const TYPE_JSON = 'json'; /** * @var bool diff --git a/src/Executor/Executor.php b/src/Executor/Executor.php index fa17ce2a8..82b09ffe6 100644 --- a/src/Executor/Executor.php +++ b/src/Executor/Executor.php @@ -8,15 +8,15 @@ use Utopia\CLI\Console; class Executor { - const METHOD_GET = 'GET'; - const METHOD_POST = 'POST'; - const METHOD_PUT = 'PUT'; - const METHOD_PATCH = 'PATCH'; - const METHOD_DELETE = 'DELETE'; - const METHOD_HEAD = 'HEAD'; - const METHOD_OPTIONS = 'OPTIONS'; - const METHOD_CONNECT = 'CONNECT'; - const METHOD_TRACE = 'TRACE'; + public const METHOD_GET = 'GET'; + public const METHOD_POST = 'POST'; + public const METHOD_PUT = 'PUT'; + public const METHOD_PATCH = 'PATCH'; + public const METHOD_DELETE = 'DELETE'; + public const METHOD_HEAD = 'HEAD'; + public const METHOD_OPTIONS = 'OPTIONS'; + public const METHOD_CONNECT = 'CONNECT'; + public const METHOD_TRACE = 'TRACE'; private $endpoint; From 3b14ccb7d480ccf484d1328a1f673fe201fe0203 Mon Sep 17 00:00:00 2001 From: Everly Precia Suresh Date: Thu, 2 Jun 2022 13:09:04 +0000 Subject: [PATCH 36/44] fix linting issues --- app/workers/audits.php | 2 ++ composer.lock | 42 ++++++++++++++++++------------------ src/Appwrite/Event/Event.php | 2 +- 3 files changed, 24 insertions(+), 22 deletions(-) diff --git a/app/workers/audits.php b/app/workers/audits.php index 696eb6df5..bb36876aa 100644 --- a/app/workers/audits.php +++ b/app/workers/audits.php @@ -1,5 +1,7 @@ !\is_array($param)); $paramKeys = \array_keys($params); From 02838cc1b2d8e89d55bb5a67bf083cc40ef5fdae Mon Sep 17 00:00:00 2001 From: Everly Precia Suresh Date: Thu, 2 Jun 2022 13:36:51 +0000 Subject: [PATCH 37/44] Remove namespace --- app/workers/audits.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/app/workers/audits.php b/app/workers/audits.php index bb36876aa..696eb6df5 100644 --- a/app/workers/audits.php +++ b/app/workers/audits.php @@ -1,7 +1,5 @@ Date: Thu, 2 Jun 2022 14:10:55 +0000 Subject: [PATCH 38/44] add rule to exclude namespace --- phpcs.xml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/phpcs.xml b/phpcs.xml index 550678584..e9131c8f4 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -15,4 +15,8 @@ * + + + ./app/workers + \ No newline at end of file From 5a8bbf6457842eccea52c5ed37a126bf223b279b Mon Sep 17 00:00:00 2001 From: Everly Precia Suresh Date: Thu, 2 Jun 2022 14:20:15 +0000 Subject: [PATCH 39/44] add rule to exclude namespace --- phpcs.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/phpcs.xml b/phpcs.xml index e9131c8f4..cb31d549e 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -15,8 +15,8 @@ * - + - ./app/workers + ./app \ No newline at end of file From 4830f89ed3ce8f7d31ae220e6b47039404a6e656 Mon Sep 17 00:00:00 2001 From: Chuong Tang Date: Thu, 2 Jun 2022 08:38:33 -0600 Subject: [PATCH 40/44] Added webm into mimeType and previewType --- app/config/storage/logos.php | 1 + app/config/storage/mimes.php | 1 + 2 files changed, 2 insertions(+) diff --git a/app/config/storage/logos.php b/app/config/storage/logos.php index 8816611ed..d87019826 100644 --- a/app/config/storage/logos.php +++ b/app/config/storage/logos.php @@ -7,6 +7,7 @@ return [ // Based on this list @see http://stackoverflow.com/a/4212908/2299554 // Video Files 'video/mp4' => __DIR__.'/logos/video.png', 'video/x-flv' => __DIR__.'/logos/video.png', + 'video/webm' => __DIR__.'/logos/video.png', 'application/x-mpegURL' => __DIR__.'/logos/video.png', 'video/MP2T' => __DIR__.'/logos/video.png', 'video/3gpp' => __DIR__.'/logos/video.png', diff --git a/app/config/storage/mimes.php b/app/config/storage/mimes.php index 7995ef368..1c732307d 100644 --- a/app/config/storage/mimes.php +++ b/app/config/storage/mimes.php @@ -10,6 +10,7 @@ return [ // Video Files 'video/mp4', 'video/x-flv', + 'video/webm', 'application/x-mpegURL', 'video/MP2T', 'video/3gpp', From 616e813229f6cdbd6c24c41a89124e1cdfa6d1c1 Mon Sep 17 00:00:00 2001 From: Everly Precia Suresh Date: Thu, 2 Jun 2022 22:18:42 +0000 Subject: [PATCH 41/44] add comment when fall-through is intentional in a non-empty case body --- .github/workflows/linter.yml | 2 +- src/Appwrite/Migration/Version/V13.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index a185f3fcd..2c98d11b8 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -31,4 +31,4 @@ jobs: args: --profile --ignore-platform-reqs - name: Run Linter - run: ./vendor/bin/phpcs -p || true + run: ./vendor/bin/phpcs -p diff --git a/src/Appwrite/Migration/Version/V13.php b/src/Appwrite/Migration/Version/V13.php index 277b84ae9..d204be84f 100644 --- a/src/Appwrite/Migration/Version/V13.php +++ b/src/Appwrite/Migration/Version/V13.php @@ -319,7 +319,7 @@ class V13 extends Migration return 'buckets.*.' . implode('.', $parts); case 'files': return 'buckets.*.' . $second . '.*.' . implode('.', $parts); - } + } // intentional fallthrough case 'database': $second = array_shift($parts); switch ($second) { From ee07af85fc914f6585f809de5f3182e04dc03c22 Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Fri, 3 Jun 2022 12:27:46 +0200 Subject: [PATCH 42/44] Update storage.md --- docs/services/storage.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/services/storage.md b/docs/services/storage.md index 5b046d318..0e2f7c6ea 100644 --- a/docs/services/storage.md +++ b/docs/services/storage.md @@ -4,4 +4,4 @@ Each file in the service is granted with read and write permissions to manage wh The preview endpoint allows you to generate preview images for your files. Using the preview endpoint, you can also manipulate the resulting image so that it will fit perfectly inside your app in terms of dimensions, file size, and style. The preview endpoint also allows you to change the resulting image file format for better compression or image quality for better delivery over the network. -The maximum file size allowed for file upload is controlled by the `_APP_STORAGE_LIMIT` environment variable, which defaults to 10 MB. See [Environment Variables](/docs/environment-variables#storage) for more information. +The maximum file size allowed for file upload is controlled by the `_APP_STORAGE_LIMIT` environment variable, which defaults to 30 MB. See [Environment Variables](/docs/environment-variables#storage) for more information. From d9f53d6e23dc87a38f508a094d91a6a7eb0d8f50 Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Fri, 3 Jun 2022 12:34:44 +0200 Subject: [PATCH 43/44] Update realtime.php --- app/realtime.php | 1 + 1 file changed, 1 insertion(+) diff --git a/app/realtime.php b/app/realtime.php index afe4a2756..7f3264f31 100644 --- a/app/realtime.php +++ b/app/realtime.php @@ -186,6 +186,7 @@ $server->onStart(function () use ($stats, $register, $containerId, &$statsDocume }); }); +$server->onWorkerStart(function (int $workerId) use ($server, $register, $stats, $realtime, $logError) { Console::success('Worker ' . $workerId . ' started successfully'); $attempts = 0; From a456634324cdb57c9832e6e0546c0b7ef011a6d3 Mon Sep 17 00:00:00 2001 From: Everly Precia Suresh Date: Mon, 6 Jun 2022 13:32:58 +0000 Subject: [PATCH 44/44] fix linter issues --- app/config/storage/logos.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/app/config/storage/logos.php b/app/config/storage/logos.php index 70e73208b..9db909653 100644 --- a/app/config/storage/logos.php +++ b/app/config/storage/logos.php @@ -6,15 +6,15 @@ return [ // Based on this list @see http://stackoverflow.com/a/4212908/2299554 // Video Files - 'video/mp4' => __DIR__.'/logos/video.png', - 'video/x-flv' => __DIR__.'/logos/video.png', - 'video/webm' => __DIR__.'/logos/video.png', - 'application/x-mpegURL' => __DIR__.'/logos/video.png', - 'video/MP2T' => __DIR__.'/logos/video.png', - 'video/3gpp' => __DIR__.'/logos/video.png', - 'video/quicktime' => __DIR__.'/logos/video.png', - 'video/x-msvideo' => __DIR__.'/logos/video.png', - 'video/x-ms-wmv' => __DIR__.'/logos/video.png', + 'video/mp4' => __DIR__ . '/logos/video.png', + 'video/x-flv' => __DIR__ . '/logos/video.png', + 'video/webm' => __DIR__ . '/logos/video.png', + 'application/x-mpegURL' => __DIR__ . '/logos/video.png', + 'video/MP2T' => __DIR__ . '/logos/video.png', + 'video/3gpp' => __DIR__ . '/logos/video.png', + 'video/quicktime' => __DIR__ . '/logos/video.png', + 'video/x-msvideo' => __DIR__ . '/logos/video.png', + 'video/x-ms-wmv' => __DIR__ . '/logos/video.png',