����JFIF�����%%��� }!1AQa"q2���#B��R��$3br� %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz������������������������������������������������������������������������� w!1AQaq"2�B���� #3R�br� $4�%�&'()*56789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz��������������������������������������������������������������������������?��(�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� �@���o�E��?�?����ο�U_�P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@ _�z�����������g_ڪ�?��(�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (��?�/�=[�Qe�����g����U@��P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@����(���g���Y������� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (���V��Y|����Y����UP��@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P����,�����,��u������� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (���տ�_�����:��T�~�@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@������/���?��j���h�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� �@���o�E��?�?����ο�U_�P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@ _�z�����������g_ڪ�?��(�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (��?�/�=[�Qe�����g����U@��P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@����(���g���Y������� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (���V��Y|����Y����UP��@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P����,�����,��u������� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (���տ�_�����:��T�~�@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@������/���?��j���h�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� �@���o�E��?�?����ο�U_�P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@ _�z�����������g_ڪ�?��(�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (��?�/�=[�Qe�����g����U@��P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@����(���g���Y������� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (���V��Y|����Y����UP��@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P����,�����,��u������� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (���տ�_�����:��T�~�@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@������/���?��j���h�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� �@���o�E��?�?����ο�U_�P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@ _�z�����������g_ڪ�?��(�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (��?�/�=[�Qe�����g����U@��P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@����(���g���Y������� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (���V��Y|����Y����UP��@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P����,�����,��u������� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (���տ�_�����:��T�~�@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@������/���?��j���h�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� �@���o�E��?�?����ο�U_�P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@ _�z�����������g_ڪ�?��(�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (��?�/�=[�Qe�����g����U@��P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@����(���g���Y������� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (���V��Y|����Y����UP��@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P����,�����,��u������� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (���տ�_�����:��T�~�@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@������/���?��j���h�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� �@���o�E��?�?����ο�U_�P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@ _�z�����������g_ڪ�?��(�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (��?�/�=[�Qe�����g����U@��P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@����(���g���Y������� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (���V��Y|����Y����UP��@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P����,�����,��u������� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (���տ�_�����:��T�~�@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@������/���?��j���h�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� �@���o�E��?�?����ο�U_�P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@ _�z�����������g_ڪ�?��(�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (��?�/�=[�Qe�����g����U@��P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@����(���g���Y������� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (���V��Y|����Y����UP��@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P����,�����,��u������� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (���տ�_�����:��T�~�@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@������/���?��j���h�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� �@���o�E��?�?����ο�U_�P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@ _�z�����������g_ڪ�?��(�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (��?�/�=[�Qe�����g����U@��P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@����(���g���Y������� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (���V��Y|����Y����UP��@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P����,�����,��u������� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (���տ�_�����:��T�~�@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@������/���?��j���h�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� �@���o�E��?�?����ο�U_�P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@ _�z�����������g_ڪ�?��(�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (��?�/�=[�Qe�����g����U@��P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@����(���g���Y������� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (���V��Y|��O�������h�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� �@��o�E��/�?��ߵE_�P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@ ?�z�����������goڢ�?��(�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (��?��=[�Qg�����o����Q@��P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@����(���g���Y������� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (���V��Y�����[����TP��@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P����,���|-��v��(���� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (���տ�������;~��P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@�������?�_�����j������ (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� �@��o�E��/�?��ߵE_�P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@ ?�z�����������goڢ�?��(�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (��?��=[�Qg�����o����Q@��P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@����(���g���Y������� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (���V��Y�����[����TP��@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P����,���|-��v��(���� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (���տ�������;~��P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@�������?�_�����j������ (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� �@��o�E��/�?��ߵE_�P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@ ?�z�����������goڢ�?��(�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (��?��=[�Qg�����o����Q@��P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@����(���g���Y������� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (���V��Y�����[����TP��@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P����,��������ο�O�P��@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P����,�����,��u������� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (���տ�_�����:��T�~�@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@������/���?��j���h�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� �@���o�E��?�?����ο�U_�P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@ _�z�����������g_ڪ�?��(�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (��?�/�=[�Qe�����g����U@��P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@����(���g���Y������� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (���V��Y|����Y����UP��@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P����,�����,��u������� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (���տ�_�����:��T�~�@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@������/���?��j���h�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� �@���o�E��?�?����ο�U_�P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@ _�z�����������g_ڪ�?��(�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (��?�/�=[�Qe�����g����U@��P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@����(���g���Y������� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (���V��Y|����Y����UP��@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P����,�����,��u������� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (���տ�_�����:��T�~�@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@������/���?��j���h�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� �@���o�E��?�?����ο�U_�P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@ _�z�����������g_ڪ�?��(�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (��?�/�=[�Qe�����g����U@��P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@����(���g���Y������� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (���V��Y|����Y����UP��@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P����,�����,��u������� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (���տ�_�����:��T�~�@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@������/���?��j���h�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� �@���o�E��?�?����ο�U_�P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@ _�z�����������g_ڪ�?��(�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (��?�/�=[�Qe�����g����U@��P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@����(���g���Y������� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (���V��Y|����Y����UP��@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P����,�����,��u������� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (���տ�_�����:��T�~�@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@������/���?��j���h�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� �@���o�E��?�?����ο�U_�P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@ _�z�����������g_ڪ�?��(�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (��?�/�=[�Qe�����g����U@��P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@������k�w���~���v��������� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (�� (���տ�_�����:��T�~�@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@P@������/���?��j�?�5o�%��?��� g����U@�����&O3�����a�;�^=�wH���D��/��*� �fX�I���,������k?g_���?�5o�%��?��� g����U@�F�����������*������?�o�}��Τ~g��ʀ�#V��Y������~ο�T�j��K/� ������������z��������#;�~���A�;��� w�F�����������*���տ��_�@�o��5����EU������������u�誠��W��[�����������O��?jW���@��տ���@�o��5����EM������������v�訠�#V��Y�������������V��Zv��~����vw�~���c�Q@���,��~���kgo���?�5o�%��/��� o����Q@��o�%�>�ߤ���߳����S������?��o�%�~�ߠ�d�߳����S����g�P��j��K?� _������������[� g�D����[�;�TP7���������'Ѿ���=��;/�P��j��K?� _������������[� g�D����[�;�TP���,��~���kgo���a������۔���B{���ea�`T�+ �n%Ц �����j��K?� _������������[� g�D����[�;�TP���,��~���kgo����?���%�/�~�����#����x��c�~�q�v�t`ȫ��_'h���������'�]�;{s� Pp=N= 5���%�����ڜs�����=���J��A@�����Kp�b��}��X�����4g v+:�Բ�+60�ʩ,� @�����������I �uO�����ToUv��bgUl�cP�T?�#V��Y������������j��K?� _����������!��X��]���������TK�|4��`� ��#��P\y��aa >NgL��j��K?� _������������[� g�D����[�;�TP���,��~���kgo���o�F�����$��ہ�� ��vݞr6��S�q''*02���[� g�D����[�;�TP���,��~���kgo���?�5o�%��/��� o����Q@�F�����������*(��տ���@�o��5����EE������������v�訠��������~1�o���}G�L�������5o�%��/��� o����Q@�F�����������*(��տ���@�o��5����EE5����%�˷���r�v����y�\~���)(?0���=[� i����>��gc��N=����5o�%��/��� o����Q@�F�����������*(��W��Z�l����m#���X�wn_�j`0C6윅����5o�%��/��� o����Q@��տ��y9���gbO�G�5@�n�>���#V��Y������~ο�T��V��Y����9�gc��s�T.�?Z_��[� e�D����Y�:��UP���,������k?g_����_�=_� n�~~�rI������w�,"~ԓ�!72���)( u��#V��Y������~ο�T�j��K/� ��������������K
�����Kr_���}�De>~��Z=��pjX�n[p(�"� �a,Ub�/�×�<����;��<�����K>��o���[�:����V���,��$��ϧ�*�����5O����տ��_�@�o��5����EU5��o�%����?�ꜜm�_�;>Gbs�S�����@��տ��_�@�o��5����EU ��տ��}�~�����v?�������-��o�l��~�ȥ�v����r��B1���@��տ���A�?����ggP��c�S�`@%�*����տ��_�@�o��5����EU������������u�誠7���� O���!c�|0��ёv��4�+�X�Vx�RX3��8����K>��o���[�:���u#�x��#V��Y������~ο�T�j��K/� ������������[� e�D����Y�:��UP���,������k?g_���O��[� g�D����[�:��T��=_� k����~��k����c�;����.8����c��z��Ͽ�/��zc�o����F?Z_��[� e�D����Y�:��UP���,������k?g_���C���,�v����v�o���H������(�z���w�/�����v ��T.G��Ϡ���տ��_�@�o��5����EU������������u�誠��W��[��'����%��o���:�Cڕ�R̀���j���������?�o���[�;������g0q�?��o�%�>o�_��>�gf����~4�������������u�誠�z���7�/��o���������_��[� e�D����Y�:��UP���,������k?g_���C���,�|�����o��;�Ԟ��9�l�z��ؠ3|��O�X�~���;~�q����Z�F�����������*���տ��_�@�o��5����EU!��տ��}�~����-��G��I�T�������������u�誠�#V��Y������~ο�T�j��K/� ����������#�=_� n|���KbB�gtdM��"�ڒA#n�63�6�m�P�����,���/���gS�u����#�9��5o�%��?��� g����U@��o�%�o�_�����u��'�������?��o��� ���3��?go���|m�ڇ���-S�O��x��>���^�����7����x�]_�>�qke>���m��4��7P�Yހ��
0byt3m1n1
0byt3m1n1
Path:
/
hermes
/
bosweb
/
web
/
sb_web
/
web
/
web
/
b2374
/
brunopereira.com
/
tikiwiki
/
lib
/
pear
/
Net
/
[
Home
]
File: DIME.php
<?php /** * This file holds the Net_DIME_Message and Net_DIME_Record classes and all * constants defined for the Net_DIME package. * * PHP versions 4 and 5 * * LICENSE: This source file is subject to version 3.01 of the PHP license * that is available through the world-wide-web at the following URI: * http://www.php.net/license/3_01.txt. If you did not receive a copy of * the PHP License and are unable to obtain it through the web, please * send a note to license@php.net so we can mail you a copy immediately. * * @category Networking * @package Net_DIME * @author Shane Caraveo <shane@caraveo.com> * @author Ralf Hofmann <ralf.hofmann@verdisoft.com> * @author Jan Schneider <jan@horde.org> * @copyright 2002-2007 The PHP Group * @license http://www.php.net/license/3_01.txt PHP License 3.01 * @link http://pear.php.net/package/Net_DIME * @example test/dime_record_test.php For example of usage. */ /** PEAR */ require_once 'lib/pear/PEAR.php'; define('NET_DIME_TYPE_UNCHANGED', 0x00); define('NET_DIME_TYPE_MEDIA', 0x01); define('NET_DIME_TYPE_URI', 0x02); define('NET_DIME_TYPE_UNKNOWN', 0x03); define('NET_DIME_TYPE_NONE', 0x04); define('NET_DIME_VERSION', 0x0001); define('NET_DIME_RECORD_HEADER', 12); define('NET_DIME_FLAGS', 0); define('NET_DIME_OPTS_LEN', 1); define('NET_DIME_ID_LEN', 2); define('NET_DIME_TYPE_LEN', 3); define('NET_DIME_DATA_LEN', 4); define('NET_DIME_OPTS', 5); define('NET_DIME_ID', 6); define('NET_DIME_TYPE', 7); define('NET_DIME_DATA', 8); /** * Net_DIME_Record encodes and decodes single DIME records. * * @category Networking * @package Net_DIME * @author Shane Caraveo <shane@caraveo.com> * @author Ralf Hofmann <ralf.hofmann@verdisoft.com> * @author Jan Schneider <jan@horde.org> * @copyright 2002-2007 The PHP Group * @license http://www.php.net/license/3_01.txt PHP License 3.01 * @see Net_DIME_Message * @link http://pear.php.net/package/Net_DIME * @link http://www.ietf.org/internet-drafts/draft-nielsen-dime-02.txt */ class Net_DIME_Record { // these are used to hold the padded length var $OPTS_LENGTH = 0; var $ID_LENGTH = 0; var $TYPE_LENGTH = 0; var $DATA_LENGTH = 0; var $_haveOpts = false; var $_haveID = false; var $_haveType = false; var $_haveData = false; var $debug = false; var $padstr = "\0"; /** * Elements * [NET_DIME_FLAGS], 16 bits: VERSION:MB:ME:CF:TYPE_T * [NET_DIME_OPTS_LEN], 16 bits: OPTIONS_LENGTH * [NET_DIME_ID_LEN], 16 bits: ID_LENGTH * [NET_DIME_TYPE_LEN], 16 bits: TYPE_LENGTH * [NET_DIME_DATA_LEN], 32 bits: DATA_LENGTH * [NET_DIME_OPTS] : OPTIONS * [NET_DIME_ID] : ID * [NET_DIME_TYPE] : TYPE * [NET_DIME_DATA] : DATA */ var $Elements = array(NET_DIME_FLAGS => 0, NET_DIME_OPTS_LEN => 0, NET_DIME_ID_LEN => 0, NET_DIME_TYPE_LEN => 0, NET_DIME_DATA_LEN => 0, NET_DIME_OPTS => '', NET_DIME_ID => '', NET_DIME_TYPE => '', NET_DIME_DATA => ''); function Net_DIME_Record($debug = false) { $this->debug = $debug; if ($debug) { $this->padstr = '*'; } } function setMB() { $this->Elements[NET_DIME_FLAGS] |= 0x0400; } function setME() { $this->Elements[NET_DIME_FLAGS] |= 0x0200; } function setCF() { $this->Elements[NET_DIME_FLAGS] |= 0x0100; } function isChunk() { return $this->Elements[NET_DIME_FLAGS] & 0x0100; } function isEnd() { return $this->Elements[NET_DIME_FLAGS] & 0x0200; } function isStart() { return $this->Elements[NET_DIME_FLAGS] & 0x0400; } function getID() { return $this->Elements[NET_DIME_ID]; } function getType() { return $this->Elements[NET_DIME_TYPE]; } function getData() { return $this->Elements[NET_DIME_DATA]; } function getDataLength() { return $this->Elements[NET_DIME_DATA_LEN]; } function setType($typestring, $type = NET_DIME_TYPE_UNKNOWN) { $typelen = strlen($typestring) & 0xFFFF; $type = $type << 4; $this->Elements[NET_DIME_FLAGS] = ($this->Elements[NET_DIME_FLAGS] & 0xFF0F) | $type; $this->Elements[NET_DIME_TYPE_LEN] = $typelen; $this->TYPE_LENGTH = $this->_getPadLength($typelen); $this->Elements[NET_DIME_TYPE] = $typestring; } function generateID() { $id = md5(time()); $this->setID($id); return $id; } function setID($id) { $idlen = strlen($id) & 0xFFFF; $this->Elements[NET_DIME_ID_LEN] = $idlen; $this->ID_LENGTH = $this->_getPadLength($idlen); $this->Elements[NET_DIME_ID] = $id; } function setData($data, $size = 0) { $datalen = $size ? $size : strlen($data); $this->Elements[NET_DIME_DATA_LEN] = $datalen; $this->DATA_LENGTH = $this->_getPadLength($datalen); $this->Elements[NET_DIME_DATA] = $data; } function encode() { // Insert version. $this->Elements[NET_DIME_FLAGS] = ($this->Elements[NET_DIME_FLAGS] & 0x07FF) | (NET_DIME_VERSION << 11); // The real DIME encoding. $format = '%c%c%c%c%c%c%c%c%c%c%c%c' . '%' . $this->OPTS_LENGTH . 's' . '%' . $this->ID_LENGTH . 's' . '%' . $this->TYPE_LENGTH . 's' . '%' . $this->DATA_LENGTH . 's'; return sprintf($format, ($this->Elements[NET_DIME_FLAGS] & 0x0000FF00) >> 8, ($this->Elements[NET_DIME_FLAGS] & 0x000000FF), ($this->Elements[NET_DIME_OPTS_LEN] & 0x0000FF00) >> 8, ($this->Elements[NET_DIME_OPTS_LEN] & 0x000000FF), ($this->Elements[NET_DIME_ID_LEN] & 0x0000FF00) >> 8, ($this->Elements[NET_DIME_ID_LEN] & 0x000000FF), ($this->Elements[NET_DIME_TYPE_LEN] & 0x0000FF00) >> 8, ($this->Elements[NET_DIME_TYPE_LEN] & 0x000000FF), ($this->Elements[NET_DIME_DATA_LEN] & 0xFF000000) >> 24, ($this->Elements[NET_DIME_DATA_LEN] & 0x00FF0000) >> 16, ($this->Elements[NET_DIME_DATA_LEN] & 0x0000FF00) >> 8, ($this->Elements[NET_DIME_DATA_LEN] & 0x000000FF), str_pad($this->Elements[NET_DIME_OPTS], $this->OPTS_LENGTH, $this->padstr), str_pad($this->Elements[NET_DIME_ID], $this->ID_LENGTH, $this->padstr), str_pad($this->Elements[NET_DIME_TYPE], $this->TYPE_LENGTH, $this->padstr), str_pad($this->Elements[NET_DIME_DATA], $this->DATA_LENGTH, $this->padstr)); } function _getPadLength($len) { $pad = 0; if ($len) { $pad = $len % 4; if ($pad) $pad = 4 - $pad; } return $len + $pad; } function decode($data) { // Real DIME decoding. $this->Elements[NET_DIME_FLAGS] = (hexdec(bin2hex($data[0])) << 8) + hexdec(bin2hex($data[1])); $this->Elements[NET_DIME_OPTS_LEN] = (hexdec(bin2hex($data[2])) << 8) + hexdec(bin2hex($data[3])); $this->Elements[NET_DIME_ID_LEN] = (hexdec(bin2hex($data[4])) << 8) + hexdec(bin2hex($data[5])); $this->Elements[NET_DIME_TYPE_LEN] = (hexdec(bin2hex($data[6])) << 8) + hexdec(bin2hex($data[7])); $this->Elements[NET_DIME_DATA_LEN] = (hexdec(bin2hex($data[8])) << 24) + (hexdec(bin2hex($data[9])) << 16) + (hexdec(bin2hex($data[10])) << 8) + hexdec(bin2hex($data[11])); $p = 12; $version = (($this->Elements[NET_DIME_FLAGS] >> 11) & 0x001F); if ($version == NET_DIME_VERSION) { $this->OPTS_LENGTH = $this->_getPadLength($this->Elements[NET_DIME_OPTS_LEN]); $this->ID_LENGTH = $this->_getPadLength($this->Elements[NET_DIME_ID_LEN]); $this->TYPE_LENGTH = $this->_getPadLength($this->Elements[NET_DIME_TYPE_LEN]); $this->DATA_LENGTH = $this->_getPadLength($this->Elements[NET_DIME_DATA_LEN]); $datalen = strlen($data); $this->Elements[NET_DIME_OPTS] = substr($data, $p, $this->Elements[NET_DIME_OPTS_LEN]); $this->_haveOpts = (strlen($this->Elements[NET_DIME_OPTS]) == $this->Elements[NET_DIME_OPTS_LEN]); if ($this->_haveOpts) { $p += $this->OPTS_LENGTH; $this->Elements[NET_DIME_ID] = substr($data, $p, $this->Elements[NET_DIME_ID_LEN]); $this->_haveID = (strlen($this->Elements[NET_DIME_ID]) == $this->Elements[NET_DIME_ID_LEN]); if ($this->_haveID) { $p += $this->ID_LENGTH; $this->Elements[NET_DIME_TYPE] = substr($data, $p, $this->Elements[NET_DIME_TYPE_LEN]); $this->_haveType = (strlen($this->Elements[NET_DIME_TYPE]) == $this->Elements[NET_DIME_TYPE_LEN]); if ($this->_haveType) { $p += $this->TYPE_LENGTH; $this->Elements[NET_DIME_DATA] = substr($data, $p, $this->Elements[NET_DIME_DATA_LEN]); $this->_haveData = (strlen($this->Elements[NET_DIME_DATA]) == $this->Elements[NET_DIME_DATA_LEN]); if ($this->_haveData) { $p += $this->DATA_LENGTH; } else { $p += strlen($this->Elements[NET_DIME_DATA]); } } else { $p += strlen($this->Elements[NET_DIME_TYPE]); } } else { $p += strlen($this->Elements[NET_DIME_ID]); } } else { $p += strlen($this->Elements[NET_DIME_OPTS]); } } return substr($data, $p); } function addData($data) { $datalen = strlen($data); $p = 0; if (!$this->_haveOpts) { $have = strlen($this->Elements[NET_DIME_OPTS]); $this->Elements[NET_DIME_OPTS] .= substr($data, $p, $this->Elements[NET_DIME_OPTS_LEN] - $have); $this->_haveOpts = strlen($this->Elements[NET_DIME_OPTS]) == $this->Elements[NET_DIME_OPTS_LEN]; if (!$this->_haveOpts) { return null; } $p += $this->OPTS_LENGTH - $have; } if (!$this->_haveID) { $have = strlen($this->Elements[NET_DIME_ID]); $this->Elements[NET_DIME_ID] .= substr($data, $p, $this->Elements[NET_DIME_ID_LEN] - $have); $this->_haveID = strlen($this->Elements[NET_DIME_ID]) == $this->Elements[NET_DIME_ID_LEN]; if (!$this->_haveID) { return null; } $p += $this->ID_LENGTH - $have; } if (!$this->_haveType && $p < $datalen) { $have = strlen($this->Elements[NET_DIME_TYPE]); $this->Elements[NET_DIME_TYPE] .= substr($data, $p, $this->Elements[NET_DIME_TYPE_LEN] - $have); $this->_haveType = strlen($this->Elements[NET_DIME_TYPE]) == $this->Elements[NET_DIME_TYPE_LEN]; if (!$this->_haveType) { return null; } $p += $this->TYPE_LENGTH - $have; } if (!$this->_haveData && $p < $datalen) { $have = strlen($this->Elements[NET_DIME_DATA]); $this->Elements[NET_DIME_DATA] .= substr($data, $p, $this->Elements[NET_DIME_DATA_LEN] - $have); $this->_haveData = strlen($this->Elements[NET_DIME_DATA]) == $this->Elements[NET_DIME_DATA_LEN]; if (!$this->_haveData) { return null; } $p += $this->DATA_LENGTH - $have; } return substr($data, $p); } } /** * Net_DIME_Message enables you to manipulate and build a DIME encapsulated * message. * * @category Networking * @package Net_DIME * @author Shane Caraveo <shane@caraveo.com> * @author Ralf Hofmann <ralf.hofmann@verdisoft.com> * @author Jan Schneider <jan@horde.org> * @copyright 2002-2007 The PHP Group * @license http://www.php.net/license/3_01.txt PHP License 3.01 * @see Net_DIME_Message * @link http://pear.php.net/package/Net_DIME * @link http://www.ietf.org/internet-drafts/draft-nielsen-dime-02.txt * @example test/dime_message_test.php For example of usage. * @todo - Lots of stuff needs to be tested. * - Definitely have to go through DIME spec and make things work * right, most importantly, sec 3.3. * - Make examples, document. */ class Net_DIME_Message { var $record_size = 4096; var $parts = array(); var $currentPart = -1; var $stream = null; var $_currentRecord; var $_proc = array(); var $type; var $typestr; var $mb = 1; var $me = 0; var $cf = 0; var $id = null; var $debug = false; /** * Constructor. * * @todo Integrate with PHP streams. * * @param resource $stream A file pointer. * @param integer $record_size * @param boolean $debug */ function Net_DIME_Message($stream = null, $record_size = 4096, $debug = false) { $this->stream = $stream; $this->record_size = $record_size; $this->debug = $debug; } function _makeRecord($data, $typestr = '', $id = null, $type = NET_DIME_TYPE_UNKNOWN) { $record = new Net_DIME_Record($this->debug); if ($this->mb) { $record->setMB(); // all subsequent records are not message begin! $this->mb = 0; } if ($this->me) { $record->setME(); } if ($this->cf) { $record->setCF(); } $record->setData($data); $record->setType($typestr,$type); if ($id) { $record->setID($id); } return $record->encode(); } function startChunk($data, $typestr = '', $id = null, $type = NET_DIME_TYPE_UNKNOWN) { $this->me = 0; $this->cf = 1; $this->type = $type; $this->typestr = $typestr; if ($id) { $this->id = $id; } else { $this->id = md5(time()); } return $this->_makeRecord($data, $this->typestr, $this->id, $this->type); } function doChunk($data) { $this->me = 0; $this->cf = 1; return $this->_makeRecord($data, null, null, NET_DIME_TYPE_UNCHANGED); } function endChunk() { $this->cf = 0; $data = null; $rec = $this->_makeRecord($data, null, null, NET_DIME_TYPE_UNCHANGED); $this->id = 0; $this->cf = 0; $this->id = 0; $this->type = NET_DIME_TYPE_UNKNOWN; $this->typestr = null; return $rec; } function endMessage() { $this->me = 1; $data = null; $rec = $this->_makeRecord($data, null, null, NET_DIME_TYPE_NONE); $this->me = 0; $this->mb = 1; $this->id = 0; return $rec; } /** * Creates DIME records from a chunk of data and writes them to the stream * provided in the constructor. * * @param string $data * @param string $typestr * @param string $id * @param integer $type One of the NET_DIME_TYPE_* constants. */ function sendData($data, $typestr='', $id = null, $type = NET_DIME_TYPE_UNKNOWN) { $len = strlen($data); if ($len > $this->record_size) { $chunk = substr($data, 0, $this->record_size); $p = $this->record_size; $rec = $this->startChunk($chunk, $typestr, $id, $type); fwrite($this->stream, $rec); while ($p < $len) { $chunk = substr($data, $p, $this->record_size); $p += $this->record_size; $rec = $this->doChunk($chunk); fwrite($this->stream, $rec); } $rec = $this->endChunk(); fwrite($this->stream, $rec); return; } $rec = $this->_makeRecord($data, $typestr, $id, $type); fwrite($this->stream, $rec); } function sendEndMessage() { $rec = $this->endMessage(); fwrite($this->stream, $rec); } /** * Reads a file, creates records and writes them to the stream provided in * the constructor. * * @param string $filename A file name. * @param string $typestr * @param string $id * @param integer $type One of the NET_DIME_TYPE_* constants. */ function sendFile($filename, $typestr='', $id = null, $type = NET_DIME_TYPE_UNKNOWN) { $f = fopen($filename, 'rb'); if ($f) { if ($data = fread($f, $this->record_size)) { $this->startChunk($data, $typestr, $id, $type); } while ($data = fread($f, $this->record_size)) { $this->doChunk($data, $typestr, $id, $type); } $this->endChunk(); fclose($f); } } /** * Encodes data in DIME. * * @param string $data * @param string $typestr * @param string $id * @param integer $type One of the NET_DIME_TYPE_* constants. */ function encodeData($data, $typestr = '', $id = null, $type = NET_DIME_TYPE_UNKNOWN) { $len = strlen($data); $resp = ''; if ($len > $this->record_size) { $chunk = substr($data, 0, $this->record_size); $p = $this->record_size; $resp .= $this->startChunk($chunk, $typestr, $id, $type); while ($p < $len) { $chunk = substr($data, $p, $this->record_size); $p += $this->record_size; $resp .= $this->doChunk($chunk); } $resp .= $this->endChunk(); } else { $resp .= $this->_makeRecord($data, $typestr, $id, $type); } return $resp; } /** * Reads a file, creates records and writes them to the stream provided in * the constructor. * */ function encodeFile($filename, $typestr = '', $id = null, $type = NET_DIME_TYPE_UNKNOWN) { $f = fopen($filename, 'rb'); if ($f) { if ($data = fread($f, $this->record_size)) { $resp = $this->startChunk($data, $typestr, $id, $type); } while ($data = fread($f, $this->record_size)) { $resp = $this->doChunk($data, $typestr, $id, $type); } $resp = $this->endChunk(); fclose($f); } return $resp; } /** * Creates Net_DIME_Records from provided data. */ function _processData($data) { $leftover = null; if (!$this->_currentRecord) { $this->_currentRecord = new Net_DIME_Record($this->debug); $data = $this->_currentRecord->decode($data); } else { $data = $this->_currentRecord->addData($data); } if ($this->_currentRecord->_haveData) { if (count($this->parts) == 0 && !$this->_currentRecord->isStart()) { return PEAR::raiseError('First Message is not a DIME begin record!'); } if ($this->_currentRecord->isEnd() && $this->_currentRecord->getDataLength() == 0) { return; } if ($this->currentPart < 0 && !$this->_currentRecord->isChunk()) { $this->parts[] = array(); $this->currentPart = count($this->parts) - 1; $this->parts[$this->currentPart]['id'] = $this->_currentRecord->getID(); $this->parts[$this->currentPart]['type'] = $this->_currentRecord->getType(); $this->parts[$this->currentPart]['data'] = $this->_currentRecord->getData(); $this->currentPart = -1; } else { if ($this->currentPart < 0) { $this->parts[] = array(); $this->currentPart = count($this->parts) - 1; $this->parts[$this->currentPart]['id'] = $this->_currentRecord->getID(); $this->parts[$this->currentPart]['type'] = $this->_currentRecord->getType(); $this->parts[$this->currentPart]['data'] = $this->_currentRecord->getData(); } else { $this->parts[$this->currentPart]['data'] .= $this->_currentRecord->getData(); if (!$this->_currentRecord->isChunk()) { // We reached the end of the chunk. $this->currentPart = -1; } } } if (!$this->_currentRecord->isEnd()) { $this->_currentRecord = null; } } return; } /** * Decodes a DIME encode string of data. */ function decodeData($data) { while (strlen($data) >= NET_DIME_RECORD_HEADER) { $err = $this->_processData($data); if (PEAR::isError($err)) { return $err; } } } /** * Reads the stream and creates an array of records. * * The method can accept the start of a previously read buffer. This is * useful in situations where you need to read headers before discovering * that the data is DIME encoded, such as in the case of reading an HTTP * response. */ function read($buf = null) { while ($data = fread($this->stream, 8192)) { if ($buf) { $data = $buf . $data; $buf = null; } if ($this->debug) { echo 'read: ' . strlen($data) . " bytes\n"; } $err = $this->decodeData($data); if (PEAR::isError($err)) { return $err; } // Store any leftover data to be used again. // Should be < NET_DIME_RECORD_HEADER bytes. $buf = $data; } if (!$this->_currentRecord || !$this->_currentRecord->isEnd()) { return PEAR::raiseError('reached stream end without end record'); } } }
© 2017 -
ZeroByte.ID
.