WebArea/Compat/Composer/En

From TuxFamilyFAQ
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. Same reasoning with Composer's XDG-compliant cache directory (~/.cache).

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
export XDG_CACHE_HOME=/home/myprojectgroup/cache
mkdir -p "${COMPOSER_HOME}" "${XDG_CACHE_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.

export COMPOSER_VENDOR_DIR=/tmp/myproject-vendor
mkdir -p "${COMPOSER_VENDOR_DIR}"
chgrp myprojectgroup "${COMPOSER_VENDOR_DIR}"
chmod +s "${COMPOSER_VENDOR_DIR}"
~/myprojectgroup/tools/composer/composer.phar install