<?php |
<?php |
|
|
// http://gold.gov.au/reports/department/index.xml |
// http://gold.gov.au/reports/department/index.xml |
require_once '../include/common.inc.php'; |
require_once '../include/common.inc.php'; |
try { |
$db = $server->get_db('disclosr-agencies'); |
$server->create_db('disclosr-agencies'); |
$rows = $db->get_view("app", "byName")->rows; |
} catch (SetteeRestClientException $e) { |
$nametoid = Array(); |
setteErrorHandler($e); |
$sums = Array(); |
|
foreach ($rows as $row) { |
|
$nametoid[trim($row->key)] = $row->value; |
} |
} |
$db = $server->get_db('disclosr-agencies'); |
|
createAgencyDesignDoc(); |
|
|
|
|
if (file_exists('index.xml')) { |
|
$xml = simplexml_load_file('index.xml'); |
|
|
|
foreach ($xml as $agency) { |
|
$names = Array(); |
|
$names[] = "".$agency->name; |
|
|
|
if (isset($agency->shortName)) { |
|
$names[] = "".$agency->shortName; |
|
} |
|
foreach ($names as $name) { |
|
if (!in_array($name, array_keys($nametoid))) { |
|
echo "$name missing".PHP_EOL; |
|
print_r($names); |
|
echo $agency->dn; |
|
echo PHP_EOL; |
|
echo PHP_EOL; |
|
} |
|
} |
|
} |
|
} else { |
|
exit('Failed to open test.xml.'); |
|
} |
?> |
?> |
|
|