From 18784a484b04b5f74e6d4dca516b2dc20cffe953 Mon Sep 17 00:00:00 2001 From: Michael Date: Thu, 12 Oct 2017 16:10:42 +0000 Subject: [PATCH] Additional work for PR 3778 --- dav/friendica/database-init.inc.php | 15 +++++++++------ pumpio/pumpio_sync.php | 2 +- twitter/twitter_sync.php | 2 +- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/dav/friendica/database-init.inc.php b/dav/friendica/database-init.inc.php index f91ddb25..e172b44d 100644 --- a/dav/friendica/database-init.inc.php +++ b/dav/friendica/database-init.inc.php @@ -242,10 +242,11 @@ function dav_create_tables() $stms = dav_get_create_statements(); $errors = array(); - global $db; foreach ($stms as $st) { // @TODO Friendica-dependent - $db->q($st); - if ($db->error) $errors[] = $db->error; + dba::e($st); + if (dba::errorMessage()) { + $errors[] = dba::errorMessage(); + } } return $errors; @@ -261,10 +262,12 @@ function dav_upgrade_tables() $stms = dav_get_update_statements($ver); $errors = array(); - global $db; + foreach ($stms as $st) { // @TODO Friendica-dependent - $db->q($st); - if ($db->error) $errors[] = $db->error; + dba::e($st); + if (dba::errorMessage()) { + $errors[] = dba::errorMessage(); + } } return $errors; diff --git a/pumpio/pumpio_sync.php b/pumpio/pumpio_sync.php index a23eb4b0..834bc1e6 100644 --- a/pumpio/pumpio_sync.php +++ b/pumpio/pumpio_sync.php @@ -2,7 +2,7 @@ use Friendica\Core\Config; function pumpio_sync_run(&$argv, &$argc) { - global $a, $db; + global $a; require_once("addon/pumpio/pumpio.php"); diff --git a/twitter/twitter_sync.php b/twitter/twitter_sync.php index ed9f3f85..5d6e8b2f 100644 --- a/twitter/twitter_sync.php +++ b/twitter/twitter_sync.php @@ -2,7 +2,7 @@ use Friendica\Core\Config; function twitter_sync_run($argv, $argc) { - global $a, $db; + global $a; require_once("addon/twitter/twitter.php");