æãåçŽãªããŒã¿ãéä¿¡ããããšèšããªããã°ãªããªã-æååïŒããŸããŸãªé·ããå®éã«ã¯ã»ãšãã©ãããã€ããŸãã¯10ãéåžžæ°çŸãã€ãã¯ãããŸããïŒãæŽæ°ïŒUnixã¿ã€ã ã¹ã¿ã³ããå«ãïŒãå®æ°ã®ã»ãããtrue / falseãã©ã°ã®ã¿ããå Žåã«ã¯ãæµ®åå°æ°ç¹å€ãéä¿¡ãããŸãã åºæ¬çã«ãæååãæŽæ°ãæµ®åå°æ°ç¹æ°ã®3çš®é¡ã®ããŒã¿ã«ãªããŸãã å¿ èŠã«å¿ããŠãåæããããã©ãŒã ã«èµ·å ããã³ãã³ãã³ãŒããã£ãŒã«ãã匷調衚瀺ããããšãã§ããŸãïŒã³ãã³ãã®æ°ã¯å¶éãããŠããŸããããã¡ããã·ã¹ãã ã®æé·ã«äŒŽãå¢å ããŸãïŒã ã·ãªã¢ã«åããã圢åŒã§ã¯ããã®ãããªããã±ãŒãžã¯å€ãã®ã¹ããŒã¹ãå æãããœã±ããäžã®ããŒã¿ã¯ããŒã«ã«ãã·ã³å ã§éä¿¡ãããŸãããããã¯ãŸã ãªãã·ã§ã³ã§ã¯ãããŸãã-æåã¯ã·ã¹ãã ã¯ã¯ã©ã¹ã¿ãŒã®è€æ°ã®ããŒããžã®åçãªæ¡åŒµãèš±å¯ããå¿ èŠããããŸãã
ã¡ãªã¿ã«ãPHPé åã®ä»£ããã«ããã«JSONã䜿çšããããã«èããããŸããããã«ãããä»ã®èšèªã®ãããã³ã«ãç解ããåé¡ã解決ãããŸãã ããããç§ãç解ããŠããããã«ãæååæåãç¹ã«UTFã«å€æãããŠ\ u3490ãšããŠè¡šç€ºãããããªã«æåã®ãšã³ã³ãŒãã«ã¯ãèœãšãç©ŽããããŸããããã«ãããéä¿¡ãããããŒã¿éãå€§å¹ ã«å¢å ããŸãã
ããã§ãç§ã¯ïŒããäžåºŠãããŒïŒå°æ¥ãããŸããŸãªãã©ãããã©ãŒã éã§ããåãã§ããã¢ããªã±ãŒã·ã§ã³ãµãŒãã¹éã®ããåãã®ããã®ããŸããŸãªåœ¢åŒãæ¢ãå§ãããããã¯ãŒã¯äžã§ééçã«éä¿¡ãããå¯èœãªéãã³ã³ãã¯ãã«ãªããŸããã ç§ã¯ããã»ã®ãããã³ã«ãæ¬åœã«å¥œãã§ããïŒãã¹ãã§ã¯ã2çªç®ã®å®è£ ã¯éåžžã«åªããŠããŸãïŒããããŸãã«ãéããããŠãããããã¥ã¡ã³ããã»ãšãã©ãããŸããã ã ããåºæ¬çã«ç§ã¯Facebook / Apache ThriftãšGoogle Protocol BufferãèŠã ã
Thriftã¯çŸåšéããŠãããApache Fundationã«è»¢éãããŠããŸããããã®å®è£ ã¯ããªãè€éã§ãããã«ãããæå°éã®ããã¥ã¡ã³ããšäŸïŒäžåšã¯èšããŸã§ããããŸããïŒãšãšãã«ãããã«æ¶ããŠããŸããŸããã
ããããGoogle Protocol BufferïŒä»¥éãç¥ããŠPBãšåŒã³ãŸãïŒã¯éåžžã«å¿«é©ã§èå³æ·±ãããšãããããŸããã ããããç§ã®ã¿ã¹ã¯ã¯éçºè ãæäŸããPythonãJavaã§ã¯ãªããPHPã§åœŒãšä»äºãããããšã ã£ããããå°é£ã¯ããã«å§ãŸããŸããã ãã®ãããã¯ã«é¢ããè³æã¯ãªãã®ã§ã誰ããåãããšãããªããã°ãªããªãå Žåã«åããŠãèªåã®æé ã説æããããšã«ããŸããã ãããã³ã«èªäœã«ã€ããŠã¯èª¬æããŸããããããžã§ã¯ãã®Webãµã€ãã«è¯ã玹ä»ããããŸãïŒ éçºè ã¬ã€ããªã© ïŒã
ãããã£ãŠãæåã«åã°ããã®ã¯ãPBã䜿çšããããã«è¿œå ã®ãœãããŠã§ã¢ãã€ã³ã¹ããŒã«ããããPHPã®æ¡åŒµæ©èœãã³ã³ãã€ã«ãããããå¿ èŠããªãããšã§ããã€ãŸããããŒã ãã·ã³ãšå ±æãã¹ãã£ã³ã°ã®äž¡æ¹ã§å®éšãè¡ãããšãã§ããŸãã ãããŸã§ã®ãšãããPHPã§äœæ¥ããå¯äžã®æ段ã¯pb4phpãããžã§ã¯ãã§ã ãããã¯éçºã®åæ段éã«ãããŸãïŒããŒãžã§ã³çªå·0.25ã§å€æããéçºã¯1人ã§å®è¡ããã1幎以äžåã«éå§ãããŸãããæã ã³ãããã衚瀺ãããŸãããã¢ã¯ãã£ããã£ã¯ã»ãšãã©ãããŸããïŒã ç§ãã¡ã¯ããã䜿çšããŸãããç§ã¯ããªãã®ããŒãºãçå£ã«è©äŸ¡ããããšããå§ãããŸã-ãã©ãŒãããã®åºæ¬çãªæ©èœãšäœæ/èªã¿åã/æžã蟌ã¿/ã·ãªã¢ã«åã®æäœãããªãã«ãšã£ãŠååã§ããã°ããã¹ãŠãããŸããããããé«åºŠãªæäœã¯ãµããŒããããŸããã
ããšãã°ãæãåçŽãªãªãã·ã§ã³ãæ³åããŠãã ãããããšãã°ããã¥ãŒã¹ãåä¿¡ãããµãŒãã¹ããããŸããããšãã°ãRSSãã£ãŒããããã¥ãŒã¹ãæœåºãã賌èªè ã«ãã¥ãŒã¹ãéä¿¡ãããµãŒããŒããããŸãã ãµãŒãã¹ã®1ã€ãŸãã¯äž¡æ¹ãPHPäžã«ããéã«ãäž¡æ¹ã®ãµãŒãã¹éã®ããŒã¿äº€æããããã³ã«ãããã¡ãŒãä»ããããŒã¿äº€æã«æžãããããšèããŠããŸãã äœãã©ã®ããã«è¡ãã®ã§ããïŒ
æåã«ãã¡ãã»ãŒãžåœ¢åŒã«åæããå¿ èŠããããŸãããããæãç°¡åãªãªãã·ã§ã³ã§ãããšããŸãããïŒ
message News { required int32 id = 1; optional string source = 2; optional string dsign = 3; optional string news_msg = 4; optional int32 n_timestamp = 5; } * This source code was highlighted with Source Code Highlighter .
message News { required int32 id = 1; optional string source = 2; optional string dsign = 3; optional string news_msg = 4; optional int32 n_timestamp = 5; } * This source code was highlighted with Source Code Highlighter .
message News { required int32 id = 1; optional string source = 2; optional string dsign = 3; optional string news_msg = 4; optional int32 n_timestamp = 5; } * This source code was highlighted with Source Code Highlighter .
message News { required int32 id = 1; optional string source = 2; optional string dsign = 3; optional string news_msg = 4; optional int32 n_timestamp = 5; } * This source code was highlighted with Source Code Highlighter .
message News { required int32 id = 1; optional string source = 2; optional string dsign = 3; optional string news_msg = 4; optional int32 n_timestamp = 5; } * This source code was highlighted with Source Code Highlighter .
message News { required int32 id = 1; optional string source = 2; optional string dsign = 3; optional string news_msg = 4; optional int32 n_timestamp = 5; } * This source code was highlighted with Source Code Highlighter .
message News { required int32 id = 1; optional string source = 2; optional string dsign = 3; optional string news_msg = 4; optional int32 n_timestamp = 5; } * This source code was highlighted with Source Code Highlighter .
message News { required int32 id = 1; optional string source = 2; optional string dsign = 3; optional string news_msg = 4; optional int32 n_timestamp = 5; } * This source code was highlighted with Source Code Highlighter .
message News { required int32 id = 1; optional string source = 2; optional string dsign = 3; optional string news_msg = 4; optional int32 n_timestamp = 5; } * This source code was highlighted with Source Code Highlighter .
åºæ¬ã¿ã€ãã®ã¿ã䜿çšããŠæãåçŽãªã¡ãã»ãŒãžã説æããŸããïŒåæãšå®æ°ã¯ãããŸã§ã®ãšãã䜿çšããŠããŸããïŒã åãã£ãŒã«ãã«ã¯ãã¡ãã»ãŒãžã®ãšã³ã³ãŒãã«å¿ èŠãªæ°å€ã¿ã°ãå²ãåœãŠãããŠããŸãã ã¡ãã»ãŒãžãæ£ããèªèãããªãå¯äžã®å¿ é ãã£ãŒã«ãã¯èå¥åã§ããæ®ãã®ãã£ãŒã«ãã¯ååšããªãå ŽåããããŸãã ãã¡ãããå®éã®ç¶æ³ã§ã¯ã圢åŒã¯ããè€éã§ããããã£ãŒã«ãã¿ã€ãã®éžæã¯ç°¡åã§ã¯ãããŸããããããã§ã¯ãããçç¥ããŸãã ãããã³ã«ã«é¢ããè³æã®1ã€ãèªãã§ããã©ãŒããããé »ç¹ã«å€æŽããå Žåã¯ãã¹ãŠã®ãã£ãŒã«ãããªãã·ã§ã³ãšããŠå®£èšããããšããå§ãããŸããæçµããŒãžã§ã³ã§ã®ã¿åºå¥ã§ãããããäŸã§ã¯å¿ é ãã£ãŒã«ãã1ã€ãããªããšããéçºè ã®èšèã«åºäŒããŸããã ãã©ã¡ãŒã¿ããªãå Žåãã¡ãã»ãŒãžã«ã¯å«ãŸããŸãããã€ãŸããããŒã¿ãã±ããã®ãµã€ãºãç¯çŽã§ããŸãã
æå®ããããã¡ã€ã«ã¯ã* .proto圢åŒã®ãã¬ãŒã³ããã¹ããã¡ã€ã«ãšããŠä¿åãããŸãã ããã«ãã³ã³ãã€ã©ãŒïŒããŸããŸãªãã©ãããã©ãŒã çšã«ããããããŠã³ããŒãã§ããŸãïŒã䜿çšããŠãã¡ãã»ãŒãžããã€ããªãŒåœ¢åŒãå®éã«ã¯åŸã§äœ¿çšããããã®ãã³ãã¬ãŒãã«ã³ã³ãã€ã«ããŸãã
æšæºã³ã³ãã€ã©ã¯ããµããŒããããŠããèšèªïŒJavaãC ++ãPythonïŒã®ã¡ãã»ãŒãžããªããžã§ã¯ãããŠãŒãã£ãªãã£ã¡ãœããã®ã©ãããŒãããã«çæããŸãã ããããç§ãã¡ã¯ãŸã ãªã¹ãã«èŒã£ãŠããªãPHPã§äœæ¥ããŠããŸãã
pb4phpããã±ãŒãžïŒexample / protoc.phpãã£ã¬ã¯ããªã«ãããŸãïŒã«ã¯ãPHPã«å¯ŸããŠïŒäžåšçšã§ãæ£çŽã«ïŒåãããšãè¡ãã¹ã¯ãªããããããŸã-æå®ãããprotoãã¡ã€ã«ãããŒãããã¡ãã»ãŒãžãåŠçããããã®PHPã¯ã©ã¹æ§é ãçæããŸãïŒã¯ãã PHPã³ãŒãïŒã ãã®ã³ã³ãã€ã©ã¯ãã¡ãã»ãŒãžã®ããã¹ãèšè¿°ãã€ãŸãäžèšã§äœæãã* .protoãã¡ã€ã«ãåŠçããããšã«æ³šæããŠãã ããã
ãã ããã¡ãã»ãŒãžã®ã©ãããŒã¯ã©ã¹ãæåã§çæããããšã奜ã¿ãŸãããç¹ã«ããµã³ãã«ãã¡ã€ã«èªäœã«ãšã©ãŒãèŠã€ãããŸããã ã³ã³ãã€ã©ã¯ãæååããŒã¿åãžã®ãã€ã³ã¿ã誀ã£ãŠçæããŸããPBMessage:: WIRED_STRINGå®æ°ã¯ãœãŒã¹ã«ãããŸããããã¹ãŠã®äŸã«ååšããŸãããPBMessage :: WIRED_LENGTH_DELIMITEDã«çœ®ãæããå¿ èŠããããŸãã
ã©ãããŒã¯ã©ã¹ã¯ãäžè¬çãªPBMessageã¯ã©ã¹ãç¶æ¿ããã¡ãã»ãŒãžã®ç¹å®ã®ãã£ãŒã«ãã®èª¬æãè¿œå ããŠããã£ãŒã«ãã®ã²ãã¿ãŒ/ã»ãã¿ãŒãèšå®ããŸãã ã³ãŒãããå€æãããšããããã¯éåžžã®é£æ³é åãšããŠæ ŒçŽãããã·ãªã¢ã«åäžã«ã®ã¿ãã€ããªåœ¢åŒPBã§ãšã³ã³ãŒããããŸãã
ãã®ã¯ã©ã¹ã¯éåžžã«ã·ã³ãã«ã§ãpb_news_interface.phpãã¡ã€ã«ã«ä¿åãããŸãã
*ãã®ãœãŒã¹ã³ãŒãã¯ã ãœãŒã¹ã³ãŒããã€ã©ã€ã¿ãŒã§åŒ·èª¿è¡šç€ºãããŸããã
- ã¯ã©ã¹ Newsã¯PBMessageãæ¡åŒµããŸã
- {
- var $ wired_type = PBMessage :: WIRED_LENGTH_DELIMITED;
- ãããªã㯠é¢æ° __constructïŒ$ reader = null ïŒ
- {
- 芪:: __ã³ã³ã¹ãã©ã¯ãïŒ$ãªãŒããŒïŒ;
- $ this- > fields [ "1" ] = "PBInt" ;
- $ this-> values [ "1" ] = 0;
- $ this- > fields [ "2" ] = "PBString" ;
- $ this-> values [ "2" ] = '' ;
- $ this- > fields [ "3" ] = "PBString" ;
- $ this-> values [ "3" ] = '' ;
- $ this- > fields [ "4" ] = "PBString" ;
- $ this-> values [ "4" ] = '' ;
- $ this- > fields [ "5" ] = "PBInt" ;
- $ this-> values [ "5" ] = 0;
- }
- é¢æ° IDïŒïŒ
- {
- return $ this-> _ get_valueïŒ '1' ïŒ;
- }
- é¢æ° set_idïŒ$å€ïŒ
- {
- return $ this-> _ set_valueïŒ '1' ã$ valueïŒ;
- }
- é¢æ°ãœãŒã¹ïŒïŒ
- {
- return $ this-> _ get_valueïŒ '2' ïŒ;
- }
- é¢æ° set_sourceïŒ$å€ïŒ
- {
- return $ this-> _ set_valueïŒ '2' ã$ valueïŒ;
- }
- é¢æ° dsignïŒïŒ
- {
- return $ this-> _ get_valueïŒ '3' ïŒ;
- }
- é¢æ° set_dsignïŒ$å€ïŒ
- {
- return $ this-> _ set_valueïŒ '3' ã$ valueïŒ;
- }
- é¢æ° news_msgïŒïŒ
- {
- return $ this-> _ get_valueïŒ '4' ïŒ;
- }
- é¢æ° set_news_msgïŒ$å€ïŒ
- {
- return $ this-> _ set_valueïŒ '4' ã$ valueïŒ;
- }
- é¢æ° n_timestampïŒïŒ
- {
- return $ this-> _ get_valueïŒ '5' ïŒ;
- }
- é¢æ° set_n_timestampïŒ$å€ïŒ
- {
- return $ this-> _ set_valueïŒ '5' ã$ valueïŒ;
- }
- }
ã³ã³ã¹ãã©ã¯ã¿ãŒã§ã¯ãããŒã¿åã®å®çŸ©æžã¿ã®ååã䜿çšããŠããŒã¿åœ¢åŒãèšè¿°ããŸããpb4phpã¯ãããããã¡ã€ã³ãããã³ã«ããŒã¿åã®ã¯ã©ã¹-PBIntãPBBoolïŒPBIntããç¶æ¿ïŒãPBSignedIntãPBEnumïŒåæïŒãPBStringããã³PBBytesã«ãããã³ã°ããŸãã ãã¹ãŠã®ãããã³ã«ããŒã¿åãçµã¿èŸŒã¿èšèªããŒã¿åã«çŽæ¥ãããã§ããããã§ã¯ãªãããããã®ãããªã©ãããŒãå¿ èŠã§ããããšãã°ãC ++ã®sint32 / int32ã¯åãint32åã«ããããããŸãïŒãã ããäžè¬ã«ããŒã¿åã®åé¡ã¯åçŽã§ã¯ãªãããããã³ã°ããŒãã«ææžããå®å šãªçããäžããŠããŸããïŒã pb4phpã¯ããã€ãã®åºæ¬çãªã¿ã€ãã®ã¿ãå®è£ ããŠããããããã©ãŒããããèšè¿°ããããã«æãäžè¬çãªã¿ã€ããéžæããå¿ èŠããããŸãã
ãšããã§ãã©ãããŒã³ãŒãèªäœã¯æé©ãšã¯ã»ã©é ãã§ããéæ³ã®__get / __ setã¡ãœããã䜿çšããŠãããã·ã³ãã«ã§çãã³ãŒãã«çœ®ãæããããšãã§ããŸããæããã«ãã³ãŒãã¯PHPãšOOPæ©èœã®å€ãããŒãžã§ã³ãšã®äºææ§ã®ããã«æžãããããã§ãã
ã§ã¯ãç¶ããŸãããã ããã°ã©ã ã§ãããã³ã«ã䜿çšããã«ã¯ã2ã€ã®ãŠãŒãã£ãªãã£ãã¡ã€ã«ãæ¥ç¶ããå¿ èŠããããŸããã¡ãã»ãŒãžãåŠçããã¡ã€ã³ã¯ã©ã¹ïŒ/message/pb_message.phpïŒãšãã¡ãã»ãŒãžçšã«çæãããã©ãããŒã¯ã©ã¹ïŒpb_news_interface.phpïŒã§ãã ãã®åŸãéåžžã®PHPã¯ã©ã¹ãããã«äœ¿çšããŸãã
*ãã®ãœãŒã¹ã³ãŒãã¯ã ãœãŒã¹ã³ãŒããã€ã©ã€ã¿ãŒã§åŒ·èª¿è¡šç€ºãããŸããã
- //ã¯ã©ã¹ã®ã€ã³ã¹ã¿ã³ã¹ãäœæããŸãïŒ
- $ new_news = new NewsïŒïŒ;
- //ãã£ãŒã«ãã«å ¥åããŸãïŒ
- $ new_news-> set_idïŒ1ïŒ; //èå¥åã1ã«èšå®ããŸã
- $ new_news-> set_n_timestampïŒtimeïŒïŒïŒ; //ã¿ã€ã ã¹ã¿ã³ããè¿œå ããŸã
- $ new_news-> set_news_msgïŒ 'Test News' ïŒ; //ã¡ãã»ãŒãžæ¬æ
- //æ®ãã®ãã£ãŒã«ãã«ã¯å ¥åãããããã©ã«ãå€ã§åæåãããŸã
ããã«äœæ¥ãé²ããã«ã¯ãããšãã°ãããã¯ãŒã¯ãä»ããŠããã«éä¿¡ããããã«ãã¡ãã»ãŒãžã®ã·ãªã¢ã«åãããå€ãååŸããå¿ èŠããããŸãã ãããè¡ãã«ã¯ãã¡ãã»ãŒãžãæååïŒHEXïŒã«ãšã³ã³ãŒãããçµã¿èŸŒã¿SerializeToStringã¡ãœããããããŸãã
ã¡ãªã¿ã«ãäœæè ã¯ããªããžã§ã¯ãããããã¯ãŒã¯çµç±ã§éä¿¡ããçµã¿èŸŒã¿ã¡ãœãããåŠçããŸãã-Sendã¡ãœãããåŒã³åºããŠURLãšã¡ãã»ãŒãžã®ã€ã³ã¹ã¿ã³ã¹ãæž¡ãã ãã§ãcURLãä»ããŠãã·ãªã¢ã«åãããPBã¡ãã»ãŒãžãå«ãã¡ãã»ãŒãžãã©ã¡ãŒã¿ãŒã§POSTãªã¯ãšã¹ããè¡ãããŸãã å®éã«ã¯ãçµã¿èŸŒã¿ã®ããŒã¿è»¢éã¡ã«ããºã ã䜿çšããŸããããæ©èœããã¹ãããã ãã§ãã
èå³æ·±ãå®æ°MODUSããããŸããããã¯ããã€ããªãŸãã¯æååã®ã¹ãã¬ãŒãžåœ¢åŒãæ åœããŸãã ãã€ããªã¯ãããã¯ãŒã¯ãä»ããäŒéã«ããå¹ççã§ããããã©ãã£ãã¯ãç¯çŽããŸãããã®æååã¯ãéçºè ã«ãããã¹ãããã³èªã¿åãã«äŸ¿å©ã§ãã
*ãã®ãœãŒã¹ã³ãŒãã¯ã ãœãŒã¹ã³ãŒããã€ã©ã€ã¿ãŒã§åŒ·èª¿è¡šç€ºãããŸããã
- //çµã¿èŸŒã¿ã¡ãœããã䜿çšããŠã¡ãã»ãŒãžãéä¿¡ããŸãã
- $ new_news-> SendïŒ 'http://domain.com/pb-service/server.php' ïŒ;
- //ã·ãªã¢ã«åãããæååãååŸããŸã
- $ res = $ new_news-> SerializeToStringïŒïŒ; //å¥åŠãªãã©ã¡ãŒã¿ããŸã æž¡ãããŠããŸãããçç±ã¯ããããŸãã
調æ»ãè¡ã£ãŠãã¢ããªã±ãŒã·ã§ã³ã§è¿œè·¡ãããŠããå žåçãªããŒã¿ã»ãããååŸããpb4phpããªã¢ã³ãã®PHPããã³ãããã³ã«ãããã¡ãŒã®ãã€ãã£ãã·ãªã¢ã«åãšããŒãžã§ã³ãæ¯èŒããããšããŸããã ããŒã¿ãµã€ãºã®å¢å ã¯çŽ30ïŒ ïŒéåžžã®æ¹æ³ã§ã¯186ãã€ãã«å¯ŸããŠ127ãã€ãïŒã§ããããããã¯çå£ãªç 究ã®ãµãããããã®ã§ã¯ãããŸããããå®éã®ããŒã¿ã»ããã®å¹çãæ¯èŒããã®ã¯èå³æ·±ãããšã§ããã
ãªããžã§ã¯ãã®å ã®ãã©ãŒã ã埩å ããã«ã¯ãã€ã³ã¹ã¿ã³ã¹ãäœæããŠParseFromStringã¡ãœãããåŒã³åºãã ãã§ãã
*ãã®ãœãŒã¹ã³ãŒãã¯ã ãœãŒã¹ã³ãŒããã€ã©ã€ã¿ãŒã§åŒ·èª¿è¡šç€ºãããŸããã
- $ tmp = $ new_news-> SerializeToStringïŒïŒ; //ã·ãªã¢ã«å
- $ test = new NewsïŒïŒ; //ã¡ãã»ãŒãžã®ã€ã³ã¹ã¿ã³ã¹ãäœæããŸã
- $ test-> ParseFromStringïŒ$ testïŒ; //ã¡ãã»ãŒãžã埩å ããŸã
- //ãã§ãã¯
- echo 'IDïŒ' ã $ test-> get_idïŒïŒ; //æ»ããŸãïŒIDïŒ1
ãšããã§ãã©ã€ãã©ãªã§ãµããŒããããŠããããã€ãã®é«åºŠãªPBæ©èœã«ã€ããŠã¯ããã£ã¬ã¯ããª/ examples / nested_mess /ãèŠãŠãã ãããéåžžã®ã¿ã€ãã®ãã£ãŒã«ããé€ããå éšã«å«ãŸããã¡ãã»ãŒãžã䜿çšããŠRSSããããã³ã«ãããã¡ãŒã«å€æããã ãã®äŸããããŸãããã¹ããããã¯ã©ã¹ãã
ãããŠãæçµçã«ã pb4phpã®æ©èœã䜿çšãããšã次ã®ããšãã§ããŸãã
- ãããã³ã«ãããã¡ã¡ãã»ãŒãžã®å
ã®ä»æ§ã«åŸã£ãŠãPHPã¯ã©ã¹ã©ãããŒãçæããŸãïŒæé©ãªæ§é ã§ã¯ãããŸãããïŒã
éåžžã®PHPã¯ã©ã¹ãšåæ§ã«ãã¡ãã»ãŒãžã¯ã©ã¹ã䜿çšããŠPHPã¹ã¯ãªããã§äœæ¥ãããã£ãŒã«ãã«ããŒã¿ãå ¥åããŸãã
åŸç¶ã®ãã¡ã€ã«ãžã®èšé²ãŸãã¯ãããã¯ãŒã¯çµç±ã®éä¿¡ïŒçµã¿èŸŒã¿HTTP-POSTã¡ãœãããå«ãïŒã®ããã«ãã¡ãã»ãŒãžã16é²æååã«ã·ãªã¢ã«åããŸãã éåžžãæçµã¡ãã»ãŒãžã¯éåžžã®ã·ãªã¢ã«åãããé åãŸãã¯JSONããã10ã30ïŒ å°ãªããªããŸãïŒãŸã JSONã§ãã¹ãããŠããªããã©ããã¯ããããŸããããããã ãšæããŸãïŒã
çŽååããããã¥ãŒããPHPã¯ã©ã¹ãžã®ã¡ãã»ãŒãžã埩å ããŸãã
ã¡ãã»ãŒãžã«ãã¹ããããã¡ãã»ãŒãžã ãã§ãªããåºæ¬ããŒã¿åã䜿çšã§ããŸãã
ãã¡ãããã·ãªã¢ã«åã¯ãªãœãŒã¹ãæ¶è²»ããéåžžã®ãã€ãã£ããããåžžã«é·ããªããŸãããåçŽãªã¡ãã»ãŒãžïŒè€æ°ã®ãã£ãŒã«ããããå ŽåïŒã§ã¯ã»ãšãã©èŠããŸããã äž»ãªå©ç¹ã¯ãããŒã¿éã®åæžïŒç¹ã«ããããã¯ãŒã¯ããã³å€§éã®ã¡ãã»ãŒãžãããŒã§éä¿¡ããå Žåã«éèŠïŒãããã³å®è£ èšèªãšãã©ãããã©ãŒã æ©èœã«äŸåããªããµãŒãã¹ãç°¡åã«æ§ç¯ã§ããããšã§ãã åã°ãªãå¯äžã®ããšã¯ããããžã§ã¯ãã®ã»ãšãã©åçµãããéçºïŒãããã³ã«ãããã¡ãŒèªäœã§ã¯ãªãpb4phpãæå³ããŸãïŒãšãã®äžææ§ã§ã-å€ãã®èšèªã§ã¯ãããã€ãã®å®è£ ããããŸãã PHPçšã®Cæ¡åŒµæ©èœãåããããªã¢ã³ããäœæããããšã¯èå³æ·±ãã§ããããã·ãªã¢ã«å/ãªã«ããªæäœãå€§å¹ ã«é«éåã§ããŸãããŸããZend Frameworkãªã©ã®äž»èŠãªãã¬ãŒã ã¯ãŒã¯ããã®ãµããŒããåžæããŸãã
ãã ãããã®åœ¢åŒã§ããããžã§ã¯ãã䜿çšã§ããŸããPHPã§Googleãããã³ã«ãããã¡ãŒåœ¢åŒã®ã¡ãã»ãŒãžãåŠçããæ¹æ³ããã°ããåŠç¿ããå¿ èŠãããå Žåã¯ãpb4phpã䜿çšããŠãã ããã