FacebookBridge - make a huge fuss if we can't create a valid Facebookclient
This commit is contained in:
parent
8eca1b8dac
commit
65dbf485e4
@ -51,6 +51,13 @@ class Facebookclient
|
||||
function __construct($notice)
|
||||
{
|
||||
$this->facebook = self::getFacebook();
|
||||
|
||||
if (empty($this->facebook)) {
|
||||
throw new FacebookApiException(
|
||||
"Could not create Facebook client! Bad application ID or secret?"
|
||||
);
|
||||
}
|
||||
|
||||
$this->notice = $notice;
|
||||
|
||||
$this->flink = Foreign_link::getByUserID(
|
||||
@ -89,6 +96,22 @@ class Facebookclient
|
||||
$secret = common_config('facebook', 'global_secret');
|
||||
}
|
||||
|
||||
if (empty($appId)) {
|
||||
common_log(
|
||||
LOG_WARNING,
|
||||
"Couldn't find Facebook application ID!",
|
||||
__FILE__
|
||||
);
|
||||
}
|
||||
|
||||
if (empty($secret)) {
|
||||
common_log(
|
||||
LOG_WARNING,
|
||||
"Couldn't find Facebook application ID!",
|
||||
__FILE__
|
||||
);
|
||||
}
|
||||
|
||||
return new Facebook(
|
||||
array(
|
||||
'appId' => $appId,
|
||||
|
Loading…
Reference in New Issue
Block a user