Skip to content

Commit

Permalink
feat(xdebug): Add more parameters to XDebug jsonnet function
Browse files Browse the repository at this point in the history
  • Loading branch information
Toilal committed Nov 27, 2020
1 parent b240b07 commit cf5dc74
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions ddb/feature/jsonnet/lib/ddb.docker.libjsonnet
Expand Up @@ -243,14 +243,14 @@ local VirtualHost = if _docker_reverse_proxy_type == "traefik" then TraefikVirtu

// XDebug 3 configuration has changed.
// Default TCP port has changed from 9000 to 9003, but we still configure it to 9000 to avoid confusion while configuring code editors.
local XDebug(version=null) =
local xdebug2_config = ["remote_enable=on","remote_autostart=off", "idekey=" + _core_project_name, "remote_host=" + _docker_debug_host];
local XDebug(version=null, session=_core_project_name, mode="debug") =
local xdebug2_config = ["remote_enable=" + if mode != "off" then "on" else "off", "remote_autostart=off", "idekey=" + session, "remote_host=" + _docker_debug_host];
local xdebug3_config = ["client_host=" + _docker_debug_host, "client_port=9000"];
{
[if !_docker_debug_disabled then "environment"]: {
[if version == null || version == 2 then "PHP_IDE_CONFIG"]: "serverName=" + _core_project_name,
[if version == null || version == 3 then "XDEBUG_MODE"]: "debug",
[if version == null || version == 3 then "XDEBUG_SESSION"]: _core_project_name,
[if version == null || version == 2 then "PHP_IDE_CONFIG"]: "serverName=" + session,
[if version == null || version == 3 then "XDEBUG_MODE"]: mode,
[if version == null || version == 3 then "XDEBUG_SESSION"]: session,
[if version == 2 then "XDEBUG_CONFIG"]: std.join(' ', xdebug2_config),
[if version == 3 then "XDEBUG_CONFIG"]: std.join(' ', xdebug3_config),
[if version == null then "XDEBUG_CONFIG"]: std.join(' ', (xdebug2_config + xdebug3_config))
Expand Down

0 comments on commit cf5dc74

Please sign in to comment.