2015-05-15 103 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" 
    } 
} 

我尚未獲得,因爲我打算用提供商鍵(就是可能爲什麼發生這種情況?)。我試着用Steam登錄來測試它是否有效,因爲它是唯一不需要我獲得密鑰的提供商。

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

我正確地重定向到一個Steam登錄頁面後但點擊登錄我收到上述錯誤。 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)); 

,因爲這是我看到的序列化的東西,但他評論說出來似乎沒有工作的唯一線路。我的index.php中的第83行是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庫的固定蒸汽供應商。

相關問題