Skip to content

Commit 4334d0f

Browse files
feat(*): Prepare release 0.26.0
1 parent 6c2f24c commit 4334d0f

File tree

6 files changed

+13
-3
lines changed

6 files changed

+13
-3
lines changed

CHANGELOG.md

+8
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,14 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/)
55
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
66

77

8+
## [0.26.0] - 2022-07-28
9+
10+
### Changed
11+
- *Breaking change*: Modify all constructors (`Bouncer`, `ApiCache`, `ApiClient`, `RestClient`) to use only
12+
configurations and logger as parameters
13+
- Use `shouldBounceCurrentIp` method of Standalone before bouncer instantiation
14+
- Modify logger constructor
15+
816
## [0.25.0] - 2022-07-22
917

1018
### Added

scripts/auto-prepend/refresh-cache.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
}elseif($crowdSecStandaloneBouncerConfig['bouncing_level'] === 'flex_boucing'){
1717
$crowdSecStandaloneBouncerConfig['bouncing_level'] = 'flex_bouncing';
1818
}
19-
19+
$bounce->initLogger($crowdSecStandaloneBouncerConfig);
2020
$bouncer = $bounce->init($crowdSecStandaloneBouncerConfig);
2121
$bouncer->refreshBlocklistCache();
2222
echo 'Cache has been refreshed'.PHP_EOL;

src/Constants.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class Constants
2020
public const DEFAULT_LAPI_URL = 'http://localhost:8080';
2121

2222
/** @var string The last version of this library */
23-
public const VERSION = 'v0.25.0';
23+
public const VERSION = 'v0.26.0';
2424

2525
/** @var string The user agent used to send request to LAPI */
2626
public const BASE_USER_AGENT = 'PHP CrowdSec Bouncer/' . self::VERSION;

src/StandaloneBounce.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -363,8 +363,8 @@ public function safelyBounce(array $configs): bool
363363
if ($this->shouldBounceCurrentIp()) {
364364
$this->init($configs);
365365
$this->run();
366+
$result = true;
366367
}
367-
$result = true;
368368
} catch (Exception $e) {
369369
if ($this->logger) {
370370
$this->logger->error('', [

tests/end-to-end/php-scripts/cache-actions.php.dist

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ if (isset($_GET['action']) && in_array($_GET['action'],['refresh', 'clear', 'pru
1313
$action = $_GET['action'];
1414
$bounce = new StandaloneBounce();
1515
/** @var $crowdSecStandaloneBouncerConfig */
16+
$bounce->initLogger($crowdSecStandaloneBouncerConfig);
1617
$bouncer = $bounce->init($crowdSecStandaloneBouncerConfig);
1718
switch ($action) {
1819
case 'refresh':

tests/end-to-end/php-scripts/geolocation-test.php.dist

+1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ if (isset($_GET['ip'])) {
3030
$bounce = new StandaloneBounce();
3131
/** @var $crowdSecStandaloneBouncerConfig */
3232
$finalConfig = array_merge($crowdSecStandaloneBouncerConfig, ['geolocation' => $geolocConfig]);
33+
$bounce->initLogger($finalConfig);
3334
$bouncer = $bounce->init($finalConfig);
3435
$apiCache = $bouncer->getApiCache();
3536

0 commit comments

Comments
 (0)