remove a file before overwriting it with file_put_contents
This commit is contained in:
parent
ca28cd7cf9
commit
494d8a262d
|
@ -23,7 +23,9 @@ class LassoSPKitFileStore implements LassoSPKitStore {
|
|||
}
|
||||
function set($key, $value) {
|
||||
if ($key && $key != "") {
|
||||
$ret = @file_put_contents($this->filepath($key), @serialize($value));
|
||||
$path = $this->filepath($key);
|
||||
@unlink($path);
|
||||
$ret = @file_put_contents($path, @serialize($value));
|
||||
$this->debug($ret, "cannot set contents of file " . $this->filepath($key));
|
||||
} else {
|
||||
throw new Exception("Bad usage of FileStore::set, key is null");
|
||||
|
|
Reference in New Issue