Symfony2:使用Facebook PHP Api,BaseFacebook类无法加载 [英] Symfony2: using Facebook PHP Api, BaseFacebook class can not be loaded
问题描述
我创建了一个
class FacebookSessionPersistence extends \BaseFacebook
此外,我在自动加载中插入以下行.php:
$ loader-> registerPrefixes(array(
'Facebook'=> __DIR __。 ../vendor/facebook/src,));
仍然遇到以下错误:
致命错误:类BaseFacebook未找到/var/www/..../Bundle/Library/FacebookSessionPersistence.php第14行
我应该怎么做,告诉Symfony加载这个类?
尝试 class FacebookSessionPersistence扩展了Facebook\BaseFacebook
如果这个失败,你需要显式地包含base_facebook.php文件p>
您还应该查看 FOSFacebookBundle - 它可能解决了你想要做的任何事情。至少我知道它有一个 fos_facebook.api
服务,这是你想要实现的。
I think this is related to the autoloading of Symfony2:
I created a
class FacebookSessionPersistence extends \BaseFacebook
Further, I inserted following line in the autoload.php:
$loader->registerPrefixes(array(
'Facebook' => __DIR__.'/../vendor/facebook/src',));
Still I get following error:
Fatal error: Class 'BaseFacebook' not found in /var/www/..../Bundle/Library/FacebookSessionPersistence.php on line 14
What should I do, to tell Symfony to load this class?
Try class FacebookSessionPersistence extends Facebook\BaseFacebook
If this fails you'll need to explicitly include base_facebook.php file
You should also take a look at FOSFacebookBundle - it probably solves whatever you're trying to do. At least I know for sure that it has a fos_facebook.api
service, which is what you're trying to implement..
这篇关于Symfony2:使用Facebook PHP Api,BaseFacebook类无法加载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!