forked from Homegear/Homegear_PHP_XMLRPC_Client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathConnect.php
35 lines (29 loc) · 960 Bytes
/
Connect.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
<?php
/****************************************************/
/****************************************************/
/***** Modify this file according to your needs *****/
/****************************************************/
/****************************************************/
$clientPath = (PHP_OS == "WINNT") ? "HM-XMLRPC-Client\\" : "HM-XMLRPC-Client/";
require_once($clientPath."Client.php");
//No SSL (recommended for "localhost")
$host = "localhost";
$port = 2001;
$ssl = false;
$Client = new \XMLRPC\Client($host, $port, $ssl);
//SSL
/*
$host = "homegear";
$port = 2003;
$ssl = true;
$username = "homegear";
$password = "homegear";
$Client = new \XMLRPC\Client($host, $port, $ssl);
$Client->setSSLVerifyPeer(false);
//!!! You should create a signed certificate and then enable "verify peer" !!!
//$Client->setSSLVerifyPeer(true);
//$Client->setCAFile("/path/to/ca.crt");
$Client->setUsername($username);
$Client->setPassword($password);
*/
?>