我在这里使用本教程安装了 FOSTwitterBundle ,但是我有一个关于如何在我的数据库中保存每个使用他的 Twitter 帐户登录的用户的信息的问题?
编辑 :
现在我有这个错误:
ErrorException: Catchable Fatal Error: Argument 2 passed to Skeleton\PanelBundle\Security\User\Provider\TwitterUserProvider::__construct() must be an instance of FOS\UserBundle\Entity\UserManager, instance of FOS\UserBundle\Doctrine\UserManager given, called in /var/www/skeleton/app/cache/dev/appDevDebugProjectContainer.php on line 1678 and defined in /var/www/skeleton/src/Skeleton/PanelBundle/Security/User/Provider/TwitterUserProvider.php line 34
这是我的 config.yml :
services:
my.twitter.user:
class: Skeleton\PanelBundle\Security\User\Provider\TwitterUserProvider
arguments:
twitter_oauth: "@fos_twitter.api"
userManager: "@fos_user.user_manager"
validator: "@validator"
session: "@session"
和 security.yml :
security:
encoders:
Symfony\Component\Security\Core\User\User: plaintext
role_hierarchy:
ROLE_ADMIN: ROLE_USER
ROLE_SUPER_ADMIN: [ROLE_USER, ROLE_ADMIN, ROLE_ALLOWED_TO_SWITCH]
providers:
my_fos_twitter_provider:
id: my.twitter.user
firewalls:
dev:
pattern: ^/(_(profiler|wdt)|css|images|js)/
security: false
public:
pattern: /
fos_twitter:
login_path: /twitter/login
check_path: /twitter/login_check
default_target_path: /
provider: my_fos_twitter_provider
anonymous: ~
我真的很讨厌这个捆绑包,我几乎整天都在数据库中的用户表中信息帐户!
==>所有问题都在服务中my.twitter.user
!