-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathClient.php
52 lines (46 loc) · 1.12 KB
/
Client.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<?php namespace MobilyAPI;
/**
* @package MobilyAPI
*/
class Client{
/**
* The client setup
* @var array
*/
public $setup = [
'username' => null,
'password' => null,
'senderName' => null,
'appUrl' => null,
'request_time_out' => 5,
'verify_ssl_certificate' => false,
'debug' => false
];
/**
* The API base uri
*/
const API_BASE_URI = 'https://mobily.ws/api/json/';
/**
* @param $username
* @param $password
* @param $senderName
* @param array $setup
*/
public function __construct($username, $password, $senderName, $setup = []){
// The client setup
$this->setup = array_merge($this->setup, $setup);
$this->setup['username'] = $username;
$this->setup['password'] = $password;
$this->setup['senderName'] = $senderName;
if(!$this->setup['appUrl']){
$this->setup['appUrl'] = $_SERVER['SERVER_NAME'];
}
}
/**
* Change the sender name
* @param $name
*/
public function changeSender($name){
$this->setup['senderName'] = $name;
}
}