aboutsummaryrefslogtreecommitdiffhomepage
path: root/inc
diff options
context:
space:
mode:
authorNicolas LÅ“uillet <nicolas@loeuillet.org>2014-07-18 11:29:05 +0200
committerNicolas LÅ“uillet <nicolas@loeuillet.org>2014-07-18 11:29:05 +0200
commit6a4bbf0fe5afe1f0783c685fda1478f9c33a90b2 (patch)
tree0e981372151179fa66f603608b930a4e3eed4cc4 /inc
parent8e68391a57ba7055823a25726641d176041e1af9 (diff)
parent93edcab52edbae5671948e6e7c3cdd6511e16862 (diff)
downloadwallabag-6a4bbf0fe5afe1f0783c685fda1478f9c33a90b2.tar.gz
wallabag-6a4bbf0fe5afe1f0783c685fda1478f9c33a90b2.tar.zst
wallabag-6a4bbf0fe5afe1f0783c685fda1478f9c33a90b2.zip
Merge branch 'refactor' of github.com:wallabag/wallabag into refactor
Diffstat (limited to 'inc')
-rw-r--r--inc/3rdparty/FlattrItem.class.php16
1 files changed, 8 insertions, 8 deletions
diff --git a/inc/3rdparty/FlattrItem.class.php b/inc/3rdparty/FlattrItem.class.php
index 5cf9e5fc..ef8c62f7 100644
--- a/inc/3rdparty/FlattrItem.class.php
+++ b/inc/3rdparty/FlattrItem.class.php
@@ -11,13 +11,13 @@
11class FlattrItem 11class FlattrItem
12{ 12{
13 public $status; 13 public $status;
14 public $urltoflattr; 14 public $urlToFlattr;
15 public $flattrItemURL; 15 public $flattrItemURL;
16 public $numflattrs; 16 public $numFlattrs;
17 17
18 public function checkItem($urltoflattr, $id) 18 public function checkItem($urlToFlattr, $id)
19 { 19 {
20 $this->_cacheflattrfile($urltoflattr, $id); 20 $this->_cacheFlattrFile($urlToFlattr, $id);
21 $flattrResponse = file_get_contents(CACHE . "/flattr/".$id.".cache"); 21 $flattrResponse = file_get_contents(CACHE . "/flattr/".$id.".cache");
22 if($flattrResponse != FALSE) { 22 if($flattrResponse != FALSE) {
23 $result = json_decode($flattrResponse); 23 $result = json_decode($flattrResponse);
@@ -29,7 +29,7 @@ class FlattrItem
29 elseif (is_object($result) && $result->link) { 29 elseif (is_object($result) && $result->link) {
30 $this->status = FLATTRED; 30 $this->status = FLATTRED;
31 $this->flattrItemURL = $result->link; 31 $this->flattrItemURL = $result->link;
32 $this->numflattrs = $result->flattrs; 32 $this->numFlattrs = $result->flattrs;
33 } 33 }
34 else { 34 else {
35 $this->status = NOT_FLATTRABLE; 35 $this->status = NOT_FLATTRABLE;
@@ -40,7 +40,7 @@ class FlattrItem
40 } 40 }
41 } 41 }
42 42
43 private function _cacheflattrfile($urltoflattr, $id) 43 private function _cacheFlattrFile($urlToFlattr, $id)
44 { 44 {
45 if (!is_dir(CACHE . '/flattr')) { 45 if (!is_dir(CACHE . '/flattr')) {
46 mkdir(CACHE . '/flattr', 0777); 46 mkdir(CACHE . '/flattr', 0777);
@@ -48,10 +48,10 @@ class FlattrItem
48 48
49 // if a cache flattr file for this url already exists and it's been less than one day than it have been updated, see in /cache 49 // if a cache flattr file for this url already exists and it's been less than one day than it have been updated, see in /cache
50 if ((!file_exists(CACHE . "/flattr/".$id.".cache")) || (time() - filemtime(CACHE . "/flattr/".$id.".cache") > 86400)) { 50 if ((!file_exists(CACHE . "/flattr/".$id.".cache")) || (time() - filemtime(CACHE . "/flattr/".$id.".cache") > 86400)) {
51 $askForFlattr = Tools::getFile(FLATTR_API . $urltoflattr); 51 $askForFlattr = Tools::getFile(FLATTR_API . $urlToFlattr);
52 $flattrCacheFile = fopen(CACHE . "/flattr/".$id.".cache", 'w+'); 52 $flattrCacheFile = fopen(CACHE . "/flattr/".$id.".cache", 'w+');
53 fwrite($flattrCacheFile, $askForFlattr); 53 fwrite($flattrCacheFile, $askForFlattr);
54 fclose($flattrCacheFile); 54 fclose($flattrCacheFile);
55 } 55 }
56 } 56 }
57} \ No newline at end of file 57}