1
0
mirror of https://github.com/RSS-Bridge/rss-bridge.git synced 2025-07-31 05:40:24 +02:00

Correction of few bugs.

Warn if RSS-Bridge cannot write to disk.
Try/Catch the bridge RSS generation.

Signed-off-by: teromene <teromene@teromene.fr>
This commit is contained in:
teromene
2015-11-05 10:12:58 +00:00
parent 1efaba5c7c
commit 43f0fc93b7
4 changed files with 26 additions and 18 deletions

View File

@@ -24,7 +24,13 @@ class FileCache extends CacheAbstract{
public function saveData($datas){
$this->isPrepareCache();
file_put_contents($this->getCacheFile(), json_encode($datas));
$writeStream = file_put_contents($this->getCacheFile(), json_encode($datas));
if(!$writeStream) {
throw new \Exception("Cannot write the cache... Do you have the right permissions ?");
}
return $this;
}
@@ -89,4 +95,4 @@ class FileCache extends CacheAbstract{
$stringToEncode = $_SERVER['REQUEST_URI'] . http_build_query($this->param);
return hash('sha1', $stringToEncode) . '.cache';
}
}
}