LoginSignup
5
5

More than 5 years have passed since last update.

symfony1.4 のプラグインを composer で管理

Last updated at Posted at 2013-06-03

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;
    }
5
5
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
5
5