18
15

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

PhpStormでcomposerを使う

Posted at

PhpStormのPHP Composer設定

PhpStorm PreferenceのComposerで「Path to composer.phar」にcomposerのパスを設定します。

% which composer
/usr/local/bin/composer

本PCは/usr/local/bin/composerにcomposerをインストールしているので次のようになります。

設定画面

kobito.1408894445.124909.png

composer.jsonの作成

メニューの「Tools - Composer - Init Composer...」でプロジェクトのルートにcomposer.jsonのひな形が作成されます。

kobito.1408894749.341102.png

パッケージの追加

メニューの「Tools - Composer - Add Dependency...」

kobito.1408895042.415228.png

パッケージとバージョンを選んでInstallボタンを押すとcomposer.jsonにパッケージが追加され、かつcomposer updateも実行されてダウンロードが始まります。
PhpStormの多機能っぷりがすごい。

kobito.1408895217.302661.png

18
15
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
18
15

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?