/adei/trunk

To get this branch, use:
bzr branch http://darksoft.org/webbzr/adei/trunk

« back to all changes in this revision

Viewing changes to docs/samples/cgroups.php

  • Committer: Suren A. Chilingaryan
  • Date: 2014-10-17 14:09:35 UTC
  • Revision ID: csa@suren.me-20141017140935-aous739tn3noirae
Added samples of PHP API to documentation

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?php
 
2
require("../adei.php");
 
3
 
 
4
header("Content-type: text/xml");
 
5
header("Cache-Control: no-cache, must-revalidate");
 
6
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
 
7
 
 
8
$_GET['db_server'] = "test_zeus";
 
9
$_GET['db_name'] = "zeus";
 
10
 
 
11
try {
 
12
    $req = new SOURCERequest($_GET);
 
13
 
 
14
    $reader = $req->CreateReader();
 
15
    $list = $reader->GetGroupList(REQUEST::CONTROL);
 
16
    unset($reader);
 
17
 
 
18
    if (!count($list)) $error = translate("No LogGroups is found");
 
19
} catch (ADEIException $ex) {
 
20
    $error = xml_escape($ex->getMessage());
 
21
}
 
22
 
 
23
echo "<?xml version=\"1.0\"?>\n";
 
24
if ($error) echo "<result><Error>$error</Error></result>";
 
25
else {
 
26
    echo "<result>";
 
27
    foreach ($list as $value=>$db) {
 
28
        echo "<Value name=\"" . xml_escape($db['name']) . "\" value=\"" . $value . "\"/>";
 
29
    }
 
30
    echo "</result>";
 
31
}
 
32
 
 
33
?>
 
 
b'\\ No newline at end of file'