我使用本教程here安装了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
!
答案 0 :(得分:0)
首先,我必须通过此use FOS\UserBundle\Entity\UserManager;
use FOS\UserBundle\Doctrine\UserManager;
同时按Symfony\Component\HttpFoundation\Session
Symfony\Component\HttpFoundation\Session\Session