Join 3 table mysql with codeigniter 4 with the same one intended Premier Key (in 'id_kafe') - join

I have a problem when i want to join 2 table to id_kafe on tbl_kafe.
Here for the contents of the table
table_kafe
table_kafe_image
table_business_hours
i have done a join table_kafe with table_kafe_image with code like the following:
return $this->db->table('tbl_kafe')
->select('tbl_kafe.id_kafe as id_kafe, nama_kafe, alamat_kafe, coordinate, instagram_kafe, created_at, updated_at, stat_appv, GROUP_CONCAT(tbl_foto_kafe.nama_file_foto SEPARATOR ",") as nama_foto')
->join('tbl_foto_kafe', 'tbl_foto_kafe.id_kafe = tbl_kafe.id_kafe', 'left')
->groupBy('tbl_kafe.id_kafe')
->getWhere(['stat_appv' => '1']);
Result
Array
(
[0] => stdClass Object
(
[id_kafe] => 112
[nama_kafe] => Verte Cafe
[alamat_kafe] => JL. Jambi No. 47, Darmo, Surabaya
[coordinate] => -7.290871578917681, 112.73218139711598
[instagram_kafe] => vertecafe.id
[created_at] => 2022-12-26 00:42:57
[updated_at] => 2022-12-26 13:42:57
[stat_appv] => 1
[nama_foto] => 1672036977_fd38565eb6c216b4c81f.png, 1672036977_1ce1ce8733ad92fc4ff7.jpeg, 1672036977_a5d9e3417d276475d67f.png
)
[1] => stdClass Object
(
[id_kafe] => 113
[nama_kafe] => Asmaraloka Coffee
[alamat_kafe] => Jl. Petemon 4A No. 28
[coordinate] => -7.263516671669007, 112.71427820904135
[instagram_kafe] => asmaralokacoffee
[created_at] => 2022-12-26 02:28:47
[updated_at] => 2022-12-26 15:28:47
[stat_appv] => 1
[nama_foto] => 1672043327_3deaa642e08c88be7836.jpg, 1672043327_2d007d316badaac00d74.png
)
)
But, how to join table_business_hours to table_kafe as well
Previously I have tried with the following code:
return $this->db->table('tbl_kafe')
->select('tbl_kafe.id_kafe as id_kafe, nama_kafe, alamat_kafe, coordinate, fasilitas_kafe, instagram_kafe, created_at, updated_at, stat_appv, GROUP_CONCAT(tbl_foto_kafe.nama_file_foto SEPARATOR ",") as nama_foto, GROUP_CONCAT(tbl_jam_operasional.hari SEPARATOR ",") as hari, GROUP_CONCAT(tbl_jam_operasional.open_time SEPARATOR ",") as open_time, GROUP_CONCAT(tbl_jam_operasional.close_time SEPARATOR ",") as close_time')
->join('tbl_provinsi', 'tbl_provinsi.id_provinsi = tbl_kafe.id_provinsi')
->join('tbl_kabupaten', 'tbl_kabupaten.id_kabupaten = tbl_kafe.id_kabupaten')
->join('tbl_kecamatan', 'tbl_kecamatan.id_kecamatan = tbl_kafe.id_kecamatan')
->join('tbl_kelurahan', 'tbl_kelurahan.id_kelurahan = tbl_kafe.id_kelurahan')
->join('tbl_foto_kafe', 'tbl_foto_kafe.id_kafe = tbl_kafe.id_kafe', 'left')
->groupBy('tbl_kafe.id_kafe')
->join('tbl_jam_operasional', 'tbl_jam_operasional.kafe_id = tbl_kafe.id_kafe')
->getWhere(['stat_appv' => '1']);
But the result did not match expectations and repeated
Array
(
[0] => stdClass Object
(
[id_kafe] => 112
[nama_kafe] => Verte Cafe
[alamat_kafe] => JL. Jambi No. 47, Darmo, Surabaya
[coordinate] => -7.290871578917681, 112.73218139711598
[fasilitas_kafe] => Writing, Coding
[instagram_kafe] => vertecafe.id
[created_at] => 2022-12-26 00:42:57
[updated_at] => 2022-12-26 13:42:57
[stat_appv] => 1
[nama_foto] => 1672036977_fd38565eb6c216b4c81f.png, 1672036977_1ce1ce8733ad92fc4ff7.jpeg, 1672036977_a5d9e3417d276475d67f.png, 1672036977_fd38565eb6c216b4c81f.png, 1672036977_1ce1ce8733ad92fc4ff7.jpeg, 1672036977_a5d9e3417d276475d67f.png, 1672036977_fd38565eb6c216b4c81f.png, 1672036977_1ce1ce8733ad92fc4ff7.jpeg, 1672036977_a5d9e3417d276475d67f.png, 1672036977_fd38565eb6c216b4c81f.png, 1672036977_1ce1ce8733ad92fc4ff7.jpeg, 1672036977_a5d9e3417d276475d67f.png, 1672036977_fd38565eb6c216b4c81f.png, 1672036977_1ce1ce8733ad92fc4ff7.jpeg, 1672036977_a5d9e3417d276475d67f.png, 1672036977_fd38565eb6c216b4c81f.png, 1672036977_1ce1ce8733ad92fc4ff7.jpeg, 1672036977_a5d9e3417d276475d67f.png, 1672036977_fd38565eb6c216b4c81f.png, 1672036977_1ce1ce8733ad92fc4ff7.jpeg, 1672036977_a5d9e3417d276475d67f.png
[hari] => Senin, Senin, Senin, Selasa, Selasa, Selasa, Rabu, Rabu, Rabu, Kamis, Kamis, Kamis, Jumat, Jumat, Jumat, Sabtu, Sabtu, Sabtu, Minggu, Minggu, Minggu
[open_time] => 05:59:00, 05:59:00, 05:59:00, 05:59:00, 05:59:00, 05:59:00, 05:59:00, 05:59:00, 05:59:00, 05:59:00, 05:59:00, 05:59:00, 05:59:00, 05:59:00, 05:59:00, 05:59:00, 05:59:00, 05:59:00
[close_time] => 04:53:00, 04:53:00, 04:53:00, 04:53:00, 04:53:00, 04:53:00, 04:53:00, 04:53:00, 04:53:00, 04:53:00, 04:53:00, 04:53:00, 04:53:00, 04:53:00, 04:53:00, 23:28:00, 23:28:00, 23:28:00
)
[1] => stdClass Object
(
[id_kafe] => 113
[nama_kafe] => Asmaraloka Coffee
[alamat_kafe] => Jl. Petemon 4A No. 28
[coordinate] => -7.263516671669007, 112.71427820904135
[fasilitas_kafe] => Reading, Writing
[instagram_kafe] => asmaralokacoffee
[created_at] => 2022-12-26 02:28:47
[updated_at] => 2022-12-26 15:28:47
[stat_appv] => 1
[nama_foto] => 1672043327_3deaa642e08c88be7836.jpg, 1672043327_2d007d316badaac00d74.png, 1672043327_3deaa642e08c88be7836.jpg, 1672043327_2d007d316badaac00d74.png, 1672043327_3deaa642e08c88be7836.jpg, 1672043327_2d007d316badaac00d74.png, 1672043327_3deaa642e08c88be7836.jpg, 1672043327_2d007d316badaac00d74.png, 1672043327_3deaa642e08c88be7836.jpg, 1672043327_2d007d316badaac00d74.png, 1672043327_3deaa642e08c88be7836.jpg, 1672043327_2d007d316badaac00d74.png, 1672043327_3deaa642e08c88be7836.jpg, 1672043327_2d007d316badaac00d74.png
[hari] => Senin, Senin, Selasa, Selasa, Rabu, Rabu, Kamis, Kamis, Jumat, Jumat, Sabtu, Sabtu, Minggu, Minggu
[open_time] => 05:59:00, 05:59:00, 05:59:00, 05:59:00, 05:59:00, 05:59:00, 05:59:00, 05:59:00, 05:59:00, 05:59:00
[close_time] => 08:59:00, 08:59:00, 08:59:00, 08:59:00, 08:59:00, 08:59:00, 08:59:00, 08:59:00, 08:59:00, 08:59:00
)
)

Related

Ejabberd - undef module not found when using hook

I'm learning to use Hooks to build an Ejabberd module. This is the tutorial I'm referring. Following is my code:-
-module(mod_sunshine).
-behavior(gen_mod).
-include("ejabberd.hrl").
-include("logger.hrl").
-export([start/2, stop/1, receive_packet/1]).
start(_Host, _Opts) ->
?INFO_MSG("mod_sunshine starting", []),
ejabberd_hooks:add(user_receive_packet, _Host, ?MODULE, receive_packet, 50),
ok.
stop(_Host) ->
?INFO_MSG("mod_sunshine stopping", []),
ejabberd_hooks:delete(user_receive_packet, _Host, ?MODULE, receive_packet, 50),
ok.
receive_packet({_JID, From, To} = Packet) ->
?INFO_MSG("receive_packet JID: ~p From: ~p To: ~p Packet: ~p~n",[_JID, From, To, Packet]),
ok.
I'm receiving and logging the received packet(using user_receive_packet Hook) and but it throws an error. Following is the error:-
** Reason = {error,function_clause,[{mod_sunshine,receive_packet,[{file,"src/mod_sunshine.erl"},{line,20}],[{{iq,<<"purplead8c6fd0">>,result,<<"en">>,{jid,<<"praful1">>,<<"localhost">>,<<>>,<<"praful1">>,<<"localhost">>,<<>>},{jid,<<"praful1">>,<<"localhost">>,<<"Prafuls-MacBook-Pro">>,<<"praful1">>,<<"localhost">>,<<"Prafuls-MacBook-Pro">>},[],#{ip => {0,0,0,0,0,0,0,1}}},#{socket => {socket_state,gen_tcp,#Port<0.16027>,<0.479.0>},socket_monitor => #Ref<0.0.1.726>,stream_direction => in,caps_resources => {1,{{<<"praful1">>,<<"localhost">>,<<"Prafuls-MacBook-Pro">>},{caps,<<"http://pidgin.im/">>,<<"DdnydQG7RGhP9E3k9Sf+b+bF0zo=">>,<<"sha-1">>,[]},nil,nil}},tls_enabled => false,auth_module => ejabberd_auth_mnesia,mgmt_stanzas_out => 0,server => <<"localhost">>,sockmod => ejabberd_socket,privacy_list => {userlist,none,[],false},mgmt_resend => false,stream_id => <<"8641864023627389616">>,stream_authenticated => true,mgmt_ack_timeout => 60000,mgmt_queue_type => ram,mgmt_stanzas_req => 0,stream_timeout => infinity,stream_state => established,stream_compressed => false,shaper => c2s_shaper,sid => {{1495,527854,1},<0.480.0>},stream_version => {1,0},user => <<"praful1">>,mgmt_timeout => 300,ip => {{0,0,0,0,0,0,0,1},50783},stream_header_sent => true,csi_state => active,mgmt_state => inactive,conn => c2s,mod => ejabberd_c2s,stream_encrypted => false,pres_f => {1,{{<<"praful1">>,<<"localhost">>,<<>>},nil,nil}},tls_required => false,csi_queue => {0,#{}},jid => {jid,<<"praful1">>,<<"localhost">>,<<"Prafuls-MacBook-Pro">>,<<"praful1">>,<<"localhost">>,<<"Prafuls-MacBook-Pro">>},stream_restarted => true,pres_timestamp => {1495,527854,960838},xmlns => <<"jabber:client">>,mgmt_max_queue => 1000,tls_options => [compression_none],owner => <0.480.0>,resource => <<"Prafuls-MacBook-Pro">>,access => c2s,zlib => false,pres_last => {presence,<<>>,available,<<"en">>,{jid,<<"praful1">>,<<"localhost">>,<<"Prafuls-MacBook-Pro">>,<<"praful1">>,<<"localhost">>,<<"Prafuls-...">>},...},...}}]},...]}
** Arguments = [{{iq,<<"purplead8c6fd0">>,result,<<"en">>,{jid,<<"praful1">>,<<"localhost">>,<<>>,<<"praful1">>,<<"localhost">>,<<>>},{jid,<<"praful1">>,<<"localhost">>,<<"Prafuls-MacBook-Pro">>,<<"praful1">>,<<"localhost">>,<<"Prafuls-MacBook-Pro">>},[],#{ip => {0,0,0,0,0,0,0,1}}},#{socket => {socket_state,gen_tcp,#Port<0.16027>,<0.479.0>},socket_monitor => #Ref<0.0.1.726>,stream_direction => in,caps_resources => {1,{{<<"praful1">>,<<"localhost">>,<<"Prafuls-MacBook-Pro">>},{caps,<<"http://pidgin.im/">>,<<"DdnydQG7RGhP9E3k9Sf+b+bF0zo=">>,<<"sha-1">>,[]},nil,nil}},tls_enabled => false,auth_module => ejabberd_auth_mnesia,mgmt_stanzas_out => 0,server => <<"localhost">>,sockmod => ejabberd_socket,privacy_list => {userlist,none,[],false},mgmt_resend => false,stream_id => <<"8641864023627389616">>,stream_authenticated => true,mgmt_ack_timeout => 60000,mgmt_queue_type => ram,mgmt_stanzas_req => 0,stream_timeout => infinity,stream_state => established,stream_compressed => false,shaper => c2s_shaper,sid => {{1495,527854,1},<0.480.0>},stream_version => {1,0},user => <<"praful1">>,mgmt_timeout => 300,ip => {{0,0,0,0,0,0,0,1},50783},stream_header_sent => true,csi_state => active,mgmt_state => inactive,conn => c2s,mod => ejabberd_c2s,stream_encrypted => false,pres_f => {1,{{<<"praful1">>,<<"localhost">>,<<>>},nil,nil}},tls_required => false,csi_queue => {0,#{}},jid => {jid,<<"praful1">>,<<"localhost">>,<<"Prafuls-MacBook-Pro">>,<<"praful1">>,<<"localhost">>,<<"Prafuls-MacBook-Pro">>},stream_restarted => true,pres_timestamp => {1495,527854,960838},xmlns => <<"jabber:client">>,mgmt_max_queue => 1000,tls_options => [compression_none],owner => <0.480.0>,resource => <<"Prafuls-MacBook-Pro">>,access => c2s,zlib => false,pres_last => {presence,<<>>,available,<<"en">>,{jid,<<"praful1">>,<<"localhost">>,<<"Prafuls-MacBook-Pro">>,<<"praful1">>,<<"localhost">>,<<"Prafuls-MacBook-Pro">>},{jid,<<"praful1">>,<<"localhost">>,<<>>,<<"praful1">>,<<"lo...">>,...},...},...}}]
Where exactly am I wrong?
UPDATE
Upon looking at the hook written in one of the ejabberd module, it clearly shows that the hook function will have only 1 parameter. Hence, I updated my code as follow:-
-module(mod_sunshine).
-behavior(gen_mod).
-include("ejabberd.hrl").
-include("logger.hrl").
-include("xmpp.hrl").
-export([start/2, stop/1, user_receive_packet/1]).
start(_Host, _Opts) ->
?INFO_MSG("mod_sunshine starting", []),
ejabberd_hooks:add(user_receive_packet, _Host, ?MODULE, user_receive_packet, 50),
ok.
stop(_Host) ->
?INFO_MSG("mod_sunshine stopping", []),
ejabberd_hooks:delete(user_receive_packet, _Host, ?MODULE, user_receive_packet, 50),
ok.
-spec user_receive_packet({stanza(), ejabberd_c2s:state()}) -> {stanza(), ejabberd_c2s:state()}.
user_receive_packet({Packet, C2SState}) ->
?INFO_MSG("INSIDEEEEEEEE", []),
ok.
But the moment I receive a packet, it throws an error :-
13:59:28.118 [error] Hook user_receive_packet crashed when running mod_carboncopy:user_receive_packet/1:
** Reason = {error,function_clause,[{mod_carboncopy,user_receive_packet,[{file,"src/mod_carboncopy.erl"},{line,159}],[ok]},{ejabberd_hooks,safe_apply,[{file,"src/ejabberd_hooks.erl"},{line,380}],4},{ejabberd_hooks,run_fold1,[{file,"src/ejabberd_hooks.erl"},{line,364}],4},{ejabberd_c2s,process_info,[{file,"src/ejabberd_c2s.erl"},{line,231}],2},{ejabberd_hooks,safe_apply,[{file,"src/ejabberd_hooks.erl"},{line,380}],4},{ejabberd_hooks,run_fold1,[{file,"src/ejabberd_hooks.erl"},{line,364}],4},{xmpp_stream_in,handle_info,[{file,"src/xmpp_stream_in.erl"},{line,373}],2},{p1_server,handle_msg,[{file,"src/p1_server.erl"},{line,696}],8}]}
** Arguments = [ok]
13:59:28.119 [error] Hook c2s_handle_info crashed when running ejabberd_c2s:process_info/2:
** Reason = {error,{badmatch,ok},[{ejabberd_c2s,process_info,[{file,"src/ejabberd_c2s.erl"},{line,231}],2},{ejabberd_hooks,safe_apply,[{file,"src/ejabberd_hooks.erl"},{line,380}],4},{ejabberd_hooks,run_fold1,[{file,"src/ejabberd_hooks.erl"},{line,364}],4},{xmpp_stream_in,handle_info,[{file,"src/xmpp_stream_in.erl"},{line,373}],2},{p1_server,handle_msg,[{file,"src/p1_server.erl"},{line,696}],8},{proc_lib,init_p_do_apply,[{file,"proc_lib.erl"},{line,247}],3}]}
** Arguments = [#{socket => {socket_state,gen_tcp,#Port<0.15488>,<0.467.0>},stream_authenticated => true,tls_enabled => false,auth_module => ejabberd_auth_mnesia,mgmt_stanzas_out => 0,server => <<"localhost">>,sockmod => ejabberd_socket,privacy_list => {userlist,none,[],false},mgmt_resend => false,stream_id => <<"11245006342381720927">>,stream_encrypted => false,stream_state => established,mgmt_ack_timeout => 60000,mgmt_queue_type => ram,mgmt_stanzas_req => 0,stream_direction => in,stream_restarted => true,sid => {{1495,614568,1},<0.468.0>},user => <<"praful1">>,mgmt_timeout => 300,ip => {{0,0,0,0,0,0,0,1},52732},socket_monitor => #Ref<0.0.2.683>,csi_state => active,mgmt_state => inactive,conn => c2s,stream_timeout => infinity,mod => ejabberd_c2s,stream_compressed => false,pres_f => {1,{{<<"praful1">>,<<"localhost">>,<<>>},nil,nil}},tls_required => false,csi_queue => {0,#{}},jid => {jid,<<"praful1">>,<<"localhost">>,<<"Prafuls-MacBook-Pro">>,<<"praful1">>,<<"localhost">>,<<"Prafuls-MacBook-Pro">>},stream_header_sent => true,shaper => c2s_shaper,xmlns => <<"jabber:client">>,mgmt_max_queue => 1000,tls_options => [compression_none],owner => <0.468.0>,resource => <<"Prafuls-MacBook-Pro">>,access => c2s,zlib => false,mgmt_max_timeout => 300,pres_a => {0,nil},lang => <<"en">>,mgmt_stanzas_in => 0,lserver => <<"localhost">>,tls_verify => false,pres_t => {1,{{<<"praful1">>,<<"localhost">>,<<>>},nil,nil}},stream_version => {1,0}},{route,{iq,<<"purple3d24e94d">>,result,<<"en">>,{jid,<<>>,<<"localhost">>,<<>>,<<>>,<<"localhost">>,<<>>},{jid,<<"praful1">>,<<"localhost">>,<<"Prafuls-MacBook-Pro">>,<<"praful1">>,<<"localhost">>,<<"Prafuls-MacBook-Pro">>},[{disco_items,<<>>,[{disco_item,{jid,<<>>,<<"conference.localhost">>,<<>>,<<>>,<<"conference.localhost">>,<<>>},<<>>,<<>>},{disco_item,{jid,<<>>,<<"echo.localhost">>,<<>>,<<>>,<<"echo.localhost">>,<<>>},<<>>,<<>>},{disco_item,{jid,<<>>,<<"irc.localhost">>,<<>>,<<>>,<<"irc.localhost">>,<<>>},<<>>,<<>>},{disco_item,{jid,<<>>,<<"pubsub.localhost">>,<<>>,<<>>,<<"pubsub.localhost">>,<<>>},<<>>,<<>>},{disco_item,{jid,<<>>,<<"localhost">>,<<>>,<<>>,<<"localhost">>,<<>>},<<"Announcements">>,<<"announce">>},{disco_item,{jid,<<>>,<<"localhost">>,<<>>,<<>>,<<"localhost">>,<<>>},<<"Configuration">>,<<"config">>},{disco_item,{jid,<<>>,<<"localhost">>,<<>>,<<>>,<<"localhost">>,<<>>},<<"User Management">>,<<"user">>},{disco_item,{jid,<<>>,<<"localhost">>,<<>>,<<>>,<<"localhost">>,<<>>},<<"Online Users">>,<<"online users">>},{disco_item,{jid,<<>>,<<"localhost">>,<<>>,<<>>,<<"localhost">>,<<>>},<<"All Users">>,<<"all users">>},{disco_item,{jid,<<>>,<<"localhost">>,<<>>,<<>>,<<"localhost">>,<<>>},<<"Outgoing s2s Connections">>,<<"outgoing s2s">>},{disco_item,{jid,<<>>,<<"localhost">>,<<>>,<<>>,<<"localhost">>,<<>>},<<"Running Nodes">>,<<"running nodes">>},{disco_item,{jid,<<>>,<<"localhost">>,<<>>,<<>>,<<"localhost">>,<<>>},<<"Stopped Nodes">>,<<"stopped nodes">>}],undefined}],#{ip => {0,0,0,0,0,0,0,1}}}}]
Kindly provide your valuable inputs.
It seems that tutorial did not update for newer version of Ejabberd and i think you are using ejabberd >= 16.12.
according to the Code, Ejabberd passed Packet, ClientState, ClientJid, FromJid and ToJid to your function.
In newer versions, Packet is #iq{}, #presence{} or #message{} record.
Read this include file of xmpp lib for more info.

EF generate two FK by one relationship

EF 6.1.3
Mapping
var b = mb.Entity<PAYMENT_INVOICE>();
b.ToTable("T_PAYMENT_INVOICE");
b.HasPrimaryKey(x => x.Id);
b.Property(x => x.OrdersSumm).IsRequired();
b.Property(x => x.MargaSumm).IsRequired();
b.Property(x => x.DeliverySumm).IsRequired();
b.Property(x => x.PaySumm).IsRequired();
b.Property(x => x.CreateDate).IsRequired();
b.Property(x => x.Sended).IsRequired();
b.Property(x => x.LastError).IsOptional();
b.HasOptional(x => x.Payment).WithMany(x => x.Invoices).HasForeignKey(x => x.PaymentId);
b.HasRequired(x => x.Client).WithMany().HasForeignKey(x => x.ClientId);
b.HasRequired(x => x.Purchase).WithMany(x => x.Invoices).HasForeignKey(x => x.PurchaseId).WillCascadeOnDelete(false);
Why generate this key and column? Both are equal.
I remove column PURCHASE_ID and FK_dbo.T_PAYMENT_INVOICE_dbo.T_PURCHASE_PURCHASE_Id.
When I save PAYMENT_INVOICE I get an error:
Invalid column name 'PURCHASE_Id'
I do not need a second key, what is my mistake?

'Serialization of 'SimpleXMLElement' is not allowed'

I've changed around the path structure for HybridAuth quite a bit, all of the HybridAuth files are in a login directory.
require_once('login/Auth.php');
$auth = new Hybrid_Auth(self::$settings['auth']);
Where self::$settings['auth'] is this json file
{
"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 have not yet acquired keys for the providers I intended to use (is that possibly why this is happening?). I tried to login with Steam to test that it was working since it was the only provider that didn't require me to get keys.
$_SESSION['user'] = $auth->authenticate('Steam');
I was correctly redirected to a Steam login page however upon clicking Login I received the above error.
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
I thought it possibly had something to do with this line:
Hybrid_Logger::debug( "Hybrid_Auth initialize. dump used config: ", serialize( $config ) );
because that is the only line that I see serializing something but commenting that out didn't seem to work. Line 83 in my index.php is the initialization of Hybrid_Auth.
$auth = new Hybrid_Auth(self::$settings['auth']);
I can't seem to figure out what is going wrong with this though. Since that line of code is run when attempting to login and only causes a problem when returning from the Steam authorization page.
Here is the information that was output into auth.txt, I removed some information.
(
[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] =>
)
This was an issue with the Steam provider and was fixed in a commit you can download the fixed steam provider from the github repo.

how to get value from wsdl returned data in PHP?

Below is the data I'm getting from wsdl response... I need to get the separate value for example how to get the firstname from this array...Please anyone help me...
GetReportResponse Object ( [GetReportResult] => MBPeopleSearchRs_Type Object ( [MsgRsHdr] => MsgRsHdr_Type Object ( [RqUID] => {4DB2AD23-228A-465F-938D-BE072CED61C4} [Status] => Status_Type Object ( [StatusCode] => 0 [ServerStatusCode] => [Severity] => Info [StatusDesc] => OK [AdditionalStatus] => ) ) [Subject] => Subject Object ( [RefNum] => [PersonInfo] => PersonInfo_Type Object ( [PersonName] => PersonName_Type Object ( [LastName] => JANARDHANAN [FirstName] => SENTHINBABU [FullName] => [MiddleName] => [TitlePrefix] => [NameSuffix] => [Nickname] => [LegalName] => [MaidenName] => [OfficialTitle] => [Source] => MB [EffDt] => 2013-05-24 ) [ContactInfo] => ContactInfo_Type Object ( [ContactPref] => [PhoneNum] => [ContactName] => [EmailAddr] => [URL] => [PostAddr] => PostAddr_Type Object ( [PreDirection] => [Addr2] => [PostDirection] => N [Addr3] => [StreetType] => AVE [Addr4] => [StreetName] => LEXINGTON [Apt] => APT 4203 [StreetNum] => 4150 [Addr1] => [City] => SAINT PAUL [StateProv] => MN [PostalCode] => 55126-6131 [County] => RAMSEY
I suggest using a framework for this. CXF is a good choice if you write Java.
http://cxf.apache.org/
edit: since you work with php, take a look here: PHP SOAP client Tutorial/Recommendation?

composer autoload not working on production server

I've setup a project localy using composer to autoload my vendors and modules.
This is done on a Windows XP machine running Nginx.
When I sync everything to my production server, running LAMP, the autoloader stops working and every class i call its not found.
Since this is a shared host i cant run composer.phar update to try to refresh the classmap namespace.
Anyone knows what might be happening?
+INFO:
<?php
// autoload_namespaces.php generated by Composer
$vendorDir = dirname(__DIR__);
$baseDir = dirname(dirname($vendorDir));
return array(
'Zend\\' => $vendorDir . '/zendframework/zendframework/library/',
'ZendTest\\' => $vendorDir . '/zendframework/zendframework/tests/',
'Symfony\\Component\\Console' => $vendorDir . '/symfony/console/',
'Doctrine\\ORM' => $vendorDir . '/doctrine/orm/lib/',
'Doctrine\\DBAL' => $vendorDir . '/doctrine/dbal/lib/',
'Doctrine\\Common' => $vendorDir . '/doctrine/common/lib/',
'DoctrineORMModule\\' => $vendorDir . '/doctrine/doctrine-orm-module/src/',
'DoctrineORMModuleTest\\' => $vendorDir . '/doctrine/doctrine-orm-module/tests/',
'DoctrineModule\\' => $vendorDir . '/doctrine/doctrine-module/src/',
'DoctrineModuleTest\\' => $vendorDir . '/doctrine/doctrine-module/tests/',
'Application\\' => $baseDir . '/module/Application/src',
);
<?php
// autoload_classmap.php generated by Composer
$vendorDir = dirname(__DIR__);
$baseDir = dirname(dirname($vendorDir));
return array(
);
$loader returned:
Composer\Autoload\ClassLoader Object
(
[prefixes:Composer\Autoload\ClassLoader:private] => Array
(
[Zend\] => Array
(
[0] => /home/XXXX/public_html/vendor/zendframework/zendframework/library/
)
[ZendTest\] => Array
(
[0] => /home/XXXX/public_html/vendor/zendframework/zendframework/tests/
)
[Symfony\Component\Console] => Array
(
[0] => /home/XXXX/public_html/vendor/symfony/console/
)
[Doctrine\ORM] => Array
(
[0] => /home/XXXX/public_html/vendor/doctrine/orm/lib/
)
[Doctrine\DBAL] => Array
(
[0] => /home/XXXX/public_html/vendor/doctrine/dbal/lib/
)
[Doctrine\Common] => Array
(
[0] => /home/XXXX/public_html/vendor/doctrine/common/lib/
)
[DoctrineORMModule\] => Array
(
[0] => /home/XXXX/public_html/vendor/doctrine/doctrine-orm-module/src/
)
[DoctrineORMModuleTest\] => Array
(
[0] => /home/XXXX/public_html/vendor/doctrine/doctrine-orm-module/tests/
)
[DoctrineModule\] => Array
(
[0] => /home/XXXX/public_html/vendor/doctrine/doctrine-module/src/
)
[DoctrineModuleTest\] => Array
(
[0] => /home/XXXX/public_html/vendor/doctrine/doctrine-module/tests/
)
[Application\] => Array
(
[0] => /home/XXXX/public_html/module/Application/src
)
)
[fallbackDirs:Composer\Autoload\ClassLoader:private] => Array
(
)
[useIncludePath:Composer\Autoload\ClassLoader:private] =>
[classMap:Composer\Autoload\ClassLoader:private] => Array
(
)
)
++INFO:
spl_autoload_functions:
Array
(
[0] => Array
(
[0] => Composer\Autoload\ClassLoader Object
(
[prefixes:Composer\Autoload\ClassLoader:private] => Array
(
[Zend\] => Array
(
[0] => /home/XXXX/public_html/vendor/zendframework/zendframework/library/
)
[ZendTest\] => Array
(
[0] => /home/XXXX/public_html/vendor/zendframework/zendframework/tests/
)
[Symfony\Component\Console] => Array
(
[0] => /home/XXXX/public_html/vendor/symfony/console/
)
[Doctrine\ORM] => Array
(
[0] => /home/XXXX/public_html/vendor/doctrine/orm/lib/
)
[Doctrine\DBAL] => Array
(
[0] => /home/XXXX/public_html/vendor/doctrine/dbal/lib/
)
[Doctrine\Common] => Array
(
[0] => /home/XXXX/public_html/vendor/doctrine/common/lib/
)
[DoctrineORMModule\] => Array
(
[0] => /home/XXXX/public_html/vendor/doctrine/doctrine-orm-module/src/
)
[DoctrineORMModuleTest\] => Array
(
[0] => /home/XXXX/public_html/vendor/doctrine/doctrine-orm-module/tests/
)
[DoctrineModule\] => Array
(
[0] => /home/XXXX/public_html/vendor/doctrine/doctrine-module/src/
)
[DoctrineModuleTest\] => Array
(
[0] => /home/XXXX/public_html/vendor/doctrine/doctrine-module/tests/
)
[Application\] => Array
(
[0] => /home/XXXX/public_html/module/Application/src
)
)
[fallbackDirs:Composer\Autoload\ClassLoader:private] => Array
(
)
[useIncludePath:Composer\Autoload\ClassLoader:private] =>
[classMap:Composer\Autoload\ClassLoader:private] => Array
(
)
)
[1] => loadClass
)
)
The solutions was str replacing all the \ from the namespaces with / in all the modules autoloaders.
So,this:
public function getAutoloaderConfig() {
return array(
'Zend\Loader\StandardAutoloader' => array(
'namespaces' => array(
__NAMESPACE__ => __DIR__ . '/src/' . str_replace('\\', '/', __NAMESPACE__),
),
),
);
}
will get everything working as intended on a LAMP machine.

Resources