summaryrefslogtreecommitdiff
path: root/lib/facebookutil.php
diff options
context:
space:
mode:
authorEvan Prodromou <evan@controlyourself.ca>2009-05-27 14:52:35 -0400
committerEvan Prodromou <evan@controlyourself.ca>2009-05-27 14:52:35 -0400
commitb3bb8943f592de9f6936f35be49a88c641bf6da1 (patch)
treebefbe8ff6d3c7d1268ecce3696bee5caaa799db7 /lib/facebookutil.php
parent698228acb9a6262f2fb4e0c82118249aa94cc0f8 (diff)
parentf59ab5dc40862b141ee5463fd4d24b0d213a96f2 (diff)
Merge branch '0.7.x' into utf8
Diffstat (limited to 'lib/facebookutil.php')
-rw-r--r--lib/facebookutil.php15
1 files changed, 13 insertions, 2 deletions
diff --git a/lib/facebookutil.php b/lib/facebookutil.php
index ec3987273..242d2e06f 100644
--- a/lib/facebookutil.php
+++ b/lib/facebookutil.php
@@ -27,9 +27,21 @@ define("FACEBOOK_PROMPTED_UPDATE_PREF", 2);
function getFacebook()
{
+ static $facebook = null;
+
$apikey = common_config('facebook', 'apikey');
$secret = common_config('facebook', 'secret');
- return new Facebook($apikey, $secret);
+
+ if ($facebook === null) {
+ $facebook = new Facebook($apikey, $secret);
+ }
+
+ if (!$facebook) {
+ common_log(LOG_ERR, 'Could not make new Facebook client obj!',
+ __FILE__);
+ }
+
+ return $facebook;
}
function updateProfileBox($facebook, $flink, $notice) {
@@ -92,7 +104,6 @@ function isFacebookBound($notice, $flink) {
}
-
function facebookBroadcastNotice($notice)
{
$facebook = getFacebook();