diff options
author | Robin Millette <millette@controlyourself.ca> | 2009-05-17 00:05:53 -0400 |
---|---|---|
committer | Robin Millette <millette@controlyourself.ca> | 2009-05-17 00:05:53 -0400 |
commit | a325144fa0ba769de1cdb554cac04e0116912b66 (patch) | |
tree | b36b33c91330cf80ffcfc090ef52be4df03c63e3 /lib | |
parent | f3ea79a12a7bdf0d4efcd7eb706d25ae81b7fad9 (diff) | |
parent | 811cef10083f8b7824b2fd8140f940bf13b54c8d (diff) |
Merge branch '0.8.x' of git@gitorious.org:~evan/laconica/dev into 0.8.x
Diffstat (limited to 'lib')
-rw-r--r-- | lib/facebookutil.php | 15 |
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(); |