Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[5.x] Add graceful handler for SIGINT for .env restoration #682

Merged
merged 6 commits into from
Oct 18, 2019

Conversation

mbardelmeijer
Copy link
Contributor

This PR ensures that if the php artisan dusk command is cancelled by a CTRL+C (command cancel, i.e. SIGINT), the original .env is restored correctly.

We often run a dusk test, and cancel within the test suite if an issue comes up. In that case, the .env.backup isn't restored, and requires it to be restored manually.

Also adds a try {} finally {} clause if the Dusk commands fails themself the environment is still restored.

@driesvints driesvints changed the title Add graceful handler for SIGINT for .env restoration [5.x] Add graceful handler for SIGINT for .env restoration Oct 14, 2019
src/Console/DuskCommand.php Outdated Show resolved Hide resolved
src/Console/DuskCommand.php Show resolved Hide resolved
@driesvints driesvints dismissed their stale review October 14, 2019 13:16

Changes made.

@taylorotwell
Copy link
Member

Don't use declare(ticks=1)... use asnyc signals which are available on all versions of PHP that Dusk requires.

@taylorotwell
Copy link
Member

@mbardelmeijer
Copy link
Contributor Author

Agreed; change is made with 874df3f.

@taylorotwell taylorotwell merged commit 874df3f into laravel:5.0 Oct 18, 2019
@driesvints driesvints mentioned this pull request Nov 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants