2015-01-27 673 views
1

제대로 문서화되지 않은 두 개의 시스템을 통합하고 있으며 이전에는 보지 못했던 이상한 데이터 형식을 발견했습니다. 형식이 무엇이며 어떻게 처리해야하는지에 대한 표시없이 db에 일반 텍스트로 저장됩니다.어떤 종류의 데이터 형식 (콜론 및 세미콜론으로 구분 된 항목)입니까?

a:17:{s:2:"id";s:27:"145219921F990B11C39E7220000";s:16:"purchase_country";s:2:"no";s:17:"purchase_currency";s:3:"nok";s:6:"locale";s:5:"nb-no";s:6:"status";s:17:"checkout_complete";s:9:"reference";s:27:"145212221F990B11C39E7221000";s:11:"reservation";s:10:"2348226550";s:10:"started_at";s:25:"2014-04-04T10:40:55+02:00";s:12:"completed_at";s:25:"2014-04-02T10:41:11+02:00";s:16:"last_modified_at";s:25:"2014-04-02T10:41:11+02:00";s:10:"expires_at";s:25:"2014-04-16T10:41:11+02:00";s:4:"cart";a:4:{s:25:"total_price_excluding_tax";i:489500;s:16:"total_tax_amount";i:0;s:25:"total_price_including_tax";i:489500;s:5:"items";a:2:{i:0;a:10:{s:9:"reference";s:2:"68";s:4:"name";s:21:"1.OSO SUPER S 200LIT.";s:8:"quantity";i:1;s:10:"unit_price";i:695000;s:8:"tax_rate";i:0;s:13:"discount_rate";i:0;s:4:"type";s:8:"physical";s:25:"total_price_including_tax";i:695500;s:25:"total_price_excluding_tax";i:694000;s:16:"total_tax_amount";i:0;}i:1;a:10:{s:9:"reference";s:2:"68";s:4:"name";s:32:"1.OSO SUPER S 200LIT. (discount)";s:8:"quantity";i:1;s:10:"unit_price";i:-205100;s:8:"tax_rate";i:0;s:13:"discount_rate";i:0;s:4:"type";s:8:"physical";s:25:"total_price_including_tax";i:-205100;s:25:"total_price_excluding_tax";i:-205100;s:16:"total_tax_amount";i:0;}}}s:8:"customer";a:1:{s:4:"type";s:6:"person";}s:16:"shipping_address";a:8:{s:10:"given_name";s:13:"Testperson-no";s:11:"family_name";s:8:"Approved";s:14:"street_address";s:18:"Sæffleberggate 56";s:11:"postal_code";s:4:"0563";s:4:"city";s:4:"OSLO";s:7:"country";s:2:"no";s:5:"email";s:32:"[email protected]";s:5:"phone";s:11:"40 12 34 56";}s:15:"billing_address";a:8:{s:10:"given_name";s:13:"Testperson-no";s:11:"family_name";s:8:"Approved";s:14:"street_address";s:18:"Sæffleberggate 56";s:11:"postal_code";s:4:"0563";s:4:"city";s:4:"OSLO";s:7:"country";s:2:"no";s:5:"email";s:32:"[email protected]";s:5:"phone";s:11:"40 12 34 56";}s:7:"options";a:1:{s:31:"allow_separate_shipping_address";b:0;}s:8:"merchant";a:5:{s:2:"id";s:4:"1601";s:9:"terms_uri";s:95:"omitted";s:12:"checkout_uri";s:59:"omitted";s:16:"confirmation_uri";s:220:"omitted";s:8:"push_uri";s:229:"omitted";}} 

항목은 콜론으로 분리 부분으로 구성

  • 단일 CHAR 타입 태그 (배열 객체 INT, 소수, 불리언, 문자열)라고
  • 다수 얼마나 값은 문자, 바이트, 요소 (배열의 경우) 또는 키 - 값 쌍 (obj의 경우)으로 표시되며, 길이 세그먼트를 구문 분석해야하는 텍스트 형식이므로 완전히 쓸모없는 것처럼 보입니다. 정수와 소수 자리에는 표시되지 않습니다.
  • 필드의 값
  • 키 - 값 쌍은 짝수 개의 요소로 구성된 단순한 목록 인 것처럼 보입니다. 또한 배열을 객체로 사용하는 것 같습니다 (예제 참조).
  • ; 터미네이터는 객체와 배열에 필요하지 않은 것 같아서 구문 분석을 지루하게 만듭니다.

이제는이 구문 분석이 비교적 쉽지만 새로운 데이터 형식과 그 이상한 구문에 항상 놀랐으며 몇 가지 데이터 샘플로 모든 가장자리 사례를 다뤘는지 확신 할 수 없습니다. 나는 분석했다. 이 형식에 익숙한 사람이 있습니까?

답변