-
Notifications
You must be signed in to change notification settings - Fork 2
/
dds_schema_test.php
58 lines (49 loc) · 1.63 KB
/
dds_schema_test.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
<?php
/**
* Test DDS Schema creation
*
* @author Aaron Harris <[email protected]>
* @copyright 2000-2014 Intacct Corporation
*
* This document contains trade secret data that belongs to Intacct
* Corporation and is protected by the copyright laws. Information
* herein may not be used, copied or disclosed in whole or in part
* without prior written consent from Intacct Corporation.
*/
// simple test to see if we can create a database
require_once 'intacctws-php/api_session.php';
require_once 'intacctws-php/api_post.php';
require_once 'DdsLoader/DdsDbManager.php';
require_once 'DdsLoader/DdsController.php';
require_once 'DdsLoader/DBs/DdsDbRedshift.php';
try {
$memcache = new Memcache();
$memcache->connect("localhost", 11211);
$key = 'dds_loader_test_session';
$session = $memcache->get($key);
if ($session === false) {
$session = new api_session();
$session->connectCredentials(
$_SERVER['IntacctCompanyId'],
$_SERVER['IntacctUserId'],
$_SERVER['IntacctPwd'],
$_SERVER['SenderId'],
$_SERVER['SenderPwd']
);
$memcache->set($key, $session, null, 300);
}
$intacctPg = new DdsDbRedshift(
$_SERVER['RedShiftURL'],
$_SERVER['RedShiftDB'],
$_SERVER['RedShiftUser'],
$_SERVER['RedShiftPwd']
);
//DdsDbManager::rebuildSchema($intacctPg, $session);
DdsController::runDdsJob('ardetail', api_post::DDS_JOBTYPE_ALL, $session);
echo "done!";
}
catch (Exception $ex) {
print_r($ex->getMessage());
print_r(api_post::getLastRequest());
print_r(api_post::getLastResponse());
}