2015-05-15 3 views
0

Я немного изменил структуру пути для HybridAuth, все файлы HybridAuth находятся в каталоге входа в систему.«Сериализация« SimpleXMLElement »не допускается»

require_once('login/Auth.php'); 
$auth = new Hybrid_Auth(self::$settings['auth']); 

Где self::$settings['auth'] находится этот JSon файл

{ 
    "debug": 1, 
    "database": { 
    "driver": "mysql", 
    "host": "localhost", 
    "port": 3306, 
    "name": "ws_db", 
    "username": "root", 
    "password": "", 
    "charset": "utf8" 
    }, 
    "auth": { 
    "base_url": "http://localhost/login/process", 
    "providers": { 
     "Twitter": { 
     "enabled": true 
     }, 
     "Google": { 
     "enabled": true, 
     "keys": { 
      "id": "", 
      "secret": "" 
     } 
     }, 
     "Facebook": { 
     "enabled": true, 
     "keys": { 
      "id": "", 
      "secret": "" 
     }, 
     "trustForwarded": false 
     }, 
     "Steam": { 
     "enabled": true 
     } 
    }, 
    "debug_mode": true, 
    "debug_file": "auth.txt" 
    } 
} 

Я еще не приобрел ключи для провайдеров I, предназначенных для использования (в том, что, возможно, почему это происходит?). Я попытался войти в Steam, чтобы проверить, что он работает, поскольку он был единственным поставщиком, который не требовал, чтобы я получил ключи.

$_SESSION['user'] = $auth->authenticate('Steam'); 

Я был правильно перенаправлен на страницу входа в Steam, но, щелкнув «Login», я получил вышеуказанную ошибку. Fatal error: Uncaught exception 'Exception' with message 'Serialization of 'SimpleXMLElement' is not allowed' in login\Auth.php:153 Stack trace: #0 login\Auth.php(39): Hybrid_Auth::initialize(Array) #1 index.php(83): Hybrid_Auth->__construct(Array) #2 index.php(6): Site::main() #3 {main} thrown in login\Auth.php on line 153

Я думал, что это, возможно, что-то делать с этой линией:

Hybrid_Logger::debug("Hybrid_Auth initialize. dump used config: ", serialize($config)); 

, потому что это единственная линия, что я вижу сериализации что-то, но заметив, что из не похоже на работу. Строка 83 в моем index.php - это инициализация Hybrid_Auth.

$auth = new Hybrid_Auth(self::$settings['auth']); 

Я не могу понять, что происходит с этим. Поскольку эта строка кода запускается при попытке входа в систему и вызывает только проблему при возврате с страницы авторизации Steam.

Вот информация, которая была выведена в auth.txt, я удалил некоторую информацию.

(
    [message:protected] => Serialization of 'SimpleXMLElement' is not allowed 
    [string:Exception:private] => 
    [code:protected] => 0 
    [file:protected] => login\Storage.php 
    [line:protected] => 73 
    [trace:Exception:private] => Array 
     (
      [0] => Array 
       (
        [file] => login\Storage.php 
        [line] => 73 
        [function] => serialize 
        [args] => Array 
         (
          [0] => Hybrid_User Object 
           (
            [providerId] => Steam 
            [timestamp] => 1431707732 
            [profile] => Hybrid_User_Profile Object 
             (
              [identifier] => *************** 
              [webSiteURL] => 
              [profileURL] => http://steamcommunity.com/id/******/ 
              [photoURL] => 
              [displayName] => Renari 
              [description] => <span>profile information was here</span> 
              [firstName] => SimpleXMLElement Object 
               (
                [0] => SimpleXMLElement Object 
                 (
                 ) 

               ) 

              [lastName] => 
              [gender] => 
              [language] => 
              [age] => 
              [birthDay] => 
              [birthMonth] => 
              [birthYear] => 
              [email] => 
              [emailVerified] => 
              [phone] => 
              [address] => 
              [country] => 
              [region] => location information was here 
              [city] => 
              [zip] => 
             ) 

           ) 

         ) 

       ) 

      [1] => Array 
       (
        [file] => login\Providers\Steam.php 
        [line] => 37 
        [function] => set 
        [class] => Hybrid_Storage 
        [type] => -> 
        [args] => Array 
         (
          [0] => hauth_session.Steam.user 
          [1] => Hybrid_User Object 
           (
            [providerId] => Steam 
            [timestamp] => 1431707732 
            [profile] => Hybrid_User_Profile Object 
             (
              [identifier] => *************** 
              [webSiteURL] => 
              [profileURL] => http://steamcommunity.com/id/******/ 
              [photoURL] => 
              [displayName] => ****** 
              [description] => <span>profile information was here</span> 
              [firstName] => SimpleXMLElement Object 
               (
                [0] => SimpleXMLElement Object 
                 (
                 ) 

               ) 

              [lastName] => 
              [gender] => 
              [language] => 
              [age] => 
              [birthDay] => 
              [birthMonth] => 
              [birthYear] => 
              [email] => 
              [emailVerified] => 
              [phone] => 
              [address] => 
              [country] => 
              [region] => location information was here 
              [city] => 
              [zip] => 
             ) 

           ) 

         ) 

       ) 

      [2] => Array 
       (
        [file] => login\Endpoint.php 
        [line] => 182 
        [function] => loginFinish 
        [class] => Hybrid_Providers_Steam 
        [type] => -> 
        [args] => Array 
         (
         ) 

       ) 

      [3] => Array 
       (
        [file] => login\Endpoint.php 
        [line] => 55 
        [function] => processAuthDone 
        [class] => Hybrid_Endpoint 
        [type] => -> 
        [args] => Array 
         (
         ) 

       ) 

      [4] => Array 
       (
        [file] => login\Endpoint.php 
        [line] => 71 
        [function] => __construct 
        [class] => Hybrid_Endpoint 
        [type] => -> 
        [args] => Array 
         (
          [0] => 
         ) 

       ) 

      [5] => Array 
       (
        [file] => index.php 
        [line] => 90 
        [function] => process 
        [class] => Hybrid_Endpoint 
        [type] => :: 
        [args] => Array 
         (
         ) 

       ) 

      [6] => Array 
       (
        [file] => index.php 
        [line] => 6 
        [function] => main 
        [class] => Site 
        [type] => :: 
        [args] => Array 
         (
         ) 

       ) 

     ) 

    [previous:Exception:private] => 
) 

ответ

0

Это был вопросом с поставщиком пара и фиксировал в commit вы можете скачать неподвижный поставщик пара из GitHub репо.

Смежные вопросы