minor fixes + minor code reformatting
This commit is contained in:
parent
d0f967b90a
commit
1b89448983
5 changed files with 16 additions and 19 deletions
|
@ -34,9 +34,11 @@ if (!function_exists('pg_connect')) {
|
|||
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)) {
|
||||
echo $dbc->getMessage()."\n";
|
||||
echo $dbc->getUserInfo()."\n";
|
||||
echo "Database connection problem.\n";
|
||||
echo "Check if database '{$config['dsn']['database']}' exists".
|
||||
" with corresponding permissions.\n";
|
||||
|
@ -73,15 +75,6 @@ if ($log) {
|
|||
echo "# testlog:\n{$log}";
|
||||
}
|
||||
|
||||
#echo "# Reinstall + testdata insert ...\n";
|
||||
#$gb->reinstall();
|
||||
#$gb->sessid = $gb->login('root', $gb->config['tmpRootPass']);
|
||||
#$gb->testData();
|
||||
#$gb->logout($gb->sessid); unset($gb->sessid);
|
||||
|
||||
#echo "# TREE DUMP:\n";
|
||||
#echo $gb->dumpTree();
|
||||
|
||||
echo "# Delete test data ...\n";
|
||||
$gb->deleteData();
|
||||
|
||||
|
|
|
@ -60,8 +60,11 @@ if(PHP5){
|
|||
|
||||
|
||||
/* ============================================================= runable code */
|
||||
PEAR::setErrorHandling(PEAR_ERROR_RETURN);
|
||||
$dbc = DB::connect($config['dsn'], TRUE);
|
||||
$r = $dbc =& DB::connect($config['dsn'], TRUE);
|
||||
if (PEAR::isError($r)) {
|
||||
trigger_error("DB::connect: ".$r->getMessage()." ".$r->getUserInfo(),E_USER_ERROR);
|
||||
}
|
||||
$dbc->setErrorHandling(PEAR_ERROR_RETURN);
|
||||
$dbc->setFetchMode(DB_FETCHMODE_ASSOC);
|
||||
|
||||
$archive = new XR_Archive($dbc, $config);
|
||||
|
|
|
@ -63,7 +63,7 @@ $infos = array(
|
|||
|
||||
"deleteAudioClip" =>
|
||||
array('m'=>"archive.deleteAudioClip",
|
||||
'p'=>array('sessid', 'gunid'), 'r'=>'status'),
|
||||
'p'=>array('sessid', 'gunid','forced'), 'r'=>'status'),
|
||||
"existsAudioClip" => array('m'=>"archive.existsAudioClip",
|
||||
'p'=>array('sessid', 'gunid'), 'r'=>'exists'),
|
||||
"getAudioClip" => array('m'=>"archive.getAudioClip",
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue