update v1.0.6
This commit is contained in:
1
vendor/bugsnag/bugsnag/.travis.yml
vendored
1
vendor/bugsnag/bugsnag/.travis.yml
vendored
@@ -1,6 +1,7 @@
|
||||
sudo: false
|
||||
language: php
|
||||
php:
|
||||
- 7.0
|
||||
- 5.6
|
||||
- 5.5
|
||||
- 5.4
|
||||
|
||||
9
vendor/bugsnag/bugsnag/CHANGELOG.md
vendored
9
vendor/bugsnag/bugsnag/CHANGELOG.md
vendored
@@ -1,6 +1,15 @@
|
||||
Changelog
|
||||
=========
|
||||
|
||||
2.6.1 (2016-01-28)
|
||||
-----
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Fixes an error thrown when sending an `Error` instance using PHP 7
|
||||
[Petr Bugyík](https://github.com/o5)
|
||||
[#110](https://github.com/bugsnag/bugsnag-php/pull/110)
|
||||
|
||||
2.6.0 (23 Dec 2015)
|
||||
-----
|
||||
|
||||
|
||||
BIN
vendor/bugsnag/bugsnag/build/bugsnag.phar
vendored
BIN
vendor/bugsnag/bugsnag/build/bugsnag.phar
vendored
Binary file not shown.
2
vendor/bugsnag/bugsnag/composer.json
vendored
2
vendor/bugsnag/bugsnag/composer.json
vendored
@@ -16,7 +16,7 @@
|
||||
},
|
||||
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "3.7.*"
|
||||
"phpunit/phpunit": "~4.8|~5.0"
|
||||
},
|
||||
|
||||
"autoload": {
|
||||
|
||||
@@ -18,7 +18,7 @@ class Bugsnag_Configuration
|
||||
public $proxySettings = array();
|
||||
public $notifier = array(
|
||||
'name' => 'Bugsnag PHP (Official)',
|
||||
'version' => '2.6.0',
|
||||
'version' => '2.6.1',
|
||||
'url' => 'https://bugsnag.com',
|
||||
);
|
||||
public $sendEnvironment = false;
|
||||
|
||||
14
vendor/bugsnag/bugsnag/src/Bugsnag/Error.php
vendored
14
vendor/bugsnag/bugsnag/src/Bugsnag/Error.php
vendored
@@ -96,8 +96,20 @@ class Bugsnag_Error
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setPHPException(Exception $exception)
|
||||
public function setPHPException($exception)
|
||||
{
|
||||
if (version_compare(PHP_VERSION, '7.0.0', '>=')) {
|
||||
if (!$exception instanceof \Throwable) {
|
||||
error_log('Bugsnag Warning: Exception must implement interface \Throwable.');
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
if (!$exception instanceof \Exception) {
|
||||
error_log('Bugsnag Warning: Exception must be instance of \Exception.');
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
$this->setName(get_class($exception))
|
||||
->setMessage($exception->getMessage())
|
||||
->setStacktrace(Bugsnag_Stacktrace::fromBacktrace($this->config, $exception->getTrace(), $exception->getFile(), $exception->getLine()));
|
||||
|
||||
@@ -59,7 +59,7 @@ class Bugsnag_Request
|
||||
|
||||
public static function getCurrentUrl()
|
||||
{
|
||||
$schema = ((!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') || $_SERVER['SERVER_PORT'] == 443) ? 'https://' : 'http://';
|
||||
$schema = ((!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') || (!empty($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT'] == 443)) ? 'https://' : 'http://';
|
||||
|
||||
return $schema.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
|
||||
}
|
||||
|
||||
@@ -1,5 +1,17 @@
|
||||
<?php
|
||||
|
||||
if (!defined('PHP_VERSION_ID')) {
|
||||
$version = explode('.', PHP_VERSION);
|
||||
|
||||
define('PHP_VERSION_ID', ($version[0] * 10000 + $version[1] * 100 + $version[2]));
|
||||
}
|
||||
|
||||
if (PHP_VERSION_ID < 50207) {
|
||||
define('PHP_MAJOR_VERSION', $version[0]);
|
||||
define('PHP_MINOR_VERSION', $version[1]);
|
||||
define('PHP_RELEASE_VERSION', $version[2]);
|
||||
}
|
||||
|
||||
class ClientTest extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
/** @var PHPUnit_Framework_MockObject_MockObject|Bugsnag_Client */
|
||||
@@ -73,11 +85,13 @@ class ClientTest extends PHPUnit_Framework_TestCase
|
||||
->errorHandler(E_NOTICE, "Something broke", "somefile.php", 123);
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException PHPUnit_Framework_Error
|
||||
*/
|
||||
public function testSetInvalidCurlOptions()
|
||||
{
|
||||
if (PHP_MAJOR_VERSION >= 7) {
|
||||
$this->setExpectedException('TypeError');
|
||||
} else {
|
||||
$this->setExpectedException('PHPUnit_Framework_Error');
|
||||
}
|
||||
$this->client->setCurlOptions("option");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -128,4 +128,10 @@ class ErrorTest extends Bugsnag_TestCase
|
||||
$errorArray = $this->error->toArray();
|
||||
$this->assertArrayNotHasKey('groupingHash', $errorArray);
|
||||
}
|
||||
|
||||
public function testSetPHPException()
|
||||
{
|
||||
$exception = version_compare(PHP_VERSION, '7.0.0', '>=') ? new \Error() : new Exception();
|
||||
$this->error->setPHPException($exception);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user