commit | author | age
|
413d3b
|
1 |
<?php |
T |
2 |
|
7fe908
|
3 |
require 'soap_config.php'; |
413d3b
|
4 |
|
T |
5 |
|
|
6 |
$client = new SoapClient(null, array('location' => $soap_location, |
7fe908
|
7 |
'uri' => $soap_uri, |
MC |
8 |
'trace' => 1, |
|
9 |
'exceptions' => 1)); |
413d3b
|
10 |
|
T |
11 |
|
|
12 |
try { |
7fe908
|
13 |
if($session_id = $client->login($username, $password)) { |
413d3b
|
14 |
echo 'Logged successfull. Session ID:'.$session_id.'<br />'; |
T |
15 |
} |
7fe908
|
16 |
|
413d3b
|
17 |
//* Set the function parameters. |
T |
18 |
$client_id = 1; |
|
19 |
$params = array( |
7fe908
|
20 |
'server_id' => 1, |
MC |
21 |
'type' => 'mysql', |
39113e
|
22 |
'website_id' => 1, |
7fe908
|
23 |
'database_name' => 'db_name2', |
MC |
24 |
'database_user_id' => '1', |
|
25 |
'database_ro_user_id' => '0', |
|
26 |
'database_charset' => 'UTF8', |
|
27 |
'remote_access' => 'y', |
|
28 |
'remote_ips' => '', |
|
29 |
'backup_interval' => 'none', |
|
30 |
'backup_copies' => 1, |
|
31 |
'active' => 'y' |
|
32 |
); |
|
33 |
|
413d3b
|
34 |
$database_id = $client->sites_database_add($session_id, $client_id, $params); |
T |
35 |
|
|
36 |
echo "Database ID: ".$database_id."<br>"; |
7fe908
|
37 |
|
413d3b
|
38 |
if($client->logout($session_id)) { |
T |
39 |
echo 'Logged out.<br />'; |
|
40 |
} |
7fe908
|
41 |
|
MC |
42 |
|
413d3b
|
43 |
} catch (SoapFault $e) { |
T |
44 |
echo $client->__getLastResponse(); |
|
45 |
die('SOAP Error: '.$e->getMessage()); |
|
46 |
} |
|
47 |
|
|
48 |
?> |