Roundcube/Plugin/composer

Aus Foxwiki

Managing plugins via composer

Some of the mentioned above plugins are shipped with the Roundcube package, while the others can be easily installed from https://plugins.roundcube.net/ via composer. To learn how to use composer take a look to the home page of this site, where a quick howto is provided.

Installing composer

Install as follow if composer.phar is not already installed

cd /var/www/roundcube
chown -R root:apache .

wget https://getcomposer.org/composer-stable.phar 
mv composer-stable.phar composer.phar 
chown apache:apache composer.phar 
mkdir -p /var/www/.composer 
chown -R apache:apache /var/www/.composer

Since composer has to be runned by apache, it is the case to set up write priviledges in some folder and files that the apache user has to overwrite.

mkdir -p /srv/httpd
chown -R apache:apache /srv/httpd

touch composer.lock
chown apache:apache composer.lock composer.phar

chmod -R g+w plugins vendor composer.lock

Using composer

In a few words, just open your composer.json file and add a line like this for each plugin that is browseable from https://plugins.roundcube.net and you would like to install:

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

This is my composer.json file that is needed to install the plugins described below:

 "require": {
       ............... other stuff
       "johndoh/contextmenu": ">=3.3.1", 
       "johndoh/swipe": ">=0.5"
}

Run composer as the apache user to update and install:

cd /var/www/roundcube
sudo -u apache php composer.phar update