Skip to content

Conversation

@justinmaurerdotdev
Copy link
Contributor

@justinmaurerdotdev justinmaurerdotdev commented Sep 17, 2024

This addresses #70. This one is sort of complicated to reproduce accurately, but these tests demonstrate that a registered shutdown function is capable of writing to a file, so the reported issue is invalid, and can probably be safely closed as a "will not fix". Brian and I decided that we preferred the error_log() demonstration over file_put_contents() for Behat, but we tested both ways and the result was the same.

Submitted during Contributor Day.

register_shutdown_function(function() {
error_log('LOG A SHUTDOWN FROM ERROR');
// file_put_contents( dirname( __FILE__ ) . '/log.log', print_r( 'Shutdown called correctly', true ) . "\r\n\r\n", FILE_APPEND );
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line can be removed.

@swissspidy swissspidy linked an issue Mar 31, 2025 that may be closed by this pull request
2 tasks
@swissspidy swissspidy merged commit 984b30b into wp-cli:main Mar 31, 2025
37 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

When running cron event produces a fatal error, the shutdown function doesn't run

3 participants