Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Guilherme Filippo
ISPConfig 3
Commits
2e575370
Commit
2e575370
authored
Feb 18, 2010
by
moglia
Browse files
Initial Commit of soap database add example.
parent
9bc372a4
Changes
1
Hide whitespace changes
Inline
Side-by-side
remoting_client/examples/soap-database-add.php
0 → 100644
View file @
2e575370
<?php
$username
=
'admin'
;
$password
=
'admin'
;
$soap_location
=
'http://localhost:8080/remote/index.php'
;
$soap_uri
=
'http://localhost:8080/remote/'
;
$client
=
new
SoapClient
(
null
,
array
(
'location'
=>
$soap_location
,
'uri'
=>
$soap_uri
));
try
{
if
(
$session_id
=
$client
->
login
(
$username
,
$password
))
{
echo
"Logged:"
.
$session_id
.
"<br />
\n
"
;
}
$database_type
=
'mysql'
;
//Only mysql type avaliable more types coming soon.
$database_name
=
'yourdbname'
;
$database_username
=
'yourusername'
;
$database_password
=
'yourpassword'
;
$database_charset
=
''
;
// blank = db default, latin1 or utf8
$database_remoteips
=
''
;
//remote ip´s separated by commas
$params
=
array
(
'server_id'
=>
1
,
'type'
=>
$database_type
,
'database_name'
=>
$database_name
,
'database_user'
=>
$database_username
,
'database_password'
=>
$database_password
,
'database_charset'
=>
$database_charset
,
'remote_access'
=>
'n'
,
// n disabled - y enabled
'active'
=>
'y'
,
// n disabled - y enabled
'remote_ips'
=>
$database_remoteips
);
$client_id
=
1
;
$database_id
=
$client
->
sites_database_add
(
$session_id
,
$client_id
,
$params
);
if
(
$client
->
logout
(
$session_id
))
{
echo
"Logout.<br />
\n
"
;
}
}
catch
(
SoapFault
$e
)
{
die
(
'Error: '
.
$e
->
getMessage
());
}
?>
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment