Skip to content

Commit

Permalink
Merge pull request #7 from nazg-hack/feature/hhvm-4.0
Browse files Browse the repository at this point in the history
Feature/hhvm 4.0
  • Loading branch information
ytake authored Mar 23, 2019
2 parents 0831ef0 + 098e852 commit acef4f9
Show file tree
Hide file tree
Showing 6 changed files with 3 additions and 123 deletions.
16 changes: 1 addition & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ $ hhvm -d xdebug.enable=0 -d hhvm.jit=0 -d hhvm.php7.all=1\

## Usage

*supported apc, memcached, redis, map, void, filesystem*
*supported apc, memcached, map, void, filesystem*

### Using the CacheManager

Expand Down Expand Up @@ -183,17 +183,3 @@ $mc->addServers([['127.0.0.1', 11211]]);
$cache->setMemcached($mc);
$cache->save("qwerty", new Element('testing:cache', 0));
```

#### RedisCache

```hack
<?hh
use Nazg\HCache\Element;
use Nazg\HCache\Driver\RedisCache;
$cache = new RedisCache();
$redis = new Redis();
$redis->connect('127.0.0.1', 6379);
$cache->setRedis($redis);
$cache->save("qwerty", new Element('testing:cache', 0));
```
1 change: 0 additions & 1 deletion src/CacheManager.hack
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ class CacheManager {
'map' => \Nazg\HCache\Driver\MapCache::class,
'file' => \Nazg\HCache\Driver\FileSystemCache::class,
'memcached' => \Nazg\HCache\Driver\MemcachedCache::class,
'redis' => \Nazg\HCache\Driver\RedisCache::class,
};

protected Map<string, (function():CacheProvider)> $userCache = Map{};
Expand Down
71 changes: 0 additions & 71 deletions src/Driver/RedisCache.hack

This file was deleted.

2 changes: 2 additions & 0 deletions src/Element.hack
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,12 @@ class Element {
protected int $lifetime = 0
) { }

<<__Rx>>
public function getData(): mixed {
return $this->data;
}

<<__Rx>>
public function getLifetime(): int {
return $this->lifetime;
}
Expand Down
1 change: 0 additions & 1 deletion tests/CacheManagerTest.hack
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ final class CacheManagerTest extends HackTest {
expect($manager->createCache('file'))->toBeInstanceOf(FileSystemCache::class);
expect($manager->createCache('apc'))->toBeInstanceOf(ApcCache::class);
expect($manager->createCache('memcached'))->toBeInstanceOf(MemcachedCache::class);
expect($manager->createCache('redis'))->toBeInstanceOf(RedisCache::class);
expect($manager->createCache('void'))->toBeInstanceOf(VoidCache::class);
}

Expand Down
35 changes: 0 additions & 35 deletions tests/Driver/RedisCacheTest.hack

This file was deleted.

0 comments on commit acef4f9

Please sign in to comment.