Changeset 1894410
- Timestamp:
- 06/18/2018 09:09:25 AM (8 years ago)
- Location:
- rollbar/trunk
- Files:
-
- 12 edited
-
README.md (modified) (2 diffs)
-
readme.txt (modified) (3 diffs)
-
rollbar-php-wordpress.php (modified) (1 diff)
-
src/Plugin.php (modified) (5 diffs)
-
vendor/rollbar/rollbar/README.md (modified) (4 diffs)
-
vendor/rollbar/rollbar/src/Defaults.php (modified) (1 diff)
-
vendor/rollbar/rollbar/src/Payload/Notifier.php (modified) (1 diff)
-
vendor/rollbar/rollbar/src/RollbarLogger.php (modified) (2 diffs)
-
vendor/rollbar/rollbar/src/Utilities.php (modified) (1 diff)
-
vendor/rollbar/rollbar/tests/DataTest.php (modified) (2 diffs)
-
vendor/rollbar/rollbar/tests/DefaultsTest.php (modified) (1 diff)
-
vendor/rollbar/rollbar/tests/NotifierTest.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
rollbar/trunk/README.md
r1881337 r1894410 3 3 4 4 Rollbar full-stack error tracking for WordPress 5 6 The full documentation is available [here](https://docs.rollbar.com/v1.0.0/docs/wordpress). 5 7 6 8 ## Description … … 61 63 12. Pick a minimum logging level. Only errors at that or higher level will be reported. For reference: [PHP Manual: Predefined Error Constants](http://php.net/manual/en/errorfunc.constants.php). 62 64 13. Click `Save Changes`. 63 64 ## Configuration65 66 ### `rollbar_js_config` filter67 68 Allows a plugin to modify the JS config passed to Rollbar.69 70 You can use this e.g. to add the currently logged in user to the `person` field71 of the payload. With this change, you could have this plugin:72 73 ```php74 class RollbarWPUser {75 76 public function __construct(){77 add_filter( 'rollbar_js_config', array($this, 'rollbar_js_config') );78 }79 80 function rollbar_js_config($config) {81 if(is_user_logged_in()) {82 $user = wp_get_current_user();83 84 if(empty($config['payload']['person'])) {85 $config['payload']['person'] = array(86 'id' => $user->ID,87 'username' => $user->user_login,88 'email' => $user->user_email89 );90 }91 }92 93 return $config;94 }95 96 }97 ```98 99 ### `rollbar_plugin_settings` filter100 101 Allows you to manually adjust the settings of the plugin, in case you want to add additional processing after the settings get fetched from the database.102 103 ```php104 function adjust_rollbar_settings($settings)105 {106 ...107 }108 109 add_filter( 'rollbar_plugin_settings', 'adjust_rollbar_settings' );110 ```111 65 112 66 ## Help / Support -
rollbar/trunk/readme.txt
r1890956 r1894410 4 4 Requires at least: 3.5.1 5 5 Tested up to: 4.8.2 6 Stable tag: 2.4. 36 Stable tag: 2.4.4 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 107 107 == Changelog == 108 108 109 = Version 2.4.4 (June 18th 2018) = 110 * Update rollbar-php to v1.5.3 111 109 112 = Version 2.4.3 (June 11th 2018) = 110 113 * Update rollbar-php to v1.5.2 … … 175 178 == Upgrade Notice == 176 179 180 = Version 2.4.4 (June 18th 2018) = 181 * Update rollbar-php to v1.5.3 182 183 = Version 2.4.3 (June 11th 2018) = 184 * Update rollbar-php to v1.5.2 185 * Use rollbar-php:v1.5.2 new defaults methods to handle restoring default settings. 186 177 187 = Version 2.4.2 (25th May 2018) = 178 188 * Fixed the plugin not always respecting the boolean true settings (https://github.com/rollbar/rollbar-php-wordpress/issues/58) -
rollbar/trunk/rollbar-php-wordpress.php
r1890956 r1894410 4 4 * Plugin URI: https://wordpress.org/plugins/rollbar 5 5 * Description: Rollbar full-stack error tracking for WordPress 6 * Version: 2.4. 36 * Version: 2.4.4 7 7 * Author: Rollbar 8 8 * Author URI: https://rollbar.com -
rollbar/trunk/src/Plugin.php
r1890956 r1894410 10 10 class Plugin { 11 11 12 const VERSION = "2.4. 3";12 const VERSION = "2.4.4"; 13 13 14 14 private $config; … … 17 17 18 18 private function __construct() { 19 $this->fetchSettings();20 19 $this->config = array(); 21 20 } … … 233 232 } 234 233 234 $this->fetchSettings(); 235 235 236 // installs global error and exception handlers 236 237 try { … … 366 367 public function getDefaultOption($setting) 367 368 { 369 $spaced = str_replace('_', ' ', $setting); 370 $method = lcfirst(str_replace(' ', '', ucwords($spaced))); 371 368 372 // Handle the "branch" exception 369 373 switch($method) { 370 374 case "branch": 371 $method = "git _branch";375 $method = "gitBranch"; 372 376 break; 373 377 } … … 384 388 if ($value === null) { 385 389 try { 386 $value = $rollbarDefaults-> fromSnakeCase($setting);390 $value = $rollbarDefaults->$method(); 387 391 } catch (\Exception $e) { 388 392 $value = null; -
rollbar/trunk/vendor/rollbar/rollbar/README.md
r1890956 r1894410 18 18 See our [Releases](https://github.com/rollbar/rollbar-php/releases) page for a list of all releases, including changes. 19 19 20 # #Related projects20 # Related projects 21 21 22 22 A range of examples of using Rollbar PHP is available here: [Rollbar PHP Examples](https://github.com/rollbar/rollbar-php-examples). … … 35 35 Yii2 package: [baibaratsky/yii2-rollbar](https://github.com/baibaratsky/yii2-rollbar) 36 36 37 # #Help / Support37 # Help / Support 38 38 39 39 If you run into any issues, please email us at [[email protected]](mailto:[email protected]) … … 43 43 the contents of your `sys_get_temp_dir() . '/rollbar.debug.log'` (usually `/tmp/rollbar.debug.log`). 44 44 45 # #Contributing45 # Contributing 46 46 47 47 1. Fork it … … 51 51 5. Create new Pull Request 52 52 53 # #Testing53 # Testing 54 54 Tests are in `tests`. 55 55 To run the tests: `composer test` 56 56 To fix code style issues: `composer fix` 57 57 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 58 68 # License 59 69 Rollbar-gem is free software released under the MIT License. See [LICENSE.txt](LICENSE.txt) for details. -
rollbar/trunk/vendor/rollbar/rollbar/src/Defaults.php
r1890956 r1894410 132 132 return $gitBranch; 133 133 } 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; 136 142 } 137 return $this->defaultGitBranch;143 return null; 138 144 } 139 145 -
rollbar/trunk/vendor/rollbar/rollbar/src/Payload/Notifier.php
r1890956 r1894410 4 4 { 5 5 const NAME = "rollbar-php"; 6 const VERSION = "1.5. 2";6 const VERSION = "1.5.3"; 7 7 8 8 public static function defaultNotifier() -
rollbar/trunk/vendor/rollbar/rollbar/src/RollbarLogger.php
r1890956 r1894410 101 101 $response = new Response(0, "Ignored"); 102 102 } else { 103 $scrubbed = $this->scrub($payload); 103 $serialized = $payload->serialize(); 104 $scrubbed = $this->scrub($serialized); 104 105 $encoded = $this->encode($scrubbed); 105 106 $truncated = $this->truncate($encoded); … … 189 190 190 191 /** 191 * @param Payload $payload192 * @param array $serializedPayload 192 193 * @return array 193 194 */ 194 protected function scrub(Payload $payload) 195 { 196 $serialized = $payload->serialize(); 197 $serialized['data'] = $this->config->getScrubber()->scrub($serialized['data']); 198 return $serialized; 195 protected function scrub(array &$serializedPayload) 196 { 197 $serializedPayload['data'] = $this->config->getScrubber()->scrub($serializedPayload['data']); 198 return $serializedPayload; 199 199 } 200 200 -
rollbar/trunk/vendor/rollbar/rollbar/src/Utilities.php
r1890956 r1894410 75 75 if ($val instanceof \Serializable) { 76 76 $val = $val->serialize(); 77 } elseif (is_array($val)) { 78 $val = self::serializeForRollbar($val); 77 79 } 78 80 if ($customKeys !== null && in_array($key, $customKeys)) { -
rollbar/trunk/vendor/rollbar/rollbar/tests/DataTest.php
r1890956 r1894410 156 156 ->setPerson($person) 157 157 ->setServer($server) 158 ->setCustom(array("x" => "hello", "extra" => new \ArrayObject()))158 ->setCustom(array("x" => "hello", "extra" => array('key'=>'val'))) 159 159 ->setFingerprint("big-fingerprint") 160 160 ->setTitle("The Title") … … 176 176 $this->assertContains("\"person\":\"{PERSON}\"", $encoded); 177 177 $this->assertContains("\"server\":\"{SERVER}\"", $encoded); 178 $this->assertContains("\"custom\":{\"x\":\"hello\",\"extra\":{ }}", $encoded);178 $this->assertContains("\"custom\":{\"x\":\"hello\",\"extra\":{\"key\":\"val\"}}", $encoded); 179 179 $this->assertContains("\"fingerprint\":\"big-fingerprint\"", $encoded); 180 180 $this->assertContains("\"title\":\"The Title\"", $encoded); -
rollbar/trunk/vendor/rollbar/rollbar/tests/DefaultsTest.php
r1890956 r1894410 85 85 $val = rtrim(shell_exec('git rev-parse --abbrev-ref HEAD')); 86 86 $this->assertEquals($val, $this->defaults->gitBranch()); 87 } 88 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)); 87 98 } 88 99 -
rollbar/trunk/vendor/rollbar/rollbar/tests/NotifierTest.php
r1890956 r1894410 30 30 $notifier = Notifier::defaultNotifier(); 31 31 $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); 33 33 } 34 34 }
Note: See TracChangeset
for help on using the changeset viewer.