Symfony Meetup Kansai #1 ã«åå ãã¦ãã¾ãã
Symfony Meetup Kansai #1 ã«åå ãã¦ãã¾ããã
ä¸è¬æ ã®å¸ãã¡ãã£ã¨ã§ããããããã¨ããã°æ¸ãã¾ãæ ã§ã¨ã³ããªã¼ããã®ã§ã22æ¥ã®æ°´ææ¥ããã ãã¶ç©ºãã¦ãã¾ãã¾ãããããããããããã°æ¸ãã¾ãã
é¢è¥¿ã§ Symfony ç³»ã®ã¤ãã³ãã¯é·ãéãªãã¦ãç¡ãã¨ããã«ç«ã¡ä¸ãã£ã¦æãã®ã¹ã¿ã¼ããªã®ã§ãããååãããããã£ãã§ããä½ãã£ã¦ãåãæ¥ã«æ±äº¬ã§ã¯ Laravel ã®ãã¼ãã¢ãããéå¬ããã¦ãããã§ããããªãã¨é¢è¥¿ã®æ¹ã«æ±äº¬ããã®åå è ã!! åå¤å±ãããæ¥å¸°ãã§çè ãéããåæå±±ããã(é¢è¥¿ã®äººã§ãªãã¨ããããªãããã§ãããåæå±±ã¨ãä¸éã£ã¦å®ã¯æéã ãã§ããã°åå¤å±ããé ãã§ã)!
ã¡ã¤ã³ã»ãã·ã§ã³ã¯ãEC-CUBE ã® 4.x ã§ãã£ãã Symfony ã«ãªã£ã¦ã©ããªã£ããã¨ãã話ãAbstract ã¯éªæªãªææ(æ» ã¼ããªããã°)ã¨ãã話ã§ããã
EC-CUBE 㯠3.0 ãä½ãã¨ã Silex ã鏿ããé ãç¥ã£ã¦ããã社å åå¼·ä¼ã§ PhpStorm ã®ã話ãããã¦ããã£ãã¨ããä½ã£ã¦ã人ã®åã§ã¤ã³ã¹ãã¯ã·ã§ã³ã®é»è²ã«ããã³ãå ¥ãããµã³ãã«ã³ã¼ãã¨ãã¦ä½¿ã£ããã使ã£ã¦ãªããã©ã¡ãã£ã¨ç¸ãããã®ã§ææ ¨æ·±ãã§ãã
Symfony ã®ã·ã¼ã±ã³ã¹å³ãããã£ãã§ããä½ãã£ã¦ããã¨ãã®å¦çé åºãããã£ã¦ãªãã¨ãæ§æ YAML ã«ä½ãæ¸ãã¹ããã¡ããã¨çè§£ã§ããªãã¨æããã§ãããã¾ãã«ãã®ãå ¨å®¹ãã¡ããã¨ç¥ãã®ã«ããããªãªè³æãããªããã¨æãã¾ããã
Abstract éªæªè©±ã¯ããã£ããä½ã£ã¦ããäºæé¨å¼ã«ä»ã®è¨è¨è¦ããããªè¦æ±åºããªãã¦ããã®ããã¸ã§ã¯ã管çã®ã»ããéªæªããã? ãªã©ã¨æããªãããw æåã¯ã¢ããªã·ãã¯ã«ã§ããã¨å¤æããç®æã«ãå ´ååããå¢ããè¤éãªåé¡ãå ¥ã£ã¦ããã¨ããå·¥æ°ãã±ãã£ã¦ç¶æ¿ã«ããå·®åããã°ã©ãã³ã°ã宿ã«é¸æãããªã¨ãããã¾ã£ã¨ããªè©±ã§ãã
ã§ããã¼ã¯ã®ã¹ãã¼ãªã¼ç«ã¦ã¨ãã¦ã¯ãã¾ã£ããç¥ããªãã£ãè¦æ±ãå¾ããåºã¦æ¥ã¦ãã¿ããã«ãªã£ã¦ã¦ãã¼ããã¨ãªãã¨ããã§ãããèããããã¢ã¸ã£ã¤ã«éçºã®ã²ã¨ã¤ã®ã¿ã¹ã¯ã«ã¼ãã®ã¹ã³ã¼ãã£ã¦ããã®ã¯ããä¼å¡ç»é²ã§ãããããã¹ã¯ã¼ããããã·ã¥ã«ããããç¶æ³ã«é©ããã¡ãã»ã¼ã¸ã«ãããã¨ãã£ãåä½ãããªããã¨æã£ããã§ãããæå³çã«ãããããµãã«åºåã£ã¦æèããã
æ©è½ã®å ¨å®¹ã¯ãªãã¨ãªãäºæ³ã§ããã¨ãã¦ããã¢ã¸ã£ã¤ã«ã§ãããªããã®ã¿ã¹ã¯ã«ã¼ãã«å¯¾ãã¦ã®ã¿éä¸ãã¦å·¥æ°ãåãã¹ããããããæå³ã§ããã®ã¿ã¹ã¯ã«ã¼ãã«ãªããããªåã ã®åé¡ãã²ã¨ã¤ã²ã¨ã¤å®å®ãã¦å¦çãã¦ããããããªè¨è¨ãããæèããããæ¬å½ã¯ã¢ã¸ã£ã¤ã«ã«å¿ è¦ãªã¹ãã«ã§ããã®ã¢ã¸ã£ã¤ã«å¥¥ç¾©æ¬ãè¨ãã¢ã¸ã£ã¤ã«ã¨ããã®ã¯ãããããæå³ãªããããªãããªã¨æãã¾ããã

- ä½è : ããã¼ãã»Cã»ãã¼ãã³,Robert C. Martin,ç¬è°·åä»
- åºç社/ã¡ã¼ã«ã¼: SBã¯ãªã¨ã¤ãã£ã
- çºå£²æ¥: 2008/07/01
- ã¡ãã£ã¢: åè¡æ¬
- è³¼å ¥: 18人 ã¯ãªãã¯: 586å
- ãã®ååãå«ãããã° (64ä»¶) ãè¦ã
ä»ååå ãã¦ã¿ã¦ãå®ã¯èªåããã¡ã°ãè¯ãã£ããªã¨æã£ãã®ããLT ãéè«ã®ãªãã§åºã¦ããæè¦ã§ãSymfony ã使ã£ããããã§ãèªåã§è¨è¨ãã¦åé¡ã解決ã§ãããã¨ãã£ãé°å²æ°ã«ã¿ããªãèªç¶ã«å ±æãã¦ããããã«è¦ãããã¨ã§ãããã¬ã¼ã ã¯ã¼ã¯ã®åå¼·ä¼ã£ã¦ã©ããã¦ããããã¬ã¼ã ã¯ã¼ã¯ã®ææ³ã«æ²¿ã£ãéçºææ³ãããã¬ã¼ã ã¯ã¼ã¯ã使ã£ãããã¸ã§ã¯ãæ§æãããããæ¥åã«åã£ããã¿ããã«ãªã£ã¦ãã¾ããã¡ã§ãããããè¯ãã¨ãæªãã¨ãã§ã¯ãªãã¦ãSymfony ã使ãã¨ãèªåã®è¨è¨ãããã¨ããã¬ã¼ã ã¯ã¼ã¯åºæã®ææ³ãããããå½±é¿ããªããã¨ããããããã«ç´æ¥å½±é¿ããªããã¨ã Symfony ã®ææ³ã¨ããã...
ãå®ããç ´ããé¢ãã¨ãè¨ãã¨èªå¼ããããã§ãããã¾ãç½®ãæãã¦ããã¨ããã¬ã¼ã ã¯ã¼ã¯ãä¸å¿ã«ããããæåã«å®ãã®ããã¬ã¼ã ã¯ã¼ã¯ã§ãããã°ã£ã¦æå¾ã«èªåã®ã¢ã¼ããã¯ãã£ã«æã£ã¦ããã¤ã¡ã¼ã¸ãããã§ããã¨ããããªãèªåã§è¨è¨ã£ã¦ãããéãªããããªãã®ã¨æããããããªããã©ãã©ããªåªç§ãªäººã§ãæåã¯ãã¬ã¼ã ã¯ã¼ã¯åå¿è ãªãã ããããã¬ã¼ã ã¯ã¼ã¯ã¨ã¯é¢ä¿ãªãè¨è¨ååãå ±éèªèã¨ãã¦ããã°ã©ã ãæ¸ãã®ããå®ãã§ãã¾ãã§ãç¾å®åãããªãã¨æå³ãªãã®ã§ãã¤ã¬ã®ã¥ã©ã¼è¦ç´ ã¨ãã¦ã©ã¤ãã©ãªã®ãã¾ãä½¿ãæ¹ã¿ãããªæè¡ç解決ãããã¨ããããªããããããã®ãããåãã®ãæåã«æ¥ãªãã¦ãã£ããã¼ã§ã¯ãªãããã ãã©ãç¸ãããèªç±ã«å¦ã³ãæ´»ããã¦ããã§ãããã
ä½è¨ã£ã¦ãã ãã§ããã
ã¨ããããããªãã ããã®æ¥ã®ããªã§ãããªãã¨ã«ãªã£ã¦ã
_Ï(ï½¥_ï½¥ https://t.co/A2o4dw3Cdz
— â¯Ippei Sumida@CoderDojo Japanå ¬å¼Scratchæ¬æ¸ãã¾ãã (@ippey_s) May 22, 2019
ããã㨠LT ãã人ããªããã§ãããã¤ãã¤ãã£ã¦ç©ºæ°ã§å¼ãä¸ããã®ã¯ãã£ãæªãããèªåã LT ãã¾ãããè³æã¯ã»ãã·ã§ã³ä¸ã« Apple Pencil ã§ä½ãã¾ããã
ãªãã¨è¨å ´æã®ããã¹ã©ã¤ãã§ãããw 説æããªãã¨æå³ãããã¾ããããè¦ããã«ãåä¸ç¶æ¿ã§ããªãã§ãããã¾ããã¨å©ç¨ã§ãããã®ã¯å©ç¨ãã¦ããã¨ãããã¨ã¨ããã¹ã¦ã®ãããã¯ã·ã§ã³ã³ã¼ãã«æ£ãããæ±ããã®ã¯ãã¤ã (ããããã大ãããªæ£ããã¨ã½ããã¦ã§ã¢ã®å¤åããããã¯ç¸åãã) ã®ã§ãããã«éã¾ããããã®äººãªããããããã¨ããããå ·åã屿çã«éãè¾¼ãã¦ãããããããã¨è¨ã£ã¦ã大ä¸å¤«ã ãããã£ã¦ãã¨ã§ãã
ãã®ã¨ãããã£ã¨ã¡ããã¨ããåå¼·ä¼ã§ã¯ãã¡ã§ãããã¨è¨ã£ã¦ãã¾ã£ã¦ãã¿ã¾ãããªãã§ãããä¼ãããã£ãã®ã¯ãæ³å®ã¹ãã«ã®ãã³ããªãæ¿ããã¦èª°ãã©ããªè§£éãããããããªãã大人æ°ã«ã³ãã¡ã¬ã³ã¹ã®å ´ã§ã¯è¨ãã¾ããããã¿ãªããã®é¡ãè¦ããããããè¯ãå ´ãªã®ã§ãã¨ããæ°æã¡ã§ãã¯ããããåãéãããã¨ã«ããã£ã¨å¤§ããªã¤ãã³ãã«ãã¦ããããã§ãããã¯ãã
é·ãããã¾ãããã¾ããæã®ãã2019å¹´ã® Symfony ã³ãã¥ããã£ãããããããã©ããªã£ã¦ããã®ãããã¤ã«æ¥½ãã¿ã§ããã

ãè¶ Gitã¯ã©ã¤ã¢ã³ã PhpStormããããã«è©±ãã¦ã¿ã¾ãã
大ããªã¤ãã³ãã§ç±ãèªã£ã¦å¼ããããããªã®ã§ããã¼ã«ã«ãªåå¼·ä¼ã§ã¡ãã£ã¨ãã¢ã£ã¦ã¿ã¾ããã
ç°ç«¯çãªã¨ã¢ãé¨åããã¹ã©ã¤ãã«åºã¦ãªãã¦ããã¢ã¯ãªã¢ã«ã¿ã¤ã ã§ããã§ãã¦ãã¾ããã®ã§ããããæã人çã«ã¯ã¾ãããããããã¾ããããã¯ãã
// TODO ãã¨ã§åé¿ãæ¸ã // ç´¹ä»ãã¦ãæ©è½ãå¤ãã¦ãã¼ããããªã // ãã¼ã¸ã³ããããç©ã¾ãªãã¨masterã«å ¥ã£ãæ¥æããã°ã«æ®ããªã â æ´¾é¥åé¡
PHPer ã®ã¿ãªãããã PhpStorm ã¯æã£ã¦ã¾ããããã¦ãä»ã®è¨èªã®äººã§ã JetBrains ã® IDE ã¯ãã... ã? ããã£?! æã£ã¦ãªããã§ãã? ããããããã®ãªã³ã¯ãããå¤å¼ãä¾¡æ ¼ã§ãã¾ããè²·ããããªãã§ããã
ããã§ãããããªãã ãã®ãªã³ã¯ã辿ã£ãå ã§æ±ºæ¸ããªãã¨ãã¡ã§ããã
PHP - The Wrong Way ã¨ã¯ä½ã ã£ãã®ã
ãã㯠PHP Advent Calendar 2017 - Qiita ã®12æ¥ç®ã®è¨äºã§ãã
ããããå æãPHP - The Wrong Way ãæ¥æ¬èªã«ç¿»è¨³ãã¾ããã
è¡æã®æçµµã¯ã覧ããã ãã¾ããã§ããããã

ããã¯2017å¹´ã® Symfony Live London ã§ Laravel ãç¬ãè ã«ãã¦ããæ§å ãæãã風åºç»ã§ãã
ããã§ããã©ãã
ã§ãã©ãã§ãããããããçµµã ã¨ããã°ããè¦ãã¾ããã? ãã³ãã³ã§ã®äºä»¶ã¯ Laravel 㨠Symfony ã®éã«ããæ©æ¦ã§ãããããã¨ç¸ä¼¼ãªé¢ä¿ã¯ãã¦ã¼ã¶ã¼ã³ãã¥ããã£å ¨ä½ã¨ Laravel ã®ãããªãã®ã¨ã®éã«ãããããæ·±å»ãªç¶æ ã§æ¨ªããã£ã¦ããã®ã§ã¯ãªãã§ããããããã®ãã³ãã³ã®ãã¼ã¡ã©ã³ã¯ãèªåã®ç¿»è¨³é²æã«ããã¶ãå½±é¿ãã¾ããã
å®ãè¨ãã¨èªåã¯ããã¾ãå¤ãã®äººã« PHP - The Wrong Way ã®ç¿»è¨³ãèªãã§ãããããã¨ã¯æã£ã¦ãã¾ããããã®ç¨®ã®ä¸å¹¸ãªæ©æ¦ã®ãµã³ãã«ã¨ãã¦ãæèãè¶ ããé æ ®ãããåã¨å¨ã®ãã人ã«å±ããèãããã®ãã£ããã«ãã¦ãããããã£ãã®ã§ãã
ãããããã誰ã«ã§ãèªãã§ãããããææ¸ã¨ãã¦ã¯ããããªãã®ããã¯ããã« PHP: The Right Way ã®ã»ããæçã§ããéå°ã«è¦ããã«ãã¦ããå°ãªãã¨ã Right Way ã«ã¯æè¡çã«ã¯åã¯æ¸ããã¦ãã¾ããã
ã¨ãããã¨ã¯? ããããã®ã¨ãããWrong Way ã¯æè¡æ å ±ã¨ãã¦ãèè ã®å¦æ³ã«ãããªãåã®äºå®ãæ¸ããã¦ããã®ã§ãããããããããã®å¤§åãäºå®ã«ãã¨ã¥ããªããç¡ç¥ããã®è¨ã訳ã®ãããªãã®ã§åºæ¥ä¸ãã£ã¦ãã¾ãã
è±æã§ãã®ããã¥ã¡ã³ããæåã«èªãã æç¹ã§æã£ãã®ã¯ãæ¥æ¬ã§è¨ããããããã¨ã ã®ã¹ã¿ã¤ã«ã«è¿ãã¨ãããã¨ã§ãããã¾ã ã³ã¢ãã£ãã£åãã¦ããªããã©ãã¤ã ã«é¢ãã¦ãé¨åçè§£ (æ²è§£?) ããæ³åãè¨ãã¾ãããªã¬ãªã¬çè«ãèªãã¯ãããã¢ã¬ã§ãã(ã©ããã®ãµã¤ãã§ã¯ã¢ã«ã¦ã³ããã¨æ¹æ®ºãããã»ã©ã®å¤§ç½ªã¨ããã¦ãã¾ãã)
ã¨ã¯ãããå¤è¨èªã«ç¿»è¨³ãã㦠GitHub ã§ã¡ã³ãããã¦ãããã ãããã®ããã«ãã¡ã¤ã³åã¾ã§åã£ããã ãããä½ãã²ã¨ã¤ãããå¾ããã®ãããã«ã¡ãããªããã¨ããã®ã翻訳ã®ããããã®åæ©ã§ãããããã§ãä½ãå¾ããããã£ã¦? ãããããæå³ãæå¾ 以ä¸ã®ãã®ãå¾ããã¾ããããããã¯ä½ãã¨ããã®ã¯ã¡ãã£ã¨å¾ã«ãã¦ãã¾ãã¯ãã£ã¡ãæ¹å¤ããªããã°ãªãã¾ããã
ãã®ã¦ã§ããµã¤ãã¯ãPHP ããã°ã©ãã³ã°ã«é¢ããç¾å®çãªè¦è§£ã示ãããã«ä½ããã¾ãããæµè¡ãã®ãã¬ã³ããçè«ãå¦åçãªæç¤ºã§ã¯ãªããçµé¨ã¨å®è·µã®å¸°çãæ¸ãè¨ããè¦ç¹ã§ãã
ããã§ãããããã§ãã®ãçµé¨ã¨å®è·µãã¯å ·ä½çã«ã¯èª°ã®? ä½ã®? ãã¼ã¿ã¯ã©ããã?
ç¹°ãè¿ãç»å ´ãããç¾å®ã®ããç¾å ´ã§ã¯ãã¨ãã£ãè¨ãåãã§ããããããèªã¿é²ãã¦ããååã¨ãããäºä¾ã¯åºã¦ãã¾ãããè³å ã¹ãè«ã°ãããç¹°ãè¿ããã¾ããã¾ããã©ã®ãã¬ã³ãã¨å¦è¡çè«ãã©ã®ããã«ééã£ã¦ãããããã£ããã«è¨¼æããã¾ããããã¨ãã°ããã
仿¥ã®ããã°ã©ãã®å¤ãã¯ãå¥å ¨ãªããã°ã©ãã³ã°ã®åºæ¬ååãå®å ¨ã«ç¡è¦ã
ã¢ãã³ãªäººãã¡ã®ã©ã®æ¹æ³è«ããåºæ¬ååã®ä½ããã©ã®ããã«ç¡è¦ãã¦ããã®ãããªããã®ç¡è¦ãåé¡ãªã®ããã¾ã£ãããããã¾ããããããªãç¡æ¡ä»¶ã«ãæµè¡ã£ã¦ãããã®ã¯ééã£ã¦ããã¯ãã (大è¡ã¯é°è¬ã«é¨ããã¦ãã)ãã¿ãããªå°å ¥ã§ããããããã«ã«ãã§ããã
æè¡ãã¬ã³ãã®ã»ãã«ã¯ãå°ãªãã¨ããããæ¯ãã人ããã¦ãå ±éã®å顿èã®ããã¯ãã¼ã³ãããã¾ããå¦è¡è«æã¨ããã®ã¯ã客観çãªæ¨è«ã¨å®è¨¼ãã¼ã¿ãã¨ããªããç§å¦çããªã¹ã¿ã¤ã«ãå¿ è¦ã§ãããããããã誰ãããä½ãã説æãã¦ããã®ãæããã«ãªã£ã¦ãã¾ãã
çæ§çãªè°è«ã®å俵ã«ããã¦ãããããã£ã¨ãç®ã«ã¤ã䏿£ã§ãããããèè ã¯å¿åã§ãããããå¿ããã®ä¸»å¼µã§ããä¸åº¦ã§ãåãã¤ãã¨å ¨ä½ãä¿¡ç¨ãããªããªãã¾ããããæ¬å½ã«è°è«ã«éä¸ã§ããããã«ã¨å¿åã«ãã¦ããã®ã ã¨ãã¦ããããã§ã¯é广ã§ããå£ããåºã¾ãããè¨ã£ã¦ããããååãåä¹ããªãã®ã ããã¨è¨ããã¦ã仿¹ããã¾ããã
ãããããã¯ç§ã®ã¨ãã»ã¤ã§ããããã£ã¨çããèã æã£ã¦ãããã¨ã¨éãªãã§ããããã¿ãããªè©±ã§ããã°ãä¿¡ç¨ã失ããã¨ã¯ãªãã£ããã§ããããã©ã
(... ãããã¾ãããããã§ããã©ããã£ã¦æåã«æ¸ãããã? ãããããã¯æè©®ã¨ãã»ã¤ã§ããã)
Reddit ã§ PHP ã³ãã¥ããã£ãé·ãè¦ã¦ããã¨ãããJon LeMaitre ããããã®è¿ä¿¡ã¯ã主ã«ãããã£ãå 容ã®ãã¨ãç¹°ãè¿ããã¦ãã¾ãããã ãã誰ã®è©±ã ããã£ã¦ã
These people seem to work tirelessly at getting other people to follow their way of doing things.
Itâs unclear who âthese peopleâ are as the author never actually provides names or even examples of these propagations. Itâs a nebulous complaint as abstract as the very abstractions lamented by the author further into the article.
ãã®äººã¯ Laravel ã®ã¦ã¼ã¶ã¼ã¿ããã§ãããä»ã®ææå 容ããã£ã¨ããã¤ã¾ãã§ã¿ã¾ã:
- èªä½ã©ã¤ãã©ãªã®ã»ããã§ãããã¤ããã使ãã£ã¦æ±ºãã¦ããªããã§ã«ãã¬ã¼ã ã¯ã¼ã¯ããã
- Djang / Rails ã®æãç«ã¡ã«ã¤ãã¦ã¯å®å ¨ã«çè§£ãééã£ã¦ãã
- ç¡é§ã«å±¤ãç©ãã§è¤éã«ãã¦ãã¨ããã
strtotime()è¦ã¦ãåããã¨è¨ãã? - æ®éã®æ¡ä»¶ãªãã¹ã±ã¼ã«ããªãã®ã¯ãã¬ã¼ã ã¯ã¼ã¯ã®ãããããªãã¦äººæã®(ã²ãã³ã²ãã³
- PHPã¯é¢æ°åããµãã¼ããã¦ãã¾ãã£ã¦ã©ãã? ãªãã¬ã¯ãã£ãã£ã¦ãããªãã©ãã¤ã ç¥ããªããã©?
- OOP ã好ãã å«ãã ã§ Composer ã®ã¯ã©ã¹ãã¼ãã¼ä½¿ããªãæã¯ãªãã§ãããPSR-0/4 ã¯å«ã§ã©ã¤ãã©ãªã¯ä½¿ã£ã¦ãããã¨ããã¾ã©ããã³ã»ã³ã¹ã«ãã»ã©ã...
- ã»ãã¥ã¢ããã°ã©ãã³ã°ã®ãã¤ã ãã¯èªã価å¤ãã
Wrong Way ã¨ã¯éã®æå³ã§ (å½ããåããã¦) 翻訳ãè¾ãã®ã§ãã ãããé¡ããã¾ãããã¶ããã®è¿ä¿¡ã®ã»ãããã£ã½ã©ãä¸è¬çã«ã¯ä¾¡å¤ã®ããææ¸ãªã®ã§ã
ãããã«ãWrong Way ã¯è¦åºãã®ã¬ãã«ã§ã¯ãããã¨æ¸ãã¦ããã«è¦ãã¡ããã®ã§ãç¥èããªã人ãè¦ãã°ããããPHPã¯ãããªãã¨ã«ãªã£ã¦ãã®ãã人ç¥ããçå®ãè¦æãã¦ããã¨ã¯ç«æ´¾ãªãã£ã¦ãµãã«ãªããããªãã§ãããããã§ãã¡ãªäººã»ã©ãã»ããã£ã±ãæè©®ã¯PHPã®é£ä¸ã¯ããããæåã ã£ã¦è¨ã£ã¦ããããªãããããªãããªãã¸ã§ã¯ãæåããã¬ã¼ã ã¯ã¼ã¯ãæ¨æºè¦ç´ãç¡è¦ãã¦ããããããçé¢ç®ã«ãã£ã¦ãªãã¦ããã£ããã£ã¦ãã¾ãã¾ããã¡ãªã»ãã¸è¡ãã§ããã
ããèãã¦ãã ãããç¥èããã人ãæã極ãããã¨ä½å¶å´ã®æ¬ºçãç¥ã£ã¦æ»ã£ã¦ãã¦ãã¼ã¯ãã¼ãã¼ã«ãªã£ãã¨ããªãããããªç¨æãªééãã ããã«ãªãã¯ããªããããªãã§ãããçµé¨è±ããªäººã PHP ã«æè¨ãæãã¦ããã? ãããããä»ã®è¨èªæåã§å¤ãã®çµé¨ããã¦ãããªããªããããPHP ã§èµ·ãã¦ãããã¨ãå¤è§çã«çè§£ã§ããªãã¨ããããã§ããããã PHP ã®åæ©ããå®åçµé¨ããªãã¦ãä½ãä»äºã§å«ãªãã¨ããã£ããã ãªã¨ãããã¡ã¤ãªã³ã°ããã»ããè¾»è¤ãåãã¾ãã
ã ãããæ¥æ¬ã®ã¨ã³ã¸ãã¢ãå¤äººãæ¸ããã£ã¦ã ãã§ä¿¡ç¨ããããªãã§ãããã¡ãã£ã¨ããããããã¯ãã°ãwwwãããã¨ã ä¹wããæ¾å°è³ã®èãããããçãªã¯ã¦ããä»ãã¨æã£ã¦ããã
はてなブックマーク - PHP - The Wrong Way

ããã¦æã§ããããã§ãã... ãããçè§£ã示ãã¡ããããæ´¾ã®ä»£è¡¨é¸æã¨ãã¦ãããæ¥æ¬èªã§ç´¹ä»ããã¦ããã ããã¤ãããªã®ã§ããããã¡ãã¨ãã¦ã¯ãããã
Wrong Way : Always trust foreigners than your neighbors.
èªåããã¯ããã« 2 ç¹ææããã¦ãã ããã(ãã£ã¨ãããã©æ¸ããããªãã®ã§)
ã²ã¨ã¤ãã
ãã¹ã¦ã®æ±ç¨ PHP ãã¬ã¼ã ã¯ã¼ã¯ã¯ã¯ã½!
誰ãå¿ è¦ã¨ãã¦ããªãã®ã¯ãä¸è½ãªãã¬ã¼ã ã¯ã¼ã¯ã§ããã¿ããªãã¿ããªä¸è¬çãªåé¡ãæ±ãã¦ããããã§ã¯ãªããã¿ãªé常ã«ç¹æ®ãªåé¡ãæ±ã解決ãããã¨è©¦ã¿ã¦ãã¾ãã
â ã©ã¹ãã¹ã»ã©ã¼ãã
ã¡ãã£ã¨ã¾ã¦ã³ã© !
ãã®å¼ç¨ããã¬ã¼ã ã¯ã¼ã¯ãããã¯ããå¦å®ããã®ã«ä½¿ãã®ã¯ããã¾ãã«ãã©ã¹ãã¹ã«å¤±ç¤¼ãããªãã? ã?!
ããã¯ãPHP Frameworks Day 2013 ã®å ¬æ¼ã§è³ªçå¿çã®åçã®æç²ã§ãã¾ãã«ãã®è³ªåã¨åçã YouTube ã§å ¬éããã¦ãã¾ãã
åçãããªã "They all sucks" ã§ä¼å ´å¤§çç¬ã§ãããã°ãããã¤ãã¿ãã¿ã§ãããããã¦ã次ã®ããã«ç¶ãã¦ãã¾ãã
"So, while all these sucks, everyone needs a framework, while everyone doesn't need a general purpose framework. Nobody has the general problem..."
è¦æ¯ã¹ãã¨ãéã«ãã£ãä¸ç¯ããã§ããã³ããã¦ãã¾ããããã¾ãããã¶ã¯ã½ã ãã©ããã¿ããªä½ããã¬ã¼ã ã¯ã¼ã¯ã¯å¿ è¦ã¨ãã¦ãããã§ãããªãã§ãä¸è½ãã¬ã¼ã ã¯ã¼ã¯ãããªããã ãã¶æå³ãéãã¾ãããã ããããPHP Frameworks Day ã«æ¥ã¦ãã¬ã¼ã ã¯ã¼ã¯å ¨å¦å®ããã¨ããã©ãã ã空æ°èªããã®ãã£ã¦è©±ã«ãªã£ã¡ããã¾ããããããããªãã§ããã
ã©ã¹ãã¹ãè¨ãããã£ãã®ã¯ããããçéãã®äººããããããç®çã®ç°ãªããã¬ã¼ã ã¯ã¼ã¯ã¯å½¹ã«ç«ããªããã¯ã½ã£ã¦è¨ãããã®ãããããã¤ã¾ã PHP ã«ã¯æ±ç¨ã§ä¸è½ãªãã¬ã¼ã ã¯ã¼ã¯ãªãã¦ãã¼ãºã¯å®ã¯ãªãã¦ãã¿ããªããããããããªã¬ã¤ã¤ã¼ã§ PHP ã使ã£ã¦ãããã ãããã¬ã¼ã ã¯ã¼ã¯ã¯å¤æ§ã ãããã¨ã誰ããã¢ã¬ã¯ã¯ã½ã ãã£ã¡ã®ã»ããåªãã¦ããã¨è¨ã£ã¦ããã¨ãã¦ããåé¡ãå ±æãã人ãã¡ã«ã¨ã£ã¦ã¯ãä»äººã«ã¯ããããªã大äºãªä¾¡å¤è¦³ããã£ã¦ãPHP ã¯ãã®å¤æ§æ§ãæ¯ããè¨èªãªãã ã¨ããããããã¨ãããªãã§ãã?
ãã®ã¹ã¿ã³ã¹ã¯æ¬å½ã«ç´ æ´ãããããã¬ã¼ã ã¯ã¼ã¯ã®åã³ãã¥ããã£ã®é¢ä¿ã«è¯ãå½±é¿ãä¸ããã ããã¨æã£ã¦ãã¾ããåããããªãã¨ãæ¥æ¬ã® PHP ã«ã³ãã¡ã¬ã³ã¹ã§ãè¨ã£ã¦ã¾ããããããããã®ä¼å ´ã«æ¥ããã¦ããçããã¯ã¯ã¬ã¤ã¸ã¼ãªãã¨ã¨ãæãããããã¾ããããPHP7 㯠WordPress ã®ããã©ã¼ãã³ã¹åä¸ãé常ã«éè¦ãã¦ãã¾ããã¨ã
ããããæ¢æã®ãã¬ã¼ã ã¯ã¼ã¯ãå¦å®ãã¦èªä½ä¸»ç¾©ã徿¼ãããæèã§å¼ç¨ããã®ã¯ãããããã¨ãªããPHPer ã®é¢¨ä¸ã«ãç½®ãããããã£ã¦ããã§ãããã»ãã¨ã«ãä»ããã¡ãã£ã¨å¼ç¨ã®ãã¥ã¢ã³ã¹éãããããªããã¨æãç®æããã£ããã©ãã¨ã«ãããããé£ã³æãã¦ã²ã©ãã§ããã
ãã¨ãã誰ãä½ãè¨ã£ã¦ãããã¯åé¡ã§ã¯ãªããã¨å¾ãã FAQ ã§è¨ãã®ãªããæå人ã®å¼ç¨ãæãã®ã¯ãã¼ãã§ããããéãã§ããã誰ãä½ãè¨ã£ããã¯ããã®çºè¨ã®èæ¯ãé常ã«éè¦ã§ãããããã£ããèãã¦ãã©ã¹ãã¹åç»ãæã¿ã¾ãããã
ãµãã¤ãã
ããã¦ä»¥åã®ããã°ã©ãã¼ããã¬ã¼ã ã¯ã¼ã¯ A ã¾ãã¯ãã¬ã¼ã ã¯ã¼ã¯ B ã使ã£ã¦ããã人æ¥ãç¯ç´ã§ããã®ã«ã¨ãæ³£ãè¨ãè¨ãã ãã¾ãã
ããã¯ããã®ããã°ã©ãã¼ã®ã¡ã³ã¿ãªãã£ã§ã¯ããã¾ããããããªãã¨èª°ããã¾ããã
�
ãã¬ã¼ã³ PHP ã§æ¸ãããã³ã¼ãã2年以ä¸ããã¦ã©ãã«ããã¬ã¼ã ã¯ã¼ã¯åããä»¶ã§ãã¡ã³ãã¼ãã©ãã ãåã®å¤æ³¨ã«åªãã®è¨èãåãããã£ã¦è©±ããããã?
確ãã«ãæãããã³ã¼ããããããã¯ããããè¨è¨ããã¦ããªãã£ãã³ã¼ããã¾ãã¯ã¯ã©ã¤ã¢ã³ããæ¸ãç´ãã鏿ããããªãã¦ä½åº¦ãèªå·±æé·ãã¦ããã§ãããã³ã¼ããã¨ãã£ããã®ã¯åå¨ããã³ã¼ããæªããã¦ããããªãã«ã¯æã«è² ããªãã¨ãã¦ããã©ããªãã¬ã¼ã ã¯ã¼ã¯ããã®ãããªç¶æ³ãé²ãã§ããã¯ãã¾ãããããã¯ããããããã°ã©ã ã®èªç¶ãªæé·ããã»ã¹ã§ããã¨ã«ãããã©ããªç¨®é¡ã®ãã¬ã¼ã ã¯ã¼ã¯ãçµå±ã¯æçåãã¦ãã¾ãã¾ãã
æãããã¹ãã²ããã£ã³ã¼ããåå¨ãããã¨ã¯ç¢ºãã§ããã誰ãæãããã¹ãã²ããã£ã³ã¼ããæå³çã«ä½ãã¯ãã¾ãããå ´åã«ãã£ã¦ã¯çµé¨ä¸è¶³ã®çµæããããã¾ããããã¯ã©ã¤ã¢ã³ãã®ããã§éçºã®éä¸ã§ä½åº¦ã仿§ã夿´ããã¨ããã®ã¯ããã£ã¡ã ãã§ããããã®ä¸¡æ¹ã®ãããã®å ´åã§ãããã¬ã¼ã ã¯ã¼ã¯ã使ç¨ããã¨ããã§çµæã¯ã¹ãã²ããã£ã³ã¼ãã«ãªãã¾ããã¾ããã©ãã ããªãã¸ã§ã¯ãæåã®ãã©ãã¤ã ã使ç¨ããã¦ããçµæã¯ãã¯ãã¹ãã²ããã£ã³ã¼ãã«ãªãã¾ãã
ããã°ã©ãã¨ãã¦ãç§ãã¡ãã¿ãªåé¿ãããã¨ãããã®ãããªç¶æ³ã§ãããããã¯æ®éã®ãã¨ã§ããã㯠ããã°ã©ãã³ã°ã®è¸è¡ ã§ããã㯠ããã°ã©ãã§ããã㨠ãæå³ãããã®ã®ã²ã¨ã¤ãªã®ã§ã!
èªã¿ã«ããã!
ããããã翻訳åãªãã¦ç³ã訳ãªããã§ãããåæã§ããããªé°å²æ°ã§... 誤èªããããã¨ãã¦ãã®ããªã£ã¦æãã§ããããããã«ãä»äººã®ã³ã¼ããæãããã¨ãã®ç« ã¯ãã½ããã¦ã§ã¢ã»ã¨ã³ã¸ãã¢ãªã³ã°ã®å ¨é¢å¦å®ã§ãã
- çç´ã«è¨ã£ã¦ãã°ãã³ã¼ã
- è¨è¨ãªãã§ã¹ã¿ã¼ãããéçº
- 顧客ããªã©ã¤ãå·¥æ°ãå«ãã£ã¦ç§ä¼ã®ã¿ã¬å
- åå¿è ã«æ¸ããã¦ã¹ãã²ããã£å
- 顧客ãéä¸ã§ä»æ§å¤æ´ãé£çº
ããããããããããã°ã©ã ã®èªç¶ãªæé·ããã»ã¹ãã§ããããåé¿ãããã¨ããç¶æ³ãã§ã¯ãªããæ®éã®ãã¨ãã§ããããã°ã©ãã¼ã¨ã¯ã¤ã¾ãããããæå³ã®è·æ¥ãã ããã§ãããããã¨ããããã¾ããç´ æ´ããã社çã£ã·ãã§ããã
ãã¬ã¼ã ã¯ã¼ã¯ã¨ãªãã¸ã§ã¯ãæåã§ã¯ææ¸ã§ããªãã£ã¦...? ãããããããåé¡ã«å¯¾ãã¦ããã£ã¨ãææ¸ã®æãå·®ã伸ã¹ã¦ããã¦ããã®ãããã¤ãã§ããã©ãç¾ä»£ã½ããã¦ã§ã¢ãè¤éããç ´ç¶»ãããã«æ¸ãã§ããã®ã¯ããã®æ´å²ã«ãªãã¸ã§ã¯ãæåããã£ããããã§ããè¤éãã«æ ¹æ§ã¯ç¡å¹ãã¨ããå½ããåã®äººéçãªã¨ã³ã¸ãã¢ãªã³ã°ãã¤ã³ãã¯ããªãã¸ã§ã¯ãæåã¨ã¨ãã«è²ã£ãã¨èªåã¯èªèãã¦ãã¾ããã
ã¦ããã...
çç´ã«è¨ã£ã¦ãã°ãã³ã¼ã â ãªãã¸ã§ã¯ã群ããã©ã«ãã§åºåããå¥ãªãã¸ããªã«ãããªã©ãã¦ç¸äºã«ä¸å¯ä¾µã«ãã§ãçæ¹ã«æºã¾ã£ãè² åµã¯æ©ããªãã¡ã¯ã¿ãªã³ã°ã§è¿æ¸ãã¾ããããä»ã ã¨ããã°ãã³ã¼ãã«ã¯ PHPStan ã CI åãã®ãå¹ãã¾ããPhpStorm ã®é»è²ã¯ã³ãããéãã¡ãã ãã§ãã
è¨è¨ãªãã§ã¹ã¿ã¼ãããéçº â æ¸ãåã«è¨è¨ããªãã¨ãããããªãã®ã§æ©ãéãã¦ãè¨è¨ã¨ããã®ã¯ããã¥ã¡ã³ããæ¸ããã¨ãããªãã¦ãä½ããã¨ãã¦ãããã®ãä½ã§ãããã¨ããæ¦å¿µãæ±ºãããã¨ãã©ã®ããã«å®ç¾ãããã®ä»®èª¬æ¤è¨¼ã®ãã¨ã§ãããææ¨ãè²·ã£ã¦ãã¦ãªãã¨ãªãéãæã£ã¦ãããã¡ã«ç¬å°å±ã£ã½ããªã£ã¦ããããç¬ãå ¥ãããã¿ãããªãã®ãéçºã¨å¼ã¶ãªããå¹¼ç¨åå ã«ã¬ã´ã§éã°ãã¦ããã°ããã®ã§ããå°å¦çã§ãå¤ä¼ã¿ã®å·¥ä½ã¯ã¾ãè¨ç»ããããã§ãããã
顧客ããªã©ã¤ãå·¥æ°ãå«ãã£ã¦ç§ä¼ã®ã¿ã¬å â ã¿ã¬ã®æ¶è²»æéãè¦ç©ãã£ã¦ããã以ä¸ã®å¥ç´ã§ã¯äºæ ã£ã¦ãç¡ä¿è¨¼ãã¤æ°è¦ã¨åãè¦ç©ããåºæºã§è«æ±ãã¾ãããéããåéãã¦ã§ããããã©ã¤ã³ã¾ã§ã«å·¥æ°æ»åºããã»ããæå©ã¨é¡§å®¢ã«ããããããããããªãã¨ãç æ°ã«ãªãã¨ç¥ã£ã¦ããªããå³ãããã¨ã¯æããªãå»è ã¨åãã§ãè¨ãäºè¨ã£ã¦èããªãç¸æã¯ (ç®å ã®æã«è¦ãã¦ããããªãã«å®åããããªãé·ãç®ã§è¦ã¦å¾ã ãã) åã£ã¦ããããããã¡ããã©ããã§ãã
åå¿è ã«æ¸ããã¦ã¹ãã²ããã£å â ã¹ãã²ããã£ã«ãªãã»ã©åºãã¹ã³ã¼ããåå¿è ã«ä»»ããã®ãå®å ¨ã«ããã¸ã¡ã³ãã®ãã¹ã ãçµé¨è ã®æå°ãã¹ã§ãããã¾ãã¯ã誰ã®ç®ã«ãååã¨æããã¨ãã¹ãã¼ããéããåå¿è ã®æè½ãä¸å®æ°´æºã¾ã§å¼ãä¸ãã¾ãããã
顧客ãéä¸ã§ä»æ§å¤æ´ãé£çº â ã¹ãã²ããã£åããã¬ãã«ã®å¤æ´è¦æ±ãèµ·ããæç¹ã§ãããã¾ã§ã®åãããªã¼ãºãã¦åè¦ç©ãè¦ç©å·¥æ°ã¨æ¤è¨¼ã®æéããªã»ãããå½ããåãéã«ãåé¡ãªãã¤ãã¬ã¼ã·ã§ã³åããç¯å²ã®å¤æ´ã§å質ãä¸ããããã§ã¯ãããããé¨åé¨åã¸ã®è²¬ååé ã®è¨è¨ã«åé¡ãããã¾ããéª¨æ ¼ãå¤ãããªããã«å·¥äºã¯ä¸æ¢ãã ããã£ã¦å è£ ã夿´ãããå¾ããã«ã¯æ¬ é¥å»ºç¯ã
ãããã... ããããçµé¨ã¨å®è·µãã®æ£ä½ãªã®ãã¨ãã¦ã©ã¼ã¿ã¼ãã©ã¼ã«ãããªãå姿代ã§ãããããªããæ¹åãããã¨ããæ¨¡ç´¢ãªãã«ãåãå ¥ããã§ãããåãå ¥ããã¤ãã¿ãå¾ã«æ®ããªãããã«ã§ã¯ãªããå°æ¥ã®ä¸ä»£ã«ãä¸å¹¸ã®é£éãç¶ããããã¨ãããã©ãã®æ³¥è大伿¥ã®ãµã©ãªã¼ãã³ã®è©±ã§ãããã(æ³¥èã§ã大伿¥ãªããã·ãªã»ãããé¶ç´°ã®å¤§ä¼æ¥ç ã¯ç®ãå½ã¦ãããªãã§ãã)
ããããç¾å®ããããã¯ãããããªãããã©ãä½ãããªãã®ãããã ã¨ãããããè¨èª¬ã¯ãã ã£ããé»ã£ã¦ããã£ã¡ã®ããæ°åããªã¨ãããè°è«ããæ°ããªãã®ã¯ã©ã£ã¡ã§ããã£ã¦ãããã
ç¥èçãªãã¨ã¯ããããééããããããªãããç®ãã¤ã¶ã£ã¦ããããã§æ ¹æ¬çãªã¡ã³ã¿ãªãã£ã«åé¡ããã証æ ããã以ä¸ãããã ãã§ããã¢ã¦ãã
Wrong Way: PHP - Wrong Way itself
ææ ¢ãªããªãã®ã§ã²ã¨ãã¨è¨ããã¦ãããã¾ããã
ã¾ãã¯ç´ ç´ã«å¦ãã§ãã ããããªãã¸ã§ã¯ãæåã®ã»ãªãªã¼ ã®ä¸ã§ããããã±ã¼ã¸ååã«ç»å ´ãããåæ¹åä¾åãã¨ããæ¦å¿µã¯ç¹ã«éè¦ã§ããæ¢æã®ãã¬ã¼ã ã¯ã¼ã¯ã«ããå¶ç´ã¬ãã«ãä¸ããããªããä¾åã®åãã«æå¤§éã®æ³¨æãæã£ã¦ãã ãããä½ãèãã¦ããªãã¨ããã«ä¾åæ¹åãåæ¹åã«ãªã£ã¦çµåãå¯ã«ãªãã¾ããå¼ã¶å´ã¨å¼ã°ããå´ã®éã«ãä¾åé¢ä¿å転ååãæãç«ã¤ç®æããªãããè¦ã¤ããªããã°ãªãã¾ããããã¶ã¤ã³ãã¿ã¼ã³ã¨è¨ãããã©ãããããã¾ããããæ½è±¡åº¦ã®é«ãã©ã¤ãã©ãªãå ±éãã¦æã£ã¦ããæ§å¼ã¯ãã¨ã¦ãåèã«ãªãã¾ããä¾åã®åãã®è¨è¨ã«ã¯é«ãè½åãæ±ããããããã«ãè²»ç¨å¯¾å¹æã®é«ãä»äºã¨ã¯è¦ããã¾ããããªã®ã§ãããã¸ã§ã¯ãè¦æ¨¡ã大ãããªãã°ãæ°æ§ã§æ¸ãè¶³ãéçºããã«ãæ©è½ã¨å±¤ãåããã§ããã ãå¶ç´ã®å¼·ãæ¢æã®ãã¬ã¼ã ã¯ã¼ã¯ã«ä¸æ¹çã«ä¾åã§ããç®æãæãåºãã¦ãã ããã価å¤ã®é«ãããã°ã©ã ãæ¸ãããã«ãããã°ã©ã ãæ¸ããªã鏿ãããã®ã§ãã
ãªãã¸ã§ã¯ãæåããã¶ã¤ã³ãã¿ã¼ã³ããã¬ã¼ã ã¯ã¼ã¯ããèããã«ä½¿ããã®ã§ã¯ãªããããããèããææã¨ãã¦å¸¸ã«ã¹ããã¯ãã¦ããã¦ãã ãããããããã¡ã¤ã³ã¢ãã«ãè²§è¡ã«ãªããã¨ä»åã¯ãã©ã³ã¶ã¯ã·ã§ã³ã¹ã¯ãªãããé©ãã¦ãããã¨ããçããåºãã®ãªããããã¯ããã§ãã¾ãã¾ããããããæ¬å½ã®æå³ã§ã® "Not Always" ã¨ãããã¨ã§ããè¦åããããªããè¦ãªãã¦ããããå¦ã³ãããªããã¨ããã®ã¯ "Always Not" ã§ãã
ãããããç®æããªãã¸ã§ã¯ãæåã§è¨è¨ããå¿ è¦ã¯ãªããã¨ããã¹ã¦ã®é åã§ãªãã¸ã§ã¯ãæåãå½¹ã«ç«ããªãããåºå¥ã§ããªã種é¡ã®äººã¯ããããããã§ãããããããããã°ã©ãã³ã°ä»äºã®é©æ§ããªãã¨è¨ãããããã¾ãããã©ãã人éã¯ããããã¬ããªãã¯ãåºå¥ã§ããªããããã¾ãããã¨èãã¦ãã確信ç¯ããã¡ããã¦ã¦ãã¡ã§ãã
ã¯ã¼
ãã¦ããããçãããWrong Way ãèªãã§ç¬ã£ããå¼ãããã§ããããã«ãªã£ã¦ããã§ãããããããããã䏿©ã ããç§ã®è©±ã«ä»ãåã£ã¦ãããã¾ããã
ãã¾ã¿ãªããã¯ããã³ãã³ã§ Laravel ãç¬ã£ã Symfony ã¦ã¼ã¶ã¼ã¨åããã¸ã·ã§ã³ã«ãã¾ããç¬ãã°ç¬ãã»ã©ãå½¼ãã¯é ãªã«æ®»ã«ãããã®ã§ãããªããªããæ£ãããã©ããã§ã¯ãªããããæ¹æ³ã§ããã£ã! èªåã«ãã§ããããåãã¦éåæãªãæãã ã£ããã¨ããåä½é¨ãå¾ãè ã¯ããã®æè¡ãã©ã³ãã«å¼·ãã¢ã¤ãã³ãã£ãã£ãæã£ã¦è¡ããã¾ããæç¶ãåã§ãã¾ãããã人ã»ã©ã颿°åãçè§£ããã®ãå°é£ã¨ãã£ãç¾è±¡ã¨åãã§ããããã¯ä¸æè°ãªãã¨ã«ãæè¡ã®åªå£ã¨ã¯é¢ä¿ãããã¾ããã
Symfony ããè¨ãããã°ãapp() ãéãã¦æ°è»½ã«ã·ã³ã°ã«ãã³ã«ã¢ã¯ã»ã¹ã§ããã®ã¯éªéã®æ¥µã¿ã§ããæ¬æ¥ãªãã¦ãæãç«ã¤ã¤ã³ã¿ã¼ãã§ã¼ã¹ããLaravel ãæ§æãããã®ã¨ãã¦ã²ã¨ã¤ã®ããã±ã¼ã¸ã«åã¾ã£ã¦ãã¦åé¢ã§ããªãã®ããã¹ã¸ãããã¨ã¯è¨ãã¾ãããããã«ã¸ã¥ã¢ã«ã§æµ
ãããã«è¦ããããªãããããã©ã¼ãã³ã¹ã¯ Symfony ãããããªãè½ã¡ã¦ãã¾ããåçååã«å¿ å®ã¨ããæå³ã§ã¯ãã»ã© Symfony ã®ã»ããã·ã³ãã«ã§æ´ç¶ã¨ãã¦ããã®ã«ãããã§ Beautiful ã¨ãããçæ¿ãæ²ãã¦ããªããããè¨ããããåã¡ãã¨ä¸æå¿«ã«ãªãã®ããããã¾ãã
ãã£ã¨ Laravel ã®ã²ã¨ãããã§æè¡çãªè¨ã訳ãããã Wrong Way ã¨åãã§ãããã¾ãã¯ç´ ç´ã«ããªãã»ã©ããã¯ããã£ã¨ããç²¾é²ãã¾ããã¨è¿ãã¾ãããããããããããã©ã©ã¡ããããå¤ãã®äººã«ä¾¡å¤ãå±ãããããã§ããã°ãããã¦æªãä»äºã¯ãã¦ãªãã¨æããã§ãããã¾ãããã©ã³ã¹äººã¯ã¢ã¡ãªã«ãä¸æå¿«ã¨æãã®ã¯ãããã¾ãããããã¯ãããããªããããã©ãã§ããã
(ã¡ãªã¿ã«èª°ãè¨ã£ããã¨ããæèã¯ã¨ã¦ã大äºã§ãYii ã¦ã¼ã¶ã¼ã®èªåã¯ããã£ã¡ã®æ¹ãå ã«ãã±ããé£ã°ããã®ã«ã¢ã¡ãªã«ã¡ãããããã¨ããã©ã³ã¹ãããã£ã½ã©ããããã¦ããã·ã¢å´ãªãã§)
ããæ¥ãã°ãããã©ã¯è¯ãæå³ã§ã®ç¬ããåããããããªãã§ããããã®å¨ãã©ã¹ãã¹ã® "They all sucks" ã ã£ãã¨æããã§ãããã¡ãããããã«ã«ãããã£ã¦ãã£ã¦ã ãã«ãªãã¨ãæè¡ã®åªå£ãèªæèã«ç´çµãã¦ã¦ã«ãã¨ãªããã¤ã§ãè² ããèªãã¦ãã®ã¨åãã§ãããã¬ã¼ã ã¯ã¼ã¯ä½¿ã£ã¦ãªãã£ãã¨ãç°å¸¸è ã ãªãã¦èª°ãè¨ã£ã¦ãªãã®ã«ããããã種é¡ã®ã³ã³ãã¬ãã¯ã¹ãæ±ãã¦ãã¾ãã¾ããã¤ã§ããã
ããããç®ã§ãWrong Way ã®ä¸æ´¾ã«å¯¾ãã¦ä½ãã§ããããã©ã®ããã«ã¢ããã¤ã¹ã§ããããäºãã®ä¾¡å¤ã対çã«ã·ã§ã¢ãåãããããã£ã¨çå£ã«èããªãã¨ãããªãããã«æãã¾ãã
èªåã®åè¦ã§ç³ã訳ãªãã®ã§ãããPHP ã®ã³ãã¥ããã£ã£ã¦ããããå¹³åã ããã¨ããç·ãå¼ãã¨ããã®ç·ãã大ããå¤ãã 2 ã¤ã®ã¯ã©ã¹ã¿ãå½¢æãããæããããã¾ããããã«æè½/ç¡è½ã¨ãã話ã§ã¯ãªãã¦ããã¨ãã°ããççºçãããã®èªç¤¾ãµã¼ãã¹ã§åã人ãã¡ãã¨ãå¤éä¸è«ãã®åºè¾ºã§ã¹ã¼ãã¼ç«æ¶ããã人ãã¡ãã ã¨ãããããããã¦ã¼ã¹ã±ã¼ã¹ãã¡ããã¡ãå¤ãè¤åã·ã¹ãã ã§ã»ãã¥ã¢ã³ã¼ãã£ã³ã°ãç¯æ£ãã¦ããããã¬ã¼ã ã¯ã¼ã¯ãéè¦ãã¨ããã¬ã¼ã ã¯ã¼ã¯ã使ã£ã¦ã·ã³ã°ã«ãµã¤ããå¯çµåã§éããã¼ã³ãã§ããªãã¨ç«¶äºåã失ããã®å¯¾ç«ãã ã¨ãã
対ç«ããã¯ã©ã¹ã¿ã¯ãäºãã«ç¸æã¯ã©ã¹ã¿ã®åºè¾ºãè¦ã¦ãããã¤ãã¯ãã«ã ãã¨è¨ã£ã¦èªåãæ °ãããã§ããããããããããæ¬å½ã«å®åçãªçç±ã§ Laravel ãé¸ãã 人ããç¨ããªãã®ã« Symfony ãåãã¨ã¤ãã£ã¦ä½¿ãåå¿è ãè¦ã¦ãããã¨æãããããã¾ãããããããããããªã¼ã«ã¤ã³ã¯ã³ãªãã¬ã¼ã ã¯ã¼ã¯ã«æ¯ãåãããåå¿è ãè¦ã¦ãZend 1 ã®é ããå¿ è¦æå°éã®ã©ã¤ãã©ãªãå ¥ãæ¿ãã¦ã¯ä»£è¬ãã¦ããã·ã¹ãã ã®ããã©ã³ã¯ãä»ã¯ã©ã¤ãã©ãªè±å¯ã«ããããã¡ãã£ã¨è½ã¡çãã¦èªåã§çµãã§ã¿ãç·´ç¿ããã¦ããã§ãé ããªãããã¨æãã¦ããããããã¾ããããããªé¢ä¿ãªãã ããããããã絶対çãªåªå£ããããã¤ãã¯ç¥ç§ä¸»ç¾©è ã ã¨ç¸æãå¦å®ããåæ©ããªããã§ãããã(PHP 㨠PHP ãæ¶æãã人ã®ä½¿ãè¨èªã®é¢ä¿ãããã£ã¨ããã ã£ãã§ãã?)
ã ããããæ¯ãã©ã· (=PHP) ã®ä½¿ãæ¹ã§ã±ã³ã«ãããªãã¦ããã¾ãã夫婦ããã£ã¦ãã¨ã§ããããã¾ã«ã¯ç¸æã®æ°æã¡ã«å åããã¦ãä½ããµãã©ã¤ãºãã¬ã¼ã³ãã§ãè²·ã£ã¦ããã¾ãããã
ããããããã°ã ãã¶ Pinoco ãã»ã£ããããã«ãã¦ãã£ã...
ãã¬ã¼ã ã¯ã¼ã¯ã«ããå¶ç´ã¨ãªãã¸ã§ã¯ãæåã®å¦ç¿ã³ã¹ãã«å¯¾å¦ããã«ã¯ãã§ããªãã§ããªãã¨æã£ãããããããããããããªãã¦ããã¨ãã°ããªãã¸ã§ã¯ãæåãé§ä½¿ãã¦ãªãã¸ã§ã¯ãæåã®è¦ããªããã¬ã¼ã ã¯ã¼ã¯ãä½ã£ã¦ããã¨ããã¢ããã¼ããããã¾ãããã
Right Way: As a programmer, create, share and act before rant.
以ä¸ãæå¾ 以ä¸ã®ãã®ãè¦ã¤ãã¦ãã¾ã£ãã¨ãããã¨ã ã§ããããããã¯ã¦ãªããã°! ã¤ã¨ã¼!
PhpStorm ã¦ã¼ã¶ã¼ã®ããã® IntelliJ IDEA ãã³ãºãªã³ ã®ããã
ãIntelliJ IDEA ãã³ãºãªã³ããç®æ¬ããã ãã¾ãããèè ã§ãããJetBrains 代çåºãµã ã©ã¤ãºã ã®ä»£è¡¨ã§ãããå±±æ¬ç¥ä»ããããããã¨ããããã¾ãã

http://amzn.asia/0ELFU8Qamzn.asia
JetBrains ã® IDE 製åã¯å¤§å¥½ç©ã§ãæ®æ®µããã¨ã¦ããä¸è©±ã«ãªã£ã¦ãã¾ããã¨ãããã¨ã§ããã£ããèªã¾ãã¦ãããã¾ããã
èªã¿å§ãã¦çã£å ã«æã£ãã®ã¯ããã PHPer ã§ãè²·ã£ã¦å ¨ç¶æãªããªãã§ãã
ç¾å¨ã® PHP ã¯ãææ³çã«ããæè¡æåçã«ããé常㫠Java ã«ä¼¼ãè¨èªã¨ãªãã¾ããããªã®ã§ãJava ãä¸å¿ã«è§£èª¬ããã¦ããæ¬ã ã¨ã¯ããããã®è§£èª¬ã®åå以ä¸ã¯ PHP 㨠PhpStorm ã§ãæ´»ãããå 容ã ã¨æãã¾ããã
æ¬æ¸ã¯äºé¨æ§æã«ãªã£ã¦ãã¦ã第ä¸é¨ã¯ãããªæã...
- HTMLã¨CSSã¨JavaScriptã®è¨è¿°ãéãã¦æä½æãç·´ç¿
- æãã¤ããããæçã®ãã¼ã¹ããã¼ã¯ã§ã¨ãã£ã¿æä½ãã¯ã©ã¹å®è£
- xUnitç³»åä½ãã¹ãã¨ãã®å®è¡ + ãããã¬ã®æä½
- Gitããã¼ã¹ã«ãã¼ã¸ã§ã³ç®¡çæ©è½ã®èª¬æ
- DBã®GUIããã³ãã¨ã³ãã®èª¬æ
ã©ãã§ãããã® Java æã®ãªããã©ã®è¨èªã§ã§ãå¿ç¨ã§ãã¾ããããã¨ãã« PHP ã¯ãJava ã«ä¼¼ã¦ãããããã§ãããç¡é§ããªãæãã
ã§ããã®èª¿åã§æ¸ããã第ä¸é¨ããå ¨ãã¼ã¸æ§æã®ã ããã 65% ãé£ã£ã¦ãã¾ããæ®ãã® 35% ã第äºé¨ããã£ã¡ã¯ãã㨠IntelliJ 㨠Java ã«åºæãªå 容ã«ãªã£ã¦ããã¾ãã
ã¨ã¯ãã£ã¦ãããã㦠IntelliJ ã«ä»ã®è¨èªã®ãã©ã°ã¤ã³ãå ¥ãã¦ä½¿ã£ã¦ãã人ãªããããã¸ã§ã¯ãã¨ã¢ã¸ã¥ã¼ã«ã®æ¦å¿µããåè¨èªå°ç¨ IDE ã®æ©è½ã¨ Ultimate ç¨ãã©ã°ã¤ã³ã®é¢ä¿ãææ¡ããªãã¨ãªã®ã§ãæ¬å½ã«å ¨ç·¨ Java åºæ (ã¨ããã Java EE) ãªç« ã¯å ¨ 10 ç« ä¸ã® 1 ç« ã ãã§ããã
ããã§ãã®å¤æ®µãªããã¨ãããã¨ã§è²·ã£ã¦æã¯ãªãä¸åã§ãã©ããã
PhpStormã§ãããªããã
ã£ã¦ã¾ããããã ãå§ãã¦ãã PHP ã ã¨è©±éãããã£ã¦è¦æ åºãã¨ãããªãã®ã§ãè²·ã£ã人ã®ããã«ãPHP ã§ã®å·®åãè£è¶³ãã¾ãããã¾ã èªãã§ãªã人ã«ã¯æå³ããããããã§ãããè²·ã£ã¦ããã¾ãæ¥ã¦ãã ããã
ãã®æ¬ã®å 容ã PhpStorm ã§ãã£ã¨ãã®ã£ããã大ããã®ã¯ããMavenãGradleãã¨æ¸ãããã¨ããããComposerãã«ç½®ãæãããã¨ã¨ããJUnitãããPHPUnitãã«ãªãé¨åããããåºæ¬çãªããã¸ã§ã¯ãæ§æã§ãã
åæºå
WordPress çã® Composer ã使ããªãæåã§ãªãããããã¾ã PHP composer.json support ãã©ã°ã¤ã³ãã¤ã³ã¹ãã¼ã«ãã¦ããã¾ããããPlugins Browse repositories... ãã composer ã§æ¤ç´¢ãã¾ãã

ããã¸ã§ã¯ã使

æ°è¦ããã¸ã§ã¯ã使ã§ã¯ãCLI Interpreter ãæå®ãã¾ããåãã¦PhpStormãèµ·åããã¨ãã¯ãããã«é¸æãããã®ããªãã¨æãã¾ããã¨ãªãã® ... ãã¿ã³ãããèªåã® PHP ã®ã¤ã³ã¹ãã¼ã«ãã¹ãå®ç¾©ããã¦ã£ã³ãã¦ã§å°ãªãã¨ãã²ã¨ã¤ã®ã¤ã³ã¹ãã¼ã«å
ãæå®ãã¦ãã ããã

空ã®ããã¸ã§ã¯ããã§ããã Terminal ã Option + F12 ã§éãã¾ããããã¯ãOSæ¨æºã®ã³ãã³ãã©ã¤ã³ã·ã§ã«ã¨åãã§ããPHP 㯠Java ããã CLI ã«è§¦ããæ©ä¼ãå¤ãã®ã§ããã²æ´»ç¨ãã¦ãã ããã

Composer ã使ã£ã¦ PHPUnit ã使ããããã«ãã¾ããããããã¨ããã£ã¨ããæè»½ã«
composer.json ãã¡ã¤ã«ã¨ PHPUnit ãæºåã§ãã¾ãã

åºæ¥ä¸ãã£ã composer.json ãéãã¦ãautoload ã追å ãã¾ããå
ã«ã¤ã³ã¹ãã¼ã«ãããã©ã°ã¤ã³ã®ãããã§ãComposer ã®ãã¼ã¯ã¼ããè£å®ã§ããããã«ãªã£ã¦ãã¾ãã
"autoload": {
"psr-4": {
"Acme\\FizzBuzz\\": "src"
}
},
"autoload-dev": {
"psr-4": {
"Acme\\FizzBuzz\\": "tests"
}
},

ãã¾ãåãã¦ãããã°ãã¤ã³ãã³ã·ã§ã³ã¢ã¯ã·ã§ã³ (è±é»ç / Option + ENTER) ãããsrc 㨠tests ã®ãã©ã«ãã使ãããã¨ãã§ãã¾ãã
ããã§ãã£ããããã¸ã§ã¯ããéãã¦ãå度éãã¾ãã
ããã¸ã§ã¯ãè¨å®
æ¬å½ã¯ãåèµ·åããã«ããã¸ã§ã¯ãè¨å®ãç¶ãããã¨ã¯ã§ããã®ã§ãããããã¦ãPhpStormã®ããããªãã®composer.json ãããããã¸ã§ã¯ããªããéãããããã«èªåè¨å®ãã¦ããããæ©è½ãçºåããã¦ã¿ã¾ãã

éãã¨ãããªã¡ãã»ã¼ã¸ã表示ãããã®ã§ããããã Initialize ãã¯ãªãã¯ãã¾ãã

Synchronize IDE Settings with composer.json ã«ãã§ãã¯ãOKãã¾ããããã¨...

ã¾ãä½ãåæã«åä½ãããããªã¡ãã»ã¼ã¸ããããã¯ãcomposer.json ã® autoload ã®åå空éã¨ãã£ã¬ã¯ããªã対å¿ä»ãããPHPUnitã®è¨å®ãæ¸ã¾ãããã¨ããæå³ã§ãã

ãããã¢ããã§æä½ãã Composer ã®è¨å®ã¯ããã«ããã¾ãã

ãã£ã¬ã¯ããªè¨å®ã¯ããã§ããã½ã¼ã¹ã¨ãã¹ãã«èªåã§ååãªè¨å®ãè¡ããã¦ãã¾ãã

PHPUnit ã¯ããã§ããComposer ã§ã¤ã³ã¹ãã¼ã«ãããã®ãèªåçã«èªèãã¦ãã¾ãã
ãéãç´ãã¦ãã¤ã¢ãã°ã§OKããã ããã§ãåæã«ããããã§ãã¦ãã¾ãã¾ããã便å©ã§ãããä½ãèµ·ãã£ã¦ããã®ãããããªããªãæããããã¾ããããããã?ãã¨æã£ããã主ã«ãã®ãããã®è¨å®ã確èªããã°ãããã¨çè§£ãã¦ãã ããã
autoload ãæ¸ãæããã®ã« composer install ãå®è¡ãã¦ããªãã£ãã®ã§ããã®ã¾ã¾ã§ã¯ã¾ã èªåã®æ¸ãã¯ã©ã¹ããã¼ãããã¾ãããPhpStorm ã«ãããã¾ããããcomposer.json ã®ã³ã³ããã¹ãã¡ãã¥ã¼ãã...


FizzBuzzå®è£

Cmd + N ã§ src ä¸ã«ã¯ã©ã¹ã使ãããã¨æãã¾ãããã¡ã¤ã«ã®ç¨®é¡ã鏿ãããããã¢ãããåºã¦ããç¶æ
ã§ãããããã« class ã®ããã«ã¿ã¤ããã¦ã¿ã¦ãã ããã

使åãå ¥åããã¨ã鏿é ç®ãçµãè¾¼ã¾ãã¾ãã
ãã®ããããã¢ãããªã¹ãããã®çªç¶ã®ã¿ã¤ãã³ã°ãã¯ãããããªç®æã§ä½¿ãã¦ä¾¿å©ãªæã§ããæè¿ä½¿ç¨ãããã¡ã¤ã« (Cmd + E) ãã¯ã©ã¹ã® Structure ãããã¢ãã (Cmd + F12) ã§ç´ æ©ãç®çã®é ç®ã«ã¢ã¯ã»ã¹ã§ãã¾ãããã¼ã¸ã§ã³ç®¡çã¡ãã¥ã¼ (Ctrl + V) ããªãã¡ã¯ã¿ãªã³ã°ã¡ãã¥ã¼ (Ctrl + T) ã§ãæå¹ã§ãã

ããã¸ã§ã¯ãè¨å®ãã§ãã¦ããã®ã§ãã¯ã©ã¹ä½æãã¤ã¢ãã°ã§ã¯ããã£ã¬ã¯ããªã¨åå空éãæ£ããåã¾ã£ã¦ãã¾ãã(ãã¾ãè¨å®ã§ãã¦ããªããã°ããã®ãã¤ã¢ãã°ã§åå空éã空ç½ã«ãªãã¾ã)

ã¯ã©ã¹ãã Cmd + Shift + T ã§ãã¹ãã使/è¡ãæ¥ã§ããã®ã¯ Java ã¨åãã§ãã

PHPUnit 6+ format ã«ãã§ãã¯ã


PHPUnit ã®ã³ã¼ãã ã¨èªèããã° Cmd + N ã« PHPUnit Test Method ã追å ããã¾ãã

ç¾å¨ã¯ test ãã¬ãã£ã¯ã¹å½¢å¼ã§ãããè¿ããã¼ã¸ã§ã³ã¢ããã§ãããã§çæãããã³ã¼ãã®éå½¢ãã«ã¹ã¿ãã¤ãºã§ããããã«ãªãã¾ãããããªãã° @test ã¢ããã¼ã·ã§ã³å½¢å¼ã®ãã¹ããå¯è½ã§ãã
ãã¹ãã®å®è¡
JUnit ã®å ´åã¯ããã¹ãã±ã¼ã¹ã®ã¡ã½ããã«ã¢ã¤ã³ã³ã表示ããã¾ãããPHPUnit ã«ã¯ç¾å¨ã¢ã¤ã³ã³è¡¨ç¤ºãããã¾ãããããããã¯ã©ã¹åãã¡ã½ããåãå³ã¯ãªãã¯ããã°ãå®è¡ããããã¹ãã ããå®è¡ãããã¨ãã§ãã¾ãã


Run 㨠Debug ã鏿ãããã¨ãã§ãã¾ãããã PHP ã« Xdebug ãã¤ã³ã¹ãã¼ã«ããã¦ããã°ãæ¬æ¸ã® Java ã®ãããã°ã¨åæ§ã«ããã¬ã¼ã¯ãã¤ã³ãããã¹ãããå®è¡ã§ãã¾ãã(ãã ã PHP ã«ã¯ãã¹ã¿ãã¯ãã¬ã¼ã ãå·»ãæ»ããããªãããæ©è½ã¯ããã¾ãã)

ã¾ããphpunit.xml ãããã°ããã®å³ã¯ãªãã¯ããç°¡åã«ããã¹ãã¹ã¤ã¼ããã¹ã¦ãå®è¡ã§ãã¾ãã

ãã¨ã㨠PHPUnit ã¯ãJUnit ã¨ç°ãªããCLI ããæã£ã¦ãã¾ãããã«ããããããããã®å®è¡çµæããã¾ã JUnit ã¨åããã㪠GUI ã§è¡¨ç¾ãã¦ããã¾ããCLI ã®åºåã¯ãã®ã¾ã¾èªããã¾ãã表示ããã¦ãããã¡ã¤ã«ãã¹ + è¡çªå·ã¯ãã¯ãªãã¯ãã¦ããããã«ç§»åãããã¨ãã§ãã¾ãã
ãã®ä»
Java ã§ã¯ psvm -> TAB ã§ãã®é¢åãªè¨è¿°ã® public static void main(...) ã¡ã½ããã使ãã¾ããããPHP ã§ã pubsf ã§ public static function () { ... } ã¨å±éã§ãã¾ããã»ããpubf ã prif ã¨ãã£ã Live Template ãæåããå®ç¾©ãã¦ããã¾ãã

__DIR__ ã使ã£ãå ´åã®ãã¡ã¤ã«ãã¹ã®è£å®ã便å©ã§ããã¾ããå®å¨ããªããã°è¦åã¨ãªããã¤ã³ãã³ã·ã§ã³ã¢ã¯ã·ã§ã³ã§å¾ãã使ããã§ãã¾ãã


Web ãµã¼ãã¼ã®ããã¥ã¡ã³ãã«ã¼ãã«ããããã£ã¬ã¯ããªã Resource Root ã¨ãã¦ããã¨ãURL ãè£å®ã§ããã¾ããå®å¨ããªãå ´åã®è¦åãæ´»ãããã¨ãã§ãã¾ãã

ãã㯠IntelliJ ãå ±éã§ããããã¼ã¸ã§ã³ç®¡çä¸ã«å¤æ´ã®ãã£ããã¡ã¤ã«ã¯ãã³ããããã¤ã¢ãã°ãåºãã¾ã§ããªããShow Diff (Cmd + D) ã§å¤§ããªã¦ã£ã³ãã¦ã«å·®å表示ããã¾ãããã¡ããããã®å³å´ãç·¨éã§ããã¨ãã£ã¿ã§ãããããåã«å人çã«ãã³ããããã¤ã¢ãã°ãåºããã«æ¸ãã®ã§æ°ã«å ¥ã£ã¦ã¦ãªã¹ã¹ã¡ã§ããã£ã¦ã ãã§ãã
æ¬ã®ç« ç«ã¦ã®ä¸ã§ã¯ç®ç«ããªãã§ããã(S)FTP ã¯ã©ã¤ã¢ã³ã㨠REST ã¯ã©ã¤ã¢ã³ãã®ç´¹ä»ããããããã§ããè¦è½ã¨ããªãã§ãã ãããPHPer ãªããã¤ããã£ã¨å½¹ã«ç«ã¡ã¾ããã
IntelliJ IDEA Ultiname ã® Java éçºè åãæ©è½ã¯ã夿®µã ãã®ãã¨ã¯ãã£ã¦ãå ¬å¼ãé常ã«å å®ãã¦ãã¾ãããPhpStorm ã¯ããµã¼ããã¼ãã£ãã©ã°ã¤ã³ãããªãæ´»èºãã¾ããåè¨èªã®ä¸ã§ãPhpStormã¯PHPã®æ¹è¨ã¿ãããªã®ã®ãã©ã°ã¤ã³ãããã£ã¨ãå¤ãããããªãã§ããããããªã®ã§ãèªåã®ãã¬ã¼ã ã¯ã¼ã¯ãéè¦ãããæè¡ãã¼ã¯ã¼ãã§ãã¾ãã¯ãã¡ã©ãã©ã°ã¤ã³ãæ¤ç´¢ãã¦ã¿ã¦ãã ããã
å·®åã§ãããã«ããã£ã¦äººã«ã¯ãå°ãå¤ãã§ãããPhpStorm 2016.3 入門動画を作りました - なんたらノート第三期ベータ ãåèã«ãªãããããã¾ãããã«ãã¼ããé åã ããããã¶ã£ã¦ã¾ãã
...ã§
ã¾ããã£ãããç·¨éãè¨å®ãããããªã«ã¹ã ã¼ãºã«ä½¿ãããã¨ã¯ãªãã§ããããã¨æ¯å試è¡é¯èª¤ã ã£ãããç¡é§ãªæä½ãã¦ããã§ãã
ããããã... ãããªã«ãã¾ããããªããã¨æã£ã¦ããæåã¯ãããã大ä¸å¤«ãã¨ã«ããæå³ããã¨ããã«ã³ã¼ããå ¥åã§ãããããã°ãããã ãã§ååã§ãã㨠IntelliJ ã¯åæã«å½¹ç«ã£ã¦ããã¦ã¦ããã¤ã®éã«ãå©ãã¦ããã¦ããã§ã
ã§ããã£ããé«ãè²·ãç©ããããªãããã¨ãã£ã2894åã ãåºãã¦è¿éè¡ã£ãã»ããããå¾ãããªãã§ãããããã©ã¤ã»ã³ã¹ã®æå¹æéããããã¨ã ãã
PhpBenchãã¼ã¸ã§ã³ã®åç §ãã³ããã¼ã¯ãæ¸ãã¦ã¿ã
ãã
ã ãã¶å¤ããªã£ã¦ãPHP7ã®äºæ ã¨ãåæ ã§ãã¦ããªãã®ããã£ã¦ãè¨æ¸¬ãç´ãã¦ã¿ãã㨅 ã§ããã®ã¨ããã¾ãã¾ GitHub - phpbench/phpbench: PHP Benchmarking framework ã使ã£ããããããæãã®ã»ãããã£ããã¨ããããã§ GitHub ã«ä¸ãã¾ããã
PhpBench ã¯ãã³ããã¼ã¯ãã¬ã¼ã ã¯ã¼ã¯ã§ããåºæ¬ãPHPUnit ã®ããã«ããã³ããã¼ã¯ç¨ã®ã¯ã©ã¹ã«åã·ããªãªã表ãã¡ã½ãããæ¸ãã°OKããã¨ã¯ CLI ãã vendor/bin/phpbench run ... ã§å¼æ°ã«ãªãã·ã§ã³ããããæå®ãã¦å®è¡ã
ãããããã£ã 1
setUp() çãªã¡ã½ãããã¢ããã¼ã·ã§ã³ã§æå®ã§ãã¾ããäºåæ¡ä»¶ã®æºåããã³ããã¼ã¯çµæã«å½±é¿ããªããããéãããã®ãããã§ãã
<?php /** * @BeforeMethods({"init"}) */ class PhpReferenceBench01Nop { protected $bigArray; public function init() { $this->bigArray = range(1, 100000); }
ä»ã«ãPHPUnit ã® @dataProvider ã®ãã㪠ParamProviders ãããã¾ãããè¤æ°ãã¿ã¼ã³ããã¨ã使ããã¾ããã
ãããããã£ã2
ã¦ã©ã¼ã ã¢ãããåå¾©åæ°ã®æå®ãå å®ãã¦ãã¾ããã
ã³ãã³ãã©ã¤ã³ã§ --rev=100 --iterations=10 ã¨ããã°ã100ååã®å¦çæéã10ã»ãããã£ãå¹³åãã¿ããã«ãæè»½ã«ããã¾ãã
ããããã ã¨ãããããã£ã¦ããã¨æµ ãããå¤ãã«ãã£ã¦å¹³ååããããªããããå価ãé«ãããä»ã¨åãåæ°ããã®ã¯ããã©ããã¨ãã£ãç¥èãæ®ããªãã®ã§ãã¡ã½ããã®ã¢ããã¼ã·ã§ã³ã§ãããã¦ãã¾ãã
<?php class PhpReferenceBench01Nop { /** * @Warmup(10) * @Revs(100) * @Iterations(10) */ public function benchNoRef() { $result = PhpReference::nopNoRef($this->bigArray); unset($result); }
@Warmup(10)= ã¡ã¢ãªæçåãã³ã¼ããã£ãã·ã¥ã®å½±é¿ãåããªãããã10åç´ æ¯ããã¦ããè¨æ¸¬ã«å ¥ã@Revs(100)= 100ååã®åè¨ã1åã¨ãã¦è©ä¾¡ãã@Iterations(10)= 10ã»ãããã£ã¦ãã®å¹³å/æé«/ææªãåã
以åã®ãã®ã¯ã100ä¸ä»¶ã®ãã¼ã¿ã§1åã§ãããä»åã¯ãã¼ã¿ã10ä¸ä»¶ã«ä¸ãããã®ä»£ãããRevsã«100ã50ãæå®ãã¦çµæãå®å®ããã¾ããããã¸ãã¯ã«å½±é¿ãããã¨ãªããå®è¡ã®ããæ¹ ãç¬ç«ãã¦èª¿æ´ã§ããã®ãå¬ããã§ããã
ãããããã£ã3
çµæè¡¨ç¤ºã®èª¿æ´ãç°¡åãDockerã使ã£ã¦7ã¨5ãåæã«ããããã£ãã®ã§ãèªåã¯PHPã®ãã¼ã¸ã§ã³ã表示ããéã«ã誤差ã®åºã«ãããã³ããªã®ã§å¹³åå®è¡æé以å¤ãé ãã¾ããããããªæã https://github.com/tanakahisateru/php-ref-bench/blob/master/phpbench.json#L4

ã¦ããã… ã·ã¼ã±ã³ã·ã£ã«ãªé åã®PHP5ã¨7ã®å·®ã夿´æã®ã³ãã¼é度ã§ç´9åãã¡ã¢ãªã§ãã£ã¨3åã§ããç¡é§ã³ãã¼ããªããªã£ã¦ããã©ãããã…åç §ã®ã»ããé ãã§ããã£ã¦è¨ããªã…
Vagrantãããã¤ãã®å ±æãã©ã«ãæ§è½æ¯è¼
Vagrant ã使ã£ã¦ä»®æ³ç°å¢ã§éçºãããããå ±æãã©ã«ã (Vagrantfile ã® synced_folder è¨å®) ãä»®æ³ãã·ã³ã®é常ã®ãã©ã«ãã«æ¯ã¹ã¦ãã®ãããé ãã¨ããåé¡ãããã¾ããããã§ãç¾å®ç㪠PHP ã®ã¢ããªã±ã¼ã·ã§ã³ (å®éã«éç¨ãã¦ããWebãµã¤ã) ã使ã£ã¦ãå®éã«å ±æãã©ã«ãã®å½±é¿ãã©ã®ããããããã¨ãã調æ»ããã¦ã¿ã¾ããã
ç·¨éããã½ã¼ã¹ã³ã¼ãã®åæãç°¡åã«ããã«ã¯ããã¯ãå ±æãã©ã«ãã使ãã®ãä¸è¬çã§ãããã夿´ãããã³ã«æåã§ãã¡ã¤ã«è»¢éããæ¹æ³ã ã¨ãé¢åãªããåæãºã¬ãå¿é ã§ããã§ãããPHP ã¯ãªã¯ã¨ã¹ãã®ãã³ã«ã½ã¼ã¹ãã¡ã¤ã«ãã¹ãã£ã³ãã¾ããã¤ã¾ããååã«éããã¡ã¤ã«ã·ã¹ãã ã«ã½ã¼ã¹ãç½®ããã¦ããªãã¨ãæ¯åãã® I/O ã®ããã«ãã£ãåãããã¨ã«ãªãã¾ãã
(ä»ã®è¨èªã©ã¤ã³ã¿ã¤ã ã ã¨ããã¡ã©ã¡ã¢ãªä¸ã«ã³ã¼ããä¹ã£ã¦ãã¾ãã¨ã以å¾ããã°ã©ã ããã¼ãããããã«ãã¡ã¤ã«ã·ã¹ãã ã«ã¢ã¯ã»ã¹ããå¿ è¦ã¯ã»ã¨ãã©ããã¾ããããã®è©±ã¯ããã¾ã§ PHP ã§ã¨ãã«å½±é¿ãå¼·ãã¨ãã話ã§ã)
èªåã¯ãã¨ãã«æèããªãã¦ãå ±æãã©ã«ããéã Parallels ãããã¤ãã使ã£ã¦ããã®ã§ãããParallels 㯠11 以éãå¹´éãµãã¹ã¯ãªãã·ã§ã³ã§è³¼å ¥ãã Pro ãã¼ã¸ã§ã³ä»¥ä¸ã§ãªãã¨ãVagrant ã使ããªã仿§ã«ãªã£ã¦ãã¾ãã¾ãããä»ã®äººã«ãè²·ã£ã¦ãããã°æ¸ãã¨ããç°¡åãªè©±ã§ã¯æ¸ã¾ãªããªã£ãã®ã§ãä»®æ³åç°å¢ã忤è¨ãããã¨æããVirtualBox ã VMware ããNFS ãä½µç¨ããå ´åãå«ãã¦æ¯è¼ãã¦ã¿ã¾ããã
æ§æ
- CPU x2
- ã¡ã¢ãª 1.5GB
- ã©ã³ã¿ã¤ã = PHP 7.0
- Web = Nginx 1.10 + php-fpm
- DB = MySQL 5.6
- ãã£ãã·ã¥ = Redis 3.2
Web ãã¬ã¼ã ã¯ã¼ã¯ã¯ Yii 2.0 ã§ããæ¬æ¥ã©ã®ãããã®æ§è½ãã¨ããã®ã¯ãã¡ããåèã«: GitHub - kenjis/php-framework-benchmark: PHP Framework Benchmark
MySQL ã¨ã® I/O ãéããªããã¥ã¼ã¯ãHTMLã®é¨åã¬ã³ããªã³ã°çµæã Redis ã«ãã£ãã·ã¥ãã¦ãã¾ããã¨ã¯ãããMySQL ã«ã¯ãããã (8 ã 20 ã¯ã¨ãª/ãã¼ã¸) ã¢ã¯ã»ã¹ãããã¾ããMySQL ã®ã¹ãã¬ã¼ã¸ã¯ VM ã®ä¸ã«ããã¾ããä»ã«ãæ°´å¹³åæ£ããã¨ã Web ãµã¼ãã¼éã§å ±æãã¹ããã¼ã¿ã¯ Redis ã«ããã¾ãããããã°çã®æåã«å½±é¿ããªããã¼ã¿ã®ã¯ä¸é¨å ±æãã©ã«ãã«æ¸ãè¾¼ãã§ãã¾ãã
çµæ
- VirtualBox 5.1.14
- VMware Fusion 8.5 + Vagrant VMware Provider (ææ)
- Parallels Pro 12 (Vagrant Provider 㯠OSS)

- Front Page = ããããã³ã³ãã³ãç³»ã®ãªã³ã¯ããã®ããã
- Nginx Single File = ã©ã®ãã¼ã¸ã§ãåç §ãã¦ããCSS
- Privacy Policy / Contact (SSL) = ãã¾ã I/O ã®ãªããã¼ã¸ãSSLã®æç¡ã§æ¯è¼ãããã
- Contents List = 主ã ã£ãã³ã³ãã³ãã®ä¸è¦§ãPagination ã§ã¹ã¯ãã¼ã«
- Contents Detail = ã¨ã¦ãè¤éãªã³ã³ãã³ã詳細ããã£ãã·ã¥ãããã°ã£ã¦ã


wrk ã§è¨æ¸¬ãåä½ã¯ç§éã¬ã¹ãã³ã¹æ°ã§ããéçãã¡ã¤ã«é ä¿¡ã ãã¯æ¡ãéãã®ã§å¥ã®ã°ã©ãã«ãã¾ããã
å®å ¨ã«äºæ³å¤ã ã£ãã®ã VMware ã®ããã©ã«ãå ±æãã©ã«ãã§ããåºæ¬æ§è½ Parallels ã¨éè²ãªãåç¨VMã¨æããããç´ ã®å ±æãã©ã«ãã®æ§è½ã¯ VirtualBox ããé ããªãã¾ãããNginx ã« CSS ãè¦æ±ãã¦ç§é30ããåºã¾ãããã¨ãã§ããªãé ãã§ããã
ãã®çµæãå ±æãã©ã«ãã NFS ã«ãã¦ãããã©ãããæ¯é çã ã¨ãããã¨ããããã¾ãããParallels 㯠NFS ã使ããã©ããã«é¢ä¿ãªãåç¨åº¦ã®æ§è½ãåºã¦ããã®ã§ãã¯ãããã Mac OS ã® API ã使ããã«ãNFS ç¸å½ã®ãã¨ããã¦ããã®ã ã¨ãããµãã«æ¨æ¸¬ã§ãã¾ãã
NFS ã使ã£ããã¿ã¼ã³ã®ä¸ã§æ¯ã¹ãã¨ããã¯ã VirtualBox ã¯ããå£ãã¾ãããã誰ã§ãç¡åã§ä½¿ãããã®ã¨ããæ±ç¨æ§ã§èããã¨ãååãªæ§è½ã«ãªã£ã¦ããã¨æãã¾ãããã¾ã CPU ã使ããªã Nginx ã®éçãã¡ã¤ã«é ä¿¡ã§ã¯å¤§ããå·®ã空ãããã¦ãã¾ãããHTMLãã¼ã¸ã®ã¬ã¹ãã³ã¹ãèããã°ãç§é1000ããããªãã§ãããã
çµè«
ã¨ããããã§ãMac ã® PHPer ãæ±ãã¦ããã®ã¯ææè£½åãªãã§ã¯ã® VM ãã¥ã¼ãã³ã°ãã§ã¯ãªããåã«å ±æãã©ã«ãã® NFS åã ã£ãã¨ããã話ã§ããã
NFS - Synced Folders - Vagrant by HashiCorp
Vagrantのshare folderが遅い時はNFSを使うといいです - Qiita
ã¨ã¯ãããMS ç³»ãã©ã¦ã¶ã§ãããã³ãã¨ã³ãã®ãã¹ãããããã¨ã¯å¤ã ããã§ãããããMac ã§ Windows ãã¹ãã¬ã¹ãªãåããããã®ã¯æºåãã¦ããã®ãè¯ãã§ãããããããã人ã¯ãããã¨åã製åã§ãµã¼ãã¼ã®ä»®æ³åã¾ã§ãã£ã¦ãã¾ã£ã¦ãããããããã¾ããããããã¯ãªãã·ã§ã³ã¨èãã¦ããã®ãç¡é£ã§ãã
Mac ã§éçºãã PHPer ã®ãã¿ã¼ã³ããããªæãã«è½ã¡çãã§ããããã
- ãµã¼ãã¼ä»®æ³å㯠VirtualBox ã ããWindows ã Parallels ãã¼ãã«ã VMware Fusion ã§
- VMware Fusion ã§ãµã¼ãã¼ã Windows ãOKã«ãã¦ããããã¼ã ã«ãã£ã¦ VirtualBox ã¨ä½¿ãåã
- ãã¼ã ã¡ã³ãã¼å ¨å¡ã Parallels Pro ã®å¹´éãµãã¹ã¯ãªãã·ã§ã³ã§çæ´»
ã¾ããPHP 以å¤ã®ãç§é1000ã¬ã¹ãã³ã¹ã®ä¸çã§ããã°ãåç¨VMã®æ§è½å½±é¿ã大ãããªãã®ã§ãã¾ãéã£ãæéã«ãªãããããã¾ãããã
PhpStorm 2016.3 ã®ä¾å¤ã¤ã³ã¹ãã¯ã·ã§ã³ã©ãããããã?
ãããªè¨äºãæ¸ãããã§ãããæ£ç´ãPhpStorm ã§ RuntimeException ã®å¾å¦çããã¾ã表ç¾ã§ããªãã¦å°ã£ã¦ãã¾ãã
Runtime ãå«ãã§ã©ããªä¾å¤ã§ããã®ã¾ã¾ã¹ãã¼ã 㨠@throws \Exception ãå¿
è¦ã£ã¦è¨ãããã主èªãã§ãããã¦ãã ã

java.lang.Exception ã§ãã£ãããããããã¯ã®ä¸ãããããã®ã¾ã¾ throw ããã¨ãã£ã¦ãthrows Exception ä»ãã£ã?
— ç°ä¸ã²ãã¦ã (@tanakahisateru) 2016å¹´12æ6æ¥
Java ã¯æ§æçã«ãä¾å¤ã®ææå¿ãããªããã¨ãæç¢ºã«ãããã®ã§ããã® catch ã«ã¯ RuntimeException ã¬ãã«ã®ãã®ããæ¥ãªãã¯ãã£ã¦ãã¨ãããããªãããããªã®ã§åããã¨ãã£ã¦ã throws Exception ãå¿ è¦ã¨ã¯è¨ãããªãã
ãããµãã thanks
横æµãããã ããªã®ã« throw ã¨æ¸ãããããã«åå¿ããã®? ã£ã¦ãã¨ã§ãtry-finally ã§æ¸ãã¦ã¿ããããããä»åº¦ã¯å°éããªãè¡ããããã¨ãèªèãã¦ãããªãããããã°?

ã©ãã try-catch ã®æ§æããã£ã¦ãããã大åè±åºããããã¨ãèªèãã¦ãããããã© IDE ãæªæçãªããã§åé¿ããããã«å®å¹åã®ããã³ã¼ãã«ä½è¨ãªãã®ãå ¥ãã®ã¯ããã(doc ã³ã¡ã³ããªãããããªããã©)

究極çã«ã¯ãããæ£è§£? ããã©ãã
phpdoc ã @ throws \Exception ã«ãªãã®ãããããããããã¦ãRuntime以åã«ææããªãã¨ãã¡ãªä¾å¤ããã£ãããã¦ãªãã¨ããLogicExceptionãåºã https://t.co/s7M6a37HBV
— ç°ä¸ã²ãã¦ã (@tanakahisateru) 2016å¹´12æ6æ¥
ãã¼ãããã£ãããããããªãã«ããããããã¨ã...


ã¡ãããããException åã® throw 㯠RuntimeException | LogicException ãæå³ããå¯è½æ§ããããã åã«ç¡è¦ãã¦æ¬²ããã@throws \Exception ãªãã¦æ¸ãã¦ããPHP ã ã¨èª°ã幸ãã«ãªããªãããã
ãã¼ã... https://youtrack.jetbrains.com/issues/WI?q=throws%20%23Bug
ã¾ããã¢ããªã±ã¼ã·ã§ã³ã¬ãã«ã§ã¯ RuntimeException ã¾ããã®ãããããå顿±ãæç¹ã§è² ãã§ãããã¯æ¨ªæçãªé¢å¿ã¨ãã¦åé¢ããã®ãæ£è§£ãªãã§ãä»ã®ãããããç¶æ³ã¯éã«é¢å¿åé¢ã®ãã£ã³ã¹ããã§ããã©ãã
