summaryrefslogtreecommitdiffstats
path: root/BOSH.php
blob: ef384987efb635d11a0b4f7af3c04c4bd488af75 (plain)
ofshex dumpascii
0000 6c 69 62 2f 45 78 63 65 70 74 69 6f 6e 2e 70 68 70 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 lib/Exception.php...............
0020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
0040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
0060 00 00 00 00 30 30 30 30 36 34 34 00 30 30 30 31 37 35 30 00 30 30 30 31 37 35 30 00 30 30 30 30 ....0000644.0001750.0001750.0000
0080 30 30 30 33 30 30 37 00 31 32 37 37 33 30 33 31 30 36 35 00 30 31 33 30 37 31 00 20 30 00 00 00 0003007.12773031065.013071..0...
00a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
00c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
00e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
0100 00 75 73 74 61 72 20 20 00 74 7a 75 72 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 .ustar...tzur...................
0120 00 00 00 00 00 00 00 00 00 74 7a 75 72 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 .........tzur...................
0140 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
0160 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
0180 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
01a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
01c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
01e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
0200 3c 3f 70 68 70 0d 0a 2f 2a 2a 0d 0a 20 2a 20 58 4d 50 50 48 50 3a 20 54 68 65 20 50 48 50 20 58 <?php../**...*.XMPPHP:.The.PHP.X
0220 4d 50 50 20 4c 69 62 72 61 72 79 0d 0a 20 2a 20 43 6f 70 79 72 69 67 68 74 20 28 43 29 20 32 30 MPP.Library...*.Copyright.(C).20
0240 30 38 20 20 4e 61 74 68 61 6e 61 65 6c 20 43 2e 20 46 72 69 74 7a 0d 0a 20 2a 20 54 68 69 73 20 08..Nathanael.C..Fritz...*.This.
0260 66 69 6c 65 20 69 73 20 70 61 72 74 20 6f 66 20 53 6c 65 65 6b 58 4d 50 50 2e 0d 0a 20 2a 0d 0a file.is.part.of.SleekXMPP....*..
0280 20 2a 20 58 4d 50 50 48 50 20 69 73 20 66 72 65 65 20 73 6f 66 74 77 61 72 65 3b 20 79 6f 75 20 .*.XMPPHP.is.free.software;.you.
02a0 63 61 6e 20 72 65 64 69 73 74 72 69 62 75 74 65 20 69 74 20 61 6e 64 2f 6f 72 20 6d 6f 64 69 66 can.redistribute.it.and/or.modif
02c0 79 0d 0a 20 2a 20 69 74 20 75 6e 64 65 72 20 74 68 65 20 74 65 72 6d 73 20 6f 66 20 74 68 65 20 y...*.it.under.the.terms.of.the.
02e0 47 4e 55 20 47 65 6e 65 72 61 6c 20 50 75 62 6c 69 63 20 4c 69 63 65 6e 73 65 20 61 73 20 70 75 GNU.General.Public.License.as.pu
0300 62 6c 69 73 68 65 64 20 62 79 0d 0a 20 2a 20 74 68 65 20 46 72 65 65 20 53 6f 66 74 77 61 72 65 blished.by...*.the.Free.Software
0320 20 46 6f 75 6e 64 61 74 69 6f 6e 3b 20 65 69 74 68 65 72 20 76 65 72 73 69 6f 6e 20 32 20 6f 66 .Foundation;.either.version.2.of
0340 20 74 68 65 20 4c 69 63 65 6e 73 65 2c 20 6f 72 0d 0a 20 2a 20 28 61 74 20 79 6f 75 72 20 6f 70 .the.License,.or...*.(at.your.op
0360 74 69 6f 6e 29 20 61 6e 79 20 6c 61 74 65 72 20 76 65 72 73 69 6f 6e 2e 0d 0a 20 2a 0d 0a 20 2a tion).any.later.version....*...*
0380 20 58 4d 50 50 48 50 20 69 73 20 64 69 73 74 72 69 62 75 74 65 64 20 69 6e 20 74 68 65 20 68 6f .XMPPHP.is.distributed.in.the.ho
03a0 70 65 20 74 68 61 74 20 69 74 20 77 69 6c 6c 20 62 65 20 75 73 65 66 75 6c 2c 0d 0a 20 2a 20 62 pe.that.it.will.be.useful,...*.b
03c0 75 74 20 57 49 54 48 4f 55 54 20 41 4e 59 20 57 41 52 52 41 4e 54 59 3b 20 77 69 74 68 6f 75 74 ut.WITHOUT.ANY.WARRANTY;.without
03e0 20 65 76 65 6e 20 74 68 65 20 69 6d 70 6c 69 65 64 20 77 61 72 72 61 6e 74 79 20 6f 66 0d 0a 20 .even.the.implied.warranty.of...
0400 2a 20 4d 45 52 43 48 41 4e 54 41 42 49 4c 49 54 59 20 6f 72 20 46 49 54 4e 45 53 53 20 46 4f 52 *.MERCHANTABILITY.or.FITNESS.FOR
0420 20 41 20 50 41 52 54 49 43 55 4c 41 52 20 50 55 52 50 4f 53 45 2e 20 20 53 65 65 20 74 68 65 0d .A.PARTICULAR.PURPOSE...See.the.
0440 0a 20 2a 20 47 4e 55 20 47 65 6e 65 72 61 6c 20 50 75 62 6c 69 63 20 4c 69 63 65 6e 73 65 20 66 ..*.GNU.General.Public.License.f
0460 6f 72 20 6d 6f 72 65 20 64 65 74 61 69 6c 73 2e 0d 0a 20 2a 0d 0a 20 2a 20 59 6f 75 20 73 68 6f or.more.details....*...*.You.sho
0480 75 6c 64 20 68 61 76 65 20 72 65 63 65 69 76 65 64 20 61 20 63 6f 70 79 20 6f 66 20 74 68 65 20 uld.have.received.a.copy.of.the.
04a0 47 4e 55 20 47 65 6e 65 72 61 6c 20 50 75 62 6c 69 63 20 4c 69 63 65 6e 73 65 0d 0a 20 2a 20 61 GNU.General.Public.License...*.a
04c0 6c 6f 6e 67 20 77 69 74 68 20 58 4d 50 50 48 50 3b 20 69 66 20 6e 6f 74 2c 20 77 72 69 74 65 20 long.with.XMPPHP;.if.not,.write.
04e0 74 6f 20 74 68 65 20 46 72 65 65 20 53 6f 66 74 77 61 72 65 0d 0a 20 2a 20 46 6f 75 6e 64 61 74 to.the.Free.Software...*.Foundat
0500 69 6f 6e 2c 20 49 6e 63 2e 2c 20 35 31 20 46 72 61 6e 6b 6c 69 6e 20 53 74 2c 20 46 69 66 74 68 ion,.Inc.,.51.Franklin.St,.Fifth
0520 20 46 6c 6f 6f 72 2c 20 42 6f 73 74 6f 6e 2c 20 4d 41 20 20 30 32 31 31 30 2d 31 33 30 31 20 20 .Floor,.Boston,.MA..02110-1301..
0540 55 53 41 0d 0a 20 2a 0d 0a 20 2a 20 40 63 61 74 65 67 6f 72 79 20 20 20 78 6d 70 70 68 70 0d 0a USA...*...*.@category...xmpphp..
0560 20 2a 20 40 70 61 63 6b 61 67 65 20 20 20 20 58 4d 50 50 48 50 0d 0a 20 2a 20 40 61 75 74 68 6f .*.@package....XMPPHP...*.@autho
0580 72 20 20 20 20 20 4e 61 74 68 61 6e 61 65 6c 20 43 2e 20 46 72 69 74 7a 20 3c 4a 49 44 3a 20 66 r.....Nathanael.C..Fritz.<JID:.f
05a0 72 69 74 7a 79 40 6e 65 74 66 6c 69 6e 74 2e 6e 65 74 3e 0d 0a 20 2a 20 40 61 75 74 68 6f 72 20 ritzy@netflint.net>...*.@author.
05c0 20 20 20 20 53 74 65 70 68 61 6e 20 57 65 6e 74 7a 20 3c 4a 49 44 3a 20 73 74 65 70 68 61 6e 40 ....Stephan.Wentz.<JID:.stephan@
05e0 6a 61 62 62 65 72 2e 77 65 6e 74 7a 2e 69 74 3e 0d 0a 20 2a 20 40 61 75 74 68 6f 72 20 20 20 20 jabber.wentz.it>...*.@author....
0600 20 4d 69 63 68 61 65 6c 20 47 61 72 76 69 6e 20 3c 4a 49 44 3a 20 67 61 72 40 6e 65 74 66 6c 69 .Michael.Garvin.<JID:.gar@netfli
0620 6e 74 2e 6e 65 74 3e 0d 0a 20 2a 20 40 61 75 74 68 6f 72 20 20 20 20 20 41 6c 65 78 61 6e 64 65 nt.net>...*.@author.....Alexande
0640 72 20 42 69 72 6b 6e 65 72 20 28 68 74 74 70 73 3a 2f 2f 67 69 74 68 75 62 2e 63 6f 6d 2f 42 69 r.Birkner.(https://github.com/Bi
0660 72 6b 6e 65 72 41 6c 65 78 29 0d 0a 20 2a 20 40 63 6f 70 79 72 69 67 68 74 20 20 32 30 30 38 20 rknerAlex)...*.@copyright..2008.
0680 4e 61 74 68 61 6e 61 65 6c 20 43 2e 20 46 72 69 74 7a 0d 0a 20 2a 2f 0d 0a 2f 2a 2a 0d 0a 20 2a Nathanael.C..Fritz...*/../**...*
06a0 20 58 4d 50 50 48 50 20 4d 61 69 6e 20 43 6c 61 73 73 0d 0a 20 2a 0d 0a 20 2a 20 40 63 61 74 65 .XMPPHP.Main.Class...*...*.@cate
06c0 67 6f 72 79 20 20 20 78 6d 70 70 68 70 0d 0a 20 2a 20 40 70 61 63 6b 61 67 65 20 20 20 20 58 4d gory...xmpphp...*.@package....XM
06e0 50 50 48 50 0d 0a 20 2a 20 40 61 75 74 68 6f 72 20 20 20 20 20 4e 61 74 68 61 6e 61 65 6c 20 43 PPHP...*.@author.....Nathanael.C
0700 2e 20 46 72 69 74 7a 20 3c 4a 49 44 3a 20 66 72 69 74 7a 79 40 6e 65 74 66 6c 69 6e 74 2e 6e 65 ..Fritz.<JID:.fritzy@netflint.ne
0720 74 3e 0d 0a 20 2a 20 40 61 75 74 68 6f 72 20 20 20 20 20 53 74 65 70 68 61 6e 20 57 65 6e 74 7a t>...*.@author.....Stephan.Wentz
0740 20 3c 4a 49 44 3a 20 73 74 65 70 68 61 6e 40 6a 61 62 62 65 72 2e 77 65 6e 74 7a 2e 69 74 3e 0d .<JID:.stephan@jabber.wentz.it>.
0760 0a 20 2a 20 40 61 75 74 68 6f 72 20 20 20 20 20 4d 69 63 68 61 65 6c 20 47 61 72 76 69 6e 20 3c ..*.@author.....Michael.Garvin.<
0780 4a 49 44 3a 20 67 61 72 40 6e 65 74 66 6c 69 6e 74 2e 6e 65 74 3e 0d 0a 20 2a 20 40 63 6f 70 79 JID:.gar@netflint.net>...*.@copy
07a0 72 69 67 68 74 20 20 32 30 30 38 20 4e 61 74 68 61 6e 61 65 6c 20 43 2e 20 46 72 69 74 7a 0d 0a right..2008.Nathanael.C..Fritz..
07c0 20 2a 20 40 76 65 72 73 69 6f 6e 20 20 20 20 24 49 64 24 0d 0a 20 2a 2f 0d 0a 63 6c 61 73 73 20 .*.@version....$Id$...*/..class.
07e0 58 4d 50 50 45 78 63 65 70 74 69 6f 6e 20 65 78 74 65 6e 64 73 20 5c 45 78 63 65 70 74 69 6f 6e XMPPException.extends.\Exception
0800 20 7b 0d 0a 7d 0d 0a 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 .{..}...........................
0820 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
0840 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
0860 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
0880 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
08a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
08c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
08e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
0900 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
0920 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
0940 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
0960 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
0980 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
09a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
09c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
09e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
0a00 6c 69 62 2f 52 6f 73 74 65 72 2e 70 68 70 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 lib/Roster.php..................
0a20 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
0a40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
0a60 00 00 00 00 30 30 30 30 36 34 34 00 30 30 30 31 37 35 30 00 30 30 30 31 37 35 30 00 30 30 30 30 ....0000644.0001750.0001750.0000
0a80 30 30 31 31 34 30 37 00 31 32 37 37 33 30 33 31 30 37 33 00 30 31 32 34 31 33 00 20 30 00 00 00 0011407.12773031073.012413..0...
0aa0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
0ac0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
0ae0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
0b00 00 75 73 74 61 72 20 20 00 74 7a 75 72 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 .ustar...tzur...................
0b20 00 00 00 00 00 00 00 00 00 74 7a 75 72 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 .........tzur...................
0b40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
0b60 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
0b80 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
0ba0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
0bc0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
0be0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
0c00 3c 3f 70 68 70 0d 0a 2f 2a 2a 0d 0a 20 2a 20 58 4d 50 50 48 50 3a 20 54 68 65 20 50 48 50 20 58 <?php../**...*.XMPPHP:.The.PHP.X
0c20 4d 50 50 20 4c 69 62 72 61 72 79 0d 0a 20 2a 20 43 6f 70 79 72 69 67 68 74 20 28 43 29 20 32 30 MPP.Library...*.Copyright.(C).20
0c40 30 38 20 20 4e 61 74 68 61 6e 61 65 6c 20 43 2e 20 46 72 69 74 7a 0d 0a 20 2a 20 54 68 69 73 20 08..Nathanael.C..Fritz...*.This.
0c60 66 69 6c 65 20 69 73 20 70 61 72 74 20 6f 66 20 53 6c 65 65 6b 58 4d 50 50 2e 0d 0a 20 2a 0d 0a file.is.part.of.SleekXMPP....*..
0c80 20 2a 20 58 4d 50 50 48 50 20 69 73 20 66 72 65 65 20 73 6f 66 74 77 61 72 65 3b 20 79 6f 75 20 .*.XMPPHP.is.free.software;.you.
0ca0 63 61 6e 20 72 65 64 69 73 74 72 69 62 75 74 65 20 69 74 20 61 6e 64 2f 6f 72 20 6d 6f 64 69 66 can.redistribute.it.and/or.modif
0cc0 79 0d 0a 20 2a 20 69 74 20 75 6e 64 65 72 20 74 68 65 20 74 65 72 6d 73 20 6f 66 20 74 68 65 20 y...*.it.under.the.terms.of.the.
0ce0 47 4e 55 20 47 65 6e 65 72 61 6c 20 50 75 62 6c 69 63 20 4c 69 63 65 6e 73 65 20 61 73 20 70 75 GNU.General.Public.License.as.pu
0d00 62 6c 69 73 68 65 64 20 62 79 0d 0a 20 2a 20 74 68 65 20 46 72 65 65 20 53 6f 66 74 77 61 72 65 blished.by...*.the.Free.Software
0d20 20 46 6f 75 6e 64 61 74 69 6f 6e 3b 20 65 69 74 68 65 72 20 76 65 72 73 69 6f 6e 20 32 20 6f 66 .Foundation;.either.version.2.of
0d40 20 74 68 65 20 4c 69 63 65 6e 73 65 2c 20 6f 72 0d 0a 20 2a 20 28 61 74 20 79 6f 75 72 20 6f 70 .the.License,.or...*.(at.your.op
0d60 74 69 6f 6e 29 20 61 6e 79 20 6c 61 74 65 72 20 76 65 72 73 69 6f 6e 2e 0d 0a 20 2a 0d 0a 20 2a tion).any.later.version....*...*
0d80 20 58 4d 50 50 48 50 20 69 73 20 64 69 73 74 72 69 62 75 74 65 64 20 69 6e 20 74 68 65 20 68 6f .XMPPHP.is.distributed.in.the.ho
0da0 70 65 20 74 68 61 74 20 69 74 20 77 69 6c 6c 20 62 65 20 75 73 65 66 75 6c 2c 0d 0a 20 2a 20 62 pe.that.it.will.be.useful,...*.b
0dc0 75 74 20 57 49 54 48 4f 55 54 20 41 4e 59 20 57 41 52 52 41 4e 54 59 3b 20 77 69 74 68 6f 75 74 ut.WITHOUT.ANY.WARRANTY;.without
0de0 20 65 76 65 6e 20 74 68 65 20 69 6d 70 6c 69 65 64 20 77 61 72 72 61 6e 74 79 20 6f 66 0d 0a 20 .even.the.implied.warranty.of...
0e00 2a 20 4d 45 52 43 48 41 4e 54 41 42 49 4c 49 54 59 20 6f 72 20 46 49 54 4e 45 53 53 20 46 4f 52 *.MERCHANTABILITY.or.FITNESS.FOR
0e20 20 41 20 50 41 52 54 49 43 55 4c 41 52 20 50 55 52 50 4f 53 45 2e 20 20 53 65 65 20 74 68 65 0d .A.PARTICULAR.PURPOSE...See.the.
0e40 0a 20 2a 20 47 4e 55 20 47 65 6e 65 72 61 6c 20 50 75 62 6c 69 63 20 4c 69 63 65 6e 73 65 20 66 ..*.GNU.General.Public.License.f
0e60 6f 72 20 6d 6f 72 65 20 64 65 74 61 69 6c 73 2e 0d 0a 20 2a 0d 0a 20 2a 20 59 6f 75 20 73 68 6f or.more.details....*...*.You.sho
0e80 75 6c 64 20 68 61 76 65 20 72 65 63 65 69 76 65 64 20 61 20 63 6f 70 79 20 6f 66 20 74 68 65 20 uld.have.received.a.copy.of.the.
0ea0 47 4e 55 20 47 65 6e 65 72 61 6c 20 50 75 62 6c 69 63 20 4c 69 63 65 6e 73 65 0d 0a 20 2a 20 61 GNU.General.Public.License...*.a
0ec0 6c 6f 6e 67 20 77 69 74 68 20 58 4d 50 50 48 50 3b 20 69 66 20 6e 6f 74 2c 20 77 72 69 74 65 20 long.with.XMPPHP;.if.not,.write.
0ee0 74 6f 20 74 68 65 20 46 72 65 65 20 53 6f 66 74 77 61 72 65 0d 0a 20 2a 20 46 6f 75 6e 64 61 74 to.the.Free.Software...*.Foundat
0f00 69 6f 6e 2c 20 49 6e 63 2e 2c 20 35 31 20 46 72 61 6e 6b 6c 69 6e 20 53 74 2c 20 46 69 66 74 68 ion,.Inc.,.51.Franklin.St,.Fifth
0f20 20 46 6c 6f 6f 72 2c 20 42 6f 73 74 6f 6e 2c 20 4d 41 20 20 30 32 31 31 30 2d 31 33 30 31 20 20 .Floor,.Boston,.MA..02110-1301..
0f40 55 53 41 0d 0a 20 2a 0d 0a 20 2a 20 40 63 61 74 65 67 6f 72 79 20 20 20 78 6d 70 70 68 70 0d 0a USA...*...*.@category...xmpphp..
0f60 20 2a 20 40 70 61 63 6b 61 67 65 20 20 20 20 58 4d 50 50 48 50 0d 0a 20 2a 20 40 61 75 74 68 6f .*.@package....XMPPHP...*.@autho
0f80 72 20 20 20 20 20 4e 61 74 68 61 6e 61 65 6c 20 43 2e 20 46 72 69 74 7a 20 3c 4a 49 44 3a 20 66 r.....Nathanael.C..Fritz.<JID:.f
0fa0 72 69 74 7a 79 40 6e 65 74 66 6c 69 6e 74 2e 6e 65 74 3e 0d 0a 20 2a 20 40 61 75 74 68 6f 72 20 ritzy@netflint.net>...*.@author.
0fc0 20 20 20 20 53 74 65 70 68 61 6e 20 57 65 6e 74 7a 20 3c 4a 49 44 3a 20 73 74 65 70 68 61 6e 40 ....Stephan.Wentz.<JID:.stephan@
0fe0 6a 61 62 62 65 72 2e 77 65 6e 74 7a 2e 69 74 3e 0d 0a 20 2a 20 40 61 75 74 68 6f 72 20 20 20 20 jabber.wentz.it>...*.@author....
1000 20 4d 69 63 68 61 65 6c 20 47 61 72 76 69 6e 20 3c 4a 49 44 3a 20 67 61 72 40 6e 65 74 66 6c 69 .Michael.Garvin.<JID:.gar@netfli
1020 6e 74 2e 6e 65 74 3e 0d 0a 20 2a 20 40 61 75 74 68 6f 72 20 20 20 20 20 41 6c 65 78 61 6e 64 65 nt.net>...*.@author.....Alexande
1040 72 20 42 69 72 6b 6e 65 72 20 28 68 74 74 70 73 3a 2f 2f 67 69 74 68 75 62 2e 63 6f 6d 2f 42 69 r.Birkner.(https://github.com/Bi
1060 72 6b 6e 65 72 41 6c 65 78 29 0d 0a 20 2a 20 40 63 6f 70 79 72 69 67 68 74 20 20 32 30 30 38 20 rknerAlex)...*.@copyright..2008.
1080 4e 61 74 68 61 6e 61 65 6c 20 43 2e 20 46 72 69 74 7a 0d 0a 20 2a 2f 0d 0a 2f 2a 2a 0d 0a 20 2a Nathanael.C..Fritz...*/../**...*
10a0 20 58 4d 50 50 48 50 20 4d 61 69 6e 20 43 6c 61 73 73 0d 0a 20 2a 0d 0a 20 2a 20 40 63 61 74 65 .XMPPHP.Main.Class...*...*.@cate
10c0 67 6f 72 79 20 20 20 78 6d 70 70 68 70 0d 0a 20 2a 20 40 70 61 63 6b 61 67 65 20 20 20 20 58 4d gory...xmpphp...*.@package....XM
10e0 50 50 48 50 0d 0a 20 2a 20 40 61 75 74 68 6f 72 20 20 20 20 20 4e 61 74 68 61 6e 61 65 6c 20 43 PPHP...*.@author.....Nathanael.C
1100 2e 20 46 72 69 74 7a 20 3c 4a 49 44 3a 20 66 72 69 74 7a 79 40 6e 65 74 66 6c 69 6e 74 2e 6e 65 ..Fritz.<JID:.fritzy@netflint.ne
1120 74 3e 0d 0a 20 2a 20 40 61 75 74 68 6f 72 20 20 20 20 20 53 74 65 70 68 61 6e 20 57 65 6e 74 7a t>...*.@author.....Stephan.Wentz
1140 20 3c 4a 49 44 3a 20 73 74 65 70 68 61 6e 40 6a 61 62 62 65 72 2e 77 65 6e 74 7a 2e 69 74 3e 0d .<JID:.stephan@jabber.wentz.it>.
1160 0a 20 2a 20 40 61 75 74 68 6f 72 20 20 20 20 20 4d 69 63 68 61 65 6c 20 47 61 72 76 69 6e 20 3c ..*.@author.....Michael.Garvin.<
1180 4a 49 44 3a 20 67 61 72 40 6e 65 74 66 6c 69 6e 74 2e 6e 65 74 3e 0d 0a 20 2a 20 40 63 6f 70 79 JID:.gar@netflint.net>...*.@copy
11a0 72 69 67 68 74 20 20 32 30 30 38 20 4e 61 74 68 61 6e 61 65 6c 20 43 2e 20 46 72 69 74 7a 0d 0a right..2008.Nathanael.C..Fritz..
11c0 20 2a 20 40 76 65 72 73 69 6f 6e 20 20 20 20 24 49 64 24 0d 0a 20 2a 2f 0d 0a 63 6c 61 73 73 20 .*.@version....$Id$...*/..class.
11e0 52 6f 73 74 65 72 20 7b 0d 0a 09 2f 2a 2a 0d 0a 09 20 2a 20 52 6f 73 74 65 72 20 61 72 72 61 79 Roster.{.../**....*.Roster.array
1200 2c 20 68 61 6e 64 6c 65 73 20 63 6f 6e 74 61 63 74 73 20 61 6e 64 20 70 72 65 73 65 6e 63 65 2e ,.handles.contacts.and.presence.
1220 20 20 49 6e 64 65 78 65 64 20 62 79 20 6a 69 64 2e 0d 0a 09 20 2a 20 43 6f 6e 74 61 69 6e 73 20 ..Indexed.by.jid.....*.Contains.
1240 61 72 72 61 79 20 77 69 74 68 20 70 6f 74 65 6e 74 69 61 6c 6c 79 20 74 77 6f 20 69 6e 64 65 78 array.with.potentially.two.index
1260 65 73 20 27 63 6f 6e 74 61 63 74 27 20 61 6e 64 20 27 70 72 65 73 65 6e 63 65 27 0d 0a 09 20 2a es.'contact'.and.'presence'....*
1280 20 40 76 61 72 20 61 72 72 61 79 0d 0a 09 20 2a 2f 0d 0a 09 70 72 6f 74 65 63 74 65 64 20 24 72 .@var.array....*/...protected.$r
12a0 6f 73 74 65 72 5f 61 72 72 61 79 20 3d 20 61 72 72 61 79 28 29 3b 0d 0a 09 2f 2a 2a 0d 0a 09 20 oster_array.=.array();.../**....
12c0 2a 20 43 6f 6e 73 74 72 75 63 74 6f 72 0d 0a 09 20 2a 20 0d 0a 09 20 2a 2f 0d 0a 09 70 75 62 6c *.Constructor....*.....*/...publ
12e0 69 63 20 66 75 6e 63 74 69 6f 6e 20 5f 5f 63 6f 6e 73 74 72 75 63 74 28 24 72 6f 73 74 65 72 5f ic.function.__construct($roster_
1300 61 72 72 61 79 20 3d 20 61 72 72 61 79 28 29 29 20 7b 0d 0a 09 09 69 66 20 28 24 74 68 69 73 2d array.=.array()).{....if.($this-
1320 3e 76 65 72 69 66 79 52 6f 73 74 65 72 28 24 72 6f 73 74 65 72 5f 61 72 72 61 79 29 29 20 7b 0d >verifyRoster($roster_array)).{.
1340 0a 09 09 09 24 74 68 69 73 2d 3e 72 6f 73 74 65 72 5f 61 72 72 61 79 20 3d 20 24 72 6f 73 74 65 ....$this->roster_array.=.$roste
1360 72 5f 61 72 72 61 79 3b 20 2f 2f 41 6c 6c 6f 77 20 66 6f 72 20 70 72 65 70 6f 70 75 6c 61 74 69 r_array;.//Allow.for.prepopulati
1380 6f 6e 20 77 69 74 68 20 65 78 69 73 74 69 6e 67 20 72 6f 73 74 65 72 0d 0a 09 09 7d 20 65 6c 73 on.with.existing.roster....}.els
13a0 65 20 7b 0d 0a 09 09 09 24 74 68 69 73 2d 3e 72 6f 73 74 65 72 5f 61 72 72 61 79 20 3d 20 61 72 e.{.....$this->roster_array.=.ar
13c0 72 61 79 28 29 3b 0d 0a 09 09 7d 0d 0a 09 7d 0d 0a 09 2f 2a 2a 0d 0a 09 20 2a 0d 0a 09 20 2a 20 ray();....}...}.../**....*....*.
13e0 43 68 65 63 6b 20 74 68 61 74 20 61 20 67 69 76 65 6e 20 72 6f 73 74 65 72 20 61 72 72 61 79 20 Check.that.a.given.roster.array.
1400 69 73 20 6f 66 20 61 20 76 61 6c 69 64 20 73 74 72 75 63 74 75 72 65 20 28 65 6d 70 74 79 20 69 is.of.a.valid.structure.(empty.i
1420 73 20 73 74 69 6c 6c 20 76 61 6c 69 64 29 0d 0a 09 20 2a 0d 0a 09 20 2a 20 40 70 61 72 61 6d 20 s.still.valid)....*....*.@param.
1440 61 72 72 61 79 20 24 72 6f 73 74 65 72 5f 61 72 72 61 79 0d 0a 09 20 2a 2f 0d 0a 09 70 72 6f 74 array.$roster_array....*/...prot
1460 65 63 74 65 64 20 66 75 6e 63 74 69 6f 6e 20 76 65 72 69 66 79 52 6f 73 74 65 72 28 24 72 6f 73 ected.function.verifyRoster($ros
1480 74 65 72 5f 61 72 72 61 79 29 20 7b 0d 0a 09 09 23 54 4f 44 4f 20 6f 6e 63 65 20 77 65 20 6b 6e ter_array).{....#TODO.once.we.kn
14a0 6f 77 20 2a 77 68 61 74 2a 20 61 20 76 61 6c 69 64 20 72 6f 73 74 65 72 20 61 72 72 61 79 20 6c ow.*what*.a.valid.roster.array.l
14c0 6f 6f 6b 73 20 6c 69 6b 65 0d 0a 09 09 72 65 74 75 72 6e 20 54 72 75 65 3b 0d 0a 09 7d 0d 0a 09 ooks.like....return.True;...}...
14e0 2f 2a 2a 0d 0a 09 20 2a 0d 0a 09 20 2a 20 41 64 64 20 67 69 76 65 6e 20 63 6f 6e 74 61 63 74 20 /**....*....*.Add.given.contact.
1500 74 6f 20 72 6f 73 74 65 72 0d 0a 09 20 2a 0d 0a 09 20 2a 20 40 70 61 72 61 6d 20 73 74 72 69 6e to.roster....*....*.@param.strin
1520 67 20 24 6a 69 64 0d 0a 09 20 2a 20 40 70 61 72 61 6d 20 73 74 72 69 6e 67 20 24 73 75 62 73 63 g.$jid....*.@param.string.$subsc
1540 72 69 70 74 69 6f 6e 0d 0a 09 20 2a 20 40 70 61 72 61 6d 20 73 74 72 69 6e 67 20 24 6e 61 6d 65 ription....*.@param.string.$name
1560 0d 0a 09 20 2a 20 40 70 61 72 61 6d 20 61 72 72 61 79 20 24 67 72 6f 75 70 73 0d 0a 09 20 2a 2f ....*.@param.array.$groups....*/
1580 0d 0a 09 70 75 62 6c 69 63 20 66 75 6e 63 74 69 6f 6e 20 61 64 64 43 6f 6e 74 61 63 74 28 24 6a ...public.function.addContact($j
15a0 69 64 2c 20 24 73 75 62 73 63 72 69 70 74 69 6f 6e 2c 20 24 6e 61 6d 65 3d 27 27 2c 20 24 67 72 id,.$subscription,.$name='',.$gr
15c0 6f 75 70 73 3d 61 72 72 61 79 28 29 29 20 7b 0d 0a 09 09 24 63 6f 6e 74 61 63 74 20 3d 20 61 72 oups=array()).{....$contact.=.ar
15e0 72 61 79 28 27 6a 69 64 27 20 3d 3e 20 24 6a 69 64 2c 20 27 73 75 62 73 63 72 69 70 74 69 6f 6e ray('jid'.=>.$jid,.'subscription
1600 27 20 3d 3e 20 24 73 75 62 73 63 72 69 70 74 69 6f 6e 2c 20 27 6e 61 6d 65 27 20 3d 3e 20 24 6e '.=>.$subscription,.'name'.=>.$n
1620 61 6d 65 2c 20 27 67 72 6f 75 70 73 27 20 3d 3e 20 24 67 72 6f 75 70 73 29 3b 0d 0a 09 09 69 66 ame,.'groups'.=>.$groups);....if
1640 20 28 24 74 68 69 73 2d 3e 69 73 43 6f 6e 74 61 63 74 28 24 6a 69 64 29 29 20 7b 0d 0a 09 09 09 .($this->isContact($jid)).{.....
1660 24 74 68 69 73 2d 3e 72 6f 73 74 65 72 5f 61 72 72 61 79 5b 24 6a 69 64 5d 5b 27 63 6f 6e 74 61 $this->roster_array[$jid]['conta
1680 63 74 27 5d 20 3d 20 24 63 6f 6e 74 61 63 74 3b 0d 0a 09 09 7d 20 65 6c 73 65 20 7b 0d 0a 09 09 ct'].=.$contact;....}.else.{....
16a0 09 24 74 68 69 73 2d 3e 72 6f 73 74 65 72 5f 61 72 72 61 79 5b 24 6a 69 64 5d 20 3d 20 61 72 72 .$this->roster_array[$jid].=.arr
16c0 61 79 28 27 63 6f 6e 74 61 63 74 27 20 3d 3e 20 24 63 6f 6e 74 61 63 74 29 3b 0d 0a 09 09 7d 0d ay('contact'.=>.$contact);....}.
16e0 0a 09 7d 0d 0a 09 2f 2a 2a 0d 0a 09 20 2a 20 0d 0a 09 20 2a 20 52 65 74 72 69 65 76 65 20 63 6f ..}.../**....*.....*.Retrieve.co
1700 6e 74 61 63 74 20 76 69 61 20 6a 69 64 0d 0a 09 20 2a 0d 0a 09 20 2a 20 40 70 61 72 61 6d 20 73 ntact.via.jid....*....*.@param.s
1720 74 72 69 6e 67 20 24 6a 69 64 0d 0a 09 20 2a 2f 0d 0a 09 70 75 62 6c 69 63 20 66 75 6e 63 74 69 tring.$jid....*/...public.functi
1740 6f 6e 20 67 65 74 43 6f 6e 74 61 63 74 28 24 6a 69 64 29 20 7b 0d 0a 09 09 69 66 20 28 24 74 68 on.getContact($jid).{....if.($th
1760 69 73 2d 3e 69 73 43 6f 6e 74 61 63 74 28 24 6a 69 64 29 29 20 7b 0d 0a 09 09 09 72 65 74 75 72 is->isContact($jid)).{.....retur
1780 6e 20 24 74 68 69 73 2d 3e 72 6f 73 74 65 72 5f 61 72 72 61 79 5b 24 6a 69 64 5d 5b 27 63 6f 6e n.$this->roster_array[$jid]['con
17a0 74 61 63 74 27 5d 3b 0d 0a 09 09 7d 0d 0a 09 7d 0d 0a 09 2f 2a 2a 0d 0a 09 20 2a 0d 0a 09 20 2a tact'];....}...}.../**....*....*
17c0 20 44 69 73 63 6f 76 65 72 20 69 66 20 61 20 63 6f 6e 74 61 63 74 20 65 78 69 73 74 73 20 69 6e .Discover.if.a.contact.exists.in
17e0 20 74 68 65 20 72 6f 73 74 65 72 20 76 69 61 20 6a 69 64 0d 0a 09 20 2a 0d 0a 09 20 2a 20 40 70 .the.roster.via.jid....*....*.@p
1800 61 72 61 6d 20 73 74 72 69 6e 67 20 24 6a 69 64 0d 0a 09 20 2a 2f 0d 0a 09 70 75 62 6c 69 63 20 aram.string.$jid....*/...public.
1820 66 75 6e 63 74 69 6f 6e 20 69 73 43 6f 6e 74 61 63 74 28 24 6a 69 64 29 20 7b 0d 0a 09 09 72 65 function.isContact($jid).{....re
1840 74 75 72 6e 20 28 61 72 72 61 79 5f 6b 65 79 5f 65 78 69 73 74 73 28 24 6a 69 64 2c 20 24 74 68 turn.(array_key_exists($jid,.$th
1860 69 73 2d 3e 72 6f 73 74 65 72 5f 61 72 72 61 79 29 29 3b 0d 0a 09 7d 0d 0a 09 2f 2a 2a 0d 0a 09 is->roster_array));...}.../**...
1880 20 2a 0d 0a 09 20 2a 20 53 65 74 20 70 72 65 73 65 6e 63 65 0d 0a 09 20 2a 0d 0a 09 20 2a 20 40 .*....*.Set.presence....*....*.@
18a0 70 61 72 61 6d 20 73 74 72 69 6e 67 20 24 70 72 65 73 65 6e 63 65 0d 0a 09 20 2a 20 40 70 61 72 param.string.$presence....*.@par
18c0 61 6d 20 69 6e 74 65 67 65 72 20 24 70 72 69 6f 72 69 74 79 0d 0a 09 20 2a 20 40 70 61 72 61 6d am.integer.$priority....*.@param
18e0 20 73 74 72 69 6e 67 20 24 73 68 6f 77 0d 0a 09 20 2a 20 40 70 61 72 61 6d 20 73 74 72 69 6e 67 .string.$show....*.@param.string
1900 20 24 73 74 61 74 75 73 0d 0a 09 2a 2f 0d 0a 09 70 75 62 6c 69 63 20 66 75 6e 63 74 69 6f 6e 20 .$status...*/...public.function.
1920 73 65 74 50 72 65 73 65 6e 63 65 28 24 70 72 65 73 65 6e 63 65 2c 20 24 70 72 69 6f 72 69 74 79 setPresence($presence,.$priority
1940 2c 20 24 73 68 6f 77 2c 20 24 73 74 61 74 75 73 29 20 7b 0d 0a 09 09 24 70 72 65 73 65 6e 63 65 ,.$show,.$status).{....$presence
1960 20 3d 20 65 78 70 6c 6f 64 65 28 27 2f 27 2c 20 24 70 72 65 73 65 6e 63 65 2c 20 32 29 3b 0d 0a .=.explode('/',.$presence,.2);..
1980 09 09 24 6a 69 64 20 3d 20 24 70 72 65 73 65 6e 63 65 5b 30 5d 3b 0d 0a 09 09 24 72 65 73 6f 75 ..$jid.=.$presence[0];....$resou
19a0 72 63 65 20 3d 20 69 73 73 65 74 28 24 70 72 65 73 65 6e 63 65 5b 31 5d 29 20 3f 20 24 70 72 65 rce.=.isset($presence[1]).?.$pre
19c0 73 65 6e 63 65 5b 31 5d 20 3a 20 27 27 3b 0d 0a 09 09 69 66 20 28 24 73 68 6f 77 20 21 3d 20 27 sence[1].:.'';....if.($show.!=.'
19e0 75 6e 61 76 61 69 6c 61 62 6c 65 27 29 20 7b 0d 0a 09 09 09 69 66 20 28 21 24 74 68 69 73 2d 3e unavailable').{.....if.(!$this->
1a00 69 73 43 6f 6e 74 61 63 74 28 24 6a 69 64 29 29 20 7b 0d 0a 09 09 09 09 24 74 68 69 73 2d 3e 61 isContact($jid)).{......$this->a
1a20 64 64 43 6f 6e 74 61 63 74 28 24 6a 69 64 2c 20 27 6e 6f 74 2d 69 6e 2d 72 6f 73 74 65 72 27 29 ddContact($jid,.'not-in-roster')
1a40 3b 0d 0a 09 09 09 7d 0d 0a 09 09 09 24 74 68 69 73 2d 3e 72 6f 73 74 65 72 5f 61 72 72 61 79 5b ;.....}.....$this->roster_array[
1a60 24 6a 69 64 5d 5b 27 70 72 65 73 65 6e 63 65 27 5d 5b 24 72 65 73 6f 75 72 63 65 5d 20 3d 20 61 $jid]['presence'][$resource].=.a
1a80 72 72 61 79 28 27 70 72 69 6f 72 69 74 79 27 20 3d 3e 20 24 70 72 69 6f 72 69 74 79 2c 20 27 73 rray('priority'.=>.$priority,.'s
1aa0 68 6f 77 27 20 3d 3e 20 24 73 68 6f 77 2c 20 27 73 74 61 74 75 73 27 20 3d 3e 20 24 73 74 61 74 how'.=>.$show,.'status'.=>.$stat
1ac0 75 73 29 3b 0d 0a 09 09 7d 20 65 6c 73 65 20 7b 20 2f 2f 4e 75 6b 65 20 75 6e 61 76 61 69 6c 61 us);....}.else.{.//Nuke.unavaila
1ae0 62 6c 65 20 72 65 73 6f 75 72 63 65 73 20 74 6f 20 73 61 76 65 20 6d 65 6d 6f 72 79 0d 0a 09 09 ble.resources.to.save.memory....
1b00 09 75 6e 73 65 74 28 24 74 68 69 73 2d 3e 72 6f 73 74 65 72 5f 61 72 72 61 79 5b 24 6a 69 64 5d .unset($this->roster_array[$jid]
1b20 5b 27 72 65 73 6f 75 72 63 65 27 5d 5b 24 72 65 73 6f 75 72 63 65 5d 29 3b 0d 0a 09 09 09 75 6e ['resource'][$resource]);.....un
1b40 73 65 74 28 24 74 68 69 73 2d 3e 72 6f 73 74 65 72 5f 61 72 72 61 79 5b 24 6a 69 64 5d 5b 27 70 set($this->roster_array[$jid]['p
1b60 72 65 73 65 6e 63 65 27 5d 5b 24 72 65 73 6f 75 72 63 65 5d 29 3b 0d 0a 09 09 7d 0d 0a 09 7d 0d resence'][$resource]);....}...}.
1b80 0a 09 2f 2a 0d 0a 09 20 2a 0d 0a 09 20 2a 20 52 65 74 75 72 6e 20 62 65 73 74 20 70 72 65 73 65 ../*....*....*.Return.best.prese
1ba0 6e 63 65 20 66 6f 72 20 6a 69 64 0d 0a 09 20 2a 0d 0a 09 20 2a 20 40 70 61 72 61 6d 20 73 74 72 nce.for.jid....*....*.@param.str
1bc0 69 6e 67 20 24 6a 69 64 0d 0a 09 20 2a 2f 0d 0a 09 70 75 62 6c 69 63 20 66 75 6e 63 74 69 6f 6e ing.$jid....*/...public.function
1be0 20 67 65 74 50 72 65 73 65 6e 63 65 28 24 6a 69 64 29 20 7b 0d 0a 09 09 24 73 70 6c 69 74 20 3d .getPresence($jid).{....$split.=
1c00 20 65 78 70 6c 6f 64 65 28 27 2f 27 2c 20 24 6a 69 64 2c 20 32 29 3b 0d 0a 09 09 24 6a 69 64 20 .explode('/',.$jid,.2);....$jid.
1c20 3d 20 24 73 70 6c 69 74 5b 30 5d 3b 0d 0a 09 09 69 66 28 24 74 68 69 73 2d 3e 69 73 43 6f 6e 74 =.$split[0];....if($this->isCont
1c40 61 63 74 28 24 6a 69 64 29 29 20 7b 0d 0a 09 09 09 24 63 75 72 72 65 6e 74 20 3d 20 61 72 72 61 act($jid)).{.....$current.=.arra
1c60 79 28 27 72 65 73 6f 75 72 63 65 27 20 3d 3e 20 27 27 2c 20 27 61 63 74 69 76 65 27 20 3d 3e 20 y('resource'.=>.'',.'active'.=>.
1c80 27 27 2c 20 27 70 72 69 6f 72 69 74 79 27 20 3d 3e 20 2d 31 32 39 2c 20 27 73 68 6f 77 27 20 3d '',.'priority'.=>.-129,.'show'.=
1ca0 3e 20 27 27 2c 20 27 73 74 61 74 75 73 27 20 3d 3e 20 27 27 29 3b 20 2f 2f 50 72 69 6f 72 69 74 >.'',.'status'.=>.'');.//Priorit
1cc0 69 65 73 20 63 61 6e 20 6f 6e 6c 79 20 62 65 20 2d 31 32 38 20 3d 20 31 32 37 0d 0a 09 09 09 66 ies.can.only.be.-128.=.127.....f
1ce0 6f 72 65 61 63 68 28 24 74 68 69 73 2d 3e 72 6f 73 74 65 72 5f 61 72 72 61 79 5b 24 6a 69 64 5d oreach($this->roster_array[$jid]
1d00 5b 27 70 72 65 73 65 6e 63 65 27 5d 20 61 73 20 24 72 65 73 6f 75 72 63 65 20 3d 3e 20 24 70 72 ['presence'].as.$resource.=>.$pr
1d20 65 73 65 6e 63 65 29 20 7b 0d 0a 09 09 09 09 2f 2f 48 69 67 68 65 73 74 20 61 76 61 69 6c 61 62 esence).{......//Highest.availab
1d40 6c 65 20 70 72 69 6f 72 69 74 79 20 6f 72 20 6a 75 73 74 20 68 69 67 68 65 73 74 20 70 72 69 6f le.priority.or.just.highest.prio
1d60 72 69 74 79 0d 0a 09 09 09 09 69 66 20 28 24 70 72 65 73 65 6e 63 65 5b 27 70 72 69 6f 72 69 74 rity......if.($presence['priorit
1d80 79 27 5d 20 3e 20 24 63 75 72 72 65 6e 74 5b 27 70 72 69 6f 72 69 74 79 27 5d 20 61 6e 64 20 28 y'].>.$current['priority'].and.(
1da0 28 24 70 72 65 73 65 6e 63 65 5b 27 73 68 6f 77 27 5d 20 3d 3d 20 22 63 68 61 74 22 20 6f 72 20 ($presence['show'].==."chat".or.
1dc0 24 70 72 65 73 65 6e 63 65 5b 27 73 68 6f 77 27 5d 20 3d 3d 20 22 61 76 61 69 6c 61 62 6c 65 22 $presence['show'].==."available"
1de0 29 20 6f 72 20 28 24 63 75 72 72 65 6e 74 5b 27 73 68 6f 77 27 5d 20 21 3d 20 22 63 68 61 74 22 ).or.($current['show'].!=."chat"
1e00 20 6f 72 20 24 63 75 72 72 65 6e 74 5b 27 73 68 6f 77 27 5d 20 21 3d 20 22 61 76 61 69 6c 61 62 .or.$current['show'].!=."availab
1e20 6c 65 22 29 29 29 20 7b 0d 0a 09 09 09 09 09 24 63 75 72 72 65 6e 74 20 3d 20 24 70 72 65 73 65 le"))).{.......$current.=.$prese
1e40 6e 63 65 3b 0d 0a 09 09 09 09 09 24 63 75 72 72 65 6e 74 5b 27 72 65 73 6f 75 72 63 65 27 5d 20 nce;.......$current['resource'].
1e60 3d 20 24 72 65 73 6f 75 72 63 65 3b 0d 0a 09 09 09 09 7d 0d 0a 09 09 09 7d 0d 0a 09 09 09 72 65 =.$resource;......}.....}.....re
1e80 74 75 72 6e 20 24 63 75 72 72 65 6e 74 3b 0d 0a 09 09 7d 0d 0a 09 7d 0d 0a 09 2f 2a 2a 0d 0a 09 turn.$current;....}...}.../**...
1ea0 20 2a 0d 0a 09 20 2a 20 47 65 74 20 72 6f 73 74 65 72 0d 0a 09 20 2a 0d 0a 09 20 2a 2f 0d 0a 09 .*....*.Get.roster....*....*/...
1ec0 70 75 62 6c 69 63 20 66 75 6e 63 74 69 6f 6e 20 67 65 74 52 6f 73 74 65 72 28 29 20 7b 0d 0a 09 public.function.getRoster().{...
1ee0 09 72 65 74 75 72 6e 20 24 74 68 69 73 2d 3e 72 6f 73 74 65 72 5f 61 72 72 61 79 3b 0d 0a 09 7d .return.$this->roster_array;...}
1f00 0d 0a 7d 0d 0a 3f 3e 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ..}..?>.........................
1f20 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
1f40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
1f60 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
1f80 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
1fa0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
1fc0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
1fe0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
2000 6c 69 62 2f 58 4d 4c 4f 62 6a 2e 70 68 70 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 lib/XMLObj.php..................
2020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
2040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
2060 00 00 00 00 30 30 30 30 36 34 34 00 30 30 30 31 37 35 30 00 30 30 30 31 37 35 30 00 30 30 30 30 ....0000644.0001750.0001750.0000
2080 30 30 30 37 33 30 33 00 31 32 37 37 33 30 33 31 30 33 37 00 30 31 32 32 33 30 00 20 30 00 00 00 0007303.12773031037.012230..0...
20a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
20c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
20e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
2100 00 75 73 74 61 72 20 20 00 74 7a 75 72 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 .ustar...tzur...................
2120 00 00 00 00 00 00 00 00 00 74 7a 75 72 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 .........tzur...................
2140 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
2160 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
2180 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
21a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
21c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
21e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
2200 3c 3f 70 68 70 0d 0a 09 2f 2a 2a 0d 0a 09 20 2a 20 58 4d 50 50 48 50 3a 20 54 68 65 20 50 48 50 <?php.../**....*.XMPPHP:.The.PHP
2220 20 58 4d 50 50 20 4c 69 62 72 61 72 79 0d 0a 09 20 2a 20 43 6f 70 79 72 69 67 68 74 20 28 43 29 .XMPP.Library....*.Copyright.(C)
2240 20 32 30 30 38 20 20 4e 61 74 68 61 6e 61 65 6c 20 43 2e 20 46 72 69 74 7a 0d 0a 09 20 2a 20 54 .2008..Nathanael.C..Fritz....*.T
2260 68 69 73 20 66 69 6c 65 20 69 73 20 70 61 72 74 20 6f 66 20 53 6c 65 65 6b 58 4d 50 50 2e 0d 0a his.file.is.part.of.SleekXMPP...
2280 09 20 2a 0d 0a 09 20 2a 20 58 4d 50 50 48 50 20 69 73 20 66 72 65 65 20 73 6f 66 74 77 61 72 65 ..*....*.XMPPHP.is.free.software
22a0 3b 20 79 6f 75 20 63 61 6e 20 72 65 64 69 73 74 72 69 62 75 74 65 20 69 74 20 61 6e 64 2f 6f 72 ;.you.can.redistribute.it.and/or
22c0 20 6d 6f 64 69 66 79 0d 0a 09 20 2a 20 69 74 20 75 6e 64 65 72 20 74 68 65 20 74 65 72 6d 73 20 .modify....*.it.under.the.terms.
22e0 6f 66 20 74 68 65 20 47 4e 55 20 47 65 6e 65 72 61 6c 20 50 75 62 6c 69 63 20 4c 69 63 65 6e 73 of.the.GNU.General.Public.Licens
2300 65 20 61 73 20 70 75 62 6c 69 73 68 65 64 20 62 79 0d 0a 09 20 2a 20 74 68 65 20 46 72 65 65 20 e.as.published.by....*.the.Free.
2320 53 6f 66 74 77 61 72 65 20 46 6f 75 6e 64 61 74 69 6f 6e 3b 20 65 69 74 68 65 72 20 76 65 72 73 Software.Foundation;.either.vers
2340 69 6f 6e 20 32 20 6f 66 20 74 68 65 20 4c 69 63 65 6e 73 65 2c 20 6f 72 0d 0a 09 20 2a 20 28 61 ion.2.of.the.License,.or....*.(a
2360 74 20 79 6f 75 72 20 6f 70 74 69 6f 6e 29 20 61 6e 79 20 6c 61 74 65 72 20 76 65 72 73 69 6f 6e t.your.option).any.later.version
2380 2e 0d 0a 09 20 2a 0d 0a 09 20 2a 20 58 4d 50 50 48 50 20 69 73 20 64 69 73 74 72 69 62 75 74 65 .....*....*.XMPPHP.is.distribute
23a0 64 20 69 6e 20 74 68 65 20 68 6f 70 65 20 74 68 61 74 20 69 74 20 77 69 6c 6c 20 62 65 20 75 73 d.in.the.hope.that.it.will.be.us
23c0 65 66 75 6c 2c 0d 0a 09 20 2a 20 62 75 74 20 57 49 54 48 4f 55 54 20 41 4e 59 20 57 41 52 52 41 eful,....*.but.WITHOUT.ANY.WARRA
23e0 4e 54 59 3b 20 77 69 74 68 6f 75 74 20 65 76 65 6e 20 74 68 65 20 69 6d 70 6c 69 65 64 20 77 61 NTY;.without.even.the.implied.wa
2400 72 72 61 6e 74 79 20 6f 66 0d 0a 09 20 2a 20 4d 45 52 43 48 41 4e 54 41 42 49 4c 49 54 59 20 6f rranty.of....*.MERCHANTABILITY.o
2420 72 20 46 49 54 4e 45 53 53 20 46 4f 52 20 41 20 50 41 52 54 49 43 55 4c 41 52 20 50 55 52 50 4f r.FITNESS.FOR.A.PARTICULAR.PURPO
2440 53 45 2e 20 20 53 65 65 20 74 68 65 0d 0a 09 20 2a 20 47 4e 55 20 47 65 6e 65 72 61 6c 20 50 75 SE...See.the....*.GNU.General.Pu
2460 62 6c 69 63 20 4c 69 63 65 6e 73 65 20 66 6f 72 20 6d 6f 72 65 20 64 65 74 61 69 6c 73 2e 0d 0a blic.License.for.more.details...
2480 09 20 2a 0d 0a 09 20 2a 20 59 6f 75 20 73 68 6f 75 6c 64 20 68 61 76 65 20 72 65 63 65 69 76 65 ..*....*.You.should.have.receive
24a0 64 20 61 20 63 6f 70 79 20 6f 66 20 74 68 65 20 47 4e 55 20 47 65 6e 65 72 61 6c 20 50 75 62 6c d.a.copy.of.the.GNU.General.Publ
24c0 69 63 20 4c 69 63 65 6e 73 65 0d 0a 09 20 2a 20 61 6c 6f 6e 67 20 77 69 74 68 20 58 4d 50 50 48 ic.License....*.along.with.XMPPH
24e0 50 3b 20 69 66 20 6e 6f 74 2c 20 77 72 69 74 65 20 74 6f 20 74 68 65 20 46 72 65 65 20 53 6f 66 P;.if.not,.write.to.the.Free.Sof
2500 74 77 61 72 65 0d 0a 09 20 2a 20 46 6f 75 6e 64 61 74 69 6f 6e 2c 20 49 6e 63 2e 2c 20 35 31 20 tware....*.Foundation,.Inc.,.51.
2520 46 72 61 6e 6b 6c 69 6e 20 53 74 2c 20 46 69 66 74 68 20 46 6c 6f 6f 72 2c 20 42 6f 73 74 6f 6e Franklin.St,.Fifth.Floor,.Boston
2540 2c 20 4d 41 20 20 30 32 31 31 30 2d 31 33 30 31 20 20 55 53 41 0d 0a 09 20 2a 0d 0a 09 20 2a 20 ,.MA..02110-1301..USA....*....*.
2560 40 63 61 74 65 67 6f 72 79 20 20 20 78 6d 70 70 68 70 0d 0a 09 20 2a 20 40 70 61 63 6b 61 67 65 @category...xmpphp....*.@package
2580 20 20 20 20 58 4d 50 50 48 50 0d 0a 09 20 2a 20 40 61 75 74 68 6f 72 20 20 20 20 20 4e 61 74 68 ....XMPPHP....*.@author.....Nath
25a0 61 6e 61 65 6c 20 43 2e 20 46 72 69 74 7a 20 3c 4a 49 44 3a 20 66 72 69 74 7a 79 40 6e 65 74 66 anael.C..Fritz.<JID:.fritzy@netf
25c0 6c 69 6e 74 2e 6e 65 74 3e 0d 0a 09 20 2a 20 40 61 75 74 68 6f 72 20 20 20 20 20 53 74 65 70 68 lint.net>....*.@author.....Steph
25e0 61 6e 20 57 65 6e 74 7a 20 3c 4a 49 44 3a 20 73 74 65 70 68 61 6e 40 6a 61 62 62 65 72 2e 77 65 an.Wentz.<JID:.stephan@jabber.we
2600 6e 74 7a 2e 69 74 3e 0d 0a 09 20 2a 20 40 61 75 74 68 6f 72 20 20 20 20 20 4d 69 63 68 61 65 6c ntz.it>....*.@author.....Michael
2620 20 47 61 72 76 69 6e 20 3c 4a 49 44 3a 20 67 61 72 40 6e 65 74 66 6c 69 6e 74 2e 6e 65 74 3e 0d .Garvin.<JID:.gar@netflint.net>.
2640 0a 09 20 2a 20 40 61 75 74 68 6f 72 20 20 20 20 20 41 6c 65 78 61 6e 64 65 72 20 42 69 72 6b 6e ...*.@author.....Alexander.Birkn
2660 65 72 20 28 68 74 74 70 73 3a 2f 2f 67 69 74 68 75 62 2e 63 6f 6d 2f 42 69 72 6b 6e 65 72 41 6c er.(https://github.com/BirknerAl
2680 65 78 29 0d 0a 09 20 2a 20 40 63 6f 70 79 72 69 67 68 74 20 20 32 30 30 38 20 4e 61 74 68 61 6e ex)....*.@copyright..2008.Nathan
26a0 61 65 6c 20 43 2e 20 46 72 69 74 7a 0d 0a 09 20 2a 2f 0d 0a 2f 2a 2a 0d 0a 20 2a 20 58 4d 50 50 ael.C..Fritz....*/../**...*.XMPP
26c0 48 50 20 4d 61 69 6e 20 43 6c 61 73 73 0d 0a 20 2a 0d 0a 20 2a 20 40 63 61 74 65 67 6f 72 79 20 HP.Main.Class...*...*.@category.
26e0 20 20 78 6d 70 70 68 70 0d 0a 20 2a 20 40 70 61 63 6b 61 67 65 20 20 20 20 58 4d 50 50 48 50 0d ..xmpphp...*.@package....XMPPHP.
2700 0a 20 2a 20 40 61 75 74 68 6f 72 20 20 20 20 20 4e 61 74 68 61 6e 61 65 6c 20 43 2e 20 46 72 69 ..*.@author.....Nathanael.C..Fri
2720 74 7a 20 3c 4a 49 44 3a 20 66 72 69 74 7a 79 40 6e 65 74 66 6c 69 6e 74 2e 6e 65 74 3e 0d 0a 20 tz.<JID:.fritzy@netflint.net>...
2740 2a 20 40 61 75 74 68 6f 72 20 20 20 20 20 53 74 65 70 68 61 6e 20 57 65 6e 74 7a 20 3c 4a 49 44 *.@author.....Stephan.Wentz.<JID
2760 3a 20 73 74 65 70 68 61 6e 40 6a 61 62 62 65 72 2e 77 65 6e 74 7a 2e 69 74 3e 0d 0a 20 2a 20 40 :.stephan@jabber.wentz.it>...*.@
2780 61 75 74 68 6f 72 20 20 20 20 20 4d 69 63 68 61 65 6c 20 47 61 72 76 69 6e 20 3c 4a 49 44 3a 20 author.....Michael.Garvin.<JID:.
27a0 67 61 72 40 6e 65 74 66 6c 69 6e 74 2e 6e 65 74 3e 0d 0a 20 2a 20 40 63 6f 70 79 72 69 67 68 74 gar@netflint.net>...*.@copyright
27c0 20 20 32 30 30 38 20 4e 61 74 68 61 6e 61 65 6c 20 43 2e 20 46 72 69 74 7a 0d 0a 20 2a 20 40 76 ..2008.Nathanael.C..Fritz...*.@v
27e0 65 72 73 69 6f 6e 20 20 20 20 24 49 64 24 0d 0a 20 2a 2f 0d 0a 63 6c 61 73 73 20 58 4d 4c 4f 62 ersion....$Id$...*/..class.XMLOb
2800 6a 20 7b 0d 0a 09 2f 2a 2a 0d 0a 09 20 2a 20 54 61 67 20 6e 61 6d 65 0d 0a 09 20 2a 0d 0a 09 20 j.{.../**....*.Tag.name....*....
2820 2a 20 40 76 61 72 20 73 74 72 69 6e 67 0d 0a 09 20 2a 2f 0d 0a 09 70 75 62 6c 69 63 20 24 6e 61 *.@var.string....*/...public.$na
2840 6d 65 3b 0d 0a 09 0d 0a 09 2f 2a 2a 0d 0a 09 20 2a 20 4e 61 6d 65 73 70 61 63 65 0d 0a 09 20 2a me;....../**....*.Namespace....*
2860 0d 0a 09 20 2a 20 40 76 61 72 20 73 74 72 69 6e 67 0d 0a 09 20 2a 2f 0d 0a 09 70 75 62 6c 69 63 ....*.@var.string....*/...public
2880 20 24 6e 73 3b 0d 0a 09 0d 0a 09 2f 2a 2a 0d 0a 09 20 2a 20 41 74 74 72 69 62 75 74 65 73 0d 0a .$ns;....../**....*.Attributes..
28a0 09 20 2a 0d 0a 09 20 2a 20 40 76 61 72 20 61 72 72 61 79 0d 0a 09 20 2a 2f 0d 0a 09 70 75 62 6c ..*....*.@var.array....*/...publ
28c0 69 63 20 24 61 74 74 72 73 20 3d 20 61 72 72 61 79 28 29 3b 0d 0a 09 0d 0a 09 2f 2a 2a 0d 0a 09 ic.$attrs.=.array();....../**...
28e0 20 2a 20 53 75 62 73 3f 0d 0a 09 20 2a 0d 0a 09 20 2a 20 40 76 61 72 20 61 72 72 61 79 0d 0a 09 .*.Subs?....*....*.@var.array...
2900 20 2a 2f 0d 0a 09 70 75 62 6c 69 63 20 24 73 75 62 73 20 3d 20 61 72 72 61 79 28 29 3b 0d 0a 09 .*/...public.$subs.=.array();...
2920 0d 0a 09 2f 2a 2a 0d 0a 09 20 2a 20 4e 6f 64 65 20 64 61 74 61 0d 0a 09 20 2a 20 0d 0a 09 20 2a .../**....*.Node.data....*.....*
2940 20 40 76 61 72 20 73 74 72 69 6e 67 0d 0a 09 20 2a 2f 0d 0a 09 70 75 62 6c 69 63 20 24 64 61 74 .@var.string....*/...public.$dat
2960 61 20 3d 20 27 27 3b 0d 0a 09 2f 2a 2a 0d 0a 09 20 2a 20 43 6f 6e 73 74 72 75 63 74 6f 72 0d 0a a.=.'';.../**....*.Constructor..
2980 09 20 2a 0d 0a 09 20 2a 20 40 70 61 72 61 6d 20 73 74 72 69 6e 67 20 24 6e 61 6d 65 0d 0a 09 20 ..*....*.@param.string.$name....
29a0 2a 20 40 70 61 72 61 6d 20 73 74 72 69 6e 67 20 24 6e 73 0d 0a 09 20 2a 20 40 70 61 72 61 6d 20 *.@param.string.$ns....*.@param.
29c0 61 72 72 61 79 20 20 24 61 74 74 72 73 0d 0a 09 20 2a 20 40 70 61 72 61 6d 20 73 74 72 69 6e 67 array..$attrs....*.@param.string
29e0 20 24 64 61 74 61 0d 0a 09 20 2a 2f 0d 0a 09 70 75 62 6c 69 63 20 66 75 6e 63 74 69 6f 6e 20 5f .$data....*/...public.function._
2a00 5f 63 6f 6e 73 74 72 75 63 74 28 24 6e 61 6d 65 2c 20 24 6e 73 20 3d 20 27 27 2c 20 24 61 74 74 _construct($name,.$ns.=.'',.$att
2a20 72 73 20 3d 20 61 72 72 61 79 28 29 2c 20 24 64 61 74 61 20 3d 20 27 27 29 20 7b 0d 0a 09 09 24 rs.=.array(),.$data.=.'').{....$
2a40 74 68 69 73 2d 3e 6e 61 6d 65 20 3d 20 73 74 72 74 6f 6c 6f 77 65 72 28 24 6e 61 6d 65 29 3b 0d this->name.=.strtolower($name);.
2a60 0a 09 09 24 74 68 69 73 2d 3e 6e 73 20 20 20 3d 20 24 6e 73 3b 0d 0a 09 09 69 66 28 69 73 5f 61 ...$this->ns...=.$ns;....if(is_a
2a80 72 72 61 79 28 24 61 74 74 72 73 29 20 26 26 20 63 6f 75 6e 74 28 24 61 74 74 72 73 29 29 20 7b rray($attrs).&&.count($attrs)).{
2aa0 0d 0a 09 09 09 66 6f 72 65 61 63 68 28 24 61 74 74 72 73 20 61 73 20 24 6b 65 79 20 3d 3e 20 24 .....foreach($attrs.as.$key.=>.$
2ac0 76 61 6c 75 65 29 20 7b 0d 0a 09 09 09 09 24 74 68 69 73 2d 3e 61 74 74 72 73 5b 73 74 72 74 6f value).{......$this->attrs[strto
2ae0 6c 6f 77 65 72 28 24 6b 65 79 29 5d 20 3d 20 24 76 61 6c 75 65 3b 0d 0a 09 09 09 7d 0d 0a 09 09 lower($key)].=.$value;.....}....
2b00 7d 0d 0a 09 09 24 74 68 69 73 2d 3e 64 61 74 61 20 3d 20 24 64 61 74 61 3b 0d 0a 09 7d 0d 0a 09 }....$this->data.=.$data;...}...
2b20 2f 2a 2a 0d 0a 09 20 2a 20 44 75 6d 70 20 74 68 69 73 20 58 4d 4c 20 4f 62 6a 65 63 74 20 74 6f /**....*.Dump.this.XML.Object.to
2b40 20 6f 75 74 70 75 74 2e 0d 0a 09 20 2a 0d 0a 09 20 2a 20 40 70 61 72 61 6d 20 69 6e 74 65 67 65 .output.....*....*.@param.intege
2b60 72 20 24 64 65 70 74 68 0d 0a 09 20 2a 2f 0d 0a 09 70 75 62 6c 69 63 20 66 75 6e 63 74 69 6f 6e r.$depth....*/...public.function
2b80 20 70 72 69 6e 74 4f 62 6a 28 24 64 65 70 74 68 20 3d 20 30 29 20 7b 0d 0a 09 09 70 72 69 6e 74 .printObj($depth.=.0).{....print
2ba0 20 73 74 72 5f 72 65 70 65 61 74 28 22 5c 74 22 2c 20 24 64 65 70 74 68 29 20 2e 20 24 74 68 69 .str_repeat("\t",.$depth)...$thi
2bc0 73 2d 3e 6e 61 6d 65 20 2e 20 22 20 22 20 2e 20 24 74 68 69 73 2d 3e 6e 73 20 2e 20 27 20 27 20 s->name..."."...$this->ns...'.'.
2be0 2e 20 24 74 68 69 73 2d 3e 64 61 74 61 3b 0d 0a 09 09 70 72 69 6e 74 20 22 5c 6e 22 3b 0d 0a 09 ..$this->data;....print."\n";...
2c00 09 66 6f 72 65 61 63 68 28 24 74 68 69 73 2d 3e 73 75 62 73 20 61 73 20 24 73 75 62 29 20 7b 0d .foreach($this->subs.as.$sub).{.
2c20 0a 09 09 09 24 73 75 62 2d 3e 70 72 69 6e 74 4f 62 6a 28 24 64 65 70 74 68 20 2b 20 31 29 3b 0d ....$sub->printObj($depth.+.1);.
2c40 0a 09 09 7d 0d 0a 09 7d 0d 0a 09 2f 2a 2a 0d 0a 09 20 2a 20 52 65 74 75 72 6e 20 74 68 69 73 20 ...}...}.../**....*.Return.this.
2c60 58 4d 4c 20 4f 62 6a 65 63 74 20 69 6e 20 78 6d 6c 20 6e 6f 74 61 74 69 6f 6e 0d 0a 09 20 2a 0d XML.Object.in.xml.notation....*.
2c80 0a 09 20 2a 20 40 70 61 72 61 6d 20 73 74 72 69 6e 67 20 24 73 74 72 0d 0a 09 20 2a 2f 0d 0a 09 ...*.@param.string.$str....*/...
2ca0 70 75 62 6c 69 63 20 66 75 6e 63 74 69 6f 6e 20 74 6f 53 74 72 69 6e 67 28 24 73 74 72 20 3d 20 public.function.toString($str.=.
2cc0 27 27 29 20 7b 0d 0a 09 09 24 73 74 72 20 2e 3d 20 22 3c 7b 24 74 68 69 73 2d 3e 6e 61 6d 65 7d '').{....$str..=."<{$this->name}
2ce0 20 78 6d 6c 6e 73 3d 27 7b 24 74 68 69 73 2d 3e 6e 73 7d 27 20 22 3b 0d 0a 09 09 66 6f 72 65 61 .xmlns='{$this->ns}'.";....forea
2d00 63 68 28 24 74 68 69 73 2d 3e 61 74 74 72 73 20 61 73 20 24 6b 65 79 20 3d 3e 20 24 76 61 6c 75 ch($this->attrs.as.$key.=>.$valu
2d20 65 29 20 7b 0d 0a 09 09 09 69 66 28 24 6b 65 79 20 21 3d 20 27 78 6d 6c 6e 73 27 29 20 7b 0d 0a e).{.....if($key.!=.'xmlns').{..
2d40 09 09 09 09 24 76 61 6c 75 65 20 3d 20 68 74 6d 6c 73 70 65 63 69 61 6c 63 68 61 72 73 28 24 76 ....$value.=.htmlspecialchars($v
2d60 61 6c 75 65 29 3b 0d 0a 09 09 09 09 24 73 74 72 20 2e 3d 20 22 24 6b 65 79 3d 27 24 76 61 6c 75 alue);......$str..=."$key='$valu
2d80 65 27 20 22 3b 0d 0a 09 09 09 7d 0d 0a 09 09 7d 0d 0a 09 09 24 73 74 72 20 2e 3d 20 22 3e 22 3b e'.";.....}....}....$str..=.">";
2da0 0d 0a 09 09 66 6f 72 65 61 63 68 28 24 74 68 69 73 2d 3e 73 75 62 73 20 61 73 20 24 73 75 62 29 ....foreach($this->subs.as.$sub)
2dc0 20 7b 0d 0a 09 09 09 24 73 74 72 20 2e 3d 20 24 73 75 62 2d 3e 74 6f 53 74 72 69 6e 67 28 29 3b .{.....$str..=.$sub->toString();
2de0 0d 0a 09 09 7d 0d 0a 09 09 24 62 6f 64 79 20 3d 20 68 74 6d 6c 73 70 65 63 69 61 6c 63 68 61 72 ....}....$body.=.htmlspecialchar
2e00 73 28 24 74 68 69 73 2d 3e 64 61 74 61 29 3b 0d 0a 09 09 24 73 74 72 20 2e 3d 20 22 24 62 6f 64 s($this->data);....$str..=."$bod
2e20 79 3c 2f 7b 24 74 68 69 73 2d 3e 6e 61 6d 65 7d 3e 22 3b 0d 0a 09 09 72 65 74 75 72 6e 20 24 73 y</{$this->name}>";....return.$s
2e40 74 72 3b 0d 0a 09 7d 0d 0a 09 2f 2a 2a 0d 0a 09 20 2a 20 48 61 73 20 74 68 69 73 20 58 4d 4c 20 tr;...}.../**....*.Has.this.XML.
2e60 4f 62 6a 65 63 74 20 74 68 65 20 67 69 76 65 6e 20 73 75 62 3f 0d 0a 09 20 2a 20 0d 0a 09 20 2a Object.the.given.sub?....*.....*
2e80 20 40 70 61 72 61 6d 20 73 74 72 69 6e 67 20 24 6e 61 6d 65 0d 0a 09 20 2a 20 40 72 65 74 75 72 .@param.string.$name....*.@retur
2ea0 6e 20 62 6f 6f 6c 65 61 6e 0d 0a 09 20 2a 2f 0d 0a 09 70 75 62 6c 69 63 20 66 75 6e 63 74 69 6f n.boolean....*/...public.functio
2ec0 6e 20 68 61 73 53 75 62 28 24 6e 61 6d 65 2c 20 24 6e 73 20 3d 20 6e 75 6c 6c 29 20 7b 0d 0a 09 n.hasSub($name,.$ns.=.null).{...
2ee0 09 66 6f 72 65 61 63 68 28 24 74 68 69 73 2d 3e 73 75 62 73 20 61 73 20 24 73 75 62 29 20 7b 0d .foreach($this->subs.as.$sub).{.
2f00 0a 09 09 09 69 66 28 28 24 6e 61 6d 65 20 3d 3d 20 22 2a 22 20 6f 72 20 24 73 75 62 2d 3e 6e 61 ....if(($name.==."*".or.$sub->na
2f20 6d 65 20 3d 3d 20 24 6e 61 6d 65 29 20 61 6e 64 20 28 24 6e 73 20 3d 3d 20 6e 75 6c 6c 20 6f 72 me.==.$name).and.($ns.==.null.or
2f40 20 24 73 75 62 2d 3e 6e 73 20 3d 3d 20 24 6e 73 29 29 20 72 65 74 75 72 6e 20 74 72 75 65 3b 0d .$sub->ns.==.$ns)).return.true;.
2f60 0a 09 09 7d 0d 0a 09 09 72 65 74 75 72 6e 20 66 61 6c 73 65 3b 0d 0a 09 7d 0d 0a 09 2f 2a 2a 0d ...}....return.false;...}.../**.
2f80 0a 09 20 2a 20 52 65 74 75 72 6e 20 61 20 73 75 62 0d 0a 09 20 2a 0d 0a 09 20 2a 20 40 70 61 72 ...*.Return.a.sub....*....*.@par
2fa0 61 6d 20 73 74 72 69 6e 67 20 24 6e 61 6d 65 0d 0a 09 20 2a 20 40 70 61 72 61 6d 20 73 74 72 69 am.string.$name....*.@param.stri
2fc0 6e 67 20 24 61 74 74 72 73 0d 0a 09 20 2a 20 40 70 61 72 61 6d 20 73 74 72 69 6e 67 20 24 6e 73 ng.$attrs....*.@param.string.$ns
2fe0 0d 0a 09 20 2a 2f 0d 0a 09 70 75 62 6c 69 63 20 66 75 6e 63 74 69 6f 6e 20 73 75 62 28 24 6e 61 ....*/...public.function.sub($na
3000 6d 65 2c 20 24 61 74 74 72 73 20 3d 20 6e 75 6c 6c 2c 20 24 6e 73 20 3d 20 6e 75 6c 6c 29 20 7b me,.$attrs.=.null,.$ns.=.null).{
3020 0d 0a 09 09 23 54 4f 44 4f 20 61 74 74 72 73 20 69 73 20 69 67 6e 6f 72 65 64 0d 0a 09 09 66 6f ....#TODO.attrs.is.ignored....fo
3040 72 65 61 63 68 28 24 74 68 69 73 2d 3e 73 75 62 73 20 61 73 20 24 73 75 62 29 20 7b 0d 0a 09 09 reach($this->subs.as.$sub).{....
3060 09 69 66 28 24 73 75 62 2d 3e 6e 61 6d 65 20 3d 3d 20 24 6e 61 6d 65 20 61 6e 64 20 28 24 6e 73 .if($sub->name.==.$name.and.($ns
3080 20 3d 3d 20 6e 75 6c 6c 20 6f 72 20 24 73 75 62 2d 3e 6e 73 20 3d 3d 20 24 6e 73 29 29 20 7b 0d .==.null.or.$sub->ns.==.$ns)).{.
30a0 0a 09 09 09 09 72 65 74 75 72 6e 20 24 73 75 62 3b 0d 0a 09 09 09 7d 0d 0a 09 09 7d 0d 0a 09 7d .....return.$sub;.....}....}...}
30c0 0d 0a 7d 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ..}.............................
30e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
3100 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
3120 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
3140 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
3160 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
3180 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
31a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
31c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
31e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
3200 6c 69 62 2f 58 4d 4c 53 74 72 65 61 6d 2e 70 68 70 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 lib/XMLStream.php...............
3220 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
3240 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
3260 00 00 00 00 30 30 30 30 36 34 34 00 30 30 30 31 37 35 30 00 30 30 30 31 37 35 30 00 30 30 30 30 ....0000644.0001750.0001750.0000
3280 30 30 35 31 35 31 37 00 31 32 37 37 33 30 33 31 30 33 37 00 30 31 32 37 35 37 00 20 30 00 00 00 0051517.12773031037.012757..0...
32a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
32c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
32e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
3300 00 75 73 74 61 72 20 20 00 74 7a 75 72 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 .ustar...tzur...................
3320 00 00 00 00 00 00 00 00 00 74 7a 75 72 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 .........tzur...................
3340 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
3360 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
3380 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
33a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
33c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
33e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
3400 3c 3f 70 68 70 0d 0a 09 2f 2a 2a 0d 0a 09 20 2a 20 58 4d 50 50 48 50 3a 20 54 68 65 20 50 48 50 <?php.../**....*.XMPPHP:.The.PHP
3420 20 58 4d 50 50 20 4c 69 62 72 61 72 79 0d 0a 09 20 2a 20 43 6f 70 79 72 69 67 68 74 20 28 43 29 .XMPP.Library....*.Copyright.(C)
3440 20 32 30 30 38 20 20 4e 61 74 68 61 6e 61 65 6c 20 43 2e 20 46 72 69 74 7a 0d 0a 09 20 2a 20 54 .2008..Nathanael.C..Fritz....*.T
3460 68 69 73 20 66 69 6c 65 20 69 73 20 70 61 72 74 20 6f 66 20 53 6c 65 65 6b 58 4d 50 50 2e 0d 0a his.file.is.part.of.SleekXMPP...
3480 09 20 2a 0d 0a 09 20 2a 20 58 4d 50 50 48 50 20 69 73 20 66 72 65 65 20 73 6f 66 74 77 61 72 65 ..*....*.XMPPHP.is.free.software
34a0 3b 20 79 6f 75 20 63 61 6e 20 72 65 64 69 73 74 72 69 62 75 74 65 20 69 74 20 61 6e 64 2f 6f 72 ;.you.can.redistribute.it.and/or
34c0 20 6d 6f 64 69 66 79 0d 0a 09 20 2a 20 69 74 20 75 6e 64 65 72 20 74 68 65 20 74 65 72 6d 73 20 .modify....*.it.under.the.terms.
34e0 6f 66 20 74 68 65 20 47 4e 55 20 47 65 6e 65 72 61 6c 20 50 75 62 6c 69 63 20 4c 69 63 65 6e 73 of.the.GNU.General.Public.Licens
3500 65 20 61 73 20 70 75 62 6c 69 73 68 65 64 20 62 79 0d 0a 09 20 2a 20 74 68 65 20 46 72 65 65 20 e.as.published.by....*.the.Free.
3520 53 6f 66 74 77 61 72 65 20 46 6f 75 6e 64 61 74 69 6f 6e 3b 20 65 69 74 68 65 72 20 76 65 72 73 Software.Foundation;.either.vers
3540 69 6f 6e 20 32 20 6f 66 20 74 68 65 20 4c 69 63 65 6e 73 65 2c 20 6f 72 0d 0a 09 20 2a 20 28 61 ion.2.of.the.License,.or....*.(a
3560 74 20 79 6f 75 72 20 6f 70 74 69 6f 6e 29 20 61 6e 79 20 6c 61 74 65 72 20 76 65 72 73 69 6f 6e t.your.option).any.later.version
3580 2e 0d 0a 09 20 2a 0d 0a 09 20 2a 20 58 4d 50 50 48 50 20 69 73 20 64 69 73 74 72 69 62 75 74 65 .....*....*.XMPPHP.is.distribute
35a0 64 20 69 6e 20 74 68 65 20 68 6f 70 65 20 74 68 61 74 20 69 74 20 77 69 6c 6c 20 62 65 20 75 73 d.in.the.hope.that.it.will.be.us
35c0 65 66 75 6c 2c 0d 0a 09 20 2a 20 62 75 74 20 57 49 54 48 4f 55 54 20 41 4e 59 20 57 41 52 52 41 eful,....*.but.WITHOUT.ANY.WARRA
35e0 4e 54 59 3b 20 77 69 74 68 6f 75 74 20 65 76 65 6e 20 74 68 65 20 69 6d 70 6c 69 65 64 20 77 61 NTY;.without.even.the.implied.wa
3600 72 72 61 6e 74 79 20 6f 66 0d 0a 09 20 2a 20 4d 45 52 43 48 41 4e 54 41 42 49 4c 49 54 59 20 6f rranty.of....*.MERCHANTABILITY.o
3620 72 20 46 49 54 4e 45 53 53 20 46 4f 52 20 41 20 50 41 52 54 49 43 55 4c 41 52 20 50 55 52 50 4f r.FITNESS.FOR.A.PARTICULAR.PURPO
3640 53 45 2e 20 20 53 65 65 20 74 68 65 0d 0a 09 20 2a 20 47 4e 55 20 47 65 6e 65 72 61 6c 20 50 75 SE...See.the....*.GNU.General.Pu
3660 62 6c 69 63 20 4c 69 63 65 6e 73 65 20 66 6f 72 20 6d 6f 72 65 20 64 65 74 61 69 6c 73 2e 0d 0a blic.License.for.more.details...
3680 09 20 2a 0d 0a 09 20 2a 20 59 6f 75 20 73 68 6f 75 6c 64 20 68 61 76 65 20 72 65 63 65 69 76 65 ..*....*.You.should.have.receive
36a0 64 20 61 20 63 6f 70 79 20 6f 66 20 74 68 65 20 47 4e 55 20 47 65 6e 65 72 61 6c 20 50 75 62 6c d.a.copy.of.the.GNU.General.Publ
36c0 69 63 20 4c 69 63 65 6e 73 65 0d 0a 09 20 2a 20 61 6c 6f 6e 67 20 77 69 74 68 20 58 4d 50 50 48 ic.License....*.along.with.XMPPH
36e0 50 3b 20 69 66 20 6e 6f 74 2c 20 77 72 69 74 65 20 74 6f 20 74 68 65 20 46 72 65 65 20 53 6f 66 P;.if.not,.write.to.the.Free.Sof
3700 74 77 61 72 65 0d 0a 09 20 2a 20 46 6f 75 6e 64 61 74 69 6f 6e 2c 20 49 6e 63 2e 2c 20 35 31 20 tware....*.Foundation,.Inc.,.51.
3720 46 72 61 6e 6b 6c 69 6e 20 53 74 2c 20 46 69 66 74 68 20 46 6c 6f 6f 72 2c 20 42 6f 73 74 6f 6e Franklin.St,.Fifth.Floor,.Boston
3740 2c 20 4d 41 20 20 30 32 31 31 30 2d 31 33 30 31 20 20 55 53 41 0d 0a 09 20 2a 0d 0a 09 20 2a 20 ,.MA..02110-1301..USA....*....*.
3760 40 63 61 74 65 67 6f 72 79 20 20 20 78 6d 70 70 68 70 0d 0a 09 20 2a 20 40 70 61 63 6b 61 67 65 @category...xmpphp....*.@package
3780 20 20 20 20 58 4d 50 50 48 50 0d 0a 09 20 2a 20 40 61 75 74 68 6f 72 20 20 20 20 20 4e 61 74 68 ....XMPPHP....*.@author.....Nath
37a0 61 6e 61 65 6c 20 43 2e 20 46 72 69 74 7a 20 3c 4a 49 44 3a 20 66 72 69 74 7a 79 40 6e 65 74 66 anael.C..Fritz.<JID:.fritzy@netf
37c0 6c 69 6e 74 2e 6e 65 74 3e 0d 0a 09 20 2a 20 40 61 75 74 68 6f 72 20 20 20 20 20 53 74 65 70 68 lint.net>....*.@author.....Steph
37e0 61 6e 20 57 65 6e 74 7a 20 3c 4a 49 44 3a 20 73 74 65 70 68 61 6e 40 6a 61 62 62 65 72 2e 77 65 an.Wentz.<JID:.stephan@jabber.we
3800 6e 74 7a 2e 69 74 3e 0d 0a 09 20 2a 20 40 61 75 74 68 6f 72 20 20 20 20 20 4d 69 63 68 61 65 6c ntz.it>....*.@author.....Michael
3820 20 47 61 72 76 69 6e 20 3c 4a 49 44 3a 20 67 61 72 40 6e 65 74 66 6c 69 6e 74 2e 6e 65 74 3e 0d .Garvin.<JID:.gar@netflint.net>.
3840 0a 09 20 2a 20 40 61 75 74 68 6f 72 20 20 20 20 20 41 6c 65 78 61 6e 64 65 72 20 42 69 72 6b 6e ...*.@author.....Alexander.Birkn
3860 65 72 20 28 68 74 74 70 73 3a 2f 2f 67 69 74 68 75 62 2e 63 6f 6d 2f 42 69 72 6b 6e 65 72 41 6c er.(https://github.com/BirknerAl
3880 65 78 29 0d 0a 09 20 2a 20 40 63 6f 70 79 72 69 67 68 74 20 20 32 30 30 38 20 4e 61 74 68 61 6e ex)....*.@copyright..2008.Nathan
38a0 61 65 6c 20 43 2e 20 46 72 69 74 7a 0d 0a 09 20 2a 2f 0d 0a 2f 2a 2a 0d 0a 20 2a 20 58 4d 50 50 ael.C..Fritz....*/../**...*.XMPP
38c0 48 50 20 4d 61 69 6e 20 43 6c 61 73 73 0d 0a 20 2a 0d 0a 20 2a 20 40 63 61 74 65 67 6f 72 79 20 HP.Main.Class...*...*.@category.
38e0 20 20 78 6d 70 70 68 70 0d 0a 20 2a 20 40 70 61 63 6b 61 67 65 20 20 20 20 58 4d 50 50 48 50 0d ..xmpphp...*.@package....XMPPHP.
3900 0a 20 2a 20 40 61 75 74 68 6f 72 20 20 20 20 20 4e 61 74 68 61 6e 61 65 6c 20 43 2e 20 46 72 69 ..*.@author.....Nathanael.C..Fri
3920 74 7a 20 3c 4a 49 44 3a 20 66 72 69 74 7a 79 40 6e 65 74 66 6c 69 6e 74 2e 6e 65 74 3e 0d 0a 20 tz.<JID:.fritzy@netflint.net>...
3940 2a 20 40 61 75 74 68 6f 72 20 20 20 20 20 53 74 65 70 68 61 6e 20 57 65 6e 74 7a 20 3c 4a 49 44 *.@author.....Stephan.Wentz.<JID
3960 3a 20 73 74 65 70 68 61 6e 40 6a 61 62 62 65 72 2e 77 65 6e 74 7a 2e 69 74 3e 0d 0a 20 2a 20 40 :.stephan@jabber.wentz.it>...*.@
3980 61 75 74 68 6f 72 20 20 20 20 20 4d 69 63 68 61 65 6c 20 47 61 72 76 69 6e 20 3c 4a 49 44 3a 20 author.....Michael.Garvin.<JID:.
39a0 67 61 72 40 6e 65 74 66 6c 69 6e 74 2e 6e 65 74 3e 0d 0a 20 2a 20 40 63 6f 70 79 72 69 67 68 74 gar@netflint.net>...*.@copyright
39c0 20 20 32 30 30 38 20 4e 61 74 68 61 6e 61 65 6c 20 43 2e 20 46 72 69 74 7a 0d 0a 20 2a 20 40 76 ..2008.Nathanael.C..Fritz...*.@v
39e0 65 72 73 69 6f 6e 20 20 20 20 24 49 64 24 0d 0a 20 2a 2f 0d 0a 63 6c 61 73 73 20 58 4d 4c 53 74 ersion....$Id$...*/..class.XMLSt
3a00 72 65 61 6d 20 7b 0d 0a 09 2f 2a 2a 0d 0a 09 20 2a 20 40 76 61 72 20 72 65 73 6f 75 72 63 65 0d ream.{.../**....*.@var.resource.
3a20 0a 09 20 2a 2f 0d 0a 09 70 72 6f 74 65 63 74 65 64 20 24 73 6f 63 6b 65 74 3b 0d 0a 09 2f 2a 2a ...*/...protected.$socket;.../**
3a40 0d 0a 09 20 2a 20 40 76 61 72 20 72 65 73 6f 75 72 63 65 0d 0a 09 20 2a 2f 0d 0a 09 70 72 6f 74 ....*.@var.resource....*/...prot
3a60 65 63 74 65 64 20 24 70 61 72 73 65 72 3b 0d 0a 09 2f 2a 2a 0d 0a 09 20 2a 20 40 76 61 72 20 73 ected.$parser;.../**....*.@var.s
3a80 74 72 69 6e 67 0d 0a 09 20 2a 2f 0d 0a 09 70 72 6f 74 65 63 74 65 64 20 24 62 75 66 66 65 72 3b tring....*/...protected.$buffer;
3aa0 0d 0a 09 2f 2a 2a 0d 0a 09 20 2a 20 40 76 61 72 20 69 6e 74 65 67 65 72 0d 0a 09 20 2a 2f 0d 0a .../**....*.@var.integer....*/..
3ac0 09 70 72 6f 74 65 63 74 65 64 20 24 78 6d 6c 5f 64 65 70 74 68 20 3d 20 30 3b 0d 0a 09 2f 2a 2a .protected.$xml_depth.=.0;.../**
3ae0 0d 0a 09 20 2a 20 40 76 61 72 20 73 74 72 69 6e 67 0d 0a 09 20 2a 2f 0d 0a 09 70 72 6f 74 65 63 ....*.@var.string....*/...protec
3b00 74 65 64 20 24 68 6f 73 74 3b 0d 0a 09 2f 2a 2a 0d 0a 09 20 2a 20 40 76 61 72 20 69 6e 74 65 67 ted.$host;.../**....*.@var.integ
3b20 65 72 0d 0a 09 20 2a 2f 0d 0a 09 70 72 6f 74 65 63 74 65 64 20 24 70 6f 72 74 3b 0d 0a 09 2f 2a er....*/...protected.$port;.../*
3b40 2a 0d 0a 09 20 2a 20 40 76 61 72 20 73 74 72 69 6e 67 0d 0a 09 20 2a 2f 0d 0a 09 70 72 6f 74 65 *....*.@var.string....*/...prote
3b60 63 74 65 64 20 24 73 74 72 65 61 6d 5f 73 74 61 72 74 20 3d 20 27 3c 73 74 72 65 61 6d 3e 27 3b cted.$stream_start.=.'<stream>';
3b80 0d 0a 09 2f 2a 2a 0d 0a 09 20 2a 20 40 76 61 72 20 73 74 72 69 6e 67 0d 0a 09 20 2a 2f 0d 0a 09 .../**....*.@var.string....*/...
3ba0 70 72 6f 74 65 63 74 65 64 20 24 73 74 72 65 61 6d 5f 65 6e 64 20 3d 20 27 3c 2f 73 74 72 65 61 protected.$stream_end.=.'</strea
3bc0 6d 3e 27 3b 0d 0a 09 2f 2a 2a 0d 0a 09 20 2a 20 40 76 61 72 20 62 6f 6f 6c 65 61 6e 0d 0a 09 20 m>';.../**....*.@var.boolean....
3be0 2a 2f 0d 0a 09 70 72 6f 74 65 63 74 65 64 20 24 64 69 73 63 6f 6e 6e 65 63 74 65 64 20 3d 20 74 */...protected.$disconnected.=.t
3c00 72 75 65 3b 0d 0a 09 2f 2a 2a 0d 0a 09 20 2a 20 40 76 61 72 20 62 6f 6f 6c 65 61 6e 0d 0a 09 20 rue;.../**....*.@var.boolean....
3c20 2a 2f 0d 0a 09 70 72 6f 74 65 63 74 65 64 20 24 73 65 6e 74 5f 64 69 73 63 6f 6e 6e 65 63 74 20 */...protected.$sent_disconnect.
3c40 3d 20 66 61 6c 73 65 3b 0d 0a 09 2f 2a 2a 0d 0a 09 20 2a 20 40 76 61 72 20 61 72 72 61 79 0d 0a =.false;.../**....*.@var.array..
3c60 09 20 2a 2f 0d 0a 09 70 72 6f 74 65 63 74 65 64 20 24 6e 73 5f 6d 61 70 20 3d 20 61 72 72 61 79 ..*/...protected.$ns_map.=.array
3c80 28 29 3b 0d 0a 09 2f 2a 2a 0d 0a 09 20 2a 20 40 76 61 72 20 61 72 72 61 79 0d 0a 09 20 2a 2f 0d ();.../**....*.@var.array....*/.
3ca0 0a 09 70 72 6f 74 65 63 74 65 64 20 24 63 75 72 72 65 6e 74 5f 6e 73 20 3d 20 61 72 72 61 79 28 ..protected.$current_ns.=.array(
3cc0 29 3b 0d 0a 09 2f 2a 2a 0d 0a 09 20 2a 20 40 76 61 72 20 61 72 72 61 79 0d 0a 09 20 2a 2f 0d 0a );.../**....*.@var.array....*/..
3ce0 09 70 72 6f 74 65 63 74 65 64 20 24 78 6d 6c 6f 62 6a 20 3d 20 6e 75 6c 6c 3b 0d 0a 09 2f 2a 2a .protected.$xmlobj.=.null;.../**
3d00 0d 0a 09 20 2a 20 40 76 61 72 20 61 72 72 61 79 0d 0a 09 20 2a 2f 0d 0a 09 70 72 6f 74 65 63 74 ....*.@var.array....*/...protect
3d20 65 64 20 24 6e 73 68 61 6e 64 6c 65 72 73 20 3d 20 61 72 72 61 79 28 29 3b 0d 0a 09 2f 2a 2a 0d ed.$nshandlers.=.array();.../**.
3d40 0a 09 20 2a 20 40 76 61 72 20 61 72 72 61 79 0d 0a 09 20 2a 2f 0d 0a 09 70 72 6f 74 65 63 74 65 ...*.@var.array....*/...protecte
3d60 64 20 24 78 70 61 74 68 68 61 6e 64 6c 65 72 73 20 3d 20 61 72 72 61 79 28 29 3b 0d 0a 09 2f 2a d.$xpathhandlers.=.array();.../*
3d80 2a 0d 0a 09 20 2a 20 40 76 61 72 20 61 72 72 61 79 0d 0a 09 20 2a 2f 0d 0a 09 70 72 6f 74 65 63 *....*.@var.array....*/...protec
3da0 74 65 64 20 24 69 64 68 61 6e 64 6c 65 72 73 20 3d 20 61 72 72 61 79 28 29 3b 0d 0a 09 2f 2a 2a ted.$idhandlers.=.array();.../**
3dc0 0d 0a 09 20 2a 20 40 76 61 72 20 61 72 72 61 79 0d 0a 09 20 2a 2f 0d 0a 09 70 72 6f 74 65 63 74 ....*.@var.array....*/...protect
3de0 65 64 20 24 65 76 65 6e 74 68 61 6e 64 6c 65 72 73 20 3d 20 61 72 72 61 79 28 29 3b 0d 0a 09 2f ed.$eventhandlers.=.array();.../
3e00 2a 2a 0d 0a 09 20 2a 20 40 76 61 72 20 69 6e 74 65 67 65 72 0d 0a 09 20 2a 2f 0d 0a 09 70 72 6f **....*.@var.integer....*/...pro
3e20 74 65 63 74 65 64 20 24 6c 61 73 74 69 64 20 3d 20 30 3b 0d 0a 09 2f 2a 2a 0d 0a 09 20 2a 20 40 tected.$lastid.=.0;.../**....*.@
3e40 76 61 72 20 73 74 72 69 6e 67 0d 0a 09 20 2a 2f 0d 0a 09 70 72 6f 74 65 63 74 65 64 20 24 64 65 var.string....*/...protected.$de
3e60 66 61 75 6c 74 5f 6e 73 3b 0d 0a 09 2f 2a 2a 0d 0a 09 20 2a 20 40 76 61 72 20 73 74 72 69 6e 67 fault_ns;.../**....*.@var.string
3e80 0d 0a 09 20 2a 2f 0d 0a 09 70 72 6f 74 65 63 74 65 64 20 24 75 6e 74 69 6c 20 3d 20 27 27 3b 0d ....*/...protected.$until.=.'';.
3ea0 0a 09 2f 2a 2a 0d 0a 09 20 2a 20 40 76 61 72 20 73 74 72 69 6e 67 0d 0a 09 20 2a 2f 0d 0a 09 70 ../**....*.@var.string....*/...p
3ec0 72 6f 74 65 63 74 65 64 20 24 75 6e 74 69 6c 5f 63 6f 75 6e 74 20 3d 20 27 27 3b 0d 0a 09 2f 2a rotected.$until_count.=.'';.../*
3ee0 2a 0d 0a 09 20 2a 20 40 76 61 72 20 61 72 72 61 79 0d 0a 09 20 2a 2f 0d 0a 09 70 72 6f 74 65 63 *....*.@var.array....*/...protec
3f00 74 65 64 20 24 75 6e 74 69 6c 5f 68 61 70 70 65 6e 65 64 20 3d 20 66 61 6c 73 65 3b 0d 0a 09 2f ted.$until_happened.=.false;.../
3f20 2a 2a 0d 0a 09 20 2a 20 40 76 61 72 20 61 72 72 61 79 0d 0a 09 20 2a 2f 0d 0a 09 70 72 6f 74 65 **....*.@var.array....*/...prote
3f40 63 74 65 64 20 24 75 6e 74 69 6c 5f 70 61 79 6c 6f 61 64 20 3d 20 61 72 72 61 79 28 29 3b 0d 0a cted.$until_payload.=.array();..
3f60 09 2f 2a 2a 0d 0a 09 20 2a 20 40 76 61 72 20 58 4d 50 58 4d 50 50 50 4c 6f 67 0d 0a 09 20 2a 2f ./**....*.@var.XMPXMPPPLog....*/
3f80 0d 0a 09 70 72 6f 74 65 63 74 65 64 20 24 6c 6f 67 3b 0d 0a 09 2f 2a 2a 0d 0a 09 20 2a 20 40 76 ...protected.$log;.../**....*.@v
3fa0 61 72 20 62 6f 6f 6c 65 61 6e 0d 0a 09 20 2a 2f 0d 0a 09 70 72 6f 74 65 63 74 65 64 20 24 72 65 ar.boolean....*/...protected.$re
3fc0 63 6f 6e 6e 65 63 74 20 3d 20 74 72 75 65 3b 0d 0a 09 2f 2a 2a 0d 0a 09 20 2a 20 40 76 61 72 20 connect.=.true;.../**....*.@var.
3fe0 62 6f 6f 6c 65 61 6e 0d 0a 09 20 2a 2f 0d 0a 09 70 72 6f 74 65 63 74 65 64 20 24 62 65 65 6e 5f boolean....*/...protected.$been_
4000 72 65 73 65 74 20 3d 20 66 61 6c 73 65 3b 0d 0a 09 2f 2a 2a 0d 0a 09 20 2a 20 40 76 61 72 20 62 reset.=.false;.../**....*.@var.b
4020 6f 6f 6c 65 61 6e 0d 0a 09 20 2a 2f 0d 0a 09 70 72 6f 74 65 63 74 65 64 20 24 69 73 5f 73 65 72 oolean....*/...protected.$is_ser
4040 76 65 72 3b 0d 0a 09 2f 2a 2a 0d 0a 09 20 2a 20 40 76 61 72 20 66 6c 6f 61 74 0d 0a 09 20 2a 2f ver;.../**....*.@var.float....*/
4060 0d 0a 09 70 72 6f 74 65 63 74 65 64 20 24 6c 61 73 74 5f 73 65 6e 64 20 3d 20 30 3b 0d 0a 09 2f ...protected.$last_send.=.0;.../
4080 2a 2a 0d 0a 09 20 2a 20 40 76 61 72 20 62 6f 6f 6c 65 61 6e 0d 0a 09 20 2a 2f 0d 0a 09 70 72 6f **....*.@var.boolean....*/...pro
40a0 74 65 63 74 65 64 20 24 75 73 65 5f 73 73 6c 20 3d 20 66 61 6c 73 65 3b 0d 0a 09 2f 2a 2a 0d 0a tected.$use_ssl.=.false;.../**..
40c0 09 20 2a 20 40 76 61 72 20 69 6e 74 65 67 65 72 0d 0a 09 20 2a 2f 0d 0a 09 70 72 6f 74 65 63 74 ..*.@var.integer....*/...protect
40e0 65 64 20 24 72 65 63 6f 6e 6e 65 63 74 54 69 6d 65 6f 75 74 20 3d 20 33 30 3b 0d 0a 09 2f 2a 2a ed.$reconnectTimeout.=.30;.../**
4100 0d 0a 09 20 2a 20 43 6f 6e 73 74 72 75 63 74 6f 72 0d 0a 09 20 2a 0d 0a 09 20 2a 20 40 70 61 72 ....*.Constructor....*....*.@par
4120 61 6d 20 73 74 72 69 6e 67 20 20 24 68 6f 73 74 0d 0a 09 20 2a 20 40 70 61 72 61 6d 20 73 74 72 am.string..$host....*.@param.str
4140 69 6e 67 20 20 24 70 6f 72 74 0d 0a 09 20 2a 20 40 70 61 72 61 6d 20 62 6f 6f 6c 65 61 6e 20 24 ing..$port....*.@param.boolean.$
4160 70 72 69 6e 74 6c 6f 67 0d 0a 09 20 2a 20 40 70 61 72 61 6d 20 73 74 72 69 6e 67 20 20 24 6c 6f printlog....*.@param.string..$lo
4180 67 6c 65 76 65 6c 0d 0a 09 20 2a 20 40 70 61 72 61 6d 20 62 6f 6f 6c 65 61 6e 20 24 69 73 5f 73 glevel....*.@param.boolean.$is_s
41a0 65 72 76 65 72 0d 0a 09 20 2a 2f 0d 0a 09 70 75 62 6c 69 63 20 66 75 6e 63 74 69 6f 6e 20 5f 5f erver....*/...public.function.__
41c0 63 6f 6e 73 74 72 75 63 74 28 24 68 6f 73 74 20 3d 20 6e 75 6c 6c 2c 20 24 70 6f 72 74 20 3d 20 construct($host.=.null,.$port.=.
41e0 6e 75 6c 6c 2c 20 24 70 72 69 6e 74 6c 6f 67 20 3d 20 66 61 6c 73 65 2c 20 24 6c 6f 67 6c 65 76 null,.$printlog.=.false,.$loglev
4200 65 6c 20 3d 20 6e 75 6c 6c 2c 20 24 69 73 5f 73 65 72 76 65 72 20 3d 20 66 61 6c 73 65 29 20 7b el.=.null,.$is_server.=.false).{
4220 0d 0a 09 09 24 74 68 69 73 2d 3e 72 65 63 6f 6e 6e 65 63 74 20 3d 20 21 24 69 73 5f 73 65 72 76 ....$this->reconnect.=.!$is_serv
4240 65 72 3b 0d 0a 09 09 24 74 68 69 73 2d 3e 69 73 5f 73 65 72 76 65 72 20 3d 20 24 69 73 5f 73 65 er;....$this->is_server.=.$is_se
4260 72 76 65 72 3b 0d 0a 09 09 24 74 68 69 73 2d 3e 68 6f 73 74 20 3d 20 24 68 6f 73 74 3b 0d 0a 09 rver;....$this->host.=.$host;...
4280 09 24 74 68 69 73 2d 3e 70 6f 72 74 20 3d 20 24 70 6f 72 74 3b 0d 0a 09 09 24 74 68 69 73 2d 3e .$this->port.=.$port;....$this->
42a0 73 65 74 75 70 50 61 72 73 65 72 28 29 3b 0d 0a 09 09 24 74 68 69 73 2d 3e 6c 6f 67 20 3d 20 6e setupParser();....$this->log.=.n
42c0 65 77 20 58 4d 50 50 4c 6f 67 28 24 70 72 69 6e 74 6c 6f 67 2c 20 24 6c 6f 67 6c 65 76 65 6c 29 ew.XMPPLog($printlog,.$loglevel)
42e0 3b 0d 0a 09 7d 0d 0a 09 2f 2a 2a 0d 0a 09 20 2a 20 44 65 73 74 72 75 63 74 6f 72 0d 0a 09 20 2a ;...}.../**....*.Destructor....*
4300 20 43 6c 65 61 6e 75 70 20 63 6f 6e 6e 65 63 74 69 6f 6e 0d 0a 09 20 2a 2f 0d 0a 09 70 75 62 6c .Cleanup.connection....*/...publ
4320 69 63 20 66 75 6e 63 74 69 6f 6e 20 5f 5f 64 65 73 74 72 75 63 74 28 29 20 7b 0d 0a 09 09 69 66 ic.function.__destruct().{....if
4340 28 21 24 74 68 69 73 2d 3e 64 69 73 63 6f 6e 6e 65 63 74 65 64 20 26 26 20 24 74 68 69 73 2d 3e (!$this->disconnected.&&.$this->
4360 73 6f 63 6b 65 74 29 20 7b 0d 0a 09 09 09 24 74 68 69 73 2d 3e 64 69 73 63 6f 6e 6e 65 63 74 28 socket).{.....$this->disconnect(
4380 29 3b 0d 0a 09 09 7d 0d 0a 09 7d 0d 0a 09 0d 0a 09 2f 2a 2a 0d 0a 09 20 2a 20 52 65 74 75 72 6e );....}...}....../**....*.Return
43a0 20 74 68 65 20 6c 6f 67 20 69 6e 73 74 61 6e 63 65 0d 0a 09 20 2a 0d 0a 09 20 2a 20 40 72 65 74 .the.log.instance....*....*.@ret
43c0 75 72 6e 20 58 4d 50 50 4c 6f 67 0d 0a 09 20 2a 2f 0d 0a 09 70 75 62 6c 69 63 20 66 75 6e 63 74 urn.XMPPLog....*/...public.funct
43e0 69 6f 6e 20 67 65 74 4c 6f 67 28 29 20 7b 0d 0a 09 09 72 65 74 75 72 6e 20 24 74 68 69 73 2d 3e ion.getLog().{....return.$this->
4400 6c 6f 67 3b 0d 0a 09 7d 0d 0a 09 0d 0a 09 2f 2a 2a 0d 0a 09 20 2a 20 47 65 74 20 6e 65 78 74 20 log;...}....../**....*.Get.next.
4420 49 44 0d 0a 09 20 2a 0d 0a 09 20 2a 20 40 72 65 74 75 72 6e 20 69 6e 74 65 67 65 72 0d 0a 09 20 ID....*....*.@return.integer....
4440 2a 2f 0d 0a 09 70 75 62 6c 69 63 20 66 75 6e 63 74 69 6f 6e 20 67 65 74 49 64 28 29 20 7b 0d 0a */...public.function.getId().{..
4460 09 09 24 74 68 69 73 2d 3e 6c 61 73 74 69 64 2b 2b 3b 0d 0a 09 09 72 65 74 75 72 6e 20 24 74 68 ..$this->lastid++;....return.$th
4480 69 73 2d 3e 6c 61 73 74 69 64 3b 0d 0a 09 7d 0d 0a 09 2f 2a 2a 0d 0a 09 20 2a 20 53 65 74 20 53 is->lastid;...}.../**....*.Set.S
44a0 53 4c 0d 0a 09 20 2a 0d 0a 09 20 2a 20 40 72 65 74 75 72 6e 20 69 6e 74 65 67 65 72 0d 0a 09 20 SL....*....*.@return.integer....
44c0 2a 2f 0d 0a 09 70 75 62 6c 69 63 20 66 75 6e 63 74 69 6f 6e 20 75 73 65 53 53 4c 28 24 75 73 65 */...public.function.useSSL($use
44e0 3d 74 72 75 65 29 20 7b 0d 0a 09 09 24 74 68 69 73 2d 3e 75 73 65 5f 73 73 6c 20 3d 20 24 75 73 =true).{....$this->use_ssl.=.$us
4500 65 3b 0d 0a 09 7d 0d 0a 09 2f 2a 2a 0d 0a 09 20 2a 20 41 64 64 20 49 44 20 48 61 6e 64 6c 65 72 e;...}.../**....*.Add.ID.Handler
4520 0d 0a 09 20 2a 0d 0a 09 20 2a 20 40 70 61 72 61 6d 20 69 6e 74 65 67 65 72 20 24 69 64 0d 0a 09 ....*....*.@param.integer.$id...
4540 20 2a 20 40 70 61 72 61 6d 20 73 74 72 69 6e 67 20 20 24 70 6f 69 6e 74 65 72 0d 0a 09 20 2a 20 .*.@param.string..$pointer....*.
4560 40 70 61 72 61 6d 20 73 74 72 69 6e 67 20 20 24 6f 62 6a 0d 0a 09 20 2a 2f 0d 0a 09 70 75 62 6c @param.string..$obj....*/...publ
4580 69 63 20 66 75 6e 63 74 69 6f 6e 20 61 64 64 49 64 48 61 6e 64 6c 65 72 28 24 69 64 2c 20 24 70 ic.function.addIdHandler($id,.$p
45a0 6f 69 6e 74 65 72 2c 20 24 6f 62 6a 20 3d 20 6e 75 6c 6c 29 20 7b 0d 0a 09 09 24 74 68 69 73 2d ointer,.$obj.=.null).{....$this-
45c0 3e 69 64 68 61 6e 64 6c 65 72 73 5b 24 69 64 5d 20 3d 20 61 72 72 61 79 28 24 70 6f 69 6e 74 65 >idhandlers[$id].=.array($pointe
45e0 72 2c 20 24 6f 62 6a 29 3b 0d 0a 09 7d 0d 0a 09 2f 2a 2a 0d 0a 09 20 2a 20 41 64 64 20 48 61 6e r,.$obj);...}.../**....*.Add.Han
4600 64 6c 65 72 0d 0a 09 20 2a 0d 0a 09 20 2a 20 40 70 61 72 61 6d 20 73 74 72 69 6e 67 20 24 6e 61 dler....*....*.@param.string.$na
4620 6d 65 0d 0a 09 20 2a 20 40 70 61 72 61 6d 20 73 74 72 69 6e 67 20 20 24 6e 73 0d 0a 09 20 2a 20 me....*.@param.string..$ns....*.
4640 40 70 61 72 61 6d 20 73 74 72 69 6e 67 20 20 24 70 6f 69 6e 74 65 72 0d 0a 09 20 2a 20 40 70 61 @param.string..$pointer....*.@pa
4660 72 61 6d 20 73 74 72 69 6e 67 20 20 24 6f 62 6a 0d 0a 09 20 2a 20 40 70 61 72 61 6d 20 69 6e 74 ram.string..$obj....*.@param.int
4680 65 67 65 72 20 24 64 65 70 74 68 0d 0a 09 20 2a 2f 0d 0a 09 70 75 62 6c 69 63 20 66 75 6e 63 74 eger.$depth....*/...public.funct
46a0 69 6f 6e 20 61 64 64 48 61 6e 64 6c 65 72 28 24 6e 61 6d 65 2c 20 24 6e 73 2c 20 24 70 6f 69 6e ion.addHandler($name,.$ns,.$poin
46c0 74 65 72 2c 20 24 6f 62 6a 20 3d 20 6e 75 6c 6c 2c 20 24 64 65 70 74 68 20 3d 20 31 29 20 7b 0d ter,.$obj.=.null,.$depth.=.1).{.
46e0 0a 09 09 23 54 4f 44 4f 20 64 65 70 72 69 63 61 74 69 6f 6e 20 77 61 72 6e 69 6e 67 0d 0a 09 09 ...#TODO.deprication.warning....
4700 24 74 68 69 73 2d 3e 6e 73 68 61 6e 64 6c 65 72 73 5b 5d 20 3d 20 61 72 72 61 79 28 24 6e 61 6d $this->nshandlers[].=.array($nam
4720 65 2c 24 6e 73 2c 24 70 6f 69 6e 74 65 72 2c 24 6f 62 6a 2c 20 24 64 65 70 74 68 29 3b 0d 0a 09 e,$ns,$pointer,$obj,.$depth);...
4740 7d 0d 0a 09 2f 2a 2a 0d 0a 09 20 2a 20 41 64 64 20 58 50 61 74 68 20 48 61 6e 64 6c 65 72 0d 0a }.../**....*.Add.XPath.Handler..
4760 09 20 2a 0d 0a 09 20 2a 20 40 70 61 72 61 6d 20 73 74 72 69 6e 67 20 24 78 70 61 74 68 0d 0a 09 ..*....*.@param.string.$xpath...
4780 20 2a 20 40 70 61 72 61 6d 20 73 74 72 69 6e 67 20 24 70 6f 69 6e 74 65 72 0d 0a 09 20 2a 20 40 .*.@param.string.$pointer....*.@
47a0 70 61 72 61 6d 0d 0a 09 20 2a 2f 0d 0a 09 70 75 62 6c 69 63 20 66 75 6e 63 74 69 6f 6e 20 61 64 param....*/...public.function.ad
47c0 64 58 50 61 74 68 48 61 6e 64 6c 65 72 28 24 78 70 61 74 68 2c 20 24 70 6f 69 6e 74 65 72 2c 20 dXPathHandler($xpath,.$pointer,.
47e0 24 6f 62 6a 20 3d 20 6e 75 6c 6c 29 20 7b 0d 0a 09 09 69 66 20 28 70 72 65 67 5f 6d 61 74 63 68 $obj.=.null).{....if.(preg_match
4800 5f 61 6c 6c 28 22 2f 5c 28 3f 7b 5b 5e 5c 7d 5d 2b 7d 5c 29 3f 28 5c 2f 3f 29 5b 5e 5c 2f 5d 2b _all("/\(?{[^\}]+}\)?(\/?)[^\/]+
4820 2f 22 2c 20 24 78 70 61 74 68 2c 20 24 72 65 67 73 29 29 20 7b 0d 0a 09 09 09 24 6e 73 5f 74 61 /",.$xpath,.$regs)).{.....$ns_ta
4840 67 73 20 3d 20 24 72 65 67 73 5b 30 5d 3b 0d 0a 09 09 7d 20 65 6c 73 65 20 7b 0d 0a 09 09 09 24 gs.=.$regs[0];....}.else.{.....$
4860 6e 73 5f 74 61 67 73 20 3d 20 61 72 72 61 79 28 24 78 70 61 74 68 29 3b 0d 0a 09 09 7d 0d 0a 09 ns_tags.=.array($xpath);....}...
4880 09 66 6f 72 65 61 63 68 28 24 6e 73 5f 74 61 67 73 20 61 73 20 24 6e 73 5f 74 61 67 29 20 7b 0d .foreach($ns_tags.as.$ns_tag).{.
48a0 0a 09 09 09 6c 69 73 74 28 24 6c 2c 20 24 72 29 20 3d 20 65 78 70 6c 6f 64 65 28 27 7d 27 2c 20 ....list($l,.$r).=.explode('}',.
48c0 24 6e 73 5f 74 61 67 29 3b 0d 0a 09 09 09 69 66 20 28 24 72 20 21 3d 20 6e 75 6c 6c 29 20 7b 0d $ns_tag);.....if.($r.!=.null).{.
48e0 0a 09 09 09 09 24 78 70 61 72 74 20 3d 20 61 72 72 61 79 28 73 75 62 73 74 72 28 24 6c 2c 20 31 .....$xpart.=.array(substr($l,.1
4900 29 2c 20 24 72 29 3b 0d 0a 09 09 09 7d 20 65 6c 73 65 20 7b 0d 0a 09 09 09 09 24 78 70 61 72 74 ),.$r);.....}.else.{......$xpart
4920 20 3d 20 61 72 72 61 79 28 6e 75 6c 6c 2c 20 24 6c 29 3b 0d 0a 09 09 09 7d 0d 0a 09 09 09 24 78 .=.array(null,.$l);.....}.....$x
4940 70 61 74 68 5f 61 72 72 61 79 5b 5d 20 3d 20 24 78 70 61 72 74 3b 0d 0a 09 09 7d 0d 0a 09 09 24 path_array[].=.$xpart;....}....$
4960 74 68 69 73 2d 3e 78 70 61 74 68 68 61 6e 64 6c 65 72 73 5b 5d 20 3d 20 61 72 72 61 79 28 24 78 this->xpathhandlers[].=.array($x
4980 70 61 74 68 5f 61 72 72 61 79 2c 20 24 70 6f 69 6e 74 65 72 2c 20 24 6f 62 6a 29 3b 0d 0a 09 7d path_array,.$pointer,.$obj);...}
49a0 0d 0a 09 2f 2a 2a 0d 0a 09 20 2a 20 41 64 64 20 45 76 65 6e 74 20 48 61 6e 64 6c 65 72 0d 0a 09 .../**....*.Add.Event.Handler...
49c0 20 2a 0d 0a 09 20 2a 20 40 70 61 72 61 6d 20 69 6e 74 65 67 65 72 20 24 69 64 0d 0a 09 20 2a 20 .*....*.@param.integer.$id....*.
49e0 40 70 61 72 61 6d 20 73 74 72 69 6e 67 20 20 24 70 6f 69 6e 74 65 72 0d 0a 09 20 2a 20 40 70 61 @param.string..$pointer....*.@pa
4a00 72 61 6d 20 73 74 72 69 6e 67 20 20 24 6f 62 6a 0d 0a 09 20 2a 2f 0d 0a 09 70 75 62 6c 69 63 20 ram.string..$obj....*/...public.
4a20 66 75 6e 63 74 69 6f 6e 20 61 64 64 45 76 65 6e 74 48 61 6e 64 6c 65 72 28 24 6e 61 6d 65 2c 20 function.addEventHandler($name,.
4a40 24 70 6f 69 6e 74 65 72 2c 20 24 6f 62 6a 29 20 7b 0d 0a 09 09 24 74 68 69 73 2d 3e 65 76 65 6e $pointer,.$obj).{....$this->even
4a60 74 68 61 6e 64 6c 65 72 73 5b 5d 20 3d 20 61 72 72 61 79 28 24 6e 61 6d 65 2c 20 24 70 6f 69 6e thandlers[].=.array($name,.$poin
4a80 74 65 72 2c 20 24 6f 62 6a 29 3b 0d 0a 09 7d 0d 0a 09 2f 2a 2a 0d 0a 09 20 2a 20 43 6f 6e 6e 65 ter,.$obj);...}.../**....*.Conne
4aa0 63 74 20 74 6f 20 58 4d 50 50 20 48 6f 73 74 0d 0a 09 20 2a 0d 0a 09 20 2a 20 40 70 61 72 61 6d ct.to.XMPP.Host....*....*.@param
4ac0 20 69 6e 74 65 67 65 72 20 24 74 69 6d 65 6f 75 74 20 20 20 20 54 69 6d 65 6f 75 74 20 69 6e 20 .integer.$timeout....Timeout.in.
4ae0 73 65 63 6f 6e 64 73 0d 0a 09 20 2a 20 40 70 61 72 61 6d 20 62 6f 6f 6c 65 61 6e 20 24 70 65 72 seconds....*.@param.boolean.$per
4b00 73 69 73 74 65 6e 74 0d 0a 09 20 2a 20 40 70 61 72 61 6d 20 62 6f 6f 6c 65 61 6e 20 24 73 65 6e sistent....*.@param.boolean.$sen
4b20 64 69 6e 69 74 20 20 20 53 65 6e 64 20 58 4d 50 50 20 73 74 61 72 74 69 6e 67 20 73 65 71 75 65 dinit...Send.XMPP.starting.seque
4b40 6e 63 65 20 61 66 74 65 72 20 63 6f 6e 6e 65 63 74 0d 0a 09 20 2a 20 20 20 20 20 20 20 20 20 20 nce.after.connect....*..........
4b60 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 61 75 74 6f 6d 61 74 69 63 61 6c 6c 79 0d ..................automatically.
4b80 0a 09 20 2a 0d 0a 09 20 2a 20 40 74 68 72 6f 77 73 20 58 4d 50 50 45 78 63 65 70 74 69 6f 6e 20 ...*....*.@throws.XMPPException.
4ba0 57 68 65 6e 20 74 68 65 20 63 6f 6e 6e 65 63 74 69 6f 6e 20 66 61 69 6c 73 0d 0a 09 20 2a 2f 0d When.the.connection.fails....*/.
4bc0 0a 09 70 75 62 6c 69 63 20 66 75 6e 63 74 69 6f 6e 20 63 6f 6e 6e 65 63 74 28 24 74 69 6d 65 6f ..public.function.connect($timeo
4be0 75 74 20 3d 20 33 30 2c 20 24 70 65 72 73 69 73 74 65 6e 74 20 3d 20 66 61 6c 73 65 2c 20 24 73 ut.=.30,.$persistent.=.false,.$s
4c00 65 6e 64 69 6e 69 74 20 3d 20 74 72 75 65 29 20 7b 0d 0a 09 09 24 74 68 69 73 2d 3e 73 65 6e 74 endinit.=.true).{....$this->sent
4c20 5f 64 69 73 63 6f 6e 6e 65 63 74 20 3d 20 66 61 6c 73 65 3b 0d 0a 09 09 24 73 74 61 72 74 74 69 _disconnect.=.false;....$startti
4c40 6d 65 20 3d 20 74 69 6d 65 28 29 3b 0d 0a 09 09 0d 0a 09 09 64 6f 20 7b 0d 0a 09 09 09 24 74 68 me.=.time();........do.{.....$th
4c60 69 73 2d 3e 64 69 73 63 6f 6e 6e 65 63 74 65 64 20 3d 20 66 61 6c 73 65 3b 0d 0a 09 09 09 24 74 is->disconnected.=.false;.....$t
4c80 68 69 73 2d 3e 73 65 6e 74 5f 64 69 73 63 6f 6e 6e 65 63 74 20 3d 20 66 61 6c 73 65 3b 0d 0a 09 his->sent_disconnect.=.false;...
4ca0 09 09 69 66 28 24 70 65 72 73 69 73 74 65 6e 74 29 20 7b 0d 0a 09 09 09 09 24 63 6f 6e 66 6c 61 ..if($persistent).{......$confla
4cc0 67 20 3d 20 53 54 52 45 41 4d 5f 43 4c 49 45 4e 54 5f 43 4f 4e 4e 45 43 54 20 7c 20 53 54 52 45 g.=.STREAM_CLIENT_CONNECT.|.STRE
4ce0 41 4d 5f 43 4c 49 45 4e 54 5f 50 45 52 53 49 53 54 45 4e 54 3b 0d 0a 09 09 09 7d 20 65 6c 73 65 AM_CLIENT_PERSISTENT;.....}.else
4d00 20 7b 0d 0a 09 09 09 09 24 63 6f 6e 66 6c 61 67 20 3d 20 53 54 52 45 41 4d 5f 43 4c 49 45 4e 54 .{......$conflag.=.STREAM_CLIENT
4d20 5f 43 4f 4e 4e 45 43 54 3b 0d 0a 09 09 09 7d 0d 0a 09 09 09 24 63 6f 6e 6e 74 79 70 65 20 3d 20 _CONNECT;.....}.....$conntype.=.
4d40 27 74 63 70 27 3b 0d 0a 09 09 09 69 66 28 24 74 68 69 73 2d 3e 75 73 65 5f 73 73 6c 29 20 24 63 'tcp';.....if($this->use_ssl).$c
4d60 6f 6e 6e 74 79 70 65 20 3d 20 27 73 73 6c 27 3b 0d 0a 09 09 09 24 74 68 69 73 2d 3e 6c 6f 67 2d onntype.=.'ssl';.....$this->log-
4d80 3e 6c 6f 67 28 22 43 6f 6e 6e 65 63 74 69 6e 67 20 74 6f 20 24 63 6f 6e 6e 74 79 70 65 3a 2f 2f >log("Connecting.to.$conntype://
4da0 7b 24 74 68 69 73 2d 3e 68 6f 73 74 7d 3a 7b 24 74 68 69 73 2d 3e 70 6f 72 74 7d 22 29 3b 0d 0a {$this->host}:{$this->port}");..
4dc0 09 09 09 74 72 79 20 7b 0d 0a 09 09 09 09 24 74 68 69 73 2d 3e 73 6f 63 6b 65 74 20 3d 20 40 73 ...try.{......$this->socket.=.@s
4de0 74 72 65 61 6d 5f 73 6f 63 6b 65 74 5f 63 6c 69 65 6e 74 28 22 24 63 6f 6e 6e 74 79 70 65 3a 2f tream_socket_client("$conntype:/
4e00 2f 7b 24 74 68 69 73 2d 3e 68 6f 73 74 7d 3a 7b 24 74 68 69 73 2d 3e 70 6f 72 74 7d 22 2c 20 24 /{$this->host}:{$this->port}",.$
4e20 65 72 72 6e 6f 2c 20 24 65 72 72 73 74 72 2c 20 24 74 69 6d 65 6f 75 74 2c 20 24 63 6f 6e 66 6c errno,.$errstr,.$timeout,.$confl
4e40 61 67 29 3b 0d 0a 09 09 09 7d 20 63 61 74 63 68 20 28 45 78 63 65 70 74 69 6f 6e 20 24 65 29 20 ag);.....}.catch.(Exception.$e).
4e60 7b 0d 0a 09 09 09 09 74 68 72 6f 77 20 6e 65 77 20 58 4d 50 50 45 78 63 65 70 74 69 6f 6e 28 24 {......throw.new.XMPPException($
4e80 65 2d 3e 67 65 74 4d 65 73 73 61 67 65 28 29 29 3b 0d 0a 09 09 09 7d 0d 0a 09 09 09 69 66 28 21 e->getMessage());.....}.....if(!
4ea0 24 74 68 69 73 2d 3e 73 6f 63 6b 65 74 29 20 7b 0d 0a 09 09 09 09 24 74 68 69 73 2d 3e 6c 6f 67 $this->socket).{......$this->log
4ec0 2d 3e 6c 6f 67 28 22 43 6f 75 6c 64 20 6e 6f 74 20 63 6f 6e 6e 65 63 74 2e 22 2c 20 20 58 4d 50 ->log("Could.not.connect.",..XMP
4ee0 50 4c 6f 67 3a 3a 4c 45 56 45 4c 5f 45 52 52 4f 52 29 3b 0d 0a 09 09 09 09 24 74 68 69 73 2d 3e PLog::LEVEL_ERROR);......$this->
4f00 64 69 73 63 6f 6e 6e 65 63 74 65 64 20 3d 20 74 72 75 65 3b 0d 0a 09 09 09 09 23 20 54 61 6b 65 disconnected.=.true;......#.Take
4f20 20 69 74 20 65 61 73 79 20 66 6f 72 20 61 20 66 65 77 20 73 65 63 6f 6e 64 73 0d 0a 09 09 09 09 .it.easy.for.a.few.seconds......
4f40 73 6c 65 65 70 28 6d 69 6e 28 24 74 69 6d 65 6f 75 74 2c 20 35 29 29 3b 0d 0a 09 09 09 7d 0d 0a sleep(min($timeout,.5));.....}..
4f60 09 09 7d 20 77 68 69 6c 65 20 28 21 24 74 68 69 73 2d 3e 73 6f 63 6b 65 74 20 26 26 20 28 74 69 ..}.while.(!$this->socket.&&.(ti
4f80 6d 65 28 29 20 2d 20 24 73 74 61 72 74 74 69 6d 65 29 20 3c 20 24 74 69 6d 65 6f 75 74 29 3b 0d me().-.$starttime).<.$timeout);.
4fa0 0a 09 09 0d 0a 09 09 69 66 20 28 24 74 68 69 73 2d 3e 73 6f 63 6b 65 74 29 20 7b 0d 0a 09 09 09 .......if.($this->socket).{.....
4fc0 73 74 72 65 61 6d 5f 73 65 74 5f 62 6c 6f 63 6b 69 6e 67 28 24 74 68 69 73 2d 3e 73 6f 63 6b 65 stream_set_blocking($this->socke
4fe0 74 2c 20 31 29 3b 0d 0a 09 09 09 69 66 28 24 73 65 6e 64 69 6e 69 74 29 20 24 74 68 69 73 2d 3e t,.1);.....if($sendinit).$this->
5000 73 65 6e 64 28 24 74 68 69 73 2d 3e 73 74 72 65 61 6d 5f 73 74 61 72 74 29 3b 0d 0a 09 09 7d 20 send($this->stream_start);....}.
5020 65 6c 73 65 20 7b 0d 0a 09 09 09 74 68 72 6f 77 20 6e 65 77 20 58 4d 50 50 45 78 63 65 70 74 69 else.{.....throw.new.XMPPExcepti
5040 6f 6e 28 22 43 6f 75 6c 64 20 6e 6f 74 20 63 6f 6e 6e 65 63 74 20 62 65 66 6f 72 65 20 74 69 6d on("Could.not.connect.before.tim
5060 65 6f 75 74 2e 22 29 3b 0d 0a 09 09 7d 0d 0a 09 7d 0d 0a 09 2f 2a 2a 0d 0a 09 20 2a 20 52 65 63 eout.");....}...}.../**....*.Rec
5080 6f 6e 6e 65 63 74 20 58 4d 50 50 20 48 6f 73 74 0d 0a 09 20 2a 0d 0a 09 20 2a 20 40 74 68 72 6f onnect.XMPP.Host....*....*.@thro
50a0 77 73 20 58 4d 50 50 45 78 63 65 70 74 69 6f 6e 20 57 68 65 6e 20 74 68 65 20 63 6f 6e 6e 65 63 ws.XMPPException.When.the.connec
50c0 74 69 6f 6e 20 66 61 69 6c 73 0d 0a 09 20 2a 20 40 75 73 65 73 20 20 20 24 72 65 63 6f 6e 6e 65 tion.fails....*.@uses...$reconne
50e0 63 74 54 69 6d 65 6f 75 74 0d 0a 09 20 2a 20 40 73 65 65 20 20 20 20 73 65 74 52 65 63 6f 6e 6e ctTimeout....*.@see....setReconn
5100 65 63 74 54 69 6d 65 6f 75 74 28 29 0d 0a 09 20 2a 2f 0d 0a 09 70 75 62 6c 69 63 20 66 75 6e 63 ectTimeout()....*/...public.func
5120 74 69 6f 6e 20 64 6f 52 65 63 6f 6e 6e 65 63 74 28 29 20 7b 0d 0a 09 09 69 66 28 21 24 74 68 69 tion.doReconnect().{....if(!$thi
5140 73 2d 3e 69 73 5f 73 65 72 76 65 72 29 20 7b 0d 0a 09 09 09 24 74 68 69 73 2d 3e 6c 6f 67 2d 3e s->is_server).{.....$this->log->
5160 6c 6f 67 28 22 52 65 63 6f 6e 6e 65 63 74 69 6e 67 20 28 24 74 68 69 73 2d 3e 72 65 63 6f 6e 6e log("Reconnecting.($this->reconn
5180 65 63 74 54 69 6d 65 6f 75 74 29 2e 2e 2e 22 2c 20 20 58 4d 50 50 4c 6f 67 3a 3a 4c 45 56 45 4c ectTimeout)...",..XMPPLog::LEVEL
51a0 5f 57 41 52 4e 49 4e 47 29 3b 0d 0a 09 09 09 24 74 68 69 73 2d 3e 63 6f 6e 6e 65 63 74 28 24 74 _WARNING);.....$this->connect($t
51c0 68 69 73 2d 3e 72 65 63 6f 6e 6e 65 63 74 54 69 6d 65 6f 75 74 2c 20 66 61 6c 73 65 2c 20 66 61 his->reconnectTimeout,.false,.fa
51e0 6c 73 65 29 3b 0d 0a 09 09 09 24 74 68 69 73 2d 3e 72 65 73 65 74 28 29 3b 0d 0a 09 09 09 24 74 lse);.....$this->reset();.....$t
5200 68 69 73 2d 3e 65 76 65 6e 74 28 27 72 65 63 6f 6e 6e 65 63 74 27 29 3b 0d 0a 09 09 7d 0d 0a 09 his->event('reconnect');....}...
5220 7d 0d 0a 09 70 75 62 6c 69 63 20 66 75 6e 63 74 69 6f 6e 20 73 65 74 52 65 63 6f 6e 6e 65 63 74 }...public.function.setReconnect
5240 54 69 6d 65 6f 75 74 28 24 74 69 6d 65 6f 75 74 29 20 7b 0d 0a 09 09 24 74 68 69 73 2d 3e 72 65 Timeout($timeout).{....$this->re
5260 63 6f 6e 6e 65 63 74 54 69 6d 65 6f 75 74 20 3d 20 24 74 69 6d 65 6f 75 74 3b 0d 0a 09 7d 0d 0a connectTimeout.=.$timeout;...}..
5280 09 0d 0a 09 2f 2a 2a 0d 0a 09 20 2a 20 44 69 73 63 6f 6e 6e 65 63 74 20 66 72 6f 6d 20 58 4d 50 ..../**....*.Disconnect.from.XMP
52a0 50 20 48 6f 73 74 0d 0a 09 20 2a 2f 0d 0a 09 70 75 62 6c 69 63 20 66 75 6e 63 74 69 6f 6e 20 64 P.Host....*/...public.function.d
52c0 69 73 63 6f 6e 6e 65 63 74 28 29 20 7b 0d 0a 09 09 24 74 68 69 73 2d 3e 6c 6f 67 2d 3e 6c 6f 67 isconnect().{....$this->log->log
52e0 28 22 44 69 73 63 6f 6e 6e 65 63 74 69 6e 67 2e 2e 2e 22 2c 20 20 58 4d 50 50 4c 6f 67 3a 3a 4c ("Disconnecting...",..XMPPLog::L
5300 45 56 45 4c 5f 56 45 52 42 4f 53 45 29 3b 0d 0a 09 09 69 66 28 66 61 6c 73 65 20 3d 3d 20 28 62 EVEL_VERBOSE);....if(false.==.(b
5320 6f 6f 6c 29 20 24 74 68 69 73 2d 3e 73 6f 63 6b 65 74 29 20 7b 0d 0a 09 09 09 72 65 74 75 72 6e ool).$this->socket).{.....return
5340 3b 0d 0a 09 09 7d 0d 0a 09 09 24 74 68 69 73 2d 3e 72 65 63 6f 6e 6e 65 63 74 20 3d 20 66 61 6c ;....}....$this->reconnect.=.fal
5360 73 65 3b 0d 0a 09 09 24 74 68 69 73 2d 3e 73 65 6e 64 28 24 74 68 69 73 2d 3e 73 74 72 65 61 6d se;....$this->send($this->stream
5380 5f 65 6e 64 29 3b 0d 0a 09 09 24 74 68 69 73 2d 3e 73 65 6e 74 5f 64 69 73 63 6f 6e 6e 65 63 74 _end);....$this->sent_disconnect
53a0 20 3d 20 74 72 75 65 3b 0d 0a 09 09 24 74 68 69 73 2d 3e 70 72 6f 63 65 73 73 55 6e 74 69 6c 28 .=.true;....$this->processUntil(
53c0 27 65 6e 64 5f 73 74 72 65 61 6d 27 2c 20 35 29 3b 0d 0a 09 09 24 74 68 69 73 2d 3e 64 69 73 63 'end_stream',.5);....$this->disc
53e0 6f 6e 6e 65 63 74 65 64 20 3d 20 74 72 75 65 3b 0d 0a 09 7d 0d 0a 09 2f 2a 2a 0d 0a 09 20 2a 20 onnected.=.true;...}.../**....*.
5400 41 72 65 20 77 65 20 61 72 65 20 64 69 73 63 6f 6e 6e 65 63 74 65 64 3f 0d 0a 09 20 2a 0d 0a 09 Are.we.are.disconnected?....*...
5420 20 2a 20 40 72 65 74 75 72 6e 20 62 6f 6f 6c 65 61 6e 0d 0a 09 20 2a 2f 0d 0a 09 70 75 62 6c 69 .*.@return.boolean....*/...publi
5440 63 20 66 75 6e 63 74 69 6f 6e 20 69 73 44 69 73 63 6f 6e 6e 65 63 74 65 64 28 29 20 7b 0d 0a 09 c.function.isDisconnected().{...
5460 09 72 65 74 75 72 6e 20 24 74 68 69 73 2d 3e 64 69 73 63 6f 6e 6e 65 63 74 65 64 3b 0d 0a 09 7d .return.$this->disconnected;...}
5480 0d 0a 09 2f 2a 2a 0d 0a 09 20 2a 20 43 68 65 63 6b 73 20 69 66 20 74 68 65 20 67 69 76 65 6e 20 .../**....*.Checks.if.the.given.
54a0 73 74 72 69 6e 67 20 69 73 20 63 6c 6f 73 65 64 20 77 69 74 68 20 74 68 65 20 73 61 6d 65 20 74 string.is.closed.with.the.same.t
54c0 61 67 20 61 73 20 69 74 20 69 73 0d 0a 09 20 2a 20 6f 70 65 6e 65 64 2e 20 57 65 20 74 72 79 20 ag.as.it.is....*.opened..We.try.
54e0 74 6f 20 62 65 20 61 73 20 66 61 73 74 20 61 73 20 70 6f 73 73 69 62 6c 65 20 68 65 72 65 2e 0d to.be.as.fast.as.possible.here..
5500 0a 09 20 2a 0d 0a 09 20 2a 20 40 70 61 72 61 6d 20 73 74 72 69 6e 67 20 24 62 75 66 66 20 52 65 ...*....*.@param.string.$buff.Re
5520 61 64 20 62 75 66 66 65 72 20 6f 66 20 5f 5f 70 72 6f 63 65 73 73 28 29 0d 0a 09 20 2a 0d 0a 09 ad.buffer.of.__process()....*...
5540 20 2a 20 40 72 65 74 75 72 6e 20 62 6f 6f 6c 65 61 6e 20 74 72 75 65 20 69 66 20 74 68 65 20 62 .*.@return.boolean.true.if.the.b
5560 75 66 66 65 72 20 73 65 65 6d 73 20 74 6f 20 62 65 20 63 6f 6d 70 6c 65 74 65 0d 0a 09 20 2a 2f uffer.seems.to.be.complete....*/
5580 0d 0a 09 70 72 6f 74 65 63 74 65 64 20 66 75 6e 63 74 69 6f 6e 20 62 75 66 66 65 72 43 6f 6d 70 ...protected.function.bufferComp
55a0 6c 65 74 65 28 24 62 75 66 66 29 0d 0a 09 7b 0d 0a 09 09 69 66 20 28 73 75 62 73 74 72 28 24 62 lete($buff)...{....if.(substr($b
55c0 75 66 66 2c 20 2d 31 29 20 21 3d 20 27 3e 27 29 20 7b 0d 0a 09 09 09 72 65 74 75 72 6e 20 66 61 uff,.-1).!=.'>').{.....return.fa
55e0 6c 73 65 3b 0d 0a 09 09 7d 0d 0a 09 09 2f 2f 77 65 20 61 6c 77 61 79 73 20 68 61 76 65 20 61 20 lse;....}....//we.always.have.a.
5600 73 70 61 63 65 20 73 69 6e 63 65 20 74 68 65 20 6e 61 6d 65 73 70 61 63 65 20 6e 65 65 64 73 20 space.since.the.namespace.needs.
5620 74 6f 20 62 65 0d 0a 09 09 2f 2f 64 65 63 6c 61 72 65 64 2e 20 63 6f 75 6c 64 20 62 65 20 61 20 to.be....//declared..could.be.a.
5640 74 61 62 2c 20 74 68 6f 75 67 68 0d 0a 09 09 24 73 74 61 72 74 20 3d 20 73 75 62 73 74 72 28 0d tab,.though....$start.=.substr(.
5660 0a 09 09 09 24 62 75 66 66 2c 20 31 2c 0d 0a 09 09 09 6d 69 6e 28 73 74 72 70 6f 73 28 24 62 75 ....$buff,.1,.....min(strpos($bu
5680 66 66 2c 20 27 3e 27 2c 20 32 29 2c 20 73 74 72 70 6f 73 28 24 62 75 66 66 2c 20 27 20 27 2c 20 ff,.'>',.2),.strpos($buff,.'.',.
56a0 32 29 29 20 2d 20 31 0d 0a 09 09 29 3b 0d 0a 09 09 24 73 74 6f 70 20 20 3d 20 73 75 62 73 74 72 2)).-.1....);....$stop..=.substr
56c0 28 24 62 75 66 66 2c 20 2d 73 74 72 6c 65 6e 28 24 73 74 61 72 74 29 20 2d 20 33 29 3b 0d 0a 09 ($buff,.-strlen($start).-.3);...
56e0 09 69 66 20 28 24 73 74 61 72 74 20 3d 3d 20 27 3f 78 6d 6c 27 29 20 7b 0d 0a 09 09 09 2f 2f 73 .if.($start.==.'?xml').{.....//s
5700 74 61 72 74 69 6e 67 20 77 69 74 68 20 61 6e 20 78 6d 6c 20 74 61 67 2e 20 74 68 69 73 20 6d 65 tarting.with.an.xml.tag..this.me
5720 61 6e 73 20 61 20 73 74 72 65 61 6d 20 69 73 20 62 65 69 6e 67 0d 0a 09 09 09 2f 2f 20 6f 70 65 ans.a.stream.is.being.....//.ope
5740 6e 65 64 2c 20 77 68 69 63 68 20 69 73 20 6e 6f 74 20 6d 75 63 68 20 6f 66 20 64 61 74 61 2c 20 ned,.which.is.not.much.of.data,.
5760 73 6f 20 6e 6f 20 66 65 61 72 20 69 74 27 73 0d 0a 09 09 09 2f 2f 20 6e 6f 74 20 63 6f 6d 70 6c so.no.fear.it's.....//.not.compl
5780 65 74 65 0d 0a 09 09 09 72 65 74 75 72 6e 20 74 72 75 65 3b 0d 0a 09 09 7d 0d 0a 09 09 69 66 20 ete.....return.true;....}....if.
57a0 28 73 75 62 73 74 72 28 24 73 74 6f 70 2c 20 2d 32 29 20 3d 3d 20 27 2f 3e 27 29 20 7b 0d 0a 09 (substr($stop,.-2).==.'/>').{...
57c0 09 09 2f 2f 6f 6e 65 20 74 61 67 2c 20 69 2e 65 2e 20 3c 73 75 63 63 65 73 73 20 2f 3e 0d 0a 09 ..//one.tag,.i.e..<success./>...
57e0 09 09 72 65 74 75 72 6e 20 74 72 75 65 3b 0d 0a 09 09 7d 0d 0a 09 09 69 66 20 28 27 3c 2f 27 20 ..return.true;....}....if.('</'.
5800 2e 20 24 73 74 61 72 74 20 2e 20 27 3e 27 20 3d 3d 20 24 73 74 6f 70 29 20 7b 0d 0a 09 09 09 72 ..$start...'>'.==.$stop).{.....r
5820 65 74 75 72 6e 20 74 72 75 65 3b 0d 0a 09 09 7d 0d 0a 09 09 72 65 74 75 72 6e 20 66 61 6c 73 65 eturn.true;....}....return.false
5840 3b 0d 0a 09 7d 0d 0a 09 2f 2a 2a 0d 0a 09 20 2a 20 43 6f 72 65 20 72 65 61 64 69 6e 67 20 74 6f ;...}.../**....*.Core.reading.to
5860 6f 6c 0d 0a 09 20 2a 0d 0a 09 20 2a 20 40 70 61 72 61 6d 20 6d 69 78 65 64 20 20 20 24 6d 61 78 ol....*....*.@param.mixed...$max
5880 69 6d 75 6d 20 4c 69 6d 69 74 20 77 68 65 6e 20 74 6f 20 72 65 74 75 72 6e 0d 0a 09 20 2a 20 20 imum.Limit.when.to.return....*..
58a0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2d 20 30 3a 20 6f 6e 6c 79 .......................-.0:.only
58c0 20 72 65 61 64 20 69 66 20 64 61 74 61 20 69 73 20 69 6d 6d 65 64 69 61 74 65 6c 79 20 72 65 61 .read.if.data.is.immediately.rea
58e0 64 79 0d 0a 09 20 2a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 dy....*.........................
5900 2d 20 4e 55 4c 4c 3a 20 77 61 69 74 20 66 6f 72 65 76 65 72 20 61 6e 64 20 65 76 65 72 0d 0a 09 -.NULL:.wait.forever.and.ever...
5920 20 2a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2d 20 69 6e 74 .*.........................-.int
5940 65 67 65 72 3a 20 70 72 6f 63 65 73 73 20 66 6f 72 20 74 68 69 73 20 61 6d 6f 75 6e 74 20 6f 66 eger:.process.for.this.amount.of
5960 20 6d 69 63 72 6f 73 65 63 6f 6e 64 73 0d 0a 09 20 2a 20 40 70 61 72 61 6d 20 62 6f 6f 6c 65 61 .microseconds....*.@param.boolea
5980 6e 20 24 72 65 74 75 72 6e 5f 77 68 65 6e 5f 72 65 63 65 69 76 65 64 20 49 6d 6d 65 64 69 61 74 n.$return_when_received.Immediat
59a0 65 6c 79 20 72 65 74 75 72 6e 20 77 68 65 6e 20 64 61 74 61 20 68 61 76 65 20 62 65 65 6e 0d 0a ely.return.when.data.have.been..
59c0 09 20 2a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ..*.............................
59e0 20 20 20 20 20 20 20 20 20 72 65 63 65 69 76 65 64 0d 0a 09 20 2a 0d 0a 09 20 2a 20 40 72 65 74 .........received....*....*.@ret
5a00 75 72 6e 20 62 6f 6f 6c 65 61 6e 20 54 72 75 65 20 77 68 65 6e 20 61 6c 6c 20 67 6f 65 73 20 77 urn.boolean.True.when.all.goes.w
5a20 65 6c 6c 2c 20 66 61 6c 73 65 20 77 68 65 6e 20 73 6f 6d 65 74 68 69 6e 67 20 66 61 69 6c 73 0d ell,.false.when.something.fails.
5a40 0a 09 20 2a 2f 0d 0a 09 70 72 69 76 61 74 65 20 66 75 6e 63 74 69 6f 6e 20 5f 5f 70 72 6f 63 65 ...*/...private.function.__proce
5a60 73 73 28 24 6d 61 78 69 6d 75 6d 20 3d 20 35 2c 20 24 72 65 74 75 72 6e 5f 77 68 65 6e 5f 72 65 ss($maximum.=.5,.$return_when_re
5a80 63 65 69 76 65 64 20 3d 20 66 61 6c 73 65 29 0d 0a 09 7b 0d 0a 09 09 24 72 65 6d 61 69 6e 69 6e ceived.=.false)...{....$remainin
5aa0 67 20 3d 20 24 6d 61 78 69 6d 75 6d 3b 0d 0a 09 09 0d 0a 09 09 64 6f 20 7b 0d 0a 09 09 09 24 73 g.=.$maximum;........do.{.....$s
5ac0 74 61 72 74 74 69 6d 65 20 3d 20 28 6d 69 63 72 6f 74 69 6d 65 28 74 72 75 65 29 20 2a 20 31 30 tarttime.=.(microtime(true).*.10
5ae0 30 30 30 30 30 29 3b 0d 0a 09 09 09 24 72 65 61 64 20 3d 20 61 72 72 61 79 28 24 74 68 69 73 2d 00000);.....$read.=.array($this-
5b00 3e 73 6f 63 6b 65 74 29 3b 0d 0a 09 09 09 24 77 72 69 74 65 20 3d 20 61 72 72 61 79 28 29 3b 0d >socket);.....$write.=.array();.
5b20 0a 09 09 09 24 65 78 63 65 70 74 20 3d 20 61 72 72 61 79 28 29 3b 0d 0a 09 09 09 69 66 20 28 69 ....$except.=.array();.....if.(i
5b40 73 5f 6e 75 6c 6c 28 24 6d 61 78 69 6d 75 6d 29 29 20 7b 0d 0a 09 09 09 09 24 73 65 63 73 20 3d s_null($maximum)).{......$secs.=
5b60 20 4e 55 4c 4c 3b 0d 0a 09 09 09 09 24 75 73 65 63 73 20 3d 20 4e 55 4c 4c 3b 0d 0a 09 09 09 7d .NULL;......$usecs.=.NULL;.....}
5b80 20 65 6c 73 65 20 69 66 20 28 24 6d 61 78 69 6d 75 6d 20 3d 3d 20 30 29 20 7b 0d 0a 09 09 09 09 .else.if.($maximum.==.0).{......
5ba0 24 73 65 63 73 20 3d 20 30 3b 0d 0a 09 09 09 09 24 75 73 65 63 73 20 3d 20 30 3b 0d 0a 09 09 09 $secs.=.0;......$usecs.=.0;.....
5bc0 7d 20 65 6c 73 65 20 7b 0d 0a 09 09 09 09 24 75 73 65 63 73 20 3d 20 24 72 65 6d 61 69 6e 69 6e }.else.{......$usecs.=.$remainin
5be0 67 20 25 20 31 30 30 30 30 30 30 3b 0d 0a 09 09 09 09 24 73 65 63 73 20 3d 20 66 6c 6f 6f 72 28 g.%.1000000;......$secs.=.floor(
5c00 28 24 72 65 6d 61 69 6e 69 6e 67 20 2d 20 24 75 73 65 63 73 29 20 2f 20 31 30 30 30 30 30 30 29 ($remaining.-.$usecs)./.1000000)
5c20 3b 0d 0a 09 09 09 7d 0d 0a 09 09 09 24 75 70 64 61 74 65 64 20 3d 20 40 73 74 72 65 61 6d 5f 73 ;.....}.....$updated.=.@stream_s
5c40 65 6c 65 63 74 28 24 72 65 61 64 2c 20 24 77 72 69 74 65 2c 20 24 65 78 63 65 70 74 2c 20 24 73 elect($read,.$write,.$except,.$s
5c60 65 63 73 2c 20 24 75 73 65 63 73 29 3b 0d 0a 09 09 09 69 66 20 28 24 75 70 64 61 74 65 64 20 3d ecs,.$usecs);.....if.($updated.=
5c80 3d 3d 20 66 61 6c 73 65 29 20 7b 0d 0a 09 09 09 09 24 74 68 69 73 2d 3e 6c 6f 67 2d 3e 6c 6f 67 ==.false).{......$this->log->log
5ca0 28 22 45 72 72 6f 72 20 6f 6e 20 73 74 72 65 61 6d 5f 73 65 6c 65 63 74 28 29 22 2c 20 20 58 4d ("Error.on.stream_select()",..XM
5cc0 50 50 4c 6f 67 3a 3a 4c 45 56 45 4c 5f 56 45 52 42 4f 53 45 29 3b 0d 0a 09 09 09 09 69 66 20 28 PPLog::LEVEL_VERBOSE);......if.(
5ce0 24 74 68 69 73 2d 3e 72 65 63 6f 6e 6e 65 63 74 29 20 7b 0d 0a 09 09 09 09 09 24 74 68 69 73 2d $this->reconnect).{.......$this-
5d00 3e 64 6f 52 65 63 6f 6e 6e 65 63 74 28 29 3b 0d 0a 09 09 09 09 7d 20 65 6c 73 65 20 7b 0d 0a 09 >doReconnect();......}.else.{...
5d20 09 09 09 09 66 63 6c 6f 73 65 28 24 74 68 69 73 2d 3e 73 6f 63 6b 65 74 29 3b 0d 0a 09 09 09 09 ....fclose($this->socket);......
5d40 09 24 74 68 69 73 2d 3e 73 6f 63 6b 65 74 20 3d 20 4e 55 4c 4c 3b 0d 0a 09 09 09 09 09 72 65 74 .$this->socket.=.NULL;.......ret
5d60 75 72 6e 20 66 61 6c 73 65 3b 0d 0a 09 09 09 09 7d 0d 0a 09 09 09 7d 20 65 6c 73 65 20 69 66 20 urn.false;......}.....}.else.if.
5d80 28 24 75 70 64 61 74 65 64 20 3e 20 30 29 20 7b 0d 0a 09 09 09 09 24 62 75 66 66 20 3d 20 27 27 ($updated.>.0).{......$buff.=.''
5da0 3b 0d 0a 09 09 09 09 64 6f 20 7b 0d 0a 09 09 09 09 09 69 66 20 28 24 62 75 66 66 20 21 3d 20 27 ;......do.{.......if.($buff.!=.'
5dc0 27 29 20 7b 0d 0a 09 09 09 09 09 09 2f 2f 64 69 73 61 62 6c 65 20 62 6c 6f 63 6b 69 6e 67 20 66 ').{........//disable.blocking.f
5de0 6f 72 20 6e 6f 77 20 62 65 63 61 75 73 65 20 66 72 65 61 64 28 29 20 77 69 6c 6c 0d 0a 09 09 09 or.now.because.fread().will.....
5e00 09 09 09 2f 2f 20 62 6c 6f 63 6b 20 75 6e 74 69 6c 20 74 68 65 20 34 6b 20 61 72 65 20 66 75 6c ...//.block.until.the.4k.are.ful
5e20 6c 20 69 66 20 77 65 20 61 6c 72 65 61 64 79 0d 0a 09 09 09 09 09 09 2f 2f 20 72 65 61 64 20 61 l.if.we.already........//.read.a
5e40 20 70 61 72 74 20 6f 66 20 74 68 65 20 70 61 63 6b 65 74 0d 0a 09 09 09 09 09 09 73 74 72 65 61 .part.of.the.packet........strea
5e60 6d 5f 73 65 74 5f 62 6c 6f 63 6b 69 6e 67 28 24 74 68 69 73 2d 3e 73 6f 63 6b 65 74 2c 20 30 29 m_set_blocking($this->socket,.0)
5e80 3b 0d 0a 09 09 09 09 09 7d 0d 0a 09 09 09 09 09 24 70 61 72 74 20 3d 20 66 72 65 61 64 28 24 74 ;.......}.......$part.=.fread($t
5ea0 68 69 73 2d 3e 73 6f 63 6b 65 74 2c 20 34 30 39 36 29 3b 0d 0a 09 09 09 09 09 73 74 72 65 61 6d his->socket,.4096);.......stream
5ec0 5f 73 65 74 5f 62 6c 6f 63 6b 69 6e 67 28 24 74 68 69 73 2d 3e 73 6f 63 6b 65 74 2c 20 31 29 3b _set_blocking($this->socket,.1);
5ee0 0d 0a 09 09 09 09 09 69 66 20 28 21 24 70 61 72 74 29 20 7b 0d 0a 09 09 09 09 09 09 69 66 28 24 .......if.(!$part).{........if($
5f00 74 68 69 73 2d 3e 72 65 63 6f 6e 6e 65 63 74 29 20 7b 0d 0a 09 09 09 09 09 09 09 24 74 68 69 73 this->reconnect).{.........$this
5f20 2d 3e 64 6f 52 65 63 6f 6e 6e 65 63 74 28 29 3b 0d 0a 09 09 09 09 09 09 7d 20 65 6c 73 65 20 7b ->doReconnect();........}.else.{
5f40 0d 0a 09 09 09 09 09 09 09 66 63 6c 6f 73 65 28 24 74 68 69 73 2d 3e 73 6f 63 6b 65 74 29 3b 0d .........fclose($this->socket);.
5f60 0a 09 09 09 09 09 09 09 24 74 68 69 73 2d 3e 73 6f 63 6b 65 74 20 3d 20 4e 55 4c 4c 3b 0d 0a 09 ........$this->socket.=.NULL;...
5f80 09 09 09 09 09 09 72 65 74 75 72 6e 20 66 61 6c 73 65 3b 0d 0a 09 09 09 09 09 09 7d 0d 0a 09 09 ......return.false;........}....
5fa0 09 09 09 7d 0d 0a 09 09 09 09 09 24 74 68 69 73 2d 3e 6c 6f 67 2d 3e 6c 6f 67 28 22 52 45 43 56 ...}.......$this->log->log("RECV
5fc0 3a 20 24 70 61 72 74 22 2c 20 20 58 4d 50 50 4c 6f 67 3a 3a 4c 45 56 45 4c 5f 56 45 52 42 4f 53 :.$part",..XMPPLog::LEVEL_VERBOS
5fe0 45 29 3b 0d 0a 09 09 09 09 09 24 62 75 66 66 20 2e 3d 20 24 70 61 72 74 3b 0d 0a 09 09 09 09 7d E);.......$buff..=.$part;......}
6000 20 77 68 69 6c 65 20 28 21 24 74 68 69 73 2d 3e 62 75 66 66 65 72 43 6f 6d 70 6c 65 74 65 28 24 .while.(!$this->bufferComplete($
6020 62 75 66 66 29 29 3b 0d 0a 09 09 09 09 78 6d 6c 5f 70 61 72 73 65 28 24 74 68 69 73 2d 3e 70 61 buff));......xml_parse($this->pa
6040 72 73 65 72 2c 20 24 62 75 66 66 2c 20 66 61 6c 73 65 29 3b 0d 0a 09 09 09 09 69 66 20 28 24 72 rser,.$buff,.false);......if.($r
6060 65 74 75 72 6e 5f 77 68 65 6e 5f 72 65 63 65 69 76 65 64 29 20 7b 0d 0a 09 09 09 09 09 72 65 74 eturn_when_received).{.......ret
6080 75 72 6e 20 74 72 75 65 3b 0d 0a 09 09 09 09 7d 0d 0a 09 09 09 7d 20 65 6c 73 65 20 7b 0d 0a 09 urn.true;......}.....}.else.{...
60a0 09 09 09 23 20 24 75 70 64 61 74 65 64 20 3d 3d 20 30 20 6d 65 61 6e 73 20 6e 6f 20 63 68 61 6e ...#.$updated.==.0.means.no.chan
60c0 67 65 73 20 64 75 72 69 6e 67 20 74 69 6d 65 6f 75 74 2e 0d 0a 09 09 09 7d 0d 0a 09 09 09 24 65 ges.during.timeout......}.....$e
60e0 6e 64 74 69 6d 65 20 3d 20 28 6d 69 63 72 6f 74 69 6d 65 28 74 72 75 65 29 2a 31 30 30 30 30 30 ndtime.=.(microtime(true)*100000
6100 30 29 3b 0d 0a 09 09 09 24 74 69 6d 65 5f 70 61 73 74 20 3d 20 24 65 6e 64 74 69 6d 65 20 2d 20 0);.....$time_past.=.$endtime.-.
6120 24 73 74 61 72 74 74 69 6d 65 3b 0d 0a 09 09 09 24 72 65 6d 61 69 6e 69 6e 67 20 3d 20 24 72 65 $starttime;.....$remaining.=.$re
6140 6d 61 69 6e 69 6e 67 20 2d 20 24 74 69 6d 65 5f 70 61 73 74 3b 0d 0a 09 09 7d 20 77 68 69 6c 65 maining.-.$time_past;....}.while
6160 20 28 69 73 5f 6e 75 6c 6c 28 24 6d 61 78 69 6d 75 6d 29 20 7c 7c 20 24 72 65 6d 61 69 6e 69 6e .(is_null($maximum).||.$remainin
6180 67 20 3e 20 30 29 3b 0d 0a 09 09 72 65 74 75 72 6e 20 74 72 75 65 3b 0d 0a 09 7d 0d 0a 09 0d 0a g.>.0);....return.true;...}.....
61a0 09 2f 2a 2a 0d 0a 09 20 2a 20 50 72 6f 63 65 73 73 0d 0a 09 20 2a 0d 0a 09 20 2a 20 40 72 65 74 ./**....*.Process....*....*.@ret
61c0 75 72 6e 20 73 74 72 69 6e 67 0d 0a 09 20 2a 2f 0d 0a 09 70 75 62 6c 69 63 20 66 75 6e 63 74 69 urn.string....*/...public.functi
61e0 6f 6e 20 70 72 6f 63 65 73 73 28 29 20 7b 0d 0a 09 09 24 74 68 69 73 2d 3e 5f 5f 70 72 6f 63 65 on.process().{....$this->__proce
6200 73 73 28 4e 55 4c 4c 29 3b 0d 0a 09 7d 0d 0a 09 2f 2a 2a 0d 0a 09 20 2a 20 50 72 6f 63 65 73 73 ss(NULL);...}.../**....*.Process
6220 20 75 6e 74 69 6c 20 61 20 74 69 6d 65 6f 75 74 20 6f 63 63 75 72 73 0d 0a 09 20 2a 0d 0a 09 20 .until.a.timeout.occurs....*....
6240 2a 20 40 70 61 72 61 6d 20 69 6e 74 65 67 65 72 20 24 74 69 6d 65 6f 75 74 20 54 69 6d 65 20 69 *.@param.integer.$timeout.Time.i
6260 6e 20 73 65 63 6f 6e 64 73 0d 0a 09 20 2a 0d 0a 09 20 2a 20 40 72 65 74 75 72 6e 20 73 74 72 69 n.seconds....*....*.@return.stri
6280 6e 67 0d 0a 09 20 2a 0d 0a 09 20 2a 20 40 73 65 65 20 5f 5f 70 72 6f 63 65 73 73 28 29 0d 0a 09 ng....*....*.@see.__process()...
62a0 20 2a 2f 0d 0a 09 70 75 62 6c 69 63 20 66 75 6e 63 74 69 6f 6e 20 70 72 6f 63 65 73 73 54 69 6d .*/...public.function.processTim
62c0 65 28 24 74 69 6d 65 6f 75 74 3d 4e 55 4c 4c 29 20 7b 0d 0a 09 09 69 66 20 28 69 73 5f 6e 75 6c e($timeout=NULL).{....if.(is_nul
62e0 6c 28 24 74 69 6d 65 6f 75 74 29 29 20 7b 0d 0a 09 09 09 72 65 74 75 72 6e 20 24 74 68 69 73 2d l($timeout)).{.....return.$this-
6300 3e 5f 5f 70 72 6f 63 65 73 73 28 4e 55 4c 4c 29 3b 0d 0a 09 09 7d 20 65 6c 73 65 20 7b 0d 0a 09 >__process(NULL);....}.else.{...
6320 09 09 72 65 74 75 72 6e 20 24 74 68 69 73 2d 3e 5f 5f 70 72 6f 63 65 73 73 28 24 74 69 6d 65 6f ..return.$this->__process($timeo
6340 75 74 20 2a 20 31 30 30 30 30 30 30 29 3b 0d 0a 09 09 7d 0d 0a 09 7d 0d 0a 09 2f 2a 2a 0d 0a 09 ut.*.1000000);....}...}.../**...
6360 20 2a 20 50 72 6f 63 65 73 73 20 75 6e 74 69 6c 20 61 20 73 70 65 63 69 66 69 65 64 20 65 76 65 .*.Process.until.a.specified.eve
6380 6e 74 20 6f 72 20 61 20 74 69 6d 65 6f 75 74 20 6f 63 63 75 72 73 0d 0a 09 20 2a 0d 0a 09 20 2a nt.or.a.timeout.occurs....*....*
63a0 20 40 70 61 72 61 6d 20 73 74 72 69 6e 67 7c 61 72 72 61 79 20 24 65 76 65 6e 74 20 20 20 45 76 .@param.string|array.$event...Ev
63c0 65 6e 74 20 6e 61 6d 65 20 6f 72 20 61 72 72 61 79 20 6f 66 20 65 76 65 6e 74 20 6e 61 6d 65 73 ent.name.or.array.of.event.names
63e0 0d 0a 09 20 2a 20 40 70 61 72 61 6d 20 69 6e 74 65 67 65 72 20 20 20 20 20 20 24 74 69 6d 65 6f ....*.@param.integer......$timeo
6400 75 74 20 54 69 6d 65 6f 75 74 20 69 6e 20 73 65 63 6f 6e 64 73 0d 0a 09 20 2a 0d 0a 09 20 2a 20 ut.Timeout.in.seconds....*....*.
6420 40 72 65 74 75 72 6e 20 61 72 72 61 79 20 50 61 79 6c 6f 61 64 0d 0a 09 20 2a 2f 0d 0a 09 70 75 @return.array.Payload....*/...pu
6440 62 6c 69 63 20 66 75 6e 63 74 69 6f 6e 20 70 72 6f 63 65 73 73 55 6e 74 69 6c 28 24 65 76 65 6e blic.function.processUntil($even
6460 74 2c 20 24 74 69 6d 65 6f 75 74 20 3d 20 2d 31 29 0d 0a 09 7b 0d 0a 09 09 69 66 20 28 24 74 68 t,.$timeout.=.-1)...{....if.($th
6480 69 73 2d 3e 64 69 73 63 6f 6e 6e 65 63 74 65 64 29 20 7b 0d 0a 09 09 09 74 68 72 6f 77 20 6e 65 is->disconnected).{.....throw.ne
64a0 77 20 58 4d 50 50 45 78 63 65 70 74 69 6f 6e 28 27 59 6f 75 20 6e 65 65 64 20 74 6f 20 63 6f 6e w.XMPPException('You.need.to.con
64c0 6e 65 63 74 20 66 69 72 73 74 27 29 3b 0d 0a 09 09 7d 0d 0a 09 09 24 73 74 61 72 74 20 3d 20 74 nect.first');....}....$start.=.t
64e0 69 6d 65 28 29 3b 0d 0a 09 09 69 66 20 28 21 69 73 5f 61 72 72 61 79 28 24 65 76 65 6e 74 29 29 ime();....if.(!is_array($event))
6500 20 7b 0d 0a 09 09 09 24 65 76 65 6e 74 20 3d 20 61 72 72 61 79 28 24 65 76 65 6e 74 29 3b 0d 0a .{.....$event.=.array($event);..
6520 09 09 7d 0d 0a 09 09 24 74 68 69 73 2d 3e 75 6e 74 69 6c 5b 5d 20 3d 20 24 65 76 65 6e 74 3b 0d ..}....$this->until[].=.$event;.
6540 0a 09 09 65 6e 64 28 24 74 68 69 73 2d 3e 75 6e 74 69 6c 29 3b 0d 0a 09 09 24 65 76 65 6e 74 5f ...end($this->until);....$event_
6560 6b 65 79 20 3d 20 6b 65 79 28 24 74 68 69 73 2d 3e 75 6e 74 69 6c 29 3b 0d 0a 09 09 72 65 73 65 key.=.key($this->until);....rese
6580 74 28 24 74 68 69 73 2d 3e 75 6e 74 69 6c 29 3b 0d 0a 09 09 24 74 68 69 73 2d 3e 75 6e 74 69 6c t($this->until);....$this->until
65a0 5f 63 6f 75 6e 74 5b 24 65 76 65 6e 74 5f 6b 65 79 5d 20 3d 20 30 3b 0d 0a 09 09 24 75 70 64 61 _count[$event_key].=.0;....$upda
65c0 74 65 64 20 3d 20 27 27 3b 0d 0a 09 09 77 68 69 6c 65 20 28 21 24 74 68 69 73 2d 3e 64 69 73 63 ted.=.'';....while.(!$this->disc
65e0 6f 6e 6e 65 63 74 65 64 0d 0a 09 09 09 26 26 20 24 74 68 69 73 2d 3e 75 6e 74 69 6c 5f 63 6f 75 onnected.....&&.$this->until_cou
6600 6e 74 5b 24 65 76 65 6e 74 5f 6b 65 79 5d 20 3c 20 31 0d 0a 09 09 09 26 26 20 28 24 74 69 6d 65 nt[$event_key].<.1.....&&.($time
6620 6f 75 74 20 3d 3d 20 2d 31 20 7c 7c 20 74 69 6d 65 28 29 20 2d 20 24 73 74 61 72 74 20 3c 20 24 out.==.-1.||.time().-.$start.<.$
6640 74 69 6d 65 6f 75 74 29 0d 0a 09 09 29 20 7b 0d 0a 09 09 09 24 6d 61 78 69 6d 75 6d 20 3d 20 24 timeout)....).{.....$maximum.=.$
6660 74 69 6d 65 6f 75 74 20 3d 3d 20 2d 31 0d 0a 09 09 09 09 3f 20 4e 55 4c 4c 0d 0a 09 09 09 09 3a timeout.==.-1......?.NULL......:
6680 20 28 24 74 69 6d 65 6f 75 74 20 2d 20 28 74 69 6d 65 28 29 20 2d 20 24 73 74 61 72 74 29 29 20 .($timeout.-.(time().-.$start)).
66a0 2a 20 31 30 30 30 30 30 30 3b 0d 0a 09 09 09 24 72 65 74 20 3d 20 24 74 68 69 73 2d 3e 5f 5f 70 *.1000000;.....$ret.=.$this->__p
66c0 72 6f 63 65 73 73 28 24 6d 61 78 69 6d 75 6d 2c 20 74 72 75 65 29 3b 0d 0a 09 09 09 69 66 20 28 rocess($maximum,.true);.....if.(
66e0 21 24 72 65 74 29 20 7b 0d 0a 09 09 09 09 62 72 65 61 6b 3b 0d 0a 09 09 09 7d 0d 0a 09 09 7d 0d !$ret).{......break;.....}....}.
6700 0a 09 09 69 66 20 28 61 72 72 61 79 5f 6b 65 79 5f 65 78 69 73 74 73 28 24 65 76 65 6e 74 5f 6b ...if.(array_key_exists($event_k
6720 65 79 2c 20 24 74 68 69 73 2d 3e 75 6e 74 69 6c 5f 70 61 79 6c 6f 61 64 29 29 20 7b 0d 0a 09 09 ey,.$this->until_payload)).{....
6740 09 24 70 61 79 6c 6f 61 64 20 3d 20 24 74 68 69 73 2d 3e 75 6e 74 69 6c 5f 70 61 79 6c 6f 61 64 .$payload.=.$this->until_payload
6760 5b 24 65 76 65 6e 74 5f 6b 65 79 5d 3b 0d 0a 09 09 09 75 6e 73 65 74 28 24 74 68 69 73 2d 3e 75 [$event_key];.....unset($this->u
6780 6e 74 69 6c 5f 70 61 79 6c 6f 61 64 5b 24 65 76 65 6e 74 5f 6b 65 79 5d 29 3b 0d 0a 09 09 09 75 ntil_payload[$event_key]);.....u
67a0 6e 73 65 74 28 24 74 68 69 73 2d 3e 75 6e 74 69 6c 5f 63 6f 75 6e 74 5b 24 65 76 65 6e 74 5f 6b nset($this->until_count[$event_k
67c0 65 79 5d 29 3b 0d 0a 09 09 09 75 6e 73 65 74 28 24 74 68 69 73 2d 3e 75 6e 74 69 6c 5b 24 65 76 ey]);.....unset($this->until[$ev
67e0 65 6e 74 5f 6b 65 79 5d 29 3b 0d 0a 09 09 7d 20 65 6c 73 65 20 7b 0d 0a 09 09 09 24 70 61 79 6c ent_key]);....}.else.{.....$payl
6800 6f 61 64 20 3d 20 61 72 72 61 79 28 29 3b 0d 0a 09 09 7d 0d 0a 09 09 72 65 74 75 72 6e 20 24 70 oad.=.array();....}....return.$p
6820 61 79 6c 6f 61 64 3b 0d 0a 09 7d 0d 0a 09 2f 2a 2a 0d 0a 09 20 2a 20 4f 62 73 6f 6c 65 74 65 3f ayload;...}.../**....*.Obsolete?
6840 0d 0a 09 20 2a 2f 0d 0a 09 70 75 62 6c 69 63 20 66 75 6e 63 74 69 6f 6e 20 58 61 70 70 6c 79 5f ....*/...public.function.Xapply_
6860 73 6f 63 6b 65 74 28 24 73 6f 63 6b 65 74 29 20 7b 0d 0a 09 09 24 74 68 69 73 2d 3e 73 6f 63 6b socket($socket).{....$this->sock
6880 65 74 20 3d 20 24 73 6f 63 6b 65 74 3b 0d 0a 09 7d 0d 0a 09 2f 2a 2a 0d 0a 09 20 2a 20 58 4d 4c et.=.$socket;...}.../**....*.XML
68a0 20 73 74 61 72 74 20 63 61 6c 6c 62 61 63 6b 0d 0a 09 20 2a 20 0d 0a 09 20 2a 20 40 73 65 65 20 .start.callback....*.....*.@see.
68c0 78 6d 6c 5f 73 65 74 5f 65 6c 65 6d 65 6e 74 5f 68 61 6e 64 6c 65 72 0d 0a 09 20 2a 0d 0a 09 20 xml_set_element_handler....*....
68e0 2a 20 40 70 61 72 61 6d 20 72 65 73 6f 75 72 63 65 20 24 70 61 72 73 65 72 0d 0a 09 20 2a 20 40 *.@param.resource.$parser....*.@
6900 70 61 72 61 6d 20 73 74 72 69 6e 67 20 20 20 24 6e 61 6d 65 0d 0a 09 20 2a 2f 0d 0a 09 70 75 62 param.string...$name....*/...pub
6920 6c 69 63 20 66 75 6e 63 74 69 6f 6e 20 73 74 61 72 74 58 4d 4c 28 24 70 61 72 73 65 72 2c 20 24 lic.function.startXML($parser,.$
6940 6e 61 6d 65 2c 20 24 61 74 74 72 29 20 7b 0d 0a 09 09 69 66 28 24 74 68 69 73 2d 3e 62 65 65 6e name,.$attr).{....if($this->been
6960 5f 72 65 73 65 74 29 20 7b 0d 0a 09 09 09 24 74 68 69 73 2d 3e 62 65 65 6e 5f 72 65 73 65 74 20 _reset).{.....$this->been_reset.
6980 3d 20 66 61 6c 73 65 3b 0d 0a 09 09 09 24 74 68 69 73 2d 3e 78 6d 6c 5f 64 65 70 74 68 20 3d 20 =.false;.....$this->xml_depth.=.
69a0 30 3b 0d 0a 09 09 7d 0d 0a 09 09 24 74 68 69 73 2d 3e 78 6d 6c 5f 64 65 70 74 68 2b 2b 3b 0d 0a 0;....}....$this->xml_depth++;..
69c0 09 09 69 66 28 61 72 72 61 79 5f 6b 65 79 5f 65 78 69 73 74 73 28 27 58 4d 4c 4e 53 27 2c 20 24 ..if(array_key_exists('XMLNS',.$
69e0 61 74 74 72 29 29 20 7b 0d 0a 09 09 09 24 74 68 69 73 2d 3e 63 75 72 72 65 6e 74 5f 6e 73 5b 24 attr)).{.....$this->current_ns[$
6a00 74 68 69 73 2d 3e 78 6d 6c 5f 64 65 70 74 68 5d 20 3d 20 24 61 74 74 72 5b 27 58 4d 4c 4e 53 27 this->xml_depth].=.$attr['XMLNS'
6a20 5d 3b 0d 0a 09 09 7d 20 65 6c 73 65 20 7b 0d 0a 09 09 09 24 74 68 69 73 2d 3e 63 75 72 72 65 6e ];....}.else.{.....$this->curren
6a40 74 5f 6e 73 5b 24 74 68 69 73 2d 3e 78 6d 6c 5f 64 65 70 74 68 5d 20 3d 20 24 74 68 69 73 2d 3e t_ns[$this->xml_depth].=.$this->
6a60 63 75 72 72 65 6e 74 5f 6e 73 5b 24 74 68 69 73 2d 3e 78 6d 6c 5f 64 65 70 74 68 20 2d 20 31 5d current_ns[$this->xml_depth.-.1]
6a80 3b 0d 0a 09 09 09 69 66 28 21 24 74 68 69 73 2d 3e 63 75 72 72 65 6e 74 5f 6e 73 5b 24 74 68 69 ;.....if(!$this->current_ns[$thi
6aa0 73 2d 3e 78 6d 6c 5f 64 65 70 74 68 5d 29 20 24 74 68 69 73 2d 3e 63 75 72 72 65 6e 74 5f 6e 73 s->xml_depth]).$this->current_ns
6ac0 5b 24 74 68 69 73 2d 3e 78 6d 6c 5f 64 65 70 74 68 5d 20 3d 20 24 74 68 69 73 2d 3e 64 65 66 61 [$this->xml_depth].=.$this->defa
6ae0 75 6c 74 5f 6e 73 3b 0d 0a 09 09 7d 0d 0a 09 09 24 6e 73 20 3d 20 24 74 68 69 73 2d 3e 63 75 72 ult_ns;....}....$ns.=.$this->cur
6b00 72 65 6e 74 5f 6e 73 5b 24 74 68 69 73 2d 3e 78 6d 6c 5f 64 65 70 74 68 5d 3b 0d 0a 09 09 66 6f rent_ns[$this->xml_depth];....fo
6b20 72 65 61 63 68 28 24 61 74 74 72 20 61 73 20 24 6b 65 79 20 3d 3e 20 24 76 61 6c 75 65 29 20 7b reach($attr.as.$key.=>.$value).{
6b40 0d 0a 09 09 09 69 66 28 73 74 72 73 74 72 28 24 6b 65 79 2c 20 22 3a 22 29 29 20 7b 0d 0a 09 09 .....if(strstr($key,.":")).{....
6b60 09 09 24 6b 65 79 20 3d 20 65 78 70 6c 6f 64 65 28 27 3a 27 2c 20 24 6b 65 79 29 3b 0d 0a 09 09 ..$key.=.explode(':',.$key);....
6b80 09 09 24 6b 65 79 20 3d 20 24 6b 65 79 5b 31 5d 3b 0d 0a 09 09 09 09 24 74 68 69 73 2d 3e 6e 73 ..$key.=.$key[1];......$this->ns
6ba0 5f 6d 61 70 5b 24 6b 65 79 5d 20 3d 20 24 76 61 6c 75 65 3b 0d 0a 09 09 09 7d 0d 0a 09 09 7d 0d _map[$key].=.$value;.....}....}.
6bc0 0a 09 09 69 66 28 21 73 74 72 73 74 72 28 24 6e 61 6d 65 2c 20 22 3a 22 29 20 3d 3d 3d 20 66 61 ...if(!strstr($name,.":").===.fa
6be0 6c 73 65 29 0d 0a 09 09 7b 0d 0a 09 09 09 24 6e 61 6d 65 20 3d 20 65 78 70 6c 6f 64 65 28 27 3a lse)....{.....$name.=.explode(':
6c00 27 2c 20 24 6e 61 6d 65 29 3b 0d 0a 09 09 09 24 6e 73 20 3d 20 24 74 68 69 73 2d 3e 6e 73 5f 6d ',.$name);.....$ns.=.$this->ns_m
6c20 61 70 5b 24 6e 61 6d 65 5b 30 5d 5d 3b 0d 0a 09 09 09 24 6e 61 6d 65 20 3d 20 24 6e 61 6d 65 5b ap[$name[0]];.....$name.=.$name[
6c40 31 5d 3b 0d 0a 09 09 7d 0d 0a 09 09 24 6f 62 6a 20 3d 20 6e 65 77 20 58 4d 4c 4f 62 6a 28 24 6e 1];....}....$obj.=.new.XMLObj($n
6c60 61 6d 65 2c 20 24 6e 73 2c 20 24 61 74 74 72 29 3b 0d 0a 09 09 69 66 28 24 74 68 69 73 2d 3e 78 ame,.$ns,.$attr);....if($this->x
6c80 6d 6c 5f 64 65 70 74 68 20 3e 20 31 29 20 7b 0d 0a 09 09 09 24 74 68 69 73 2d 3e 78 6d 6c 6f 62 ml_depth.>.1).{.....$this->xmlob
6ca0 6a 5b 24 74 68 69 73 2d 3e 78 6d 6c 5f 64 65 70 74 68 20 2d 20 31 5d 2d 3e 73 75 62 73 5b 5d 20 j[$this->xml_depth.-.1]->subs[].
6cc0 3d 20 24 6f 62 6a 3b 0d 0a 09 09 7d 0d 0a 09 09 24 74 68 69 73 2d 3e 78 6d 6c 6f 62 6a 5b 24 74 =.$obj;....}....$this->xmlobj[$t
6ce0 68 69 73 2d 3e 78 6d 6c 5f 64 65 70 74 68 5d 20 3d 20 24 6f 62 6a 3b 0d 0a 09 7d 0d 0a 09 2f 2a his->xml_depth].=.$obj;...}.../*
6d00 2a 0d 0a 09 20 2a 20 58 4d 4c 20 65 6e 64 20 63 61 6c 6c 62 61 63 6b 0d 0a 09 20 2a 20 0d 0a 09 *....*.XML.end.callback....*....
6d20 20 2a 20 40 73 65 65 20 78 6d 6c 5f 73 65 74 5f 65 6c 65 6d 65 6e 74 5f 68 61 6e 64 6c 65 72 0d .*.@see.xml_set_element_handler.
6d40 0a 09 20 2a 0d 0a 09 20 2a 20 40 70 61 72 61 6d 20 72 65 73 6f 75 72 63 65 20 24 70 61 72 73 65 ...*....*.@param.resource.$parse
6d60 72 0d 0a 09 20 2a 20 40 70 61 72 61 6d 20 73 74 72 69 6e 67 20 20 20 24 6e 61 6d 65 0d 0a 09 20 r....*.@param.string...$name....
6d80 2a 2f 0d 0a 09 70 75 62 6c 69 63 20 66 75 6e 63 74 69 6f 6e 20 65 6e 64 58 4d 4c 28 24 70 61 72 */...public.function.endXML($par
6da0 73 65 72 2c 20 24 6e 61 6d 65 29 20 7b 0d 0a 09 09 23 24 74 68 69 73 2d 3e 6c 6f 67 2d 3e 6c 6f ser,.$name).{....#$this->log->lo
6dc0 67 28 22 45 6e 64 69 6e 67 20 24 6e 61 6d 65 22 2c 20 20 58 4d 50 50 4c 6f 67 3a 3a 4c 45 56 45 g("Ending.$name",..XMPPLog::LEVE
6de0 4c 5f 44 45 42 55 47 29 3b 0d 0a 09 09 23 70 72 69 6e 74 20 22 24 6e 61 6d 65 5c 6e 22 3b 0d 0a L_DEBUG);....#print."$name\n";..
6e00 09 09 69 66 28 24 74 68 69 73 2d 3e 62 65 65 6e 5f 72 65 73 65 74 29 20 7b 0d 0a 09 09 09 24 74 ..if($this->been_reset).{.....$t
6e20 68 69 73 2d 3e 62 65 65 6e 5f 72 65 73 65 74 20 3d 20 66 61 6c 73 65 3b 0d 0a 09 09 09 24 74 68 his->been_reset.=.false;.....$th
6e40 69 73 2d 3e 78 6d 6c 5f 64 65 70 74 68 20 3d 20 30 3b 0d 0a 09 09 7d 0d 0a 09 09 24 74 68 69 73 is->xml_depth.=.0;....}....$this
6e60 2d 3e 78 6d 6c 5f 64 65 70 74 68 2d 2d 3b 0d 0a 09 09 69 66 28 24 74 68 69 73 2d 3e 78 6d 6c 5f ->xml_depth--;....if($this->xml_
6e80 64 65 70 74 68 20 3d 3d 20 31 29 20 7b 0d 0a 09 09 09 23 63 6c 65 61 6e 2d 75 70 20 6f 6c 64 20 depth.==.1).{.....#clean-up.old.
6ea0 6f 62 6a 65 63 74 73 0d 0a 09 09 09 23 24 66 6f 75 6e 64 20 3d 20 66 61 6c 73 65 3b 20 23 46 49 objects.....#$found.=.false;.#FI
6ec0 58 4d 45 20 54 68 69 73 20 64 69 64 6e 27 74 20 61 70 70 65 61 72 20 74 6f 20 62 65 20 69 6e 20 XME.This.didn't.appear.to.be.in.
6ee0 75 73 65 20 2d 2d 47 61 72 0d 0a 09 09 09 66 6f 72 65 61 63 68 28 24 74 68 69 73 2d 3e 78 70 61 use.--Gar.....foreach($this->xpa
6f00 74 68 68 61 6e 64 6c 65 72 73 20 61 73 20 24 68 61 6e 64 6c 65 72 29 20 7b 0d 0a 09 09 09 09 69 thhandlers.as.$handler).{......i
6f20 66 20 28 69 73 5f 61 72 72 61 79 28 24 74 68 69 73 2d 3e 78 6d 6c 6f 62 6a 29 20 26 26 20 61 72 f.(is_array($this->xmlobj).&&.ar
6f40 72 61 79 5f 6b 65 79 5f 65 78 69 73 74 73 28 32 2c 20 24 74 68 69 73 2d 3e 78 6d 6c 6f 62 6a 29 ray_key_exists(2,.$this->xmlobj)
6f60 29 20 7b 0d 0a 09 09 09 09 09 24 73 65 61 72 63 68 78 6d 6c 20 3d 20 24 74 68 69 73 2d 3e 78 6d ).{.......$searchxml.=.$this->xm
6f80 6c 6f 62 6a 5b 32 5d 3b 0d 0a 09 09 09 09 09 24 6e 73 74 61 67 20 3d 20 61 72 72 61 79 5f 73 68 lobj[2];.......$nstag.=.array_sh
6fa0 69 66 74 28 24 68 61 6e 64 6c 65 72 5b 30 5d 29 3b 0d 0a 09 09 09 09 09 69 66 20 28 28 24 6e 73 ift($handler[0]);.......if.(($ns
6fc0 74 61 67 5b 30 5d 20 3d 3d 20 6e 75 6c 6c 20 6f 72 20 24 73 65 61 72 63 68 78 6d 6c 2d 3e 6e 73 tag[0].==.null.or.$searchxml->ns
6fe0 20 3d 3d 20 24 6e 73 74 61 67 5b 30 5d 29 20 61 6e 64 20 28 24 6e 73 74 61 67 5b 31 5d 20 3d 3d .==.$nstag[0]).and.($nstag[1].==
7000 20 22 2a 22 20 6f 72 20 24 6e 73 74 61 67 5b 31 5d 20 3d 3d 20 24 73 65 61 72 63 68 78 6d 6c 2d ."*".or.$nstag[1].==.$searchxml-
7020 3e 6e 61 6d 65 29 29 20 7b 0d 0a 09 09 09 09 09 09 66 6f 72 65 61 63 68 28 24 68 61 6e 64 6c 65 >name)).{........foreach($handle
7040 72 5b 30 5d 20 61 73 20 24 6e 73 74 61 67 29 20 7b 0d 0a 09 09 09 09 09 09 09 69 66 20 28 24 73 r[0].as.$nstag).{.........if.($s
7060 65 61 72 63 68 78 6d 6c 20 21 3d 3d 20 6e 75 6c 6c 20 61 6e 64 20 24 73 65 61 72 63 68 78 6d 6c earchxml.!==.null.and.$searchxml
7080 2d 3e 68 61 73 53 75 62 28 24 6e 73 74 61 67 5b 31 5d 2c 20 24 6e 73 3d 24 6e 73 74 61 67 5b 30 ->hasSub($nstag[1],.$ns=$nstag[0
70a0 5d 29 29 20 7b 0d 0a 09 09 09 09 09 09 09 09 24 73 65 61 72 63 68 78 6d 6c 20 3d 20 24 73 65 61 ])).{..........$searchxml.=.$sea
70c0 72 63 68 78 6d 6c 2d 3e 73 75 62 28 24 6e 73 74 61 67 5b 31 5d 2c 20 24 6e 73 3d 24 6e 73 74 61 rchxml->sub($nstag[1],.$ns=$nsta
70e0 67 5b 30 5d 29 3b 0d 0a 09 09 09 09 09 09 09 7d 20 65 6c 73 65 20 7b 0d 0a 09 09 09 09 09 09 09 g[0]);.........}.else.{.........
7100 09 24 73 65 61 72 63 68 78 6d 6c 20 3d 20 6e 75 6c 6c 3b 0d 0a 09 09 09 09 09 09 09 09 62 72 65 .$searchxml.=.null;..........bre
7120 61 6b 3b 0d 0a 09 09 09 09 09 09 09 7d 0d 0a 09 09 09 09 09 09 7d 0d 0a 09 09 09 09 09 09 69 66 ak;.........}........}........if
7140 20 28 24 73 65 61 72 63 68 78 6d 6c 20 21 3d 3d 20 6e 75 6c 6c 29 20 7b 0d 0a 09 09 09 09 09 09 .($searchxml.!==.null).{........
7160 09 69 66 28 24 68 61 6e 64 6c 65 72 5b 32 5d 20 3d 3d 3d 20 6e 75 6c 6c 29 20 24 68 61 6e 64 6c .if($handler[2].===.null).$handl
7180 65 72 5b 32 5d 20 3d 20 24 74 68 69 73 3b 0d 0a 09 09 09 09 09 09 09 24 74 68 69 73 2d 3e 6c 6f er[2].=.$this;.........$this->lo
71a0 67 2d 3e 6c 6f 67 28 22 43 61 6c 6c 69 6e 67 20 7b 24 68 61 6e 64 6c 65 72 5b 31 5d 7d 22 2c 20 g->log("Calling.{$handler[1]}",.
71c0 20 58 4d 50 50 4c 6f 67 3a 3a 4c 45 56 45 4c 5f 44 45 42 55 47 29 3b 0d 0a 09 09 09 09 09 09 09 .XMPPLog::LEVEL_DEBUG);.........
71e0 24 68 61 6e 64 6c 65 72 5b 32 5d 2d 3e 24 68 61 6e 64 6c 65 72 5b 31 5d 28 24 74 68 69 73 2d 3e $handler[2]->$handler[1]($this->
7200 78 6d 6c 6f 62 6a 5b 32 5d 29 3b 0d 0a 09 09 09 09 09 09 7d 0d 0a 09 09 09 09 09 7d 0d 0a 09 09 xmlobj[2]);........}.......}....
7220 09 09 7d 0d 0a 09 09 09 7d 0d 0a 09 09 09 66 6f 72 65 61 63 68 28 24 74 68 69 73 2d 3e 6e 73 68 ..}.....}.....foreach($this->nsh
7240 61 6e 64 6c 65 72 73 20 61 73 20 24 68 61 6e 64 6c 65 72 29 20 7b 0d 0a 09 09 09 09 69 66 28 24 andlers.as.$handler).{......if($
7260 68 61 6e 64 6c 65 72 5b 34 5d 20 21 3d 20 31 20 61 6e 64 20 61 72 72 61 79 5f 6b 65 79 5f 65 78 handler[4].!=.1.and.array_key_ex
7280 69 73 74 73 28 32 2c 20 24 74 68 69 73 2d 3e 78 6d 6c 6f 62 6a 29 20 61 6e 64 20 20 24 74 68 69 ists(2,.$this->xmlobj).and..$thi
72a0 73 2d 3e 78 6d 6c 6f 62 6a 5b 32 5d 2d 3e 68 61 73 53 75 62 28 24 68 61 6e 64 6c 65 72 5b 30 5d s->xmlobj[2]->hasSub($handler[0]
72c0 29 29 20 7b 0d 0a 09 09 09 09 09 24 73 65 61 72 63 68 78 6d 6c 20 3d 20 24 74 68 69 73 2d 3e 78 )).{.......$searchxml.=.$this->x
72e0 6d 6c 6f 62 6a 5b 32 5d 2d 3e 73 75 62 28 24 68 61 6e 64 6c 65 72 5b 30 5d 29 3b 0d 0a 09 09 09 mlobj[2]->sub($handler[0]);.....
7300 09 7d 20 65 6c 73 65 69 66 28 69 73 5f 61 72 72 61 79 28 24 74 68 69 73 2d 3e 78 6d 6c 6f 62 6a .}.elseif(is_array($this->xmlobj
7320 29 20 61 6e 64 20 61 72 72 61 79 5f 6b 65 79 5f 65 78 69 73 74 73 28 32 2c 20 24 74 68 69 73 2d ).and.array_key_exists(2,.$this-
7340 3e 78 6d 6c 6f 62 6a 29 29 20 7b 0d 0a 09 09 09 09 09 24 73 65 61 72 63 68 78 6d 6c 20 3d 20 24 >xmlobj)).{.......$searchxml.=.$
7360 74 68 69 73 2d 3e 78 6d 6c 6f 62 6a 5b 32 5d 3b 0d 0a 09 09 09 09 7d 0d 0a 09 09 09 09 69 66 28 this->xmlobj[2];......}......if(
7380 24 73 65 61 72 63 68 78 6d 6c 20 21 3d 3d 20 6e 75 6c 6c 20 61 6e 64 20 24 73 65 61 72 63 68 78 $searchxml.!==.null.and.$searchx
73a0 6d 6c 2d 3e 6e 61 6d 65 20 3d 3d 20 24 68 61 6e 64 6c 65 72 5b 30 5d 20 61 6e 64 20 28 24 73 65 ml->name.==.$handler[0].and.($se
73c0 61 72 63 68 78 6d 6c 2d 3e 6e 73 20 3d 3d 20 24 68 61 6e 64 6c 65 72 5b 31 5d 20 6f 72 20 28 21 archxml->ns.==.$handler[1].or.(!
73e0 24 68 61 6e 64 6c 65 72 5b 31 5d 20 61 6e 64 20 24 73 65 61 72 63 68 78 6d 6c 2d 3e 6e 73 20 3d $handler[1].and.$searchxml->ns.=
7400 3d 20 24 74 68 69 73 2d 3e 64 65 66 61 75 6c 74 5f 6e 73 29 29 29 20 7b 0d 0a 09 09 09 09 09 69 =.$this->default_ns))).{.......i
7420 66 28 24 68 61 6e 64 6c 65 72 5b 33 5d 20 3d 3d 3d 20 6e 75 6c 6c 29 20 24 68 61 6e 64 6c 65 72 f($handler[3].===.null).$handler
7440 5b 33 5d 20 3d 20 24 74 68 69 73 3b 0d 0a 09 09 09 09 09 24 74 68 69 73 2d 3e 6c 6f 67 2d 3e 6c [3].=.$this;.......$this->log->l
7460 6f 67 28 22 43 61 6c 6c 69 6e 67 20 7b 24 68 61 6e 64 6c 65 72 5b 32 5d 7d 22 2c 20 20 58 4d 50 og("Calling.{$handler[2]}",..XMP
7480 50 4c 6f 67 3a 3a 4c 45 56 45 4c 5f 44 45 42 55 47 29 3b 0d 0a 09 09 09 09 09 24 68 61 6e 64 6c PLog::LEVEL_DEBUG);.......$handl
74a0 65 72 5b 33 5d 2d 3e 24 68 61 6e 64 6c 65 72 5b 32 5d 28 24 74 68 69 73 2d 3e 78 6d 6c 6f 62 6a er[3]->$handler[2]($this->xmlobj
74c0 5b 32 5d 29 3b 0d 0a 09 09 09 09 7d 0d 0a 09 09 09 7d 0d 0a 09 09 09 66 6f 72 65 61 63 68 28 24 [2]);......}.....}.....foreach($
74e0 74 68 69 73 2d 3e 69 64 68 61 6e 64 6c 65 72 73 20 61 73 20 24 69 64 20 3d 3e 20 24 68 61 6e 64 this->idhandlers.as.$id.=>.$hand
7500 6c 65 72 29 20 7b 0d 0a 09 09 09 09 69 66 28 61 72 72 61 79 5f 6b 65 79 5f 65 78 69 73 74 73 28 ler).{......if(array_key_exists(
7520 27 69 64 27 2c 20 24 74 68 69 73 2d 3e 78 6d 6c 6f 62 6a 5b 32 5d 2d 3e 61 74 74 72 73 29 20 61 'id',.$this->xmlobj[2]->attrs).a
7540 6e 64 20 24 74 68 69 73 2d 3e 78 6d 6c 6f 62 6a 5b 32 5d 2d 3e 61 74 74 72 73 5b 27 69 64 27 5d nd.$this->xmlobj[2]->attrs['id']
7560 20 3d 3d 20 24 69 64 29 20 7b 0d 0a 09 09 09 09 09 69 66 28 24 68 61 6e 64 6c 65 72 5b 31 5d 20 .==.$id).{.......if($handler[1].
7580 3d 3d 3d 20 6e 75 6c 6c 29 20 24 68 61 6e 64 6c 65 72 5b 31 5d 20 3d 20 24 74 68 69 73 3b 0d 0a ===.null).$handler[1].=.$this;..
75a0 09 09 09 09 09 24 68 61 6e 64 6c 65 72 5b 31 5d 2d 3e 24 68 61 6e 64 6c 65 72 5b 30 5d 28 24 74 .....$handler[1]->$handler[0]($t
75c0 68 69 73 2d 3e 78 6d 6c 6f 62 6a 5b 32 5d 29 3b 0d 0a 09 09 09 09 09 23 69 64 20 68 61 6e 64 6c his->xmlobj[2]);.......#id.handl
75e0 65 72 73 20 61 72 65 20 6f 6e 6c 79 20 75 73 65 64 20 6f 6e 63 65 0d 0a 09 09 09 09 09 75 6e 73 ers.are.only.used.once.......uns
7600 65 74 28 24 74 68 69 73 2d 3e 69 64 68 61 6e 64 6c 65 72 73 5b 24 69 64 5d 29 3b 0d 0a 09 09 09 et($this->idhandlers[$id]);.....
7620 09 09 62 72 65 61 6b 3b 0d 0a 09 09 09 09 7d 0d 0a 09 09 09 7d 0d 0a 09 09 09 69 66 28 69 73 5f ..break;......}.....}.....if(is_
7640 61 72 72 61 79 28 24 74 68 69 73 2d 3e 78 6d 6c 6f 62 6a 29 29 20 7b 0d 0a 09 09 09 09 24 74 68 array($this->xmlobj)).{......$th
7660 69 73 2d 3e 78 6d 6c 6f 62 6a 20 3d 20 61 72 72 61 79 5f 73 6c 69 63 65 28 24 74 68 69 73 2d 3e is->xmlobj.=.array_slice($this->
7680 78 6d 6c 6f 62 6a 2c 20 30 2c 20 31 29 3b 0d 0a 09 09 09 09 69 66 28 69 73 73 65 74 28 24 74 68 xmlobj,.0,.1);......if(isset($th
76a0 69 73 2d 3e 78 6d 6c 6f 62 6a 5b 30 5d 29 20 26 26 20 24 74 68 69 73 2d 3e 78 6d 6c 6f 62 6a 5b is->xmlobj[0]).&&.$this->xmlobj[
76c0 30 5d 20 69 6e 73 74 61 6e 63 65 6f 66 20 58 4d 4c 4f 62 6a 29 20 7b 0d 0a 09 09 09 09 09 24 74 0].instanceof.XMLObj).{.......$t
76e0 68 69 73 2d 3e 78 6d 6c 6f 62 6a 5b 30 5d 2d 3e 73 75 62 73 20 3d 20 6e 75 6c 6c 3b 0d 0a 09 09 his->xmlobj[0]->subs.=.null;....
7700 09 09 7d 0d 0a 09 09 09 7d 0d 0a 09 09 09 75 6e 73 65 74 28 24 74 68 69 73 2d 3e 78 6d 6c 6f 62 ..}.....}.....unset($this->xmlob
7720 6a 5b 32 5d 29 3b 0d 0a 09 09 7d 0d 0a 09 09 69 66 28 24 74 68 69 73 2d 3e 78 6d 6c 5f 64 65 70 j[2]);....}....if($this->xml_dep
7740 74 68 20 3d 3d 20 30 20 61 6e 64 20 21 24 74 68 69 73 2d 3e 62 65 65 6e 5f 72 65 73 65 74 29 20 th.==.0.and.!$this->been_reset).
7760 7b 0d 0a 09 09 09 69 66 28 21 24 74 68 69 73 2d 3e 64 69 73 63 6f 6e 6e 65 63 74 65 64 29 20 7b {.....if(!$this->disconnected).{
7780 0d 0a 09 09 09 09 69 66 28 21 24 74 68 69 73 2d 3e 73 65 6e 74 5f 64 69 73 63 6f 6e 6e 65 63 74 ......if(!$this->sent_disconnect
77a0 29 20 7b 0d 0a 09 09 09 09 09 24 74 68 69 73 2d 3e 73 65 6e 64 28 24 74 68 69 73 2d 3e 73 74 72 ).{.......$this->send($this->str
77c0 65 61 6d 5f 65 6e 64 29 3b 0d 0a 09 09 09 09 7d 0d 0a 09 09 09 09 24 74 68 69 73 2d 3e 64 69 73 eam_end);......}......$this->dis
77e0 63 6f 6e 6e 65 63 74 65 64 20 3d 20 74 72 75 65 3b 0d 0a 09 09 09 09 24 74 68 69 73 2d 3e 73 65 connected.=.true;......$this->se
7800 6e 74 5f 64 69 73 63 6f 6e 6e 65 63 74 20 3d 20 74 72 75 65 3b 0d 0a 09 09 09 09 66 63 6c 6f 73 nt_disconnect.=.true;......fclos
7820 65 28 24 74 68 69 73 2d 3e 73 6f 63 6b 65 74 29 3b 0d 0a 09 09 09 09 69 66 28 24 74 68 69 73 2d e($this->socket);......if($this-
7840 3e 72 65 63 6f 6e 6e 65 63 74 29 20 7b 0d 0a 09 09 09 09 09 24 74 68 69 73 2d 3e 64 6f 52 65 63 >reconnect).{.......$this->doRec
7860 6f 6e 6e 65 63 74 28 29 3b 0d 0a 09 09 09 09 7d 0d 0a 09 09 09 7d 0d 0a 09 09 09 24 74 68 69 73 onnect();......}.....}.....$this
7880 2d 3e 65 76 65 6e 74 28 27 65 6e 64 5f 73 74 72 65 61 6d 27 29 3b 0d 0a 09 09 7d 0d 0a 09 7d 0d ->event('end_stream');....}...}.
78a0 0a 09 2f 2a 2a 0d 0a 09 20 2a 20 58 4d 4c 20 63 68 61 72 61 63 74 65 72 20 63 61 6c 6c 62 61 63 ../**....*.XML.character.callbac
78c0 6b 0d 0a 09 20 2a 20 40 73 65 65 20 78 6d 6c 5f 73 65 74 5f 63 68 61 72 61 63 74 65 72 5f 64 61 k....*.@see.xml_set_character_da
78e0 74 61 5f 68 61 6e 64 6c 65 72 0d 0a 09 20 2a 0d 0a 09 20 2a 20 40 70 61 72 61 6d 20 72 65 73 6f ta_handler....*....*.@param.reso
7900 75 72 63 65 20 24 70 61 72 73 65 72 0d 0a 09 20 2a 20 40 70 61 72 61 6d 20 73 74 72 69 6e 67 20 urce.$parser....*.@param.string.
7920 20 20 24 64 61 74 61 0d 0a 09 20 2a 2f 0d 0a 09 70 75 62 6c 69 63 20 66 75 6e 63 74 69 6f 6e 20 ..$data....*/...public.function.
7940 63 68 61 72 58 4d 4c 28 24 70 61 72 73 65 72 2c 20 24 64 61 74 61 29 20 7b 0d 0a 09 09 69 66 28 charXML($parser,.$data).{....if(
7960 61 72 72 61 79 5f 6b 65 79 5f 65 78 69 73 74 73 28 24 74 68 69 73 2d 3e 78 6d 6c 5f 64 65 70 74 array_key_exists($this->xml_dept
7980 68 2c 20 24 74 68 69 73 2d 3e 78 6d 6c 6f 62 6a 29 29 20 7b 0d 0a 09 09 09 24 74 68 69 73 2d 3e h,.$this->xmlobj)).{.....$this->
79a0 78 6d 6c 6f 62 6a 5b 24 74 68 69 73 2d 3e 78 6d 6c 5f 64 65 70 74 68 5d 2d 3e 64 61 74 61 20 2e xmlobj[$this->xml_depth]->data..
79c0 3d 20 24 64 61 74 61 3b 0d 0a 09 09 7d 0d 0a 09 7d 0d 0a 09 2f 2a 2a 0d 0a 09 20 2a 20 45 76 65 =.$data;....}...}.../**....*.Eve
79e0 6e 74 3f 0d 0a 09 20 2a 0d 0a 09 20 2a 20 40 70 61 72 61 6d 20 73 74 72 69 6e 67 20 24 6e 61 6d nt?....*....*.@param.string.$nam
7a00 65 0d 0a 09 20 2a 20 40 70 61 72 61 6d 20 73 74 72 69 6e 67 20 24 70 61 79 6c 6f 61 64 0d 0a 09 e....*.@param.string.$payload...
7a20 20 2a 2f 0d 0a 09 70 75 62 6c 69 63 20 66 75 6e 63 74 69 6f 6e 20 65 76 65 6e 74 28 24 6e 61 6d .*/...public.function.event($nam
7a40 65 2c 20 24 70 61 79 6c 6f 61 64 20 3d 20 6e 75 6c 6c 29 20 7b 0d 0a 09 09 24 74 68 69 73 2d 3e e,.$payload.=.null).{....$this->
7a60 6c 6f 67 2d 3e 6c 6f 67 28 22 45 56 45 4e 54 3a 20 24 6e 61 6d 65 22 2c 20 20 58 4d 50 50 4c 6f log->log("EVENT:.$name",..XMPPLo
7a80 67 3a 3a 4c 45 56 45 4c 5f 44 45 42 55 47 29 3b 0d 0a 09 09 66 6f 72 65 61 63 68 28 24 74 68 69 g::LEVEL_DEBUG);....foreach($thi
7aa0 73 2d 3e 65 76 65 6e 74 68 61 6e 64 6c 65 72 73 20 61 73 20 24 68 61 6e 64 6c 65 72 29 20 7b 0d s->eventhandlers.as.$handler).{.
7ac0 0a 09 09 09 69 66 28 24 6e 61 6d 65 20 3d 3d 20 24 68 61 6e 64 6c 65 72 5b 30 5d 29 20 7b 0d 0a ....if($name.==.$handler[0]).{..
7ae0 09 09 09 09 69 66 28 24 68 61 6e 64 6c 65 72 5b 32 5d 20 3d 3d 3d 20 6e 75 6c 6c 29 20 7b 0d 0a ....if($handler[2].===.null).{..
7b00 09 09 09 09 09 24 68 61 6e 64 6c 65 72 5b 32 5d 20 3d 20 24 74 68 69 73 3b 0d 0a 09 09 09 09 7d .....$handler[2].=.$this;......}
7b20 0d 0a 09 09 09 09 24 68 61 6e 64 6c 65 72 5b 32 5d 2d 3e 24 68 61 6e 64 6c 65 72 5b 31 5d 28 24 ......$handler[2]->$handler[1]($
7b40 70 61 79 6c 6f 61 64 29 3b 0d 0a 09 09 09 7d 0d 0a 09 09 7d 0d 0a 09 09 66 6f 72 65 61 63 68 28 payload);.....}....}....foreach(
7b60 24 74 68 69 73 2d 3e 75 6e 74 69 6c 20 61 73 20 24 6b 65 79 20 3d 3e 20 24 75 6e 74 69 6c 29 20 $this->until.as.$key.=>.$until).
7b80 7b 0d 0a 09 09 09 69 66 28 69 73 5f 61 72 72 61 79 28 24 75 6e 74 69 6c 29 29 20 7b 0d 0a 09 09 {.....if(is_array($until)).{....
7ba0 09 09 69 66 28 69 6e 5f 61 72 72 61 79 28 24 6e 61 6d 65 2c 20 24 75 6e 74 69 6c 29 29 20 7b 0d ..if(in_array($name,.$until)).{.
7bc0 0a 09 09 09 09 09 24 74 68 69 73 2d 3e 75 6e 74 69 6c 5f 70 61 79 6c 6f 61 64 5b 24 6b 65 79 5d ......$this->until_payload[$key]
7be0 5b 5d 20 3d 20 61 72 72 61 79 28 24 6e 61 6d 65 2c 20 24 70 61 79 6c 6f 61 64 29 3b 0d 0a 09 09 [].=.array($name,.$payload);....
7c00 09 09 09 69 66 28 21 69 73 73 65 74 28 24 74 68 69 73 2d 3e 75 6e 74 69 6c 5f 63 6f 75 6e 74 5b ...if(!isset($this->until_count[
7c20 24 6b 65 79 5d 29 29 20 7b 0d 0a 09 09 09 09 09 09 24 74 68 69 73 2d 3e 75 6e 74 69 6c 5f 63 6f $key])).{........$this->until_co
7c40 75 6e 74 5b 24 6b 65 79 5d 20 3d 20 30 3b 0d 0a 09 09 09 09 09 7d 0d 0a 09 09 09 09 09 24 74 68 unt[$key].=.0;.......}.......$th
7c60 69 73 2d 3e 75 6e 74 69 6c 5f 63 6f 75 6e 74 5b 24 6b 65 79 5d 20 2b 3d 20 31 3b 0d 0a 09 09 09 is->until_count[$key].+=.1;.....
7c80 09 09 23 24 74 68 69 73 2d 3e 75 6e 74 69 6c 5b 24 6b 65 79 5d 20 3d 20 66 61 6c 73 65 3b 0d 0a ..#$this->until[$key].=.false;..
7ca0 09 09 09 09 7d 0d 0a 09 09 09 7d 0d 0a 09 09 7d 0d 0a 09 7d 0d 0a 09 2f 2a 2a 0d 0a 09 20 2a 20 ....}.....}....}...}.../**....*.
7cc0 52 65 61 64 20 66 72 6f 6d 20 73 6f 63 6b 65 74 0d 0a 09 20 2a 2f 0d 0a 09 70 75 62 6c 69 63 20 Read.from.socket....*/...public.
7ce0 66 75 6e 63 74 69 6f 6e 20 72 65 61 64 28 29 20 7b 0d 0a 09 09 24 62 75 66 66 20 3d 20 40 66 72 function.read().{....$buff.=.@fr
7d00 65 61 64 28 24 74 68 69 73 2d 3e 73 6f 63 6b 65 74 2c 20 31 30 32 34 29 3b 0d 0a 09 09 69 66 28 ead($this->socket,.1024);....if(
7d20 21 24 62 75 66 66 29 20 7b 20 0d 0a 09 09 09 69 66 28 24 74 68 69 73 2d 3e 72 65 63 6f 6e 6e 65 !$buff).{......if($this->reconne
7d40 63 74 29 20 7b 0d 0a 09 09 09 09 24 74 68 69 73 2d 3e 64 6f 52 65 63 6f 6e 6e 65 63 74 28 29 3b ct).{......$this->doReconnect();
7d60 0d 0a 09 09 09 7d 20 65 6c 73 65 20 7b 0d 0a 09 09 09 09 66 63 6c 6f 73 65 28 24 74 68 69 73 2d .....}.else.{......fclose($this-
7d80 3e 73 6f 63 6b 65 74 29 3b 0d 0a 09 09 09 09 72 65 74 75 72 6e 20 66 61 6c 73 65 3b 0d 0a 09 09 >socket);......return.false;....
7da0 09 7d 0d 0a 09 09 7d 0d 0a 09 09 24 74 68 69 73 2d 3e 6c 6f 67 2d 3e 6c 6f 67 28 22 52 45 43 56 .}....}....$this->log->log("RECV
7dc0 3a 20 24 62 75 66 66 22 2c 20 20 58 4d 50 50 4c 6f 67 3a 3a 4c 45 56 45 4c 5f 56 45 52 42 4f 53 :.$buff",..XMPPLog::LEVEL_VERBOS
7de0 45 29 3b 0d 0a 09 09 78 6d 6c 5f 70 61 72 73 65 28 24 74 68 69 73 2d 3e 70 61 72 73 65 72 2c 20 E);....xml_parse($this->parser,.
7e00 24 62 75 66 66 2c 20 66 61 6c 73 65 29 3b 0d 0a 09 7d 0d 0a 09 2f 2a 2a 0d 0a 09 20 2a 20 53 65 $buff,.false);...}.../**....*.Se
7e20 6e 64 20 74 6f 20 73 6f 63 6b 65 74 0d 0a 09 20 2a 0d 0a 09 20 2a 20 40 70 61 72 61 6d 20 73 74 nd.to.socket....*....*.@param.st
7e40 72 69 6e 67 20 24 6d 73 67 0d 0a 09 20 2a 2f 0d 0a 09 70 75 62 6c 69 63 20 66 75 6e 63 74 69 6f ring.$msg....*/...public.functio
7e60 6e 20 73 65 6e 64 28 24 6d 73 67 2c 20 24 74 69 6d 65 6f 75 74 3d 4e 55 4c 4c 29 20 7b 0d 0a 09 n.send($msg,.$timeout=NULL).{...
7e80 09 69 66 20 28 69 73 5f 6e 75 6c 6c 28 24 74 69 6d 65 6f 75 74 29 29 20 7b 0d 0a 09 09 09 24 73 .if.(is_null($timeout)).{.....$s
7ea0 65 63 73 20 3d 20 4e 55 4c 4c 3b 0d 0a 09 09 09 24 75 73 65 63 73 20 3d 20 4e 55 4c 4c 3b 0d 0a ecs.=.NULL;.....$usecs.=.NULL;..
7ec0 09 09 7d 20 65 6c 73 65 20 69 66 20 28 24 74 69 6d 65 6f 75 74 20 3d 3d 20 30 29 20 7b 0d 0a 09 ..}.else.if.($timeout.==.0).{...
7ee0 09 09 24 73 65 63 73 20 3d 20 30 3b 0d 0a 09 09 09 24 75 73 65 63 73 20 3d 20 30 3b 0d 0a 09 09 ..$secs.=.0;.....$usecs.=.0;....
7f00 7d 20 65 6c 73 65 20 7b 0d 0a 09 09 09 24 6d 61 78 69 6d 75 6d 20 3d 20 24 74 69 6d 65 6f 75 74 }.else.{.....$maximum.=.$timeout
7f20 20 2a 20 31 30 30 30 30 30 30 3b 0d 0a 09 09 09 24 75 73 65 63 73 20 3d 20 24 6d 61 78 69 6d 75 .*.1000000;.....$usecs.=.$maximu
7f40 6d 20 25 20 31 30 30 30 30 30 30 3b 0d 0a 09 09 09 24 73 65 63 73 20 3d 20 66 6c 6f 6f 72 28 28 m.%.1000000;.....$secs.=.floor((
7f60 24 6d 61 78 69 6d 75 6d 20 2d 20 24 75 73 65 63 73 29 20 2f 20 31 30 30 30 30 30 30 29 3b 0d 0a $maximum.-.$usecs)./.1000000);..
7f80 09 09 7d 0d 0a 09 09 0d 0a 09 09 24 72 65 61 64 20 3d 20 61 72 72 61 79 28 29 3b 0d 0a 09 09 24 ..}........$read.=.array();....$
7fa0 77 72 69 74 65 20 3d 20 61 72 72 61 79 28 24 74 68 69 73 2d 3e 73 6f 63 6b 65 74 29 3b 0d 0a 09 write.=.array($this->socket);...
7fc0 09 24 65 78 63 65 70 74 20 3d 20 61 72 72 61 79 28 29 3b 0d 0a 09 09 0d 0a 09 09 24 73 65 6c 65 .$except.=.array();........$sele
7fe0 63 74 20 3d 20 40 73 74 72 65 61 6d 5f 73 65 6c 65 63 74 28 24 72 65 61 64 2c 20 24 77 72 69 74 ct.=.@stream_select($read,.$writ
8000 65 2c 20 24 65 78 63 65 70 74 2c 20 24 73 65 63 73 2c 20 24 75 73 65 63 73 29 3b 0d 0a 09 09 0d e,.$except,.$secs,.$usecs);.....
8020 0a 09 09 69 66 28 24 73 65 6c 65 63 74 20 3d 3d 3d 20 46 61 6c 73 65 29 20 7b 0d 0a 09 09 09 24 ...if($select.===.False).{.....$
8040 74 68 69 73 2d 3e 6c 6f 67 2d 3e 6c 6f 67 28 22 45 52 52 4f 52 20 73 65 6e 64 69 6e 67 20 6d 65 this->log->log("ERROR.sending.me
8060 73 73 61 67 65 3b 20 72 65 63 6f 6e 6e 65 63 74 69 6e 67 2e 22 29 3b 0d 0a 09 09 09 24 74 68 69 ssage;.reconnecting.");.....$thi
8080 73 2d 3e 64 6f 52 65 63 6f 6e 6e 65 63 74 28 29 3b 0d 0a 09 09 09 23 20 54 4f 44 4f 3a 20 72 65 s->doReconnect();.....#.TODO:.re
80a0 74 72 79 20 73 65 6e 64 20 68 65 72 65 0d 0a 09 09 09 72 65 74 75 72 6e 20 66 61 6c 73 65 3b 0d try.send.here.....return.false;.
80c0 0a 09 09 7d 20 65 6c 73 65 69 66 20 28 24 73 65 6c 65 63 74 20 3e 20 30 29 20 7b 0d 0a 09 09 09 ...}.elseif.($select.>.0).{.....
80e0 24 74 68 69 73 2d 3e 6c 6f 67 2d 3e 6c 6f 67 28 22 53 6f 63 6b 65 74 20 69 73 20 72 65 61 64 79 $this->log->log("Socket.is.ready
8100 3b 20 73 65 6e 64 20 69 74 2e 22 2c 20 58 4d 50 50 4c 6f 67 3a 3a 4c 45 56 45 4c 5f 56 45 52 42 ;.send.it.",.XMPPLog::LEVEL_VERB
8120 4f 53 45 29 3b 0d 0a 09 09 7d 20 65 6c 73 65 20 7b 0d 0a 09 09 09 24 74 68 69 73 2d 3e 6c 6f 67 OSE);....}.else.{.....$this->log
8140 2d 3e 6c 6f 67 28 22 53 6f 63 6b 65 74 20 69 73 20 6e 6f 74 20 72 65 61 64 79 3b 20 62 72 65 61 ->log("Socket.is.not.ready;.brea
8160 6b 2e 22 2c 20 58 4d 50 50 4c 6f 67 3a 3a 4c 45 56 45 4c 5f 45 52 52 4f 52 29 3b 0d 0a 09 09 09 k.",.XMPPLog::LEVEL_ERROR);.....
8180 72 65 74 75 72 6e 20 66 61 6c 73 65 3b 0d 0a 09 09 7d 0d 0a 09 09 0d 0a 09 09 24 73 65 6e 74 62 return.false;....}........$sentb
81a0 79 74 65 73 20 3d 20 40 66 77 72 69 74 65 28 24 74 68 69 73 2d 3e 73 6f 63 6b 65 74 2c 20 24 6d ytes.=.@fwrite($this->socket,.$m
81c0 73 67 29 3b 0d 0a 09 09 24 74 68 69 73 2d 3e 6c 6f 67 2d 3e 6c 6f 67 28 22 53 45 4e 54 3a 20 22 sg);....$this->log->log("SENT:."
81e0 20 2e 20 6d 62 5f 73 75 62 73 74 72 28 24 6d 73 67 2c 20 30 2c 20 24 73 65 6e 74 62 79 74 65 73 ...mb_substr($msg,.0,.$sentbytes
8200 2c 20 27 38 62 69 74 27 29 2c 20 58 4d 50 50 4c 6f 67 3a 3a 4c 45 56 45 4c 5f 56 45 52 42 4f 53 ,.'8bit'),.XMPPLog::LEVEL_VERBOS
8220 45 29 3b 0d 0a 09 09 69 66 28 24 73 65 6e 74 62 79 74 65 73 20 3d 3d 3d 20 46 41 4c 53 45 29 20 E);....if($sentbytes.===.FALSE).
8240 7b 0d 0a 09 09 09 24 74 68 69 73 2d 3e 6c 6f 67 2d 3e 6c 6f 67 28 22 45 52 52 4f 52 20 73 65 6e {.....$this->log->log("ERROR.sen
8260 64 69 6e 67 20 6d 65 73 73 61 67 65 3b 20 72 65 63 6f 6e 6e 65 63 74 69 6e 67 2e 22 2c 20 58 4d ding.message;.reconnecting.",.XM
8280 50 50 4c 6f 67 3a 3a 4c 45 56 45 4c 5f 45 52 52 4f 52 29 3b 0d 0a 09 09 09 24 74 68 69 73 2d 3e PPLog::LEVEL_ERROR);.....$this->
82a0 64 6f 52 65 63 6f 6e 6e 65 63 74 28 29 3b 0d 0a 09 09 09 72 65 74 75 72 6e 20 66 61 6c 73 65 3b doReconnect();.....return.false;
82c0 0d 0a 09 09 7d 0d 0a 09 09 24 74 68 69 73 2d 3e 6c 6f 67 2d 3e 6c 6f 67 28 22 53 75 63 63 65 73 ....}....$this->log->log("Succes
82e0 73 66 75 6c 6c 79 20 73 65 6e 74 20 24 73 65 6e 74 62 79 74 65 73 20 62 79 74 65 73 2e 22 2c 20 sfully.sent.$sentbytes.bytes.",.
8300 58 4d 50 50 4c 6f 67 3a 3a 4c 45 56 45 4c 5f 56 45 52 42 4f 53 45 29 3b 0d 0a 09 09 72 65 74 75 XMPPLog::LEVEL_VERBOSE);....retu
8320 72 6e 20 24 73 65 6e 74 62 79 74 65 73 3b 0d 0a 09 7d 0d 0a 09 70 75 62 6c 69 63 20 66 75 6e 63 rn.$sentbytes;...}...public.func
8340 74 69 6f 6e 20 74 69 6d 65 28 29 20 7b 0d 0a 09 09 6c 69 73 74 28 24 75 73 65 63 2c 20 24 73 65 tion.time().{....list($usec,.$se
8360 63 29 20 3d 20 65 78 70 6c 6f 64 65 28 22 20 22 2c 20 6d 69 63 72 6f 74 69 6d 65 28 29 29 3b 0d c).=.explode(".",.microtime());.
8380 0a 09 09 72 65 74 75 72 6e 20 28 66 6c 6f 61 74 29 24 73 65 63 20 2b 20 28 66 6c 6f 61 74 29 24 ...return.(float)$sec.+.(float)$
83a0 75 73 65 63 3b 0d 0a 09 7d 0d 0a 09 2f 2a 2a 0d 0a 09 20 2a 20 52 65 73 65 74 20 63 6f 6e 6e 65 usec;...}.../**....*.Reset.conne
83c0 63 74 69 6f 6e 0d 0a 09 20 2a 2f 0d 0a 09 70 75 62 6c 69 63 20 66 75 6e 63 74 69 6f 6e 20 72 65 ction....*/...public.function.re
83e0 73 65 74 28 29 20 7b 0d 0a 09 09 24 74 68 69 73 2d 3e 78 6d 6c 5f 64 65 70 74 68 20 3d 20 30 3b set().{....$this->xml_depth.=.0;
8400 0d 0a 09 09 75 6e 73 65 74 28 24 74 68 69 73 2d 3e 78 6d 6c 6f 62 6a 29 3b 0d 0a 09 09 24 74 68 ....unset($this->xmlobj);....$th
8420 69 73 2d 3e 78 6d 6c 6f 62 6a 20 3d 20 61 72 72 61 79 28 29 3b 0d 0a 09 09 24 74 68 69 73 2d 3e is->xmlobj.=.array();....$this->
8440 73 65 74 75 70 50 61 72 73 65 72 28 29 3b 0d 0a 09 09 69 66 28 21 24 74 68 69 73 2d 3e 69 73 5f setupParser();....if(!$this->is_
8460 73 65 72 76 65 72 29 20 7b 0d 0a 09 09 09 24 74 68 69 73 2d 3e 73 65 6e 64 28 24 74 68 69 73 2d server).{.....$this->send($this-
8480 3e 73 74 72 65 61 6d 5f 73 74 61 72 74 29 3b 0d 0a 09 09 7d 0d 0a 09 09 24 74 68 69 73 2d 3e 62 >stream_start);....}....$this->b
84a0 65 65 6e 5f 72 65 73 65 74 20 3d 20 74 72 75 65 3b 0d 0a 09 7d 0d 0a 09 2f 2a 2a 0d 0a 09 20 2a een_reset.=.true;...}.../**....*
84c0 20 53 65 74 75 70 20 74 68 65 20 58 4d 4c 20 70 61 72 73 65 72 0d 0a 09 20 2a 2f 0d 0a 09 70 75 .Setup.the.XML.parser....*/...pu
84e0 62 6c 69 63 20 66 75 6e 63 74 69 6f 6e 20 73 65 74 75 70 50 61 72 73 65 72 28 29 20 7b 0d 0a 09 blic.function.setupParser().{...
8500 09 24 74 68 69 73 2d 3e 70 61 72 73 65 72 20 3d 20 78 6d 6c 5f 70 61 72 73 65 72 5f 63 72 65 61 .$this->parser.=.xml_parser_crea
8520 74 65 28 27 55 54 46 2d 38 27 29 3b 0d 0a 09 09 78 6d 6c 5f 70 61 72 73 65 72 5f 73 65 74 5f 6f te('UTF-8');....xml_parser_set_o
8540 70 74 69 6f 6e 28 24 74 68 69 73 2d 3e 70 61 72 73 65 72 2c 20 58 4d 4c 5f 4f 50 54 49 4f 4e 5f ption($this->parser,.XML_OPTION_
8560 53 4b 49 50 5f 57 48 49 54 45 2c 20 31 29 3b 0d 0a 09 09 78 6d 6c 5f 70 61 72 73 65 72 5f 73 65 SKIP_WHITE,.1);....xml_parser_se
8580 74 5f 6f 70 74 69 6f 6e 28 24 74 68 69 73 2d 3e 70 61 72 73 65 72 2c 20 58 4d 4c 5f 4f 50 54 49 t_option($this->parser,.XML_OPTI
85a0 4f 4e 5f 54 41 52 47 45 54 5f 45 4e 43 4f 44 49 4e 47 2c 20 27 55 54 46 2d 38 27 29 3b 0d 0a 09 ON_TARGET_ENCODING,.'UTF-8');...
85c0 09 78 6d 6c 5f 73 65 74 5f 6f 62 6a 65 63 74 28 24 74 68 69 73 2d 3e 70 61 72 73 65 72 2c 20 24 .xml_set_object($this->parser,.$
85e0 74 68 69 73 29 3b 0d 0a 09 09 78 6d 6c 5f 73 65 74 5f 65 6c 65 6d 65 6e 74 5f 68 61 6e 64 6c 65 this);....xml_set_element_handle
8600 72 28 24 74 68 69 73 2d 3e 70 61 72 73 65 72 2c 20 27 73 74 61 72 74 58 4d 4c 27 2c 20 27 65 6e r($this->parser,.'startXML',.'en
8620 64 58 4d 4c 27 29 3b 0d 0a 09 09 78 6d 6c 5f 73 65 74 5f 63 68 61 72 61 63 74 65 72 5f 64 61 74 dXML');....xml_set_character_dat
8640 61 5f 68 61 6e 64 6c 65 72 28 24 74 68 69 73 2d 3e 70 61 72 73 65 72 2c 20 27 63 68 61 72 58 4d a_handler($this->parser,.'charXM
8660 4c 27 29 3b 0d 0a 09 7d 0d 0a 09 70 75 62 6c 69 63 20 66 75 6e 63 74 69 6f 6e 20 72 65 61 64 79 L');...}...public.function.ready
8680 54 6f 50 72 6f 63 65 73 73 28 29 20 7b 0d 0a 09 09 24 72 65 61 64 20 3d 20 61 72 72 61 79 28 24 ToProcess().{....$read.=.array($
86a0 74 68 69 73 2d 3e 73 6f 63 6b 65 74 29 3b 0d 0a 09 09 24 77 72 69 74 65 20 3d 20 61 72 72 61 79 this->socket);....$write.=.array
86c0 28 29 3b 0d 0a 09 09 24 65 78 63 65 70 74 20 3d 20 61 72 72 61 79 28 29 3b 0d 0a 09 09 24 75 70 ();....$except.=.array();....$up
86e0 64 61 74 65 64 20 3d 20 40 73 74 72 65 61 6d 5f 73 65 6c 65 63 74 28 24 72 65 61 64 2c 20 24 77 dated.=.@stream_select($read,.$w
8700 72 69 74 65 2c 20 24 65 78 63 65 70 74 2c 20 30 29 3b 0d 0a 09 09 72 65 74 75 72 6e 20 28 28 24 rite,.$except,.0);....return.(($
8720 75 70 64 61 74 65 64 20 21 3d 3d 20 66 61 6c 73 65 29 20 26 26 20 28 24 75 70 64 61 74 65 64 20 updated.!==.false).&&.($updated.
8740 3e 20 30 29 29 3b 0d 0a 09 7d 0d 0a 7d 0d 0a 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >.0));...}..}...................
8760 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
8780 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
87a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
87c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
87e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
8800 6c 69 62 2f 58 4d 50 50 4c 6f 67 2e 70 68 70 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 lib/XMPPLog.php.................
8820 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
8840 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
8860 00 00 00 00 30 30 30 30 36 34 34 00 30 30 30 31 37 35 30 00 30 30 30 31 37 35 30 00 30 30 30 30 ....0000644.0001750.0001750.0000
8880 30 30 30 36 33 37 34 00 31 32 37 37 33 30 33 31 30 33 37 00 30 31 32 33 37 32 00 20 30 00 00 00 0006374.12773031037.012372..0...
88a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
88c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
88e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
8900 00 75 73 74 61 72 20 20 00 74 7a 75 72 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 .ustar...tzur...................
8920 00 00 00 00 00 00 00 00 00 74 7a 75 72 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 .........tzur...................
8940 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
8960 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
8980 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
89a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
89c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
89e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
8a00 3c 3f 70 68 70 0d 0a 09 2f 2a 2a 0d 0a 09 20 2a 20 58 4d 50 50 48 50 3a 20 54 68 65 20 50 48 50 <?php.../**....*.XMPPHP:.The.PHP
8a20 20 58 4d 50 50 20 4c 69 62 72 61 72 79 0d 0a 09 20 2a 20 43 6f 70 79 72 69 67 68 74 20 28 43 29 .XMPP.Library....*.Copyright.(C)
8a40 20 32 30 30 38 20 20 4e 61 74 68 61 6e 61 65 6c 20 43 2e 20 46 72 69 74 7a 0d 0a 09 20 2a 20 54 .2008..Nathanael.C..Fritz....*.T
8a60 68 69 73 20 66 69 6c 65 20 69 73 20 70 61 72 74 20 6f 66 20 53 6c 65 65 6b 58 4d 50 50 2e 0d 0a his.file.is.part.of.SleekXMPP...
8a80 09 20 2a 0d 0a 09 20 2a 20 58 4d 50 50 48 50 20 69 73 20 66 72 65 65 20 73 6f 66 74 77 61 72 65 ..*....*.XMPPHP.is.free.software
8aa0 3b 20 79 6f 75 20 63 61 6e 20 72 65 64 69 73 74 72 69 62 75 74 65 20 69 74 20 61 6e 64 2f 6f 72 ;.you.can.redistribute.it.and/or
8ac0 20 6d 6f 64 69 66 79 0d 0a 09 20 2a 20 69 74 20 75 6e 64 65 72 20 74 68 65 20 74 65 72 6d 73 20 .modify....*.it.under.the.terms.
8ae0 6f 66 20 74 68 65 20 47 4e 55 20 47 65 6e 65 72 61 6c 20 50 75 62 6c 69 63 20 4c 69 63 65 6e 73 of.the.GNU.General.Public.Licens
8b00 65 20 61 73 20 70 75 62 6c 69 73 68 65 64 20 62 79 0d 0a 09 20 2a 20 74 68 65 20 46 72 65 65 20 e.as.published.by....*.the.Free.
8b20 53 6f 66 74 77 61 72 65 20 46 6f 75 6e 64 61 74 69 6f 6e 3b 20 65 69 74 68 65 72 20 76 65 72 73 Software.Foundation;.either.vers
8b40 69 6f 6e 20 32 20 6f 66 20 74 68 65 20 4c 69 63 65 6e 73 65 2c 20 6f 72 0d 0a 09 20 2a 20 28 61 ion.2.of.the.License,.or....*.(a
8b60 74 20 79 6f 75 72 20 6f 70 74 69 6f 6e 29 20 61 6e 79 20 6c 61 74 65 72 20 76 65 72 73 69 6f 6e t.your.option).any.later.version
8b80 2e 0d 0a 09 20 2a 0d 0a 09 20 2a 20 58 4d 50 50 48 50 20 69 73 20 64 69 73 74 72 69 62 75 74 65 .....*....*.XMPPHP.is.distribute
8ba0 64 20 69 6e 20 74 68 65 20 68 6f 70 65 20 74 68 61 74 20 69 74 20 77 69 6c 6c 20 62 65 20 75 73 d.in.the.hope.that.it.will.be.us
8bc0 65 66 75 6c 2c 0d 0a 09 20 2a 20 62 75 74 20 57 49 54 48 4f 55 54 20 41 4e 59 20 57 41 52 52 41 eful,....*.but.WITHOUT.ANY.WARRA
8be0 4e 54 59 3b 20 77 69 74 68 6f 75 74 20 65 76 65 6e 20 74 68 65 20 69 6d 70 6c 69 65 64 20 77 61 NTY;.without.even.the.implied.wa
8c00 72 72 61 6e 74 79 20 6f 66 0d 0a 09 20 2a 20 4d 45 52 43 48 41 4e 54 41 42 49 4c 49 54 59 20 6f rranty.of....*.MERCHANTABILITY.o
8c20 72 20 46 49 54 4e 45 53 53 20 46 4f 52 20 41 20 50 41 52 54 49 43 55 4c 41 52 20 50 55 52 50 4f r.FITNESS.FOR.A.PARTICULAR.PURPO
8c40 53 45 2e 20 20 53 65 65 20 74 68 65 0d 0a 09 20 2a 20 47 4e 55 20 47 65 6e 65 72 61 6c 20 50 75 SE...See.the....*.GNU.General.Pu
8c60 62 6c 69 63 20 4c 69 63 65 6e 73 65 20 66 6f 72 20 6d 6f 72 65 20 64 65 74 61 69 6c 73 2e 0d 0a blic.License.for.more.details...
8c80 09 20 2a 0d 0a 09 20 2a 20 59 6f 75 20 73 68 6f 75 6c 64 20 68 61 76 65 20 72 65 63 65 69 76 65 ..*....*.You.should.have.receive
8ca0 64 20 61 20 63 6f 70 79 20 6f 66 20 74 68 65 20 47 4e 55 20 47 65 6e 65 72 61 6c 20 50 75 62 6c d.a.copy.of.the.GNU.General.Publ
8cc0 69 63 20 4c 69 63 65 6e 73 65 0d 0a 09 20 2a 20 61 6c 6f 6e 67 20 77 69 74 68 20 58 4d 50 50 48 ic.License....*.along.with.XMPPH
8ce0 50 3b 20 69 66 20 6e 6f 74 2c 20 77 72 69 74 65 20 74 6f 20 74 68 65 20 46 72 65 65 20 53 6f 66 P;.if.not,.write.to.the.Free.Sof
8d00 74 77 61 72 65 0d 0a 09 20 2a 20 46 6f 75 6e 64 61 74 69 6f 6e 2c 20 49 6e 63 2e 2c 20 35 31 20 tware....*.Foundation,.Inc.,.51.
8d20 46 72 61 6e 6b 6c 69 6e 20 53 74 2c 20 46 69 66 74 68 20 46 6c 6f 6f 72 2c 20 42 6f 73 74 6f 6e Franklin.St,.Fifth.Floor,.Boston
8d40 2c 20 4d 41 20 20 30 32 31 31 30 2d 31 33 30 31 20 20 55 53 41 0d 0a 09 20 2a 0d 0a 09 20 2a 20 ,.MA..02110-1301..USA....*....*.
8d60 40 63 61 74 65 67 6f 72 79 20 20 20 78 6d 70 70 68 70 0d 0a 09 20 2a 20 40 70 61 63 6b 61 67 65 @category...xmpphp....*.@package
8d80 20 20 20 20 58 4d 50 50 48 50 0d 0a 09 20 2a 20 40 61 75 74 68 6f 72 20 20 20 20 20 4e 61 74 68 ....XMPPHP....*.@author.....Nath
8da0 61 6e 61 65 6c 20 43 2e 20 46 72 69 74 7a 20 3c 4a 49 44 3a 20 66 72 69 74 7a 79 40 6e 65 74 66 anael.C..Fritz.<JID:.fritzy@netf
8dc0 6c 69 6e 74 2e 6e 65 74 3e 0d 0a 09 20 2a 20 40 61 75 74 68 6f 72 20 20 20 20 20 53 74 65 70 68 lint.net>....*.@author.....Steph
8de0 61 6e 20 57 65 6e 74 7a 20 3c 4a 49 44 3a 20 73 74 65 70 68 61 6e 40 6a 61 62 62 65 72 2e 77 65 an.Wentz.<JID:.stephan@jabber.we
8e00 6e 74 7a 2e 69 74 3e 0d 0a 09 20 2a 20 40 61 75 74 68 6f 72 20 20 20 20 20 4d 69 63 68 61 65 6c ntz.it>....*.@author.....Michael
8e20 20 47 61 72 76 69 6e 20 3c 4a 49 44 3a 20 67 61 72 40 6e 65 74 66 6c 69 6e 74 2e 6e 65 74 3e 0d .Garvin.<JID:.gar@netflint.net>.
8e40 0a 09 20 2a 20 40 61 75 74 68 6f 72 20 20 20 20 20 41 6c 65 78 61 6e 64 65 72 20 42 69 72 6b 6e ...*.@author.....Alexander.Birkn
8e60 65 72 20 28 68 74 74 70 73 3a 2f 2f 67 69 74 68 75 62 2e 63 6f 6d 2f 42 69 72 6b 6e 65 72 41 6c er.(https://github.com/BirknerAl
8e80 65 78 29 0d 0a 09 20 2a 20 40 63 6f 70 79 72 69 67 68 74 20 20 32 30 30 38 20 4e 61 74 68 61 6e ex)....*.@copyright..2008.Nathan
8ea0 61 65 6c 20 43 2e 20 46 72 69 74 7a 0d 0a 09 20 2a 2f 0d 0a 2f 2a 2a 0d 0a 20 2a 20 58 4d 50 50 ael.C..Fritz....*/../**...*.XMPP
8ec0 48 50 20 4d 61 69 6e 20 43 6c 61 73 73 0d 0a 20 2a 0d 0a 20 2a 20 40 63 61 74 65 67 6f 72 79 20 HP.Main.Class...*...*.@category.
8ee0 20 20 78 6d 70 70 68 70 0d 0a 20 2a 20 40 70 61 63 6b 61 67 65 20 20 20 20 58 4d 50 50 48 50 0d ..xmpphp...*.@package....XMPPHP.
8f00 0a 20 2a 20 40 61 75 74 68 6f 72 20 20 20 20 20 4e 61 74 68 61 6e 61 65 6c 20 43 2e 20 46 72 69 ..*.@author.....Nathanael.C..Fri
8f20 74 7a 20 3c 4a 49 44 3a 20 66 72 69 74 7a 79 40 6e 65 74 66 6c 69 6e 74 2e 6e 65 74 3e 0d 0a 20 tz.<JID:.fritzy@netflint.net>...
8f40 2a 20 40 61 75 74 68 6f 72 20 20 20 20 20 53 74 65 70 68 61 6e 20 57 65 6e 74 7a 20 3c 4a 49 44 *.@author.....Stephan.Wentz.<JID
8f60 3a 20 73 74 65 70 68 61 6e 40 6a 61 62 62 65 72 2e 77 65 6e 74 7a 2e 69 74 3e 0d 0a 20 2a 20 40 :.stephan@jabber.wentz.it>...*.@
8f80 61 75 74 68 6f 72 20 20 20 20 20 4d 69 63 68 61 65 6c 20 47 61 72 76 69 6e 20 3c 4a 49 44 3a 20 author.....Michael.Garvin.<JID:.
8fa0 67 61 72 40 6e 65 74 66 6c 69 6e 74 2e 6e 65 74 3e 0d 0a 20 2a 20 40 63 6f 70 79 72 69 67 68 74 gar@netflint.net>...*.@copyright
8fc0 20 20 32 30 30 38 20 4e 61 74 68 61 6e 61 65 6c 20 43 2e 20 46 72 69 74 7a 0d 0a 20 2a 20 40 76 ..2008.Nathanael.C..Fritz...*.@v
8fe0 65 72 73 69 6f 6e 20 20 20 20 24 49 64 24 0d 0a 20 2a 2f 0d 0a 63 6c 61 73 73 20 58 4d 50 50 4c ersion....$Id$...*/..class.XMPPL
9000 6f 67 20 7b 0d 0a 09 0d 0a 09 63 6f 6e 73 74 20 4c 45 56 45 4c 5f 45 52 52 4f 52 20 20 20 3d 20 og.{......const.LEVEL_ERROR...=.
9020 30 3b 0d 0a 09 63 6f 6e 73 74 20 4c 45 56 45 4c 5f 57 41 52 4e 49 4e 47 20 3d 20 31 3b 0d 0a 09 0;...const.LEVEL_WARNING.=.1;...
9040 63 6f 6e 73 74 20 4c 45 56 45 4c 5f 49 4e 46 4f 09 3d 20 32 3b 0d 0a 09 63 6f 6e 73 74 20 4c 45 const.LEVEL_INFO.=.2;...const.LE
9060 56 45 4c 5f 44 45 42 55 47 20 20 20 3d 20 33 3b 0d 0a 09 63 6f 6e 73 74 20 4c 45 56 45 4c 5f 56 VEL_DEBUG...=.3;...const.LEVEL_V
9080 45 52 42 4f 53 45 20 3d 20 34 3b 0d 0a 09 0d 0a 09 2f 2a 2a 0d 0a 09 20 2a 20 40 76 61 72 20 61 ERBOSE.=.4;....../**....*.@var.a
90a0 72 72 61 79 0d 0a 09 20 2a 2f 0d 0a 09 70 72 6f 74 65 63 74 65 64 20 24 64 61 74 61 20 3d 20 61 rray....*/...protected.$data.=.a
90c0 72 72 61 79 28 29 3b 0d 0a 09 2f 2a 2a 0d 0a 09 20 2a 20 40 76 61 72 20 61 72 72 61 79 0d 0a 09 rray();.../**....*.@var.array...
90e0 20 2a 2f 0d 0a 09 70 72 6f 74 65 63 74 65 64 20 24 6e 61 6d 65 73 20 3d 20 61 72 72 61 79 28 27 .*/...protected.$names.=.array('
9100 45 52 52 4f 52 27 2c 20 27 57 41 52 4e 49 4e 47 27 2c 20 27 49 4e 46 4f 27 2c 20 27 44 45 42 55 ERROR',.'WARNING',.'INFO',.'DEBU
9120 47 27 2c 20 27 56 45 52 42 4f 53 45 27 29 3b 0d 0a 09 2f 2a 2a 0d 0a 09 20 2a 20 40 76 61 72 20 G',.'VERBOSE');.../**....*.@var.
9140 69 6e 74 65 67 65 72 0d 0a 09 20 2a 2f 0d 0a 09 70 72 6f 74 65 63 74 65 64 20 24 72 75 6e 6c 65 integer....*/...protected.$runle
9160 76 65 6c 3b 0d 0a 09 2f 2a 2a 0d 0a 09 20 2a 20 40 76 61 72 20 62 6f 6f 6c 65 61 6e 0d 0a 09 20 vel;.../**....*.@var.boolean....
9180 2a 2f 0d 0a 09 70 72 6f 74 65 63 74 65 64 20 24 70 72 69 6e 74 6f 75 74 3b 0d 0a 09 2f 2a 2a 0d */...protected.$printout;.../**.
91a0 0a 09 20 2a 20 43 6f 6e 73 74 72 75 63 74 6f 72 0d 0a 09 20 2a 0d 0a 09 20 2a 20 40 70 61 72 61 ...*.Constructor....*....*.@para
91c0 6d 20 62 6f 6f 6c 65 61 6e 20 24 70 72 69 6e 74 6f 75 74 0d 0a 09 20 2a 20 40 70 61 72 61 6d 20 m.boolean.$printout....*.@param.
91e0 73 74 72 69 6e 67 20 20 24 72 75 6e 6c 65 76 65 6c 0d 0a 09 20 2a 2f 0d 0a 09 70 75 62 6c 69 63 string..$runlevel....*/...public
9200 20 66 75 6e 63 74 69 6f 6e 20 5f 5f 63 6f 6e 73 74 72 75 63 74 28 24 70 72 69 6e 74 6f 75 74 20 .function.__construct($printout.
9220 3d 20 66 61 6c 73 65 2c 20 24 72 75 6e 6c 65 76 65 6c 20 3d 20 73 65 6c 66 3a 3a 4c 45 56 45 4c =.false,.$runlevel.=.self::LEVEL
9240 5f 49 4e 46 4f 29 20 7b 0d 0a 09 09 24 74 68 69 73 2d 3e 70 72 69 6e 74 6f 75 74 20 3d 20 28 62 _INFO).{....$this->printout.=.(b
9260 6f 6f 6c 65 61 6e 29 24 70 72 69 6e 74 6f 75 74 3b 0d 0a 09 09 24 74 68 69 73 2d 3e 72 75 6e 6c oolean)$printout;....$this->runl
9280 65 76 65 6c 20 3d 20 28 69 6e 74 29 24 72 75 6e 6c 65 76 65 6c 3b 0d 0a 09 7d 0d 0a 09 2f 2a 2a evel.=.(int)$runlevel;...}.../**
92a0 0d 0a 09 20 2a 20 41 64 64 20 61 20 6d 65 73 73 61 67 65 20 74 6f 20 74 68 65 20 6c 6f 67 20 64 ....*.Add.a.message.to.the.log.d
92c0 61 74 61 20 61 72 72 61 79 0d 0a 09 20 2a 20 49 66 20 70 72 69 6e 74 6f 75 74 20 69 6e 20 74 68 ata.array....*.If.printout.in.th
92e0 69 73 20 69 6e 73 74 61 6e 63 65 20 69 73 20 73 65 74 20 74 6f 20 74 72 75 65 2c 20 64 69 72 65 is.instance.is.set.to.true,.dire
9300 63 74 6c 79 20 6f 75 74 70 75 74 20 74 68 65 20 6d 65 73 73 61 67 65 0d 0a 09 20 2a 0d 0a 09 20 ctly.output.the.message....*....
9320 2a 20 40 70 61 72 61 6d 20 73 74 72 69 6e 67 20 20 24 6d 73 67 0d 0a 09 20 2a 20 40 70 61 72 61 *.@param.string..$msg....*.@para
9340 6d 20 69 6e 74 65 67 65 72 20 24 72 75 6e 6c 65 76 65 6c 0d 0a 09 20 2a 2f 0d 0a 09 70 75 62 6c m.integer.$runlevel....*/...publ
9360 69 63 20 66 75 6e 63 74 69 6f 6e 20 6c 6f 67 28 24 6d 73 67 2c 20 24 72 75 6e 6c 65 76 65 6c 20 ic.function.log($msg,.$runlevel.
9380 3d 20 73 65 6c 66 3a 3a 4c 45 56 45 4c 5f 49 4e 46 4f 29 20 7b 0d 0a 09 09 24 74 69 6d 65 20 3d =.self::LEVEL_INFO).{....$time.=
93a0 20 74 69 6d 65 28 29 3b 0d 0a 09 09 23 24 74 68 69 73 2d 3e 64 61 74 61 5b 5d 20 3d 20 61 72 72 .time();....#$this->data[].=.arr
93c0 61 79 28 24 74 68 69 73 2d 3e 72 75 6e 6c 65 76 65 6c 2c 20 24 6d 73 67 2c 20 24 74 69 6d 65 29 ay($this->runlevel,.$msg,.$time)
93e0 3b 0d 0a 09 09 69 66 28 24 74 68 69 73 2d 3e 70 72 69 6e 74 6f 75 74 20 61 6e 64 20 24 72 75 6e ;....if($this->printout.and.$run
9400 6c 65 76 65 6c 20 3c 3d 20 24 74 68 69 73 2d 3e 72 75 6e 6c 65 76 65 6c 29 20 7b 0d 0a 09 09 09 level.<=.$this->runlevel).{.....
9420 24 74 68 69 73 2d 3e 77 72 69 74 65 4c 69 6e 65 28 24 6d 73 67 2c 20 24 72 75 6e 6c 65 76 65 6c $this->writeLine($msg,.$runlevel
9440 2c 20 24 74 69 6d 65 29 3b 0d 0a 09 09 7d 0d 0a 09 7d 0d 0a 09 2f 2a 2a 0d 0a 09 20 2a 20 4f 75 ,.$time);....}...}.../**....*.Ou
9460 74 70 75 74 20 74 68 65 20 63 6f 6d 70 6c 65 74 65 20 6c 6f 67 2e 0d 0a 09 20 2a 20 4c 6f 67 20 tput.the.complete.log.....*.Log.
9480 77 69 6c 6c 20 62 65 20 63 6c 65 61 72 65 64 20 69 66 20 24 63 6c 65 61 72 20 3d 20 74 72 75 65 will.be.cleared.if.$clear.=.true
94a0 0d 0a 09 20 2a 0d 0a 09 20 2a 20 40 70 61 72 61 6d 20 62 6f 6f 6c 65 61 6e 20 24 63 6c 65 61 72 ....*....*.@param.boolean.$clear
94c0 0d 0a 09 20 2a 20 40 70 61 72 61 6d 20 69 6e 74 65 67 65 72 20 24 72 75 6e 6c 65 76 65 6c 0d 0a ....*.@param.integer.$runlevel..
94e0 09 20 2a 2f 0d 0a 09 70 75 62 6c 69 63 20 66 75 6e 63 74 69 6f 6e 20 70 72 69 6e 74 6f 75 74 28 ..*/...public.function.printout(
9500 24 63 6c 65 61 72 20 3d 20 74 72 75 65 2c 20 24 72 75 6e 6c 65 76 65 6c 20 3d 20 6e 75 6c 6c 29 $clear.=.true,.$runlevel.=.null)
9520 20 7b 0d 0a 09 09 69 66 28 24 72 75 6e 6c 65 76 65 6c 20 3d 3d 3d 20 6e 75 6c 6c 29 20 7b 0d 0a .{....if($runlevel.===.null).{..
9540 09 09 09 24 72 75 6e 6c 65 76 65 6c 20 3d 20 24 74 68 69 73 2d 3e 72 75 6e 6c 65 76 65 6c 3b 0d ...$runlevel.=.$this->runlevel;.
9560 0a 09 09 7d 0d 0a 09 09 66 6f 72 65 61 63 68 28 24 74 68 69 73 2d 3e 64 61 74 61 20 61 73 20 24 ...}....foreach($this->data.as.$
9580 64 61 74 61 29 20 7b 0d 0a 09 09 09 69 66 28 24 72 75 6e 6c 65 76 65 6c 20 3c 3d 20 24 64 61 74 data).{.....if($runlevel.<=.$dat
95a0 61 5b 30 5d 29 20 7b 0d 0a 09 09 09 09 24 74 68 69 73 2d 3e 77 72 69 74 65 4c 69 6e 65 28 24 64 a[0]).{......$this->writeLine($d
95c0 61 74 61 5b 31 5d 2c 20 24 72 75 6e 6c 65 76 65 6c 2c 20 24 64 61 74 61 5b 32 5d 29 3b 0d 0a 09 ata[1],.$runlevel,.$data[2]);...
95e0 09 09 7d 0d 0a 09 09 7d 0d 0a 09 09 69 66 28 24 63 6c 65 61 72 29 20 7b 0d 0a 09 09 09 24 74 68 ..}....}....if($clear).{.....$th
9600 69 73 2d 3e 64 61 74 61 20 3d 20 61 72 72 61 79 28 29 3b 0d 0a 09 09 7d 0d 0a 09 7d 0d 0a 09 0d is->data.=.array();....}...}....
9620 0a 09 70 72 6f 74 65 63 74 65 64 20 66 75 6e 63 74 69 6f 6e 20 77 72 69 74 65 4c 69 6e 65 28 24 ..protected.function.writeLine($
9640 6d 73 67 2c 20 24 72 75 6e 6c 65 76 65 6c 2c 20 24 74 69 6d 65 29 20 7b 0d 0a 09 09 2f 2f 65 63 msg,.$runlevel,.$time).{....//ec
9660 68 6f 20 64 61 74 65 28 27 59 2d 6d 2d 64 20 48 3a 69 3a 73 27 2c 20 24 74 69 6d 65 29 2e 22 20 ho.date('Y-m-d.H:i:s',.$time).".
9680 5b 22 2e 24 74 68 69 73 2d 3e 6e 61 6d 65 73 5b 24 72 75 6e 6c 65 76 65 6c 5d 2e 22 5d 3a 20 22 [".$this->names[$runlevel]."]:."
96a0 2e 24 6d 73 67 2e 22 5c 6e 22 3b 0d 0a 09 09 65 63 68 6f 20 24 74 69 6d 65 2e 22 20 5b 22 2e 24 .$msg."\n";....echo.$time.".[".$
96c0 74 68 69 73 2d 3e 6e 61 6d 65 73 5b 24 72 75 6e 6c 65 76 65 6c 5d 2e 22 5d 3a 20 22 2e 24 6d 73 this->names[$runlevel]."]:.".$ms
96e0 67 2e 22 5c 6e 22 3b 0d 0a 09 09 66 6c 75 73 68 28 29 3b 0d 0a 09 7d 0d 0a 7d 0d 0a 00 00 00 00 g."\n";....flush();...}..}......
9700 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
9720 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
9740 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
9760 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
9780 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
97a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
97c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
97e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
9800 6c 69 62 2f 58 4d 50 50 2e 70 68 70 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 lib/XMPP.php....................
9820 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
9840 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
9860 00 00 00 00 30 30 30 30 36 34 34 00 30 30 30 31 37 35 30 00 30 30 30 31 37 35 30 00 30 30 30 30 ....0000644.0001750.0001750.0000
9880 30 30 33 31 30 35 31 00 31 32 37 37 33 30 33 31 30 33 37 00 30 31 31 37 31 36 00 20 30 00 00 00 0031051.12773031037.011716..0...
98a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
98c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
98e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
9900 00 75 73 74 61 72 20 20 00 74 7a 75 72 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 .ustar...tzur...................
9920 00 00 00 00 00 00 00 00 00 74 7a 75 72 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 .........tzur...................
9940 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
9960 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
9980 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
99a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
99c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
99e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
9a00 3c 3f 70 68 70 0d 0a 09 2f 2a 2a 0d 0a 09 20 2a 20 58 4d 50 50 48 50 3a 20 54 68 65 20 50 48 50 <?php.../**....*.XMPPHP:.The.PHP
9a20 20 58 4d 50 50 20 4c 69 62 72 61 72 79 0d 0a 09 20 2a 20 43 6f 70 79 72 69 67 68 74 20 28 43 29 .XMPP.Library....*.Copyright.(C)
9a40 20 32 30 30 38 20 20 4e 61 74 68 61 6e 61 65 6c 20 43 2e 20 46 72 69 74 7a 0d 0a 09 20 2a 20 54 .2008..Nathanael.C..Fritz....*.T
9a60 68 69 73 20 66 69 6c 65 20 69 73 20 70 61 72 74 20 6f 66 20 53 6c 65 65 6b 58 4d 50 50 2e 0d 0a his.file.is.part.of.SleekXMPP...
9a80 09 20 2a 0d 0a 09 20 2a 20 58 4d 50 50 48 50 20 69 73 20 66 72 65 65 20 73 6f 66 74 77 61 72 65 ..*....*.XMPPHP.is.free.software
9aa0 3b 20 79 6f 75 20 63 61 6e 20 72 65 64 69 73 74 72 69 62 75 74 65 20 69 74 20 61 6e 64 2f 6f 72 ;.you.can.redistribute.it.and/or
9ac0 20 6d 6f 64 69 66 79 0d 0a 09 20 2a 20 69 74 20 75 6e 64 65 72 20 74 68 65 20 74 65 72 6d 73 20 .modify....*.it.under.the.terms.
9ae0 6f 66 20 74 68 65 20 47 4e 55 20 47 65 6e 65 72 61 6c 20 50 75 62 6c 69 63 20 4c 69 63 65 6e 73 of.the.GNU.General.Public.Licens
9b00 65 20 61 73 20 70 75 62 6c 69 73 68 65 64 20 62 79 0d 0a 09 20 2a 20 74 68 65 20 46 72 65 65 20 e.as.published.by....*.the.Free.
9b20 53 6f 66 74 77 61 72 65 20 46 6f 75 6e 64 61 74 69 6f 6e 3b 20 65 69 74 68 65 72 20 76 65 72 73 Software.Foundation;.either.vers
9b40 69 6f 6e 20 32 20 6f 66 20 74 68 65 20 4c 69 63 65 6e 73 65 2c 20 6f 72 0d 0a 09 20 2a 20 28 61 ion.2.of.the.License,.or....*.(a
9b60 74 20 79 6f 75 72 20 6f 70 74 69 6f 6e 29 20 61 6e 79 20 6c 61 74 65 72 20 76 65 72 73 69 6f 6e t.your.option).any.later.version
9b80 2e 0d 0a 09 20 2a 0d 0a 09 20 2a 20 58 4d 50 50 48 50 20 69 73 20 64 69 73 74 72 69 62 75 74 65 .....*....*.XMPPHP.is.distribute
9ba0 64 20 69 6e 20 74 68 65 20 68 6f 70 65 20 74 68 61 74 20 69 74 20 77 69 6c 6c 20 62 65 20 75 73 d.in.the.hope.that.it.will.be.us
9bc0 65 66 75 6c 2c 0d 0a 09 20 2a 20 62 75 74 20 57 49 54 48 4f 55 54 20 41 4e 59 20 57 41 52 52 41 eful,....*.but.WITHOUT.ANY.WARRA
9be0 4e 54 59 3b 20 77 69 74 68 6f 75 74 20 65 76 65 6e 20 74 68 65 20 69 6d 70 6c 69 65 64 20 77 61 NTY;.without.even.the.implied.wa
9c00 72 72 61 6e 74 79 20 6f 66 0d 0a 09 20 2a 20 4d 45 52 43 48 41 4e 54 41 42 49 4c 49 54 59 20 6f rranty.of....*.MERCHANTABILITY.o
9c20 72 20 46 49 54 4e 45 53 53 20 46 4f 52 20 41 20 50 41 52 54 49 43 55 4c 41 52 20 50 55 52 50 4f r.FITNESS.FOR.A.PARTICULAR.PURPO
9c40 53 45 2e 20 20 53 65 65 20 74 68 65 0d 0a 09 20 2a 20 47 4e 55 20 47 65 6e 65 72 61 6c 20 50 75 SE...See.the....*.GNU.General.Pu
9c60 62 6c 69 63 20 4c 69 63 65 6e 73 65 20 66 6f 72 20 6d 6f 72 65 20 64 65 74 61 69 6c 73 2e 0d 0a blic.License.for.more.details...
9c80 09 20 2a 0d 0a 09 20 2a 20 59 6f 75 20 73 68 6f 75 6c 64 20 68 61 76 65 20 72 65 63 65 69 76 65 ..*....*.You.should.have.receive
9ca0 64 20 61 20 63 6f 70 79 20 6f 66 20 74 68 65 20 47 4e 55 20 47 65 6e 65 72 61 6c 20 50 75 62 6c d.a.copy.of.the.GNU.General.Publ
9cc0 69 63 20 4c 69 63 65 6e 73 65 0d 0a 09 20 2a 20 61 6c 6f 6e 67 20 77 69 74 68 20 58 4d 50 50 48 ic.License....*.along.with.XMPPH
9ce0 50 3b 20 69 66 20 6e 6f 74 2c 20 77 72 69 74 65 20 74 6f 20 74 68 65 20 46 72 65 65 20 53 6f 66 P;.if.not,.write.to.the.Free.Sof
9d00 74 77 61 72 65 0d 0a 09 20 2a 20 46 6f 75 6e 64 61 74 69 6f 6e 2c 20 49 6e 63 2e 2c 20 35 31 20 tware....*.Foundation,.Inc.,.51.
9d20 46 72 61 6e 6b 6c 69 6e 20 53 74 2c 20 46 69 66 74 68 20 46 6c 6f 6f 72 2c 20 42 6f 73 74 6f 6e Franklin.St,.Fifth.Floor,.Boston
9d40 2c 20 4d 41 20 20 30 32 31 31 30 2d 31 33 30 31 20 20 55 53 41 0d 0a 09 20 2a 0d 0a 09 20 2a 20 ,.MA..02110-1301..USA....*....*.
9d60 40 63 61 74 65 67 6f 72 79 20 20 20 78 6d 70 70 68 70 0d 0a 09 20 2a 20 40 70 61 63 6b 61 67 65 @category...xmpphp....*.@package
9d80 20 20 20 20 58 4d 50 50 48 50 0d 0a 09 20 2a 20 40 61 75 74 68 6f 72 20 20 20 20 20 4e 61 74 68 ....XMPPHP....*.@author.....Nath
9da0 61 6e 61 65 6c 20 43 2e 20 46 72 69 74 7a 20 3c 4a 49 44 3a 20 66 72 69 74 7a 79 40 6e 65 74 66 anael.C..Fritz.<JID:.fritzy@netf
9dc0 6c 69 6e 74 2e 6e 65 74 3e 0d 0a 09 20 2a 20 40 61 75 74 68 6f 72 20 20 20 20 20 53 74 65 70 68 lint.net>....*.@author.....Steph
9de0 61 6e 20 57 65 6e 74 7a 20 3c 4a 49 44 3a 20 73 74 65 70 68 61 6e 40 6a 61 62 62 65 72 2e 77 65 an.Wentz.<JID:.stephan@jabber.we
9e00 6e 74 7a 2e 69 74 3e 0d 0a 09 20 2a 20 40 61 75 74 68 6f 72 20 20 20 20 20 4d 69 63 68 61 65 6c ntz.it>....*.@author.....Michael
9e20 20 47 61 72 76 69 6e 20 3c 4a 49 44 3a 20 67 61 72 40 6e 65 74 66 6c 69 6e 74 2e 6e 65 74 3e 0d .Garvin.<JID:.gar@netflint.net>.
9e40 0a 09 20 2a 20 40 61 75 74 68 6f 72 20 20 20 20 20 41 6c 65 78 61 6e 64 65 72 20 42 69 72 6b 6e ...*.@author.....Alexander.Birkn
9e60 65 72 20 28 68 74 74 70 73 3a 2f 2f 67 69 74 68 75 62 2e 63 6f 6d 2f 42 69 72 6b 6e 65 72 41 6c er.(https://github.com/BirknerAl
9e80 65 78 29 0d 0a 09 20 2a 20 40 63 6f 70 79 72 69 67 68 74 20 20 32 30 30 38 20 4e 61 74 68 61 6e ex)....*.@copyright..2008.Nathan
9ea0 61 65 6c 20 43 2e 20 46 72 69 74 7a 0d 0a 09 20 2a 2f 0d 0a 2f 2a 2a 0d 0a 20 2a 20 58 4d 50 50 ael.C..Fritz....*/../**...*.XMPP
9ec0 48 50 20 4d 61 69 6e 20 43 6c 61 73 73 0d 0a 20 2a 0d 0a 20 2a 20 40 63 61 74 65 67 6f 72 79 20 HP.Main.Class...*...*.@category.
9ee0 20 20 78 6d 70 70 68 70 0d 0a 20 2a 20 40 70 61 63 6b 61 67 65 20 20 20 20 58 4d 50 50 48 50 0d ..xmpphp...*.@package....XMPPHP.
9f00 0a 20 2a 20 40 61 75 74 68 6f 72 20 20 20 20 20 4e 61 74 68 61 6e 61 65 6c 20 43 2e 20 46 72 69 ..*.@author.....Nathanael.C..Fri
9f20 74 7a 20 3c 4a 49 44 3a 20 66 72 69 74 7a 79 40 6e 65 74 66 6c 69 6e 74 2e 6e 65 74 3e 0d 0a 20 tz.<JID:.fritzy@netflint.net>...
9f40 2a 20 40 61 75 74 68 6f 72 20 20 20 20 20 53 74 65 70 68 61 6e 20 57 65 6e 74 7a 20 3c 4a 49 44 *.@author.....Stephan.Wentz.<JID
9f60 3a 20 73 74 65 70 68 61 6e 40 6a 61 62 62 65 72 2e 77 65 6e 74 7a 2e 69 74 3e 0d 0a 20 2a 20 40 :.stephan@jabber.wentz.it>...*.@
9f80 61 75 74 68 6f 72 20 20 20 20 20 4d 69 63 68 61 65 6c 20 47 61 72 76 69 6e 20 3c 4a 49 44 3a 20 author.....Michael.Garvin.<JID:.
9fa0 67 61 72 40 6e 65 74 66 6c 69 6e 74 2e 6e 65 74 3e 0d 0a 20 2a 20 40 63 6f 70 79 72 69 67 68 74 gar@netflint.net>...*.@copyright
9fc0 20 20 32 30 30 38 20 4e 61 74 68 61 6e 61 65 6c 20 43 2e 20 46 72 69 74 7a 0d 0a 20 2a 20 40 76 ..2008.Nathanael.C..Fritz...*.@v
9fe0 65 72 73 69 6f 6e 20 20 20 20 24 49 64 24 0d 0a 20 2a 2f 0d 0a 63 6c 61 73 73 20 58 4d 50 50 20 ersion....$Id$...*/..class.XMPP.
a000 65 78 74 65 6e 64 73 20 58 4d 4c 53 74 72 65 61 6d 20 7b 0d 0a 09 2f 2a 2a 0d 0a 09 20 2a 20 40 extends.XMLStream.{.../**....*.@
a020 76 61 72 20 73 74 72 69 6e 67 0d 0a 09 20 2a 2f 0d 0a 09 70 75 62 6c 69 63 20 24 73 65 72 76 65 var.string....*/...public.$serve
a040 72 3b 0d 0a 09 2f 2a 2a 0d 0a 09 20 2a 20 40 76 61 72 20 73 74 72 69 6e 67 0d 0a 09 20 2a 2f 0d r;.../**....*.@var.string....*/.
a060 0a 09 70 75 62 6c 69 63 20 24 75 73 65 72 3b 0d 0a 09 0d 0a 09 2f 2a 2a 0d 0a 09 20 2a 20 40 76 ..public.$user;....../**....*.@v
a080 61 72 20 73 74 72 69 6e 67 0d 0a 09 20 2a 2f 0d 0a 09 70 72 6f 74 65 63 74 65 64 20 24 70 61 73 ar.string....*/...protected.$pas
a0a0 73 77 6f 72 64 3b 0d 0a 09 0d 0a 09 2f 2a 2a 0d 0a 09 20 2a 20 40 76 61 72 20 73 74 72 69 6e 67 sword;....../**....*.@var.string
a0c0 0d 0a 09 20 2a 2f 0d 0a 09 70 72 6f 74 65 63 74 65 64 20 24 72 65 73 6f 75 72 63 65 3b 0d 0a 09 ....*/...protected.$resource;...
a0e0 0d 0a 09 2f 2a 2a 0d 0a 09 20 2a 20 40 76 61 72 20 73 74 72 69 6e 67 0d 0a 09 20 2a 2f 0d 0a 09 .../**....*.@var.string....*/...
a100 70 72 6f 74 65 63 74 65 64 20 24 66 75 6c 6c 6a 69 64 3b 0d 0a 09 0d 0a 09 2f 2a 2a 0d 0a 09 20 protected.$fulljid;....../**....
a120 2a 20 40 76 61 72 20 73 74 72 69 6e 67 0d 0a 09 20 2a 2f 0d 0a 09 70 72 6f 74 65 63 74 65 64 20 *.@var.string....*/...protected.
a140 24 62 61 73 65 6a 69 64 3b 0d 0a 09 0d 0a 09 2f 2a 2a 0d 0a 09 20 2a 20 40 76 61 72 20 62 6f 6f $basejid;....../**....*.@var.boo
a160 6c 65 61 6e 0d 0a 09 20 2a 2f 0d 0a 09 70 72 6f 74 65 63 74 65 64 20 24 61 75 74 68 65 64 20 3d lean....*/...protected.$authed.=
a180 20 66 61 6c 73 65 3b 0d 0a 09 70 72 6f 74 65 63 74 65 64 20 24 73 65 73 73 69 6f 6e 5f 73 74 61 .false;...protected.$session_sta
a1a0 72 74 65 64 20 3d 20 66 61 6c 73 65 3b 0d 0a 09 0d 0a 09 2f 2a 2a 0d 0a 09 20 2a 20 40 76 61 72 rted.=.false;....../**....*.@var
a1c0 20 62 6f 6f 6c 65 61 6e 0d 0a 09 20 2a 2f 0d 0a 09 70 72 6f 74 65 63 74 65 64 20 24 61 75 74 6f .boolean....*/...protected.$auto
a1e0 5f 73 75 62 73 63 72 69 62 65 20 3d 20 66 61 6c 73 65 3b 0d 0a 09 0d 0a 09 2f 2a 2a 0d 0a 09 20 _subscribe.=.false;....../**....
a200 2a 20 40 76 61 72 20 62 6f 6f 6c 65 61 6e 0d 0a 09 20 2a 2f 0d 0a 09 70 72 6f 74 65 63 74 65 64 *.@var.boolean....*/...protected
a220 20 24 75 73 65 5f 65 6e 63 72 79 70 74 69 6f 6e 20 3d 20 74 72 75 65 3b 0d 0a 09 0d 0a 09 2f 2a .$use_encryption.=.true;....../*
a240 2a 0d 0a 09 20 2a 20 40 76 61 72 20 62 6f 6f 6c 65 61 6e 0d 0a 09 20 2a 2f 0d 0a 09 70 75 62 6c *....*.@var.boolean....*/...publ
a260 69 63 20 24 74 72 61 63 6b 5f 70 72 65 73 65 6e 63 65 20 3d 20 74 72 75 65 3b 0d 0a 09 0d 0a 09 ic.$track_presence.=.true;......
a280 2f 2a 2a 0d 0a 09 20 2a 20 40 76 61 72 20 6f 62 6a 65 63 74 0d 0a 09 20 2a 2f 0d 0a 09 70 75 62 /**....*.@var.object....*/...pub
a2a0 6c 69 63 20 24 72 6f 73 74 65 72 3b 0d 0a 09 2f 2a 2a 0d 0a 09 20 2a 20 43 6f 6e 73 74 72 75 63 lic.$roster;.../**....*.Construc
a2c0 74 6f 72 0d 0a 09 20 2a 0d 0a 09 20 2a 20 40 70 61 72 61 6d 20 73 74 72 69 6e 67 20 20 24 68 6f tor....*....*.@param.string..$ho
a2e0 73 74 0d 0a 09 20 2a 20 40 70 61 72 61 6d 20 69 6e 74 65 67 65 72 20 24 70 6f 72 74 0d 0a 09 20 st....*.@param.integer.$port....
a300 2a 20 40 70 61 72 61 6d 20 73 74 72 69 6e 67 20 20 24 75 73 65 72 0d 0a 09 20 2a 20 40 70 61 72 *.@param.string..$user....*.@par
a320 61 6d 20 73 74 72 69 6e 67 20 20 24 70 61 73 73 77 6f 72 64 0d 0a 09 20 2a 20 40 70 61 72 61 6d am.string..$password....*.@param
a340 20 73 74 72 69 6e 67 20 20 24 72 65 73 6f 75 72 63 65 0d 0a 09 20 2a 20 40 70 61 72 61 6d 20 73 .string..$resource....*.@param.s
a360 74 72 69 6e 67 20 20 24 73 65 72 76 65 72 0d 0a 09 20 2a 20 40 70 61 72 61 6d 20 62 6f 6f 6c 65 tring..$server....*.@param.boole
a380 61 6e 20 24 70 72 69 6e 74 6c 6f 67 0d 0a 09 20 2a 20 40 70 61 72 61 6d 20 73 74 72 69 6e 67 20 an.$printlog....*.@param.string.
a3a0 20 24 6c 6f 67 6c 65 76 65 6c 0d 0a 09 20 2a 2f 0d 0a 09 70 75 62 6c 69 63 20 66 75 6e 63 74 69 .$loglevel....*/...public.functi
a3c0 6f 6e 20 5f 5f 63 6f 6e 73 74 72 75 63 74 28 24 68 6f 73 74 2c 20 24 70 6f 72 74 2c 20 24 75 73 on.__construct($host,.$port,.$us
a3e0 65 72 2c 20 24 70 61 73 73 77 6f 72 64 2c 20 24 72 65 73 6f 75 72 63 65 2c 20 24 73 65 72 76 65 er,.$password,.$resource,.$serve
a400 72 20 3d 20 6e 75 6c 6c 2c 20 24 70 72 69 6e 74 6c 6f 67 20 3d 20 66 61 6c 73 65 2c 20 24 6c 6f r.=.null,.$printlog.=.false,.$lo
a420 67 6c 65 76 65 6c 20 3d 20 6e 75 6c 6c 29 20 7b 0d 0a 09 09 70 61 72 65 6e 74 3a 3a 5f 5f 63 6f glevel.=.null).{....parent::__co
a440 6e 73 74 72 75 63 74 28 24 68 6f 73 74 2c 20 24 70 6f 72 74 2c 20 24 70 72 69 6e 74 6c 6f 67 2c nstruct($host,.$port,.$printlog,
a460 20 24 6c 6f 67 6c 65 76 65 6c 29 3b 0d 0a 09 09 0d 0a 09 09 24 74 68 69 73 2d 3e 75 73 65 72 09 .$loglevel);........$this->user.
a480 20 3d 20 24 75 73 65 72 3b 0d 0a 09 09 24 74 68 69 73 2d 3e 70 61 73 73 77 6f 72 64 20 3d 20 24 .=.$user;....$this->password.=.$
a4a0 70 61 73 73 77 6f 72 64 3b 0d 0a 09 09 24 74 68 69 73 2d 3e 72 65 73 6f 75 72 63 65 20 3d 20 24 password;....$this->resource.=.$
a4c0 72 65 73 6f 75 72 63 65 3b 0d 0a 09 09 69 66 28 21 24 73 65 72 76 65 72 29 20 24 73 65 72 76 65 resource;....if(!$server).$serve
a4e0 72 20 3d 20 24 68 6f 73 74 3b 0d 0a 09 09 24 74 68 69 73 2d 3e 62 61 73 65 6a 69 64 20 3d 20 24 r.=.$host;....$this->basejid.=.$
a500 74 68 69 73 2d 3e 75 73 65 72 20 2e 20 27 40 27 20 2e 20 24 74 68 69 73 2d 3e 68 6f 73 74 3b 0d this->user...'@'...$this->host;.
a520 0a 09 09 24 74 68 69 73 2d 3e 72 6f 73 74 65 72 20 3d 20 6e 65 77 20 52 6f 73 74 65 72 28 29 3b ...$this->roster.=.new.Roster();
a540 0d 0a 09 09 24 74 68 69 73 2d 3e 74 72 61 63 6b 5f 70 72 65 73 65 6e 63 65 20 3d 20 74 72 75 65 ....$this->track_presence.=.true
a560 3b 0d 0a 09 09 24 74 68 69 73 2d 3e 73 74 72 65 61 6d 5f 73 74 61 72 74 20 3d 20 27 3c 73 74 72 ;....$this->stream_start.=.'<str
a580 65 61 6d 3a 73 74 72 65 61 6d 20 74 6f 3d 22 27 20 2e 20 24 73 65 72 76 65 72 20 2e 20 27 22 20 eam:stream.to="'...$server...'".
a5a0 78 6d 6c 6e 73 3a 73 74 72 65 61 6d 3d 22 68 74 74 70 3a 2f 2f 65 74 68 65 72 78 2e 6a 61 62 62 xmlns:stream="http://etherx.jabb
a5c0 65 72 2e 6f 72 67 2f 73 74 72 65 61 6d 73 22 20 78 6d 6c 6e 73 3d 22 6a 61 62 62 65 72 3a 63 6c er.org/streams".xmlns="jabber:cl
a5e0 69 65 6e 74 22 20 76 65 72 73 69 6f 6e 3d 22 31 2e 30 22 3e 27 3b 0d 0a 09 09 24 74 68 69 73 2d ient".version="1.0">';....$this-
a600 3e 73 74 72 65 61 6d 5f 65 6e 64 20 20 20 3d 20 27 3c 2f 73 74 72 65 61 6d 3a 73 74 72 65 61 6d >stream_end...=.'</stream:stream
a620 3e 27 3b 0d 0a 09 09 24 74 68 69 73 2d 3e 64 65 66 61 75 6c 74 5f 6e 73 20 20 20 3d 20 27 6a 61 >';....$this->default_ns...=.'ja
a640 62 62 65 72 3a 63 6c 69 65 6e 74 27 3b 0d 0a 09 09 0d 0a 09 09 24 74 68 69 73 2d 3e 61 64 64 58 bber:client';........$this->addX
a660 50 61 74 68 48 61 6e 64 6c 65 72 28 27 7b 68 74 74 70 3a 2f 2f 65 74 68 65 72 78 2e 6a 61 62 62 PathHandler('{http://etherx.jabb
a680 65 72 2e 6f 72 67 2f 73 74 72 65 61 6d 73 7d 66 65 61 74 75 72 65 73 27 2c 20 27 66 65 61 74 75 er.org/streams}features',.'featu
a6a0 72 65 73 5f 68 61 6e 64 6c 65 72 27 29 3b 0d 0a 09 09 24 74 68 69 73 2d 3e 61 64 64 58 50 61 74 res_handler');....$this->addXPat
a6c0 68 48 61 6e 64 6c 65 72 28 27 7b 75 72 6e 3a 69 65 74 66 3a 70 61 72 61 6d 73 3a 78 6d 6c 3a 6e hHandler('{urn:ietf:params:xml:n
a6e0 73 3a 78 6d 70 70 2d 73 61 73 6c 7d 73 75 63 63 65 73 73 27 2c 20 27 73 61 73 6c 5f 73 75 63 63 s:xmpp-sasl}success',.'sasl_succ
a700 65 73 73 5f 68 61 6e 64 6c 65 72 27 29 3b 0d 0a 09 09 24 74 68 69 73 2d 3e 61 64 64 58 50 61 74 ess_handler');....$this->addXPat
a720 68 48 61 6e 64 6c 65 72 28 27 7b 75 72 6e 3a 69 65 74 66 3a 70 61 72 61 6d 73 3a 78 6d 6c 3a 6e hHandler('{urn:ietf:params:xml:n
a740 73 3a 78 6d 70 70 2d 73 61 73 6c 7d 66 61 69 6c 75 72 65 27 2c 20 27 73 61 73 6c 5f 66 61 69 6c s:xmpp-sasl}failure',.'sasl_fail
a760 75 72 65 5f 68 61 6e 64 6c 65 72 27 29 3b 0d 0a 09 09 24 74 68 69 73 2d 3e 61 64 64 58 50 61 74 ure_handler');....$this->addXPat
a780 68 48 61 6e 64 6c 65 72 28 27 7b 75 72 6e 3a 69 65 74 66 3a 70 61 72 61 6d 73 3a 78 6d 6c 3a 6e hHandler('{urn:ietf:params:xml:n
a7a0 73 3a 78 6d 70 70 2d 74 6c 73 7d 70 72 6f 63 65 65 64 27 2c 20 27 74 6c 73 5f 70 72 6f 63 65 65 s:xmpp-tls}proceed',.'tls_procee
a7c0 64 5f 68 61 6e 64 6c 65 72 27 29 3b 0d 0a 09 09 24 74 68 69 73 2d 3e 61 64 64 58 50 61 74 68 48 d_handler');....$this->addXPathH
a7e0 61 6e 64 6c 65 72 28 27 7b 6a 61 62 62 65 72 3a 63 6c 69 65 6e 74 7d 6d 65 73 73 61 67 65 27 2c andler('{jabber:client}message',
a800 20 27 6d 65 73 73 61 67 65 5f 68 61 6e 64 6c 65 72 27 29 3b 0d 0a 09 09 24 74 68 69 73 2d 3e 61 .'message_handler');....$this->a
a820 64 64 58 50 61 74 68 48 61 6e 64 6c 65 72 28 27 7b 6a 61 62 62 65 72 3a 63 6c 69 65 6e 74 7d 70 ddXPathHandler('{jabber:client}p
a840 72 65 73 65 6e 63 65 27 2c 20 27 70 72 65 73 65 6e 63 65 5f 68 61 6e 64 6c 65 72 27 29 3b 0d 0a resence',.'presence_handler');..
a860 09 09 24 74 68 69 73 2d 3e 61 64 64 58 50 61 74 68 48 61 6e 64 6c 65 72 28 27 69 71 2f 7b 6a 61 ..$this->addXPathHandler('iq/{ja
a880 62 62 65 72 3a 69 71 3a 72 6f 73 74 65 72 7d 71 75 65 72 79 27 2c 20 27 72 6f 73 74 65 72 5f 69 bber:iq:roster}query',.'roster_i
a8a0 71 5f 68 61 6e 64 6c 65 72 27 29 3b 0d 0a 09 7d 0d 0a 09 2f 2a 2a 0d 0a 09 20 2a 20 54 75 72 6e q_handler');...}.../**....*.Turn
a8c0 20 65 6e 63 72 79 70 74 69 6f 6e 20 6f 6e 2f 66 66 0d 0a 09 20 2a 0d 0a 09 20 2a 20 40 70 61 72 .encryption.on/ff....*....*.@par
a8e0 61 6d 20 62 6f 6f 6c 65 61 6e 20 24 75 73 65 45 6e 63 72 79 70 74 69 6f 6e 0d 0a 09 20 2a 2f 0d am.boolean.$useEncryption....*/.
a900 0a 09 70 75 62 6c 69 63 20 66 75 6e 63 74 69 6f 6e 20 75 73 65 45 6e 63 72 79 70 74 69 6f 6e 28 ..public.function.useEncryption(
a920 24 75 73 65 45 6e 63 72 79 70 74 69 6f 6e 20 3d 20 74 72 75 65 29 20 7b 0d 0a 09 09 24 74 68 69 $useEncryption.=.true).{....$thi
a940 73 2d 3e 75 73 65 5f 65 6e 63 72 79 70 74 69 6f 6e 20 3d 20 24 75 73 65 45 6e 63 72 79 70 74 69 s->use_encryption.=.$useEncrypti
a960 6f 6e 3b 0d 0a 09 7d 0d 0a 09 0d 0a 09 2f 2a 2a 0d 0a 09 20 2a 20 54 75 72 6e 20 6f 6e 20 61 75 on;...}....../**....*.Turn.on.au
a980 74 6f 2d 61 75 74 68 6f 72 69 7a 61 74 69 6f 6e 20 6f 66 20 73 75 62 73 63 72 69 70 74 69 6f 6e to-authorization.of.subscription
a9a0 20 72 65 71 75 65 73 74 73 2e 0d 0a 09 20 2a 0d 0a 09 20 2a 20 40 70 61 72 61 6d 20 62 6f 6f 6c .requests.....*....*.@param.bool
a9c0 65 61 6e 20 24 61 75 74 6f 53 75 62 73 63 72 69 62 65 0d 0a 09 20 2a 2f 0d 0a 09 70 75 62 6c 69 ean.$autoSubscribe....*/...publi
a9e0 63 20 66 75 6e 63 74 69 6f 6e 20 61 75 74 6f 53 75 62 73 63 72 69 62 65 28 24 61 75 74 6f 53 75 c.function.autoSubscribe($autoSu
aa00 62 73 63 72 69 62 65 20 3d 20 74 72 75 65 29 20 7b 0d 0a 09 09 24 74 68 69 73 2d 3e 61 75 74 6f bscribe.=.true).{....$this->auto
aa20 5f 73 75 62 73 63 72 69 62 65 20 3d 20 24 61 75 74 6f 53 75 62 73 63 72 69 62 65 3b 0d 0a 09 7d _subscribe.=.$autoSubscribe;...}
aa40 0d 0a 09 2f 2a 2a 0d 0a 09 20 2a 20 53 65 6e 64 20 58 4d 50 50 20 4d 65 73 73 61 67 65 0d 0a 09 .../**....*.Send.XMPP.Message...
aa60 20 2a 0d 0a 09 20 2a 20 40 70 61 72 61 6d 20 73 74 72 69 6e 67 20 24 74 6f 0d 0a 09 20 2a 20 40 .*....*.@param.string.$to....*.@
aa80 70 61 72 61 6d 20 73 74 72 69 6e 67 20 24 62 6f 64 79 0d 0a 09 20 2a 20 40 70 61 72 61 6d 20 73 param.string.$body....*.@param.s
aaa0 74 72 69 6e 67 20 24 74 79 70 65 0d 0a 09 20 2a 20 40 70 61 72 61 6d 20 73 74 72 69 6e 67 20 24 tring.$type....*.@param.string.$
aac0 73 75 62 6a 65 63 74 0d 0a 09 20 2a 2f 0d 0a 09 70 75 62 6c 69 63 20 66 75 6e 63 74 69 6f 6e 20 subject....*/...public.function.
aae0 6d 65 73 73 61 67 65 28 24 74 6f 2c 20 24 62 6f 64 79 2c 20 24 74 79 70 65 20 3d 20 27 63 68 61 message($to,.$body,.$type.=.'cha
ab00 74 27 2c 20 24 73 75 62 6a 65 63 74 20 3d 20 6e 75 6c 6c 2c 20 24 70 61 79 6c 6f 61 64 20 3d 20 t',.$subject.=.null,.$payload.=.
ab20 6e 75 6c 6c 29 20 7b 0d 0a 09 09 69 66 20 28 24 74 68 69 73 2d 3e 64 69 73 63 6f 6e 6e 65 63 74 null).{....if.($this->disconnect
ab40 65 64 29 20 7b 0d 0a 09 09 09 74 68 72 6f 77 20 6e 65 77 20 58 4d 50 50 45 78 63 65 70 74 69 6f ed).{.....throw.new.XMPPExceptio
ab60 6e 28 27 59 6f 75 20 6e 65 65 64 20 74 6f 20 63 6f 6e 6e 65 63 74 20 66 69 72 73 74 27 29 3b 0d n('You.need.to.connect.first');.
ab80 0a 09 09 7d 0d 0a 09 20 20 20 20 69 66 28 65 6d 70 74 79 28 24 74 79 70 65 29 29 20 7b 0d 0a 09 ...}.......if(empty($type)).{...
aba0 20 20 20 20 20 20 20 20 24 74 79 70 65 20 3d 20 27 63 68 61 74 27 3b 0d 0a 09 20 20 20 20 7d 0d ........$type.=.'chat';.......}.
abc0 0a 09 09 24 74 6f 09 20 20 3d 20 68 74 6d 6c 73 70 65 63 69 61 6c 63 68 61 72 73 28 24 74 6f 29 ...$to...=.htmlspecialchars($to)
abe0 3b 0d 0a 09 09 24 62 6f 64 79 09 3d 20 68 74 6d 6c 73 70 65 63 69 61 6c 63 68 61 72 73 28 24 62 ;....$body.=.htmlspecialchars($b
ac00 6f 64 79 29 3b 0d 0a 09 09 24 73 75 62 6a 65 63 74 20 3d 20 68 74 6d 6c 73 70 65 63 69 61 6c 63 ody);....$subject.=.htmlspecialc
ac20 68 61 72 73 28 24 73 75 62 6a 65 63 74 29 3b 0d 0a 09 09 0d 0a 09 09 24 6f 75 74 20 3d 20 22 3c hars($subject);........$out.=."<
ac40 6d 65 73 73 61 67 65 20 66 72 6f 6d 3d 5c 22 7b 24 74 68 69 73 2d 3e 66 75 6c 6c 6a 69 64 7d 5c message.from=\"{$this->fulljid}\
ac60 22 20 74 6f 3d 5c 22 24 74 6f 5c 22 20 74 79 70 65 3d 27 24 74 79 70 65 27 3e 22 3b 0d 0a 09 09 ".to=\"$to\".type='$type'>";....
ac80 69 66 28 24 73 75 62 6a 65 63 74 29 20 24 6f 75 74 20 2e 3d 20 22 3c 73 75 62 6a 65 63 74 3e 24 if($subject).$out..=."<subject>$
aca0 73 75 62 6a 65 63 74 3c 2f 73 75 62 6a 65 63 74 3e 22 3b 0d 0a 09 09 24 6f 75 74 20 2e 3d 20 22 subject</subject>";....$out..=."
acc0 3c 62 6f 64 79 3e 24 62 6f 64 79 3c 2f 62 6f 64 79 3e 22 3b 0d 0a 09 09 69 66 28 24 70 61 79 6c <body>$body</body>";....if($payl
ace0 6f 61 64 29 20 24 6f 75 74 20 2e 3d 20 24 70 61 79 6c 6f 61 64 3b 0d 0a 09 09 24 6f 75 74 20 2e oad).$out..=.$payload;....$out..
ad00 3d 20 22 3c 2f 6d 65 73 73 61 67 65 3e 22 3b 0d 0a 09 09 0d 0a 09 09 24 74 68 69 73 2d 3e 73 65 =."</message>";........$this->se
ad20 6e 64 28 24 6f 75 74 29 3b 0d 0a 09 7d 0d 0a 09 2f 2a 2a 0d 0a 09 20 2a 20 53 65 74 20 50 72 65 nd($out);...}.../**....*.Set.Pre
ad40 73 65 6e 63 65 0d 0a 09 20 2a 0d 0a 09 20 2a 20 40 70 61 72 61 6d 20 73 74 72 69 6e 67 20 24 73 sence....*....*.@param.string.$s
ad60 74 61 74 75 73 0d 0a 09 20 2a 20 40 70 61 72 61 6d 20 73 74 72 69 6e 67 20 24 73 68 6f 77 0d 0a tatus....*.@param.string.$show..
ad80 09 20 2a 20 40 70 61 72 61 6d 20 73 74 72 69 6e 67 20 24 74 6f 0d 0a 09 20 2a 2f 0d 0a 09 70 75 ..*.@param.string.$to....*/...pu
ada0 62 6c 69 63 20 66 75 6e 63 74 69 6f 6e 20 70 72 65 73 65 6e 63 65 28 24 73 74 61 74 75 73 20 3d blic.function.presence($status.=
adc0 20 6e 75 6c 6c 2c 20 24 73 68 6f 77 20 3d 20 27 61 76 61 69 6c 61 62 6c 65 27 2c 20 24 74 6f 20 .null,.$show.=.'available',.$to.
ade0 3d 20 6e 75 6c 6c 2c 20 24 74 79 70 65 3d 27 61 76 61 69 6c 61 62 6c 65 27 2c 20 24 70 72 69 6f =.null,.$type='available',.$prio
ae00 72 69 74 79 3d 6e 75 6c 6c 29 20 7b 0d 0a 09 09 69 66 20 28 24 74 68 69 73 2d 3e 64 69 73 63 6f rity=null).{....if.($this->disco
ae20 6e 6e 65 63 74 65 64 29 20 7b 0d 0a 09 09 09 74 68 72 6f 77 20 6e 65 77 20 58 4d 50 50 45 78 63 nnected).{.....throw.new.XMPPExc
ae40 65 70 74 69 6f 6e 28 27 59 6f 75 20 6e 65 65 64 20 74 6f 20 63 6f 6e 6e 65 63 74 20 66 69 72 73 eption('You.need.to.connect.firs
ae60 74 27 29 3b 0d 0a 09 09 7d 0d 0a 09 09 69 66 28 24 74 79 70 65 20 3d 3d 20 27 61 76 61 69 6c 61 t');....}....if($type.==.'availa
ae80 62 6c 65 27 29 20 24 74 79 70 65 20 3d 20 27 27 3b 0d 0a 09 09 24 74 6f 09 20 3d 20 68 74 6d 6c ble').$type.=.'';....$to..=.html
aea0 73 70 65 63 69 61 6c 63 68 61 72 73 28 24 74 6f 29 3b 0d 0a 09 09 24 73 74 61 74 75 73 20 3d 20 specialchars($to);....$status.=.
aec0 68 74 6d 6c 73 70 65 63 69 61 6c 63 68 61 72 73 28 24 73 74 61 74 75 73 29 3b 0d 0a 09 09 69 66 htmlspecialchars($status);....if
aee0 28 24 73 68 6f 77 20 3d 3d 20 27 75 6e 61 76 61 69 6c 61 62 6c 65 27 29 20 24 74 79 70 65 20 3d ($show.==.'unavailable').$type.=
af00 20 27 75 6e 61 76 61 69 6c 61 62 6c 65 27 3b 0d 0a 09 09 0d 0a 09 09 24 6f 75 74 20 3d 20 22 3c .'unavailable';........$out.=."<
af20 70 72 65 73 65 6e 63 65 22 3b 0d 0a 09 09 69 66 28 24 74 6f 29 20 24 6f 75 74 20 2e 3d 20 22 20 presence";....if($to).$out..=.".
af40 74 6f 3d 5c 22 24 74 6f 5c 22 22 3b 0d 0a 09 09 69 66 28 24 74 79 70 65 29 20 24 6f 75 74 20 2e to=\"$to\"";....if($type).$out..
af60 3d 20 22 20 74 79 70 65 3d 27 24 74 79 70 65 27 22 3b 0d 0a 09 09 69 66 28 24 73 68 6f 77 20 3d =.".type='$type'";....if($show.=
af80 3d 20 27 61 76 61 69 6c 61 62 6c 65 27 20 61 6e 64 20 21 24 73 74 61 74 75 73 20 61 6e 64 20 24 =.'available'.and.!$status.and.$
afa0 70 72 69 6f 72 69 74 79 20 21 3d 3d 20 6e 75 6c 6c 29 20 7b 0d 0a 09 09 09 24 6f 75 74 20 2e 3d priority.!==.null).{.....$out..=
afc0 20 22 2f 3e 22 3b 0d 0a 09 09 7d 20 65 6c 73 65 20 7b 0d 0a 09 09 09 24 6f 75 74 20 2e 3d 20 22 ."/>";....}.else.{.....$out..=."
afe0 3e 22 3b 0d 0a 09 09 09 69 66 28 24 73 68 6f 77 20 21 3d 20 27 61 76 61 69 6c 61 62 6c 65 27 29 >";.....if($show.!=.'available')
b000 20 24 6f 75 74 20 2e 3d 20 22 3c 73 68 6f 77 3e 24 73 68 6f 77 3c 2f 73 68 6f 77 3e 22 3b 0d 0a .$out..=."<show>$show</show>";..
b020 09 09 09 69 66 28 24 73 74 61 74 75 73 29 20 24 6f 75 74 20 2e 3d 20 22 3c 73 74 61 74 75 73 3e ...if($status).$out..=."<status>
b040 24 73 74 61 74 75 73 3c 2f 73 74 61 74 75 73 3e 22 3b 0d 0a 09 09 09 69 66 28 24 70 72 69 6f 72 $status</status>";.....if($prior
b060 69 74 79 20 21 3d 3d 20 6e 75 6c 6c 29 20 24 6f 75 74 20 2e 3d 20 22 3c 70 72 69 6f 72 69 74 79 ity.!==.null).$out..=."<priority
b080 3e 24 70 72 69 6f 72 69 74 79 3c 2f 70 72 69 6f 72 69 74 79 3e 22 3b 0d 0a 09 09 09 24 6f 75 74 >$priority</priority>";.....$out
b0a0 20 2e 3d 20 22 3c 2f 70 72 65 73 65 6e 63 65 3e 22 3b 0d 0a 09 09 7d 0d 0a 09 09 0d 0a 09 09 24 ..=."</presence>";....}........$
b0c0 74 68 69 73 2d 3e 73 65 6e 64 28 24 6f 75 74 29 3b 0d 0a 09 7d 0d 0a 09 2f 2a 2a 0d 0a 09 20 2a this->send($out);...}.../**....*
b0e0 20 53 65 6e 64 20 41 75 74 68 20 72 65 71 75 65 73 74 0d 0a 09 20 2a 0d 0a 09 20 2a 20 40 70 61 .Send.Auth.request....*....*.@pa
b100 72 61 6d 20 73 74 72 69 6e 67 20 24 6a 69 64 0d 0a 09 20 2a 2f 0d 0a 09 70 75 62 6c 69 63 20 66 ram.string.$jid....*/...public.f
b120 75 6e 63 74 69 6f 6e 20 73 75 62 73 63 72 69 62 65 28 24 6a 69 64 29 20 7b 0d 0a 09 09 24 74 68 unction.subscribe($jid).{....$th
b140 69 73 2d 3e 73 65 6e 64 28 22 3c 70 72 65 73 65 6e 63 65 20 74 79 70 65 3d 27 73 75 62 73 63 72 is->send("<presence.type='subscr
b160 69 62 65 27 20 74 6f 3d 27 7b 24 6a 69 64 7d 27 20 66 72 6f 6d 3d 27 7b 24 74 68 69 73 2d 3e 66 ibe'.to='{$jid}'.from='{$this->f
b180 75 6c 6c 6a 69 64 7d 27 20 2f 3e 22 29 3b 0d 0a 09 09 23 24 74 68 69 73 2d 3e 73 65 6e 64 28 22 ulljid}'./>");....#$this->send("
b1a0 3c 70 72 65 73 65 6e 63 65 20 74 79 70 65 3d 27 73 75 62 73 63 72 69 62 65 64 27 20 74 6f 3d 27 <presence.type='subscribed'.to='
b1c0 7b 24 6a 69 64 7d 27 20 66 72 6f 6d 3d 27 7b 24 74 68 69 73 2d 3e 66 75 6c 6c 6a 69 64 7d 27 20 {$jid}'.from='{$this->fulljid}'.
b1e0 2f 3e 22 29 3b 0d 0a 09 7d 0d 0a 09 2f 2a 2a 0d 0a 09 20 2a 20 4d 65 73 73 61 67 65 20 68 61 6e />");...}.../**....*.Message.han
b200 64 6c 65 72 0d 0a 09 20 2a 0d 0a 09 20 2a 20 40 70 61 72 61 6d 20 73 74 72 69 6e 67 20 24 78 6d dler....*....*.@param.string.$xm
b220 6c 0d 0a 09 20 2a 2f 0d 0a 09 70 75 62 6c 69 63 20 66 75 6e 63 74 69 6f 6e 20 6d 65 73 73 61 67 l....*/...public.function.messag
b240 65 5f 68 61 6e 64 6c 65 72 28 24 78 6d 6c 29 20 7b 0d 0a 09 09 69 66 28 69 73 73 65 74 28 24 78 e_handler($xml).{....if(isset($x
b260 6d 6c 2d 3e 61 74 74 72 73 5b 27 74 79 70 65 27 5d 29 29 20 7b 0d 0a 09 09 09 24 70 61 79 6c 6f ml->attrs['type'])).{.....$paylo
b280 61 64 5b 27 74 79 70 65 27 5d 20 3d 20 24 78 6d 6c 2d 3e 61 74 74 72 73 5b 27 74 79 70 65 27 5d ad['type'].=.$xml->attrs['type']
b2a0 3b 0d 0a 09 09 7d 20 65 6c 73 65 20 7b 0d 0a 09 09 09 24 70 61 79 6c 6f 61 64 5b 27 74 79 70 65 ;....}.else.{.....$payload['type
b2c0 27 5d 20 3d 20 27 63 68 61 74 27 3b 0d 0a 09 09 7d 0d 0a 09 09 24 62 6f 64 79 20 3d 20 24 78 6d '].=.'chat';....}....$body.=.$xm
b2e0 6c 2d 3e 73 75 62 28 27 62 6f 64 79 27 29 3b 0d 0a 09 09 24 70 61 79 6c 6f 61 64 5b 27 66 72 6f l->sub('body');....$payload['fro
b300 6d 27 5d 20 3d 20 24 78 6d 6c 2d 3e 61 74 74 72 73 5b 27 66 72 6f 6d 27 5d 3b 0d 0a 09 09 24 70 m'].=.$xml->attrs['from'];....$p
b320 61 79 6c 6f 61 64 5b 27 62 6f 64 79 27 5d 20 3d 20 69 73 5f 6f 62 6a 65 63 74 28 24 62 6f 64 79 ayload['body'].=.is_object($body
b340 29 20 3f 20 24 62 6f 64 79 2d 3e 64 61 74 61 20 3a 20 46 41 4c 53 45 3b 20 2f 2f 20 24 78 6d 6c ).?.$body->data.:.FALSE;.//.$xml
b360 2d 3e 73 75 62 28 27 62 6f 64 79 27 29 2d 3e 64 61 74 61 3b 0d 0a 09 09 24 70 61 79 6c 6f 61 64 ->sub('body')->data;....$payload
b380 5b 27 78 6d 6c 27 5d 20 3d 20 24 78 6d 6c 3b 0d 0a 09 09 24 74 68 69 73 2d 3e 6c 6f 67 2d 3e 6c ['xml'].=.$xml;....$this->log->l
b3a0 6f 67 28 22 4d 65 73 73 61 67 65 3a 20 7b 24 70 61 79 6c 6f 61 64 5b 27 62 6f 64 79 27 5d 7d 22 og("Message:.{$payload['body']}"
b3c0 2c 20 58 4d 50 50 4c 6f 67 3a 3a 4c 45 56 45 4c 5f 44 45 42 55 47 29 3b 0d 0a 09 09 24 74 68 69 ,.XMPPLog::LEVEL_DEBUG);....$thi
b3e0 73 2d 3e 65 76 65 6e 74 28 27 6d 65 73 73 61 67 65 27 2c 20 24 70 61 79 6c 6f 61 64 29 3b 0d 0a s->event('message',.$payload);..
b400 09 7d 0d 0a 09 2f 2a 2a 0d 0a 09 20 2a 20 50 72 65 73 65 6e 63 65 20 68 61 6e 64 6c 65 72 0d 0a .}.../**....*.Presence.handler..
b420 09 20 2a 0d 0a 09 20 2a 20 40 70 61 72 61 6d 20 73 74 72 69 6e 67 20 24 78 6d 6c 0d 0a 09 20 2a ..*....*.@param.string.$xml....*
b440 2f 0d 0a 09 70 75 62 6c 69 63 20 66 75 6e 63 74 69 6f 6e 20 70 72 65 73 65 6e 63 65 5f 68 61 6e /...public.function.presence_han
b460 64 6c 65 72 28 24 78 6d 6c 29 20 7b 0d 0a 09 09 24 70 61 79 6c 6f 61 64 5b 27 74 79 70 65 27 5d dler($xml).{....$payload['type']
b480 20 3d 20 28 69 73 73 65 74 28 24 78 6d 6c 2d 3e 61 74 74 72 73 5b 27 74 79 70 65 27 5d 29 29 20 .=.(isset($xml->attrs['type'])).
b4a0 3f 20 24 78 6d 6c 2d 3e 61 74 74 72 73 5b 27 74 79 70 65 27 5d 20 3a 20 27 61 76 61 69 6c 61 62 ?.$xml->attrs['type'].:.'availab
b4c0 6c 65 27 3b 0d 0a 09 09 24 70 61 79 6c 6f 61 64 5b 27 73 68 6f 77 27 5d 20 3d 20 28 69 73 73 65 le';....$payload['show'].=.(isse
b4e0 74 28 24 78 6d 6c 2d 3e 73 75 62 28 27 73 68 6f 77 27 29 2d 3e 64 61 74 61 29 29 20 3f 20 24 78 t($xml->sub('show')->data)).?.$x
b500 6d 6c 2d 3e 73 75 62 28 27 73 68 6f 77 27 29 2d 3e 64 61 74 61 20 3a 20 24 70 61 79 6c 6f 61 64 ml->sub('show')->data.:.$payload
b520 5b 27 74 79 70 65 27 5d 3b 0d 0a 09 09 24 70 61 79 6c 6f 61 64 5b 27 66 72 6f 6d 27 5d 20 3d 20 ['type'];....$payload['from'].=.
b540 24 78 6d 6c 2d 3e 61 74 74 72 73 5b 27 66 72 6f 6d 27 5d 3b 0d 0a 09 09 24 70 61 79 6c 6f 61 64 $xml->attrs['from'];....$payload
b560 5b 27 73 74 61 74 75 73 27 5d 20 3d 20 28 69 73 73 65 74 28 24 78 6d 6c 2d 3e 73 75 62 28 27 73 ['status'].=.(isset($xml->sub('s
b580 74 61 74 75 73 27 29 2d 3e 64 61 74 61 29 29 20 3f 20 24 78 6d 6c 2d 3e 73 75 62 28 27 73 74 61 tatus')->data)).?.$xml->sub('sta
b5a0 74 75 73 27 29 2d 3e 64 61 74 61 20 3a 20 27 27 3b 0d 0a 09 09 24 70 61 79 6c 6f 61 64 5b 27 70 tus')->data.:.'';....$payload['p
b5c0 72 69 6f 72 69 74 79 27 5d 20 3d 20 28 69 73 73 65 74 28 24 78 6d 6c 2d 3e 73 75 62 28 27 70 72 riority'].=.(isset($xml->sub('pr
b5e0 69 6f 72 69 74 79 27 29 2d 3e 64 61 74 61 29 29 20 3f 20 69 6e 74 76 61 6c 28 24 78 6d 6c 2d 3e iority')->data)).?.intval($xml->
b600 73 75 62 28 27 70 72 69 6f 72 69 74 79 27 29 2d 3e 64 61 74 61 29 20 3a 20 30 3b 0d 0a 09 09 24 sub('priority')->data).:.0;....$
b620 70 61 79 6c 6f 61 64 5b 27 78 6d 6c 27 5d 20 3d 20 24 78 6d 6c 3b 0d 0a 09 09 69 66 28 24 74 68 payload['xml'].=.$xml;....if($th
b640 69 73 2d 3e 74 72 61 63 6b 5f 70 72 65 73 65 6e 63 65 29 20 7b 0d 0a 09 09 09 24 74 68 69 73 2d is->track_presence).{.....$this-
b660 3e 72 6f 73 74 65 72 2d 3e 73 65 74 50 72 65 73 65 6e 63 65 28 24 70 61 79 6c 6f 61 64 5b 27 66 >roster->setPresence($payload['f
b680 72 6f 6d 27 5d 2c 20 24 70 61 79 6c 6f 61 64 5b 27 70 72 69 6f 72 69 74 79 27 5d 2c 20 24 70 61 rom'],.$payload['priority'],.$pa
b6a0 79 6c 6f 61 64 5b 27 73 68 6f 77 27 5d 2c 20 24 70 61 79 6c 6f 61 64 5b 27 73 74 61 74 75 73 27 yload['show'],.$payload['status'
b6c0 5d 29 3b 0d 0a 09 09 7d 0d 0a 09 09 24 74 68 69 73 2d 3e 6c 6f 67 2d 3e 6c 6f 67 28 22 50 72 65 ]);....}....$this->log->log("Pre
b6e0 73 65 6e 63 65 3a 20 7b 24 70 61 79 6c 6f 61 64 5b 27 66 72 6f 6d 27 5d 7d 20 5b 7b 24 70 61 79 sence:.{$payload['from']}.[{$pay
b700 6c 6f 61 64 5b 27 73 68 6f 77 27 5d 7d 5d 20 7b 24 70 61 79 6c 6f 61 64 5b 27 73 74 61 74 75 73 load['show']}].{$payload['status
b720 27 5d 7d 22 2c 20 20 58 4d 50 50 4c 6f 67 3a 3a 4c 45 56 45 4c 5f 44 45 42 55 47 29 3b 0d 0a 09 ']}",..XMPPLog::LEVEL_DEBUG);...
b740 09 69 66 28 61 72 72 61 79 5f 6b 65 79 5f 65 78 69 73 74 73 28 27 74 79 70 65 27 2c 20 24 78 6d .if(array_key_exists('type',.$xm
b760 6c 2d 3e 61 74 74 72 73 29 20 61 6e 64 20 24 78 6d 6c 2d 3e 61 74 74 72 73 5b 27 74 79 70 65 27 l->attrs).and.$xml->attrs['type'
b780 5d 20 3d 3d 20 27 73 75 62 73 63 72 69 62 65 27 29 20 7b 0d 0a 09 09 09 69 66 28 24 74 68 69 73 ].==.'subscribe').{.....if($this
b7a0 2d 3e 61 75 74 6f 5f 73 75 62 73 63 72 69 62 65 29 20 7b 0d 0a 09 09 09 09 24 74 68 69 73 2d 3e ->auto_subscribe).{......$this->
b7c0 73 65 6e 64 28 22 3c 70 72 65 73 65 6e 63 65 20 74 79 70 65 3d 27 73 75 62 73 63 72 69 62 65 64 send("<presence.type='subscribed
b7e0 27 20 74 6f 3d 27 7b 24 78 6d 6c 2d 3e 61 74 74 72 73 5b 27 66 72 6f 6d 27 5d 7d 27 20 66 72 6f '.to='{$xml->attrs['from']}'.fro
b800 6d 3d 27 7b 24 74 68 69 73 2d 3e 66 75 6c 6c 6a 69 64 7d 27 20 2f 3e 22 29 3b 0d 0a 09 09 09 09 m='{$this->fulljid}'./>");......
b820 24 74 68 69 73 2d 3e 73 65 6e 64 28 22 3c 70 72 65 73 65 6e 63 65 20 74 79 70 65 3d 27 73 75 62 $this->send("<presence.type='sub
b840 73 63 72 69 62 65 27 20 74 6f 3d 27 7b 24 78 6d 6c 2d 3e 61 74 74 72 73 5b 27 66 72 6f 6d 27 5d scribe'.to='{$xml->attrs['from']
b860 7d 27 20 66 72 6f 6d 3d 27 7b 24 74 68 69 73 2d 3e 66 75 6c 6c 6a 69 64 7d 27 20 2f 3e 22 29 3b }'.from='{$this->fulljid}'./>");
b880 0d 0a 09 09 09 7d 0d 0a 09 09 09 24 74 68 69 73 2d 3e 65 76 65 6e 74 28 27 73 75 62 73 63 72 69 .....}.....$this->event('subscri
b8a0 70 74 69 6f 6e 5f 72 65 71 75 65 73 74 65 64 27 2c 20 24 70 61 79 6c 6f 61 64 29 3b 0d 0a 09 09 ption_requested',.$payload);....
b8c0 7d 20 65 6c 73 65 69 66 28 61 72 72 61 79 5f 6b 65 79 5f 65 78 69 73 74 73 28 27 74 79 70 65 27 }.elseif(array_key_exists('type'
b8e0 2c 20 24 78 6d 6c 2d 3e 61 74 74 72 73 29 20 61 6e 64 20 24 78 6d 6c 2d 3e 61 74 74 72 73 5b 27 ,.$xml->attrs).and.$xml->attrs['
b900 74 79 70 65 27 5d 20 3d 3d 20 27 73 75 62 73 63 72 69 62 65 64 27 29 20 7b 0d 0a 09 09 09 24 74 type'].==.'subscribed').{.....$t
b920 68 69 73 2d 3e 65 76 65 6e 74 28 27 73 75 62 73 63 72 69 70 74 69 6f 6e 5f 61 63 63 65 70 74 65 his->event('subscription_accepte
b940 64 27 2c 20 24 70 61 79 6c 6f 61 64 29 3b 0d 0a 09 09 7d 20 65 6c 73 65 20 7b 0d 0a 09 09 09 24 d',.$payload);....}.else.{.....$
b960 74 68 69 73 2d 3e 65 76 65 6e 74 28 27 70 72 65 73 65 6e 63 65 27 2c 20 24 70 61 79 6c 6f 61 64 this->event('presence',.$payload
b980 29 3b 0d 0a 09 09 7d 0d 0a 09 7d 0d 0a 09 2f 2a 2a 0d 0a 09 20 2a 20 46 65 61 74 75 72 65 73 20 );....}...}.../**....*.Features.
b9a0 68 61 6e 64 6c 65 72 0d 0a 09 20 2a 0d 0a 09 20 2a 20 40 70 61 72 61 6d 20 73 74 72 69 6e 67 20 handler....*....*.@param.string.
b9c0 24 78 6d 6c 0d 0a 09 20 2a 2f 0d 0a 09 70 72 6f 74 65 63 74 65 64 20 66 75 6e 63 74 69 6f 6e 20 $xml....*/...protected.function.
b9e0 66 65 61 74 75 72 65 73 5f 68 61 6e 64 6c 65 72 28 24 78 6d 6c 29 20 7b 0d 0a 09 09 69 66 28 24 features_handler($xml).{....if($
ba00 78 6d 6c 2d 3e 68 61 73 53 75 62 28 27 73 74 61 72 74 74 6c 73 27 29 20 61 6e 64 20 24 74 68 69 xml->hasSub('starttls').and.$thi
ba20 73 2d 3e 75 73 65 5f 65 6e 63 72 79 70 74 69 6f 6e 29 20 7b 0d 0a 09 09 09 24 74 68 69 73 2d 3e s->use_encryption).{.....$this->
ba40 73 65 6e 64 28 22 3c 73 74 61 72 74 74 6c 73 20 78 6d 6c 6e 73 3d 27 75 72 6e 3a 69 65 74 66 3a send("<starttls.xmlns='urn:ietf:
ba60 70 61 72 61 6d 73 3a 78 6d 6c 3a 6e 73 3a 78 6d 70 70 2d 74 6c 73 27 3e 3c 72 65 71 75 69 72 65 params:xml:ns:xmpp-tls'><require
ba80 64 20 2f 3e 3c 2f 73 74 61 72 74 74 6c 73 3e 22 29 3b 0d 0a 09 09 7d 20 65 6c 73 65 69 66 28 24 d./></starttls>");....}.elseif($
baa0 78 6d 6c 2d 3e 68 61 73 53 75 62 28 27 62 69 6e 64 27 29 20 61 6e 64 20 24 74 68 69 73 2d 3e 61 xml->hasSub('bind').and.$this->a
bac0 75 74 68 65 64 29 20 7b 0d 0a 09 09 09 24 69 64 20 3d 20 24 74 68 69 73 2d 3e 67 65 74 49 64 28 uthed).{.....$id.=.$this->getId(
bae0 29 3b 0d 0a 09 09 09 24 74 68 69 73 2d 3e 61 64 64 49 64 48 61 6e 64 6c 65 72 28 24 69 64 2c 20 );.....$this->addIdHandler($id,.
bb00 27 72 65 73 6f 75 72 63 65 5f 62 69 6e 64 5f 68 61 6e 64 6c 65 72 27 29 3b 0d 0a 09 09 09 24 74 'resource_bind_handler');.....$t
bb20 68 69 73 2d 3e 73 65 6e 64 28 22 3c 69 71 20 78 6d 6c 6e 73 3d 5c 22 6a 61 62 62 65 72 3a 63 6c his->send("<iq.xmlns=\"jabber:cl
bb40 69 65 6e 74 5c 22 20 74 79 70 65 3d 5c 22 73 65 74 5c 22 20 69 64 3d 5c 22 24 69 64 5c 22 3e 3c ient\".type=\"set\".id=\"$id\"><
bb60 62 69 6e 64 20 78 6d 6c 6e 73 3d 5c 22 75 72 6e 3a 69 65 74 66 3a 70 61 72 61 6d 73 3a 78 6d 6c bind.xmlns=\"urn:ietf:params:xml
bb80 3a 6e 73 3a 78 6d 70 70 2d 62 69 6e 64 5c 22 3e 3c 72 65 73 6f 75 72 63 65 3e 7b 24 74 68 69 73 :ns:xmpp-bind\"><resource>{$this
bba0 2d 3e 72 65 73 6f 75 72 63 65 7d 3c 2f 72 65 73 6f 75 72 63 65 3e 3c 2f 62 69 6e 64 3e 3c 2f 69 ->resource}</resource></bind></i
bbc0 71 3e 22 29 3b 0d 0a 09 09 7d 20 65 6c 73 65 20 7b 0d 0a 09 09 09 24 74 68 69 73 2d 3e 6c 6f 67 q>");....}.else.{.....$this->log
bbe0 2d 3e 6c 6f 67 28 22 41 74 74 65 6d 70 74 69 6e 67 20 41 75 74 68 2e 2e 2e 22 29 3b 0d 0a 09 09 ->log("Attempting.Auth...");....
bc00 09 69 66 20 28 24 74 68 69 73 2d 3e 70 61 73 73 77 6f 72 64 29 20 7b 0d 0a 09 09 09 24 74 68 69 .if.($this->password).{.....$thi
bc20 73 2d 3e 73 65 6e 64 28 22 3c 61 75 74 68 20 78 6d 6c 6e 73 3d 27 75 72 6e 3a 69 65 74 66 3a 70 s->send("<auth.xmlns='urn:ietf:p
bc40 61 72 61 6d 73 3a 78 6d 6c 3a 6e 73 3a 78 6d 70 70 2d 73 61 73 6c 27 20 6d 65 63 68 61 6e 69 73 arams:xml:ns:xmpp-sasl'.mechanis
bc60 6d 3d 27 50 4c 41 49 4e 27 3e 22 20 2e 20 62 61 73 65 36 34 5f 65 6e 63 6f 64 65 28 22 5c 78 30 m='PLAIN'>"...base64_encode("\x0
bc80 30 22 20 2e 20 24 74 68 69 73 2d 3e 75 73 65 72 20 2e 20 22 5c 78 30 30 22 20 2e 20 24 74 68 69 0"...$this->user..."\x00"...$thi
bca0 73 2d 3e 70 61 73 73 77 6f 72 64 29 20 2e 20 22 3c 2f 61 75 74 68 3e 22 29 3b 0d 0a 09 09 09 7d s->password)..."</auth>");.....}
bcc0 20 65 6c 73 65 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 .else.{.........................
bce0 20 24 74 68 69 73 2d 3e 73 65 6e 64 28 22 3c 61 75 74 68 20 78 6d 6c 6e 73 3d 27 75 72 6e 3a 69 .$this->send("<auth.xmlns='urn:i
bd00 65 74 66 3a 70 61 72 61 6d 73 3a 78 6d 6c 3a 6e 73 3a 78 6d 70 70 2d 73 61 73 6c 27 20 6d 65 63 etf:params:xml:ns:xmpp-sasl'.mec
bd20 68 61 6e 69 73 6d 3d 27 41 4e 4f 4e 59 4d 4f 55 53 27 2f 3e 22 29 3b 0d 0a 09 09 09 7d 09 0d 0a hanism='ANONYMOUS'/>");.....}...
bd40 09 09 7d 0d 0a 09 7d 0d 0a 09 2f 2a 2a 0d 0a 09 20 2a 20 53 41 53 4c 20 73 75 63 63 65 73 73 20 ..}...}.../**....*.SASL.success.
bd60 68 61 6e 64 6c 65 72 0d 0a 09 20 2a 0d 0a 09 20 2a 20 40 70 61 72 61 6d 20 73 74 72 69 6e 67 20 handler....*....*.@param.string.
bd80 24 78 6d 6c 0d 0a 09 20 2a 2f 0d 0a 09 70 72 6f 74 65 63 74 65 64 20 66 75 6e 63 74 69 6f 6e 20 $xml....*/...protected.function.
bda0 73 61 73 6c 5f 73 75 63 63 65 73 73 5f 68 61 6e 64 6c 65 72 28 24 78 6d 6c 29 20 7b 0d 0a 09 09 sasl_success_handler($xml).{....
bdc0 24 74 68 69 73 2d 3e 6c 6f 67 2d 3e 6c 6f 67 28 22 41 75 74 68 20 73 75 63 63 65 73 73 21 22 29 $this->log->log("Auth.success!")
bde0 3b 0d 0a 09 09 24 74 68 69 73 2d 3e 61 75 74 68 65 64 20 3d 20 74 72 75 65 3b 0d 0a 09 09 24 74 ;....$this->authed.=.true;....$t
be00 68 69 73 2d 3e 72 65 73 65 74 28 29 3b 0d 0a 09 7d 0d 0a 09 0d 0a 09 2f 2a 2a 0d 0a 09 20 2a 20 his->reset();...}....../**....*.
be20 53 41 53 4c 20 66 65 61 74 75 72 65 20 68 61 6e 64 6c 65 72 0d 0a 09 20 2a 0d 0a 09 20 2a 20 40 SASL.feature.handler....*....*.@
be40 70 61 72 61 6d 20 73 74 72 69 6e 67 20 24 78 6d 6c 0d 0a 09 20 2a 2f 0d 0a 09 70 72 6f 74 65 63 param.string.$xml....*/...protec
be60 74 65 64 20 66 75 6e 63 74 69 6f 6e 20 73 61 73 6c 5f 66 61 69 6c 75 72 65 5f 68 61 6e 64 6c 65 ted.function.sasl_failure_handle
be80 72 28 24 78 6d 6c 29 20 7b 0d 0a 09 09 24 74 68 69 73 2d 3e 6c 6f 67 2d 3e 6c 6f 67 28 22 41 75 r($xml).{....$this->log->log("Au
bea0 74 68 20 66 61 69 6c 65 64 21 22 2c 20 20 58 4d 50 50 4c 6f 67 3a 3a 4c 45 56 45 4c 5f 45 52 52 th.failed!",..XMPPLog::LEVEL_ERR
bec0 4f 52 29 3b 0d 0a 09 09 24 74 68 69 73 2d 3e 64 69 73 63 6f 6e 6e 65 63 74 28 29 3b 0d 0a 09 09 OR);....$this->disconnect();....
bee0 0d 0a 09 09 74 68 72 6f 77 20 6e 65 77 20 58 4d 50 50 45 78 63 65 70 74 69 6f 6e 28 27 41 75 74 ....throw.new.XMPPException('Aut
bf00 68 20 66 61 69 6c 65 64 21 27 29 3b 0d 0a 09 7d 0d 0a 09 2f 2a 2a 0d 0a 09 20 2a 20 52 65 73 6f h.failed!');...}.../**....*.Reso
bf20 75 72 63 65 20 62 69 6e 64 20 68 61 6e 64 6c 65 72 0d 0a 09 20 2a 0d 0a 09 20 2a 20 40 70 61 72 urce.bind.handler....*....*.@par
bf40 61 6d 20 73 74 72 69 6e 67 20 24 78 6d 6c 0d 0a 09 20 2a 2f 0d 0a 09 70 72 6f 74 65 63 74 65 64 am.string.$xml....*/...protected
bf60 20 66 75 6e 63 74 69 6f 6e 20 72 65 73 6f 75 72 63 65 5f 62 69 6e 64 5f 68 61 6e 64 6c 65 72 28 .function.resource_bind_handler(
bf80 24 78 6d 6c 29 20 7b 0d 0a 09 09 69 66 28 24 78 6d 6c 2d 3e 61 74 74 72 73 5b 27 74 79 70 65 27 $xml).{....if($xml->attrs['type'
bfa0 5d 20 3d 3d 20 27 72 65 73 75 6c 74 27 29 20 7b 0d 0a 09 09 09 24 74 68 69 73 2d 3e 6c 6f 67 2d ].==.'result').{.....$this->log-
bfc0 3e 6c 6f 67 28 22 42 6f 75 6e 64 20 74 6f 20 22 20 2e 20 24 78 6d 6c 2d 3e 73 75 62 28 27 62 69 >log("Bound.to."...$xml->sub('bi
bfe0 6e 64 27 29 2d 3e 73 75 62 28 27 6a 69 64 27 29 2d 3e 64 61 74 61 29 3b 0d 0a 09 09 09 24 74 68 nd')->sub('jid')->data);.....$th
c000 69 73 2d 3e 66 75 6c 6c 6a 69 64 20 3d 20 24 78 6d 6c 2d 3e 73 75 62 28 27 62 69 6e 64 27 29 2d is->fulljid.=.$xml->sub('bind')-
c020 3e 73 75 62 28 27 6a 69 64 27 29 2d 3e 64 61 74 61 3b 0d 0a 09 09 09 24 6a 69 64 61 72 72 61 79 >sub('jid')->data;.....$jidarray
c040 20 3d 20 65 78 70 6c 6f 64 65 28 27 2f 27 2c 24 74 68 69 73 2d 3e 66 75 6c 6c 6a 69 64 29 3b 0d .=.explode('/',$this->fulljid);.
c060 0a 09 09 09 24 74 68 69 73 2d 3e 6a 69 64 20 3d 20 24 6a 69 64 61 72 72 61 79 5b 30 5d 3b 0d 0a ....$this->jid.=.$jidarray[0];..
c080 09 09 7d 0d 0a 09 09 24 69 64 20 3d 20 24 74 68 69 73 2d 3e 67 65 74 49 64 28 29 3b 0d 0a 09 09 ..}....$id.=.$this->getId();....
c0a0 24 74 68 69 73 2d 3e 61 64 64 49 64 48 61 6e 64 6c 65 72 28 24 69 64 2c 20 27 73 65 73 73 69 6f $this->addIdHandler($id,.'sessio
c0c0 6e 5f 73 74 61 72 74 5f 68 61 6e 64 6c 65 72 27 29 3b 0d 0a 09 09 24 74 68 69 73 2d 3e 73 65 6e n_start_handler');....$this->sen
c0e0 64 28 22 3c 69 71 20 78 6d 6c 6e 73 3d 27 6a 61 62 62 65 72 3a 63 6c 69 65 6e 74 27 20 74 79 70 d("<iq.xmlns='jabber:client'.typ
c100 65 3d 27 73 65 74 27 20 69 64 3d 27 24 69 64 27 3e 3c 73 65 73 73 69 6f 6e 20 78 6d 6c 6e 73 3d e='set'.id='$id'><session.xmlns=
c120 27 75 72 6e 3a 69 65 74 66 3a 70 61 72 61 6d 73 3a 78 6d 6c 3a 6e 73 3a 78 6d 70 70 2d 73 65 73 'urn:ietf:params:xml:ns:xmpp-ses
c140 73 69 6f 6e 27 20 2f 3e 3c 2f 69 71 3e 22 29 3b 0d 0a 09 7d 0d 0a 09 2f 2a 2a 0d 0a 09 2a 20 52 sion'./></iq>");...}.../**...*.R
c160 65 74 72 69 65 76 65 73 20 74 68 65 20 72 6f 73 74 65 72 0d 0a 09 2a 0d 0a 09 2a 2f 0d 0a 09 70 etrieves.the.roster...*...*/...p
c180 75 62 6c 69 63 20 66 75 6e 63 74 69 6f 6e 20 67 65 74 52 6f 73 74 65 72 28 29 20 7b 0d 0a 09 09 ublic.function.getRoster().{....
c1a0 24 69 64 20 3d 20 24 74 68 69 73 2d 3e 67 65 74 49 44 28 29 3b 0d 0a 09 09 24 74 68 69 73 2d 3e $id.=.$this->getID();....$this->
c1c0 73 65 6e 64 28 22 3c 69 71 20 78 6d 6c 6e 73 3d 27 6a 61 62 62 65 72 3a 63 6c 69 65 6e 74 27 20 send("<iq.xmlns='jabber:client'.
c1e0 74 79 70 65 3d 27 67 65 74 27 20 69 64 3d 27 24 69 64 27 3e 3c 71 75 65 72 79 20 78 6d 6c 6e 73 type='get'.id='$id'><query.xmlns
c200 3d 27 6a 61 62 62 65 72 3a 69 71 3a 72 6f 73 74 65 72 27 20 2f 3e 3c 2f 69 71 3e 22 29 3b 0d 0a ='jabber:iq:roster'./></iq>");..
c220 09 7d 0d 0a 09 2f 2a 2a 0d 0a 09 2a 20 52 6f 73 74 65 72 20 69 71 20 68 61 6e 64 6c 65 72 0d 0a .}.../**...*.Roster.iq.handler..
c240 09 2a 20 47 65 74 73 20 61 6c 6c 20 70 61 63 6b 65 74 73 20 6d 61 74 63 68 69 6e 67 20 58 50 61 .*.Gets.all.packets.matching.XPa
c260 74 68 20 22 69 71 2f 7b 6a 61 62 62 65 72 3a 69 71 3a 72 6f 73 74 65 72 7d 71 75 65 72 79 27 0d th."iq/{jabber:iq:roster}query'.
c280 0a 09 2a 0d 0a 09 2a 20 40 70 61 72 61 6d 20 73 74 72 69 6e 67 20 24 78 6d 6c 0d 0a 09 2a 2f 0d ..*...*.@param.string.$xml...*/.
c2a0 0a 09 70 72 6f 74 65 63 74 65 64 20 66 75 6e 63 74 69 6f 6e 20 72 6f 73 74 65 72 5f 69 71 5f 68 ..protected.function.roster_iq_h
c2c0 61 6e 64 6c 65 72 28 24 78 6d 6c 29 20 7b 0d 0a 09 09 24 73 74 61 74 75 73 20 3d 20 22 72 65 73 andler($xml).{....$status.=."res
c2e0 75 6c 74 22 3b 0d 0a 09 09 24 78 6d 6c 72 6f 73 74 65 72 20 3d 20 24 78 6d 6c 2d 3e 73 75 62 28 ult";....$xmlroster.=.$xml->sub(
c300 27 71 75 65 72 79 27 29 3b 0d 0a 09 09 66 6f 72 65 61 63 68 28 24 78 6d 6c 72 6f 73 74 65 72 2d 'query');....foreach($xmlroster-
c320 3e 73 75 62 73 20 61 73 20 24 69 74 65 6d 29 20 7b 0d 0a 09 09 09 24 67 72 6f 75 70 73 20 3d 20 >subs.as.$item).{.....$groups.=.
c340 61 72 72 61 79 28 29 3b 0d 0a 09 09 09 69 66 20 28 24 69 74 65 6d 2d 3e 6e 61 6d 65 20 3d 3d 20 array();.....if.($item->name.==.
c360 27 69 74 65 6d 27 29 20 7b 0d 0a 09 09 09 09 24 6a 69 64 20 3d 20 24 69 74 65 6d 2d 3e 61 74 74 'item').{......$jid.=.$item->att
c380 72 73 5b 27 6a 69 64 27 5d 3b 20 2f 2f 52 45 51 55 49 52 45 44 0d 0a 09 09 09 09 24 6e 61 6d 65 rs['jid'];.//REQUIRED......$name
c3a0 20 3d 20 24 69 74 65 6d 2d 3e 61 74 74 72 73 5b 27 6e 61 6d 65 27 5d 3b 20 2f 2f 4d 41 59 0d 0a .=.$item->attrs['name'];.//MAY..
c3c0 09 09 09 09 24 73 75 62 73 63 72 69 70 74 69 6f 6e 20 3d 20 24 69 74 65 6d 2d 3e 61 74 74 72 73 ....$subscription.=.$item->attrs
c3e0 5b 27 73 75 62 73 63 72 69 70 74 69 6f 6e 27 5d 3b 0d 0a 09 09 09 09 66 6f 72 65 61 63 68 28 24 ['subscription'];......foreach($
c400 69 74 65 6d 2d 3e 73 75 62 73 20 61 73 20 24 73 75 62 69 74 65 6d 29 20 7b 0d 0a 09 09 09 09 09 item->subs.as.$subitem).{.......
c420 69 66 20 28 24 73 75 62 69 74 65 6d 2d 3e 6e 61 6d 65 20 3d 3d 20 27 67 72 6f 75 70 27 29 20 7b if.($subitem->name.==.'group').{
c440 0d 0a 09 09 09 09 09 09 24 67 72 6f 75 70 73 5b 5d 20 3d 20 24 73 75 62 69 74 65 6d 2d 3e 64 61 ........$groups[].=.$subitem->da
c460 74 61 3b 0d 0a 09 09 09 09 09 7d 0d 0a 09 09 09 09 7d 0d 0a 09 09 09 09 24 63 6f 6e 74 61 63 74 ta;.......}......}......$contact
c480 73 5b 5d 20 3d 20 61 72 72 61 79 28 24 6a 69 64 2c 20 24 73 75 62 73 63 72 69 70 74 69 6f 6e 2c s[].=.array($jid,.$subscription,
c4a0 20 24 6e 61 6d 65 2c 20 24 67 72 6f 75 70 73 29 3b 20 2f 2f 53 74 6f 72 65 20 66 6f 72 20 61 63 .$name,.$groups);.//Store.for.ac
c4c0 74 69 6f 6e 20 69 66 20 6e 6f 20 65 72 72 6f 72 73 20 68 61 70 70 65 6e 0d 0a 09 09 09 7d 20 65 tion.if.no.errors.happen.....}.e
c4e0 6c 73 65 20 7b 0d 0a 09 09 09 09 24 73 74 61 74 75 73 20 3d 20 22 65 72 72 6f 72 22 3b 0d 0a 09 lse.{......$status.=."error";...
c500 09 09 7d 0d 0a 09 09 7d 0d 0a 09 09 69 66 20 28 24 73 74 61 74 75 73 20 3d 3d 20 22 72 65 73 75 ..}....}....if.($status.==."resu
c520 6c 74 22 29 20 7b 20 2f 2f 4e 6f 20 65 72 72 6f 72 73 2c 20 61 64 64 20 63 6f 6e 74 61 63 74 73 lt").{.//No.errors,.add.contacts
c540 0d 0a 09 09 09 66 6f 72 65 61 63 68 28 24 63 6f 6e 74 61 63 74 73 20 61 73 20 24 63 6f 6e 74 61 .....foreach($contacts.as.$conta
c560 63 74 29 20 7b 0d 0a 09 09 09 09 24 74 68 69 73 2d 3e 72 6f 73 74 65 72 2d 3e 61 64 64 43 6f 6e ct).{......$this->roster->addCon
c580 74 61 63 74 28 24 63 6f 6e 74 61 63 74 5b 30 5d 2c 20 24 63 6f 6e 74 61 63 74 5b 31 5d 2c 20 24 tact($contact[0],.$contact[1],.$
c5a0 63 6f 6e 74 61 63 74 5b 32 5d 2c 20 24 63 6f 6e 74 61 63 74 5b 33 5d 29 3b 0d 0a 09 09 09 7d 0d contact[2],.$contact[3]);.....}.
c5c0 0a 09 09 7d 0d 0a 09 09 69 66 20 28 24 78 6d 6c 2d 3e 61 74 74 72 73 5b 27 74 79 70 65 27 5d 20 ...}....if.($xml->attrs['type'].
c5e0 3d 3d 20 27 73 65 74 27 29 20 7b 0d 0a 09 09 09 24 74 68 69 73 2d 3e 73 65 6e 64 28 22 3c 69 71 ==.'set').{.....$this->send("<iq
c600 20 74 79 70 65 3d 5c 22 72 65 70 6c 79 5c 22 20 69 64 3d 5c 22 7b 24 78 6d 6c 2d 3e 61 74 74 72 .type=\"reply\".id=\"{$xml->attr
c620 73 5b 27 69 64 27 5d 7d 5c 22 20 74 6f 3d 5c 22 7b 24 78 6d 6c 2d 3e 61 74 74 72 73 5b 27 66 72 s['id']}\".to=\"{$xml->attrs['fr
c640 6f 6d 27 5d 7d 5c 22 20 2f 3e 22 29 3b 0d 0a 09 09 7d 0d 0a 09 7d 0d 0a 09 2f 2a 2a 0d 0a 09 20 om']}\"./>");....}...}.../**....
c660 2a 20 53 65 73 73 69 6f 6e 20 73 74 61 72 74 20 68 61 6e 64 6c 65 72 0d 0a 09 20 2a 0d 0a 09 20 *.Session.start.handler....*....
c680 2a 20 40 70 61 72 61 6d 20 73 74 72 69 6e 67 20 24 78 6d 6c 0d 0a 09 20 2a 2f 0d 0a 09 70 72 6f *.@param.string.$xml....*/...pro
c6a0 74 65 63 74 65 64 20 66 75 6e 63 74 69 6f 6e 20 73 65 73 73 69 6f 6e 5f 73 74 61 72 74 5f 68 61 tected.function.session_start_ha
c6c0 6e 64 6c 65 72 28 24 78 6d 6c 29 20 7b 0d 0a 09 09 24 74 68 69 73 2d 3e 6c 6f 67 2d 3e 6c 6f 67 ndler($xml).{....$this->log->log
c6e0 28 22 53 65 73 73 69 6f 6e 20 73 74 61 72 74 65 64 22 29 3b 0d 0a 09 09 24 74 68 69 73 2d 3e 73 ("Session.started");....$this->s
c700 65 73 73 69 6f 6e 5f 73 74 61 72 74 65 64 20 3d 20 74 72 75 65 3b 0d 0a 09 09 24 74 68 69 73 2d ession_started.=.true;....$this-
c720 3e 65 76 65 6e 74 28 27 73 65 73 73 69 6f 6e 5f 73 74 61 72 74 27 29 3b 0d 0a 09 7d 0d 0a 09 2f >event('session_start');...}.../
c740 2a 2a 0d 0a 09 20 2a 20 54 4c 53 20 70 72 6f 63 65 65 64 20 68 61 6e 64 6c 65 72 0d 0a 09 20 2a **....*.TLS.proceed.handler....*
c760 0d 0a 09 20 2a 20 40 70 61 72 61 6d 20 73 74 72 69 6e 67 20 24 78 6d 6c 0d 0a 09 20 2a 2f 0d 0a ....*.@param.string.$xml....*/..
c780 09 70 72 6f 74 65 63 74 65 64 20 66 75 6e 63 74 69 6f 6e 20 74 6c 73 5f 70 72 6f 63 65 65 64 5f .protected.function.tls_proceed_
c7a0 68 61 6e 64 6c 65 72 28 24 78 6d 6c 29 20 7b 0d 0a 09 09 24 74 68 69 73 2d 3e 6c 6f 67 2d 3e 6c handler($xml).{....$this->log->l
c7c0 6f 67 28 22 53 74 61 72 74 69 6e 67 20 54 4c 53 20 65 6e 63 72 79 70 74 69 6f 6e 22 29 3b 0d 0a og("Starting.TLS.encryption");..
c7e0 09 09 73 74 72 65 61 6d 5f 73 6f 63 6b 65 74 5f 65 6e 61 62 6c 65 5f 63 72 79 70 74 6f 28 24 74 ..stream_socket_enable_crypto($t
c800 68 69 73 2d 3e 73 6f 63 6b 65 74 2c 20 74 72 75 65 2c 20 53 54 52 45 41 4d 5f 43 52 59 50 54 4f his->socket,.true,.STREAM_CRYPTO
c820 5f 4d 45 54 48 4f 44 5f 53 53 4c 76 32 33 5f 43 4c 49 45 4e 54 29 3b 0d 0a 09 09 24 74 68 69 73 _METHOD_SSLv23_CLIENT);....$this
c840 2d 3e 72 65 73 65 74 28 29 3b 0d 0a 09 7d 0d 0a 09 2f 2a 2a 0d 0a 09 2a 20 52 65 74 72 69 65 76 ->reset();...}.../**...*.Retriev
c860 65 73 20 74 68 65 20 76 63 61 72 64 0d 0a 09 2a 0d 0a 09 2a 2f 0d 0a 09 70 75 62 6c 69 63 20 66 es.the.vcard...*...*/...public.f
c880 75 6e 63 74 69 6f 6e 20 67 65 74 56 43 61 72 64 28 24 6a 69 64 20 3d 20 4e 75 6c 6c 29 20 7b 0d unction.getVCard($jid.=.Null).{.
c8a0 0a 09 09 24 69 64 20 3d 20 24 74 68 69 73 2d 3e 67 65 74 49 44 28 29 3b 0d 0a 09 09 24 74 68 69 ...$id.=.$this->getID();....$thi
c8c0 73 2d 3e 61 64 64 49 64 48 61 6e 64 6c 65 72 28 24 69 64 2c 20 27 76 63 61 72 64 5f 67 65 74 5f s->addIdHandler($id,.'vcard_get_
c8e0 68 61 6e 64 6c 65 72 27 29 3b 0d 0a 09 09 69 66 28 24 6a 69 64 29 20 7b 0d 0a 09 09 09 24 74 68 handler');....if($jid).{.....$th
c900 69 73 2d 3e 73 65 6e 64 28 22 3c 69 71 20 74 79 70 65 3d 27 67 65 74 27 20 69 64 3d 27 24 69 64 is->send("<iq.type='get'.id='$id
c920 27 20 74 6f 3d 27 24 6a 69 64 27 3e 3c 76 43 61 72 64 20 78 6d 6c 6e 73 3d 27 76 63 61 72 64 2d '.to='$jid'><vCard.xmlns='vcard-
c940 74 65 6d 70 27 20 2f 3e 3c 2f 69 71 3e 22 29 3b 0d 0a 09 09 7d 20 65 6c 73 65 20 7b 0d 0a 09 09 temp'./></iq>");....}.else.{....
c960 09 24 74 68 69 73 2d 3e 73 65 6e 64 28 22 3c 69 71 20 74 79 70 65 3d 27 67 65 74 27 20 69 64 3d .$this->send("<iq.type='get'.id=
c980 27 24 69 64 27 3e 3c 76 43 61 72 64 20 78 6d 6c 6e 73 3d 27 76 63 61 72 64 2d 74 65 6d 70 27 20 '$id'><vCard.xmlns='vcard-temp'.
c9a0 2f 3e 3c 2f 69 71 3e 22 29 3b 0d 0a 09 09 7d 0d 0a 09 7d 0d 0a 09 2f 2a 2a 0d 0a 09 2a 20 56 43 /></iq>");....}...}.../**...*.VC
c9c0 61 72 64 20 72 65 74 72 69 65 76 61 6c 20 68 61 6e 64 6c 65 72 0d 0a 09 2a 0d 0a 09 2a 20 40 70 ard.retrieval.handler...*...*.@p
c9e0 61 72 61 6d 20 58 4d 4c 20 4f 62 6a 65 63 74 20 24 78 6d 6c 0d 0a 09 2a 2f 0d 0a 09 70 72 6f 74 aram.XML.Object.$xml...*/...prot
ca00 65 63 74 65 64 20 66 75 6e 63 74 69 6f 6e 20 76 63 61 72 64 5f 67 65 74 5f 68 61 6e 64 6c 65 72 ected.function.vcard_get_handler
ca20 28 24 78 6d 6c 29 20 7b 0d 0a 09 09 24 76 63 61 72 64 5f 61 72 72 61 79 20 3d 20 61 72 72 61 79 ($xml).{....$vcard_array.=.array
ca40 28 29 3b 0d 0a 09 09 24 76 63 61 72 64 20 3d 20 24 78 6d 6c 2d 3e 73 75 62 28 27 76 63 61 72 64 ();....$vcard.=.$xml->sub('vcard
ca60 27 29 3b 0d 0a 09 09 2f 2f 20 67 6f 20 74 68 72 6f 75 67 68 20 61 6c 6c 20 6f 66 20 74 68 65 20 ');....//.go.through.all.of.the.
ca80 73 75 62 20 65 6c 65 6d 65 6e 74 73 20 61 6e 64 20 61 64 64 20 74 68 65 6d 20 74 6f 20 74 68 65 sub.elements.and.add.them.to.the
caa0 20 76 63 61 72 64 20 61 72 72 61 79 0d 0a 09 09 66 6f 72 65 61 63 68 20 28 24 76 63 61 72 64 2d .vcard.array....foreach.($vcard-
cac0 3e 73 75 62 73 20 61 73 20 24 73 75 62 29 20 7b 0d 0a 09 09 09 69 66 20 28 24 73 75 62 2d 3e 73 >subs.as.$sub).{.....if.($sub->s
cae0 75 62 73 29 20 7b 0d 0a 09 09 09 09 24 76 63 61 72 64 5f 61 72 72 61 79 5b 24 73 75 62 2d 3e 6e ubs).{......$vcard_array[$sub->n
cb00 61 6d 65 5d 20 3d 20 61 72 72 61 79 28 29 3b 0d 0a 09 09 09 09 66 6f 72 65 61 63 68 20 28 24 73 ame].=.array();......foreach.($s
cb20 75 62 2d 3e 73 75 62 73 20 61 73 20 24 73 75 62 5f 63 68 69 6c 64 29 20 7b 0d 0a 09 09 09 09 09 ub->subs.as.$sub_child).{.......
cb40 24 76 63 61 72 64 5f 61 72 72 61 79 5b 24 73 75 62 2d 3e 6e 61 6d 65 5d 5b 24 73 75 62 5f 63 68 $vcard_array[$sub->name][$sub_ch
cb60 69 6c 64 2d 3e 6e 61 6d 65 5d 20 3d 20 24 73 75 62 5f 63 68 69 6c 64 2d 3e 64 61 74 61 3b 0d 0a ild->name].=.$sub_child->data;..
cb80 09 09 09 09 7d 0d 0a 09 09 09 7d 20 65 6c 73 65 20 7b 0d 0a 09 09 09 09 24 76 63 61 72 64 5f 61 ....}.....}.else.{......$vcard_a
cba0 72 72 61 79 5b 24 73 75 62 2d 3e 6e 61 6d 65 5d 20 3d 20 24 73 75 62 2d 3e 64 61 74 61 3b 0d 0a rray[$sub->name].=.$sub->data;..
cbc0 09 09 09 7d 0d 0a 09 09 7d 0d 0a 09 09 24 76 63 61 72 64 5f 61 72 72 61 79 5b 27 66 72 6f 6d 27 ...}....}....$vcard_array['from'
cbe0 5d 20 3d 20 24 78 6d 6c 2d 3e 61 74 74 72 73 5b 27 66 72 6f 6d 27 5d 3b 0d 0a 09 09 24 74 68 69 ].=.$xml->attrs['from'];....$thi
cc00 73 2d 3e 65 76 65 6e 74 28 27 76 63 61 72 64 27 2c 20 24 76 63 61 72 64 5f 61 72 72 61 79 29 3b s->event('vcard',.$vcard_array);
cc20 0d 0a 09 7d 0d 0a 7d 0d 0a 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ...}..}.........................
cc40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
cc60 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
cc80 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
cca0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
ccc0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
cce0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
cd00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
cd20 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
cd40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
cd60 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
cd80 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
cda0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
cdc0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
cde0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
ce00 6c 69 73 74 2e 70 68 70 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 list.php........................
ce20 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
ce40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
ce60 00 00 00 00 30 30 30 30 36 34 34 00 30 30 30 31 37 35 30 00 30 30 30 31 37 35 30 00 30 30 30 30 ....0000644.0001750.0001750.0000
ce80 30 30 30 32 32 36 33 00 31 32 37 37 33 30 34 32 35 31 33 00 30 31 31 33 34 33 00 20 30 00 00 00 0002263.12773042513.011343..0...
cea0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
cec0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
cee0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
cf00 00 75 73 74 61 72 20 20 00 74 7a 75 72 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 .ustar...tzur...................
cf20 00 00 00 00 00 00 00 00 00 74 7a 75 72 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 .........tzur...................
cf40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
cf60 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
cf80 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
cfa0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
cfc0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
cfe0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
d000 3c 3f 70 68 70 0a 2f 2a 0a 20 2a 0a 20 2a 0a 20 2a 2f 0a 72 65 71 75 69 72 65 5f 6f 6e 63 65 28 <?php./*..*..*..*/.require_once(
d020 22 45 78 63 65 70 74 69 6f 6e 2e 70 68 70 22 29 3b 0a 72 65 71 75 69 72 65 5f 6f 6e 63 65 28 22 "Exception.php");.require_once("
d040 58 4d 50 50 4c 6f 67 2e 70 68 70 22 29 3b 0a 72 65 71 75 69 72 65 5f 6f 6e 63 65 28 22 52 6f 73 XMPPLog.php");.require_once("Ros
d060 74 65 72 2e 70 68 70 22 29 3b 0a 72 65 71 75 69 72 65 5f 6f 6e 63 65 28 22 58 4d 4c 4f 62 6a 2e ter.php");.require_once("XMLObj.
d080 70 68 70 22 29 3b 0a 72 65 71 75 69 72 65 5f 6f 6e 63 65 28 22 58 4d 4c 53 74 72 65 61 6d 2e 70 php");.require_once("XMLStream.p
d0a0 68 70 22 29 3b 0a 72 65 71 75 69 72 65 5f 6f 6e 63 65 28 22 58 4d 50 50 2e 70 68 70 22 29 3b 0a hp");.require_once("XMPP.php");.
d0c0 0a 2f 2f 20 4c 6f 61 64 20 63 6f 6e 66 69 67 75 72 61 74 69 6f 6e 0a 24 63 6f 6e 66 69 67 20 3d .//.Load.configuration.$config.=
d0e0 20 72 65 71 75 69 72 65 28 5f 5f 44 49 52 5f 5f 2e 27 2f 63 6f 6e 66 69 67 2f 63 6f 6e 66 69 67 .require(__DIR__.'/config/config
d100 2e 69 6e 63 2e 70 68 70 27 29 3b 0a 2f 2f 20 49 6e 69 74 69 61 6c 69 7a 65 20 64 69 72 65 63 74 .inc.php');.//.Initialize.direct
d120 6f 72 79 20 63 6f 6e 66 69 67 0a 24 63 6f 6e 66 69 67 5b 27 73 74 6f 72 61 67 65 5f 62 61 73 65 ory.config.$config['storage_base
d140 5f 70 61 74 68 27 5d 20 3d 20 5f 5f 44 49 52 5f 5f 2e 27 2f 66 69 6c 65 73 2f 27 3b 0a 24 63 6f _path'].=.__DIR__.'/files/';.$co
d160 6e 66 69 67 5b 27 73 6c 6f 74 5f 72 65 67 69 73 74 72 79 5f 64 69 72 27 5d 20 3d 20 5f 5f 44 49 nfig['slot_registry_dir'].=.__DI
d180 52 5f 5f 2e 27 2f 73 6c 6f 74 73 2f 27 3b 0a 0a 66 75 6e 63 74 69 6f 6e 20 0a 0a 66 75 6e 63 74 R__.'/slots/';..function...funct
d1a0 69 6f 6e 20 72 65 61 64 53 6c 6f 74 73 28 24 6a 61 62 62 65 72 69 64 29 20 20 7b 0a 20 20 20 20 ion.readSlots($jabberid)..{.....
d1c0 24 73 6c 6f 74 73 20 3d 20 61 72 72 61 79 28 29 3b 0a 20 20 20 20 69 66 20 28 24 68 61 6e 64 6c $slots.=.array();.....if.($handl
d1e0 65 20 3d 20 6f 70 65 6e 64 69 72 28 24 63 6f 6e 66 69 67 5b 27 73 74 6f 72 61 67 65 5f 62 61 73 e.=.opendir($config['storage_bas
d200 65 5f 70 61 74 68 27 5d 29 29 20 7b 0a 20 20 20 20 20 20 20 20 77 68 69 6c 65 20 28 66 61 6c 73 e_path'])).{.........while.(fals
d220 65 20 21 3d 3d 20 28 24 65 6e 74 72 79 20 3d 20 72 65 61 64 64 69 72 28 24 68 61 6e 64 6c 65 29 e.!==.($entry.=.readdir($handle)
d240 29 29 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 24 70 61 72 61 6d 73 20 3d 20 72 65 71 75 69 )).{.............$params.=.requi
d260 72 65 28 24 63 6f 6e 66 69 67 5b 27 73 74 6f 72 61 67 65 5f 62 61 73 65 5f 70 61 74 68 27 5d 2e re($config['storage_base_path'].
d280 27 2f 27 2e 24 65 6e 74 72 79 29 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 24 70 61 '/'.$entry);.............if.($pa
d2a0 72 61 6d 73 5b 27 75 73 65 72 5f 6a 69 64 27 5d 20 3d 3d 20 24 6a 61 62 62 65 72 69 64 29 20 7b rams['user_jid'].==.$jabberid).{
d2c0 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 24 73 6c 6f 74 73 5b 24 65 6e 74 72 79 5d 20 .................$slots[$entry].
d2e0 3d 20 24 70 61 72 61 6d 73 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0a 20 20 20 20 20 20 20 =.$params;.............}........
d300 20 7d 0a 20 20 20 20 7d 0a 20 20 20 20 72 65 74 75 72 6e 20 24 73 6c 6f 74 73 3b 0a 7d 0a 0a 66 .}.....}.....return.$slots;.}..f
d320 75 6e 63 74 69 6f 6e 20 61 75 74 68 65 6e 74 69 63 61 74 65 28 24 6a 61 62 62 65 72 69 64 2c 20 unction.authenticate($jabberid,.
d340 24 70 61 73 73 77 6f 72 64 29 20 20 7b 0a 20 20 20 20 24 70 61 72 74 73 20 3d 20 73 70 6c 69 74 $password)..{.....$parts.=.split
d360 28 27 40 27 2c 20 24 6a 61 62 62 65 72 69 64 29 3b 0a 20 20 20 20 24 68 6f 73 74 20 3d 20 24 70 ('@',.$jabberid);.....$host.=.$p
d380 61 72 74 73 5b 31 5d 3b 0a 20 20 20 20 24 75 73 65 72 20 3d 20 24 70 61 72 74 73 5b 30 5d 3b 0a arts[1];.....$user.=.$parts[0];.
d3a0 20 20 20 20 0a 20 20 20 20 74 72 79 20 7b 0a 20 20 20 20 20 20 20 20 24 78 6d 70 70 20 3d 20 6e .........try.{.........$xmpp.=.n
d3c0 65 77 20 58 4d 50 50 28 24 68 6f 73 74 2c 20 35 32 32 32 2c 20 24 75 73 65 72 2c 20 24 70 61 73 ew.XMPP($host,.5222,.$user,.$pas
d3e0 73 77 6f 72 64 2c 20 27 68 74 74 70 75 70 6c 6f 61 64 27 29 3b 0a 20 20 20 20 20 20 20 20 24 78 sword,.'httpupload');.........$x
d400 6d 70 70 2d 3e 63 6f 6e 6e 65 63 74 28 35 29 3b 0a 20 20 20 20 20 20 20 20 24 78 6d 70 70 2d 3e mpp->connect(5);.........$xmpp->
d420 70 72 6f 63 65 73 73 55 6e 74 69 6c 28 27 73 65 73 73 69 6f 6e 5f 73 74 61 72 74 27 2c 20 31 30 processUntil('session_start',.10
d440 29 3b 0a 20 20 20 20 20 20 20 20 24 78 6d 70 70 2d 3e 64 69 73 63 6f 6e 6e 65 63 74 28 29 3b 0a );.........$xmpp->disconnect();.
d460 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 74 72 75 65 3b 0a 20 20 20 20 7d 20 63 61 74 63 68 ........return.true;.....}.catch
d480 20 28 58 4d 50 50 45 78 63 65 70 74 69 6f 6e 20 24 65 29 20 7b 0a 20 20 20 20 20 20 20 20 72 65 .(XMPPException.$e).{.........re
d4a0 74 75 72 6e 20 66 61 6c 73 65 3b 0a 20 20 20 20 7d 0a 7d 00 00 00 00 00 00 00 00 00 00 00 00 00 turn.false;.....}.}.............
d4c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
d4e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
d500 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
d520 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
d540 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
d560 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
d580 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
d5a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
d5c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
d5e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
d600 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
d620 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
d640 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
d660 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
d680 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
d6a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
d6c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
d6e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
d700 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
d720 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
d740 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
d760 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
d780 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
d7a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
d7c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
d7e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
d800 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
d820 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
d840 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
d860 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
d880 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
d8a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
d8c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
d8e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
d900 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
d920 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
d940 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
d960 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
d980 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
d9a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
d9c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
d9e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
da00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
da20 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
da40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
da60 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
da80 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
daa0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
dac0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
dae0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
db00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
db20 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
db40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
db60 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
db80 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
dba0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
dbc0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
dbe0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
dc00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
dc20 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
dc40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
dc60 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
dc80 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
dca0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
dcc0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
dce0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
dd00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
dd20 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
dd40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
dd60 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
dd80 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
dda0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
ddc0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
dde0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
de00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
de20 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
de40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
de60 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
de80 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
dea0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
dec0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
dee0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
df00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
df20 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
df40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
df60 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
df80 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
dfa0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
dfc0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
dfe0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
e000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
e020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
e040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
e060 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
e080 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
e0a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
e0c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
e0e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
e100 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
e120 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
e140 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
e160 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
e180 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
e1a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
e1c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
e1e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
e200 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
e220 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
e240 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
e260 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
e280 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
e2a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
e2c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
e2e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
e300 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
e320 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
e340 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
e360 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
e380 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
e3a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
e3c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
e3e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
e400 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
e420 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
e440 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
e460 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
e480 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
e4a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
e4c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
e4e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
e500 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
e520 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
e540 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
e560 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
e580 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
e5a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
e5c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
e5e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
e600 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
e620 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
e640 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
e660 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
e680 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
e6a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
e6c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
e6e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
e700 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
e720 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
e740 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
e760 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
e780 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
e7a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
e7c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
e7e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
e800 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
e820 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
e840 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
e860 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
e880 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
e8a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
e8c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
e8e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
e900 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
e920 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
e940 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
e960 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
e980 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
e9a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
e9c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
e9e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
ea00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
ea20 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
ea40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
ea60 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
ea80 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
eaa0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
eac0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
eae0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
eb00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
eb20 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
eb40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
eb60 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
eb80 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
eba0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
ebc0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
ebe0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
ec00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
ec20 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
ec40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
ec60 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
ec80 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
eca0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
ecc0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
ece0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
ed00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
ed20 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
ed40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
ed60 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
ed80 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
eda0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
edc0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
ede0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
ee00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
ee20 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
ee40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
ee60 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
ee80 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
eea0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
eec0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
eee0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
ef00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
ef20 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
ef40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
ef60 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
ef80 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
efa0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
efc0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
efe0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................