File: Notifications_Boxcar.php

package info (click to toggle)
spotweb 20130826%2Bdfsg2-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 5,132 kB
  • ctags: 11,281
  • sloc: php: 31,367; xml: 1,009; sh: 148; makefile: 83
file content (23 lines) | stat: -rwxr-xr-x 761 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<?php
require_once "lib/notifications/boxcar/boxcar_api.php"; // https://github.com/boxcar/Boxcar-PHP-Provider

class Notifications_Boxcar extends Notifications_abs {
	private $_dataArray;
	private $_appName;
	var $boxcarObj;

	function __construct($appName, array $dataArray) {
		$this->boxcarObj = new boxcar_api($dataArray['api_key'], $dataArray['api_secret']);
		$this->_appName = $appName;
		$this->_dataArray = $dataArray;
	} # ctor

	function register() {
		$this->boxcarObj->invite($this->_dataArray['email']);
	} # register

	function sendMessage($type, $title, $body, $sourceUrl) {
		$this->boxcarObj->notify($this->_dataArray['email'], $this->_appName, $body, null, null, $sourceUrl);
	} # sendMessage

} # Notifications_Boxcar