From 43b49895e52955620685768f8a2c15b0c9430476 Mon Sep 17 00:00:00 2001 From: Vasil Kolev Date: Thu, 31 Mar 2016 22:13:08 +0300 Subject: [PATCH] survive if clarion is down --- schedule/class.SmartCurl.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/schedule/class.SmartCurl.php b/schedule/class.SmartCurl.php index b963a31..17c3f52 100644 --- a/schedule/class.SmartCurl.php +++ b/schedule/class.SmartCurl.php @@ -87,7 +87,12 @@ class SmartCurl { $response = curl_exec($this->ch); if ($response === false) { - return false; + if (file_exists($cache_file)) { + return file_get_contents($cache_file); + } + else { + return false; + } } //var_dump(curl_getinfo($this->ch, CURLINFO_HEADER_OUT));