Skip to content

Commit

Permalink
Increased minimum php version to 8.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Geolim4 committed Jan 11, 2024
1 parent 37b2643 commit 3821ce3
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
strategy:
matrix:
operating-system: [ubuntu-latest]
php-versions: ['8.0', '8.1', '8.2', '8.3']
php-versions: ['8.1', '8.2', '8.3']
name: PHP ${{ matrix.php-versions }} quality/tests on ${{ matrix.operating-system }}
env:
key: cache-v1
Expand Down
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ composer install phpfastcache/ravendb-extension
```

#### ⚠️ This extension requires:
1️ The composer `ravendb/ravendb-php-client` library `5.2` at least.
1️ The composer `ravendb/ravendb-php-client` library `5.2.2` at least.

2️⃣ PHP **8.1** at least due to `ravendb/ravendb-php-client` limitations.


## Events
This driver is currently not emitting [customs events](https://github.com/PHPSocialNetwork/phpfastcache/blob/master/docs/EVENTS.md):
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
}
],
"require": {
"php": ">=8.0",
"php": ">=8.1",
"phpfastcache/phpfastcache": "^9.2.2",
"ravendb/ravendb-php-client": "^5.2"
"ravendb/ravendb-php-client": "^5.2.2"
},
"require-dev": {
"phpmd/phpmd": "@stable",
Expand Down
17 changes: 3 additions & 14 deletions lib/Phpfastcache/Extensions/Drivers/Ravendb/Driver.php
Original file line number Diff line number Diff line change
Expand Up @@ -231,21 +231,10 @@ protected function driverDelete(string $key, string $encodedKey): bool
*/
protected function driverDeleteMultiple(array $keys): bool
{
$this->documentStorage->operations()->send(
new DeleteByQueryOperation(
new IndexQuery(
sprintf(
"from %s where id() IN ('%s')",
$this->getConfig()->getCollectionName(),
implode("', '", array_map(fn (string $key) => $this->documentPrefix . $key, $keys))
)
)
)
);

foreach ($keys as $key) {
$this->instance->documentsById->remove($this->documentPrefix . $key);
$this->instance->delete($this->documentPrefix . $key);
}
$this->instance->saveChanges();

return true;
}
Expand All @@ -256,7 +245,7 @@ protected function driverDeleteMultiple(array $keys): bool
protected function driverClear(): bool
{
$this->documentStorage->operations()->send(
new DeleteByQueryOperation(new IndexQuery(sprintf("from %s", $this->getConfig()->getCollectionName())))
new DeleteByQueryOperation(new IndexQuery(sprintf('from %s', $this->getConfig()->getCollectionName())))
);

$this->instance->clear();
Expand Down

0 comments on commit 3821ce3

Please sign in to comment.