remove unused page_widgets.php include and provide a general function for loading sql from file to use in the cdav migration

This commit is contained in:
zotlabs
2017-06-22 22:43:08 -07:00
parent 02b7bc0803
commit 6c771f84ce
5 changed files with 14 additions and 64 deletions

View File

@@ -442,6 +442,20 @@ function db_getfunc($f) {
return $f;
}
function db_load_file($f) {
// db errors should get logged to the logfile
$str = @file_get_contents($f);
$arr = explode(';', $str);
if($arr) {
foreach($arr as $a) {
if(strlen(trim($a))) {
$r = dbq(trim($a));
}
}
}
}
// The logger function may make DB calls internally to query the system logging parameters.
// This can cause a recursion if database debugging is enabled.
// So this function preserves the current database debugging state and then turns it off