Plugin Directory

Changeset 1894410


Ignore:
Timestamp:
06/18/2018 09:09:25 AM (8 years ago)
Author:
arturmoczulski
Message:

Sync with GitHub repo

Location:
rollbar/trunk
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • rollbar/trunk/README.md

    r1881337 r1894410  
    33
    44Rollbar full-stack error tracking for WordPress
     5
     6The full documentation is available [here](https://docs.rollbar.com/v1.0.0/docs/wordpress).
    57
    68## Description
     
    616312. 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).
    626413. Click `Save Changes`.
    63 
    64 ## Configuration
    65 
    66 ### `rollbar_js_config` filter
    67 
    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` field
    71 of the payload. With this change, you could have this plugin:
    72 
    73 ```php
    74 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_email
    89         );
    90       }
    91     }
    92 
    93     return $config;
    94   }
    95  
    96 }
    97 ```
    98 
    99 ### `rollbar_plugin_settings` filter
    100 
    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 ```php
    104 function adjust_rollbar_settings($settings)
    105 {
    106   ...
    107 }
    108 
    109 add_filter( 'rollbar_plugin_settings', 'adjust_rollbar_settings' );
    110 ```
    11165
    11266## Help / Support
  • rollbar/trunk/readme.txt

    r1890956 r1894410  
    44Requires at least: 3.5.1
    55Tested up to: 4.8.2
    6 Stable tag: 2.4.3
     6Stable tag: 2.4.4
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    107107== Changelog ==
    108108
     109= Version 2.4.4 (June 18th 2018) =
     110* Update rollbar-php to v1.5.3
     111
    109112= Version 2.4.3 (June 11th 2018) =
    110113* Update rollbar-php to v1.5.2
     
    175178== Upgrade Notice ==
    176179
     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
    177187= Version 2.4.2 (25th May 2018) =
    178188* 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  
    44 * Plugin URI:      https://wordpress.org/plugins/rollbar
    55 * Description:     Rollbar full-stack error tracking for WordPress
    6  * Version:         2.4.3
     6 * Version:         2.4.4
    77 * Author:          Rollbar
    88 * Author URI:      https://rollbar.com
  • rollbar/trunk/src/Plugin.php

    r1890956 r1894410  
    1010class Plugin {
    1111   
    12     const VERSION = "2.4.3";
     12    const VERSION = "2.4.4";
    1313   
    1414    private $config;
     
    1717   
    1818    private function __construct() {
    19         $this->fetchSettings();
    2019        $this->config = array();
    2120    }
     
    233232        }
    234233       
     234        $this->fetchSettings();
     235       
    235236        // installs global error and exception handlers
    236237        try {
     
    366367    public function getDefaultOption($setting)
    367368    {
     369        $spaced = str_replace('_', ' ', $setting);
     370        $method = lcfirst(str_replace(' ', '', ucwords($spaced)));
     371       
    368372        // Handle the "branch" exception
    369373        switch($method) {
    370374            case "branch":
    371                 $method = "git_branch";
     375                $method = "gitBranch";
    372376                break;
    373377        }
     
    384388        if ($value === null) {
    385389            try {
    386                 $value = $rollbarDefaults->fromSnakeCase($setting);
     390                $value = $rollbarDefaults->$method();
    387391            } catch (\Exception $e) {
    388392                $value = null;
  • rollbar/trunk/vendor/rollbar/rollbar/README.md

    r1890956 r1894410  
    1818See 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
    2222A range of examples of using Rollbar PHP is available here: [Rollbar PHP Examples](https://github.com/rollbar/rollbar-php-examples).
     
    3535Yii2 package: [baibaratsky/yii2-rollbar](https://github.com/baibaratsky/yii2-rollbar)
    3636
    37 ## Help / Support
     37# Help / Support
    3838
    3939If you run into any issues, please email us at [[email protected]](mailto:[email protected])
     
    4343the contents of your `sys_get_temp_dir() . '/rollbar.debug.log'` (usually `/tmp/rollbar.debug.log`).
    4444
    45 ## Contributing
     45# Contributing
    4646
    47471. Fork it
     
    51515. Create new Pull Request
    5252
    53 ## Testing
     53# Testing
    5454Tests are in `tests`.
    5555To run the tests: `composer test`
    5656To fix code style issues: `composer fix`
    5757
     58# Tagging
     59
     601. `export ROLLBAR_PHP_TAG=[version number]`
     612. `git checkout master`
     623. Update version numbers in `src/Payload/Notifier.php` and `tests/NotifierTest.php`.
     634. `git add .`
     645. `git commit -m"Update readme.io dump and bump version numbers"`.
     656. `git push origin master`
     667. `git tag $ROLLBAR_PHP_TAG_VERSION`
     67
    5868# License
    5969Rollbar-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  
    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   
  • rollbar/trunk/vendor/rollbar/rollbar/src/Payload/Notifier.php

    r1890956 r1894410  
    44{
    55    const NAME = "rollbar-php";
    6     const VERSION = "1.5.2";
     6    const VERSION = "1.5.3";
    77
    88    public static function defaultNotifier()
  • rollbar/trunk/vendor/rollbar/rollbar/src/RollbarLogger.php

    r1890956 r1894410  
    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);
     
    189190   
    190191    /**
    191      * @param Payload $payload
     192     * @param array $serializedPayload
    192193     * @return array
    193194     */
    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;
    199199    }
    200200   
  • rollbar/trunk/vendor/rollbar/rollbar/src/Utilities.php

    r1890956 r1894410  
    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)) {
  • rollbar/trunk/vendor/rollbar/rollbar/tests/DataTest.php

    r1890956 r1894410  
    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")
     
    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);
  • rollbar/trunk/vendor/rollbar/rollbar/tests/DefaultsTest.php

    r1890956 r1894410  
    8585        $val = rtrim(shell_exec('git rev-parse --abbrev-ref HEAD'));
    8686        $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));
    8798    }
    8899
  • rollbar/trunk/vendor/rollbar/rollbar/tests/NotifierTest.php

    r1890956 r1894410  
    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}
Note: See TracChangeset for help on using the changeset viewer.