LoginSignup
15
16

More than 5 years have passed since last update.

phpフレームワークのプラグインをcomposer管理

Posted at

composerむっちゃ便利なんですが標準でインストールするvendor/ディレクトリ以下にインストールしてしまうとcomposer対応してないフレームワークのプラグインとかはちゃんと読み込めなくて困ったちゃんになるなーと思っていました。symfony1系のプラグインとかcakephpのプラグインとかwordpressのプラグインとかですかね。

だけどもcomposer/installersを使えば解決される事が解ったので設定方法をまとめておきます。

プラグインの各ソースファイルをgitリポジトリ管理とかにしておいてcomposerでインストール出来るように以下のcomposer.jsonをプラグインのルートディレクトリ直下に置いておけば完了です。

composer.json
{
    "name": "you/ftp",
    "type": "cakephp-plugin",
    "require": {
        "composer/installers": "~1.0"
    }
}

composer/installersを標準でrequireするようにしてtypeを各プラグインの設定に変えてやれば良いです。

あとはこのgitリポジトリ管理とかだったりをpackagistに登録したりしてプロジェクトからcomposerインストールしてくればオッケーですb

2013/9/19 現在の対応されているtype一覧

Framework Types
AGL agl-module
AnnotateCms annotatecms-module
annotatecms-component
annotatecms-service
CakePHP 2+ cakephp-plugin
CodeIgniter codeigniter-library
codeigniter-third-party
codeigniter-module
Croogo croogo-plugin
croogo-theme
Drupal drupal-module
drupal-theme

drupal-profile
drupal-drush
FuelPHP v1.x fuel-module
fuel-package
Joomla joomla-component
joomla-module
joomla-template
joomla-plugin
joomla-library
Kohana kohana-module
Laravel laravel-library
Lithium lithium-library
lithium-source
Magento magento-library
magento-skin
magento-theme
Mako mako-package
MediaWiki mediawiki-extension
OXID oxid-module
MODULEWork modulework-module
phpBB phpbb-extension
phpbb-style
phpbb-language
PPI ppi-module
SilverStripe silverstripe-module
silverstripe-theme
symfony1 symfony1-plugin
TYPO3 Flow typo3-flow-package
typo3-flow-framework
typo3-flow-plugin
typo3-flow-site
typo3-flow-boilerplate
typo3-flow-build
TYPO3 CMS typo3-cms-extension
WordPress wordpress-plugin
wordpress-theme

wordpress-muplugin
Zend zend-library
zend-extra

参考

symfony1.4 のプラグインを composer で管理
PHPエンジニア養成読本[現場で役立つイマドキ開発ノウハウ満載!]

15
16
1

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
15
16