Skip to content

Commit

Permalink
feat(phar): add phar archive to poser
Browse files Browse the repository at this point in the history
  • Loading branch information
JellyBellyDev committed Dec 29, 2020
1 parent 3178d73 commit 73011c9
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
4 changes: 4 additions & 0 deletions box.json.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"force-autodiscovery": true,
"output": "poser.phar"
}
13 changes: 5 additions & 8 deletions docker/php-fpm/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,12 @@ RUN apt-get update \
&& apt-get -y --no-install-recommends install php-xdebug php7.4-bcmath php7.4-gd php7.4-intl php-msgpack php-yaml \
&& apt-get clean; rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/*

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

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

ENV COMPOSER_CACHE_DIR='/home/dev/.composer'

# Install prestissimo
RUN composer global require hirak/prestissimo
## To generate phar archive: https://github.com/box-project/box
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
Binary file added poser.phar
Binary file not shown.
1 change: 1 addition & 0 deletions src/Calculator/GDTextSizeCalculator.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public function __construct()
public function calculateWidth(string $text, int $size = self::TEXT_SIZE): float
{
$size = $this->convertToPt($size);
var_dump($this->fontPath);
$box = \imagettfbbox($size, 0, $this->fontPath, $text);

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

0 comments on commit 73011c9

Please sign in to comment.