From 02bc2f639081fcc0ed9a32db4d97f5ce020dc2ac Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Tue, 31 May 2022 17:09:45 +0200 Subject: [PATCH 01/18] 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 0000000000..a18e227207 --- /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 8bef73637f..685b4948b1 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 0000000000..d4efd6f52b --- /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 02/18] 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 c1d3bb73fb..0b9879b649 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 d4efd6f52b..3f38d29d50 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 03/18] 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 a18e227207..90931e53a7 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 04/18] 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 90931e53a7..dcfd27f2f6 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 05/18] 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 dcfd27f2f6..e5e191592c 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 06/18] 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 e5e191592c..a185f3fcde 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 07/18] linter: exclude max line width rule --- phpcs.xml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/phpcs.xml b/phpcs.xml index 3f38d29d50..9c8ced28ef 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -7,4 +7,8 @@ ./app/sdks + + + * + \ No newline at end of file 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 08/18] 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 ae04e7732e..e1e0b868f0 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 09/18] Update CONTRIBUTING.md --- CONTRIBUTING.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e1e0b868f0..d41ead9040 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 10/18] Update CONTRIBUTING.md --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d41ead9040..44546bcce8 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 11/18] update code maintenance section --- CONTRIBUTING.md | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 44546bcce8..5a16daa353 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 12/18] 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 5a16daa353..1a5ceb8913 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 0c2919129a..6ce1bd218f 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 685b4948b1..df0981a8ce 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 fd34920d62..b6e1ed68b2 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 30258a7095..0000000000 --- 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 13/18] Update CONTRIBUTING.md --- CONTRIBUTING.md | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1a5ceb8913..aa7152a64e 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 14/18] Update CONTRIBUTING.md --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index aa7152a64e..7d8f11a539 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 15/18] lint: add new rule --- phpcs.xml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/phpcs.xml b/phpcs.xml index 9c8ced28ef..550678584f 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 16/18] style: format contributing guide --- CONTRIBUTING.md | 147 ++++++++++++++++++++++++++---------------------- 1 file changed, 80 insertions(+), 67 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7d8f11a539..e59e7e8a42 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 17/18] docs: update some phrases --- CONTRIBUTING.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e59e7e8a42..0e0cedeb98 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 18/18] docs: update phrase --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 0e0cedeb98..b8f13b3538 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 ```