Updated documentation, added some small changes
parent
eac8ebc261
commit
1c984b30ff
|
@ -317,7 +317,7 @@ function psm_log_uptime($server_id, $status, $latency) {
|
||||||
* @return string parsed message
|
* @return string parsed message
|
||||||
*/
|
*/
|
||||||
function psm_parse_msg($status, $type, $vars) {
|
function psm_parse_msg($status, $type, $vars) {
|
||||||
$status = ($status == true) ? 'on' : 'off';
|
$status = ($status === true) ? 'on' : 'off';
|
||||||
|
|
||||||
$message = psm_get_lang('notifications', $status.'_'.$type);
|
$message = psm_get_lang('notifications', $status.'_'.$type);
|
||||||
|
|
||||||
|
@ -339,7 +339,7 @@ function psm_parse_msg($status, $type, $vars) {
|
||||||
* @param string $href
|
* @param string $href
|
||||||
* @param boolean $header return headers?
|
* @param boolean $header return headers?
|
||||||
* @param boolean $body return body?
|
* @param boolean $body return body?
|
||||||
* @param int $timeout connection timeout in seconds. defaults to PSM_CURL_TIMEOUT (10 secs).
|
* @param int|null $timeout connection timeout in seconds. defaults to PSM_CURL_TIMEOUT (10 secs).
|
||||||
* @param boolean $add_agent add user agent?
|
* @param boolean $add_agent add user agent?
|
||||||
* @param string|bool $website_username Username website
|
* @param string|bool $website_username Username website
|
||||||
* @param string|bool $website_password Password website
|
* @param string|bool $website_password Password website
|
||||||
|
@ -459,7 +459,7 @@ function psm_update_available() {
|
||||||
$latest = psm_get_conf('version_update_check');
|
$latest = psm_get_conf('version_update_check');
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($latest != false) {
|
if ($latest !== false) {
|
||||||
$current = psm_get_conf('version');
|
$current = psm_get_conf('version');
|
||||||
return version_compare($latest, $current, '>');
|
return version_compare($latest, $current, '>');
|
||||||
} else {
|
} else {
|
||||||
|
@ -523,7 +523,7 @@ function psm_build_pushover() {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @return \psm\Txtmsg\TxtmsgInterface
|
* @return \Telegram
|
||||||
*/
|
*/
|
||||||
function psm_build_telegram() {
|
function psm_build_telegram() {
|
||||||
$telegram = new \Telegram();
|
$telegram = new \Telegram();
|
||||||
|
|
|
@ -35,7 +35,7 @@ class ServerController extends AbstractServerController {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Current server id
|
* Current server id
|
||||||
* @var int $server_id
|
* @var int|\PDOStatement $server_id
|
||||||
*/
|
*/
|
||||||
protected $server_id;
|
protected $server_id;
|
||||||
|
|
||||||
|
|
|
@ -61,7 +61,7 @@ class Database {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* PDOStatement of last query
|
* PDOStatement of last query
|
||||||
* @var \PDOStatement $last
|
* @var int|bool|\PDOStatement $last
|
||||||
*/
|
*/
|
||||||
protected $last;
|
protected $last;
|
||||||
|
|
||||||
|
@ -140,7 +140,7 @@ class Database {
|
||||||
/**
|
/**
|
||||||
* Execute SQL statement and return number of affected rows
|
* Execute SQL statement and return number of affected rows
|
||||||
* @param string $query
|
* @param string $query
|
||||||
* @return int
|
* @return int|\PDOStatement
|
||||||
*/
|
*/
|
||||||
public function exec($query) {
|
public function exec($query) {
|
||||||
try {
|
try {
|
||||||
|
@ -155,9 +155,9 @@ class Database {
|
||||||
/**
|
/**
|
||||||
* Prepare and execute SQL statement with parameters
|
* Prepare and execute SQL statement with parameters
|
||||||
* @param string $query SQL statement
|
* @param string $query SQL statement
|
||||||
* @param Array $parameters An array of values with as many elements as there are bound parameters in the SQL statement
|
* @param array $parameters An array of values with as many elements as there are bound parameters in the SQL statement
|
||||||
* @param boolean $fetch automatically fetch results, or return PDOStatement?
|
* @param boolean $fetch automatically fetch results, or return PDOStatement?
|
||||||
* @return @return array|\PDOStatement if $fetch = true, array, otherwise \PDOStatement
|
* @return array|\PDOStatement if $fetch = true, array, otherwise \PDOStatement
|
||||||
*/
|
*/
|
||||||
public function execute($query, $parameters, $fetch = true) {
|
public function execute($query, $parameters, $fetch = true) {
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -189,8 +189,9 @@ class CMBulkSMS extends Core {
|
||||||
/**
|
/**
|
||||||
* Create and execute the curl request
|
* Create and execute the curl request
|
||||||
*
|
*
|
||||||
* @return boolean True if message is sent
|
* @return boolean|string boolean if message is sent, else string
|
||||||
*/
|
*/
|
||||||
|
|
||||||
protected function executeCurlRequest() {
|
protected function executeCurlRequest() {
|
||||||
$cr = curl_init();
|
$cr = curl_init();
|
||||||
curl_setopt_array($cr, array(
|
curl_setopt_array($cr, array(
|
||||||
|
@ -209,7 +210,7 @@ class CMBulkSMS extends Core {
|
||||||
$cErrorCode = curl_errno($cr);
|
$cErrorCode = curl_errno($cr);
|
||||||
curl_close($cr);
|
curl_close($cr);
|
||||||
|
|
||||||
$this->result = 1;
|
$this->result = true;
|
||||||
// set result and log error if needed
|
// set result and log error if needed
|
||||||
if ($cError) {
|
if ($cError) {
|
||||||
$this->error = 'Response: CM SMS API:'.$cResponse.' cURL Error Code: '.$cErrorCode.'"'.$cError.'"';
|
$this->error = 'Response: CM SMS API:'.$cResponse.' cURL Error Code: '.$cErrorCode.'"'.$cError.'"';
|
||||||
|
|
|
@ -49,7 +49,7 @@ class Callr extends Core {
|
||||||
* @var int $success
|
* @var int $success
|
||||||
* @var string $error
|
* @var string $error
|
||||||
*
|
*
|
||||||
* @return int or string
|
* @return bool|string
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public function sendSMS($message) {
|
public function sendSMS($message) {
|
||||||
|
|
|
@ -46,7 +46,7 @@ class ClickSend extends Core {
|
||||||
* @var int $success
|
* @var int $success
|
||||||
* @var string $error
|
* @var string $error
|
||||||
*
|
*
|
||||||
* @return int or string
|
* @return bool|string
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public function sendSMS($message) {
|
public function sendSMS($message) {
|
||||||
|
|
|
@ -41,7 +41,7 @@ class Clickatell extends Core {
|
||||||
* @var int $success
|
* @var int $success
|
||||||
* @var string $error
|
* @var string $error
|
||||||
*
|
*
|
||||||
* @return int or string
|
* @return bool|string
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public function sendSMS($message) {
|
public function sendSMS($message) {
|
||||||
|
|
|
@ -42,7 +42,7 @@ class FreeMobileSMS extends Core {
|
||||||
* @var string $error
|
* @var string $error
|
||||||
* @var string $http_code
|
* @var string $http_code
|
||||||
*
|
*
|
||||||
* @return int or string
|
* @return bool|string
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public function sendSMS($message) {
|
public function sendSMS($message) {
|
||||||
|
|
|
@ -45,7 +45,7 @@ class FreeVoipDeal extends Core {
|
||||||
* @var int $success
|
* @var int $success
|
||||||
* @var string $error
|
* @var string $error
|
||||||
*
|
*
|
||||||
* @return int or string
|
* @return bool|string
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public function sendSMS($message) {
|
public function sendSMS($message) {
|
||||||
|
|
|
@ -46,7 +46,7 @@ class GatewayAPI extends Core {
|
||||||
* @var int $success
|
* @var int $success
|
||||||
* @var string $error
|
* @var string $error
|
||||||
*
|
*
|
||||||
* @return int or string
|
* @return bool|string
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public function sendSMS($message) {
|
public function sendSMS($message) {
|
||||||
|
|
|
@ -46,7 +46,7 @@ class Inetworx extends Core {
|
||||||
* @var int $success
|
* @var int $success
|
||||||
* @var string $error
|
* @var string $error
|
||||||
*
|
*
|
||||||
* @return int or string
|
* @return bool|string
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public function sendSMS($message) {
|
public function sendSMS($message) {
|
||||||
|
|
|
@ -45,8 +45,9 @@ class Messagebird extends Core {
|
||||||
* @var int $success
|
* @var int $success
|
||||||
* @var string $error
|
* @var string $error
|
||||||
*
|
*
|
||||||
* @return int or string
|
* @return bool|string
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public function sendSMS($message) {
|
public function sendSMS($message) {
|
||||||
$success = 1;
|
$success = 1;
|
||||||
$error = '';
|
$error = '';
|
||||||
|
|
|
@ -45,8 +45,9 @@ class Mosms extends Core {
|
||||||
* @var int $success
|
* @var int $success
|
||||||
* @var string $error
|
* @var string $error
|
||||||
*
|
*
|
||||||
* @return int or string
|
* @return bool|string
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public function sendSMS($message) {
|
public function sendSMS($message) {
|
||||||
$error = "";
|
$error = "";
|
||||||
$success = 1;
|
$success = 1;
|
||||||
|
|
|
@ -47,7 +47,7 @@ class Nexmo extends Core {
|
||||||
* @var int $success
|
* @var int $success
|
||||||
* @var string $error
|
* @var string $error
|
||||||
*
|
*
|
||||||
* @return int or string
|
* @return bool|string
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public function sendSMS($message) {
|
public function sendSMS($message) {
|
||||||
|
|
|
@ -50,7 +50,7 @@ class Octopush extends Core {
|
||||||
* @var int $success
|
* @var int $success
|
||||||
* @var string $error
|
* @var string $error
|
||||||
*
|
*
|
||||||
* @return int or string
|
* @return bool|string
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public function sendSMS($message) {
|
public function sendSMS($message) {
|
||||||
|
|
|
@ -45,7 +45,7 @@ class Plivo extends Core {
|
||||||
* @var int $success
|
* @var int $success
|
||||||
* @var string $error
|
* @var string $error
|
||||||
*
|
*
|
||||||
* @return int or string
|
* @return bool|string
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public function sendSMS($message) {
|
public function sendSMS($message) {
|
||||||
|
|
|
@ -46,7 +46,7 @@ class Smsglobal extends Core {
|
||||||
* @var int $success
|
* @var int $success
|
||||||
* @var string $error
|
* @var string $error
|
||||||
*
|
*
|
||||||
* @return int or string
|
* @return bool|string
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public function sendSMS($message) {
|
public function sendSMS($message) {
|
||||||
|
|
|
@ -45,7 +45,7 @@ class Smsgw extends Core {
|
||||||
* @var int $success
|
* @var int $success
|
||||||
* @var string $error
|
* @var string $error
|
||||||
*
|
*
|
||||||
* @return int or string
|
* @return bool|string
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public function sendSMS($message) {
|
public function sendSMS($message) {
|
||||||
|
|
|
@ -46,7 +46,7 @@ class Smsit extends Core {
|
||||||
* @var int $success
|
* @var int $success
|
||||||
* @var string $error
|
* @var string $error
|
||||||
*
|
*
|
||||||
* @return int or string
|
* @return bool|string
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public function sendSMS($message) {
|
public function sendSMS($message) {
|
||||||
|
|
|
@ -46,7 +46,7 @@ class SolutionsInfini extends Core {
|
||||||
* @var int $success
|
* @var int $success
|
||||||
* @var string $error
|
* @var string $error
|
||||||
*
|
*
|
||||||
* @return int or string
|
* @return bool|string
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public function sendSMS($message) {
|
public function sendSMS($message) {
|
||||||
|
|
|
@ -42,7 +42,7 @@ class Spryng extends Core {
|
||||||
* @var int $success
|
* @var int $success
|
||||||
* @var string $error
|
* @var string $error
|
||||||
*
|
*
|
||||||
* @return int or string
|
* @return bool|string
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public function sendSMS($message) {
|
public function sendSMS($message) {
|
||||||
|
|
|
@ -44,7 +44,7 @@ class Textmarketer extends Core {
|
||||||
* @var int $success
|
* @var int $success
|
||||||
* @var string $error
|
* @var string $error
|
||||||
*
|
*
|
||||||
* @return int or string
|
* @return bool|string
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public function sendSMS($message) {
|
public function sendSMS($message) {
|
||||||
|
|
|
@ -44,7 +44,7 @@ class Twilio extends Core {
|
||||||
* @var int $success
|
* @var int $success
|
||||||
* @var string $error
|
* @var string $error
|
||||||
*
|
*
|
||||||
* @return int or string
|
* @return bool|string
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public function sendSMS($message) {
|
public function sendSMS($message) {
|
||||||
|
|
|
@ -47,7 +47,7 @@ class ArchiveManager {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retention period
|
* Retention period
|
||||||
* @var \DateInterval $retention_period
|
* @var \DateInterval|bool $retention_period false if cleanup is disabled
|
||||||
* @see setRetentionPeriod()
|
* @see setRetentionPeriod()
|
||||||
*/
|
*/
|
||||||
protected $retention_period;
|
protected $retention_period;
|
||||||
|
|
|
@ -153,7 +153,6 @@ class StatusUpdater {
|
||||||
* @return boolean
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
protected function updatePing($max_runs, $run = 1) {
|
protected function updatePing($max_runs, $run = 1) {
|
||||||
$errno = 0;
|
|
||||||
// save response time
|
// save response time
|
||||||
$starttime = microtime(true);
|
$starttime = microtime(true);
|
||||||
// set ping payload
|
// set ping payload
|
||||||
|
|
Loading…
Reference in New Issue