Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run oauth tests always and update docs #133

Merged
merged 3 commits into from
Aug 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
68 changes: 16 additions & 52 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
<?php
// app/AppKernel.php
<?php // bundles.php

public function registerBundles()
{
$bundles = array(
// ...
new Noxlogic\RateLimitBundle\NoxlogicRateLimitBundle(),
);
}
return [
// ..
Noxlogic\RateLimitBundle\NoxlogicRateLimitBundle::class => ['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`:

Expand Down Expand Up @@ -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
7 changes: 6 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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.",
Expand All @@ -32,5 +32,10 @@
"psr-4": {
"Noxlogic\\RateLimitBundle\\": ""
}
},
"extra": {
"branch-alias": {
"dev-main": "2.x-dev"
}
}
}
Loading