minor fixes + minor code reformatting

This commit is contained in:
tomash 2006-11-16 00:26:50 +00:00
parent d0f967b90a
commit 1b89448983
5 changed files with 16 additions and 19 deletions

View file

@ -152,7 +152,7 @@ class MetaData {
function exists()
{
if (is_null($this->exists)) {
$this->exists = $this->dbCheck($gunid) &&
$this->exists = $this->dbCheck($this->gunid) &&
is_file($this->fname) &&
is_readable($this->fname);
}

View file

@ -6,7 +6,7 @@
// no remote execution
$arr = array_diff_assoc($_SERVER, $_ENV);
if(isset($arr["DOCUMENT_ROOT"]) && $arr["DOCUMENT_ROOT"] != ""){
if (isset($arr["DOCUMENT_ROOT"]) && $arr["DOCUMENT_ROOT"] != "") {
header("HTTP/1.1 400");
header("Content-type: text/plain; charset=UTF-8");
echo "400 Not executable\r\n";
@ -21,7 +21,9 @@ require_once "../Prefs.php";
function errCallback($err)
{
if(assert_options(ASSERT_ACTIVE)==1) return;
if (assert_options(ASSERT_ACTIVE) == 1) {
return;
}
echo "ERROR:\n";
echo "request: "; print_r($_REQUEST);
echo "gm:\n".$err->getMessage()."\ndi:\n".$err->getDebugInfo().
@ -29,15 +31,14 @@ function errCallback($err)
exit(1);
}
if(!function_exists('pg_connect')){
if (!function_exists('pg_connect')) {
trigger_error("PostgreSQL PHP extension required and not found.", E_USER_ERROR);
exit(2);
}
#PEAR::setErrorHandling(PEAR_ERROR_PRINT, "%s<hr>\n");
PEAR::setErrorHandling(PEAR_ERROR_RETURN);
$dbc = DB::connect($config['dsn'], TRUE);
if(PEAR::isError($dbc)){
if (PEAR::isError($dbc)) {
echo $dbc->getMessage()."\n";
echo $dbc->getUserInfo()."\n";
echo "Database connection problem.\n";