WebArea/Compat/Composer/En

From TuxFamilyFAQ
Revision as of 00:13, 30 June 2021 by Arcenterre (talk | contribs)
Jump to navigationJump to search

Composer is a commonly used tool to build PHP applications and handle the task of fetching dependencies. To do so, it tends to store/cache information in its "composer home" which by default is ~/.composer.

However, TuxFamily enforces very restrictive quotas on user homes, making composer unusable out of the box. Therefore, it becomes necessary to move the composer home under a group directory, using the COMPOSER_HOME environment variable:

export COMPOSER_HOME=/home/myprojectgroup/tools/composer
mkdir -p "${COMPOSER_HOME}"
composer ...

Another suitable location is the "php-include" directory under a webarea directory (do not mind the name).

In case of dependencies installation failure, try installing the packages in /tmp and move them to the desired folder afterwards.

mkdir /tmp/dest
chgrp myprojectgroup /tmp/dest
chmod +s /tmp/dest
COMPOSER_VENDOR_DIR=/tmp/dest ~/myprojectgroup/tools/composer/composer.phar install