forked from mamchyts/quickbooks
-
Notifications
You must be signed in to change notification settings - Fork 2
/
clients.php
65 lines (57 loc) · 1.3 KB
/
clients.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
53
54
55
56
57
58
59
60
61
62
63
64
65
<?php
/**
* File for integration QB
* QB Webconnector send soap request to this file
*
* @package QB SOAP
*/
/**
* Log function
*
* @param string $mess
*/
function _log($mess = '')
{
$file_name = './log/clients.log';
if(!file_exists(dirname($file_name)))
mkdir(dirname($file_name), 0777);
$f = fopen($file_name, "ab");
fwrite($f, "==============================================\n");
fwrite($f, "[" . date("m/d/Y H:i:s") . "] ".$mess."\n");
fclose($f);
}
/**
* Log function
*
* @param string $mess
*/
function requestId($id = '')
{
$file_name = './log/clients_id.log';
if(!file_exists(dirname($file_name)))
mkdir(dirname($file_name), 0777);
// save id into file
if(trim($id) !== ''){
$f = fopen($file_name, "c+b");
fwrite($f, $id);
fclose($f);
}
$id = trim(file_get_contents($file_name));
return $id;
}
/**
* System variables
*/
define('QB_LOGIN', 'admin');
define('QB_PASSWORD', 'admin');
define('QB_TICKET', '93f91a390fa604207f40e8a94d0d8fd11005de108ec1664234305e17e');
/**
* Main class for SOAP SERVER
*/
require 'qb_clients.php';
/**
* Create SOAP server
*/
$server = new SoapServer("qbwebconnectorsvc.wsdl", array('cache_wsdl' => WSDL_CACHE_NONE));
$server->setClass("Qb_Clients");
$server->handle();