Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: ad .devcontainer file e.g. for GitHub Codespaces #1136

Merged
merged 2 commits into from Aug 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
50 changes: 50 additions & 0 deletions .devcontainer/devcontainer.json
@@ -0,0 +1,50 @@
{
"name": "PHP",
"image": "mcr.microsoft.com/devcontainers/php",
"customizations": {
"vscode": {
"extensions": [
"github.codespaces",
// PHP from https://github.com/devcontainers/templates/tree/main/src/php
"xdebug.php-debug",
"bmewburn.vscode-intelephense-client",
"xdebug.php-pack",
// PHP
"DEVSENSE.phptools-vscode",
"DEVSENSE.composer-php-vscode",
// linting
"EditorConfig.EditorConfig",
"dbaeumer.vscode-eslint",
"raymondcamden.CSSLint",
// testing
"maty.vscode-mocha-sidebar"
]
},
"codespaces": {
"openFiles": [
"README.md",
"doc/README.md"
],
"repositories": {
"PrivateBin/*": {
"permissions": {
"pull_requests": "write"
}
}
}
}
},
"features": {
"ghcr.io/devcontainers-contrib/features/mocha:2": {}
},
"forwardPorts": [
8080
],
"postCreateCommand": [
"composer install --no-dev --optimize-autoloader",
"sudo chmod a+x \"$(pwd)\" && sudo rm -rf /var/www/html && sudo ln -s \"$(pwd)\" /var/www/html",
"npm install --global nyc"
],
// alternatiuve: apache2ctl start (but requires root)
"postAttachCommand": "php -S 0.0.0.0:8080"
}
7 changes: 7 additions & 0 deletions .vscode/extensions.json
@@ -0,0 +1,7 @@
{
"recommendations": [
"recca0120.vscode-phpunit",
"onecentlin.phpunit-snippets",
"devsense.profiler-php-vscode"
]
}
35 changes: 35 additions & 0 deletions .vscode/launch.json
@@ -0,0 +1,35 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Launch built-in server and debug",
"type": "php",
"request": "launch",
"runtimeArgs": [
"-S",
"localhost:8000",
"-t",
"."
],
"port": 9003,
"serverReadyAction": {
"action": "openExternally"
}
},
{
"name": "Debug current script in console",
"type": "php",
"request": "launch",
"program": "${file}",
"cwd": "${fileDirname}",
"externalConsole": false,
"port": 9003
},
{
"name": "Listen for Xdebug",
"type": "php",
"request": "launch",
"port": 9003
}
]
}