diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index bc5dbd3..2164204 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,11 +1,8 @@ // For format details, see https://aka.m s/devcontainer.json. For config options, see the // README at: https://github.com/devcontainers/templates/tree/main/src/php { - "name": "Todo App", - "image": "mcr.microsoft.com/devcontainers/php:1-7.4-bullseye", - // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile - "workspaceFolder": "/var/www/html", - // Features to add to the dev container. More info: https://containers.dev/features. + "name": "PHP", + "image": "mcr.microsoft.com/devcontainers/php:7.4-bullseye", "features": { "ghcr.io/devcontainers/features/git:1": {} }, @@ -23,7 +20,7 @@ "forwardPorts": [ 8080 ], - "postCreateCommand": "sudo chmod a+x \"$(pwd)\" && sudo rm -rf /var/www/html && sudo ln -s \"$(pwd)\" /var/www/html", + // "postCreateCommand": "sudo chmod a+x \"$(pwd)\" && sudo rm -rf /var/www/html && sudo ln -s \"$(pwd)\" /var/www/html", // Use 'portsAttributes' to set default properties for specific forwarded ports. More info: https://code.visualstudio.com/docs/remote/devcontainerjson-reference. "portsAttributes": { "8080": { diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..9dc6b4d --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,48 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": "Listen for Xdebug", + "type": "php", + "request": "launch", + "port": 9003 + }, + { + "name": "Launch currently open script", + "type": "php", + "request": "launch", + "program": "${file}", + "cwd": "${fileDirname}", + "port": 0, + "runtimeArgs": [ + "-dxdebug.start_with_request=yes" + ], + "env": { + "XDEBUG_MODE": "debug,develop", + "XDEBUG_CONFIG": "client_port=${port}" + } + }, + { + "name": "Launch Built-in web server", + "type": "php", + "request": "launch", + "runtimeArgs": [ + "-dxdebug.mode=debug", + "-dxdebug.start_with_request=yes", + "-S", + "localhost:0" + ], + "program": "", + "cwd": "${workspaceRoot}", + "port": 9003, + "serverReadyAction": { + "pattern": "Development Server \\(http://localhost:([0-9]+)\\) started", + "uriFormat": "http://localhost:%s", + "action": "openExternally" + } + } + ] +} \ No newline at end of file