Skip to content

Commit 306b070

Browse files
authored
Merge pull request #97 from iazaran/xdebug
Xdebug
2 parents 3660297 + 1c4a4f2 commit 306b070

File tree

8 files changed

+43
-10
lines changed

8 files changed

+43
-10
lines changed

.vscode/launch.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"version": "0.2.0",
3+
"configurations": [
4+
{
5+
"name": "Listen for Xdebug",
6+
"type": "php",
7+
"request": "launch",
8+
"port": 9003,
9+
"pathMappings": {
10+
"/var/www/": "${workspaceFolder}"
11+
}
12+
}
13+
]
14+
}

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
### Dockerized Pure PHP Composer based MVC Framework
22

3-
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/9b13bf034af64123821121d191acfaff)](https://app.codacy.com/manual/eazaran/php-mvc?utm_source=github.com&utm_medium=referral&utm_content=iazaran/php-mvc&utm_campaign=Badge_Grade_Dashboard)
3+
[![Codacy Badge](https://app.codacy.com/project/badge/Grade/8d638fe590dd4e68b9ce4ac9a7517e3d)](https://app.codacy.com/gh/iazaran/php-mvc/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade)
44

55
> This project tries to cover some PHP features in a simple MVC structure with minimum installed composer packages. Then developers can use packages for specific requirements. Please add your ideas in Discussions, ask features or report bugs in issues.
66
@@ -86,6 +86,9 @@ Export a specific table from DB to a CSV file
8686
#### Use Ajax to send forms' data:
8787
Consider a route for your form like `/blog/create`; now use `blog-create` as an ID for form, and `blog-create-submit` for submit button ID. All form's buttons need to have constant `form-button` class.
8888

89+
#### Use Xdebug:
90+
Xdebug installed via Docker, so it is ready to use, just need to start debug in your IDE or start listen to the Xdebug.
91+
8992
#### RESTful API sample
9093

9194
```php

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
},
2222
"config": {
2323
"platform": {
24-
"php": "8.1"
24+
"php": "8.3"
2525
}
2626
},
2727
"require": {

composer.lock

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docker-compose.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,14 @@ services:
4343
command: php-fpm
4444
volumes:
4545
- ./:/var/www
46-
- ./docker/php/local.ini:/usr/local/etc/php/conf.d/local.in
46+
- ./docker/php/local.ini:/usr/local/etc/php/conf.d/local.ini
47+
- ./docker/php/xdebug.ini:/usr/local/etc/php/conf.d/xdebug.ini
48+
- ./docker/php/error_reporting.ini:/usr/local/etc/php/conf.d/error_reporting.ini
4749
working_dir: /var/www
4850
networks:
4951
- php-mvc-network
52+
extra_hosts:
53+
- "host.docker.internal:host-gateway"
5054

5155
php-mvc-cron:
5256
build:

docker/Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
FROM php:8.3-fpm
22

33
RUN apt-get update && apt-get install -y --no-install-recommends \
4-
apt-utils build-essential curl zip zlib1g-dev unzip \
4+
apt-utils build-essential curl zip zlib1g-dev libssl-dev unzip \
55
memcached libmemcached-dev \
66
libpng-dev libjpeg62-turbo-dev libfreetype6-dev \
77
jpegoptim optipng pngquant gifsicle \
@@ -18,6 +18,8 @@ RUN pecl install grpc \
1818
&& docker-php-ext-enable grpc
1919
RUN pecl install protobuf \
2020
&& docker-php-ext-enable protobuf
21+
RUN pecl install xdebug-3.3.0alpha3 \
22+
&& docker-php-ext-enable xdebug
2123

2224
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
2325

docker/php/error_reporting.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
error_reporting=E_ALL

docker/php/xdebug.ini

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
zend_extension=xdebug.so
2+
3+
[xdebug]
4+
xdebug.mode=develop,coverage,debug,profile
5+
xdebug.client_host=host.docker.internal
6+
xdebug.client_port=9003
7+
xdebug.start_with_request=yes
8+
xdebug.log=/tmp/xdebug.log
9+
xdebug.idekey=docker

0 commit comments

Comments
 (0)