From 894bae8f9a68db792cae23d960b5b1e99a37db35 Mon Sep 17 00:00:00 2001 From: Asmir Mustafic Date: Mon, 14 Aug 2023 10:02:33 +0200 Subject: [PATCH 1/3] oauth --- .github/workflows/ci.yml | 6 +++--- composer.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 873e568..ec708ee 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,7 +12,7 @@ jobs: matrix: php: [ "8.0", "8.1", "8.2" ] composer_flags: [ "", "--prefer-lowest" ] - symfony_version: [ "^5.4", "^6.1"] + symfony_version: [ "^5.4", "^6.1" ] exclude: - php: "8.0" symfony_version: "^6.1" @@ -38,13 +38,13 @@ jobs: run: | composer self-update if [ "$SYMFONY_VERSION" != "" ]; then composer require "symfony/symfony:${SYMFONY_VERSION}" --no-update; fi; - if [ "$SYMFONY_VERSION" = "^5.4" ] || [ "$SYMFONY_VERSION" = "^6.3" ] || [ "$PHP_VERSION" = "8.0" ] || [ "$PHP_VERSION" = "8.1" ] || [ "$PHP_VERSION" = "8.2" ]; then composer remove --dev "friendsofsymfony/oauth-server-bundle" --no-update; fi; + if [ "$SYMFONY_VERSION" = "^6.1" ]; then composer remove --dev "friendsofsymfony/oauth-server-bundle" --no-update; fi; COMPOSER_MEMORY_LIMIT=-1 composer update --prefer-dist --no-interaction $COMPOSER_FLAGS - name: Run tests run: | SYMFONY_DEPRECATIONS_HELPER=weak vendor/bin/simple-phpunit --coverage-text --coverage-clover=coverage.clover - name: Upload coverage - if: ${{ matrix.php == '8.1' && github.repository == 'jaytaph/RateLimitBundle' }} + if: ${{ matrix.php == '8.2' && github.repository == 'jaytaph/RateLimitBundle' }} uses: sudo-bot/action-scrutinizer@latest with: cli-args: "--format=php-clover coverage.clover" diff --git a/composer.json b/composer.json index 008b27f..47c9fc7 100644 --- a/composer.json +++ b/composer.json @@ -20,7 +20,7 @@ "doctrine/cache": "^1.5", "psr/cache": "^1.0|^2.0", "predis/predis": "^0.8|^1.1|^2.0", - "friendsofsymfony/oauth-server-bundle": "^1.5" + "friendsofsymfony/oauth-server-bundle": "^1.5|^2.0@dev" }, "suggest": { "snc/redis-bundle": "Use Redis as a storage engine.", From a6f376dbc052d4fcc15937bc6a182acd680d30d7 Mon Sep 17 00:00:00 2001 From: Asmir Mustafic Date: Mon, 14 Aug 2023 10:24:02 +0200 Subject: [PATCH 2/3] some updates on the docs --- README.md | 68 +++++++++++++------------------------------------------ 1 file changed, 16 insertions(+), 52 deletions(-) diff --git a/README.md b/README.md index bd3af2c..a4bc904 100755 --- a/README.md +++ b/README.md @@ -24,57 +24,45 @@ This bundle is partially inspired by a GitHub gist from Ruud Kamphuis: https://g Installation takes just few easy steps: -### Step 1: Add the bundle to your composer.json +### Step 1: Install the bundle using composer If you're not yet familiar with Composer see http://getcomposer.org. -Add the NoxlogicRateLimitBundle in your composer.json: - -```json -{ - "require": { - "noxlogic/ratelimit-bundle": "2.x" - } -} -``` - -Now tell composer to download the bundle by running the command: +Tell composer to download the bundle by running the command: ``` bash -php composer.phar update noxlogic/ratelimit-bundle +composer require noxlogic/ratelimit-bundle ``` ### Step 2: Enable the bundle -Enable the bundle in the kernel: +If you are using `symfony/flex` you can skip this step, the bundle will be enabled automatically, +otherwise you need to enable the bundle by adding it to the `bundles.php` file of your project. ``` php - ['all' => true], + // .. +]; ``` -## Step 3: Install a storage engine +### Step 3: Install a storage engine -### Redis +#### Redis If you want to use Redis as your storage engine, you might want to install `SncRedisBundle`: * https://github.com/snc/SncRedisBundle -### Memcache +#### Memcache If you want to use Memcache, you might want to install `LswMemcacheBundle` * https://github.com/LeaseWeb/LswMemcacheBundle -### Doctrine cache +#### Doctrine cache If you want to use Doctrine cache as your storage engine, you might want to install `DoctrineCacheBundle`: @@ -296,29 +284,5 @@ allows you to easily handle the rate limit on another level, for instance by cap If you want to run the tests use: ``` -./vendor/bin/phpunit ./Tests +./vendor/bin/simple-phpunit ``` - - - - - - - - - - - - - - - - - - - - - - - -https://github.com/jaytaph/RateLimitBundle/issues/130 \ No newline at end of file From 3e07f27216696caa75620b2c7cd416999a45345f Mon Sep 17 00:00:00 2001 From: Asmir Mustafic Date: Mon, 14 Aug 2023 10:26:33 +0200 Subject: [PATCH 3/3] add branch alias --- composer.json | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/composer.json b/composer.json index 47c9fc7..8a6998e 100644 --- a/composer.json +++ b/composer.json @@ -32,5 +32,10 @@ "psr-4": { "Noxlogic\\RateLimitBundle\\": "" } + }, + "extra": { + "branch-alias": { + "dev-main": "2.x-dev" + } } }