Skip to content

Commit 99bd79b

Browse files
committed
Remove Rollbar
1 parent 6935d31 commit 99bd79b

File tree

9 files changed

+12
-163
lines changed

9 files changed

+12
-163
lines changed

bin/deploy

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ TARGET_FILE="${SOURCE_DIRECTORY}/etc/deploy-targets.csv"
99
TARGET_ENV=""
1010
SKIP_COMPOSER=0
1111
SKIP_CONFIRM=0
12-
ROLLBAR_ACCESS_TOKEN="$(cat ${SOURCE_DIRECTORY}/etc/.rollbar-token)"
1312

1413
# Parameter handling
1514
OPTIND=1
@@ -70,7 +69,7 @@ fi
7069
# Break on non-success exit codes
7170
set -e
7271

73-
printf "[1/5] Running composer update...\n"
72+
printf "[1/4] Running composer update...\n"
7473
if [ "${SKIP_COMPOSER}" -ne 1 ]; then
7574
if [ "${TARGET_ENV}" == "production" ]; then
7675
composer update -o --no-dev
@@ -81,7 +80,7 @@ else
8180
printf "skipping step as requested...\n"
8281
fi
8382

84-
printf "[2/5] Generating version information...\n"
83+
printf "[2/4] Generating version information...\n"
8584
# Version identifier
8685
printf "$(git describe --always --tags)\n" \
8786
> ${SOURCE_DIRECTORY}/etc/.rsync-version
@@ -95,14 +94,7 @@ printf "$(git log -n 1 --pretty='%aI' HEAD)\n" \
9594
printf "$(git log -n 1 --pretty='%h %aI' ./LICENSE.txt)" \
9695
>> ${SOURCE_DIRECTORY}/etc/.rsync-version
9796

98-
printf "[3/5] Notifying application monitors...\n"
99-
/usr/bin/env curl https://api.rollbar.com/api/1/deploy/ \
100-
-F access_token="${ROLLBAR_ACCESS_TOKEN}" \
101-
-F environment="${TARGET_ENV}" \
102-
-F revision="$(git describe --always --tags)" \
103-
-F local_username="$(id -nu ${UID})"
104-
105-
printf "[4/5] Syncing project to target...\n"
97+
printf "[3/4] Syncing project to target...\n"
10698
pushd "${SOURCE_DIRECTORY}" >/dev/null
10799
OIFS=$IFS; IFS=,
108100
for host in ${TARGET_HOST}; do
@@ -114,7 +106,7 @@ done
114106
IFS=$OIFS
115107
popd >/dev/null
116108

117-
printf "[5/5] Post-deploy clean up...\n"
109+
printf "[4/4] Post-deploy clean up...\n"
118110
rm ${SOURCE_DIRECTORY}/etc/.rsync-version
119111

120112
printf "Operation complete!\n"

composer.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@
4949
"ext-mcrypt": "*",
5050
"ext-memcached": "*",
5151
"ext-pdo": "*",
52-
"php-64bit": ">=5.5.0",
53-
"rollbar/rollbar": "^0.18.2"
52+
"php-64bit": ">=5.5.0"
5453
}
5554
}

composer.lock

Lines changed: 2 additions & 52 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

etc/.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
1-
/.rollbar-token
21
/config.phoenix.json
32
/config.redux.json

etc/config.sample.json

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,5 @@
4848
"secret": "google-provided-value",
4949
"sitekey": "google-provided-value",
5050
"url": "https://www.google.com/recaptcha/api/siteverify"
51-
},
52-
"rollbar": {
53-
"access_token_client": null,
54-
"access_token_server": null,
55-
"environment": "local"
5651
}
5752
}

src/libraries/Logger.php

Lines changed: 1 addition & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -12,73 +12,11 @@
1212
use \InvalidArgumentException;
1313
use \PDO;
1414
use \PDOException;
15-
use \Rollbar;
1615
use \RuntimeException;
1716

1817
class Logger extends LoggerMVCLib {
1918

20-
protected static $event_types = null;
21-
protected static $identified_as = null;
22-
protected static $rollbar_available = false;
23-
24-
public static function getIdentity() {
25-
return self::$identified_as;
26-
}
27-
28-
public static function getIdentityAsRollbar() {
29-
$user = self::getIdentity();
30-
if (!$user) { return null; }
31-
return [
32-
'email' => $user->getEmail(),
33-
'id' => $user->getId(),
34-
'username' => $user->getUsername(),
35-
];
36-
}
37-
38-
public static function getTimingHeader($tags = true) {
39-
$buffer = parent::getTimingHeader($tags);
40-
if (self::$rollbar_available) {
41-
ob_start();
42-
require('../templates/rollbar.inc.js.phtml');
43-
$buffer .= ob_get_clean();
44-
}
45-
return $buffer;
46-
}
47-
48-
public static function identifyAs(User $user) {
49-
self::$identified_as = $user;
50-
}
51-
52-
public static function initialize($override = false) {
53-
parent::initialize($override);
54-
if (Common::$config->rollbar->access_token_server) {
55-
self::$rollbar_available = true;
56-
57-
$rollbar_handle_exceptions = false;
58-
$rollbar_handle_errors = true;
59-
$rollbar_handle_fatal = true;
60-
61-
Rollbar::init(
62-
[
63-
'access_token' => Common::$config->rollbar->access_token_server,
64-
'code_version' => VersionInfo::$version->bnetdocs[0],
65-
'environment' => Common::$config->rollbar->environment,
66-
'person_fn' => 'Logger::getIdentityAsRollbar',
67-
'use_error_reporting' => true,
68-
],
69-
$rollbar_handle_exceptions,
70-
$rollbar_handle_errors,
71-
$rollbar_handle_fatal
72-
);
73-
}
74-
}
75-
76-
public static function logException(Exception $exception) {
77-
parent::logException($exception);
78-
if (self::$rollbar_available) {
79-
Rollbar::report_exception($exception);
80-
}
81-
}
19+
protected static $event_types = null;
8220

8321
public static function &getAllEvents() {
8422
$event_log = [];

src/libraries/Session.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
namespace BNETDocs\Libraries;
44

5-
use BNETDocs\Libraries\Logger;
65
use CarlBennett\MVC\Libraries\Router;
76
use CarlBennett\MVC\Libraries\Session as BaseSession;
87

@@ -33,10 +32,6 @@ public static function checkLogin(Router &$router) {
3332
getenv('HTTP_HOST'), '/'
3433
);
3534
}
36-
// Notify Logger
37-
if (isset($_SESSION['user_id'])) {
38-
Logger::identifyAs(new User((int) $_SESSION['user_id']));
39-
}
4035
}
4136

4237
}

src/main.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,10 @@ function main() {
4747

4848
VersionInfo::$version = VersionInfo::get();
4949

50-
// This must come after GlobalErrorHandler::createOverrides() because this
51-
// will call Rollbar::init() which will create its own error handlers for
52-
// Application Performance Monitoring (APM) purposes. This must also come
53-
// after assignment of Common::$config because we need the access token for
54-
// Rollbar which is present in the config file only.
50+
// This must come after GlobalErrorHandler::createOverrides() so that Logger
51+
// has a chance to create its own error handlers for Application Performance
52+
// Monitoring (APM) purposes. This must also come after assignment of
53+
// Common::$config because we may need access tokens from the config.
5554
Logger::initialize();
5655

5756
Session::initialize(

src/templates/rollbar.inc.js.phtml

Lines changed: 0 additions & 18 deletions
This file was deleted.

0 commit comments

Comments
 (0)