Skip to content

Commit 294a739

Browse files
committed
Document usage of docker image in CONTRIBUTING.md
1 parent a18a1f1 commit 294a739

1 file changed

Lines changed: 17 additions & 1 deletion

File tree

CONTRIBUTING.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,21 @@
11
# Contributing
22

3+
## Starting the PHP docker container
4+
5+
For easier development, a bundled dockerfile can be started with:
6+
```bash
7+
docker compose up -d
8+
```
9+
10+
It contains php-spx for easier profiling of memory/cpu usage, which can be enabled by prefixing any command in the PHP container with SPX_ENABLED=1
11+
12+
## Profiling specific PDFs
13+
14+
To profile how a specific PDF is being parsed, you can run the parser with SPX_ENABLED=1 for a specific sample from the Samples test suite. For example, to debug the file in `tests/Samples/files/gdocs-image-simple/file.pdf`, you can run the following command:
15+
```bash
16+
docker compose exec -e SPX_ENABLED=1 php vendor/bin/phpunit tests/Samples/ --filter "gdocs-image-simple"
17+
```
18+
319
## Acquiring the specification document
420

521
Because the specification document is not freely available, it cannot be included in this repository directly. The specification document is downloadable on two different places:
@@ -12,7 +28,7 @@ Because the specification document is not freely available, it cannot be include
1228
In the `tests/Samples/files` directory, create a new directory with a descriptive title. If you don't know what title to use, you can use the issue number like this: `issue-1234`. Place the sample file in this directory, and make sure that the file is named `file.pdf`. To create the `content.yml` file with the expected output, run the following command:
1329

1430
```bash
15-
composer update-content
31+
docker compose exec php composer update-content
1632
```
1733

1834
## Debugging file encryption keys

0 commit comments

Comments
 (0)