composer 対応プラグイン
composer.json
{
"require": {
"propel/sf-propel-o-r-m-plugin": "dev-master"
}
}
propelorm/sfPropelORMPlugin · GitHub
symfony-project のプラグイン
composer.json
{
"repositories": [
{
"type": "package",
"package": {
"name": "symfony-project/sfImageTransformPlugin",
"type": "symfony1-plugin",
"version": "0.0.1",
"source": {
"url": "http://svn.symfony-project.com/plugins/sfImageTransformPlugin/",
"type": "svn",
"reference": "trunk/"
}
}
}
],
"require": {
"composer/installers": "*",
"symfony-project/sfImageTransformPlugin": "*"
}
}
Plugins | sfImageTransformPlugin | 1.4.1 | symfony | Web PHP Framework
プライベートリポジトリの hogeTestPlugin
あらかじめプラグインリポジトリにcomposer.jsonを用意しておく。
composer.json
{
"name": "hoge/hoge-test-plugin",
"type": "symfony1-plugin",
"description": "symfony 1.x plugin.",
"homepage": "https://bitbucket.org/hoge/hoge-test-plugin",
"require": {
"composer/installers": "*"
}
}
composer.json
{
"repositories": [
{
"type": "vcs",
"url": "git@bitbucket.org:hoge/hoge-test-plugin.git"
}
],
"require": {
"hoge/hoge-test-plugin": "dev-master"
}
}
プラグイン名は↓のルールで変換される。
Symfony1Installer.php
/**
* Format package name to CamelCase
*/
public function inflectPackageVars($vars)
{
$vars['name'] = preg_replace_callback('/(-[a-z])/', function ($matches) {
return strtoupper($matches[0][1]);
}, $vars['name']);
return $vars;
}