我正在使用 FB PHP SDK 将消息发布到用户的墙上。一旦用户通过 FB 进行身份验证,我允许他们使用此帮助函数发布消息
function post_facebook($fb) {
$CI =& get_instance();
$CI->load->library('facebook');
$config = array(
'appId' => '123123123123',
'secret' => '567567567567'
);
$facebook = new Facebook($config);
$user_id = $facebook->getUser();
if ($user_id) {
$facebook->api('/me/feed', 'POST', array(
'message' => $fb['post_text'],
)
);
}
}
这实际上将帖子发送到 FB 并显示在墙上。
但是在 Firebug 中我可以看到这个错误
<h4>A PHP Error was encountered</h4>
<p>Severity: Warning</p>
<p>Message: Missing argument 1 for Facebook::__construct(), called in /var/www/vhosts/example.com/httpdocs/system/core/Loader.php on line 1099 and defined</p>
<p>Filename: libraries/Facebook.php</p>
<p>Line Number: 36</p>
</div><div style="border:1px solid #990000;padding-left:20px;margin:0 0 10px 0;">
<h4>A PHP Error was encountered</h4>
<p>Severity: Notice</p>
<p>Message: Undefined variable: config</p>
<p>Filename: libraries/Facebook.php</p>
<p>Line Number: 40</p>
</div>
知道我做错了什么吗?