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

Add the ability to set a project root #15

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Stoux
Copy link

@Stoux Stoux commented Sep 30, 2019

This adds the ability to set a project root, bugsnag docs: https://docs.bugsnag.com/platforms/php/other/configuration-options/#project-root.

By either setting the absolute path or the value true in the env.php file you can set the project root in Bugsnag. Bugsnag will strip the paths from errors & exceptions, normalising the paths across all deployments.

When the value true is entered, it will resolve the path using Magento's DirectoryList.

This allows you to strip the deployment path from Bugsnag errors, normalising all paths across multiple deployments.
See: https://docs.bugsnag.com/platforms/php/other/configuration-options/#project-root
// The root should be resolved by Magento
return $this->directoryList->getRoot();
} else {
Copy link
Author

Choose a reason for hiding this comment

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

I thought about adding a } if else (is_dir($projectroot)) { check here, but figured this allows more flexibility? Thoughts?

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.

1 participant