Skip to content

Commit 1379148

Browse files
committed
feat: redis cache option
1 parent 4bbc67e commit 1379148

File tree

6 files changed

+557
-406
lines changed

6 files changed

+557
-406
lines changed

README.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,14 @@ $imdb->film("tt0816692");
3434

3535
### Options
3636

37-
| Name | Type | Default Value | Description |
38-
| ------------- | ------ | ------------------------------------- | --------------------------------------------------------------------------------------------- |
39-
| `curlHeaders` | array | `['Accept-Language: en-US,en;q=0.5']` | Custom headers can be passed to `cURL` when fetching the IMDB page |
40-
| `cache` | bool | `true` | Caches film data to speed-up future requests for the same film |
41-
| `techSpecs` | bool | `true` | Loads a films technical specifications (this will take longer as it makes a separate request) |
42-
| `category` | string | `all` | What category to search for (films `tt`, people `nm` or companies `co`) |
37+
| Name | Type | Default Value | Description |
38+
| ------------- | ------ | ------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- |
39+
| `curlHeaders` | array | `['Accept-Language: en-US,en;q=0.5']` | Custom headers can be passed to `cURL` when fetching the IMDB page |
40+
| `cache` | bool | `true` | Caches film data to speed-up future requests for the same film |
41+
| `cacheType` | string | `file` or `redis` | Choose how the caching is done. Either a local file database, or connect to a redis server |
42+
| `cacheRedis` | array | `[ 'scheme' => 'tcp', 'host' => '127.0.0.1', 'port' => 6379, 'password' => '', 'database' => 0 ]` | Redis options |
43+
| `techSpecs` | bool | `true` | Loads a films technical specifications (this will take longer as it makes a separate request) |
44+
| `category` | string | `all` | What category to search for (films `tt`, people `nm` or companies `co`) |
4345

4446
```php
4547
$imdb = new Imdb;

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
"require": {
1414
"php": ">=7.1",
1515
"paquettg/php-html-parser": "^2.1",
16-
"tmarois/filebase": "^1.0"
16+
"tmarois/filebase": "^1.0",
17+
"predis/predis": "^2.2"
1718
},
1819
"require-dev": {
1920
"phpunit/phpunit": "9.5.16",

0 commit comments

Comments
 (0)