This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once('rollbar.php'); | |
class EchoLogger { | |
public function log($level, $message) { | |
echo "[Rollbar] $level $message\n"; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/rollbar.php b/rollbar.php | |
index d36a09c..d392102 100644 | |
--- a/rollbar.php | |
+++ b/rollbar.php | |
@@ -663,6 +663,9 @@ class RollbarNotifier { | |
$url = $this->base_api_url . $action . '/'; | |
$ch = curl_init(); | |
+ curl_setopt($ch, CURLOPT_VERBOSE, true); | |
+ // add the following only if on php 5.3.2 or higher |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once('rollbar.php'); | |
class EchoLogger { | |
public function log($level, $message) { | |
echo "[Rollbar] $level $message\n"; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// needs to have the 'write' scope. see the Security tab on the project settings page. | |
$access_token = 'access-token-here'; | |
$item_id = 12345; | |
// acceptable values: 'resolved', 'active', 'muted' | |
$new_status = 'resolved'; | |
$url = 'https://submit.ratchet.io/api/1/item/' . $item_id . '?access_token=' . $access_token; | |
$ch = curl_init($url); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Brian-Rues-MacBook-Pro:test brian$ php parse_error_1.php | |
Parse error: parse error in /Users/brian/www/ratchetio-php/test/parse_error_2.php on line 2 | |
in shutdown handler | |
last error: | |
array(4) { | |
["type"]=> | |
int(4) | |
["message"]=> | |
string(11) "parse error" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# I am trying out Ratchet.io and I want to add their deployment notification to my | |
# normal capistrano deployment process. Here is my first working attempt. | |
# Add this task to your deploy.rb | |
task :notify_ratchetio, :roles => :app do | |
set :revision, `git log -n 1 --pretty=format:"%H"` | |
set :local_user, `whoami` | |
set :ratchetio_token, YOUR_ACCESS_TOKEN | |
rails_env = fetch(:rails_env, "production") | |
run "curl https://submit.ratchet.io/api/1/deploy/ -F access_token=#{ratchetio_token} -F environment=#{rails_env} -F revision=#{revision} -F local_username=#{local_user}", :once => true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import time | |
import requests | |
access_token = 'xxxxx' | |
payload = { | |
'access_token': access_token, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
from fabric.api import run, local, cd, env, roles, execute | |
import requests | |
env.roledefs = { | |
'web': ['web1', 'web2'] | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
from fabric.api import run, local, cd, env, roles, execute | |
import requests | |
env.hosts = ['web1', 'web2'] | |
def deploy(): | |
# pre-roll checks |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
from fabric.api import run, local, cd, env, roles, execute | |
import requests | |
env.roledefs = { | |
'web': ['web1', 'web2'] | |
} | |