開発環境を整える
デバッグしやすく、バグにすぐ気づける環境つくりをしたい。
やってると、PHPUnitで躓いた。
うーむ。
作りたい環境
XAMPP1.8.1
開発環境(IDE) NetBeans
デバッグ XDebug
-
- (ここまではサクッといける)
自動テスト PHPUnit ←ここで嵌る
バージョン管理 Git
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
やり方をメモしとく。
XAMPPインストール
開発環境(IDE) NetBeans
ここまではふつーにインストールのみでいける。
XDebug
php.iniを修正する。
XDebugは、XAMPPに入ってるので、php.iniの修正のみでOK。
【修正前】
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
[XDebug]
;zend_extension = "C:\xampp\php\ext\php_xdebug.dll"
;xdebug.profiler_append = 0
;xdebug.profiler_enable = 1
;xdebug.profiler_enable_trigger = 0
;xdebug.profiler_output_dir = "C:\xampp\tmp"
;xdebug.profiler_output_name = "cachegrind.out.%t-%s"
;xdebug.remote_enable = 0
;xdebug.remote_handler = "dbgp"
;xdebug.remote_host = "127.0.0.1"
;xdebug.trace_output_dir = "C:\xampp\tmp"
【修正後】
[XDebug]
zend_extension = "C:\xampp\php\ext\php_xdebug.dll"
;xdebug.profiler_append = 0
;xdebug.profiler_enable = 1
;xdebug.profiler_enable_trigger = 0
;xdebug.profiler_output_dir = "C:\xampp\tmp"
;xdebug.profiler_output_name = "cachegrind.out.%t-%s"
xdebug.remote_enable = on
xdebug.remote_handler = dbgp
xdebug.remote_host = "127.0.0.1"
xdebug.trace_output_dir = "C:\xampp\tmp"
PHPUnit
ここに載ってるとおりにやる。
pearは、xamppに入ってるぽいのでpearコマンド使ってけばOK。
ただし、管理者権限でコマンドプロンプトを実行する事。
http://lazesoftware.com/blog/11/0213/
うまくいかないときはキャッシュを疑う。