Do not stop at the first PHP error/warning in files:scan
- Resolves: #35931
Summary
The files:scan command sets a custom error handler to show PHP errors. But it stops at the first one, failing the whole scan for one malformed PNG file. This PR changes that to instead show errors but continue.
Output:

Checklist
- Code is properly formatted
- Sign-off message is added to all commits
- [x] Tests (unit, integration, api and/or acceptance) are included
- [x] Screenshots before/after for front-end changes
- [x] Documentation (manuals or wiki) has been updated or is not required
- [x] Backports requested where applicable (ex: critical bugfixes)
Is the full stack trace needed on screen? Could it be logged (on file) and instead just display the exeption message?
Is the full stack trace needed on screen? Could it be logged (on file) and instead just display the exeption message?
The full stack trace was there on screen already, I did not change that. But I now changed it so that the stacktrace only shows in very verbose mode, it makes more sense :+1:
/backport to stable26
/backport to stable25
~~Putting the full exception trace in the output isn't great imo. Probably better to only show the message in the output and log the rest.~~
Edit: missed the previous discussion
Additionally, summarizing the number of failures somewhere at the end would prevent errors from being unseen from scrolling of the screen with large verbose outputs.
Additionally, summarizing the number of failures somewhere at the end would prevent errors from being unseen from scrolling of the screen with large verbose outputs.
Added an error counter.
The backport to stable25 failed. Please do this backport manually.
# Switch to the target branch and update it
git checkout stable25
git pull origin/stable25
# Create the new backport branch
git checkout -b fix/foo-stable25
# Cherry pick the change from the commit sha1 of the change against the default branch
# This might cause conflicts. Resolve them.
git cherry-pick abc123
# Push the cherry pick commit to the remote repository and open a pull request
git push origin fix/foo-stable25
More info at https://docs.nextcloud.com/server/latest/developer_manual/getting_started/development_process.html#manual-backport