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åã ãåºãã¦è¿éè¡ã£ãã»ããããå¾ãããªãã§ãããããã©ã¤ã»ã³ã¹ã®æå¹æéããããã¨ã ãã