Skip to content

Commit bae1179

Browse files
committed
add devcontainer and launch profile for VS Code
1 parent 4a793de commit bae1179

File tree

4 files changed

+40
-0
lines changed

4 files changed

+40
-0
lines changed

.devcontainer/devcontainer.json

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"name": "mindplay/sql",
3+
"dockerComposeFile": "../docker-compose.yml",
4+
"service": "php",
5+
"workspaceFolder": "/app",
6+
"customizations": {
7+
"vscode": {
8+
"extensions": [
9+
"DEVSENSE.phptools-vscode",
10+
"xdebug.php-debug"
11+
]
12+
},
13+
"settings": {
14+
"php.validate.executablePath": "/usr/local/bin/php"
15+
}
16+
},
17+
"postCreateCommand": "composer update"
18+
}

.vscode/launch.json

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"version": "0.2.0",
3+
"configurations": [
4+
{
5+
"name": "Debug test/test.php",
6+
"type": "php",
7+
"request": "launch",
8+
"cwd": "/app",
9+
"program": "/app/test/test.php",
10+
"externalConsole": false,
11+
"port": 9003
12+
}
13+
]
14+
}

Dockerfile

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ RUN apt-get update && apt-get install -y \
77
libpq-dev \
88
mariadb-client \
99
unzip \
10+
git \
1011
&& docker-php-ext-install pdo pdo_mysql pdo_pgsql
1112

1213
# Install xdebug

README.md

+7
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,13 @@ Code adheres to [PSR-2](http://www.php-fig.org/psr/psr-2/) and [PSR-4](http://ww
4747

4848
You need a working [Docker](https://docs.docker.com/get-docker/) installation to run the tests.
4949

50+
#### Using VS Code
51+
52+
The project includes a [DevContainer](https://containers.dev/) and a `launch.json` for testing and debugging
53+
with VS Code - just open the project in VS Code, hit `F5` to run the tests, and you should be good to go. ✨
54+
55+
#### Using Docker
56+
5057
To launch Docker and run the test-suite, e.g. in PHP `8.3`:
5158

5259
./test.sh 8.3

0 commit comments

Comments
 (0)