Skip to content

Commit

Permalink
add php debug config (and vscode launch config)
Browse files Browse the repository at this point in the history
  • Loading branch information
jabberwoc committed Mar 18, 2024
1 parent 0af225d commit 5c8064a
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 3 deletions.
27 changes: 27 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
// 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,
"pathMappings":
{
"/var/www/html/apps-extra/templateapp": "${workspaceFolder}",
}
},
{
"name": "Launch currently open script",
"type": "php",
"request": "launch",
"program": "${file}",
"cwd": "${fileDirname}",
"port": 9003
}
]
}
7 changes: 4 additions & 3 deletions dev/compose.yaml
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
# SPDX-FileCopyrightText: 2024 Sebastian Stöcker <[email protected]>
# SPDX-License-Identifier: AGPL-3.0-or-later

version: '3'
name: 'nc-dev'
version: "3"
name: "nc-dev"

services:

nextcloud:
image: ghcr.io/juliushaertl/nextcloud-dev-php80:latest
environment:
SERVER_BRANCH: v27.1.5
PHP_XDEBUG_MODE: debug #develop
volumes:
- ./data/shared:/shared
- ./data/xdebug.ini:/usr/local/etc/php/conf.d/xdebug.ini
- ../:/var/www/html/apps-extra/templateapp
ports:
- "8080:80"
Expand Down
24 changes: 24 additions & 0 deletions dev/data/xdebug.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
; SPDX-FileCopyrightText: Sebastian Stöcker <[email protected]>
; SPDX-License-Identifier: AGPL-3.0-or-later
; off develop debug gcstats profile trace
xdebug.mode = debug
xdebug.idekey=PHPSTORM
xdebug.trace_output_name=trace.%R.%u
xdebug.profiler_output_name=profile.%R.%u
xdebug.output_dir=/shared/xdebug

xdebug.log = /var/log/xdebug.log
xdebug.log_level = 1

; Try to discover the client host, otherwise fall back to the docker host
xdebug.discover_client_host=true
xdebug.client_host=host.docker.internal

; When you cannot specify a trigger, use "xdebug.start_with_request = yes" to autostart debugging for all requests
; https://xdebug.org/docs/all_settings#start_with_request
xdebug.start_with_request = yes

; Set xdebug.mode trace to use this
; More details at https://derickrethans.nl/flamboyant-flamegraphs.html
xdebug.trace_format=3
xdebug.trace_output_name=xdebug.%R.%u

0 comments on commit 5c8064a

Please sign in to comment.