Skip to content

Commit 2f472a3

Browse files
committed
updated
1 parent c9deb52 commit 2f472a3

File tree

4 files changed

+25
-10
lines changed

4 files changed

+25
-10
lines changed

.travis.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ env:
66
global:
77
- DOCKER_COMPOSE_VERSION=1.23.2
88
matrix:
9-
- HHVM_VERSION=4.4.0
109
- HHVM_VERSION=4.5.0
1110
- HHVM_VERSION=4.6.0
1211
- HHVM_VERSION=4.7.0
@@ -16,7 +15,14 @@ env:
1615
- HHVM_VERSION=4.11.0
1716
- HHVM_VERSION=4.12.0
1817
- HHVM_VERSION=4.13.0
19-
- HHVM_VERSION=4.14.0
18+
- HHVM_VERSION=4.14.1
19+
- HHVM_VERSION=4.15.1
20+
- HHVM_VERSION=4.16.2
21+
- HHVM_VERSION=4.17.1
22+
- HHVM_VERSION=4.18.1
23+
- HHVM_VERSION=4.19.0
24+
- HHVM_VERSION=4.20.1
25+
- HHVM_VERSION=4.21.0
2026
- HHVM_VERSION=latest
2127
before_install:
2228
- sudo rm /usr/local/bin/docker-compose

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55
## Installation
66

77
```bash
8-
$ hhvm -d xdebug.enable=0 -d hhvm.jit=0 -d hhvm.php7.all=1\
9-
-d hhvm.hack.lang.auto_typecheck=0 $(which composer) require nazg/hcache
8+
$ composer require nazg/hcache
109
```
1110

1211
## Usage

src/Driver/ApcCache.hack

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,31 +17,41 @@ namespace Nazg\HCache\Driver;
1717

1818
use type Nazg\HCache\Element;
1919
use type Nazg\HCache\CacheProvider;
20+
use function apc_fetch;
21+
use function apc_exists;
22+
use function apc_store;
23+
use function apc_delete;
24+
use function apc_clear_cache;
2025

2126
class ApcCache extends CacheProvider {
2227

2328
<<__Override>>
2429
public function fetch(string $id): mixed {
25-
return \apc_fetch($id);
30+
$success = true;
31+
$result = apc_fetch($id, inout $success);
32+
if ($success) {
33+
return $result;
34+
}
35+
return null;
2636
}
2737

2838
<<__Override>>
2939
public function contains(string $id): bool {
30-
return \apc_exists($id);
40+
return apc_exists($id);
3141
}
3242

3343
<<__Override>>
3444
public function save(string $id, Element $element): bool {
35-
return \apc_store($id, $element->getData(), $element->getLifetime());
45+
return apc_store($id, $element->getData(), $element->getLifetime());
3646
}
3747

3848
<<__Override>>
3949
public function delete(string $id): bool {
40-
return \apc_delete($id);
50+
return apc_delete($id);
4151
}
4252

4353
<<__Override>>
4454
public function flushAll(): bool {
45-
return \apc_clear_cache() && \apc_clear_cache('user');
55+
return apc_clear_cache() && apc_clear_cache('user');
4656
}
4757
}

src/Driver/MapCache.hack

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* This software consists of voluntary contributions made by many individuals
1111
* and is licensed under the MIT license.
1212
*
13-
* Copyright (c) 2017-2018 Yuuki Takezawa
13+
* Copyright (c) 2017-2019 Yuuki Takezawa
1414
*
1515
*/
1616
namespace Nazg\HCache\Driver;

0 commit comments

Comments
 (0)