From e6235846dc51b49c069c3c8071915c711e04cecc Mon Sep 17 00:00:00 2001 From: Aaron Parecki Date: Fri, 19 Feb 2016 13:40:18 -0800 Subject: [PATCH] send exceptions to errbit --- composer.json | 3 +- composer.lock | 172 ++++++++++++++++++++++++++++++++++++-------- config.template.php | 3 + public/index.php | 13 ++++ 4 files changed, 161 insertions(+), 30 deletions(-) diff --git a/composer.json b/composer.json index c79b006..a533366 100644 --- a/composer.json +++ b/composer.json @@ -13,7 +13,8 @@ "predis/predis": "1.*", "michelf/php-markdown": "1.6.*", "camspiers/json-pretty": "1.0.*", - "monolog/monolog": "1.*" + "monolog/monolog": "1.*", + "emgiezet/errbit-php": "1.1.*" }, "require-dev": { "phpunit/phpunit": "*" diff --git a/composer.lock b/composer.lock index b6bee01..aa7b847 100644 --- a/composer.lock +++ b/composer.lock @@ -4,8 +4,8 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "80253bee3fec80ece5c62e69419ed6da", - "content-hash": "033f44c5ec88a9c53103e9a38e3f78c3", + "hash": "3d6f1de70635267d75ea090ffbb4e6a7", + "content-hash": "a14b6b6853bab479528698c9e03944c1", "packages": [ { "name": "barnabywalters/mf-cleaner", @@ -83,6 +83,72 @@ "description": "Provides support for json pretty printing", "time": "2015-09-17 16:05:48" }, + { + "name": "emgiezet/errbit-php", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/emgiezet/errbitPHP.git", + "reference": "c233c262d359a4890163423bfe8d4488f3fd33b2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/emgiezet/errbitPHP/zipball/c233c262d359a4890163423bfe8d4488f3fd33b2", + "reference": "c233c262d359a4890163423bfe8d4488f3fd33b2", + "shasum": "" + }, + "require": { + "php": ">=5.3.2" + }, + "replace": { + "flippa-official/errbit-php": "dev-master", + "nodrew/php-airbrake": "dev-master" + }, + "require-dev": { + "mockery/mockery": "0.9.4", + "phpunit/phpcov": "2.0.*@dev", + "phpunit/phpunit": "4.*", + "satooshi/php-coveralls": "dev-master" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-0": { + "Errbit\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "emgiezet" + }, + { + "name": "flippa" + }, + { + "name": "karolsojko" + }, + { + "name": "deathowl" + } + ], + "description": "errbit/airbrake integration with php with psr-2", + "homepage": "http://github.com/emgiezet/errbitPHP", + "keywords": [ + "airbrake", + "errbit", + "errbit php", + "error tracking" + ], + "time": "2015-11-04 14:49:04" + }, { "name": "firebase/php-jwt", "version": "v3.0.0", @@ -128,16 +194,16 @@ }, { "name": "indieauth/client", - "version": "0.1.11", + "version": "0.1.13", "source": { "type": "git", "url": "https://github.com/indieweb/indieauth-client-php.git", - "reference": "6504ed0d4714084e9955f639d6e5cf4e976f9038" + "reference": "d438bb03db15b4ccc6c63228be16de7870b6ab99" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/indieweb/indieauth-client-php/zipball/6504ed0d4714084e9955f639d6e5cf4e976f9038", - "reference": "6504ed0d4714084e9955f639d6e5cf4e976f9038", + "url": "https://api.github.com/repos/indieweb/indieauth-client-php/zipball/d438bb03db15b4ccc6c63228be16de7870b6ab99", + "reference": "d438bb03db15b4ccc6c63228be16de7870b6ab99", "shasum": "" }, "require": { @@ -163,7 +229,7 @@ } ], "description": "IndieAuth Client Library", - "time": "2015-08-30 22:29:40" + "time": "2016-02-08 23:56:31" }, { "name": "indieweb/link-rel-parser", @@ -1282,22 +1348,24 @@ }, { "name": "phpspec/prophecy", - "version": "v1.5.0", + "version": "v1.6.0", "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "4745ded9307786b730d7a60df5cb5a6c43cf95f7" + "reference": "3c91bdf81797d725b14cb62906f9a4ce44235972" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/4745ded9307786b730d7a60df5cb5a6c43cf95f7", - "reference": "4745ded9307786b730d7a60df5cb5a6c43cf95f7", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/3c91bdf81797d725b14cb62906f9a4ce44235972", + "reference": "3c91bdf81797d725b14cb62906f9a4ce44235972", "shasum": "" }, "require": { "doctrine/instantiator": "^1.0.2", + "php": "^5.3|^7.0", "phpdocumentor/reflection-docblock": "~2.0", - "sebastian/comparator": "~1.1" + "sebastian/comparator": "~1.1", + "sebastian/recursion-context": "~1.0" }, "require-dev": { "phpspec/phpspec": "~2.0" @@ -1305,7 +1373,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.4.x-dev" + "dev-master": "1.5.x-dev" } }, "autoload": { @@ -1338,27 +1406,28 @@ "spy", "stub" ], - "time": "2015-08-13 10:07:40" + "time": "2016-02-15 07:46:21" }, { "name": "phpunit/php-code-coverage", - "version": "3.1.1", + "version": "3.2.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "92f5c61b5c64159faec5298325ffab0c7e59dcc8" + "reference": "a58f95ae76fe201b571fad3e8370a50c4368678c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/92f5c61b5c64159faec5298325ffab0c7e59dcc8", - "reference": "92f5c61b5c64159faec5298325ffab0c7e59dcc8", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/a58f95ae76fe201b571fad3e8370a50c4368678c", + "reference": "a58f95ae76fe201b571fad3e8370a50c4368678c", "shasum": "" }, "require": { - "php": ">=5.6", + "php": "^5.6 || ^7.0", "phpunit/php-file-iterator": "~1.3", "phpunit/php-text-template": "~1.2", - "phpunit/php-token-stream": "~1.3", + "phpunit/php-token-stream": "^1.4.2", + "sebastian/code-unit-reverse-lookup": "~1.0", "sebastian/environment": "^1.3.2", "sebastian/version": "~1.0|~2.0" }, @@ -1374,7 +1443,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.1.x-dev" + "dev-master": "3.2.x-dev" } }, "autoload": { @@ -1400,7 +1469,7 @@ "testing", "xunit" ], - "time": "2016-02-04 13:05:19" + "time": "2016-02-18 07:31:12" }, { "name": "phpunit/php-file-iterator", @@ -1582,16 +1651,16 @@ }, { "name": "phpunit/phpunit", - "version": "5.2.1", + "version": "5.2.9", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "40d32454fdad8a08ded0a2aafbc6d0e8f06a6b04" + "reference": "b12b9c37e382c096b93c3f26e7395775f59a5eea" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/40d32454fdad8a08ded0a2aafbc6d0e8f06a6b04", - "reference": "40d32454fdad8a08ded0a2aafbc6d0e8f06a6b04", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/b12b9c37e382c096b93c3f26e7395775f59a5eea", + "reference": "b12b9c37e382c096b93c3f26e7395775f59a5eea", "shasum": "" }, "require": { @@ -1601,9 +1670,9 @@ "ext-reflection": "*", "ext-spl": "*", "myclabs/deep-copy": "~1.3", - "php": ">=5.6", + "php": "^5.6 || ^7.0", "phpspec/prophecy": "^1.3.1", - "phpunit/php-code-coverage": "~3.1", + "phpunit/php-code-coverage": "^3.2.1", "phpunit/php-file-iterator": "~1.4", "phpunit/php-text-template": "~1.2", "phpunit/php-timer": ">=1.0.6", @@ -1652,7 +1721,7 @@ "testing", "xunit" ], - "time": "2016-02-05 17:50:46" + "time": "2016-02-19 11:43:07" }, { "name": "phpunit/phpunit-mock-objects", @@ -1710,6 +1779,51 @@ ], "time": "2015-12-08 08:47:06" }, + { + "name": "sebastian/code-unit-reverse-lookup", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", + "reference": "c36f5e7cfce482fde5bf8d10d41a53591e0198fe" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/c36f5e7cfce482fde5bf8d10d41a53591e0198fe", + "reference": "c36f5e7cfce482fde5bf8d10d41a53591e0198fe", + "shasum": "" + }, + "require": { + "php": ">=5.6" + }, + "require-dev": { + "phpunit/phpunit": "~5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Looks up which function or method a line of code belongs to", + "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", + "time": "2016-02-13 06:45:14" + }, { "name": "sebastian/comparator", "version": "1.2.0", diff --git a/config.template.php b/config.template.php index 5e5142d..630fa4b 100644 --- a/config.template.php +++ b/config.template.php @@ -8,6 +8,9 @@ class Config { public static $clientID = 'http://telegraph.dev/'; public static $defaultAuthorizationEndpoint = 'https://indieauth.com/auth'; + public static $errbitKey = ''; + public static $errbitHost = ''; + public static $db = [ 'host' => '127.0.0.1', 'database' => 'telegraph', diff --git a/public/index.php b/public/index.php index 1d0a61f..dc41b28 100644 --- a/public/index.php +++ b/public/index.php @@ -2,6 +2,19 @@ chdir('..'); include('vendor/autoload.php'); +use Errbit\Errbit; + +if(Config::$errbitHost) { + Errbit::instance() + ->configure(array( + 'api_key' => Config::$errbitKey, + 'host' => Config::$errbitHost, + 'port' => 443, + 'secure' => true + )) + ->start(); +} + initdb(); use Symfony\Component\HttpFoundation\Request;