Skip to content

Commit 7f105e9

Browse files
author
DKravtsov
committed
Updated docs and development environment configs.
1 parent 15eb883 commit 7f105e9

12 files changed

Lines changed: 436 additions & 282 deletions

File tree

‎composer.json‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,16 @@
1111
"homepage": "https://github.com/systemsdk/phpcpd",
1212
"license": "BSD-3-Clause",
1313
"authors": [
14-
{
15-
"name": "Sebastian Bergmann",
16-
"email": "sebastian@phpunit.de",
17-
"role": "lead"
18-
},
1914
{
2015
"name": "Dmitry Kravtsov",
2116
"email": "dmitry.kravtsov@systemsdk.com",
2217
"homepage": "https://github.com/systemsdk",
23-
"role": "Developer"
18+
"role": "Project Lead"
19+
},
20+
{
21+
"name": "Sebastian Bergmann",
22+
"email": "sebastian@phpunit.de",
23+
"role": "Original Author"
2424
}
2525
],
2626
"funding": [

‎composer.lock‎

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎docker/dev/www.conf‎

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,27 @@
1+
; ==============================================================================
2+
; PHP-FPM 'www' pool configuration
3+
;
4+
; Full documentation, default values, and all available directives:
5+
; https://github.com/php/php-src/blob/master/sapi/fpm/www.conf.in
6+
; ==============================================================================
7+
18
[www]
29
user = www-data
310
group = www-data
4-
listen = *:9000
5-
pm = ondemand
11+
listen = 0.0.0.0:9000
12+
13+
clear_env = no
14+
catch_workers_output = yes
15+
decorate_workers_output = no
16+
17+
pm = dynamic
618
pm.max_children = 150
7-
pm.start_servers = 10
19+
pm.start_servers = 20
820
pm.min_spare_servers = 10
9-
pm.max_spare_servers = 20
10-
pm.process_idle_timeout = 1200s
11-
pm.max_requests = 100
21+
pm.max_spare_servers = 50
22+
23+
pm.max_requests = 500
24+
1225
request_terminate_timeout = 1200s
1326
request_slowlog_timeout = 800s
1427
slowlog = /proc/self/fd/2

‎docker/dev/xdebug-main.ini‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
[PHP]
22
xdebug.mode = coverage,debug,develop
33
xdebug.client_port = 9003
4+
45
xdebug.client_host = 172.17.0.1
6+
xdebug.discover_client_host = 1
7+
58
xdebug.idekey = PHPSTORM
69
#xdebug.show_error_trace = 1
710
xdebug.start_with_request = yes
811
xdebug.file_link_format = phpstorm://open?%f:%l
9-
xdebug.discover_client_host= 1
1012
xdebug.max_nesting_level = 10000
1113
xdebug.log_level = 0

‎docker/dev/xdebug-osx.ini‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
[PHP]
22
xdebug.mode = coverage,debug,develop
33
xdebug.client_port = 9003
4+
45
xdebug.client_host = host.docker.internal
6+
xdebug.discover_client_host= 0
7+
58
xdebug.idekey = PHPSTORM
69
#xdebug.show_error_trace = 1
710
xdebug.start_with_request = yes
811
xdebug.file_link_format = phpstorm://open?%f:%l
9-
xdebug.discover_client_host= 0
1012
xdebug.max_nesting_level = 10000
1113
xdebug.log_level = 0
12-
xdebug.extended_info = On

‎docs/support.md‎

Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,148 @@
1+
# General Guidelines for the Support Team
2+
3+
## Requirements
4+
* Docker Engine version 23.0 or later
5+
* Docker Compose version 2.0 or later
6+
* An editor or IDE
7+
8+
Note: We recommend using a Linux Ubuntu-based OS for the best experience.
9+
10+
## Components
11+
1. PHP 8.5 fpm
12+
2. Composer 2
13+
3. Phive 0.16
14+
4. Phing 3.1
15+
5. Xalan 1.12
16+
17+
## Setting up Docker Engine & Docker Compose
18+
To install Docker Engine and Docker Compose, please follow the official [Docker Engine Installation Guide](https://docs.docker.com/engine/install/).
19+
20+
**For Linux Users:**
21+
After installation, run the following command to manage Docker as a non-root user (this allows you to run Docker without `sudo`):
22+
```bash
23+
sudo usermod -aG docker $USER
24+
```
25+
26+
Note: You must log out and log back in for this change to take effect.
27+
28+
**For macOS Users:**
29+
If you are using Docker Desktop for macOS 12.2 or later, we highly recommend enabling [virtiofs](https://www.docker.com/blog/speed-boost-achievement-unlocked-on-docker-desktop-4-6-for-mac/) for a significant performance boost.
30+
31+
Note: Enabled by default since Docker Desktop v4.22.
32+
33+
## Setting up the DEV environment
34+
1. Clone this repository from GitHub.
35+
36+
2. Edit and set `XDEBUG_CONFIG=` inside `.env` file (optional, by default `XDEBUG_CONFIG=main`).
37+
38+
3. Configure `/docker/dev/xdebug-main.ini` (Linux/Windows) or `/docker/dev/xdebug-osx.ini` (MacOS) (optional).
39+
40+
4. Build, start and install the docker images from your terminal:
41+
```bash
42+
make build-dev
43+
make start
44+
make setup
45+
```
46+
47+
## Accessing Container Shells
48+
Once the application is running (via `make start`), you can easily access the command line inside your containers.
49+
50+
To open a shell inside the container, run:
51+
```bash
52+
make ssh
53+
```
54+
55+
Tip: Type `exit` and press Enter to leave the container's shell and return to your local terminal.
56+
57+
## Rebuilding Containers
58+
If you modify any `Dockerfile` or environment configurations, you will need to rebuild the containers using the following commands:
59+
```bash
60+
make down
61+
make build-dev
62+
make start
63+
```
64+
65+
## Starting and Stopping Containers
66+
Use the following commands to start or stop the development environment:
67+
```bash
68+
make start
69+
make stop
70+
```
71+
72+
## Stopping and Removing Containers
73+
To completely stop and remove all environment containers and networks, use the following command:
74+
```bash
75+
make down
76+
```
77+
78+
## Available Makefile Commands
79+
Here is a reference list of the primary commands available for managing the environment, databases, logs and testing:
80+
```bash
81+
make build-dev
82+
83+
make start
84+
85+
make stop
86+
87+
make down
88+
89+
make restart
90+
91+
make ssh
92+
make ssh-root
93+
94+
make setup
95+
96+
make update
97+
98+
make composer-audit
99+
100+
make info
101+
make help
102+
103+
make phar
104+
make signed-phar
105+
106+
make phpunit
107+
make phpcs
108+
make ecs
109+
make ecs-fix
110+
make phpstan
111+
112+
make phpcpd-run
113+
make phpcpd-html-report
114+
115+
make logs
116+
```
117+
Note: For a complete list of all available commands, please inspect the `Makefile` directly or run `make help`.
118+
119+
## Architecture & packages
120+
* [cli-parser](https://packagist.org/packages/sebastian/cli-parser)
121+
* [version](https://packagist.org/packages/sebastian/version)
122+
* [php-file-iterator](https://packagist.org/packages/phpunit/php-file-iterator)
123+
* [php-timer](https://packagist.org/packages/phpunit/php-timer)
124+
* [phpunit](https://packagist.org/packages/phpunit/phpunit)
125+
* [composer-bin-plugin](https://packagist.org/packages/bamarni/composer-bin-plugin)
126+
* [security-advisories](https://packagist.org/packages/roave/security-advisories)
127+
* [easy-coding-standard](https://packagist.org/packages/symplify/easy-coding-standard)
128+
* [phpstan](https://packagist.org/packages/phpstan/phpstan)
129+
* [php-coveralls](https://github.com/php-coveralls/php-coveralls)
130+
131+
## Guidelines
132+
* [Report](https://github.com/systemsdk/phpcpd/blob/master/docs/report.md)
133+
* [Schema](https://github.com/systemsdk/phpcpd/blob/master/docs/schema.md)
134+
* [Phive](https://github.com/phar-io/phive)
135+
* [Phing](https://www.phing.info)
136+
* [Xalan](https://xalan.apache.org)
137+
138+
## Development Workflow
139+
1. **Branching:** Create a new branch from `develop` using one of the following patterns:
140+
* `feature/{ticketNo}`
141+
* `bugfix/{ticketNo}`
142+
2. **Commits:** Commit frequently and write clear, descriptive commit messages to facilitate the review process.
143+
3. **Pull Request:** Push your branch to the repository and open a Pull Request (PR) against the `develop` branch. Use the following naming convention for your PR: `feature/{ticketNo} - Short descriptive title of the Jira task`.
144+
4. **Review:** Address any feedback from reviewers and iterate as needed.
145+
5. **CI/CD Checks:** Ensure that all continuous integration checks (e.g., GitHub Actions) pass successfully and the build status is green.
146+
6. **Merge:** Once approved, your PR will be squashed and merged into `develop`. It will later be merged into a `release/{version}` branch for deployment.
147+
148+
Note: For a detailed visual guide on this branching model, please refer to the [Git Flow Cheatsheet](https://danielkummer.github.io/git-flow-cheatsheet).

0 commit comments

Comments
 (0)