Skip to content

Commit e905acd

Browse files
committed
add php-watcher for hot code reloading
1 parent 6172b76 commit e905acd

File tree

3 files changed

+21
-1
lines changed

3 files changed

+21
-1
lines changed

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ mv dev/.* dev/* ./ && rmdir dev
1616
bin/console react-server:http
1717
````
1818

19+
Open your browser on port `8080`
20+
1921
### Development Mode
2022

2123
To run it in dev mode you can run `config:development-mode` command
@@ -30,6 +32,14 @@ Or you can do it by hand renaming from `config/services/dependencies.dev.yaml.di
3032
mv config/services/dependencies.dev.yaml.dist config/services/dependencies.dev.yaml
3133
````
3234

35+
### Hot Code Reloading
36+
37+
You can use [Php whatcher](https://github.com/seregazhuk/php-watcher) with composer for more friendly development.
38+
39+
````bash
40+
composer watch
41+
````
42+
3343
![Default homepage](https://getting-started.antidotfw.io/images/default-homepage.jpg)
3444

3545
Open another console and check the built-in Cli tool

composer.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
"phpstan/phpstan": "^0.11.5",
3939
"phpunit/phpunit": "^8.0",
4040
"roave/security-advisories": "dev-master",
41+
"seregazhuk/php-watcher": "^0.5.1",
4142
"squizlabs/php_codesniffer": "^3.4",
4243
"symfony/var-dumper": "^4.2",
4344
"zendframework/zend-component-installer": "^2.1"
@@ -61,7 +62,8 @@
6162
"cs-check": "phpcs src --colors",
6263
"cs-fix": "phpcbf src --colors",
6364
"inspect": "phpstan analyse src -l7 --ansi",
64-
"test": "phpunit --colors=always"
65+
"test": "phpunit --colors=always",
66+
"watch": "php-watcher bin/console --arguments react-server:http --delay 5 --ansi"
6567
},
6668
"config": {
6769
"sort-packages": true

php-watcher.yml.dist

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
watch:
2+
- src
3+
- config
4+
extensions:
5+
- php
6+
- yml
7+
ignore:
8+
- tests

0 commit comments

Comments
 (0)