@@ -4,14 +4,14 @@ SHELL=bash
4
4
.PHONY : *
5
5
6
6
CONTAINER_REGISTRY_REPO ="ghcr.io/wyrihaximusnet/php"
7
- COMPOSER_SHOW_EXTENSION_LIST_PROD =$(shell composer show -t | grep -o "\-\-\(ext-\) .\+" | sort | uniq | cut -d- -f4- | tr -d '\n' | grep . | sed '/^$$/d' | xargs | sed -e 's/ /, /g' | tr -cd '[:alnum:],' | sed 's/.$$//')
8
- COMPOSER_SHOW_EXTENSION_LIST_DEV =$(shell composer show -s | grep -o "\(ext-\) .\+" | sort | uniq | cut -d- -f2- | cut -d" " -f1 | xargs | sed -e 's/ /, /g' | tr -cd '[:alnum:],')
7
+ COMPOSER_SHOW_EXTENSION_LIST_PROD =$(shell ((command -v docker >/dev/null 2>&1) && docker run --rm -v " ` pwd ` : ` pwd ` " -w ` pwd ` ${CONTAINER_REGISTRY_REPO}:8.4-nts-alpine-slim-dev composer show -t) | grep -o "\-\-\(ext-\).\+" | sort | uniq | cut -d- -f4- | tr -d '\n' | grep . | sed '/^$$/d' | xargs | sed -e 's/ /, /g' | tr -cd '[:alnum:],' | sed 's/.$$//')
8
+ COMPOSER_SHOW_EXTENSION_LIST_DEV =$(shell ((command -v docker >/dev/null 2>&1) && docker run --rm -v " ` pwd ` : ` pwd ` " -w ` pwd ` ${CONTAINER_REGISTRY_REPO}:8.4-nts-alpine-slim-dev composer show -s) | grep -o "\(ext-\).\+" | sort | uniq | cut -d- -f2- | cut -d" " -f1 | xargs | sed -e 's/ /, /g' | tr -cd '[:alnum:],')
9
9
COMPOSER_SHOW_EXTENSION_LIST =$(shell echo "${COMPOSER_SHOW_EXTENSION_LIST_PROD},${COMPOSER_SHOW_EXTENSION_LIST_DEV}")
10
10
SLIM_DOCKER_IMAGE =$(shell php -r 'echo count(array_intersect(["gd", "vips"], explode(",", "${COMPOSER_SHOW_EXTENSION_LIST}") )) > 0 ? "" : "-slim";')
11
11
NTS_OR_ZTS_DOCKER_IMAGE =$(shell php -r 'echo count(array_intersect(["parallel"], explode(",", "${COMPOSER_SHOW_EXTENSION_LIST}") )) > 0 ? "zts" : "nts";')
12
12
PHP_VERSION: =$(shell (((command -v docker >/dev/null 2>&1) && docker run --rm -v "` pwd ` :` pwd ` " ${CONTAINER_REGISTRY_REPO}:8.4-nts-alpine-slim php -r "echo json_decode(file_get_contents('` pwd ` /composer.json'), true)['config']['platform']['php'];") || echo "8.3") | php -r "echo str_replace('|', '.', explode('.', implode('|', explode('.', stream_get_contents(STDIN), 2)), 2)[0]);")
13
13
CONTAINER_NAME =$(shell echo "${CONTAINER_REGISTRY_REPO}:${PHP_VERSION}-${NTS_OR_ZTS_DOCKER_IMAGE}-alpine${SLIM_DOCKER_IMAGE}-dev")
14
- COMPOSER_CACHE_DIR =$(shell composer config --global cache-dir -q || echo ${HOME}/.composer-php/cache)
14
+ COMPOSER_CACHE_DIR =$(shell (command -v docker >/dev/null 2>&1) && docker run --rm -v " ` pwd ` : ` pwd ` " -w ` pwd ` ${CONTAINER_REGISTRY_REPO}:8.4-nts-alpine-slim-dev composer config --global cache-dir -q || echo ${HOME}/.composer-php/cache)
15
15
COMPOSER_CONTAINER_CACHE_DIR =$(shell ((command -v docker >/dev/null 2>&1) && docker run --rm -it ${CONTAINER_NAME} composer config --global cache-dir -q) || echo ${HOME}/.composer-php/cache)
16
16
17
17
ifneq ("$(wildcard /.you-are-in-a-wyrihaximus.net-php-docker-image) ","")
0 commit comments