forked from blallo/rss-bridge
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:
parent
1efaba5c7c
commit
43f0fc93b7
4 changed files with 26 additions and 18 deletions
|
@ -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;
|
||||
}
|
||||
|
|
14
index.php
14
index.php
|
@ -1,5 +1,4 @@
|
|||
<?php
|
||||
$time_start = microtime(true);
|
||||
/*
|
||||
TODO :
|
||||
- manage SSL detection because if library isn't loaded, some bridge crash !
|
||||
|
@ -14,7 +13,7 @@ TODO :
|
|||
|
||||
date_default_timezone_set('UTC');
|
||||
error_reporting(0);
|
||||
ini_set('display_errors','1'); error_reporting(E_ALL); // For debugging only.
|
||||
//ini_set('display_errors','1'); error_reporting(E_ALL); // For debugging only.
|
||||
|
||||
// extensions check
|
||||
if (!extension_loaded('openssl'))
|
||||
|
@ -98,6 +97,7 @@ try{
|
|||
$bridge->setDatas($_REQUEST);
|
||||
$bridge->loadMetadatas();
|
||||
// Data transformation
|
||||
try {
|
||||
$format = Format::create($format);
|
||||
$format
|
||||
->setDatas($bridge->getDatas())
|
||||
|
@ -106,6 +106,11 @@ try{
|
|||
'uri' => $bridge->getURI(),
|
||||
))
|
||||
->display();
|
||||
} catch(Exception $e) {
|
||||
|
||||
echo "The brige has crashed. You should report this to the bridges maintainer";
|
||||
|
||||
}
|
||||
die;
|
||||
}
|
||||
break;
|
||||
|
@ -273,10 +278,7 @@ $formats = Format::searchInformation();
|
|||
?>
|
||||
<footer>
|
||||
<?= $activeFoundBridgeCount; ?>/<?= count($whitelist_selection) ?> active bridges (<a href="?show_inactive=1">Show inactive</a>)<br />
|
||||
<a href="https://github.com/sebsauvage/rss-bridge">RSS-Bridge alpha 0.1 ~ Public Domain</a>
|
||||
<a href="https://github.com/sebsauvage/rss-bridge">RSS-Bridge alpha 0.2 ~ Public Domain</a>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
<?php
|
||||
echo "Ran for ". (microtime(true) - $time_start);
|
||||
?>
|
||||
|
|
Loading…
Reference in a new issue