Skip to content

Commit

Permalink
Merge pull request #95 from anaelChardan/xdebug
Browse files Browse the repository at this point in the history
ADD Xdebug
  • Loading branch information
Plopix authored Nov 23, 2020
2 parents cc2c536 + 4403c90 commit e80ab2b
Show file tree
Hide file tree
Showing 10 changed files with 27 additions and 11 deletions.
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ list:
@grep -E '^[a-zA-Z-]+:.*?## .*$$' Makefile | sort | awk 'BEGIN {FS = ":.*?## "}; {printf " ${YELLOW}%-15s${RESTORE} > %s\n", $$1, $$2}'
@echo "${RED}==============================${RESTORE}"

.PHONY: install
install: ## Install the vendor
@composer install

.PHONY: codeclean
codeclean: ## Run the codechecker
bash $(SCRIPS_DIR)/codechecker.bash
Expand Down
1 change: 1 addition & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
### ?.?.?

- Add support for calling composer ezplatform-install (script) on "initialdata" argument
- Add support for xdebug


### 1.4.0
Expand Down
3 changes: 3 additions & 0 deletions payload/dev/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ services:
- PROJECTMAPPINGFOLDER
- DEV_UID
- DEV_GID
- XDEBUG_ENABLED
- "XDEBUG_CONFIG=remote_host=172.17.0.1"
- "PHP_IDE_CONFIG=serverName=ezplatform"
- "EZP_TEST_REST_HOST=nginx"
- "DATABASE_PREFIXES=DATABASE"
- "DATABASE_USER=root"
Expand Down
6 changes: 6 additions & 0 deletions payload/dev/engine/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
FROM plopix/docker-php-ez-engine:7.4
MAINTAINER Plopix

ENV XDEBUG_ENABLED=0

RUN mkdir /usr/local/etc/php/enable-xdebug

COPY xdebug.ini /usr/local/etc/php/enable-xdebug/99-xdebug.ini

COPY entrypoint.bash /entrypoint.bash
RUN chmod +x /entrypoint.bash
ENTRYPOINT ["/entrypoint.bash"]
Expand Down
4 changes: 4 additions & 0 deletions payload/dev/engine/entrypoint.bash
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,8 @@ then
fi
/usr/local/bin/composer self-update --1

if [ "1" = "${XDEBUG_ENABLED}" ]; then
export PHP_INI_SCAN_DIR=:/usr/local/etc/php/enable-xdebug
fi

exec "$@"
10 changes: 0 additions & 10 deletions payload/dev/engine/php.ini
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,6 @@ sendmail_path = /usr/bin/env catchmail --smtp-ip mailcatcher --smtp-port 1025 -f
extension=blackfire.so
blackfire.agent_socket=tcp://blackfire:8707

# X-Debug is disable by default, uncomment and run 'ez stop engine; ez build engine; ez up engine' to enable it
#zend_extension=/usr/local/lib/php/extensions/no-debug-non-zts-20170718/xdebug.so
#xdebug.remote_enable=1
## Using Linux? define the correct host and if you find a automated way to do it: tell us on the channel #ez-launchpad
#xdebug.remote_host=host.docker.internal
#xdebug.remote_port=9000
#xdebug.max_nesting_level=1000
#xdebug.remote_autostart=1
#xdebug.remote_connect_back=0

[Date]
date.timezone = "America/Los_Angeles"

Expand Down
6 changes: 6 additions & 0 deletions payload/dev/engine/xdebug.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
zend_extension=/usr/local/lib/php/extensions/no-debug-non-zts-20190902/xdebug.so
xdebug.default_enable=1
xdebug.remote_enable=1
xdebug.max_nesting_level=1000
xdebug.idekey=XDEBUG_IDE_KEY
xdebug.remote_connect_back=1
2 changes: 1 addition & 1 deletion src/Command/Docker/Initialize.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ private function getEzPlataformMajorVersion(InputInterface $input): int
$isNetgenMedia = 'netgen' === $normalizedProvider;

if ($isNetgenMedia) {
$normalizedMajorVersion++;
++$normalizedMajorVersion;
}

return $normalizedMajorVersion;
Expand Down
1 change: 1 addition & 0 deletions src/Core/Client/Docker.php
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ public function getComposeEnvVariables(): array
'DOCKER_CERT_PATH' => getenv('DOCKER_CERT_PATH'),
'DOCKER_TLS_VERIFY' => getenv('DOCKER_TLS_VERIFY'),
'PATH' => getenv('PATH'),
'XDEBUG_ENABLED' => false === getenv('XDEBUG_ENABLED') ? '0' : '1',
];
}

Expand Down
1 change: 1 addition & 0 deletions tests/Tests/Unit/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ public function getDockerClientEnvironmentVariables(): array
'DOCKER_CERT_PATH' => getenv('DOCKER_CERT_PATH'),
'DOCKER_TLS_VERIFY' => getenv('DOCKER_TLS_VERIFY'),
'PATH' => getenv('PATH'),
'XDEBUG_ENABLED' => getenv('XDEBUG_ENABLED') === false ? '0' : '1'
];
}
}

0 comments on commit e80ab2b

Please sign in to comment.