diff options
Diffstat (limited to 'PKGBUILD')
-rw-r--r-- | PKGBUILD | 14 |
1 files changed, 12 insertions, 2 deletions
@@ -16,15 +16,25 @@ sha512sums=('337eeb18b9d6ab41fda772bb3372467a6093a153f336f804b2d2ca1b4631e1ea99f build() { cd "${srcdir}/${_pkgname}-${pkgver}" - php -d extension=phar.so /usr/bin/composer install --prefer-dist --no-dev + php -d extension=phar.so -d open_basedir=/usr/:~ /usr/bin/composer install --prefer-dist --no-dev sed -i '/git-commit/d' box.json php -d extension=phar.so -d phar.readonly=Off -d display_errors=Off /usr/bin/php-box build } check() { + STATUS=0 + if ! php -i | grep 'PHP Archive support => enabled' >/dev/null 2>&1; then echo -e "Warning: phar.so must be loaded in your php.ini to install and use ${pkgname}" - exit 1 + STATUS=1 + fi + if ! php -i | grep -E '(:/usr/$|:/usr/:)' >/dev/null 2>&1; then + echo -e "Warning: You must add ':/usr/' to 'open_basedir' setting in your php.ini to use ${pkgname}" + STATUS=1 + fi + + if [ ${STATUS} != 0 ]; then + exit ${STATUS} fi } |