Skip to content

Commit 3053056

Browse files
committed
Improved @misternerd PR :)
1 parent c55647a commit 3053056

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/phpFastCache/Drivers/memcache.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class memcache extends DriverAbstract
3232
/**
3333
* @var int
3434
*/
35-
private $flags = 0;
35+
protected $memcacheFlags = 0;
3636

3737
/**
3838
* phpFastCache_memcache constructor.
@@ -47,8 +47,8 @@ public function __construct($config = array())
4747
if (class_exists('Memcache')) {
4848
$this->instant = new MemcacheSoftware();
4949

50-
if (isset($config[ 'compress_data' ]) && $config[ 'compress_data' ] === true) {
51-
$this->flags = MEMCACHE_COMPRESSED;
50+
if (array_key_exists('compress_data', $config) && $config[ 'compress_data' ] === true) {
51+
$this->memcacheFlags = MEMCACHE_COMPRESSED;
5252
}
5353
} else {
5454
$this->fallback = true;
@@ -121,10 +121,10 @@ public function driver_set(
121121
}
122122

123123
if (isset($option[ 'skipExisting' ]) && $option[ 'skipExisting' ] == true) {
124-
return $this->instant->add($keyword, $value, $this->flags, $time);
124+
return $this->instant->add($keyword, $value, $this->memcacheFlags, $time);
125125

126126
} else {
127-
return $this->instant->set($keyword, $value, $this->flags, $time);
127+
return $this->instant->set($keyword, $value, $this->memcacheFlags, $time);
128128
}
129129
}
130130

0 commit comments

Comments
 (0)