Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.git
vendor
10 changes: 10 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM shivammathur/node:focal

VOLUME [ "/opt/rollbar/rollbar-php" ]
WORKDIR /opt/rollbar/rollbar-php
ENTRYPOINT [ "/bin/bash" ]

RUN apt-get update \
&& apt-get install -y ca-certificates git vim tree

RUN spc --php-version "8.0" --extensions "curl" --coverage "xdebug"
16 changes: 8 additions & 8 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,26 +31,26 @@
},

"require": {
"php": ">=8.0.0 <9.0",
"ext-curl": "*",
"psr/log": "^1",
"monolog/monolog": "^1 || ^2"
"monolog/monolog": "^2"
},

"require-dev": {
"phpunit/phpunit": "4.8.* || 5.7.* || ^8",
"mockery/mockery": "1.*",
"squizlabs/php_codesniffer": "2.*",
"codeclimate/php-test-reporter": "dev-master",
"packfire/php5.3-compat": "*",
"phpmd/phpmd" : "@stable"
"phpunit/phpunit": "^9",
"mockery/mockery": "^1",
"squizlabs/php_codesniffer": "^3",
"phpmd/phpmd" : "^2"
},

"suggest": {
"packfire/php5.3-compat": "for backward compatibility with PHP 5.3",
"fluent/logger": "Needed to use the 'fluent' handler for fluentd support"
},

"scripts": {
"docker-build": "docker build -t rollbar/rollbar-php:3 .",
"docker-run": "docker run -it -v \"${PWD}\":/opt/rollbar/rollbar-php rollbar/rollbar-php:3",
"test": [
"phpunit --coverage-clover build/logs/clover.xml --testsuite 'Rollbar Test Suite'",
"phpcs --standard=PSR1,PSR2 src tests"
Expand Down
27 changes: 15 additions & 12 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit backupGlobals="false"
backupStaticAttributes="false"
bootstrap="./tests/bootstrap.php"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
stopOnFailure="false">
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
backupGlobals="false"
backupStaticAttributes="false"
bootstrap="./tests/bootstrap.php"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
stopOnFailure="false">
<testsuites>
<testsuite name="Rollbar Test Suite">
<directory suffix=".php">./tests/</directory>
Expand All @@ -16,11 +19,11 @@
<directory suffix=".php">./tests/Performance/</directory>
</testsuite>
</testsuites>
<filter>
<whitelist processUncoveredFilesFromWhitelist="true">
<coverage processUncoveredFiles="true">
<include>
<directory suffix=".php">./src</directory>
</whitelist>
</filter>
</include>
</coverage>
<php>
<env name="ROLLBAR_TEST_TOKEN" value="ad865e76e7fb496fab096ac07b1dbabb" />
</php>
Expand Down
4 changes: 4 additions & 0 deletions src/DataBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,10 @@ protected function setLocalVarsDump($config)
{
$fromConfig = isset($config['local_vars_dump']) ? $config['local_vars_dump'] : null;
$this->localVarsDump = self::$defaults->localVarsDump($fromConfig);
if ($this->localVarsDump && !empty(ini_get('zend.exception_ignore_args'))) {
ini_set('zend.exception_ignore_args', 'Off');
assert(empty(ini_get('zend.exception_ignore_args')));
}
}

protected function setCaptureErrorStacktraces($config)
Expand Down
130 changes: 0 additions & 130 deletions src/Monolog/Handler/RollbarHandler.php

This file was deleted.

2 changes: 1 addition & 1 deletion src/Payload/Body.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public function serialize()
);
}

public function unserialize($serialized)
public function unserialize(string $serialized)
{
throw new \Exception('Not implemented yet.');
}
Expand Down
2 changes: 1 addition & 1 deletion src/Payload/Context.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public function serialize()
return $this->utilities->serializeForRollbar($result, null, $objectHashes);
}

public function unserialize($serialized)
public function unserialize(string $serialized)
{
throw new \Exception('Not implemented yet.');
}
Expand Down
2 changes: 1 addition & 1 deletion src/Payload/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ public function serialize()
return $this->utilities->serializeForRollbar($result, null, $objectHashes);
}

public function unserialize($serialized)
public function unserialize(string $serialized)
{
throw new \Exception('Not implemented yet.');
}
Expand Down
2 changes: 1 addition & 1 deletion src/Payload/ExceptionInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public function serialize()
return $this->utilities->serializeForRollbar($result, null, $objectHashes);
}

public function unserialize($serialized)
public function unserialize(string $serialized)
{
throw new \Exception('Not implemented yet.');
}
Expand Down
2 changes: 1 addition & 1 deletion src/Payload/Frame.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ public function serialize()
return $this->utilities->serializeForRollbar($result, null, $objectHashes);
}

public function unserialize($serialized)
public function unserialize(string $serialized)
{
throw new \Exception('Not implemented yet.');
}
Expand Down
2 changes: 1 addition & 1 deletion src/Payload/Level.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public function serialize()
return $this->level;
}

public function unserialize($serialized)
public function unserialize(string $serialized)
{
throw new \Exception('Not implemented yet.');
}
Expand Down
2 changes: 1 addition & 1 deletion src/Payload/Notifier.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public function serialize()
return $this->utilities->serializeForRollbar($result, null, $objectHashes);
}

public function unserialize($serialized)
public function unserialize(string $serialized)
{
throw new \Exception('Not implemented yet.');
}
Expand Down
2 changes: 1 addition & 1 deletion src/Payload/Payload.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public function serialize($maxDepth = -1)
return $this->utilities->serializeForRollbar($result, null, $objectHashes, $maxDepth);
}

public function unserialize($serialized)
public function unserialize(string $serialized)
{
throw new \Exception('Not implemented yet.');
}
Expand Down
2 changes: 1 addition & 1 deletion src/Payload/Person.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public function serialize()
return $this->utilities->serializeForRollbar($result, array_keys($this->extra), $objectHashes);
}

public function unserialize($serialized)
public function unserialize(string $serialized)
{
throw new \Exception('Not implemented yet.');
}
Expand Down
2 changes: 1 addition & 1 deletion src/Payload/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ public function serialize()
return $this->utilities->serializeForRollbar($result, array_keys($this->extra), $objectHashes);
}

public function unserialize($serialized)
public function unserialize(string $serialized)
{
throw new \Exception('Not implemented yet.');
}
Expand Down
2 changes: 1 addition & 1 deletion src/Payload/Server.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public function serialize()
return $this->utilities->serializeForRollbar($result, array_keys($this->extra), $objectHashes);
}

public function unserialize($serialized)
public function unserialize(string $serialized)
{
throw new \Exception('Not implemented yet.');
}
Expand Down
8 changes: 8 additions & 0 deletions src/RollbarLogger.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,14 @@ public function __construct(array $config)
$this->truncation = new Truncation($this->config);
$this->queue = array();
}

/**
* @since 3.0
*/
public function getConfig()
{
return $this->config;
}

public function enable()
{
Expand Down
2 changes: 1 addition & 1 deletion tests/AgentTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public function testAgent()
$logger->info("this is a test");
$file = fopen($this->path . '/rollbar-relay.' . getmypid() . '.' . microtime(true) . '.rollbar', 'r');
$line = fgets($file);
$this->assertContains('this is a test', $line);
$this->assertStringContainsString('this is a test', $line);
}

public function tearDown(): void
Expand Down
Loading