-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2632 from MPOS/development
UPDATE : Development to Master
- Loading branch information
Showing
14 changed files
with
71 additions
and
61 deletions.
There are no files selected for viewing
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,42 @@ | ||
<?php | ||
class Notifications_NotifyMyAndroid implements IPushNotification { | ||
|
||
private $apiKey; | ||
public function __construct($apikey){ | ||
$this->apiKey = $apikey; | ||
} | ||
|
||
static $priorities = array( | ||
0 => 'info', | ||
2 => 'error', | ||
); | ||
|
||
public static function getName(){ | ||
return "notifymyandroid.com"; | ||
} | ||
|
||
public static function getParameters(){ | ||
return array( | ||
'apikey' => 'API key', | ||
); | ||
} | ||
|
||
public function notify($message, $severity = 'info', $event = null){ | ||
curl_setopt_array($ch = curl_init(), array( | ||
CURLOPT_URL => "https://www.notifymyandroid.com/publicapi/notify", | ||
CURLOPT_POST => true, | ||
CURLOPT_RETURNTRANSFER => true, | ||
CURLOPT_POSTFIELDS => http_build_query($data = array( | ||
"apikey" => $this->apiKey, | ||
"application" => "CryptoGlance", | ||
"description" => $message, | ||
"content-type" => "text/html", | ||
"event" => $event, | ||
"priority" => array_search($severity, self::$priorities), | ||
)), | ||
)); | ||
curl_exec($ch); | ||
curl_close($ch); | ||
} | ||
} | ||
class Notifications_NotifyMyAndroid implements IPushNotification { | ||
|
||
private $apiKey; | ||
public function __construct($apikey){ | ||
$this->apiKey = $apikey; | ||
} | ||
|
||
static $priorities = array( | ||
0 => 'info', | ||
2 => 'error', | ||
); | ||
|
||
public static function getName(){ | ||
return "notifymyandroid.com"; | ||
} | ||
|
||
public static function getParameters(){ | ||
return array( | ||
'apikey' => 'API key', | ||
); | ||
} | ||
|
||
public function notify($message, $severity = 'info', $event = null){ | ||
global $setting; | ||
curl_setopt_array($ch = curl_init(), array( | ||
CURLOPT_URL => "https://www.notifymyandroid.com/publicapi/notify", | ||
CURLOPT_POST => true, | ||
CURLOPT_RETURNTRANSFER => true, | ||
CURLOPT_POSTFIELDS => http_build_query($data = array( | ||
"apikey" => $this->apiKey, | ||
"application" => $setting->getValue('website_title')?:"PHP-MPOS", | ||
"description" => $message, | ||
"content-type" => "text/html", | ||
"event" => $event, | ||
"priority" => array_search($severity, self::$priorities), | ||
)), | ||
)); | ||
curl_exec($ch); | ||
curl_close($ch); | ||
} | ||
} |
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
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
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
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
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
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
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
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
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
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