Roundcube Composer - how to install

composer.phar composer

Roundcube Composer - how to install

Статья поправлена sil 29.07.16

Для начала необходимо установить git.

sudo apt-get install git

The plugin repository for Roundcube is based on Composer to manage, install and update the plugins for your Roundcube installation. The following two steps are necessary to connect your local Roundcube installation to the plugin repository:

1. Install Composer

Run this in your command line:

cd <roundcube-project-root>
curl -s https://getcomposer.org/installer | php

Or download composer.phar into your Roundcube root directory.

2. Configure composer.json

Copy the template composer.json-dist to composer.json in your Roundcube root directory.

Затем надо добавить  секцию “config:

....

],

**    “config”: {**

**    “secure-http”: false**

**        },**

“require”: {

....

3. Installing plugins

Browse through our repository and find the plugins you want to install.

Then edit your local composer.json file and add the "vendor/plugin" names to the "require" section of the JSON structure. Don’t forget to specify the version constraint:

"require" : {
    ...,
    "roundcube/rcsample": ">=0.2.0"
}

After every change to composer.json run

php composer.phar install

to download and install all dependencies.

The plugins are installed to the plugins/ directory and when running the install command you’ll be asked whether to activate the plugins right away. For any later activation or deactivation of a plugin, you can add/remove the plugin name to/from the $config['plugins'] option in your local Roundcube config file config/config.inc.php.

Publishing Plugins

  1. Read the short introduction how to write plugins for Roundcube on our wiki. Once you have your plugin ready for distribution, commit the code to a plublic git or svn repository like github. Make sure the plugin contents e.g .php are placed in the root direcotry of the git repository.
  2. Then put a file named composer.json to the root of your plugin repository, containing the following information:
    {
        "name": "<your-vendor-name>/<plugin-name>",
        "type": "roundcube-plugin",
        "license": "GPL-3.0+",
        "repositories": [
            {
                "type": "composer",
                "url": "https://plugins.roundcube.net"
            }
        ],
        "require": {
            "roundcube/plugin-installer": ">=0.1.6"
        }
    }
    
    This is the strictly minimal information you have to provide. For more details about package naming and the fields you can use to describe your plugin better, see the about page.
  3. Publish your plugin on this platform. Login or register on this site, then hit the big fat button that says “Submit plugin”.

Once you entered your public repository URL in there, your package will be automatically crawled periodically and published on this platform. You just have to make sure you keep the composer.json file up to date.