-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
39 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,33 @@ | ||
MAKEFLAGS += --always-make | ||
|
||
XDEBUG_VERSION := 3.2.2 | ||
XDEBUG_GIT_URL := https://github.com/xdebug/xdebug | ||
|
||
all: fetch-xdebug apply-patch build | ||
@echo Use zend_extension=$$PWD/xdebug/modules/xdebug.so | ||
|
||
fetch-xdebug: cleanall | ||
git clone --depth 1 --branch "$(XDEBUG_VERSION)" 'https://github.com/xdebug/xdebug' | ||
@git clone --depth 1 --branch "$(XDEBUG_VERSION)" "$(XDEBUG_GIT_URL)" | ||
|
||
patch-status: | ||
git -C ./xdebug/ status | ||
show-status: | ||
@git -C ./xdebug/ status | ||
|
||
apply-patch: | ||
git -C ./xdebug/ apply ../fracker.patch | ||
@git -C ./xdebug/ apply ../fracker.patch | ||
|
||
format-patch: | ||
git -C ./xdebug/ add . | ||
git -C ./xdebug/ diff --cached | grep --invert-match '^index ' >fracker.patch | ||
@git -C ./xdebug/ add . | ||
@git -C ./xdebug/ diff --cached | grep --invert-match '^index ' >fracker.patch | ||
|
||
build: | ||
cd ./xdebug/ \ | ||
@cd ./xdebug/ \ | ||
&& make distclean || true \ | ||
&& phpize --clean \ | ||
&& phpize \ | ||
&& ./configure \ | ||
&& make -j "$(shell nproc)" | ||
|
||
clean: | ||
git -C ./xdebug/ reset --hard HEAD | ||
git -C ./xdebug/ clean -dx --force | ||
@git -C ./xdebug/ reset --hard HEAD | ||
@git -C ./xdebug/ clean -dx --force | ||
|
||
cleanall: | ||
rm -fr ./xdebug/ | ||
@rm -fr ./xdebug/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,35 @@ | ||
# Development | ||
# PHP extension development | ||
|
||
Instead of keeping a fork of Xdebug, we keep a single patch file so that all the changes are self-contained. | ||
All the changes introduced by Fracker to Xdebug are self-contained in a single [patch file](./fracker.patch), to update it: | ||
|
||
To make a change to the extension: | ||
1. first make sure to start from a fresh state with: | ||
|
||
1. first make sure to start from a fresh state with `make fetch-xdebug`; | ||
``` | ||
make fetch-xdebug | ||
``` | ||
|
||
2. then load the existing patch with `make apply-patch`; | ||
2. then load the existing patch with: | ||
|
||
3. experiment and make the changes in the `./xdebug/` directory; | ||
``` | ||
make apply-patch | ||
``` | ||
|
||
4. finally save the patch with `make format-patch`. | ||
3. make the changes in the `./xdebug/` directory, each time building with: | ||
|
||
To update the Xdebug version change the `XDEBUG_VERSION` variable in the `Makefile` then continue with the above steps. You might need to resolve conflicts and other issues manually. | ||
``` | ||
make build | ||
``` | ||
|
||
4. try the extansion with: | ||
|
||
``` | ||
php -d zend_extension=$PWD/xdebug/modules/xdebug.so -r 'var_dump(123);' | ||
``` | ||
|
||
5. finally save the patch with: | ||
|
||
``` | ||
make format-patch | ||
``` | ||
|
||
To update the Xdebug version, change the `XDEBUG_VERSION` variable in the `Makefile` then repeat the above steps. You might need to resolve conflicts and other issues manually. |