MAMPç°å¢æ§ç¯ã¡ã¢
諸äºæ
ã«ã¦æ¥é½PHPã§ã¨ããã¦ã§ããµã¼ãã¹ãéçºããªãã¨ãããªããªã£ãã®ã§ãç°å¢æ§ç¯ã¡ã¢ã
ããã¡ãªã¿ã«ç§ã®ç°å¢ã¯Mac OSX 10.7.2ã§ãã
ä»åã®ãããã¯ã¯ä»¥ä¸ã®5ã¤ã
ãã®ä»ãPivotal TrackerãTravis CIãè²ã
ãããã ãã©ããããã¯å¾æ¥ã
- MAMPã§AppacheãMySQLãPHPã®å°å ¥ (å½ç¶å¿ é )
- NetBeans (Eclipseã¯éãã®ã§æ¬é )
- CakePHPã®å°å ¥ (ã»ã¼ã¹ã¯ã©ããéçºãªã®ã§ããã¬ã¼ã ã¯ã¼ã¯ä½¿ãã¾ã)
- PHPUnitã®å°å ¥ (ã¦ããããã¹ããã¼ã«ãTDDã§è¡ãã¾ã)
- Xdebugã®å°å ¥ (ãã¹ãã±ã¼ã¹ã®ã«ãã¬ãã¸æ¸¬å®ãã¼ã«)
ãã ããªããè²ã
ãã¡ããã¡ããã£ã¦ã¦è¨æ¶ãæªããã®ã§ãæ
å ±ééã£ã¦ãããã
VMã§ãã¹ãMACç°å¢ããã¨ãããããæ便å©ãããªãã§ãããï¼
å度å°å
¥æé 確èªãã¦ãæå¾ã«ããã¥ã¡ã³ãã«ã¾ã¨ããããã®ã§ã
ããããããªãã§ããããã¼ã éçºããæãªããã«ç¹ã«ä¾¿å©ãããªããã¨ã
ä½è«ã¯ããã¨ãã¦ãæ©éæ¬é¡ã
1. MAMPã§AppacheãMySQLãPHPã®å°å ¥
ããã¯æ¸ãå¿ è¦ããªãã§ããã
MAMP: Mac, Apache, MySQL, PHP
http://www.mamp.info/en/index.html
ä¸è¨ãªã³ã¯å
ããMAMPã®ã¤ã³ã¹ãã¼ã©ã¼ãDLãã¦å¾ã¯é©å½ã«ã¯ãªãã¯ããã ãã
Macã£ã¦æåããAppacheãPHPãå
¥ã£ã¦ããã§ã競åé¢ä¿ã¨ãã©ããªããã§ãããï¼
æ°æã¡æªããã§æå使ããããªãã£ããã§ãããçµå±ãã使ãã®ã楽ã§ããã
2. NetBeans
ãããç¹ã«è¦å´ããè¨æ¶ç¡ãã®ã§ãã¤ã³ã¹ãã¼ã©ã¼ãDLãã¦å°å ¥ããã ãã ã£ãããªã
NetBeans æ¥æ¬èªãµã¤ã
http://ja.netbeans.org/
ã§ãè¦ãç®ãããã¼ããããã§ãã¨ãããããã©ã³ãã ãã¯å¤ãã¾ããã
Mac OS X Lionç°å¢NetBeans IDEã«ããã°ã©ãã³ã°ç¨ãã©ã³ãRictyå°å
¥
http://show-web.jp/2012/01/31/mac-os-x-lion%E7%92%B0%E5%A2%83netbeans-ide%E3%81%AB%E3%83%97%E3%83%AD%E3%82%B0%E3%83%A9%E3%83%9F%E3%83%B3%E3%82%B0%E7%94%A8%E3%83%95%E3%82%A9%E3%83%B3%E3%83%88ricty%E5%B0%8E%E5%85%A5/
ãã¨ã§ãããããããããã ãã©ãã¨ããããå¾åãã
NetBeans + CakePHP Code Completion ï¼ã³ã¼ãè£å®ï¼
http://junichi11.com/?p=1150
NetBeans6.9.1ã«ZenCodingãç°¡åã«å°å
¥ãã
http://studiokdf.com/blog/2011/01/349.html
3. CakePHPã®å°å ¥
Appacheã¾ãããããããããªããã§è¨æ¶ãææ§ãªãã ãã©ãããããããªæãã
CakePHP 2.0éçºã®æºåããããï¼
http://libro.tuyano.com/index3?id=730002
- å ¬å¼ãµã¤ã( http://cakephp.jp/ )ãããã¬ã¼ã ã¯ã¼ã¯ãDL
- 解åãããã£ã¬ã¯ããªãMAMPã§å°å ¥ããAppacheã®ãã£ã¬ã¯ããª( /Applications/MAMP/htdocs )ã«ç½®ãã
- CakePHPã®tmpãã£ã¬ã¯ããª( /Applications/MAMP/htdocs/[cakeã®ãã£ã¬ã¯ããªå]/app/tmp )以ä¸ã®ãã¼ããã·ã§ã³ã777ã«ããã
- CakePHPã®Cacheãã£ã¬ã¯ããª( /Applications/MAMP/htdocs/cake_2_1/lib/Cake/Cache )以ä¸ã®ãã¼ããã·ã§ã³ã777ã«ããã
4. PHPUnitã®å°å
¥
ãããåèã«ããã®ã¯ãããã辺ã
CakePHP2.0 + PHPUnit on NetBeans
http://php-tips.com/php/2012/01/cakephp2-0-phpunit-on-netbeans
第3ç« PHPUnit ã®ã¤ã³ã¹ãã¼ã«
http://www.phpunit.de/manual/3.6/ja/installation.html
PHPUnitãXAMPPã«ã¤ã³ã¹ãã¼ã«
http://lazesoftware.com/blog/11/0213/
ããããããã
PHPUnitãå
¥ããããã«pearã£ã¦ããããã±ã¼ã¸ç®¡çãã¼ã«ã使ããã§ããã
OSX Lionã ã¨pearãå¤ãã ã®ãªãã ã®æãããããã§ããæããã¾ããã
ãªããããåããã¾ãããã以ä¸ã®Qã«å¯¾ããAã®éãã«ãã£ãããã¾ãããã¾ããã
PHPUnit: Warning: require(PHPUnit/Autoload.php): failed to open stream: No such file or directory in /usr/local/bin/phpunit on line 42
http://stackoverflow.com/questions/8333279/phpunit-warning-requirephpunit-autoload-php-failed-to-open-stream-no-such
5. Xdebugã®å°å ¥
ããã辺åèã«ã
第4å PHPUnitã«ãããã¹ãï¼å¿ç¨ç·¨
http://thinkit.co.jp/article/1202/1?page=0,1
CakePHP
http://www.ryuzee.com/contents/blog/3522
NetBeansãããããä¾®ã£ã¦ãã誤解ãã¦ãããã¦ã
http://d.hatena.ne.jp/masanobuimai/20120106
ãããæåå¼ã£ããã£ããã§ããã以ä¸ã§ç´¹ä»ããã¦ãã³ãã³ãã§ç¾è±¡ç解ã
takuto-2:MAMP takuto_1981$ php -i | grep -i "xdebug support"
PHP: syntax error, unexpected $end, expecting TC_DOLLAR_CURLY or TC_QUOTED_STRING or '"' in /private/etc/php.ini on line 1914
ãã®ç®æããããã³ã¡ã³ãã¢ã¦ããåé¤ããã ããªã®ã§ãå
ã
ééãã¦ããããªããã
ãã¨ãããããphp.iniã£ã¦/etc/php.iniã ã¨æã£ã¦ããã®ã ãã©ã
ã©ãããMAMPã§å°å
¥ããå ´åã¯/private/etc/php.iniãããã
Appacheã¨ãããã®è¾ºå
¨ç¶è§¦ã£ããã¨ãªãã®ã§ããã¯ãæåã¯ã¤ã¾ã¥ãã¾ããªã
ãããªæãã«ãªãã¾ãã
以ä¸ã