/adei/ui

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

« back to all changes in this revision

Viewing changes to services/database.php

  • Committer: Suren A. Chilingaryan
  • Date: 2008-04-02 10:23:22 UTC
  • Revision ID: csa@dside.dyndns.org-20080402102322-okib92sicg2dx3o3
Initial import

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
 
 
9
try {
 
10
    $req = new SERVERRequest($_GET);
 
11
 
 
12
    $reader = $req->CreateReader();
 
13
    $dblist = $reader->GetDatabaseList();
 
14
    unset($reader);
 
15
    
 
16
    if (!count($dblist)) $error = translate("No database is found");
 
17
} catch (ADEIException $ex) {
 
18
    $error = xml_escape($ex->getMessage());
 
19
}
 
20
 
 
21
 
 
22
echo "<?xml version=\"1.0\"?>\n";
 
23
if ($error) echo "<result><Error>$error</Error></result>";
 
24
else {
 
25
    echo "<result>";
 
26
    foreach ($dblist as $db => $val) {
 
27
        echo "<Value name=\"" . $val['name'] . "\" value=\"$db\"/>";
 
28
    }
 
29
    echo "</result>";
 
30
}
 
31
 
 
32
?>
 
 
b'\\ No newline at end of file'