Update v1.0.6
This commit is contained in:
3
vendor/bugsnag/bugsnag-laravel/.gitattributes
vendored
Normal file
3
vendor/bugsnag/bugsnag-laravel/.gitattributes
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
example/ export-ignore
|
||||
tests/ export-ignore
|
||||
phpunit.xml export-ignore
|
4
vendor/bugsnag/bugsnag-laravel/.gitignore
vendored
Normal file
4
vendor/bugsnag/bugsnag-laravel/.gitignore
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
/vendor
|
||||
composer.phar
|
||||
composer.lock
|
||||
.DS_Store
|
18
vendor/bugsnag/bugsnag-laravel/.travis.yml
vendored
Normal file
18
vendor/bugsnag/bugsnag-laravel/.travis.yml
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
language: php
|
||||
|
||||
php:
|
||||
- 5.3
|
||||
- 5.4
|
||||
- 5.5
|
||||
- 5.6
|
||||
|
||||
before_script:
|
||||
- travis_retry composer install --no-interaction --prefer-source
|
||||
|
||||
script:
|
||||
- phpunit
|
||||
|
||||
notifications:
|
||||
hipchat:
|
||||
rooms:
|
||||
secure: h9501ANwjT/oDK9YM1fmLV9+1WuhEWpRu35VCqJrOHEHpDQjk7W0LZw4xJo/kK10AKCN861U5VT1U5ncxujFLBZ2HnrKGraTCvXRss/dC2wn+fG2P+T4hsQGWAyU/rU/A8uPwZT71gqCmNtt1Xo/uGHt1UHT+H59J3d3GoFjgBY=
|
121
vendor/bugsnag/bugsnag-laravel/CHANGELOG.md
vendored
Normal file
121
vendor/bugsnag/bugsnag-laravel/CHANGELOG.md
vendored
Normal file
@@ -0,0 +1,121 @@
|
||||
Changelog
|
||||
=========
|
||||
|
||||
1.6.3
|
||||
-----
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- Avoid initializing Bugsnag when no API key is set
|
||||
| [Dries Vints](https://github.com/driesvints)
|
||||
| [#72](https://github.com/bugsnag/bugsnag-laravel/pull/72)
|
||||
|
||||
1.6.2
|
||||
-----
|
||||
|
||||
### Enhancements
|
||||
|
||||
- Add support for configuring the notifier completely from
|
||||
[environment variables](https://github.com/bugsnag/bugsnag-laravel#environment-variables)
|
||||
| [Andrew](https://github.com/browner12)
|
||||
| [#71](https://github.com/bugsnag/bugsnag-laravel/pull/71)
|
||||
|
||||
1.6.1
|
||||
-----
|
||||
- Fix array syntax for older php
|
||||
|
||||
1.6.0
|
||||
-----
|
||||
- Move to using .env for api key in laravel 5+
|
||||
- Support for artisan vendor:publish
|
||||
|
||||
1.5.1
|
||||
-----
|
||||
- Lumen Service Provider use statement
|
||||
|
||||
1.5.0
|
||||
-----
|
||||
- Lumen support
|
||||
- Fix bug in instructions
|
||||
- Fix bug with reading settings from service file
|
||||
|
||||
1.4.2
|
||||
-----
|
||||
- Try/catch for missing/nonstandard auth service
|
||||
|
||||
1.4.1
|
||||
-----
|
||||
- Default severity to 'error'
|
||||
|
||||
1.4.0
|
||||
-----
|
||||
- Better laravel 5 support!
|
||||
|
||||
1.3.0
|
||||
-----
|
||||
- Laravel 5 support!
|
||||
|
||||
1.2.1
|
||||
-----
|
||||
- Protect against missing configuration variables (thanks @jasonlfunk!)
|
||||
|
||||
1.2.0
|
||||
-----
|
||||
- Update `bugsnag-php` dependency to enable support for code snippets on
|
||||
your Bugsnag dashboard
|
||||
- Allow configuring of more Bugsnag settings from your `config.php`
|
||||
(thanks @jacobmarshall!)
|
||||
|
||||
1.1.1
|
||||
-----
|
||||
- Fix issue where sending auth information with complex users could fail (thanks @hannesvdvreken!)
|
||||
|
||||
1.1.0
|
||||
-----
|
||||
- Send user/auth information if available (thanks @hannesvdvreken!)
|
||||
|
||||
1.0.10
|
||||
------
|
||||
- Laravel 5 support
|
||||
|
||||
1.0.9
|
||||
------
|
||||
- Split strip paths from `inProject`
|
||||
|
||||
1.0.8
|
||||
-----
|
||||
- Bump the bugsnag-php dependency to include recent fixes
|
||||
|
||||
1.0.7
|
||||
-----
|
||||
- Fix major notification bug introduced in 1.0.6
|
||||
|
||||
1.0.6
|
||||
-----
|
||||
- Fix incompatibility with PHP 5.3
|
||||
|
||||
1.0.5
|
||||
-----
|
||||
- Identify as Laravel notifier instead of PHP
|
||||
|
||||
1.0.4
|
||||
-----
|
||||
- Allow configuration of notify_release_stages from config file
|
||||
|
||||
1.0.3
|
||||
-----
|
||||
- Fix bug when setting releaseStage in the ServiceProvider
|
||||
|
||||
1.0.2
|
||||
-----
|
||||
- Fix laravel requirement to work with 4.1
|
||||
- Add a `Bugsnag` facade for quick access to $app["bugsnag"]
|
||||
|
||||
1.0.1
|
||||
-----
|
||||
- Fixed fatal error handling
|
||||
- Set release stage based on laravel's `App::environment` setting
|
||||
|
||||
1.0.0
|
||||
-----
|
||||
- Initial release
|
26
vendor/bugsnag/bugsnag-laravel/CONTRIBUTING.md
vendored
Normal file
26
vendor/bugsnag/bugsnag-laravel/CONTRIBUTING.md
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
Contributing
|
||||
============
|
||||
|
||||
- [Fork](https://help.github.com/articles/fork-a-repo) the [notifier on github](https://github.com/bugsnag/bugsnag-laravel)
|
||||
- Build and test your changes:
|
||||
```
|
||||
composer install && ./vendor/bin/phpunit
|
||||
```
|
||||
|
||||
- Commit and push until you are happy with your contribution
|
||||
- [Make a pull request](https://help.github.com/articles/using-pull-requests)
|
||||
- Thanks!
|
||||
|
||||
|
||||
Releasing
|
||||
=========
|
||||
|
||||
1. Commit all outstanding changes
|
||||
1. Bump the version in `src/Bugsnag/BugsnagLaravel/BugsnagLaravelServiceProvider.php` and `src/Bugsnag/BugsnagLaravel/BugsnagLumenServiceProvider.php`
|
||||
2. Update the CHANGELOG.md, and README if appropriate.
|
||||
3. Commit, tag push
|
||||
|
||||
git commit -am v1.x.x
|
||||
git tag v1.x.x
|
||||
git push origin master v1.x.x
|
||||
|
20
vendor/bugsnag/bugsnag-laravel/LICENSE.txt
vendored
Normal file
20
vendor/bugsnag/bugsnag-laravel/LICENSE.txt
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
Copyright (c) 2013 Bugsnag
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
349
vendor/bugsnag/bugsnag-laravel/README.md
vendored
Normal file
349
vendor/bugsnag/bugsnag-laravel/README.md
vendored
Normal file
@@ -0,0 +1,349 @@
|
||||
Bugsnag Notifier for Laravel and Lumen
|
||||
=====================================
|
||||
|
||||
The Bugsnag Notifier for Laravel gives you instant notification of errors and
|
||||
exceptions in your Laravel PHP applications. We support Laravel 5, Laravel 4,
|
||||
Laravel 3, and Lumen.
|
||||
|
||||
[Bugsnag](https://bugsnag.com) captures errors in real-time from your web,
|
||||
mobile and desktop applications, helping you to understand and resolve them
|
||||
as fast as possible. [Create a free account](https://bugsnag.com) to start
|
||||
capturing errors from your applications.
|
||||
|
||||
Check out this excellent [Laracasts
|
||||
screencast](https://laracasts.com/lessons/better-error-tracking-with-bugsnag)
|
||||
for a quick overview of how to use Bugsnag with your Laravel apps.
|
||||
|
||||
Contents
|
||||
--------
|
||||
|
||||
- [Getting Started](#getting-started)
|
||||
- [Installation](#installation)
|
||||
- [Laravel 5.0+](#laravel-50)
|
||||
- [Laravel (Older Versions)](#laravel-older-versions)
|
||||
- [Lumen](#lumen)
|
||||
- [Environment Variables](#environment-variables)
|
||||
- [Usage](#usage)
|
||||
- [Catching and Reporting Exceptions](#catching-and-reporting-exceptions)
|
||||
- [Sending Non-fatal Exceptions](#sending-non-fatal-exceptions)
|
||||
- [Configuration Options](#configuration-options)
|
||||
- [Error Reporting Levels](#error-reporting-levels)
|
||||
- [Callbacks](#callbacks)
|
||||
- [Demo Applications](#demo-applications)
|
||||
- [Support](#support)
|
||||
- [Contributing](#contributing)
|
||||
- [License](#license)
|
||||
|
||||
|
||||
Getting Started
|
||||
---------------
|
||||
|
||||
### Installation
|
||||
|
||||
#### Laravel 5.0+
|
||||
|
||||
1. Install the `bugsnag/bugsnag-laravel` package
|
||||
|
||||
```shell
|
||||
$ composer require bugsnag/bugsnag-laravel:1.*
|
||||
```
|
||||
|
||||
1. Update `config/app.php` to activate Bugsnag
|
||||
|
||||
```php
|
||||
# Add `BugsnagLaravelServiceProvider` to the `providers` array
|
||||
'providers' => array(
|
||||
...
|
||||
Bugsnag\BugsnagLaravel\BugsnagLaravelServiceProvider::class,
|
||||
)
|
||||
|
||||
# Add the `BugsnagFacade` to the `aliases` array
|
||||
'aliases' => array(
|
||||
...
|
||||
'Bugsnag' => Bugsnag\BugsnagLaravel\BugsnagFacade::class,
|
||||
)
|
||||
```
|
||||
|
||||
1. Use the Bugsnag exception handler from `App/Exceptions/Handler.php`.
|
||||
|
||||
```php
|
||||
# DELETE this line
|
||||
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
|
||||
```
|
||||
|
||||
```php
|
||||
# ADD this line instead
|
||||
use Bugsnag\BugsnagLaravel\BugsnagExceptionHandler as ExceptionHandler;
|
||||
```
|
||||
|
||||
After this change, your file should look like this:
|
||||
|
||||
```php
|
||||
<?php namespace App\Exceptions;
|
||||
|
||||
use Exception;
|
||||
use Bugsnag\BugsnagLaravel\BugsnagExceptionHandler as ExceptionHandler;
|
||||
|
||||
class Handler extends ExceptionHandler {
|
||||
...
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
1. Create the configuration file `config/bugsnag.php`:
|
||||
|
||||
```shell
|
||||
$ php artisan vendor:publish --provider="Bugsnag\BugsnagLaravel\BugsnagLaravelServiceProvider"
|
||||
```
|
||||
|
||||
1. Configure your `api_key` in your `.env` file:
|
||||
|
||||
```shell
|
||||
BUGSNAG_API_KEY=YOUR-API-KEY-HERE
|
||||
```
|
||||
|
||||
1. Optionally, you can add the `notify_release_stages` key to the
|
||||
`config/bugsnag.php` file to define which Laravel environments will send
|
||||
Exceptions to Bugsnag.
|
||||
|
||||
```php
|
||||
return array(
|
||||
'api_key' => env('BUGSNAG_API_KEY'),
|
||||
'notify_release_stages' => ['production', 'staging']
|
||||
);
|
||||
```
|
||||
|
||||
#### Laravel (Older Versions)
|
||||
|
||||
For versions of Laravel before 5.0:
|
||||
|
||||
1. Install the `bugsnag/bugsnag-laravel` package
|
||||
|
||||
```shell
|
||||
$ composer require bugsnag/bugsnag-laravel:1.*
|
||||
```
|
||||
|
||||
1. Update app/config/app.php` to activate Bugsnag
|
||||
|
||||
```php
|
||||
# Add `BugsnagLaravelServiceProvider` to the `providers` array
|
||||
'providers' => array(
|
||||
...
|
||||
'Bugsnag\BugsnagLaravel\BugsnagLaravelServiceProvider',
|
||||
)
|
||||
|
||||
# Add the `BugsnagFacade` to the `aliases` array
|
||||
'aliases' => array(
|
||||
...
|
||||
'Bugsnag' => 'Bugsnag\BugsnagLaravel\BugsnagFacade',
|
||||
)
|
||||
```
|
||||
|
||||
1. Generate a template Bugsnag config file
|
||||
|
||||
```shell
|
||||
$ php artisan config:publish bugsnag/bugsnag-laravel
|
||||
```
|
||||
|
||||
1. Update `app/config/packages/bugsnag/bugsnag-laravel/config.php` with your
|
||||
Bugsnag API key:
|
||||
|
||||
```php
|
||||
return array(
|
||||
'api_key' => 'YOUR-API-KEY-HERE'
|
||||
);
|
||||
```
|
||||
|
||||
1. Optionally, you can add the `notify_release_stages` key to the same file
|
||||
above to define which Laravel environments will send Exceptions to Bugsnag.
|
||||
|
||||
```php
|
||||
return array(
|
||||
'api_key' => 'YOUR-API-KEY-HERE',
|
||||
'notify_release_stages' => ['production', 'staging']
|
||||
);
|
||||
```
|
||||
|
||||
|
||||
#### Lumen
|
||||
|
||||
1. In `bootstrap/app.php` add the line
|
||||
|
||||
```php
|
||||
$app->register('Bugsnag\BugsnagLaravel\BugsnagLumenServiceProvider');
|
||||
```
|
||||
|
||||
just before the line
|
||||
|
||||
```php
|
||||
require __DIR__ . '/../app/Http/routes.php';
|
||||
```
|
||||
|
||||
2. Change the function `report` in `app/Exceptions/Handler.php` to look like
|
||||
this:
|
||||
|
||||
```php
|
||||
public function report(Exception $e) {
|
||||
app('bugsnag')->notifyException($e, []);
|
||||
return parent::report($e);
|
||||
}
|
||||
```
|
||||
|
||||
3. Create a file `config/bugsnag.php` that contains your API key
|
||||
|
||||
```php
|
||||
<?php # config/bugsnag.php
|
||||
|
||||
return array(
|
||||
'api_key' => 'YOUR-API-KEY-HERE'
|
||||
);
|
||||
```
|
||||
|
||||
### Environment Variables
|
||||
|
||||
In addition to `BUGSNAG_API_KEY`, other configuration keys can be automatically
|
||||
populated in `config.php` from your `.env` file:
|
||||
|
||||
- `BUGSNAG_API_KEY`: Your API key. You can find your API key on your Bugsnag
|
||||
dashboard.
|
||||
- `BUGSNAG_NOTIFY_RELEASE_STAGES`: Set which release stages should send
|
||||
notifications to Bugsnag.
|
||||
- `BUGSNAG_ENDPOINT`: Set what server to which the Bugsnag notifier should send
|
||||
errors. The default is https://notify.bugsnag.com, but for Bugsnag Enterprise
|
||||
the endpoint should be the URL of your Bugsnag instance.
|
||||
- `BUGSNAG_FILTERS`: Set which keys are filtered from metadata is sent to
|
||||
Bugsnag.
|
||||
- `BUGSNAG_PROXY`: Set the configuration options for your server if it is behind
|
||||
a proxy server. Additional details are available in the
|
||||
[sample configuration](src/Bugsnag/BugsnagLaravel/config.php#L56).
|
||||
|
||||
|
||||
Usage
|
||||
-----
|
||||
|
||||
### Catching and Reporting Exceptions
|
||||
|
||||
Bugsnag works "out of the box" for reporting unhandled exceptions in
|
||||
Laravel and Lumen apps.
|
||||
|
||||
|
||||
### Sending Non-fatal Exceptions
|
||||
|
||||
You can easily tell Bugsnag about non-fatal or caught exceptions by
|
||||
calling `Bugsnag::notifyException`:
|
||||
|
||||
```php
|
||||
Bugsnag::notifyException(new Exception("Something bad happened"));
|
||||
```
|
||||
|
||||
You can also send custom errors to Bugsnag with `Bugsnag::notifyError`:
|
||||
|
||||
```php
|
||||
Bugsnag::notifyError("ErrorType", "Something bad happened here too");
|
||||
```
|
||||
|
||||
Both of these functions can also be passed an optional `$metaData` parameter,
|
||||
which should take the following format:
|
||||
|
||||
```php
|
||||
$metaData = array(
|
||||
"user" => array(
|
||||
"name" => "James",
|
||||
"email" => "james@example.com"
|
||||
)
|
||||
);
|
||||
```
|
||||
|
||||
### Configuration Options
|
||||
|
||||
The [Bugsnag PHP Client](https://bugsnag.com/docs/notifiers/php)
|
||||
is available as `Bugsnag`, which allows you to set various
|
||||
configuration options. These options are listed in the
|
||||
[documentation for Bugsnag PHP](https://bugsnag.com/docs/notifiers/php#additional-options).
|
||||
|
||||
#### Error Reporting Levels
|
||||
|
||||
By default we'll use the value of `error_reporting` from your `php.ini`
|
||||
or any value you set at runtime using the `error_reporting(...)` function.
|
||||
|
||||
If you'd like to send different levels of errors to Bugsnag, you can call
|
||||
`setErrorReportingLevel`, for example:
|
||||
|
||||
```php
|
||||
Bugsnag::setErrorReportingLevel(E_ALL & ~E_NOTICE);
|
||||
```
|
||||
|
||||
#### Callbacks
|
||||
|
||||
It is often useful to send additional meta-data about your app, such as
|
||||
information about the currently logged in user, along with any
|
||||
error or exceptions, to help debug problems.
|
||||
|
||||
To send custom data, you should define a *before-notify* function,
|
||||
adding an array of "tabs" of custom data to the $metaData parameter. For example:
|
||||
|
||||
```php
|
||||
Bugsnag::setBeforeNotifyFunction("before_bugsnag_notify");
|
||||
|
||||
function before_bugsnag_notify($error) {
|
||||
// Do any custom error handling here
|
||||
|
||||
// Also add some meta data to each error
|
||||
$error->setMetaData(array(
|
||||
"user" => array(
|
||||
"name" => "James",
|
||||
"email" => "james@example.com"
|
||||
)
|
||||
));
|
||||
}
|
||||
```
|
||||
|
||||
This example snippet adds a "user" tab to the Bugsnag error report. See the
|
||||
[setBeforeNotifyFunction](https://bugsnag.com/docs/notifiers/php#setbeforenotifyfunction)
|
||||
documentation on the `bugsnag-php` library for more information.
|
||||
|
||||
|
||||
Demo Applications
|
||||
-----------------
|
||||
|
||||
The [Bugsnag Laravel source
|
||||
repository](https://github.com/bugsnag/bugsnag-laravel) includes example
|
||||
applications for [Laravel 4, Laravel 5, and
|
||||
Lumen](https://github.com/bugsnag/bugsnag-laravel/tree/master/example).
|
||||
|
||||
Before running one of the example applications, install the prerequisites:
|
||||
|
||||
brew tap josegonzalez/homebrew-php
|
||||
brew install php56 php56-mcrypt composer
|
||||
|
||||
Then open the example directory (such as `example/laravel-5.1`) in a terminal
|
||||
and start the server:
|
||||
|
||||
composer install
|
||||
php56 artisan serve --port 8004
|
||||
|
||||
|
||||
Support
|
||||
-------
|
||||
|
||||
* [Additional Documentation](https://github.com/bugsnag/bugsnag-laravel/tree/master/docs)
|
||||
* [Search open and closed issues](https://github.com/bugsnag/bugsnag-laravel/issues?utf8=✓&q=is%3Aissue) for similar problems
|
||||
* [Report a bug or request a feature](https://github.com/bugsnag/bugsnag-laravel/issues/new)
|
||||
|
||||
|
||||
Contributing
|
||||
------------
|
||||
|
||||
We'd love you to file issues and send pull requests. The [contributing
|
||||
guidelines](https://github.com/bugsnag/bugsnag-laravel/CONTRIBUTING.md) details
|
||||
the process of building and testing `bugsnag-laravel`, as well as the pull
|
||||
request process. Feel free to comment on [existing
|
||||
issues](https://github.com/bugsnag/bugsnag-laravel/issues) for clarification or
|
||||
starting points.
|
||||
|
||||
|
||||
License
|
||||
-------
|
||||
|
||||
The Bugsnag Laravel notifier is free software released under the MIT License.
|
||||
See [LICENSE.txt](LICENSE.txt) for details.
|
23
vendor/bugsnag/bugsnag-laravel/composer.json
vendored
Normal file
23
vendor/bugsnag/bugsnag-laravel/composer.json
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"name": "bugsnag/bugsnag-laravel",
|
||||
"description": "Official Bugsnag notifier for Laravel applications.",
|
||||
"keywords": ["bugsnag", "exceptions", "errors", "logging", "tracking", "laravel"],
|
||||
"homepage": "https://github.com/bugsnag/bugsnag-laravel",
|
||||
"license": "MIT",
|
||||
"authors": [
|
||||
{
|
||||
"name": "James Smith",
|
||||
"email": "notifiers@bugsnag.com"
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"php": ">=5.3.0",
|
||||
"illuminate/support": "4.*|5.*",
|
||||
"bugsnag/bugsnag": ">=2.5.0"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-0": {
|
||||
"Bugsnag\\BugsnagLaravel\\": "src/"
|
||||
}
|
||||
}
|
||||
}
|
11
vendor/bugsnag/bugsnag-laravel/provides.json
vendored
Normal file
11
vendor/bugsnag/bugsnag-laravel/provides.json
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"providers": [
|
||||
"Bugsnag\BugsnagLaravel\BugsnagLaravelServiceProvider"
|
||||
],
|
||||
"aliases": [
|
||||
{
|
||||
"alias": "Bugsnag",
|
||||
"facade": "Bugsnag\BugsnagLaravel\BugsnagFacade"
|
||||
}
|
||||
]
|
||||
}
|
29
vendor/bugsnag/bugsnag-laravel/src/Bugsnag/BugsnagLaravel/BugsnagExceptionHandler.php
vendored
Normal file
29
vendor/bugsnag/bugsnag-laravel/src/Bugsnag/BugsnagLaravel/BugsnagExceptionHandler.php
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php namespace Bugsnag\BugsnagLaravel;
|
||||
|
||||
use Exception;
|
||||
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
|
||||
|
||||
class BugsnagExceptionHandler extends ExceptionHandler {
|
||||
/**
|
||||
* Report or log an exception.
|
||||
*
|
||||
* This is a great spot to send exceptions to Sentry, Bugsnag, etc.
|
||||
*
|
||||
* @param \Exception $e
|
||||
* @return void
|
||||
*/
|
||||
public function report(Exception $e)
|
||||
{
|
||||
foreach ($this->dontReport as $type) {
|
||||
if ($e instanceof $type) {
|
||||
return parent::report($e);
|
||||
}
|
||||
}
|
||||
|
||||
if (app()->bound('bugsnag')) {
|
||||
app('bugsnag')->notifyException($e, null, "error");
|
||||
}
|
||||
|
||||
return parent::report($e);
|
||||
}
|
||||
}
|
11
vendor/bugsnag/bugsnag-laravel/src/Bugsnag/BugsnagLaravel/BugsnagFacade.php
vendored
Normal file
11
vendor/bugsnag/bugsnag-laravel/src/Bugsnag/BugsnagLaravel/BugsnagFacade.php
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php namespace Bugsnag\BugsnagLaravel;
|
||||
|
||||
use Illuminate\Support\Facades\Facade;
|
||||
|
||||
class BugsnagFacade extends Facade
|
||||
{
|
||||
protected static function getFacadeAccessor()
|
||||
{
|
||||
return 'bugsnag';
|
||||
}
|
||||
}
|
115
vendor/bugsnag/bugsnag-laravel/src/Bugsnag/BugsnagLaravel/BugsnagLaravelServiceProvider.php
vendored
Normal file
115
vendor/bugsnag/bugsnag-laravel/src/Bugsnag/BugsnagLaravel/BugsnagLaravelServiceProvider.php
vendored
Normal file
@@ -0,0 +1,115 @@
|
||||
<?php namespace Bugsnag\BugsnagLaravel;
|
||||
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
|
||||
class BugsnagLaravelServiceProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* Indicates if loading of the provider is deferred.
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
protected $defer = false;
|
||||
|
||||
/**
|
||||
* Bootstrap the application events.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function boot()
|
||||
{
|
||||
|
||||
$app = $this->app;
|
||||
|
||||
if (version_compare($app::VERSION, '5.0') < 0) {
|
||||
|
||||
$this->package('bugsnag/bugsnag-laravel', 'bugsnag');
|
||||
|
||||
// Register for exception handling
|
||||
$app->error(function (\Exception $exception) use ($app) {
|
||||
if ('Symfony\Component\Debug\Exception\FatalErrorException'
|
||||
!== get_class($exception)
|
||||
) {
|
||||
$app['bugsnag']->notifyException($exception, null, "error");
|
||||
}
|
||||
});
|
||||
|
||||
// Register for fatal error handling
|
||||
$app->fatal(function ($exception) use ($app) {
|
||||
$app['bugsnag']->notifyException($exception, null, "error");
|
||||
});
|
||||
} else {
|
||||
$this->publishes(array(
|
||||
__DIR__.'/config.php' => config_path('bugsnag.php'),
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Register the service provider.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function register()
|
||||
{
|
||||
$this->app->singleton('bugsnag', function ($app) {
|
||||
$config = isset($app['config']['services']['bugsnag']) ? $app['config']['services']['bugsnag'] : null;
|
||||
if (is_null($config)) {
|
||||
$config = $app['config']['bugsnag'] ?: $app['config']['bugsnag::config'];
|
||||
}
|
||||
|
||||
$client = new \Bugsnag_Client($config['api_key']);
|
||||
$client->setStripPath(base_path());
|
||||
$client->setProjectRoot(app_path());
|
||||
$client->setAutoNotify(false);
|
||||
$client->setBatchSending(false);
|
||||
$client->setReleaseStage($app->environment());
|
||||
$client->setNotifier(array(
|
||||
'name' => 'Bugsnag Laravel',
|
||||
'version' => '1.6.3',
|
||||
'url' => 'https://github.com/bugsnag/bugsnag-laravel'
|
||||
));
|
||||
|
||||
if (isset($config['notify_release_stages']) && is_array($config['notify_release_stages'])) {
|
||||
$client->setNotifyReleaseStages($config['notify_release_stages']);
|
||||
}
|
||||
|
||||
if (isset($config['endpoint'])) {
|
||||
$client->setEndpoint($config['endpoint']);
|
||||
}
|
||||
|
||||
if (isset($config['filters']) && is_array($config['filters'])) {
|
||||
$client->setFilters($config['filters']);
|
||||
}
|
||||
|
||||
if (isset($config['proxy']) && is_array($config['proxy'])) {
|
||||
$client->setProxySettings($config['proxy']);
|
||||
}
|
||||
|
||||
// Check if someone is logged in.
|
||||
try {
|
||||
if ($app['auth']->check()) {
|
||||
// User is logged in.
|
||||
$user = $app['auth']->user();
|
||||
|
||||
// If these attributes are available: pass them on.
|
||||
$client->setUser(array('id' => $user->getAuthIdentifier()));
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
// Do nothing.
|
||||
}
|
||||
|
||||
return $client;
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the services provided by the provider.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function provides()
|
||||
{
|
||||
return array("bugsnag");
|
||||
}
|
||||
}
|
91
vendor/bugsnag/bugsnag-laravel/src/Bugsnag/BugsnagLaravel/BugsnagLumenServiceProvider.php
vendored
Normal file
91
vendor/bugsnag/bugsnag-laravel/src/Bugsnag/BugsnagLaravel/BugsnagLumenServiceProvider.php
vendored
Normal file
@@ -0,0 +1,91 @@
|
||||
<?php namespace Bugsnag\BugsnagLaravel;
|
||||
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
|
||||
class BugsnagLumenServiceProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* Indicates if loading of the provider is deferred.
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
protected $defer = false;
|
||||
|
||||
/**
|
||||
* Bootstrap the application events.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function boot()
|
||||
{
|
||||
$this->app->configure('bugsnag');
|
||||
}
|
||||
|
||||
/**
|
||||
* Register the service provider.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function register()
|
||||
{
|
||||
$this->app->singleton('bugsnag', function ($app) {
|
||||
$config = isset($app['config']['services']['bugsnag']) ? $app['config']['services']['bugsnag'] : null;
|
||||
if (is_null($config)) {
|
||||
$config = $app['config']['bugsnag'] ?: $app['config']['bugsnag::config'];
|
||||
}
|
||||
|
||||
$client = new \Bugsnag_Client($config['api_key']);
|
||||
$client->setStripPath(base_path());
|
||||
$client->setProjectRoot(base_path() . '/app');
|
||||
$client->setAutoNotify(false);
|
||||
$client->setBatchSending(false);
|
||||
$client->setReleaseStage($app->environment());
|
||||
$client->setNotifier(array(
|
||||
'name' => 'Bugsnag Lumen',
|
||||
'version' => '1.6.3',
|
||||
'url' => 'https://github.com/bugsnag/bugsnag-laravel'
|
||||
));
|
||||
|
||||
if (isset($config['notify_release_stages']) && is_array($config['notify_release_stages'])) {
|
||||
$client->setNotifyReleaseStages($config['notify_release_stages']);
|
||||
}
|
||||
|
||||
if (isset($config['endpoint'])) {
|
||||
$client->setEndpoint($config['endpoint']);
|
||||
}
|
||||
|
||||
if (isset($config['filters']) && is_array($config['filters'])) {
|
||||
$client->setFilters($config['filters']);
|
||||
}
|
||||
|
||||
if (isset($config['proxy']) && is_array($config['proxy'])) {
|
||||
$client->setProxySettings($config['proxy']);
|
||||
}
|
||||
|
||||
// Check if someone is logged in.
|
||||
try {
|
||||
if ($app['auth']->check()) {
|
||||
// User is logged in.
|
||||
$user = $app['auth']->user();
|
||||
|
||||
// If these attributes are available: pass them on.
|
||||
$client->setUser(array('id' => $user->getAuthIdentifier()));
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
// Do nothing.
|
||||
}
|
||||
|
||||
return $client;
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the services provided by the provider.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function provides()
|
||||
{
|
||||
return array("bugsnag");
|
||||
}
|
||||
}
|
77
vendor/bugsnag/bugsnag-laravel/src/Bugsnag/BugsnagLaravel/config.php
vendored
Normal file
77
vendor/bugsnag/bugsnag-laravel/src/Bugsnag/BugsnagLaravel/config.php
vendored
Normal file
@@ -0,0 +1,77 @@
|
||||
<?php
|
||||
|
||||
return array(
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| API Key
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| You can find your API key on your Bugsnag dashboard.
|
||||
|
|
||||
| This api key points the Bugsnag notifier to the project in your account
|
||||
| which should receive your application's uncaught exceptions.
|
||||
|
|
||||
*/
|
||||
'api_key' => env('BUGSNAG_API_KEY'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Notify Release Stages
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Set which release stages should send notifications to Bugsnag.
|
||||
|
|
||||
| Example: array('development', 'production')
|
||||
|
|
||||
*/
|
||||
'notify_release_stages' => env('BUGSNAG_NOTIFY_RELEASE_STAGES', null),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Endpoint
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Set what server the Bugsnag notifier should send errors to. By default
|
||||
| this is set to 'https://notify.bugsnag.com', but for Bugsnag Enterprise
|
||||
| this should be the URL to your Bugsnag instance.
|
||||
|
|
||||
*/
|
||||
'endpoint' => env('BUGSNAG_ENDPOINT', null),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Filters
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Use this if you want to ensure you don't send sensitive data such as
|
||||
| passwords, and credit card numbers to our servers. Any keys which
|
||||
| contain these strings will be filtered.
|
||||
|
|
||||
*/
|
||||
'filters' => env('BUGSNAG_FILTERS', array('password')),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Proxy
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| If your server is behind a proxy server, you can configure this as well.
|
||||
| Other than the host, none of these settings are mandatory.
|
||||
|
|
||||
| Note: Proxy configuration is only possible if the PHP cURL extension
|
||||
| is installed.
|
||||
|
|
||||
| Example:
|
||||
|
|
||||
| 'proxy' => array(
|
||||
| 'host' => 'bugsnag.com',
|
||||
| 'port' => 42,
|
||||
| 'user' => 'username',
|
||||
| 'password' => 'password123'
|
||||
| )
|
||||
|
|
||||
*/
|
||||
'proxy' => env('BUGSNAG_PROXY', null)
|
||||
|
||||
);
|
77
vendor/bugsnag/bugsnag-laravel/src/config/config.php
vendored
Normal file
77
vendor/bugsnag/bugsnag-laravel/src/config/config.php
vendored
Normal file
@@ -0,0 +1,77 @@
|
||||
<?php
|
||||
|
||||
return array(
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| API Key
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| You can find your API key on your Bugsnag dashboard.
|
||||
|
|
||||
| This api key points the Bugsnag notifier to the project in your account
|
||||
| which should receive your application's uncaught exceptions.
|
||||
|
|
||||
*/
|
||||
'api_key' => 'YOUR-API-KEY-HERE',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Notify Release Stages
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Set which release stages should send notifications to Bugsnag.
|
||||
|
|
||||
| Example: array('development', 'production')
|
||||
|
|
||||
*/
|
||||
'notify_release_stages' => null,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Endpoint
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Set what server the Bugsnag notifier should send errors to. By default
|
||||
| this is set to 'https://notify.bugsnag.com', but for Bugsnag Enterprise
|
||||
| this should be the URL to your Bugsnag instance.
|
||||
|
|
||||
*/
|
||||
'endpoint' => null,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Filters
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Use this if you want to ensure you don't send sensitive data such as
|
||||
| passwords, and credit card numbers to our servers. Any keys which
|
||||
| contain these strings will be filtered.
|
||||
|
|
||||
*/
|
||||
'filters' => array('password'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Proxy
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| If your server is behind a proxy server, you can configure this as well.
|
||||
| Other than the host, none of these settings are mandatory.
|
||||
|
|
||||
| Note: Proxy configuration is only possible if the PHP cURL extension
|
||||
| is installed.
|
||||
|
|
||||
| Example:
|
||||
|
|
||||
| 'proxy' => array(
|
||||
| 'host' => 'bugsnag.com',
|
||||
| 'port' => 42,
|
||||
| 'user' => 'username',
|
||||
| 'password' => 'password123'
|
||||
| )
|
||||
|
|
||||
*/
|
||||
'proxy' => null
|
||||
|
||||
);
|
Reference in New Issue
Block a user