Comments (8)
It is now posted to packagist. Either install from packagist or use the phar file (which we use over here). As there were more fixes than this single one it's not a single PR. Will split up & cherry pick if there is activity from the maintainer
from php-watcher.
Had this issue with our own code with graceful shut downs. I.e. the watcher does not wait for the app to shutdown. Fixed & re-released this with this commit.
Not sure about the maintenance status of this project so will keep it maintained in our fork until there is clearance.
from php-watcher.
@fritz-gerneth I would like to try your solution. It appears you changed the package name in your fork, but it is not available from packagist. How can I install it?
Also, perhaps you can try and post a PR to this project. There does not seem to be much activity, but that might just be because the project is somewhat finished - it is a simple utility after all, and apart from major new PHP versions and bug fixes, it should not need much maintenance.
from php-watcher.
Thank you @fritz-gerneth, installing with composer require --dev funct-gmbh/php-watcher
worked.
Restarting now works, but it appears a bit imperfect - there is a message telling me the app crashed when I simply change whitespace in a file to trigger a reload:
root@59d2aec7e8b2:/var/www# vendor/bin/php-watcher artisan --arguments=octane:start --watch=app
[PHP-Watcher] 1.0.0
[PHP-Watcher] watching: app
[PHP-Watcher] starting `php artisan octane:start`
ā
INFO Server runningā¦
Local: http://127.0.0.1:8000
Press Ctrl+C to stop the server
[PHP-Watcher] app crashed - waiting for file changes before starting...
[PHP-Watcher] restarting due to changes...
[PHP-Watcher] starting `php artisan octane:start`
ā”
INFO Server runningā¦
Local: http://127.0.0.1:8000
Press Ctrl+C to stop the server
from php-watcher.
Weird stuff.. It doesn't do that for me but restarts with the proper message... That'd mean artisan would quit with a non-zero code. Could you check the exit code (echo $?
) when starting the process manually & terminate it kill -INT $PID
?
( I also pushed v1.0.1 to include the code on app crash )
from php-watcher.
The process exits with code 137
after terminating it with kill -INT
. The output of the updated version confirms that:
[PHP-Watcher] app crashed (137) - waiting for file changes before starting...
What exact command are you using to watch octane?
from php-watcher.
Not using Laravel but for ReactPHP directly (i.e. php-watcher src/index.php
) but in general this should work with every script/language).
Not knowing the intrinsics I do not know why artisan would return with a 137 code (which it apparently does even without the php-watcher infront). Might be a topic for the laravel community :)
from php-watcher.
It appears that Octane generally does not fail gracefully on SIGTERM
, see laravel/octane#469
from php-watcher.
Related Issues (20)
- Move Symfony process dependency to dev
- Remove "script" from config and force it in CLI
- Decouple Screen from Application instance
- Option to disable spinner HOT 20
- Dockerized run loses STDERR
- Use `exec` when starting watcher script
- Reuse spinner
- [Feature] Watching whether the script is alive HOT 1
- Move spinner ending to Screen object HOT 1
- Use predefined const for PHP binary
- Make it compatible with Symfony 5 HOT 3
- Make php-cli-snake an optional requirement HOT 4
- Compatibility with Symfony5 HOT 1
- Console colours HOT 5
- php-watcher has unmet requirements HOT 1
- Create a new tag with the PHP 8 compatibility HOT 1
- Listening to graphql files
- High CPU usage
- Still maintaining?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
š Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ššš
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ā¤ļø Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from php-watcher.