Create file called /usr/local/bin/zephir as follows:
#!/usr/bin/env bash
docker_bin="$(which docker 2> /dev/null)"
# 5.4, 5.5, 5.6, 7, 7.0, latest
PHP_VERSION="${PHP_VERSION:-7}"
${docker_bin} run -it --rm \
--privileged=true \
-e ZEND_DONT_UNLOAD_MODULES=1 \
-v $(pwd):/zephir \
phalconphp/zephir:${PHP_VERSION} "$@"
if [ $? != 0 ]; then
ERROR_LOG="$(pwd)/compile-errors.log"
if [ -e ${ERROR_LOG} ]; then
cat ${ERROR_LOG}
fi
fi
Make it executable:
$ sudo chmod a+x /usr/local/bin/zephir
Test:
$ zephir version
0.9.3a-dev