Skip to content

Commit 80f453e

Browse files
Update rollbar-php to 1.5.3
1 parent 331ed08 commit 80f453e

File tree

8 files changed

+46
-17
lines changed

8 files changed

+46
-17
lines changed

vendor/rollbar/rollbar/README.md

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ For complete usage instructions and configuration reference, see our [PHP SDK do
1717

1818
See our [Releases](https://github.com/rollbar/rollbar-php/releases) page for a list of all releases, including changes.
1919

20-
## Related projects
20+
# Related projects
2121

2222
A range of examples of using Rollbar PHP is available here: [Rollbar PHP Examples](https://github.com/rollbar/rollbar-php-examples).
2323

@@ -34,26 +34,36 @@ Yii package: [baibaratsky/yii-rollbar](https://github.com/baibaratsky/yii-rollba
3434

3535
Yii2 package: [baibaratsky/yii2-rollbar](https://github.com/baibaratsky/yii2-rollbar)
3636

37-
## Help / Support
37+
# Help / Support
3838

3939
If you run into any issues, please email us at [[email protected]](mailto:[email protected])
4040

4141
For bug reports, please [open an issue on GitHub](https://github.com/rollbar/rollbar-php/issues/new).
4242
The best, configure your Rollbar with `verbosity` at level `\Psr\Log\LogLevel::DEBUG` and attach
4343
the contents of your `sys_get_temp_dir() . '/rollbar.debug.log'` (usually `/tmp/rollbar.debug.log`).
4444

45-
## Contributing
45+
# Contributing
4646

4747
1. Fork it
4848
2. Create your feature branch (`git checkout -b my-new-feature`)
4949
3. Commit your changes (`git commit -am 'Added some feature'`)
5050
4. Push to the branch (`git push origin my-new-feature`)
5151
5. Create new Pull Request
5252

53-
## Testing
53+
# Testing
5454
Tests are in `tests`.
5555
To run the tests: `composer test`
5656
To fix code style issues: `composer fix`
5757

58+
# Tagging
59+
60+
1. `export ROLLBAR_PHP_TAG=[version number]`
61+
2. `git checkout master`
62+
3. Update version numbers in `src/Payload/Notifier.php` and `tests/NotifierTest.php`.
63+
4. `git add .`
64+
5. `git commit -m"Update readme.io dump and bump version numbers"`.
65+
6. `git push origin master`
66+
7. `git tag $ROLLBAR_PHP_TAG_VERSION`
67+
5868
# License
5969
Rollbar-gem is free software released under the MIT License. See [LICENSE.txt](LICENSE.txt) for details.

vendor/rollbar/rollbar/src/Defaults.php

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,10 +131,16 @@ public function gitBranch($gitBranch = null, $allowExec = true)
131131
if ($gitBranch) {
132132
return $gitBranch;
133133
}
134-
if (!isset($this->defaultGitBranch) && $allowExec) {
135-
$this->defaultGitBranch = self::getGitBranch();
134+
if ($allowExec) {
135+
static $cachedValue;
136+
static $hasExecuted = false;
137+
if (!$hasExecuted) {
138+
$cachedValue = self::getGitBranch();
139+
$hasExecuted = true;
140+
}
141+
return $cachedValue;
136142
}
137-
return $this->defaultGitBranch;
143+
return null;
138144
}
139145

140146
private static function getGitBranch()

vendor/rollbar/rollbar/src/Payload/Notifier.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
class Notifier implements \Serializable
44
{
55
const NAME = "rollbar-php";
6-
const VERSION = "1.5.2";
6+
const VERSION = "1.5.3";
77

88
public static function defaultNotifier()
99
{

vendor/rollbar/rollbar/src/RollbarLogger.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,8 @@ public function log($level, $toLog, array $context = array(), $isUncaught = fals
100100
if ($this->config->checkIgnored($payload, $accessToken, $toLog, $isUncaught)) {
101101
$response = new Response(0, "Ignored");
102102
} else {
103-
$scrubbed = $this->scrub($payload);
103+
$serialized = $payload->serialize();
104+
$scrubbed = $this->scrub($serialized);
104105
$encoded = $this->encode($scrubbed);
105106
$truncated = $this->truncate($encoded);
106107

@@ -188,14 +189,13 @@ protected function handleResponse($payload, $response)
188189
}
189190

190191
/**
191-
* @param Payload $payload
192+
* @param array $serializedPayload
192193
* @return array
193194
*/
194-
protected function scrub(Payload $payload)
195+
protected function scrub(array &$serializedPayload)
195196
{
196-
$serialized = $payload->serialize();
197-
$serialized['data'] = $this->config->getScrubber()->scrub($serialized['data']);
198-
return $serialized;
197+
$serializedPayload['data'] = $this->config->getScrubber()->scrub($serializedPayload['data']);
198+
return $serializedPayload;
199199
}
200200

201201
/**

vendor/rollbar/rollbar/src/Utilities.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ public static function serializeForRollbar(
7474
foreach ($obj as $key => $val) {
7575
if ($val instanceof \Serializable) {
7676
$val = $val->serialize();
77+
} elseif (is_array($val)) {
78+
$val = self::serializeForRollbar($val);
7779
}
7880
if ($customKeys !== null && in_array($key, $customKeys)) {
7981
$returnVal[$key] = $val;

vendor/rollbar/rollbar/tests/DataTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ public function testEncode()
155155
->setRequest($request)
156156
->setPerson($person)
157157
->setServer($server)
158-
->setCustom(array("x" => "hello", "extra" => new \ArrayObject()))
158+
->setCustom(array("x" => "hello", "extra" => array('key'=>'val')))
159159
->setFingerprint("big-fingerprint")
160160
->setTitle("The Title")
161161
->setUuid("123e4567-e89b-12d3-a456-426655440000")
@@ -175,7 +175,7 @@ public function testEncode()
175175
$this->assertContains("\"request\":\"{REQUEST}\"", $encoded);
176176
$this->assertContains("\"person\":\"{PERSON}\"", $encoded);
177177
$this->assertContains("\"server\":\"{SERVER}\"", $encoded);
178-
$this->assertContains("\"custom\":{\"x\":\"hello\",\"extra\":{}}", $encoded);
178+
$this->assertContains("\"custom\":{\"x\":\"hello\",\"extra\":{\"key\":\"val\"}}", $encoded);
179179
$this->assertContains("\"fingerprint\":\"big-fingerprint\"", $encoded);
180180
$this->assertContains("\"title\":\"The Title\"", $encoded);
181181
$this->assertContains("\"uuid\":\"123e4567-e89b-12d3-a456-426655440000\"", $encoded);

vendor/rollbar/rollbar/tests/DefaultsTest.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,17 @@ public function testGitBranch()
8686
$this->assertEquals($val, $this->defaults->gitBranch());
8787
}
8888

89+
public function testGitBranchExplicit()
90+
{
91+
$val = 'some-branch';
92+
$this->assertEquals($val, $this->defaults->gitBranch($val));
93+
}
94+
95+
public function testGitBranchNoExec()
96+
{
97+
$this->assertEquals(null, $this->defaults->gitBranch(null, false));
98+
}
99+
89100
public function testServerRoot()
90101
{
91102
$_ENV["HEROKU_APP_DIR"] = "abc123";

vendor/rollbar/rollbar/tests/NotifierTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,6 @@ public function testEncode()
2929
{
3030
$notifier = Notifier::defaultNotifier();
3131
$encoded = json_encode($notifier->serialize());
32-
$this->assertEquals('{"name":"rollbar-php","version":"1.5.2"}', $encoded);
32+
$this->assertEquals('{"name":"rollbar-php","version":"1.5.3"}', $encoded);
3333
}
3434
}

0 commit comments

Comments
 (0)