Symfony 在FacebookBundle中获取配置文件的图片

Symfony 在FacebookBundle中获取配置文件的图片,symfony,symfony-2.1,fosfacebookbundle,Symfony,Symfony 2.1,Fosfacebookbundle,有人知道如何从Json数据中获取配置文件图片,我获得了所有信息(usernam、firstname、FacebookId),但我无法获得配置文件图片的链接: namespace djepo\UserBundle\Security\User\Provider; use Symfony\Component\Security\Core\Exception\UsernameNotFoundException; use Symfony\Component\Security\Core\Exception\

有人知道如何从Json数据中获取配置文件图片,我获得了所有信息(usernam、firstname、FacebookId),但我无法获得配置文件图片的链接:

namespace djepo\UserBundle\Security\User\Provider;

use Symfony\Component\Security\Core\Exception\UsernameNotFoundException;
use Symfony\Component\Security\Core\Exception\UnsupportedUserException;
use Symfony\Component\Security\Core\User\UserProviderInterface;
use Symfony\Component\Security\Core\User\UserInterface;
use \BaseFacebook;
use \FacebookApiException;

class FacebookProvider implements UserProviderInterface
{
/**
 * @var \Facebook
 */
protected $facebook;
protected $userManager;
protected $validator;
....
....
public function loadUserByUsername($username)
{           
    $user = $this->findUserByFbId($username);


    try {
        $fbdata = $this->facebook->api('/me');// Here I Get all information without pic
    } catch (FacebookApiException $e) {
        $fbdata = null;
    }

    if (!empty($fbdata)) {     
        var_dump($fbdata);// here I see object with result of data
        exit();
        $user_by_mail=$this->userManager->findUserBy(array('email'=>$fbdata['email']));

      .....
       ....

如果您有他们的用户名,则只需执行以下操作:

您可能需要在curlopt设置中允许重定向