From: Maxious Date: Sat, 22 Sep 2012 13:34:15 +0000 Subject: amon amon everybody X-Git-Url: https://maxious.lambdacomplex.org/git/?p=disclosr.git&a=commitdiff&h=dba8c5480c94fdcb0b9b723482ed8ce7c3567842 --- amon amon everybody Former-commit-id: 849bb37a7a41983224d0913e46a3eacf2ed0659f --- --- a/.gitmodules +++ b/.gitmodules @@ -25,4 +25,7 @@ [submodule "lib/querypath"] path = lib/querypath url = https://github.com/technosophos/querypath.git +[submodule "lib/amon-php"] + path = lib/amon-php + url = https://github.com/martinrusev/amon-php.git --- a/about.php +++ b/about.php @@ -10,8 +10,10 @@ Disclo.gs is a project to monitor Australian Federal Government agencies compliance with their "proactive disclosure requirements" to make a transparency league table as suggested by gov2 taskforce http://gov2.net.au/blog/2009/09/19/a-league-ladder-of-psi-openness/.

Attributions

-National Archives of Australia, Australian Governments’ Interactive Functions Thesaurus, 2nd edition, September 2005, published at http://www.naa.gov.au/recordkeeping/thesaurus/index.htm. - +National Archives of Australia, Australian Governments’ Interactive Functions Thesaurus, 2nd edition, September 2005, published at http://www.naa.gov.au/recordkeeping/thesaurus/index.htm
+data.gov.au http://data.gov.au/dataset/directory-gov-au-full-data-export/
+directory.gov.au
+australia.gov.au http://australia.gov.au/about/copyright

Open everything

All documents released CC-BY 3 AU Open source git @ --- a/alaveteli/exportAgencies.csv.php +++ b/alaveteli/exportAgencies.csv.php @@ -1,20 +1,6 @@ id; $row["name"] = trim($agency->value->name); - if (isset($agency->value->foiEmail)) { - $row["request_email"] = $agency->value->foiEmail; - } else { - if ($agency->value->orgType == "FMA-DepartmentOfState") { - $row["request_email"] = "foi@" . GetDomain($agency->value->website); - } else { - $row["request_email"] = $foiEmail[$agency->value->parentOrg]; - } + $row["request_email"] = (isset($agency->value->foiEmail) ? $agency->value->foiEmail : ""); + $row["short_name"] = (isset($agency->value->shortName) ? $agency->value->shortName : ""); + $row["notes"] = (isset($agency->value->description) ? $agency->value->description : ""); + + $otherBodies = Array(); + if (isset($agency->value->foiBodies)) { + $otherBodies = array_merge($otherBodies, $agency->value->foiBodies); } - if (isset($agency->value->shortName)) { - $row["short_name"] = $agency->value->shortName; - } else { - $row["short_name"] = shortName($agency->value->name); + if (isset($agency->value->positions)) { + $otherBodies = array_merge($otherBodies, $agency->value->positions); } - $row["notes"] = ""; + if (count($otherBodies) > 0) { + $row["notes"] .= "
This department also responds to requests for information held by ".implode(",",$otherBodies); + } + $row["publication_scheme"] = (isset($agency->value->infoPublicationSchemeURL) ? $agency->value->infoPublicationSchemeURL : ""); $row["home_page"] = (isset($agency->value->website) ? $agency->value->website : ""); if ($agency->value->orgType == "FMA-DepartmentOfState") { - $row["tag_string"] = $tag[$agency->value->_id] . " " . $agency->value->orgType; + $row["tag_string"] = $tag[$agency->value->_id]; } else { - $row["tag_string"] = $tag[$agency->value->parentOrg] . " " . $agency->value->orgType; + $row["tag_string"] = $tag[$agency->value->parentOrg]; } - + $row["tag_string"] .= " " . $agency->value->orgType; + $row["tag_string"] .= " federal"; fputcsv($fp, array_values($row)); - if (isset($agency->value->foiBodies)) { - foreach ($agency->value->foiBodies as $foiBody) { - $row['name'] = iconv("UTF-8", "ASCII//TRANSLIT",$foiBody); - $row["short_name"] = shortName($foiBody); - fputcsv($fp, array_values($row)); - } - } + + } } } catch (SetteeRestClientException $e) { --- a/include/common.inc.php +++ b/include/common.inc.php @@ -14,6 +14,11 @@ require_once $basePath.'lib/Requests/library/Requests.php'; Requests::register_autoloader(); +require $basePath."lib/amon-php/amon.php"; +Amon::config(array('address'=> 'http://127.0.0.1:2464', + 'protocol' => 'http', + 'secret_key' => "I2LJ6dOMmlnXgVAkTPFXd5M3ejkga8Gd2FbBt6iqZdw")); +Amon::setup_exception_handler(); # Convert a stdClass to an Array. http://www.php.net/manual/en/language.types.object.php#102735 function object_to_array(stdClass $Class) { --- a/include/couchdb.inc.php +++ b/include/couchdb.inc.php @@ -168,6 +168,7 @@ $server = new SetteeServer($serverAddr); function setteErrorHandler($e) { + Amon::log($e->getMessage() . " " . print_r($_SERVER,true), array('error')); echo $e->getMessage() . "
" . PHP_EOL; } --- /dev/null +++ b/js/bubbletree --- /dev/null +++ b/js/flotr2 --- /dev/null +++ b/js/sigma --- /dev/null +++ b/lib/amon-php