Skip to content

Commit 73011c9

Browse files
committed
feat(phar): add phar archive to poser
1 parent 3178d73 commit 73011c9

File tree

4 files changed

+10
-8
lines changed

4 files changed

+10
-8
lines changed

box.json.dist

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"force-autodiscovery": true,
3+
"output": "poser.phar"
4+
}

docker/php-fpm/Dockerfile

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,12 @@ RUN apt-get update \
99
&& apt-get -y --no-install-recommends install php-xdebug php7.4-bcmath php7.4-gd php7.4-intl php-msgpack php-yaml \
1010
&& apt-get clean; rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/*
1111

12-
# Install git
12+
# Install git and wget
1313
RUN apt-get update \
14-
&& apt-get -y install git \
14+
&& apt-get -y install git wget \
1515
&& apt-get clean; rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/*
1616

17-
RUN mkdir -p /home/dev/.composer \
18-
&& chown -R 1000:1000 /home/dev/
17+
COPY --from=composer:2 /usr/bin/composer /usr/local/bin/composer
1918

20-
ENV COMPOSER_CACHE_DIR='/home/dev/.composer'
21-
22-
# Install prestissimo
23-
RUN composer global require hirak/prestissimo
19+
## To generate phar archive: https://github.com/box-project/box
20+
RUN wget -q -O /usr/bin/box https://github.com/box-project/box/releases/download/3.11.0/box.phar && chmod +x /usr/bin/box

poser.phar

1.7 MB
Binary file not shown.

src/Calculator/GDTextSizeCalculator.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ public function __construct()
2828
public function calculateWidth(string $text, int $size = self::TEXT_SIZE): float
2929
{
3030
$size = $this->convertToPt($size);
31+
var_dump($this->fontPath);
3132
$box = \imagettfbbox($size, 0, $this->fontPath, $text);
3233

3334
return \round(\abs($box[2] - $box[0]) + self::SHIELD_PADDING_EXTERNAL + self::SHIELD_PADDING_INTERNAL, 1);

0 commit comments

Comments
 (0)