Skip to content

Commit b6d9dd0

Browse files
committed
Fixed caching of twitter stuff.
1 parent 029b1c5 commit b6d9dd0

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

index.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

3-
error_reporting(E_ALL);
4-
ini_set('display_errors', 0);
3+
error_reporting(-1);
4+
ini_set('display_errors', 1);
55

66
$uri = $_SERVER['REQUEST_URI'];
77
//echo "uri is: ".$uri."<br>";

lib/Twitter.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ public static function profile($username = '')
1010
}
1111

1212
// Store cached profiles in /cache for now.
13-
$cache = "cache/cache-twitter-{$username}";
13+
$cache = dirname($_SERVER['SCRIPT_FILENAME']) . "/cache/cache-twitter-{$username}";
1414
//echo "cache is" . $cache . "<br>";
1515
if (file_exists($cache)) {
1616
// echo "file exists<br>";
@@ -28,6 +28,7 @@ public static function profile($username = '')
2828
return array('error' => 'Twitter is not responding.');
2929
} else {
3030
$profile = json_decode($json, TRUE);
31+
3132
file_put_contents($cache, serialize($profile));
3233

3334
return $profile;

0 commit comments

Comments
 (0)