├── .gitignore
├── Makefile
├── README.md
├── app
├── .gitignore
├── composer.json
├── composer.lock
├── phpunit.xml.dist
├── public
│ └── index.php
├── src
│ └── SomeClass.php
└── tests
│ ├── SomeClassTest.php
│ └── bootstrap.php
├── docker-compose.override.yml.dist
├── docker-compose.yml
└── docker
├── nginx
├── Dockerfile
└── conf.d
│ └── default.conf
└── php
├── Dockerfile
├── bin
└── entrypoint.sh
└── conf.d
├── php.ini
└── xdebug.ini
/.gitignore:
--------------------------------------------------------------------------------
1 | ### General (Docker, MacOS, PHPStorm...)
2 | .idea/*
3 | docker-compose.override.yml
4 | .DS_Store
5 | .AppleDouble
6 | .LSOverride
7 |
8 | ###> friendsofphp/php-cs-fixer ###
9 | .php_cs
10 | .php_cs.cache
11 | ###< friendsofphp/php-cs-fixer ###
12 |
--------------------------------------------------------------------------------
/Makefile:
--------------------------------------------------------------------------------
1 | # Makefile focusing on Docker
2 |
3 | DOCKER_COMPOSE = docker-compose
4 | EXEC = $(DOCKER_COMPOSE) exec -T php /usr/local/bin/entrypoint
5 |
6 | ##
7 | ###------------#
8 | ### Help #
9 | ###------------#
10 | ##
11 |
12 | .DEFAULT_GOAL := help
13 |
14 | help: ## DEFAULT_GOAL : Display help messages from parent Makefile
15 | @grep -E '(^[a-zA-Z_-]+:.*?##.*$$)|(^##)' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[32m%-20s\033[0m %s\n", $$1, $$2}' | sed -e 's/\[32m##/[33m/'
16 |
17 | .PHONY: help
18 |
19 | ##
20 | ###----------------------------------#
21 | ### Project commands (Docker) #
22 | ###----------------------------------#
23 | ##
24 |
25 | exec\:%: ## Calling Symfony console
26 | $(EXEC) $* $(ARGS)
27 |
28 | build: ./docker-compose.yml ./docker-compose.override.yml.dist ## Build Docker images
29 | @if [ -f ./docker-compose.override.yml ]; \
30 | then \
31 | echo '\033[1;41m/!\ The ./docker-compose.override.yml already exists. So delete it, if you want to reset it.\033[0m'; \
32 | else \
33 | cp ./docker-compose.override.yml.dist ./docker-compose.override.yml; \
34 | echo '\033[1;42m/!\ The ./docker-compose.override.yml was just created. Feel free to put your config in it.\033[0m'; \
35 | fi
36 | $(DOCKER_COMPOSE) pull --quiet --ignore-pull-failures 2> /dev/null
37 | $(DOCKER_COMPOSE) build --force-rm --compress
38 |
39 | start: ## Start all containers
40 | $(DOCKER_COMPOSE) up -d --remove-orphans --no-recreate
41 |
42 | stop: ## Stop all containers
43 | $(DOCKER_COMPOSE) stop
44 |
45 | install: build start composer ## Launch project : Build Docker and start the project with vendors
46 |
47 | kill: ## Kill Docker containers
48 | $(DOCKER_COMPOSE) kill
49 | $(DOCKER_COMPOSE) down --volumes --remove-orphans
50 |
51 | clear: kill rmi ## Remove all containers and images
52 |
53 | rmi: ## Remove all images ( too)
54 | docker image prune -fa
55 |
56 | reset: clear build ## Alias coupling clear and build rules
57 |
58 | .PHONY: build start stop install kill clear rmi reset
59 |
60 | ##
61 | ###------------#
62 | ### Vendor #
63 | ###------------#
64 | ##
65 |
66 | composer: ## Install vendor/
67 | $(DOCKER_COMPOSE) exec -T php /usr/local/bin/entrypoint composer install -d ./app/ --prefer-dist --no-progress
68 |
69 | .PHONY: composer
70 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # php-docker-starter
2 |
3 | Dockerized your web environment using PHP7.4, NGINX, COMPOSER, PHPUNIT, PHP-CS-FIXER, XDEBUG.
4 |
5 | 
6 |
7 | [](https://github.com/gaetanrole)
8 |
9 | This repository uses official [PHP](https://hub.docker.com/_/php) and [NGINX](https://hub.docker.com/_/nginx) containers.
10 |
11 | ## Installation instructions
12 |
13 | ### Docker Contents
14 |
15 | - [PHP-FPM 7.4](https://hub.docker.com/_/php)
16 | - [NGINX 1.17](https://hub.docker.com/_/nginx)
17 | - [Composer 1.10](https://getcomposer.org/)
18 | - [PHPUnit 9.1](https://phpunit.de/)
19 | - [PHP-CS-FIXER-V2](https://github.com/FriendsOfPHP/PHP-CS-Fixer)
20 | - [Xdebug 2.9](https://xdebug.org/)
21 |
22 | ### Project requirements
23 |
24 | - [Docker Machine](https://docs.docker.com/machine/overview/)
25 | - [Docker Engine](https://docs.docker.com/installation/)
26 | - [Docker Compose](https://docs.docker.com/compose/)
27 | - Make (or not)
28 |
29 | ### Suggested requirements (for Mac)
30 |
31 | - [Docker Machine NFS](https://github.com/adlogix/docker-machine-nfs)
32 |
33 | ### Suggested requirements (for Windows)
34 |
35 | - Maybe a suggestion ? So add your contribution !
36 |
37 | ### Tree view
38 |
39 | ```
40 | app/
41 | public/
42 | src/
43 | tests/
44 | ...
45 | docker/
46 | nginx/
47 | php/
48 | docker-compose.override.yml.dist
49 | docker-compose.yml
50 | Makefile
51 | README.md
52 | ```
53 |
54 | ### Installation
55 |
56 | Assuming you have a running docker machine, **create and add your own config** `./docker-compose.override.yml`, based on the dist one.
57 | Then let's run docker-compose :
58 |
59 | ```bash
60 | $ docker-compose up -d
61 | $ docker-compose exec -T php /usr/local/bin/entrypoint composer install -d /srv/app/ --prefer-dist
62 | ```
63 |
64 | Or if you want use the project's **Makefile** :
65 |
66 | ```bash
67 | $ make install
68 | $ make exec:composer ARGS="update -d /srv/app/"
69 | ```
70 |
71 | > See other commands in it, such as clear, kill and so on.
72 |
73 | ## Usage
74 |
75 | **Go on** : http://localhost:8080/ (or other ports specified in your `./docker-compose.override.yml`)
76 |
77 | ### Useful commands
78 |
79 | ```bash
80 | # shell commands
81 | $ docker-compose exec php /usr/local/bin/entrypoint sh
82 |
83 | # Composer (e.g. composer update)
84 | $ docker-compose exec -T php /usr/local/bin/entrypoint composer update -d /srv/app
85 |
86 | # Retrieve an container IP Address (here for the http one with nginx container_name)
87 | $ docker inspect --format '{{ .NetworkSettings.Networks.dockersymfony_default.IPAddress }}' $(docker ps -f name=nginx -q)
88 | $ docker inspect $(docker ps -f name=nginx -q) | grep IPAddress
89 |
90 | # Check container CPU consumption
91 | $ docker stats $(docker inspect -f "{{ .Name }}" $(docker ps -q))
92 |
93 | # Delete all containers
94 | $ docker stop $(docker ps -aq)
95 | $ docker rm $(docker ps -aq)
96 |
97 | # Delete all images
98 | $ docker rmi $(docker images -q)
99 | ```
100 |
101 | ## Using PHPUnit, XDebug, PHP-CS-FIXER
102 |
103 | Default configuration is already set, see `./docker/php/conf.d/*.ini`.
104 | Do not hesitate to add your `xdebug.remote_host` and configure your IDE, according to the current configuration.
105 |
106 | _- E.g._ :
107 |
108 | ```bash
109 | $ docker-compose exec -T php /usr/local/bin/entrypoint /srv/app/vendor/bin/phpunit --configuration /srv/app/phpunit.xml.dist /srv/app/tests
110 | $ docker-compose exec -T php /usr/local/bin/entrypoint php-cs-fixer fix app/src/ --rules=@PSR2
111 | ```
112 |
113 | ## Application path
114 |
115 | The default application path is located at `./app/public/index.php`.
116 | You will need to alter the application path depending on your specific needs, e.g. if using
117 | Symfony, create a Symfony directory with all the application in it and change your NGINX conf & volumes path to `./app/symfony/public/index.php`.
118 | You can also add a Makefile to be comfortable with Docker commands.
119 |
120 | ## Anything else ?
121 |
122 | If you want persist some data to your application you can add these containers to your `docker-compose.yml` :
123 |
124 | ```docker
125 | database:
126 | image: mariadb:latest
127 | container_name: mariadb
128 | working_dir: /srv
129 | restart: always
130 | ```
131 |
132 | And to your `docker-composer.override.yml.dist` :
133 |
134 | ```docker
135 | database:
136 | volumes:
137 | - "./data/db:/var/lib/mysql"
138 | environment:
139 | - MYSQL_DATABASE=
140 | - MYSQL_USER=
141 | - MYSQL_PASSWORD=
142 | - MYSQL_RANDOM_ROOT_PASSWORD=yes
143 | ports:
144 | - "3306:3306"
145 |
146 | # http://localhost:8008/?server=database
147 | adminer:
148 | image: adminer:latest
149 | container_name: adminer
150 | working_dir: /srv
151 | restart: on-failure
152 | ports:
153 | - "8008:8080"
154 | links:
155 | - database
156 |
157 | ```
158 |
159 | ## Contributing
160 |
161 | Do not hesitate to improve this repository, creating your PR on GitHub with a description which explains it.
162 |
163 | Ask your question on `gaetan.role@gmail.com`.
164 |
--------------------------------------------------------------------------------
/app/.gitignore:
--------------------------------------------------------------------------------
1 | ###> symfony/framework-bundle ###
2 | /vendor/
3 | ###< symfony/framework-bundle ###
4 |
5 | ###> symfony/phpunit-bridge ###
6 | .phpunit
7 | /phpunit.xml
8 | ###< symfony/phpunit-bridge ###
9 |
--------------------------------------------------------------------------------
/app/composer.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "gaetan-role/php-docker-starter",
3 | "type": "project",
4 | "license": "proprietary",
5 | "description": "A simple Docker starter kit with PHP, Nginx, Composer, PHPUnit, PHP-CS-Fixer and Xdebug useful to show remote debugging.",
6 | "require": {
7 | "php": "^7.4"
8 | },
9 | "require-dev": {
10 | "phpunit/phpunit": "^9.1"
11 | },
12 | "autoload": {
13 | "psr-4": {
14 | "App\\": "src/"
15 | }
16 | },
17 | "autoload-dev": {
18 | "psr-4": {
19 | "Test\\": "tests/"
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/app/composer.lock:
--------------------------------------------------------------------------------
1 | {
2 | "_readme": [
3 | "This file locks the dependencies of your project to a known state",
4 | "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
5 | "This file is @generated automatically"
6 | ],
7 | "content-hash": "b5270cda7189c4b50ca5adc862b4ef59",
8 | "packages": [],
9 | "packages-dev": [
10 | {
11 | "name": "doctrine/instantiator",
12 | "version": "1.3.0",
13 | "source": {
14 | "type": "git",
15 | "url": "https://github.com/doctrine/instantiator.git",
16 | "reference": "ae466f726242e637cebdd526a7d991b9433bacf1"
17 | },
18 | "dist": {
19 | "type": "zip",
20 | "url": "https://api.github.com/repos/doctrine/instantiator/zipball/ae466f726242e637cebdd526a7d991b9433bacf1",
21 | "reference": "ae466f726242e637cebdd526a7d991b9433bacf1",
22 | "shasum": ""
23 | },
24 | "require": {
25 | "php": "^7.1"
26 | },
27 | "require-dev": {
28 | "doctrine/coding-standard": "^6.0",
29 | "ext-pdo": "*",
30 | "ext-phar": "*",
31 | "phpbench/phpbench": "^0.13",
32 | "phpstan/phpstan-phpunit": "^0.11",
33 | "phpstan/phpstan-shim": "^0.11",
34 | "phpunit/phpunit": "^7.0"
35 | },
36 | "type": "library",
37 | "extra": {
38 | "branch-alias": {
39 | "dev-master": "1.2.x-dev"
40 | }
41 | },
42 | "autoload": {
43 | "psr-4": {
44 | "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/"
45 | }
46 | },
47 | "notification-url": "https://packagist.org/downloads/",
48 | "license": [
49 | "MIT"
50 | ],
51 | "authors": [
52 | {
53 | "name": "Marco Pivetta",
54 | "email": "ocramius@gmail.com",
55 | "homepage": "http://ocramius.github.com/"
56 | }
57 | ],
58 | "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors",
59 | "homepage": "https://www.doctrine-project.org/projects/instantiator.html",
60 | "keywords": [
61 | "constructor",
62 | "instantiate"
63 | ],
64 | "time": "2019-10-21T16:45:58+00:00"
65 | },
66 | {
67 | "name": "myclabs/deep-copy",
68 | "version": "1.9.5",
69 | "source": {
70 | "type": "git",
71 | "url": "https://github.com/myclabs/DeepCopy.git",
72 | "reference": "b2c28789e80a97badd14145fda39b545d83ca3ef"
73 | },
74 | "dist": {
75 | "type": "zip",
76 | "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/b2c28789e80a97badd14145fda39b545d83ca3ef",
77 | "reference": "b2c28789e80a97badd14145fda39b545d83ca3ef",
78 | "shasum": ""
79 | },
80 | "require": {
81 | "php": "^7.1"
82 | },
83 | "replace": {
84 | "myclabs/deep-copy": "self.version"
85 | },
86 | "require-dev": {
87 | "doctrine/collections": "^1.0",
88 | "doctrine/common": "^2.6",
89 | "phpunit/phpunit": "^7.1"
90 | },
91 | "type": "library",
92 | "autoload": {
93 | "psr-4": {
94 | "DeepCopy\\": "src/DeepCopy/"
95 | },
96 | "files": [
97 | "src/DeepCopy/deep_copy.php"
98 | ]
99 | },
100 | "notification-url": "https://packagist.org/downloads/",
101 | "license": [
102 | "MIT"
103 | ],
104 | "description": "Create deep copies (clones) of your objects",
105 | "keywords": [
106 | "clone",
107 | "copy",
108 | "duplicate",
109 | "object",
110 | "object graph"
111 | ],
112 | "time": "2020-01-17T21:11:47+00:00"
113 | },
114 | {
115 | "name": "phar-io/manifest",
116 | "version": "1.0.3",
117 | "source": {
118 | "type": "git",
119 | "url": "https://github.com/phar-io/manifest.git",
120 | "reference": "7761fcacf03b4d4f16e7ccb606d4879ca431fcf4"
121 | },
122 | "dist": {
123 | "type": "zip",
124 | "url": "https://api.github.com/repos/phar-io/manifest/zipball/7761fcacf03b4d4f16e7ccb606d4879ca431fcf4",
125 | "reference": "7761fcacf03b4d4f16e7ccb606d4879ca431fcf4",
126 | "shasum": ""
127 | },
128 | "require": {
129 | "ext-dom": "*",
130 | "ext-phar": "*",
131 | "phar-io/version": "^2.0",
132 | "php": "^5.6 || ^7.0"
133 | },
134 | "type": "library",
135 | "extra": {
136 | "branch-alias": {
137 | "dev-master": "1.0.x-dev"
138 | }
139 | },
140 | "autoload": {
141 | "classmap": [
142 | "src/"
143 | ]
144 | },
145 | "notification-url": "https://packagist.org/downloads/",
146 | "license": [
147 | "BSD-3-Clause"
148 | ],
149 | "authors": [
150 | {
151 | "name": "Arne Blankerts",
152 | "email": "arne@blankerts.de",
153 | "role": "Developer"
154 | },
155 | {
156 | "name": "Sebastian Heuer",
157 | "email": "sebastian@phpeople.de",
158 | "role": "Developer"
159 | },
160 | {
161 | "name": "Sebastian Bergmann",
162 | "email": "sebastian@phpunit.de",
163 | "role": "Developer"
164 | }
165 | ],
166 | "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)",
167 | "time": "2018-07-08T19:23:20+00:00"
168 | },
169 | {
170 | "name": "phar-io/version",
171 | "version": "2.0.1",
172 | "source": {
173 | "type": "git",
174 | "url": "https://github.com/phar-io/version.git",
175 | "reference": "45a2ec53a73c70ce41d55cedef9063630abaf1b6"
176 | },
177 | "dist": {
178 | "type": "zip",
179 | "url": "https://api.github.com/repos/phar-io/version/zipball/45a2ec53a73c70ce41d55cedef9063630abaf1b6",
180 | "reference": "45a2ec53a73c70ce41d55cedef9063630abaf1b6",
181 | "shasum": ""
182 | },
183 | "require": {
184 | "php": "^5.6 || ^7.0"
185 | },
186 | "type": "library",
187 | "autoload": {
188 | "classmap": [
189 | "src/"
190 | ]
191 | },
192 | "notification-url": "https://packagist.org/downloads/",
193 | "license": [
194 | "BSD-3-Clause"
195 | ],
196 | "authors": [
197 | {
198 | "name": "Arne Blankerts",
199 | "email": "arne@blankerts.de",
200 | "role": "Developer"
201 | },
202 | {
203 | "name": "Sebastian Heuer",
204 | "email": "sebastian@phpeople.de",
205 | "role": "Developer"
206 | },
207 | {
208 | "name": "Sebastian Bergmann",
209 | "email": "sebastian@phpunit.de",
210 | "role": "Developer"
211 | }
212 | ],
213 | "description": "Library for handling version information and constraints",
214 | "time": "2018-07-08T19:19:57+00:00"
215 | },
216 | {
217 | "name": "phpdocumentor/reflection-common",
218 | "version": "2.0.0",
219 | "source": {
220 | "type": "git",
221 | "url": "https://github.com/phpDocumentor/ReflectionCommon.git",
222 | "reference": "63a995caa1ca9e5590304cd845c15ad6d482a62a"
223 | },
224 | "dist": {
225 | "type": "zip",
226 | "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/63a995caa1ca9e5590304cd845c15ad6d482a62a",
227 | "reference": "63a995caa1ca9e5590304cd845c15ad6d482a62a",
228 | "shasum": ""
229 | },
230 | "require": {
231 | "php": ">=7.1"
232 | },
233 | "require-dev": {
234 | "phpunit/phpunit": "~6"
235 | },
236 | "type": "library",
237 | "extra": {
238 | "branch-alias": {
239 | "dev-master": "2.x-dev"
240 | }
241 | },
242 | "autoload": {
243 | "psr-4": {
244 | "phpDocumentor\\Reflection\\": "src/"
245 | }
246 | },
247 | "notification-url": "https://packagist.org/downloads/",
248 | "license": [
249 | "MIT"
250 | ],
251 | "authors": [
252 | {
253 | "name": "Jaap van Otterdijk",
254 | "email": "opensource@ijaap.nl"
255 | }
256 | ],
257 | "description": "Common reflection classes used by phpdocumentor to reflect the code structure",
258 | "homepage": "http://www.phpdoc.org",
259 | "keywords": [
260 | "FQSEN",
261 | "phpDocumentor",
262 | "phpdoc",
263 | "reflection",
264 | "static analysis"
265 | ],
266 | "time": "2018-08-07T13:53:10+00:00"
267 | },
268 | {
269 | "name": "phpdocumentor/reflection-docblock",
270 | "version": "5.1.0",
271 | "source": {
272 | "type": "git",
273 | "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git",
274 | "reference": "cd72d394ca794d3466a3b2fc09d5a6c1dc86b47e"
275 | },
276 | "dist": {
277 | "type": "zip",
278 | "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/cd72d394ca794d3466a3b2fc09d5a6c1dc86b47e",
279 | "reference": "cd72d394ca794d3466a3b2fc09d5a6c1dc86b47e",
280 | "shasum": ""
281 | },
282 | "require": {
283 | "ext-filter": "^7.1",
284 | "php": "^7.2",
285 | "phpdocumentor/reflection-common": "^2.0",
286 | "phpdocumentor/type-resolver": "^1.0",
287 | "webmozart/assert": "^1"
288 | },
289 | "require-dev": {
290 | "doctrine/instantiator": "^1",
291 | "mockery/mockery": "^1"
292 | },
293 | "type": "library",
294 | "extra": {
295 | "branch-alias": {
296 | "dev-master": "5.x-dev"
297 | }
298 | },
299 | "autoload": {
300 | "psr-4": {
301 | "phpDocumentor\\Reflection\\": "src"
302 | }
303 | },
304 | "notification-url": "https://packagist.org/downloads/",
305 | "license": [
306 | "MIT"
307 | ],
308 | "authors": [
309 | {
310 | "name": "Mike van Riel",
311 | "email": "me@mikevanriel.com"
312 | },
313 | {
314 | "name": "Jaap van Otterdijk",
315 | "email": "account@ijaap.nl"
316 | }
317 | ],
318 | "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.",
319 | "time": "2020-02-22T12:28:44+00:00"
320 | },
321 | {
322 | "name": "phpdocumentor/type-resolver",
323 | "version": "1.1.0",
324 | "source": {
325 | "type": "git",
326 | "url": "https://github.com/phpDocumentor/TypeResolver.git",
327 | "reference": "7462d5f123dfc080dfdf26897032a6513644fc95"
328 | },
329 | "dist": {
330 | "type": "zip",
331 | "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/7462d5f123dfc080dfdf26897032a6513644fc95",
332 | "reference": "7462d5f123dfc080dfdf26897032a6513644fc95",
333 | "shasum": ""
334 | },
335 | "require": {
336 | "php": "^7.2",
337 | "phpdocumentor/reflection-common": "^2.0"
338 | },
339 | "require-dev": {
340 | "ext-tokenizer": "^7.2",
341 | "mockery/mockery": "~1"
342 | },
343 | "type": "library",
344 | "extra": {
345 | "branch-alias": {
346 | "dev-master": "1.x-dev"
347 | }
348 | },
349 | "autoload": {
350 | "psr-4": {
351 | "phpDocumentor\\Reflection\\": "src"
352 | }
353 | },
354 | "notification-url": "https://packagist.org/downloads/",
355 | "license": [
356 | "MIT"
357 | ],
358 | "authors": [
359 | {
360 | "name": "Mike van Riel",
361 | "email": "me@mikevanriel.com"
362 | }
363 | ],
364 | "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names",
365 | "time": "2020-02-18T18:59:58+00:00"
366 | },
367 | {
368 | "name": "phpspec/prophecy",
369 | "version": "v1.10.3",
370 | "source": {
371 | "type": "git",
372 | "url": "https://github.com/phpspec/prophecy.git",
373 | "reference": "451c3cd1418cf640de218914901e51b064abb093"
374 | },
375 | "dist": {
376 | "type": "zip",
377 | "url": "https://api.github.com/repos/phpspec/prophecy/zipball/451c3cd1418cf640de218914901e51b064abb093",
378 | "reference": "451c3cd1418cf640de218914901e51b064abb093",
379 | "shasum": ""
380 | },
381 | "require": {
382 | "doctrine/instantiator": "^1.0.2",
383 | "php": "^5.3|^7.0",
384 | "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0|^5.0",
385 | "sebastian/comparator": "^1.2.3|^2.0|^3.0|^4.0",
386 | "sebastian/recursion-context": "^1.0|^2.0|^3.0|^4.0"
387 | },
388 | "require-dev": {
389 | "phpspec/phpspec": "^2.5 || ^3.2",
390 | "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5 || ^7.1"
391 | },
392 | "type": "library",
393 | "extra": {
394 | "branch-alias": {
395 | "dev-master": "1.10.x-dev"
396 | }
397 | },
398 | "autoload": {
399 | "psr-4": {
400 | "Prophecy\\": "src/Prophecy"
401 | }
402 | },
403 | "notification-url": "https://packagist.org/downloads/",
404 | "license": [
405 | "MIT"
406 | ],
407 | "authors": [
408 | {
409 | "name": "Konstantin Kudryashov",
410 | "email": "ever.zet@gmail.com",
411 | "homepage": "http://everzet.com"
412 | },
413 | {
414 | "name": "Marcello Duarte",
415 | "email": "marcello.duarte@gmail.com"
416 | }
417 | ],
418 | "description": "Highly opinionated mocking framework for PHP 5.3+",
419 | "homepage": "https://github.com/phpspec/prophecy",
420 | "keywords": [
421 | "Double",
422 | "Dummy",
423 | "fake",
424 | "mock",
425 | "spy",
426 | "stub"
427 | ],
428 | "time": "2020-03-05T15:02:03+00:00"
429 | },
430 | {
431 | "name": "phpunit/php-code-coverage",
432 | "version": "8.0.1",
433 | "source": {
434 | "type": "git",
435 | "url": "https://github.com/sebastianbergmann/php-code-coverage.git",
436 | "reference": "31e94ccc084025d6abee0585df533eb3a792b96a"
437 | },
438 | "dist": {
439 | "type": "zip",
440 | "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/31e94ccc084025d6abee0585df533eb3a792b96a",
441 | "reference": "31e94ccc084025d6abee0585df533eb3a792b96a",
442 | "shasum": ""
443 | },
444 | "require": {
445 | "ext-dom": "*",
446 | "ext-xmlwriter": "*",
447 | "php": "^7.3",
448 | "phpunit/php-file-iterator": "^3.0",
449 | "phpunit/php-text-template": "^2.0",
450 | "phpunit/php-token-stream": "^4.0",
451 | "sebastian/code-unit-reverse-lookup": "^2.0",
452 | "sebastian/environment": "^5.0",
453 | "sebastian/version": "^3.0",
454 | "theseer/tokenizer": "^1.1.3"
455 | },
456 | "require-dev": {
457 | "phpunit/phpunit": "^9.0"
458 | },
459 | "suggest": {
460 | "ext-pcov": "*",
461 | "ext-xdebug": "*"
462 | },
463 | "type": "library",
464 | "extra": {
465 | "branch-alias": {
466 | "dev-master": "8.0-dev"
467 | }
468 | },
469 | "autoload": {
470 | "classmap": [
471 | "src/"
472 | ]
473 | },
474 | "notification-url": "https://packagist.org/downloads/",
475 | "license": [
476 | "BSD-3-Clause"
477 | ],
478 | "authors": [
479 | {
480 | "name": "Sebastian Bergmann",
481 | "email": "sebastian@phpunit.de",
482 | "role": "lead"
483 | }
484 | ],
485 | "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.",
486 | "homepage": "https://github.com/sebastianbergmann/php-code-coverage",
487 | "keywords": [
488 | "coverage",
489 | "testing",
490 | "xunit"
491 | ],
492 | "time": "2020-02-19T13:41:19+00:00"
493 | },
494 | {
495 | "name": "phpunit/php-file-iterator",
496 | "version": "3.0.0",
497 | "source": {
498 | "type": "git",
499 | "url": "https://github.com/sebastianbergmann/php-file-iterator.git",
500 | "reference": "354d4a5faa7449a377a18b94a2026ca3415e3d7a"
501 | },
502 | "dist": {
503 | "type": "zip",
504 | "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/354d4a5faa7449a377a18b94a2026ca3415e3d7a",
505 | "reference": "354d4a5faa7449a377a18b94a2026ca3415e3d7a",
506 | "shasum": ""
507 | },
508 | "require": {
509 | "php": "^7.3"
510 | },
511 | "require-dev": {
512 | "phpunit/phpunit": "^9.0"
513 | },
514 | "type": "library",
515 | "extra": {
516 | "branch-alias": {
517 | "dev-master": "3.0-dev"
518 | }
519 | },
520 | "autoload": {
521 | "classmap": [
522 | "src/"
523 | ]
524 | },
525 | "notification-url": "https://packagist.org/downloads/",
526 | "license": [
527 | "BSD-3-Clause"
528 | ],
529 | "authors": [
530 | {
531 | "name": "Sebastian Bergmann",
532 | "email": "sebastian@phpunit.de",
533 | "role": "lead"
534 | }
535 | ],
536 | "description": "FilterIterator implementation that filters files based on a list of suffixes.",
537 | "homepage": "https://github.com/sebastianbergmann/php-file-iterator/",
538 | "keywords": [
539 | "filesystem",
540 | "iterator"
541 | ],
542 | "time": "2020-02-07T06:05:22+00:00"
543 | },
544 | {
545 | "name": "phpunit/php-invoker",
546 | "version": "3.0.0",
547 | "source": {
548 | "type": "git",
549 | "url": "https://github.com/sebastianbergmann/php-invoker.git",
550 | "reference": "7579d5a1ba7f3ac11c80004d205877911315ae7a"
551 | },
552 | "dist": {
553 | "type": "zip",
554 | "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/7579d5a1ba7f3ac11c80004d205877911315ae7a",
555 | "reference": "7579d5a1ba7f3ac11c80004d205877911315ae7a",
556 | "shasum": ""
557 | },
558 | "require": {
559 | "php": "^7.3"
560 | },
561 | "require-dev": {
562 | "ext-pcntl": "*",
563 | "phpunit/phpunit": "^9.0"
564 | },
565 | "suggest": {
566 | "ext-pcntl": "*"
567 | },
568 | "type": "library",
569 | "extra": {
570 | "branch-alias": {
571 | "dev-master": "3.0-dev"
572 | }
573 | },
574 | "autoload": {
575 | "classmap": [
576 | "src/"
577 | ]
578 | },
579 | "notification-url": "https://packagist.org/downloads/",
580 | "license": [
581 | "BSD-3-Clause"
582 | ],
583 | "authors": [
584 | {
585 | "name": "Sebastian Bergmann",
586 | "email": "sebastian@phpunit.de",
587 | "role": "lead"
588 | }
589 | ],
590 | "description": "Invoke callables with a timeout",
591 | "homepage": "https://github.com/sebastianbergmann/php-invoker/",
592 | "keywords": [
593 | "process"
594 | ],
595 | "time": "2020-02-07T06:06:11+00:00"
596 | },
597 | {
598 | "name": "phpunit/php-text-template",
599 | "version": "2.0.0",
600 | "source": {
601 | "type": "git",
602 | "url": "https://github.com/sebastianbergmann/php-text-template.git",
603 | "reference": "526dc996cc0ebdfa428cd2dfccd79b7b53fee346"
604 | },
605 | "dist": {
606 | "type": "zip",
607 | "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/526dc996cc0ebdfa428cd2dfccd79b7b53fee346",
608 | "reference": "526dc996cc0ebdfa428cd2dfccd79b7b53fee346",
609 | "shasum": ""
610 | },
611 | "require": {
612 | "php": "^7.3"
613 | },
614 | "type": "library",
615 | "extra": {
616 | "branch-alias": {
617 | "dev-master": "2.0-dev"
618 | }
619 | },
620 | "autoload": {
621 | "classmap": [
622 | "src/"
623 | ]
624 | },
625 | "notification-url": "https://packagist.org/downloads/",
626 | "license": [
627 | "BSD-3-Clause"
628 | ],
629 | "authors": [
630 | {
631 | "name": "Sebastian Bergmann",
632 | "email": "sebastian@phpunit.de",
633 | "role": "lead"
634 | }
635 | ],
636 | "description": "Simple template engine.",
637 | "homepage": "https://github.com/sebastianbergmann/php-text-template/",
638 | "keywords": [
639 | "template"
640 | ],
641 | "time": "2020-02-01T07:43:44+00:00"
642 | },
643 | {
644 | "name": "phpunit/php-timer",
645 | "version": "3.0.0",
646 | "source": {
647 | "type": "git",
648 | "url": "https://github.com/sebastianbergmann/php-timer.git",
649 | "reference": "4118013a4d0f97356eae8e7fb2f6c6472575d1df"
650 | },
651 | "dist": {
652 | "type": "zip",
653 | "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/4118013a4d0f97356eae8e7fb2f6c6472575d1df",
654 | "reference": "4118013a4d0f97356eae8e7fb2f6c6472575d1df",
655 | "shasum": ""
656 | },
657 | "require": {
658 | "php": "^7.3"
659 | },
660 | "require-dev": {
661 | "phpunit/phpunit": "^9.0"
662 | },
663 | "type": "library",
664 | "extra": {
665 | "branch-alias": {
666 | "dev-master": "3.0-dev"
667 | }
668 | },
669 | "autoload": {
670 | "classmap": [
671 | "src/"
672 | ]
673 | },
674 | "notification-url": "https://packagist.org/downloads/",
675 | "license": [
676 | "BSD-3-Clause"
677 | ],
678 | "authors": [
679 | {
680 | "name": "Sebastian Bergmann",
681 | "email": "sebastian@phpunit.de",
682 | "role": "lead"
683 | }
684 | ],
685 | "description": "Utility class for timing",
686 | "homepage": "https://github.com/sebastianbergmann/php-timer/",
687 | "keywords": [
688 | "timer"
689 | ],
690 | "time": "2020-02-07T06:08:11+00:00"
691 | },
692 | {
693 | "name": "phpunit/php-token-stream",
694 | "version": "4.0.0",
695 | "source": {
696 | "type": "git",
697 | "url": "https://github.com/sebastianbergmann/php-token-stream.git",
698 | "reference": "b2560a0c33f7710e4d7f8780964193e8e8f8effe"
699 | },
700 | "dist": {
701 | "type": "zip",
702 | "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/b2560a0c33f7710e4d7f8780964193e8e8f8effe",
703 | "reference": "b2560a0c33f7710e4d7f8780964193e8e8f8effe",
704 | "shasum": ""
705 | },
706 | "require": {
707 | "ext-tokenizer": "*",
708 | "php": "^7.3"
709 | },
710 | "require-dev": {
711 | "phpunit/phpunit": "^9.0"
712 | },
713 | "type": "library",
714 | "extra": {
715 | "branch-alias": {
716 | "dev-master": "4.0-dev"
717 | }
718 | },
719 | "autoload": {
720 | "classmap": [
721 | "src/"
722 | ]
723 | },
724 | "notification-url": "https://packagist.org/downloads/",
725 | "license": [
726 | "BSD-3-Clause"
727 | ],
728 | "authors": [
729 | {
730 | "name": "Sebastian Bergmann",
731 | "email": "sebastian@phpunit.de"
732 | }
733 | ],
734 | "description": "Wrapper around PHP's tokenizer extension.",
735 | "homepage": "https://github.com/sebastianbergmann/php-token-stream/",
736 | "keywords": [
737 | "tokenizer"
738 | ],
739 | "time": "2020-02-07T06:19:00+00:00"
740 | },
741 | {
742 | "name": "phpunit/phpunit",
743 | "version": "9.1.1",
744 | "source": {
745 | "type": "git",
746 | "url": "https://github.com/sebastianbergmann/phpunit.git",
747 | "reference": "848f6521c906500e66229668768576d35de0227e"
748 | },
749 | "dist": {
750 | "type": "zip",
751 | "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/848f6521c906500e66229668768576d35de0227e",
752 | "reference": "848f6521c906500e66229668768576d35de0227e",
753 | "shasum": ""
754 | },
755 | "require": {
756 | "doctrine/instantiator": "^1.2.0",
757 | "ext-dom": "*",
758 | "ext-json": "*",
759 | "ext-libxml": "*",
760 | "ext-mbstring": "*",
761 | "ext-xml": "*",
762 | "ext-xmlwriter": "*",
763 | "myclabs/deep-copy": "^1.9.1",
764 | "phar-io/manifest": "^1.0.3",
765 | "phar-io/version": "^2.0.1",
766 | "php": "^7.3",
767 | "phpspec/prophecy": "^1.8.1",
768 | "phpunit/php-code-coverage": "^8.0.1",
769 | "phpunit/php-file-iterator": "^3.0",
770 | "phpunit/php-invoker": "^3.0",
771 | "phpunit/php-text-template": "^2.0",
772 | "phpunit/php-timer": "^3.0",
773 | "sebastian/code-unit": "^1.0",
774 | "sebastian/comparator": "^4.0",
775 | "sebastian/diff": "^4.0",
776 | "sebastian/environment": "^5.0.1",
777 | "sebastian/exporter": "^4.0",
778 | "sebastian/global-state": "^4.0",
779 | "sebastian/object-enumerator": "^4.0",
780 | "sebastian/resource-operations": "^3.0",
781 | "sebastian/type": "^2.0",
782 | "sebastian/version": "^3.0"
783 | },
784 | "require-dev": {
785 | "ext-pdo": "*"
786 | },
787 | "suggest": {
788 | "ext-soap": "*",
789 | "ext-xdebug": "*"
790 | },
791 | "bin": [
792 | "phpunit"
793 | ],
794 | "type": "library",
795 | "extra": {
796 | "branch-alias": {
797 | "dev-master": "9.1-dev"
798 | }
799 | },
800 | "autoload": {
801 | "classmap": [
802 | "src/"
803 | ],
804 | "files": [
805 | "src/Framework/Assert/Functions.php"
806 | ]
807 | },
808 | "notification-url": "https://packagist.org/downloads/",
809 | "license": [
810 | "BSD-3-Clause"
811 | ],
812 | "authors": [
813 | {
814 | "name": "Sebastian Bergmann",
815 | "email": "sebastian@phpunit.de",
816 | "role": "lead"
817 | }
818 | ],
819 | "description": "The PHP Unit Testing framework.",
820 | "homepage": "https://phpunit.de/",
821 | "keywords": [
822 | "phpunit",
823 | "testing",
824 | "xunit"
825 | ],
826 | "funding": [
827 | {
828 | "url": "https://phpunit.de/donate.html",
829 | "type": "custom"
830 | },
831 | {
832 | "url": "https://github.com/sebastianbergmann",
833 | "type": "github"
834 | }
835 | ],
836 | "time": "2020-04-03T14:40:04+00:00"
837 | },
838 | {
839 | "name": "sebastian/code-unit",
840 | "version": "1.0.0",
841 | "source": {
842 | "type": "git",
843 | "url": "https://github.com/sebastianbergmann/code-unit.git",
844 | "reference": "8d8f09bd47c75159921e6e84fdef146343962866"
845 | },
846 | "dist": {
847 | "type": "zip",
848 | "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/8d8f09bd47c75159921e6e84fdef146343962866",
849 | "reference": "8d8f09bd47c75159921e6e84fdef146343962866",
850 | "shasum": ""
851 | },
852 | "require": {
853 | "php": "^7.3"
854 | },
855 | "require-dev": {
856 | "phpunit/phpunit": "^9.0"
857 | },
858 | "type": "library",
859 | "extra": {
860 | "branch-alias": {
861 | "dev-master": "1.0-dev"
862 | }
863 | },
864 | "autoload": {
865 | "classmap": [
866 | "src/"
867 | ]
868 | },
869 | "notification-url": "https://packagist.org/downloads/",
870 | "license": [
871 | "BSD-3-Clause"
872 | ],
873 | "authors": [
874 | {
875 | "name": "Sebastian Bergmann",
876 | "email": "sebastian@phpunit.de",
877 | "role": "lead"
878 | }
879 | ],
880 | "description": "Collection of value objects that represent the PHP code units",
881 | "homepage": "https://github.com/sebastianbergmann/code-unit",
882 | "funding": [
883 | {
884 | "url": "https://github.com/sebastianbergmann",
885 | "type": "github"
886 | }
887 | ],
888 | "time": "2020-03-30T11:59:20+00:00"
889 | },
890 | {
891 | "name": "sebastian/code-unit-reverse-lookup",
892 | "version": "2.0.0",
893 | "source": {
894 | "type": "git",
895 | "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git",
896 | "reference": "5b5dbe0044085ac41df47e79d34911a15b96d82e"
897 | },
898 | "dist": {
899 | "type": "zip",
900 | "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/5b5dbe0044085ac41df47e79d34911a15b96d82e",
901 | "reference": "5b5dbe0044085ac41df47e79d34911a15b96d82e",
902 | "shasum": ""
903 | },
904 | "require": {
905 | "php": "^7.3"
906 | },
907 | "require-dev": {
908 | "phpunit/phpunit": "^9.0"
909 | },
910 | "type": "library",
911 | "extra": {
912 | "branch-alias": {
913 | "dev-master": "2.0-dev"
914 | }
915 | },
916 | "autoload": {
917 | "classmap": [
918 | "src/"
919 | ]
920 | },
921 | "notification-url": "https://packagist.org/downloads/",
922 | "license": [
923 | "BSD-3-Clause"
924 | ],
925 | "authors": [
926 | {
927 | "name": "Sebastian Bergmann",
928 | "email": "sebastian@phpunit.de"
929 | }
930 | ],
931 | "description": "Looks up which function or method a line of code belongs to",
932 | "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/",
933 | "time": "2020-02-07T06:20:13+00:00"
934 | },
935 | {
936 | "name": "sebastian/comparator",
937 | "version": "4.0.0",
938 | "source": {
939 | "type": "git",
940 | "url": "https://github.com/sebastianbergmann/comparator.git",
941 | "reference": "85b3435da967696ed618ff745f32be3ff4a2b8e8"
942 | },
943 | "dist": {
944 | "type": "zip",
945 | "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/85b3435da967696ed618ff745f32be3ff4a2b8e8",
946 | "reference": "85b3435da967696ed618ff745f32be3ff4a2b8e8",
947 | "shasum": ""
948 | },
949 | "require": {
950 | "php": "^7.3",
951 | "sebastian/diff": "^4.0",
952 | "sebastian/exporter": "^4.0"
953 | },
954 | "require-dev": {
955 | "phpunit/phpunit": "^9.0"
956 | },
957 | "type": "library",
958 | "extra": {
959 | "branch-alias": {
960 | "dev-master": "4.0-dev"
961 | }
962 | },
963 | "autoload": {
964 | "classmap": [
965 | "src/"
966 | ]
967 | },
968 | "notification-url": "https://packagist.org/downloads/",
969 | "license": [
970 | "BSD-3-Clause"
971 | ],
972 | "authors": [
973 | {
974 | "name": "Sebastian Bergmann",
975 | "email": "sebastian@phpunit.de"
976 | },
977 | {
978 | "name": "Jeff Welch",
979 | "email": "whatthejeff@gmail.com"
980 | },
981 | {
982 | "name": "Volker Dusch",
983 | "email": "github@wallbash.com"
984 | },
985 | {
986 | "name": "Bernhard Schussek",
987 | "email": "bschussek@2bepublished.at"
988 | }
989 | ],
990 | "description": "Provides the functionality to compare PHP values for equality",
991 | "homepage": "https://github.com/sebastianbergmann/comparator",
992 | "keywords": [
993 | "comparator",
994 | "compare",
995 | "equality"
996 | ],
997 | "time": "2020-02-07T06:08:51+00:00"
998 | },
999 | {
1000 | "name": "sebastian/diff",
1001 | "version": "4.0.0",
1002 | "source": {
1003 | "type": "git",
1004 | "url": "https://github.com/sebastianbergmann/diff.git",
1005 | "reference": "c0c26c9188b538bfa985ae10c9f05d278f12060d"
1006 | },
1007 | "dist": {
1008 | "type": "zip",
1009 | "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/c0c26c9188b538bfa985ae10c9f05d278f12060d",
1010 | "reference": "c0c26c9188b538bfa985ae10c9f05d278f12060d",
1011 | "shasum": ""
1012 | },
1013 | "require": {
1014 | "php": "^7.3"
1015 | },
1016 | "require-dev": {
1017 | "phpunit/phpunit": "^9.0",
1018 | "symfony/process": "^4 || ^5"
1019 | },
1020 | "type": "library",
1021 | "extra": {
1022 | "branch-alias": {
1023 | "dev-master": "4.0-dev"
1024 | }
1025 | },
1026 | "autoload": {
1027 | "classmap": [
1028 | "src/"
1029 | ]
1030 | },
1031 | "notification-url": "https://packagist.org/downloads/",
1032 | "license": [
1033 | "BSD-3-Clause"
1034 | ],
1035 | "authors": [
1036 | {
1037 | "name": "Sebastian Bergmann",
1038 | "email": "sebastian@phpunit.de"
1039 | },
1040 | {
1041 | "name": "Kore Nordmann",
1042 | "email": "mail@kore-nordmann.de"
1043 | }
1044 | ],
1045 | "description": "Diff implementation",
1046 | "homepage": "https://github.com/sebastianbergmann/diff",
1047 | "keywords": [
1048 | "diff",
1049 | "udiff",
1050 | "unidiff",
1051 | "unified diff"
1052 | ],
1053 | "time": "2020-02-07T06:09:38+00:00"
1054 | },
1055 | {
1056 | "name": "sebastian/environment",
1057 | "version": "5.0.2",
1058 | "source": {
1059 | "type": "git",
1060 | "url": "https://github.com/sebastianbergmann/environment.git",
1061 | "reference": "c39c1db0a5cffc98173f3de5a17d489d1043fd7b"
1062 | },
1063 | "dist": {
1064 | "type": "zip",
1065 | "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/c39c1db0a5cffc98173f3de5a17d489d1043fd7b",
1066 | "reference": "c39c1db0a5cffc98173f3de5a17d489d1043fd7b",
1067 | "shasum": ""
1068 | },
1069 | "require": {
1070 | "php": "^7.3"
1071 | },
1072 | "require-dev": {
1073 | "phpunit/phpunit": "^9.0"
1074 | },
1075 | "suggest": {
1076 | "ext-posix": "*"
1077 | },
1078 | "type": "library",
1079 | "extra": {
1080 | "branch-alias": {
1081 | "dev-master": "5.0-dev"
1082 | }
1083 | },
1084 | "autoload": {
1085 | "classmap": [
1086 | "src/"
1087 | ]
1088 | },
1089 | "notification-url": "https://packagist.org/downloads/",
1090 | "license": [
1091 | "BSD-3-Clause"
1092 | ],
1093 | "authors": [
1094 | {
1095 | "name": "Sebastian Bergmann",
1096 | "email": "sebastian@phpunit.de"
1097 | }
1098 | ],
1099 | "description": "Provides functionality to handle HHVM/PHP environments",
1100 | "homepage": "http://www.github.com/sebastianbergmann/environment",
1101 | "keywords": [
1102 | "Xdebug",
1103 | "environment",
1104 | "hhvm"
1105 | ],
1106 | "funding": [
1107 | {
1108 | "url": "https://github.com/sebastianbergmann",
1109 | "type": "github"
1110 | }
1111 | ],
1112 | "time": "2020-03-31T12:14:15+00:00"
1113 | },
1114 | {
1115 | "name": "sebastian/exporter",
1116 | "version": "4.0.0",
1117 | "source": {
1118 | "type": "git",
1119 | "url": "https://github.com/sebastianbergmann/exporter.git",
1120 | "reference": "80c26562e964016538f832f305b2286e1ec29566"
1121 | },
1122 | "dist": {
1123 | "type": "zip",
1124 | "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/80c26562e964016538f832f305b2286e1ec29566",
1125 | "reference": "80c26562e964016538f832f305b2286e1ec29566",
1126 | "shasum": ""
1127 | },
1128 | "require": {
1129 | "php": "^7.3",
1130 | "sebastian/recursion-context": "^4.0"
1131 | },
1132 | "require-dev": {
1133 | "ext-mbstring": "*",
1134 | "phpunit/phpunit": "^9.0"
1135 | },
1136 | "type": "library",
1137 | "extra": {
1138 | "branch-alias": {
1139 | "dev-master": "4.0-dev"
1140 | }
1141 | },
1142 | "autoload": {
1143 | "classmap": [
1144 | "src/"
1145 | ]
1146 | },
1147 | "notification-url": "https://packagist.org/downloads/",
1148 | "license": [
1149 | "BSD-3-Clause"
1150 | ],
1151 | "authors": [
1152 | {
1153 | "name": "Sebastian Bergmann",
1154 | "email": "sebastian@phpunit.de"
1155 | },
1156 | {
1157 | "name": "Jeff Welch",
1158 | "email": "whatthejeff@gmail.com"
1159 | },
1160 | {
1161 | "name": "Volker Dusch",
1162 | "email": "github@wallbash.com"
1163 | },
1164 | {
1165 | "name": "Adam Harvey",
1166 | "email": "aharvey@php.net"
1167 | },
1168 | {
1169 | "name": "Bernhard Schussek",
1170 | "email": "bschussek@gmail.com"
1171 | }
1172 | ],
1173 | "description": "Provides the functionality to export PHP variables for visualization",
1174 | "homepage": "http://www.github.com/sebastianbergmann/exporter",
1175 | "keywords": [
1176 | "export",
1177 | "exporter"
1178 | ],
1179 | "time": "2020-02-07T06:10:52+00:00"
1180 | },
1181 | {
1182 | "name": "sebastian/global-state",
1183 | "version": "4.0.0",
1184 | "source": {
1185 | "type": "git",
1186 | "url": "https://github.com/sebastianbergmann/global-state.git",
1187 | "reference": "bdb1e7c79e592b8c82cb1699be3c8743119b8a72"
1188 | },
1189 | "dist": {
1190 | "type": "zip",
1191 | "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bdb1e7c79e592b8c82cb1699be3c8743119b8a72",
1192 | "reference": "bdb1e7c79e592b8c82cb1699be3c8743119b8a72",
1193 | "shasum": ""
1194 | },
1195 | "require": {
1196 | "php": "^7.3",
1197 | "sebastian/object-reflector": "^2.0",
1198 | "sebastian/recursion-context": "^4.0"
1199 | },
1200 | "require-dev": {
1201 | "ext-dom": "*",
1202 | "phpunit/phpunit": "^9.0"
1203 | },
1204 | "suggest": {
1205 | "ext-uopz": "*"
1206 | },
1207 | "type": "library",
1208 | "extra": {
1209 | "branch-alias": {
1210 | "dev-master": "4.0-dev"
1211 | }
1212 | },
1213 | "autoload": {
1214 | "classmap": [
1215 | "src/"
1216 | ]
1217 | },
1218 | "notification-url": "https://packagist.org/downloads/",
1219 | "license": [
1220 | "BSD-3-Clause"
1221 | ],
1222 | "authors": [
1223 | {
1224 | "name": "Sebastian Bergmann",
1225 | "email": "sebastian@phpunit.de"
1226 | }
1227 | ],
1228 | "description": "Snapshotting of global state",
1229 | "homepage": "http://www.github.com/sebastianbergmann/global-state",
1230 | "keywords": [
1231 | "global state"
1232 | ],
1233 | "time": "2020-02-07T06:11:37+00:00"
1234 | },
1235 | {
1236 | "name": "sebastian/object-enumerator",
1237 | "version": "4.0.0",
1238 | "source": {
1239 | "type": "git",
1240 | "url": "https://github.com/sebastianbergmann/object-enumerator.git",
1241 | "reference": "e67516b175550abad905dc952f43285957ef4363"
1242 | },
1243 | "dist": {
1244 | "type": "zip",
1245 | "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/e67516b175550abad905dc952f43285957ef4363",
1246 | "reference": "e67516b175550abad905dc952f43285957ef4363",
1247 | "shasum": ""
1248 | },
1249 | "require": {
1250 | "php": "^7.3",
1251 | "sebastian/object-reflector": "^2.0",
1252 | "sebastian/recursion-context": "^4.0"
1253 | },
1254 | "require-dev": {
1255 | "phpunit/phpunit": "^9.0"
1256 | },
1257 | "type": "library",
1258 | "extra": {
1259 | "branch-alias": {
1260 | "dev-master": "4.0-dev"
1261 | }
1262 | },
1263 | "autoload": {
1264 | "classmap": [
1265 | "src/"
1266 | ]
1267 | },
1268 | "notification-url": "https://packagist.org/downloads/",
1269 | "license": [
1270 | "BSD-3-Clause"
1271 | ],
1272 | "authors": [
1273 | {
1274 | "name": "Sebastian Bergmann",
1275 | "email": "sebastian@phpunit.de"
1276 | }
1277 | ],
1278 | "description": "Traverses array structures and object graphs to enumerate all referenced objects",
1279 | "homepage": "https://github.com/sebastianbergmann/object-enumerator/",
1280 | "time": "2020-02-07T06:12:23+00:00"
1281 | },
1282 | {
1283 | "name": "sebastian/object-reflector",
1284 | "version": "2.0.0",
1285 | "source": {
1286 | "type": "git",
1287 | "url": "https://github.com/sebastianbergmann/object-reflector.git",
1288 | "reference": "f4fd0835cabb0d4a6546d9fe291e5740037aa1e7"
1289 | },
1290 | "dist": {
1291 | "type": "zip",
1292 | "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/f4fd0835cabb0d4a6546d9fe291e5740037aa1e7",
1293 | "reference": "f4fd0835cabb0d4a6546d9fe291e5740037aa1e7",
1294 | "shasum": ""
1295 | },
1296 | "require": {
1297 | "php": "^7.3"
1298 | },
1299 | "require-dev": {
1300 | "phpunit/phpunit": "^9.0"
1301 | },
1302 | "type": "library",
1303 | "extra": {
1304 | "branch-alias": {
1305 | "dev-master": "2.0-dev"
1306 | }
1307 | },
1308 | "autoload": {
1309 | "classmap": [
1310 | "src/"
1311 | ]
1312 | },
1313 | "notification-url": "https://packagist.org/downloads/",
1314 | "license": [
1315 | "BSD-3-Clause"
1316 | ],
1317 | "authors": [
1318 | {
1319 | "name": "Sebastian Bergmann",
1320 | "email": "sebastian@phpunit.de"
1321 | }
1322 | ],
1323 | "description": "Allows reflection of object attributes, including inherited and non-public ones",
1324 | "homepage": "https://github.com/sebastianbergmann/object-reflector/",
1325 | "time": "2020-02-07T06:19:40+00:00"
1326 | },
1327 | {
1328 | "name": "sebastian/recursion-context",
1329 | "version": "4.0.0",
1330 | "source": {
1331 | "type": "git",
1332 | "url": "https://github.com/sebastianbergmann/recursion-context.git",
1333 | "reference": "cdd86616411fc3062368b720b0425de10bd3d579"
1334 | },
1335 | "dist": {
1336 | "type": "zip",
1337 | "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/cdd86616411fc3062368b720b0425de10bd3d579",
1338 | "reference": "cdd86616411fc3062368b720b0425de10bd3d579",
1339 | "shasum": ""
1340 | },
1341 | "require": {
1342 | "php": "^7.3"
1343 | },
1344 | "require-dev": {
1345 | "phpunit/phpunit": "^9.0"
1346 | },
1347 | "type": "library",
1348 | "extra": {
1349 | "branch-alias": {
1350 | "dev-master": "4.0-dev"
1351 | }
1352 | },
1353 | "autoload": {
1354 | "classmap": [
1355 | "src/"
1356 | ]
1357 | },
1358 | "notification-url": "https://packagist.org/downloads/",
1359 | "license": [
1360 | "BSD-3-Clause"
1361 | ],
1362 | "authors": [
1363 | {
1364 | "name": "Sebastian Bergmann",
1365 | "email": "sebastian@phpunit.de"
1366 | },
1367 | {
1368 | "name": "Jeff Welch",
1369 | "email": "whatthejeff@gmail.com"
1370 | },
1371 | {
1372 | "name": "Adam Harvey",
1373 | "email": "aharvey@php.net"
1374 | }
1375 | ],
1376 | "description": "Provides functionality to recursively process PHP variables",
1377 | "homepage": "http://www.github.com/sebastianbergmann/recursion-context",
1378 | "time": "2020-02-07T06:18:20+00:00"
1379 | },
1380 | {
1381 | "name": "sebastian/resource-operations",
1382 | "version": "3.0.0",
1383 | "source": {
1384 | "type": "git",
1385 | "url": "https://github.com/sebastianbergmann/resource-operations.git",
1386 | "reference": "8c98bf0dfa1f9256d0468b9803a1e1df31b6fa98"
1387 | },
1388 | "dist": {
1389 | "type": "zip",
1390 | "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/8c98bf0dfa1f9256d0468b9803a1e1df31b6fa98",
1391 | "reference": "8c98bf0dfa1f9256d0468b9803a1e1df31b6fa98",
1392 | "shasum": ""
1393 | },
1394 | "require": {
1395 | "php": "^7.3"
1396 | },
1397 | "require-dev": {
1398 | "phpunit/phpunit": "^9.0"
1399 | },
1400 | "type": "library",
1401 | "extra": {
1402 | "branch-alias": {
1403 | "dev-master": "3.0-dev"
1404 | }
1405 | },
1406 | "autoload": {
1407 | "classmap": [
1408 | "src/"
1409 | ]
1410 | },
1411 | "notification-url": "https://packagist.org/downloads/",
1412 | "license": [
1413 | "BSD-3-Clause"
1414 | ],
1415 | "authors": [
1416 | {
1417 | "name": "Sebastian Bergmann",
1418 | "email": "sebastian@phpunit.de"
1419 | }
1420 | ],
1421 | "description": "Provides a list of PHP built-in functions that operate on resources",
1422 | "homepage": "https://www.github.com/sebastianbergmann/resource-operations",
1423 | "time": "2020-02-07T06:13:02+00:00"
1424 | },
1425 | {
1426 | "name": "sebastian/type",
1427 | "version": "2.0.0",
1428 | "source": {
1429 | "type": "git",
1430 | "url": "https://github.com/sebastianbergmann/type.git",
1431 | "reference": "9e8f42f740afdea51f5f4e8cec2035580e797ee1"
1432 | },
1433 | "dist": {
1434 | "type": "zip",
1435 | "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/9e8f42f740afdea51f5f4e8cec2035580e797ee1",
1436 | "reference": "9e8f42f740afdea51f5f4e8cec2035580e797ee1",
1437 | "shasum": ""
1438 | },
1439 | "require": {
1440 | "php": "^7.3"
1441 | },
1442 | "require-dev": {
1443 | "phpunit/phpunit": "^9.0"
1444 | },
1445 | "type": "library",
1446 | "extra": {
1447 | "branch-alias": {
1448 | "dev-master": "2.0-dev"
1449 | }
1450 | },
1451 | "autoload": {
1452 | "classmap": [
1453 | "src/"
1454 | ]
1455 | },
1456 | "notification-url": "https://packagist.org/downloads/",
1457 | "license": [
1458 | "BSD-3-Clause"
1459 | ],
1460 | "authors": [
1461 | {
1462 | "name": "Sebastian Bergmann",
1463 | "email": "sebastian@phpunit.de",
1464 | "role": "lead"
1465 | }
1466 | ],
1467 | "description": "Collection of value objects that represent the types of the PHP type system",
1468 | "homepage": "https://github.com/sebastianbergmann/type",
1469 | "time": "2020-02-07T06:13:43+00:00"
1470 | },
1471 | {
1472 | "name": "sebastian/version",
1473 | "version": "3.0.0",
1474 | "source": {
1475 | "type": "git",
1476 | "url": "https://github.com/sebastianbergmann/version.git",
1477 | "reference": "0411bde656dce64202b39c2f4473993a9081d39e"
1478 | },
1479 | "dist": {
1480 | "type": "zip",
1481 | "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/0411bde656dce64202b39c2f4473993a9081d39e",
1482 | "reference": "0411bde656dce64202b39c2f4473993a9081d39e",
1483 | "shasum": ""
1484 | },
1485 | "require": {
1486 | "php": "^7.3"
1487 | },
1488 | "type": "library",
1489 | "extra": {
1490 | "branch-alias": {
1491 | "dev-master": "3.0-dev"
1492 | }
1493 | },
1494 | "autoload": {
1495 | "classmap": [
1496 | "src/"
1497 | ]
1498 | },
1499 | "notification-url": "https://packagist.org/downloads/",
1500 | "license": [
1501 | "BSD-3-Clause"
1502 | ],
1503 | "authors": [
1504 | {
1505 | "name": "Sebastian Bergmann",
1506 | "email": "sebastian@phpunit.de",
1507 | "role": "lead"
1508 | }
1509 | ],
1510 | "description": "Library that helps with managing the version number of Git-hosted PHP projects",
1511 | "homepage": "https://github.com/sebastianbergmann/version",
1512 | "time": "2020-01-21T06:36:37+00:00"
1513 | },
1514 | {
1515 | "name": "symfony/polyfill-ctype",
1516 | "version": "v1.15.0",
1517 | "source": {
1518 | "type": "git",
1519 | "url": "https://github.com/symfony/polyfill-ctype.git",
1520 | "reference": "4719fa9c18b0464d399f1a63bf624b42b6fa8d14"
1521 | },
1522 | "dist": {
1523 | "type": "zip",
1524 | "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/4719fa9c18b0464d399f1a63bf624b42b6fa8d14",
1525 | "reference": "4719fa9c18b0464d399f1a63bf624b42b6fa8d14",
1526 | "shasum": ""
1527 | },
1528 | "require": {
1529 | "php": ">=5.3.3"
1530 | },
1531 | "suggest": {
1532 | "ext-ctype": "For best performance"
1533 | },
1534 | "type": "library",
1535 | "extra": {
1536 | "branch-alias": {
1537 | "dev-master": "1.15-dev"
1538 | }
1539 | },
1540 | "autoload": {
1541 | "psr-4": {
1542 | "Symfony\\Polyfill\\Ctype\\": ""
1543 | },
1544 | "files": [
1545 | "bootstrap.php"
1546 | ]
1547 | },
1548 | "notification-url": "https://packagist.org/downloads/",
1549 | "license": [
1550 | "MIT"
1551 | ],
1552 | "authors": [
1553 | {
1554 | "name": "Gert de Pagter",
1555 | "email": "BackEndTea@gmail.com"
1556 | },
1557 | {
1558 | "name": "Symfony Community",
1559 | "homepage": "https://symfony.com/contributors"
1560 | }
1561 | ],
1562 | "description": "Symfony polyfill for ctype functions",
1563 | "homepage": "https://symfony.com",
1564 | "keywords": [
1565 | "compatibility",
1566 | "ctype",
1567 | "polyfill",
1568 | "portable"
1569 | ],
1570 | "funding": [
1571 | {
1572 | "url": "https://symfony.com/sponsor",
1573 | "type": "custom"
1574 | },
1575 | {
1576 | "url": "https://github.com/fabpot",
1577 | "type": "github"
1578 | },
1579 | {
1580 | "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
1581 | "type": "tidelift"
1582 | }
1583 | ],
1584 | "time": "2020-02-27T09:26:54+00:00"
1585 | },
1586 | {
1587 | "name": "theseer/tokenizer",
1588 | "version": "1.1.3",
1589 | "source": {
1590 | "type": "git",
1591 | "url": "https://github.com/theseer/tokenizer.git",
1592 | "reference": "11336f6f84e16a720dae9d8e6ed5019efa85a0f9"
1593 | },
1594 | "dist": {
1595 | "type": "zip",
1596 | "url": "https://api.github.com/repos/theseer/tokenizer/zipball/11336f6f84e16a720dae9d8e6ed5019efa85a0f9",
1597 | "reference": "11336f6f84e16a720dae9d8e6ed5019efa85a0f9",
1598 | "shasum": ""
1599 | },
1600 | "require": {
1601 | "ext-dom": "*",
1602 | "ext-tokenizer": "*",
1603 | "ext-xmlwriter": "*",
1604 | "php": "^7.0"
1605 | },
1606 | "type": "library",
1607 | "autoload": {
1608 | "classmap": [
1609 | "src/"
1610 | ]
1611 | },
1612 | "notification-url": "https://packagist.org/downloads/",
1613 | "license": [
1614 | "BSD-3-Clause"
1615 | ],
1616 | "authors": [
1617 | {
1618 | "name": "Arne Blankerts",
1619 | "email": "arne@blankerts.de",
1620 | "role": "Developer"
1621 | }
1622 | ],
1623 | "description": "A small library for converting tokenized PHP source code into XML and potentially other formats",
1624 | "time": "2019-06-13T22:48:21+00:00"
1625 | },
1626 | {
1627 | "name": "webmozart/assert",
1628 | "version": "1.7.0",
1629 | "source": {
1630 | "type": "git",
1631 | "url": "https://github.com/webmozart/assert.git",
1632 | "reference": "aed98a490f9a8f78468232db345ab9cf606cf598"
1633 | },
1634 | "dist": {
1635 | "type": "zip",
1636 | "url": "https://api.github.com/repos/webmozart/assert/zipball/aed98a490f9a8f78468232db345ab9cf606cf598",
1637 | "reference": "aed98a490f9a8f78468232db345ab9cf606cf598",
1638 | "shasum": ""
1639 | },
1640 | "require": {
1641 | "php": "^5.3.3 || ^7.0",
1642 | "symfony/polyfill-ctype": "^1.8"
1643 | },
1644 | "conflict": {
1645 | "vimeo/psalm": "<3.6.0"
1646 | },
1647 | "require-dev": {
1648 | "phpunit/phpunit": "^4.8.36 || ^7.5.13"
1649 | },
1650 | "type": "library",
1651 | "autoload": {
1652 | "psr-4": {
1653 | "Webmozart\\Assert\\": "src/"
1654 | }
1655 | },
1656 | "notification-url": "https://packagist.org/downloads/",
1657 | "license": [
1658 | "MIT"
1659 | ],
1660 | "authors": [
1661 | {
1662 | "name": "Bernhard Schussek",
1663 | "email": "bschussek@gmail.com"
1664 | }
1665 | ],
1666 | "description": "Assertions to validate method input/output with nice error messages.",
1667 | "keywords": [
1668 | "assert",
1669 | "check",
1670 | "validate"
1671 | ],
1672 | "time": "2020-02-14T12:15:55+00:00"
1673 | }
1674 | ],
1675 | "aliases": [],
1676 | "minimum-stability": "stable",
1677 | "stability-flags": [],
1678 | "prefer-stable": false,
1679 | "prefer-lowest": false,
1680 | "platform": {
1681 | "php": "^7.4"
1682 | },
1683 | "platform-dev": [],
1684 | "plugin-api-version": "1.1.0"
1685 | }
1686 |
--------------------------------------------------------------------------------
/app/phpunit.xml.dist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 | tests
29 |
30 |
31 |
32 |
33 |
34 | ./src
35 |
40 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/app/public/index.php:
--------------------------------------------------------------------------------
1 | Exec (whoami) : ' . exec('whoami') . '
';
8 | echo 'Current script owner: '. get_current_user() . '
';
9 |
10 | phpinfo();
11 |
--------------------------------------------------------------------------------
/app/src/SomeClass.php:
--------------------------------------------------------------------------------
1 |
9 | */
10 | class SomeClass
11 | {
12 | /**
13 | * @return string A string to compare in unit test
14 | */
15 | public function getClassName(): string
16 | {
17 | return 'SomeClass';
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/app/tests/SomeClassTest.php:
--------------------------------------------------------------------------------
1 |
13 | */
14 | class SomeClassTest extends TestCase
15 | {
16 | public function testIfGetClassNameReturnTheGoodOne(): void
17 | {
18 | self::assertSame('SomeClass', (new SomeClass())->getClassName());
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/app/tests/bootstrap.php:
--------------------------------------------------------------------------------
1 | "
19 | - XDEBUG_CONFIG="remote_host="
20 |
--------------------------------------------------------------------------------
/docker-compose.yml:
--------------------------------------------------------------------------------
1 | # File syntax : https://docs.docker.com/compose/compose-file/
2 | # Global config, you can add your .yml to override this one with -f option.
3 |
4 | version: "3.6"
5 |
6 | services:
7 |
8 | http:
9 | build: ./docker/nginx
10 | container_name: nginx
11 | working_dir: /srv
12 | restart: always
13 | depends_on:
14 | - php
15 |
16 | php:
17 | build: ./docker/php
18 | container_name: php
19 | working_dir: /srv
20 | restart: always
21 |
--------------------------------------------------------------------------------
/docker/nginx/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM nginx:alpine
2 |
3 | LABEL maintainer="Gaëtan Rolé-Dubruille "
4 |
5 | COPY conf.d/default.conf /etc/nginx/conf.d/default.conf
6 |
--------------------------------------------------------------------------------
/docker/nginx/conf.d/default.conf:
--------------------------------------------------------------------------------
1 | upstream phpfcgi {
2 | server php:9000;
3 | }
4 |
5 | server {
6 | listen 80;
7 |
8 | # Change domain names if needed
9 | server_name localhost;
10 | server_tokens off;
11 | root /srv/app/public;
12 |
13 | # restrict access to hidden files
14 | location ~ /\. {
15 | deny all;
16 | }
17 |
18 | location / {
19 | try_files $uri @rewriteapp;
20 | }
21 |
22 | location @rewriteapp {
23 | rewrite ^(.*)$ /index.php/$1 last;
24 | }
25 |
26 | # Redirect everything to php image
27 | location ~ ^/index\.php(/|$) {
28 | fastcgi_pass php:9000;
29 |
30 | fastcgi_split_path_info ^(.+\.php)(/.*)$;
31 |
32 | include fastcgi_params;
33 | fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
34 | fastcgi_param DOCUMENT_ROOT $realpath_root;
35 | fastcgi_param HTTPS off;
36 |
37 | # Prevents URI like *.*/index.php/*
38 | internal;
39 | }
40 |
41 | # 404 to prevent access to other php files than the front controller
42 | location ~ \.php$ {
43 | return 404;
44 | }
45 |
46 | # Access to logs
47 | error_log /var/log/nginx/jobs_error.log;
48 | access_log /var/log/nginx/jobs_access.log;
49 | }
50 |
--------------------------------------------------------------------------------
/docker/php/Dockerfile:
--------------------------------------------------------------------------------
1 | # Install Composer and PHP
2 | FROM composer:1.10 as composer
3 | FROM php:7.4-fpm-alpine
4 |
5 | COPY --from=composer /usr/bin/composer /usr/local/bin/composer
6 |
7 | LABEL maintainer="Gaëtan Rolé-Dubruille "
8 |
9 | # PECL
10 | ENV APCU_VERSION 5.1.18
11 |
12 | # Removing APKINDEX warnings
13 | RUN rm -rf /var/cache/apk/* && \
14 | rm -rf /tmp/*
15 |
16 | RUN apk update
17 |
18 | # Native libs and building dependencies
19 | # su-exec > gosu (10kb instead of 1.8MB)
20 | RUN apk add --update --no-cache \
21 | git \
22 | unzip \
23 | zlib-dev \
24 | libzip-dev \
25 | ca-certificates \
26 | && apk add --no-cache --virtual .build-deps \
27 | $PHPIZE_DEPS \
28 | curl \
29 | icu-dev \
30 | && docker-php-ext-install \
31 | zip \
32 | pdo_mysql \
33 | && yes | pecl install apcu-${APCU_VERSION} \
34 | && yes | pecl install xdebug \
35 | && docker-php-ext-enable apcu \
36 | && docker-php-ext-enable opcache \
37 | && apk add --no-cache su-exec \
38 | && addgroup bar \
39 | && adduser -D -h /home -s /bin/sh -G bar foo \
40 | && apk del .build-deps
41 |
42 | # PHP-CS-FIXER
43 | RUN wget http://cs.sensiolabs.org/download/php-cs-fixer-v2.phar -O php-cs-fixer \
44 | && chmod a+x php-cs-fixer \
45 | && mv php-cs-fixer /usr/local/bin/php-cs-fixer
46 |
47 | # PHP config
48 | COPY conf.d/php.ini /usr/local/etc/php
49 | COPY conf.d/xdebug.ini /usr/local/etc/php/conf.d
50 | RUN echo "zend_extension=$(find /usr/local/lib/php/extensions/ -name xdebug.so)" >> /usr/local/etc/php/conf.d/xdebug.ini
51 |
52 | # Entrypoint
53 | COPY ./bin/entrypoint.sh /usr/local/bin/entrypoint
54 | ENTRYPOINT ["/usr/local/bin/entrypoint"]
55 |
--------------------------------------------------------------------------------
/docker/php/bin/entrypoint.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | ## Pay attention to file permissions, otherwise: RUN chmod +x entrypoint.sh
3 | set -e
4 |
5 | uid=$(stat -c %u /srv)
6 | gid=$(stat -c %g /srv)
7 |
8 | if [[ $uid == 0 ]] && [[ $gid == 0 ]]; then
9 | if [[ $# -eq 0 ]]; then
10 | php-fpm --allow-to-run-as-root
11 | else
12 | echo "$@"
13 | exec "$@"
14 | exit
15 | fi
16 | fi
17 |
18 | sed -i -r "s/foo:x:\d+:\d+:/foo:x:$uid:$gid:/g" /etc/passwd
19 | sed -i -r "s/bar:x:\d+:/bar:x:$gid:/g" /etc/group
20 |
21 | chown $uid:$gid /home
22 |
23 | sed -i "s/user = www-data/user = foo/g" /usr/local/etc/php-fpm.d/www.conf
24 | sed -i "s/group = www-data/group = bar/g" /usr/local/etc/php-fpm.d/www.conf
25 |
26 | user=$(grep ":x:$uid:" /etc/passwd | cut -d: -f1)
27 | if [[ $# -eq 0 ]]; then
28 | php-fpm
29 | else
30 | echo su-exec $user "$@"
31 | exec su-exec $user "$@"
32 | fi
33 |
--------------------------------------------------------------------------------
/docker/php/conf.d/php.ini:
--------------------------------------------------------------------------------
1 | # https://github.com/php/php-src/blob/master/php.ini-development
2 |
3 | [core]
4 | apc.enable_cli = 1
5 | date.timezone = Europe/Paris
6 | session.auto_start = Off
7 | short_open_tag = Off
8 | realpath_cache_size = 4096K
9 | realpath_cache_ttl = 600
10 | expose_php = Off
11 |
12 | [opcache]
13 | opcache.interned_strings_buffer = 16
14 | opcache.max_accelerated_files = 32531
15 | opcache.memory_consumption = 256
16 |
--------------------------------------------------------------------------------
/docker/php/conf.d/xdebug.ini:
--------------------------------------------------------------------------------
1 | [xdebug]
2 | xdebug.default_enable = 1
3 | xdebug.remote_enable = 1
4 | xdebug.remote_autostart = 1
5 | # Not ignoring remote_host
6 | xdebug.remote_connect_back = 0
7 | xdebug.remote_port = 9005
8 | # Show stack trace
9 | xdebug.show_error_trace = 1
10 | xdebug.remote_log = /tmp/xdebug.log
11 | xdebug.idekey = PHPSTORM
12 | xdebug.file_link_format = phpstorm://open?%f:%l
13 |
--------------------------------------------------------------------------------