CakePHP
の開発時に利用する「DebugKit
」の導入方法を説明していきます。
今回はGit
のサブモジュールの機能を利用してDebugKit
を導入していきます。
前提条件
今回利用した環境は下記の通りです。
- git:2.24.2
- PHP:7.1.6
- CakePHP:2.8.5
.gitmodulesファイル作成
「.git
」があるディレクトリ上に「.gitmodules
」というファイルを作成します。
.gitmodules
[submodule "DebugKit"]
path = app/Plugin/DebugKit
url = https://github.com/cakephp/debug_kit.git
git submoduleの実行
下記のコマンドを実行し、サブモジュールとして「DebugKit
」をクローンします。
$ git submodule update --init --recursive
Submodule 'DebugKit' (https://github.com/cakephp/debug_kit.git) registered for path 'app/Plugin/DebugKit'
Cloning into '/Applications/MAMP/htdocs/ipos_customer/app/Plugin/DebugKit'...
Submodule path 'app/Plugin/DebugKit': checked out '49afa821703da5af536051cabd5dbaa5d21a1eca'
サブモジュールの状態確認
サブモジュールが正常にクローンされていれば、下記のコマンドを実行してサブモジュールのステータスを確認できます。
$ git submodule status
49afa821703da5af536051cabd5dbaa5d21a1eca app/Plugin/DebugKit (2.2.1)
最後に
DebugKit
はCakePHP
の開発時に必ず利用するプラグインなので、導入方法はきちんと覚えておきたいですね。
コメント