Skip to content

Commit 2adb222

Browse files
committed
Add Zest Framework
1 parent 5b30b3d commit 2adb222

File tree

5 files changed

+48
-29
lines changed

5 files changed

+48
-29
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ phpbenchkit --restart
3636
# Stop Docker container
3737
phpbenchkit --stop
3838

39-
# Update docker image and phpbenchkit command
39+
# Update docker image and phpbenchkit command
4040
phpbenchkit --selfupdate
4141
```
4242

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "phpbenchmarks/benchmark-kit",
3-
"description": "PHPBenchmarks kit to add benchmarks",
3+
"description": "PHPBenchmarks kit to add benchmarks on phpbenchmarks.com",
44
"license": "proprietary",
55
"authors": [
66
{

docker/Dockerfile

Lines changed: 30 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,11 @@
11
# This container should represent the benchmark server who is not dockerised
2-
# So everything is installed into one container
2+
# So everything is installed into one container
33
FROM ubuntu:18.04
44

55
COPY --from=composer /usr/bin/composer /usr/local/bin/composer
6-
# Copy benchmark kit source code
7-
COPY bin/console /var/benchmark-kit/bin/console
8-
COPY config /var/benchmark-kit/config
9-
COPY documentation /var/benchmark-kit/documentation
10-
COPY public /var/benchmark-kit/public
11-
COPY src /var/benchmark-kit/src
12-
COPY templates /var/benchmark-kit/templates
13-
COPY vendor /var/benchmark-kit/vendor
14-
COPY .env /var/benchmark-kit/.env
15-
COPY changelog.md /var/benchmark-kit/changelog.md
16-
COPY README.md /var/benchmark-kit/README.md
17-
COPY phpbenchkit.sh /var/benchmark-kit/phpbenchkit.sh
18-
# Configure nginx default page
19-
COPY docker/html /var/www/html
20-
COPY docker/nginx/default /etc/nginx/sites-available
216

227
RUN \
23-
# Update and instal some dependencies
8+
# Update and instal some dependencies
249
apt-get update \
2510
&& apt-get upgrade -y \
2611
&& apt-get install -y \
@@ -61,10 +46,6 @@ RUN \
6146
&& echo "phpbenchmarks ALL=(ALL) NOPASSWD: /usr/sbin/service php7.2-fpm restart" >> /etc/sudoers.d/phpbenchmarks \
6247
&& echo "phpbenchmarks ALL=(ALL) NOPASSWD: /usr/sbin/service php7.3-fpm restart" >> /etc/sudoers.d/phpbenchmarks \
6348
&& echo "phpbenchmarks ALL=(ALL) NOPASSWD: /usr/sbin/service php7.4-fpm restart" >> /etc/sudoers.d/phpbenchmarks \
64-
# We have some commands to do in this directories with phpbenchmarks user.
65-
# So instead of adding a lot of commands into sudoers, and as security doesn't matter in this container,
66-
# change this directories mod to 777
67-
&& mkdir /var/benchmark-kit/var \
6849
&& chmod -R 777 \
6950
/etc/nginx/sites-enabled \
7051
/var/log/nginx \
@@ -74,8 +55,6 @@ RUN \
7455
/etc/php/7.2/fpm/conf.d \
7556
/etc/php/7.3/fpm/conf.d \
7657
/etc/php/7.4/fpm/conf.d \
77-
/var/benchmark-kit/public \
78-
/var/benchmark-kit/var \
7958
# Create phpbenchmarks user, we assume final host user id will be 1000 (should be it 99% of the time)
8059
&& useradd -ms /bin/bash --uid 1000 phpbenchmarks \
8160
&& usermod -a -G www-data phpbenchmarks \
@@ -93,14 +72,40 @@ RUN \
9372
&& sed -i 's/group = www-data/group = phpbenchmarks/g' /etc/php/7.3/fpm/pool.d/www.conf \
9473
&& sed -i 's/user = www-data/user = phpbenchmarks/g' /etc/php/7.4/fpm/pool.d/www.conf \
9574
&& sed -i 's/group = www-data/group = phpbenchmarks/g' /etc/php/7.4/fpm/pool.d/www.conf \
96-
# Define PHP 7.4 as default
75+
# Define PHP 7.4 as default
9776
&& /usr/bin/update-alternatives --set php /usr/bin/php7.4 \
9877
# Remove nginx default page
9978
&& rm /var/www/html/index.nginx-debian.html
10079

101-
# Install git alone, or it will ask some geographical configs, I don't know why
80+
# Install git alone, or it will ask some geographical configs, I don't know why
10281
RUN apt-get install -y git
10382

83+
# Copy benchmark kit source code
84+
COPY bin/console /var/benchmark-kit/bin/console
85+
COPY config /var/benchmark-kit/config
86+
COPY documentation /var/benchmark-kit/documentation
87+
COPY public /var/benchmark-kit/public
88+
COPY src /var/benchmark-kit/src
89+
COPY templates /var/benchmark-kit/templates
90+
COPY vendor /var/benchmark-kit/vendor
91+
COPY .env /var/benchmark-kit/.env
92+
COPY changelog.md /var/benchmark-kit/changelog.md
93+
COPY README.md /var/benchmark-kit/README.md
94+
COPY phpbenchkit.sh /var/benchmark-kit/phpbenchkit.sh
95+
# Configure nginx default page
96+
COPY docker/html /var/www/html
97+
COPY docker/nginx/default /etc/nginx/sites-available
98+
99+
# Configure benchmark kit directories
100+
RUN \
101+
mkdir /var/benchmark-kit/var \
102+
# We have some commands to do in this directories with phpbenchmarks user.
103+
# So instead of adding a lot of commands into sudoers, and as security doesn't matter in this container,
104+
# change this directories mod to 777
105+
&& chmod -R 777 \
106+
/var/benchmark-kit/public \
107+
/var/benchmark-kit/var
108+
104109
COPY --chown=phpbenchmarks docker/entrypoint.sh /usr/local/bin/entrypoint
105110
COPY docker/phpbenchkit.sh /usr/local/bin/phpbenchkit
106111

phpbenchkit.sh

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,20 +92,29 @@ function startContainer() {
9292

9393
function updatePhpBenchKitScript()
9494
{
95+
set +e
96+
docker stop phpbenchmarks_benchmark-kit_selfupdate > /dev/null 2>&1
97+
set -e
98+
9599
docker run \
96100
-it \
97101
-d \
98102
--name=$SELFUPDATE_CONTAINER_NAME \
99103
--rm \
100104
$DOCKER_IMAGE_NAME
101-
docker cp $SELFUPDATE_CONTAINER_NAME:$BENCHMARK_KIT_PATH/phpbenchkit.sh $ROOT_DIR/$(basename $0)
105+
106+
local binPath="$ROOT_DIR/$(basename $0)"
107+
echo -en "\e[43m sudo password could be asked to update $binPath \e[0m\n"
108+
sudo docker cp $SELFUPDATE_CONTAINER_NAME:$BENCHMARK_KIT_PATH/phpbenchkit.sh "$binPath"
102109
docker stop $SELFUPDATE_CONTAINER_NAME
103110
}
104111

105112
function stopContainer() {
106113
if [ $containerStarted == true ]; then
107114
echo -e "Stop \e[32m$CONTAINER_NAME\e[0m container."
108-
docker kill $CONTAINER_NAME > /dev/null
115+
set +e
116+
docker kill $CONTAINER_NAME
117+
set -e
109118
fi
110119
}
111120

src/Component/Component.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ class Component
1111
public const LARAVEL = 'laravel';
1212
public const ZEND_FRAMEWORK = 'zend-framework';
1313
public const CAKE_PHP = 'cake-php';
14+
public const ZEST_FRAMEWORK = 'zest-framework';
1415
public const TWIG = 'twig';
1516
public const PLATES = 'plates';
1617
public const SMARTY = 'smarty';
@@ -43,6 +44,10 @@ class Component
4344
'name' => 'CakePHP',
4445
'type' => ComponentType::FRAMEWORK
4546
],
47+
self::ZEST_FRAMEWORK => [
48+
'name' => 'Zest Framework',
49+
'type' => ComponentType::FRAMEWORK
50+
],
4651
self::TWIG => [
4752
'name' => 'Twig',
4853
'type' => ComponentType::TEMPLATE_ENGINE

0 commit comments

Comments
 (0)