db_info(1); // set + check edit access id $edit_access_id = 3; if ($login->login_check_edit_access($edit_access_id)) $basic->edit_access_id = $edit_access_id; else $basic->edit_access_id = $login->acl['info']['default_edit_access']; // $basic->debug('SESSION', $basic->print_ar($_SESSION)); print "TEST CLASS"; print ""; print '
'; print 'Logout'; print ''; print '
'; // print the debug core vars print "DEBUG OUT: ".$basic->debug_output."
"; print "ECHO OUT: ".$basic->echo_output."
"; print "PRINT OUT: ".$basic->print_output."
"; print "NOT DEBUG OUT: ".$basic->debug_output_not."
"; print "NOT ECHO OUT: ".$basic->echo_output_not."
"; print "NOT PRINT OUT: ".$basic->print_output_not."
"; print "DEBUG OUT ALL: ".$basic->debug_output_all."
"; print "ECHO OUT ALL: ".$basic->echo_output_all."
"; print "PRINT OUT ALL: ".$basic->print_output_all."
"; // file name (logging) print "FILENAME EXT: ".$basic->file_name_ext."
"; print "MAX FILESIZE: ".$basic->max_filesize."
"; print "CALLER BACKTRACE: ".$basic->get_caller_method()."
"; $basic->debug('SOME MARK', 'Some error output'); print "EDIT ACCESS ID: ".$basic->edit_access_id."
"; // print "ACL:
".$basic->print_ar($login->acl)."
"; $basic->debug('ACL', "ACL: ".$basic->print_ar($login->acl)); // print "DEFAULT ACL:
".$basic->print_ar($login->default_acl_list)."
"; // print "DEFAULT ACL:
".$basic->print_ar($login->default_acl_list)."
"; // $result = array_flip(array_filter(array_flip($login->default_acl_list), function ($key) { if (is_numeric($key)) return $key; })); // print "DEFAULT ACL:
".$basic->print_ar($result)."
"; // DEPRICATED CALL // $basic->adbSetACL($login->acl); while ($res = $basic->db_return("SELECT * FROM max_test")) { print "TIME: ".$res['time']."
"; } $status = $basic->db_exec("INSERT INTO foo (test) VALUES ('FOO TEST ".time()."') RETURNING test"); print "DIRECT INSERT STATUS: $status | PRIMARY KEY: ".$basic->insert_id."
"; print "DIRECT INSERT PREVIOUS INSERTED: ".print_r($basic->db_return_row("SELECT foo_id, test FROM foo WHERE foo_id = ".$basic->insert_id), 1)."
"; $basic->db_prepare("ins_foo", "INSERT INTO foo (test) VALUES ($1)"); $status = $basic->db_execute("ins_foo", array('BAR TEST '.time())); print "PREPARE INSERT STATUS: $status | PRIMARY KEY: ".$basic->insert_id."
"; print "PREPARE INSERT PREVIOUS INSERTED: ".print_r($basic->db_return_row("SELECT foo_id, test FROM foo WHERE foo_id = ".$basic->insert_id), 1)."
"; # async test queries /* $basic->db_exec_async("SELECT test FROM foo, (SELECT pg_sleep(10)) as sub WHERE foo_id IN (27, 50, 67, 44, 10)"); echo "WAITING FOR ASYNC: "; $chars = array('|', '/', '-', '\\'); while (($ret = $basic->db_check_async()) === true) { if ((list($_, $char) = each($chars)) === FALSE) { reset($chars); list($_, $char) = each($chars); } print $char; sleep(1); flush(); } print "
END STATUS: ".$ret."
"; // while ($res = $basic->db_fetch_array($ret)) while ($res = $basic->db_fetch_array()) { echo "RES: ".$res['test']."
"; } # test async insert $basic->db_exec_async("INSERT INTO foo (Test) VALUES ('ASYNC TEST ".time()."')"); echo "WAITING FOR ASYNC INSERT: "; while (($ret = $basic->db_check_async()) === true) { print "."; sleep(1); flush(); } print "
END STATUS: ".$ret." | PK: ".$basic->insert_id."
"; print "ASYNC PREVIOUS INSERTED: ".print_r($basic->db_return_row("SELECT foo_id, test FROM foo WHERE foo_id = ".$basic->insert_id), 1)."
"; */ $to_db_version = '9.1.9'; print "VERSION DB: ".$basic->db_version()."
"; print "DB Version smaller $to_db_version: ".$basic->db_compare_version('<'.$to_db_version)."
"; print "DB Version smaller than $to_db_version: ".$basic->db_compare_version('<='.$to_db_version)."
"; print "DB Version equal $to_db_version: ".$basic->db_compare_version('='.$to_db_version)."
"; print "DB Version bigger than $to_db_version: ".$basic->db_compare_version('>='.$to_db_version)."
"; print "DB Version bigger $to_db_version: ".$basic->db_compare_version('>'.$to_db_version)."
"; $q = "SELECT FOO FRO BAR"; // $q = "Select * from foo"; $foo = $basic->db_exec_async($q); print "[ERR] Query: ".$q."
"; print "[ERR] RESOURCE: $foo
"; while (($ret = $basic->db_check_async()) === true) { print "[ERR]: $ret
"; // sleep(5); } // search path check $q = "SHOW search_path"; $cursor = $basic->db_exec($q); $data = $basic->db_fetch_array($cursor)['search_path']; print "RETURN DATA FOR search_path: ".$data."
"; // print "RETURN DATA FOR search_path: ".$basic->print_ar($data)."
"; // insert something into test.schema_test and see if we get the PK back $status = $basic->db_exec("INSERT INTO test.schema_test (contents, id) VALUES ('TIME: ".time()."', ".rand(1, 10).")"); print "OTHER SCHEMA INSERT STATUS: ".$status." | PK NAME: ".$basic->pk_name.", PRIMARY KEY: ".$basic->insert_id."
"; // time string thest $timestamp = 5887998.33445; $time_string = $basic->TimeStringFormat($timestamp); print "TIME STRING TEST: ".$time_string."
"; print "REVERSE TIME STRING: ".$basic->StringToTime($time_string); // magic links test print $basic->magic_links('user@bubu.at').'
'; print $basic->magic_links('http://test.com/foo/bar.php?foo=1').'
'; // print error messages print $basic->print_error_msg(); print ""; ?>