PHPã§HTTPã®ä¸¦è¡ãã¦ã³ãã¼ããå®ç¾ããï¼Guzzleç·¨ï¼
PHPã§æè¿æ³¨ç®ã®HTTPã¯ã©ã¤ã¢ã³ãã©ã¤ãã©ãªã«Guzzleãããã¾ããæ¥æ¬ã§ã®ç¥å度ã¯ã¾ã ã¾ã ã¨ããå°è±¡ã§ãããããªãé«æ©è½ãã¤çé¢ç®ã«ã¡ã³ããã³ã¹ããã¦ããå°è±¡ã§ãä»å¾ã®ããã¡ã¯ãã¹ã¿ã³ãã¼ãã«ãªãããã©ã¤ãã©ãªã¨è¨ããã§ãããã
æ¬ç¨¿ã§ã¯ãã®Guzzleã使ã£ã¦Webãµã¼ããã並è¡ã«ãã¦ã³ãã¼ãããæ¹æ³ãç´¹ä»ãã¾ããWebãã©ã¦ã¶ã®ããã«åæã«è¤æ°ã³ãã¯ã·ã§ã³ã管çããªããKeep-Aliveã§ã³ãã¯ã·ã§ã³ã使ãåãã¾ãã®ã§ãä¸æãªã³ã¼ãã§å®ç¾ããããæ¥ç¶å
Webãµã¼ãã«ãåªããã¯ãã§ãã
Guzzleã®ç¹å¾´
ã¾ãã¯ãGuzzleã«ã¤ãã¦åãç¹å¾´çã ã¨æãç¹ãç´¹ä»ãã¾ãã
- ããã¨è¦ã§ããããããã¤ã³ã¿ã¼ãã§ã¼ã¹
- cURLã¯å¿ é ã§ã¯ãªããããã©ã«ãã§cURLã使ã
- ã¤ãã³ãããã¯ï¼ãªã¯ã¨ã¹ãã®åå¾ãªã©ã§ããã¯å¯è½ï¼ã®å°å ¥
- Composer対å¿
- ã¯ããã¼ãOAuthããã£ãã·ã¥ããã®ã³ã°ãªã©å¤ãã®ãã©ã°ã¤ã³ãæä¾
æ¬ ç¹ã¯å·¨å¤§ããããã¨ã¨ãããã¥ã¢ã«ã®æ¥æ¬èªè¨³ãã¾ã ç¡ããã¨ãããã§ãããã
Guzzleã®ãã¼ã¸ã§ã³
Guzzleã使ãä¸ã§ãGuzzleã®ãã¼ã¸ã§ã³ã«ã¯è¦æ³¨æã§ããGuzzleã«ã¯Guzzle 3ã¨Guzzle 4ã¨2ã¤ã®ãã¼ã¸ã§ã³ãããã¾ããåãæ©è½ã§ãGuzzle 3ã¨Guzzle 4ã¨ã§ã¡ã½ããåãå¤ãã£ã¦ãããããã®ã§ãæ¤ç´¢ã§è¦ã¤ããè¨äºãèªããããªå ´åã¯æ³¨æãã¦ãã ããã
Guzzle 3ã¨Guzzle 4ã¯ç°ãªããã¼ã ã¹ãã¼ã¹ãå©ç¨ãã¦ãã¾ãã®ã§ãã©ã¡ãã使ã£ã¦ãããã¯ä¸ç®çç¶ã§ããGuzzle 3ã®åå空éã¯ã\Guzzle\ãããå§ã¾ããGuzzle 4ã¯ã\GuzzleHttp\ãããå§ã¾ãã¾ãã
ã¾ããPackagistã§ã®ããã±ã¼ã¸åãGuzzle 3ã¯ãguzzle/guzzleããGuzzle 4+ã¯ãguzzlehttp/guzzleãã¨ãªã£ã¦ãã¾ãã®ã§ãcomposer.jsonã«æ¸ãéã注æãå¿ è¦ã§ãã
Guzzle 4ã¯ä»å¹´ã®3æã«ãªãªã¼ã¹ãããã°ããã§ãããä»ãã使ããªããã¡ãã使ã£ãæ¹ãè¯ãã§ããããæ¬ç¨¿ã§ãGuzzle 4ãå©ç¨ãã¦ãã¾ãã
並è¡ãã¦ã³ãã¼ããããµã³ãã«ã³ã¼ã
Guzzleã®ä¸è¬çãªä½¿ãæ¹ã¯ä»ã®ãã¼ã¸ãè¦ã¦é ãã¨ãã¦ãæ©é並è¡ãã¦ã³ãã¼ãã®ãµã³ãã«ã³ã¼ããç´¹ä»ãã¾ãããã®ã³ã¼ãã¯ã¸ã§ãã¬ã¼ã¿ã使ãããã£ãã®ã§PHP 5.5以éã§ããåä½ãã¾ããããGuzzle 4ã¯PHP 5.4以éã§åãã¯ãã§ãã