From: Hypolite Petovan Date: Fri, 20 Jul 2018 02:15:21 +0000 (-0400) Subject: Update use statement lists with new Friendica\Database\dba class X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=daa1177e3a1e42b4c95e0a8759f1610942b952c7;p=friendica.git Update use statement lists with new Friendica\Database\dba class - Remove unused use statement - Remove superfluous use statements (classes in the same namespace) - Add missing use statements --- diff --git a/bin/daemon.php b/bin/daemon.php index 65ae2a53b6..6ab2f76102 100755 --- a/bin/daemon.php +++ b/bin/daemon.php @@ -10,6 +10,7 @@ use Friendica\App; use Friendica\Core\Config; use Friendica\Core\Worker; +use Friendica\Database\dba; // Ensure that daemon.php is executed from the base path of the installation if (!file_exists("boot.php") && (sizeof($_SERVER["argv"]) != 0)) { diff --git a/include/api.php b/include/api.php index b67c5a5650..a6196852bf 100644 --- a/include/api.php +++ b/include/api.php @@ -19,6 +19,7 @@ use Friendica\Core\PConfig; use Friendica\Core\Protocol; use Friendica\Core\System; use Friendica\Core\Worker; +use Friendica\Database\dba; use Friendica\Database\DBM; use Friendica\Model\Contact; use Friendica\Model\Group; diff --git a/include/conversation.php b/include/conversation.php index 54716cd687..9b37e32687 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -12,10 +12,12 @@ use Friendica\Core\Config; use Friendica\Core\L10n; use Friendica\Core\PConfig; use Friendica\Core\System; +use Friendica\Database\dba; use Friendica\Database\DBM; use Friendica\Model\Contact; -use Friendica\Model\Profile; use Friendica\Model\Item; +use Friendica\Model\Profile; +use Friendica\Model\Term; use Friendica\Object\Post; use Friendica\Object\Thread; use Friendica\Util\DateTimeFormat; @@ -578,7 +580,7 @@ function conversation(App $a, array $items, $mode, $update, $preview = false, $o $profile_name = $item['author-link']; } - $tags = \Friendica\Model\Term::populateTagsFromItem($item); + $tags = Term::populateTagsFromItem($item); $author = ['uid' => 0, 'id' => $item['author-id'], 'network' => $item['author-network'], 'url' => $item['author-link']]; diff --git a/include/enotify.php b/include/enotify.php index 2d4cbdadb5..30ebe5d1ac 100644 --- a/include/enotify.php +++ b/include/enotify.php @@ -8,10 +8,11 @@ use Friendica\Core\Addon; use Friendica\Core\Config; use Friendica\Core\L10n; use Friendica\Core\System; +use Friendica\Database\dba; use Friendica\Database\DBM; +use Friendica\Model\Item; use Friendica\Util\DateTimeFormat; use Friendica\Util\Emailer; -use Friendica\Model\Item; /** * @brief Creates a notification entry and possibly sends a mail @@ -679,7 +680,7 @@ function check_user_notification($itemid) { * * @param int $itemid ID of the item for which the check should be done * @param int $uid User ID - * @param str $defaulttype (Optional) Forces a notification with this type. + * @param string $defaulttype (Optional) Forces a notification with this type. */ function check_item_notification($itemid, $uid, $defaulttype = "") { $notification_data = ["uid" => $uid, "profiles" => []]; diff --git a/include/items.php b/include/items.php index e06df925e3..14a74c8e51 100644 --- a/include/items.php +++ b/include/items.php @@ -9,6 +9,7 @@ use Friendica\Core\Config; use Friendica\Core\L10n; use Friendica\Core\PConfig; use Friendica\Core\System; +use Friendica\Database\dba; use Friendica\Database\DBM; use Friendica\Model\Item; use Friendica\Protocol\DFRN; diff --git a/include/security.php b/include/security.php index 768d7c82d4..64f32bd55e 100644 --- a/include/security.php +++ b/include/security.php @@ -8,6 +8,7 @@ use Friendica\Core\Config; use Friendica\Core\L10n; use Friendica\Core\PConfig; use Friendica\Core\System; +use Friendica\Database\dba; use Friendica\Database\DBM; use Friendica\Model\Group; use Friendica\Util\DateTimeFormat; diff --git a/index.php b/index.php index a8098942c2..8cdef23ccb 100644 --- a/index.php +++ b/index.php @@ -17,6 +17,7 @@ use Friendica\Core\Session; use Friendica\Core\System; use Friendica\Core\Theme; use Friendica\Core\Worker; +use Friendica\Database\dba; use Friendica\Database\DBM; use Friendica\Model\Profile; use Friendica\Module\Login; diff --git a/mod/acl.php b/mod/acl.php index dd5dd90281..32b86d90bb 100644 --- a/mod/acl.php +++ b/mod/acl.php @@ -6,6 +6,7 @@ use Friendica\App; use Friendica\Content\Widget; use Friendica\Core\ACL; use Friendica\Core\Addon; +use Friendica\Database\dba; use Friendica\Database\DBM; use Friendica\Model\Contact; use Friendica\Model\Item; diff --git a/mod/admin.php b/mod/admin.php index 9fa54bc137..9a289dda5a 100644 --- a/mod/admin.php +++ b/mod/admin.php @@ -14,6 +14,7 @@ use Friendica\Core\L10n; use Friendica\Core\System; use Friendica\Core\Theme; use Friendica\Core\Worker; +use Friendica\Database\dba; use Friendica\Database\DBM; use Friendica\Database\DBStructure; use Friendica\Model\Contact; @@ -782,7 +783,7 @@ function admin_page_workerqueue(App $a) // get jobs from the workerqueue table $statement = dba::select('workerqueue', ['id', 'parameter', 'created', 'priority'], ['done' => 0], ['order'=> ['priority']]); $r = dba::inArray($statement); - + for($i = 0; $i < count($r); $i++) { $r[$i]['parameter'] = stripslashes(implode(': ', explode('","', $r[$i]['parameter']))); $r[$i]['parameter'] = substr($r[$i]['parameter'], 2, -2); diff --git a/mod/allfriends.php b/mod/allfriends.php index d85d3ec9b3..e9d964847c 100644 --- a/mod/allfriends.php +++ b/mod/allfriends.php @@ -2,10 +2,12 @@ /** * @file mod/allfriends.php */ + use Friendica\App; use Friendica\Content\ContactSelector; use Friendica\Core\L10n; use Friendica\Core\System; +use Friendica\Database\dba; use Friendica\Database\DBM; use Friendica\Model\Contact; use Friendica\Model\GContact; diff --git a/mod/attach.php b/mod/attach.php index fd428286a6..0b88fe28fc 100644 --- a/mod/attach.php +++ b/mod/attach.php @@ -2,8 +2,10 @@ /** * @file mod/attach.php */ + use Friendica\App; use Friendica\Core\L10n; +use Friendica\Database\dba; use Friendica\Database\DBM; require_once 'include/dba.php'; diff --git a/mod/cal.php b/mod/cal.php index bf73408f42..246d8a6447 100644 --- a/mod/cal.php +++ b/mod/cal.php @@ -13,6 +13,7 @@ use Friendica\Content\Widget; use Friendica\Core\Config; use Friendica\Core\L10n; use Friendica\Core\System; +use Friendica\Database\dba; use Friendica\Database\DBM; use Friendica\Model\Contact; use Friendica\Model\Event; diff --git a/mod/common.php b/mod/common.php index f45bbb0175..f6f826789b 100644 --- a/mod/common.php +++ b/mod/common.php @@ -2,9 +2,11 @@ /** * @file include/common.php */ + use Friendica\App; use Friendica\Content\ContactSelector; use Friendica\Core\L10n; +use Friendica\Database\dba; use Friendica\Database\DBM; use Friendica\Model\Contact; use Friendica\Model\GContact; diff --git a/mod/community.php b/mod/community.php index 1e6162fb8e..97ecf00831 100644 --- a/mod/community.php +++ b/mod/community.php @@ -9,6 +9,7 @@ use Friendica\Core\ACL; use Friendica\Core\Config; use Friendica\Core\L10n; use Friendica\Core\PConfig; +use Friendica\Database\dba; use Friendica\Database\DBM; function community_init(App $a) diff --git a/mod/contacts.php b/mod/contacts.php index a4caafe8f9..736d16dfb9 100644 --- a/mod/contacts.php +++ b/mod/contacts.php @@ -12,6 +12,7 @@ use Friendica\Core\Addon; use Friendica\Core\L10n; use Friendica\Core\System; use Friendica\Core\Worker; +use Friendica\Database\dba; use Friendica\Database\DBM; use Friendica\Model\Contact; use Friendica\Model\GContact; diff --git a/mod/crepair.php b/mod/crepair.php index 29b00b4e3a..e23e082240 100644 --- a/mod/crepair.php +++ b/mod/crepair.php @@ -2,9 +2,11 @@ /** * @file mod/crepair.php */ + use Friendica\App; use Friendica\Core\Config; use Friendica\Core\L10n; +use Friendica\Database\dba; use Friendica\Database\DBM; use Friendica\Model\Contact; use Friendica\Model\Profile; diff --git a/mod/delegate.php b/mod/delegate.php index 510fc0ec8f..60cf130464 100644 --- a/mod/delegate.php +++ b/mod/delegate.php @@ -2,9 +2,11 @@ /** * @file mod/delegate.php */ + use Friendica\App; use Friendica\Core\L10n; use Friendica\Core\System; +use Friendica\Database\dba; use Friendica\Database\DBM; use Friendica\Model\User; diff --git a/mod/dfrn_confirm.php b/mod/dfrn_confirm.php index 0bcf137857..32a9d59f9e 100644 --- a/mod/dfrn_confirm.php +++ b/mod/dfrn_confirm.php @@ -20,13 +20,11 @@ use Friendica\App; use Friendica\Core\Config; use Friendica\Core\L10n; -use Friendica\Core\PConfig; use Friendica\Core\System; -use Friendica\Core\Worker; +use Friendica\Database\dba; use Friendica\Database\DBM; use Friendica\Model\Contact; use Friendica\Model\Group; -use Friendica\Model\Item; use Friendica\Model\User; use Friendica\Network\Probe; use Friendica\Protocol\Diaspora; diff --git a/mod/dfrn_notify.php b/mod/dfrn_notify.php index bfbf4c657a..e356996572 100644 --- a/mod/dfrn_notify.php +++ b/mod/dfrn_notify.php @@ -9,6 +9,7 @@ use Friendica\App; use Friendica\Core\Config; use Friendica\Core\System; +use Friendica\Database\dba; use Friendica\Database\DBM; use Friendica\Model\Contact; use Friendica\Protocol\DFRN; diff --git a/mod/dfrn_poll.php b/mod/dfrn_poll.php index d6bc1727e7..32a8013c31 100644 --- a/mod/dfrn_poll.php +++ b/mod/dfrn_poll.php @@ -3,10 +3,12 @@ /** * @file mod/dfrn_poll.php */ + use Friendica\App; use Friendica\Core\Config; use Friendica\Core\L10n; use Friendica\Core\System; +use Friendica\Database\dba; use Friendica\Database\DBM; use Friendica\Module\Login; use Friendica\Protocol\DFRN; diff --git a/mod/dfrn_request.php b/mod/dfrn_request.php index b7a0dd7487..8713785ad4 100644 --- a/mod/dfrn_request.php +++ b/mod/dfrn_request.php @@ -15,8 +15,8 @@ use Friendica\App; use Friendica\Core\Config; use Friendica\Core\L10n; -use Friendica\Core\PConfig; use Friendica\Core\System; +use Friendica\Database\dba; use Friendica\Database\DBM; use Friendica\Model\Contact; use Friendica\Model\Group; diff --git a/mod/directory.php b/mod/directory.php index a83b1b76ce..85bcbf8130 100644 --- a/mod/directory.php +++ b/mod/directory.php @@ -2,12 +2,14 @@ /** * @file mod/directory.php */ + use Friendica\App; use Friendica\Content\Nav; use Friendica\Content\Widget; use Friendica\Core\Addon; use Friendica\Core\Config; use Friendica\Core\L10n; +use Friendica\Database\dba; use Friendica\Database\DBM; use Friendica\Model\Contact; use Friendica\Model\Profile; diff --git a/mod/dirfind.php b/mod/dirfind.php index d72c2d43d4..257c8b11aa 100644 --- a/mod/dirfind.php +++ b/mod/dirfind.php @@ -2,6 +2,7 @@ /** * @file mod/dirfind.php */ + use Friendica\App; use Friendica\Content\ContactSelector; use Friendica\Content\Widget; @@ -9,12 +10,13 @@ use Friendica\Core\Config; use Friendica\Core\L10n; use Friendica\Core\System; use Friendica\Core\Worker; +use Friendica\Database\dba; +use Friendica\Database\DBM; use Friendica\Model\Contact; use Friendica\Model\GContact; use Friendica\Network\Probe; use Friendica\Protocol\PortableContact; use Friendica\Util\Network; -use Friendica\Database\DBM; require_once 'mod/contacts.php'; diff --git a/mod/display.php b/mod/display.php index 2600dfd26d..3775d263c8 100644 --- a/mod/display.php +++ b/mod/display.php @@ -11,6 +11,7 @@ use Friendica\Core\Config; use Friendica\Core\L10n; use Friendica\Core\Protocol; use Friendica\Core\System; +use Friendica\Database\dba; use Friendica\Database\DBM; use Friendica\Model\Contact; use Friendica\Model\Group; diff --git a/mod/feedtest.php b/mod/feedtest.php index 9217b85d54..a96b1f5d03 100644 --- a/mod/feedtest.php +++ b/mod/feedtest.php @@ -6,6 +6,7 @@ use Friendica\App; use Friendica\Core\L10n; +use Friendica\Database\dba; use Friendica\Model\Contact; use Friendica\Protocol\Feed; use Friendica\Util\Network; diff --git a/mod/hovercard.php b/mod/hovercard.php index 0e8cc80f27..dfec168541 100644 --- a/mod/hovercard.php +++ b/mod/hovercard.php @@ -7,12 +7,13 @@ * Author: Rabuzarus * License: GNU AFFERO GENERAL PUBLIC LICENSE (Version 3) */ + use Friendica\App; use Friendica\Core\Config; use Friendica\Core\System; +use Friendica\Database\dba; use Friendica\Model\Contact; use Friendica\Model\GContact; -use Friendica\Model\Profile; function hovercard_init(App $a) { diff --git a/mod/install.php b/mod/install.php index 55a7cdd7fd..59dcf92c56 100644 --- a/mod/install.php +++ b/mod/install.php @@ -4,9 +4,10 @@ */ use Friendica\App; -use Friendica\Core\L10n; use Friendica\Core\Install; +use Friendica\Core\L10n; use Friendica\Core\System; +use Friendica\Database\dba; use Friendica\Database\DBM; use Friendica\Util\Temporal; diff --git a/mod/item.php b/mod/item.php index 2359b79c58..7bcfdfbe35 100644 --- a/mod/item.php +++ b/mod/item.php @@ -17,11 +17,13 @@ use Friendica\App; use Friendica\Content\Text\BBCode; +use Friendica\Content\Text\HTML; use Friendica\Core\Addon; use Friendica\Core\Config; use Friendica\Core\L10n; use Friendica\Core\System; use Friendica\Core\Worker; +use Friendica\Database\dba; use Friendica\Database\DBM; use Friendica\Model\Contact; use Friendica\Model\Item; @@ -812,7 +814,7 @@ function item_post(App $a) { 'replyTo' => $a->user['email'], 'messageSubject' => $subject, 'htmlVersion' => $message, - 'textVersion' => Friendica\Content\Text\HTML::toPlaintext($html.$disclaimer) + 'textVersion' => HTML::toPlaintext($html.$disclaimer) ]; Emailer::send($params); } diff --git a/mod/lostpass.php b/mod/lostpass.php index 0d22252bdc..07c24f1580 100644 --- a/mod/lostpass.php +++ b/mod/lostpass.php @@ -4,8 +4,10 @@ */ use Friendica\App; +use Friendica\Core\Config; use Friendica\Core\L10n; use Friendica\Core\System; +use Friendica\Database\dba; use Friendica\Database\DBM; use Friendica\Model\User; use Friendica\Util\DateTimeFormat; diff --git a/mod/message.php b/mod/message.php index b414fe0e49..ccdb377b2f 100644 --- a/mod/message.php +++ b/mod/message.php @@ -10,6 +10,7 @@ use Friendica\Content\Text\BBCode; use Friendica\Core\ACL; use Friendica\Core\L10n; use Friendica\Core\System; +use Friendica\Database\dba; use Friendica\Database\DBM; use Friendica\Model\Contact; use Friendica\Model\Mail; diff --git a/mod/network.php b/mod/network.php index 67dd651e22..af9e111c9f 100644 --- a/mod/network.php +++ b/mod/network.php @@ -15,6 +15,7 @@ use Friendica\Core\Config; use Friendica\Core\L10n; use Friendica\Core\PConfig; use Friendica\Core\System; +use Friendica\Database\dba; use Friendica\Database\DBM; use Friendica\Model\Contact; use Friendica\Model\Group; diff --git a/mod/nodeinfo.php b/mod/nodeinfo.php index fad7246075..57b083a761 100644 --- a/mod/nodeinfo.php +++ b/mod/nodeinfo.php @@ -7,8 +7,9 @@ use Friendica\App; use Friendica\Core\Addon; -use Friendica\Core\System; use Friendica\Core\Config; +use Friendica\Core\System; +use Friendica\Database\dba; use Friendica\Util\Network; require_once 'include/dba.php'; diff --git a/mod/noscrape.php b/mod/noscrape.php index 20936929dd..d17937ff5d 100644 --- a/mod/noscrape.php +++ b/mod/noscrape.php @@ -2,8 +2,10 @@ /** * @file mod/noscrape.php */ + use Friendica\App; use Friendica\Core\System; +use Friendica\Database\dba; use Friendica\Database\DBM; use Friendica\Model\Profile; diff --git a/mod/notes.php b/mod/notes.php index 69a5280f7e..af7bd71793 100644 --- a/mod/notes.php +++ b/mod/notes.php @@ -2,12 +2,14 @@ /** * @file mod/notes.php */ + use Friendica\App; use Friendica\Content\Nav; use Friendica\Core\L10n; +use Friendica\Database\dba; use Friendica\Database\DBM; -use Friendica\Model\Profile; use Friendica\Model\Item; +use Friendica\Model\Profile; function notes_init(App $a) { diff --git a/mod/notifications.php b/mod/notifications.php index b113be030d..0b7ac14d45 100644 --- a/mod/notifications.php +++ b/mod/notifications.php @@ -3,12 +3,14 @@ * @file mod/notifications.php * @brief The notifications module */ + use Friendica\App; use Friendica\Content\ContactSelector; use Friendica\Content\Nav; use Friendica\Core\L10n; use Friendica\Core\NotificationsManager; use Friendica\Core\System; +use Friendica\Database\dba; use Friendica\Database\DBM; function notifications_post(App $a) diff --git a/mod/photos.php b/mod/photos.php index bd1de938c8..4058ac5c18 100644 --- a/mod/photos.php +++ b/mod/photos.php @@ -13,6 +13,7 @@ use Friendica\Core\Config; use Friendica\Core\L10n; use Friendica\Core\System; use Friendica\Core\Worker; +use Friendica\Database\dba; use Friendica\Database\DBM; use Friendica\Model\Contact; use Friendica\Model\Group; diff --git a/mod/profile.php b/mod/profile.php index 08c0dfdb86..6ac7d41fe0 100644 --- a/mod/profile.php +++ b/mod/profile.php @@ -12,6 +12,7 @@ use Friendica\Core\Config; use Friendica\Core\L10n; use Friendica\Core\PConfig; use Friendica\Core\System; +use Friendica\Database\dba; use Friendica\Database\DBM; use Friendica\Model\Group; use Friendica\Model\Item; diff --git a/mod/profiles.php b/mod/profiles.php index 3ceb8c6645..db4a7deae5 100644 --- a/mod/profiles.php +++ b/mod/profiles.php @@ -13,10 +13,10 @@ use Friendica\Core\L10n; use Friendica\Core\PConfig; use Friendica\Core\System; use Friendica\Core\Worker; +use Friendica\Database\dba; use Friendica\Database\DBM; use Friendica\Model\Contact; use Friendica\Model\GContact; -use Friendica\Model\Item; use Friendica\Model\Profile; use Friendica\Network\Probe; use Friendica\Util\DateTimeFormat; diff --git a/mod/proxy.php b/mod/proxy.php index ca8ced3cd6..6dc3967876 100644 --- a/mod/proxy.php +++ b/mod/proxy.php @@ -7,6 +7,7 @@ use Friendica\App; use Friendica\Core\Config; use Friendica\Core\System; +use Friendica\Database\dba; use Friendica\Database\DBM; use Friendica\Model\Photo; use Friendica\Object\Image; diff --git a/mod/pubsub.php b/mod/pubsub.php index a68b222ec4..fb6de40523 100644 --- a/mod/pubsub.php +++ b/mod/pubsub.php @@ -1,6 +1,7 @@ mode |= App::MODE_LOCALCONFIGPRESENT; - if (!\dba::connected()) { + if (!dba::connected()) { return; } $this->mode |= App::MODE_DBAVAILABLE; - if (\dba::fetch_first("SHOW TABLES LIKE 'config'") === false) { + if (dba::fetch_first("SHOW TABLES LIKE 'config'") === false) { return; } @@ -513,7 +511,7 @@ class App public function loadDatabase() { - if (\dba::connected()) { + if (dba::connected()) { return; } @@ -544,7 +542,7 @@ class App $stamp1 = microtime(true); - \dba::connect($db_host, $db_user, $db_pass, $db_data, $charset); + dba::connect($db_host, $db_user, $db_pass, $db_data, $charset); unset($db_host, $db_user, $db_pass, $db_data, $charset); $this->save_timestamp($stamp1, 'network'); diff --git a/src/Content/ContactSelector.php b/src/Content/ContactSelector.php index 06972c36d9..47df84f7a6 100644 --- a/src/Content/ContactSelector.php +++ b/src/Content/ContactSelector.php @@ -6,9 +6,8 @@ namespace Friendica\Content; use Friendica\Core\Addon; use Friendica\Core\L10n; +use Friendica\Database\dba; use Friendica\Database\DBM; -use Friendica\Protocol\Diaspora; -use dba; /** * @brief ContactSelector class diff --git a/src/Content/ForumManager.php b/src/Content/ForumManager.php index e45dd0c421..edbe0b64e9 100644 --- a/src/Content/ForumManager.php +++ b/src/Content/ForumManager.php @@ -5,13 +5,12 @@ */ namespace Friendica\Content; -use Friendica\App; use Friendica\Content\Feature; use Friendica\Core\L10n; use Friendica\Core\System; -use Friendica\Model\Contact; +use Friendica\Database\dba; use Friendica\Database\DBM; -use dba; +use Friendica\Model\Contact; require_once 'include/dba.php'; diff --git a/src/Content/Nav.php b/src/Content/Nav.php index 92ca714df8..5f47875098 100644 --- a/src/Content/Nav.php +++ b/src/Content/Nav.php @@ -10,9 +10,9 @@ use Friendica\Core\Addon; use Friendica\Core\Config; use Friendica\Core\L10n; use Friendica\Core\System; +use Friendica\Database\dba; use Friendica\Database\DBM; use Friendica\Model\Profile; -use dba; require_once 'boot.php'; require_once 'dba.php'; diff --git a/src/Content/OEmbed.php b/src/Content/OEmbed.php index 390f3ea868..70556839e9 100644 --- a/src/Content/OEmbed.php +++ b/src/Content/OEmbed.php @@ -5,21 +5,21 @@ */ namespace Friendica\Content; +use DOMDocument; +use DOMNode; +use DOMText; +use DOMXPath; +use Exception; use Friendica\Core\Addon; use Friendica\Core\Cache; use Friendica\Core\Config; use Friendica\Core\L10n; use Friendica\Core\System; +use Friendica\Database\dba; use Friendica\Database\DBM; use Friendica\Util\DateTimeFormat; use Friendica\Util\Network; use Friendica\Util\ParseUrl; -use dba; -use DOMDocument; -use DOMNode; -use DOMText; -use DOMXPath; -use Exception; use stdClass; require_once 'include/dba.php'; diff --git a/src/Content/Widget.php b/src/Content/Widget.php index ba57520124..76d51961c6 100644 --- a/src/Content/Widget.php +++ b/src/Content/Widget.php @@ -11,11 +11,11 @@ use Friendica\Core\Config; use Friendica\Core\L10n; use Friendica\Core\PConfig; use Friendica\Core\System; +use Friendica\Database\dba; use Friendica\Database\DBM; use Friendica\Model\Contact; use Friendica\Model\GContact; use Friendica\Model\Profile; -use dba; require_once 'boot.php'; require_once 'include/dba.php'; diff --git a/src/Content/Widget/TagCloud.php b/src/Content/Widget/TagCloud.php index 53c4daae45..9160dd579f 100644 --- a/src/Content/Widget/TagCloud.php +++ b/src/Content/Widget/TagCloud.php @@ -6,9 +6,9 @@ namespace Friendica\Content\Widget; -use dba; use Friendica\Core\L10n; use Friendica\Core\System; +use Friendica\Database\dba; use Friendica\Database\DBM; require_once 'include/dba.php'; diff --git a/src/Core/ACL.php b/src/Core/ACL.php index 4e8bf6abde..95948af293 100644 --- a/src/Core/ACL.php +++ b/src/Core/ACL.php @@ -6,27 +6,13 @@ namespace Friendica\Core; -use dba; use Friendica\BaseObject; use Friendica\Content\Feature; +use Friendica\Database\dba; use Friendica\Database\DBM; use Friendica\Model\Contact; use Friendica\Model\GContact; use Friendica\Util\Network; -use const CONTACT_IS_FRIEND; -use const NETWORK_DFRN; -use const NETWORK_DIASPORA; -use const NETWORK_FACEBOOK; -use const NETWORK_MAIL; -use const NETWORK_OSTATUS; -use const PHP_EOL; -use function dbesc; -use function defaults; -use function get_markup_template; -use function get_server; -use function local_user; -use function remote_user; -use function replace_macros; /** * Handle ACL management and display diff --git a/src/Core/Addon.php b/src/Core/Addon.php index 50247d240f..eb2b7d1aac 100644 --- a/src/Core/Addon.php +++ b/src/Core/Addon.php @@ -4,11 +4,9 @@ */ namespace Friendica\Core; -use Friendica\Core\Config; +use Friendica\App; +use Friendica\Database\dba; use Friendica\Database\DBM; -use Friendica\Core\Worker; - -use dba; require_once 'include/dba.php'; @@ -228,12 +226,12 @@ class Addon /** * @brief Calls a single hook. * - * @param \Friendica\App $a + * @param App $a * @param string $name of the hook to call * @param array $hook Hook data * @param string|array &$data to transmit to the callback handler */ - public static function callSingleHook(\Friendica\App $a, $name, $hook, &$data = null) + public static function callSingleHook(App $a, $name, $hook, &$data = null) { // Don't run a theme's hook if the user isn't using the theme if (strpos($hook[0], 'view/theme/') !== false && strpos($hook[0], 'view/theme/' . $a->getCurrentTheme()) === false) { diff --git a/src/Core/Cache/DatabaseCacheDriver.php b/src/Core/Cache/DatabaseCacheDriver.php index 059fef3290..2e14567704 100644 --- a/src/Core/Cache/DatabaseCacheDriver.php +++ b/src/Core/Cache/DatabaseCacheDriver.php @@ -2,8 +2,8 @@ namespace Friendica\Core\Cache; -use dba; use Friendica\Core\Cache; +use Friendica\Database\dba; use Friendica\Database\DBM; use Friendica\Util\DateTimeFormat; diff --git a/src/Core/Config/JITConfigAdapter.php b/src/Core/Config/JITConfigAdapter.php index 527c718ae0..77902ffc82 100644 --- a/src/Core/Config/JITConfigAdapter.php +++ b/src/Core/Config/JITConfigAdapter.php @@ -1,8 +1,8 @@ mode === App::MODE_INSTALL) { - throw new \RuntimeException('Friendica isn\'t properly installed yet.'); + throw new RuntimeException('Friendica isn\'t properly installed yet.'); } $nurl = normalise_link($this->getArgument(0)); if (!dba::exists('contact', ['nurl' => $nurl, 'archive' => false])) { - throw new \RuntimeException(L10n::t('Could not find any unarchived contact entry for this URL (%s)', $nurl)); + throw new RuntimeException(L10n::t('Could not find any unarchived contact entry for this URL (%s)', $nurl)); } if (dba::update('contact', ['archive' => true], ['nurl' => $nurl])) { $condition = ["`cid` IN (SELECT `id` FROM `contact` WHERE `archive`)"]; dba::delete('queue', $condition); $this->out(L10n::t('The contact entries have been archived')); } else { - throw new \RuntimeException('The contact archival failed.'); + throw new RuntimeException('The contact archival failed.'); } return 0; diff --git a/src/Core/Console/AutomaticInstallation.php b/src/Core/Console/AutomaticInstallation.php index 4822368ab5..76735ec9ae 100644 --- a/src/Core/Console/AutomaticInstallation.php +++ b/src/Core/Console/AutomaticInstallation.php @@ -3,11 +3,11 @@ namespace Friendica\Core\Console; use Asika\SimpleConsole\Console; -use dba; use Friendica\App; use Friendica\Core\Config; use Friendica\Core\Install; use Friendica\Core\Theme; +use Friendica\Database\dba; use RuntimeException; require_once 'mod/install.php'; diff --git a/src/Core/Console/Config.php b/src/Core/Console/Config.php index c37dd26b15..daa0ba60a8 100644 --- a/src/Core/Console/Config.php +++ b/src/Core/Console/Config.php @@ -9,8 +9,9 @@ namespace Friendica\Core\Console; use Asika\SimpleConsole\CommandArgsException; -use dba; +use Friendica\App; use Friendica\Core; +use RuntimeException; require_once 'include/dba.php'; require_once 'include/text.php'; @@ -92,7 +93,7 @@ HELP; throw new CommandArgsException('Too many arguments'); } - if (!($a->mode & \Friendica\App::MODE_DBCONFIGAVAILABLE)) { + if (!($a->mode & App::MODE_DBCONFIGAVAILABLE)) { $this->out('Database isn\'t ready or populated yet, showing file config only'); } @@ -102,7 +103,7 @@ HELP; $value = $this->getArgument(2); if (is_array(Core\Config::get($cat, $key))) { - throw new \RuntimeException("$cat.$key is an array and can't be set using this command."); + throw new RuntimeException("$cat.$key is an array and can't be set using this command."); } $result = Core\Config::set($cat, $key, $value); @@ -151,7 +152,7 @@ HELP; if (count($this->args) == 0) { Core\Config::load(); - if (Core\Config::get('system', 'config_adapter') == 'jit' && $a->mode & \Friendica\App::MODE_DBCONFIGAVAILABLE) { + if (Core\Config::get('system', 'config_adapter') == 'jit' && $a->mode & App::MODE_DBCONFIGAVAILABLE) { $this->out('Warning: The JIT (Just In Time) Config adapter doesn\'t support loading the entire configuration, showing file config only'); } diff --git a/src/Core/Console/DatabaseStructure.php b/src/Core/Console/DatabaseStructure.php index 1190484310..8c26987d2c 100644 --- a/src/Core/Console/DatabaseStructure.php +++ b/src/Core/Console/DatabaseStructure.php @@ -3,7 +3,9 @@ namespace Friendica\Core\Console; use Friendica\Core; +use Friendica\Database\dba; use Friendica\Database\DBStructure; +use RuntimeException; require_once 'boot.php'; require_once 'include/dba.php'; @@ -56,8 +58,8 @@ HELP; throw new \Asika\SimpleConsole\CommandArgsException('Too many arguments'); } - if (!\dba::connected()) { - throw new \RuntimeException('Unable to connect to database'); + if (!dba::connected()) { + throw new RuntimeException('Unable to connect to database'); } Core\Config::load(); diff --git a/src/Core/Console/GlobalCommunitySilence.php b/src/Core/Console/GlobalCommunitySilence.php index ccd6014e9c..6330d08a12 100644 --- a/src/Core/Console/GlobalCommunitySilence.php +++ b/src/Core/Console/GlobalCommunitySilence.php @@ -3,8 +3,10 @@ namespace Friendica\Core\Console; use Friendica\Core\Protocol; +use Friendica\Database\dba; use Friendica\Database\DBM; use Friendica\Network\Probe; +use RuntimeException; require_once 'include/text.php'; @@ -65,7 +67,7 @@ HELP; } if ($a->isInstallMode()) { - throw new \RuntimeException('Database isn\'t ready or populated yet'); + throw new RuntimeException('Database isn\'t ready or populated yet'); } /** @@ -75,16 +77,16 @@ HELP; * */ $net = Probe::uri($this->getArgument(0)); if (in_array($net['network'], [Protocol::PHANTOM, Protocol::MAIL])) { - throw new \RuntimeException('This account seems not to exist.'); + throw new RuntimeException('This account seems not to exist.'); } $nurl = normalise_link($net['url']); - $contact = \dba::selectFirst("contact", ["id"], ["nurl" => $nurl, "uid" => 0]); + $contact = dba::selectFirst("contact", ["id"], ["nurl" => $nurl, "uid" => 0]); if (DBM::is_result($contact)) { - \dba::update("contact", ["hidden" => true], ["id" => $contact["id"]]); + dba::update("contact", ["hidden" => true], ["id" => $contact["id"]]); $this->out('NOTICE: The account should be silenced from the global community page'); } else { - throw new \RuntimeException('NOTICE: Could not find any entry for this URL (' . $nurl . ')'); + throw new RuntimeException('NOTICE: Could not find any entry for this URL (' . $nurl . ')'); } return 0; diff --git a/src/Core/Console/NewPassword.php b/src/Core/Console/NewPassword.php index 0035974727..cdf31422d1 100644 --- a/src/Core/Console/NewPassword.php +++ b/src/Core/Console/NewPassword.php @@ -2,12 +2,12 @@ namespace Friendica\Core\Console; -use Friendica\Core\L10n; -use Friendica\Model\Contact; -use Friendica\Model\User; use Friendica\Core\Config; +use Friendica\Core\L10n; +use Friendica\Database\dba; use Friendica\Database\DBM; -use dba; +use Friendica\Model\User; +use RuntimeException; /** * @brief tool to set a new password for a user @@ -59,14 +59,14 @@ HELP; } if ($a->isInstallMode()) { - throw new \RuntimeException('Database isn\'t ready or populated yet'); + throw new RuntimeException('Database isn\'t ready or populated yet'); } $nick = $this->getArgument(0); $user = dba::selectFirst('user', ['uid'], ['nickname' => $nick]); if (!DBM::is_result($user)) { - throw new \RuntimeException(L10n::t('User not found')); + throw new RuntimeException(L10n::t('User not found')); } $password = $this->getArgument(1); @@ -76,15 +76,15 @@ HELP; } if (!$password) { - throw new \RuntimeException(L10n::t('Password can\'t be empty')); + throw new RuntimeException(L10n::t('Password can\'t be empty')); } if (!Config::get('system', 'disable_password_exposed', false) && User::isPasswordExposed($password)) { - throw new \RuntimeException(L10n::t('The new password has been exposed in a public data dump, please choose another.')); + throw new RuntimeException(L10n::t('The new password has been exposed in a public data dump, please choose another.')); } if (!User::updatePassword($user['uid'], $password)) { - throw new \RuntimeException(L10n::t('Password update failed. Please try again.')); + throw new RuntimeException(L10n::t('Password update failed. Please try again.')); } $this->out(L10n::t('Password changed.')); diff --git a/src/Core/L10n.php b/src/Core/L10n.php index 2389817021..32f87a4703 100644 --- a/src/Core/L10n.php +++ b/src/Core/L10n.php @@ -4,8 +4,8 @@ */ namespace Friendica\Core; -use Friendica\Core\Config; -use dba; +use Friendica\BaseObject; +use Friendica\Database\dba; require_once 'boot.php'; require_once 'include/dba.php'; @@ -14,7 +14,7 @@ require_once 'include/dba.php'; * Provide Languange, Translation, and Localisation functions to the application * Localisation can be referred to by the numeronym L10N (as in: "L", followed by ten more letters, and then "N"). */ -class L10n extends \Friendica\BaseObject +class L10n extends BaseObject { /** * @brief get the prefered language from the HTTP_ACCEPT_LANGUAGE header diff --git a/src/Core/Lock/DatabaseLockDriver.php b/src/Core/Lock/DatabaseLockDriver.php index fc057c6b55..10612a91e4 100644 --- a/src/Core/Lock/DatabaseLockDriver.php +++ b/src/Core/Lock/DatabaseLockDriver.php @@ -2,8 +2,8 @@ namespace Friendica\Core\Lock; -use dba; use Friendica\Core\Cache; +use Friendica\Database\dba; use Friendica\Database\DBM; use Friendica\Util\DateTimeFormat; diff --git a/src/Core/NotificationsManager.php b/src/Core/NotificationsManager.php index 6605abf79b..1154206d3c 100644 --- a/src/Core/NotificationsManager.php +++ b/src/Core/NotificationsManager.php @@ -9,17 +9,12 @@ namespace Friendica\Core; use Friendica\BaseObject; use Friendica\Content\Text\BBCode; use Friendica\Content\Text\HTML; -use Friendica\Core\L10n; -use Friendica\Core\PConfig; -use Friendica\Core\System; use Friendica\Database\DBM; use Friendica\Model\Contact; -use Friendica\Model\Profile; use Friendica\Model\Item; use Friendica\Util\DateTimeFormat; use Friendica\Util\Temporal; use Friendica\Util\XML; -use dba; require_once 'include/dba.php'; diff --git a/src/Core/Session/DatabaseSessionHandler.php b/src/Core/Session/DatabaseSessionHandler.php index f69531a888..82cb36aacb 100644 --- a/src/Core/Session/DatabaseSessionHandler.php +++ b/src/Core/Session/DatabaseSessionHandler.php @@ -4,9 +4,9 @@ namespace Friendica\Core\Session; use Friendica\BaseObject; use Friendica\Core\Session; +use Friendica\Database\dba; use Friendica\Database\DBM; use SessionHandlerInterface; -use dba; require_once 'boot.php'; require_once 'include/dba.php'; diff --git a/src/Core/UserImport.php b/src/Core/UserImport.php index 0832dae45a..1b25a66ba0 100644 --- a/src/Core/UserImport.php +++ b/src/Core/UserImport.php @@ -5,14 +5,9 @@ namespace Friendica\Core; use Friendica\App; -use Friendica\Core\L10n; -use Friendica\Core\System; -use Friendica\Core\PConfig; -use Friendica\Core\Worker; -use Friendica\Database\DBM; +use Friendica\Database\dba; use Friendica\Model\Photo; use Friendica\Object\Image; -use dba; require_once "include/dba.php"; diff --git a/src/Core/Worker.php b/src/Core/Worker.php index 897a80111d..fbd162615f 100644 --- a/src/Core/Worker.php +++ b/src/Core/Worker.php @@ -4,7 +4,7 @@ */ namespace Friendica\Core; -use dba; +use Friendica\Database\dba; use Friendica\Database\DBM; use Friendica\Model\Process; use Friendica\Util\DateTimeFormat; diff --git a/src/Database/DBM.php b/src/Database/DBM.php index 7daf6b545f..bbe60e0f2c 100644 --- a/src/Database/DBM.php +++ b/src/Database/DBM.php @@ -4,7 +4,6 @@ */ namespace Friendica\Database; -use dba; use Friendica\Util\DateTimeFormat; require_once 'include/dba.php'; diff --git a/src/Database/DBStructure.php b/src/Database/DBStructure.php index 67750c3479..bfecdba20e 100644 --- a/src/Database/DBStructure.php +++ b/src/Database/DBStructure.php @@ -4,7 +4,8 @@ */ namespace Friendica\Database; -use dba; +use Exception; +use Friendica\Core\Addon; use Friendica\Core\Config; use Friendica\Core\L10n; @@ -629,7 +630,7 @@ class DBStructure private static function createIndex($indexname, $fieldnames, $method = "ADD") { $method = strtoupper(trim($method)); if ($method!="" && $method!="ADD") { - throw new \Exception("Invalid parameter 'method' in self::createIndex(): '$method'"); + throw new Exception("Invalid parameter 'method' in self::createIndex(): '$method'"); } if ($fieldnames[0] == "UNIQUE") { @@ -1941,7 +1942,7 @@ class DBStructure ] ]; - \Friendica\Core\Addon::callHooks('dbstructure_definition', $database); + Addon::callHooks('dbstructure_definition', $database); return $database; } diff --git a/src/Database/PostUpdate.php b/src/Database/PostUpdate.php index 5593d932a3..4ce89d49e5 100644 --- a/src/Database/PostUpdate.php +++ b/src/Database/PostUpdate.php @@ -5,11 +5,9 @@ namespace Friendica\Database; use Friendica\Core\Config; -use Friendica\Database\DBM; use Friendica\Model\Contact; use Friendica\Model\Item; use Friendica\Model\PermissionSet; -use dba; require_once 'include/dba.php'; diff --git a/src/Model/Contact.php b/src/Model/Contact.php index 093ee0d91e..1328300937 100644 --- a/src/Model/Contact.php +++ b/src/Model/Contact.php @@ -11,19 +11,16 @@ use Friendica\Core\L10n; use Friendica\Core\PConfig; use Friendica\Core\System; use Friendica\Core\Worker; +use Friendica\Database\dba; use Friendica\Database\DBM; -use Friendica\Model\Photo; -use Friendica\Model\Profile; use Friendica\Network\Probe; -use Friendica\Protocol\DFRN; +use Friendica\Object\Image; use Friendica\Protocol\Diaspora; use Friendica\Protocol\OStatus; use Friendica\Protocol\PortableContact; use Friendica\Protocol\Salmon; use Friendica\Util\DateTimeFormat; use Friendica\Util\Network; -use Friendica\Object\Image; -use dba; require_once 'boot.php'; require_once 'include/dba.php'; diff --git a/src/Model/Conversation.php b/src/Model/Conversation.php index 69bbc3bb6d..4b1adc250f 100644 --- a/src/Model/Conversation.php +++ b/src/Model/Conversation.php @@ -4,8 +4,8 @@ */ namespace Friendica\Model; +use Friendica\Database\dba; use Friendica\Database\DBM; -use dba; require_once "include/dba.php"; diff --git a/src/Model/Event.php b/src/Model/Event.php index 47ec50aaa0..bd614f0bfb 100644 --- a/src/Model/Event.php +++ b/src/Model/Event.php @@ -5,15 +5,14 @@ namespace Friendica\Model; -use dba; use Friendica\BaseObject; use Friendica\Content\Text\BBCode; use Friendica\Core\Addon; use Friendica\Core\L10n; use Friendica\Core\PConfig; use Friendica\Core\System; +use Friendica\Database\dba; use Friendica\Database\DBM; -use Friendica\Model\Item; use Friendica\Util\DateTimeFormat; use Friendica\Util\Map; diff --git a/src/Model/GContact.php b/src/Model/GContact.php index d77e81a4c7..52924b6416 100644 --- a/src/Model/GContact.php +++ b/src/Model/GContact.php @@ -6,18 +6,16 @@ */ namespace Friendica\Model; -use Friendica\Core\Config; +use Exception; +use Friendica\Core\Console\Config; use Friendica\Core\System; use Friendica\Core\Worker; +use Friendica\Database\dba; use Friendica\Database\DBM; -use Friendica\Model\Contact; -use Friendica\Model\Profile; use Friendica\Network\Probe; use Friendica\Protocol\PortableContact; use Friendica\Util\DateTimeFormat; use Friendica\Util\Network; -use dba; -use Exception; require_once 'include/dba.php'; diff --git a/src/Model/Group.php b/src/Model/Group.php index 79604e2ca0..5247a05569 100644 --- a/src/Model/Group.php +++ b/src/Model/Group.php @@ -6,8 +6,8 @@ namespace Friendica\Model; use Friendica\BaseObject; use Friendica\Core\L10n; +use Friendica\Database\dba; use Friendica\Database\DBM; -use dba; require_once 'boot.php'; require_once 'include/dba.php'; diff --git a/src/Model/Item.php b/src/Model/Item.php index 74a4ebba5f..4f9f1cf904 100644 --- a/src/Model/Item.php +++ b/src/Model/Item.php @@ -6,18 +6,16 @@ namespace Friendica\Model; -use dba; use Friendica\BaseObject; -use Friendica\Content\Text; +use Friendica\Content\Text\BBCode; use Friendica\Core\Addon; use Friendica\Core\Config; -use Friendica\Core\L10n; use Friendica\Core\Lock; use Friendica\Core\PConfig; use Friendica\Core\System; use Friendica\Core\Worker; +use Friendica\Database\dba; use Friendica\Database\DBM; -use Friendica\Model\PermissionSet; use Friendica\Object\Image; use Friendica\Protocol\Diaspora; use Friendica\Protocol\OStatus; @@ -2219,7 +2217,7 @@ class Item extends BaseObject */ private static function addLanguageToItemArray(&$item) { - $naked_body = Text\BBCode::toPlaintext($item['body'], false); + $naked_body = BBCode::toPlaintext($item['body'], false); $ld = new Text_LanguageDetect(); $ld->setNameMode(2); diff --git a/src/Model/Mail.php b/src/Model/Mail.php index f10ad368ba..1e5c864872 100644 --- a/src/Model/Mail.php +++ b/src/Model/Mail.php @@ -8,10 +8,10 @@ namespace Friendica\Model; use Friendica\Core\L10n; use Friendica\Core\System; use Friendica\Core\Worker; +use Friendica\Database\dba; use Friendica\Database\DBM; use Friendica\Network\Probe; use Friendica\Util\DateTimeFormat; -use dba; require_once 'include/dba.php'; diff --git a/src/Model/OpenWebAuthToken.php b/src/Model/OpenWebAuthToken.php index 5c405b27d3..336f4ab069 100644 --- a/src/Model/OpenWebAuthToken.php +++ b/src/Model/OpenWebAuthToken.php @@ -5,9 +5,9 @@ */ namespace Friendica\Model; +use Friendica\Database\dba; use Friendica\Database\DBM; use Friendica\Util\DateTimeFormat; -use dba; /** * Methods to deal with entries of the 'openwebauth-token' table. @@ -16,12 +16,12 @@ class OpenWebAuthToken { /** * Create an entry in the 'openwebauth-token' table. - * + * * @param string $type Verify type. * @param int $uid The user ID. * @param string $token * @param string $meta - * + * * @return boolean */ public static function create($type, $uid, $token, $meta) @@ -38,11 +38,11 @@ class OpenWebAuthToken /** * Get the "meta" field of an entry in the openwebauth-token table. - * + * * @param string $type Verify type. * @param int $uid The user ID. * @param string $token - * + * * @return string|boolean The meta enry or false if not found. */ public static function getMeta($type, $uid, $token) @@ -60,7 +60,7 @@ class OpenWebAuthToken /** * Purge entries of a verify-type older than interval. - * + * * @param string $type Verify type. * @param string $interval SQL compatible time interval */ diff --git a/src/Model/PermissionSet.php b/src/Model/PermissionSet.php index c31e88bf17..983261fd61 100644 --- a/src/Model/PermissionSet.php +++ b/src/Model/PermissionSet.php @@ -5,8 +5,8 @@ namespace Friendica\Model; use Friendica\BaseObject; +use Friendica\Database\dba; use Friendica\Database\DBM; -use dba; require_once 'include/dba.php'; diff --git a/src/Model/Photo.php b/src/Model/Photo.php index b08c6f0459..2d740c3933 100644 --- a/src/Model/Photo.php +++ b/src/Model/Photo.php @@ -10,11 +10,11 @@ use Friendica\Core\Cache; use Friendica\Core\Config; use Friendica\Core\L10n; use Friendica\Core\System; +use Friendica\Database\dba; use Friendica\Database\DBM; use Friendica\Object\Image; use Friendica\Util\DateTimeFormat; use Friendica\Util\Network; -use dba; require_once 'include/dba.php'; diff --git a/src/Model/Process.php b/src/Model/Process.php index 75d898065c..d459597651 100644 --- a/src/Model/Process.php +++ b/src/Model/Process.php @@ -5,8 +5,8 @@ namespace Friendica\Model; use Friendica\BaseObject; +use Friendica\Database\dba; use Friendica\Util\DateTimeFormat; -use dba; require_once 'include/dba.php'; diff --git a/src/Model/Profile.php b/src/Model/Profile.php index 92355b216e..79f3262410 100644 --- a/src/Model/Profile.php +++ b/src/Model/Profile.php @@ -15,16 +15,12 @@ use Friendica\Core\L10n; use Friendica\Core\PConfig; use Friendica\Core\System; use Friendica\Core\Worker; +use Friendica\Database\dba; use Friendica\Database\DBM; -use Friendica\Model\Contact; -use Friendica\Model\OpenWebAuthToken; use Friendica\Protocol\Diaspora; use Friendica\Util\DateTimeFormat; use Friendica\Util\Network; use Friendica\Util\Temporal; -use dba; - -use InvalidArgumentException; require_once 'include/dba.php'; require_once 'mod/proxy.php'; diff --git a/src/Model/PushSubscriber.php b/src/Model/PushSubscriber.php index 925a461e2a..fc08ca6cbb 100644 --- a/src/Model/PushSubscriber.php +++ b/src/Model/PushSubscriber.php @@ -5,9 +5,9 @@ namespace Friendica\Model; use Friendica\Core\Worker; -use Friendica\Util\DateTimeFormat; +use Friendica\Database\dba; use Friendica\Database\DBM; -use dba; +use Friendica\Util\DateTimeFormat; require_once 'include/dba.php'; diff --git a/src/Model/Queue.php b/src/Model/Queue.php index 8b9e801c3f..8e9ed40d03 100644 --- a/src/Model/Queue.php +++ b/src/Model/Queue.php @@ -5,9 +5,9 @@ namespace Friendica\Model; use Friendica\Core\Config; +use Friendica\Database\dba; use Friendica\Database\DBM; use Friendica\Util\DateTimeFormat; -use dba; require_once 'include/dba.php'; diff --git a/src/Model/Term.php b/src/Model/Term.php index e9918c23b8..9f0b595014 100644 --- a/src/Model/Term.php +++ b/src/Model/Term.php @@ -5,9 +5,8 @@ namespace Friendica\Model; use Friendica\Core\System; +use Friendica\Database\dba; use Friendica\Database\DBM; -use Friendica\Model\Item; -use dba; require_once 'boot.php'; require_once 'include/conversation.php'; diff --git a/src/Model/User.php b/src/Model/User.php index 57a3ecb50d..4dca908b61 100644 --- a/src/Model/User.php +++ b/src/Model/User.php @@ -6,22 +6,19 @@ namespace Friendica\Model; use DivineOmega\PasswordExposed\PasswordStatus; +use Exception; use Friendica\Core\Addon; use Friendica\Core\Config; use Friendica\Core\L10n; use Friendica\Core\PConfig; use Friendica\Core\System; use Friendica\Core\Worker; +use Friendica\Database\dba; use Friendica\Database\DBM; -use Friendica\Model\Contact; -use Friendica\Model\Group; -use Friendica\Model\Photo; use Friendica\Object\Image; use Friendica\Util\Crypto; use Friendica\Util\DateTimeFormat; use Friendica\Util\Network; -use dba; -use Exception; use LightOpenID; use function password_exposed; diff --git a/src/Module/Hashtag.php b/src/Module/Hashtag.php index c35a6440c0..a53585c284 100644 --- a/src/Module/Hashtag.php +++ b/src/Module/Hashtag.php @@ -6,7 +6,7 @@ namespace Friendica\Module; use Friendica\BaseModule; use Friendica\Core\System; -use dba; +use Friendica\Database\dba; require_once 'include/dba.php'; require_once 'include/text.php'; diff --git a/src/Module/Login.php b/src/Module/Login.php index 06d724bb2a..fb7a60613d 100644 --- a/src/Module/Login.php +++ b/src/Module/Login.php @@ -4,16 +4,16 @@ */ namespace Friendica\Module; +use Exception; use Friendica\BaseModule; use Friendica\Core\Addon; use Friendica\Core\Config; use Friendica\Core\L10n; +use Friendica\Database\dba; use Friendica\Database\DBM; use Friendica\Model\User; use Friendica\Util\DateTimeFormat; use Friendica\Util\Network; -use dba; -use Exception; use LightOpenID; require_once 'boot.php'; diff --git a/src/Module/Magic.php b/src/Module/Magic.php index d55e8f93bc..c1e2a7c978 100644 --- a/src/Module/Magic.php +++ b/src/Module/Magic.php @@ -5,12 +5,11 @@ namespace Friendica\Module; use Friendica\BaseModule; +use Friendica\Database\dba; use Friendica\Model\Contact; use Friendica\Util\HTTPSignature; use Friendica\Util\Network; -use dba; - /** * Magic Auth (remote authentication) module. * diff --git a/src/Module/Owa.php b/src/Module/Owa.php index 306c525c06..84f2502447 100644 --- a/src/Module/Owa.php +++ b/src/Module/Owa.php @@ -6,23 +6,22 @@ namespace Friendica\Module; use Friendica\BaseModule; use Friendica\Core\System; +use Friendica\Database\dba; use Friendica\Database\DBM; use Friendica\Model\Contact; use Friendica\Model\OpenWebAuthToken; use Friendica\Util\HTTPSignature; -use dba; - /** * @brief OpenWebAuth verifier and token generator - * + * * See https://macgirvin.com/wiki/mike/OpenWebAuth/Home * Requests to this endpoint should be signed using HTTP Signatures * using the 'Authorization: Signature' authentication method * If the signature verifies a token is returned. * * This token may be exchanged for an authenticated cookie. - * + * * Ported from Hubzilla: https://framagit.org/hubzilla/core/blob/master/Zotlabs/Module/Owa.php */ class Owa extends BaseModule diff --git a/src/Network/FKOAuth1.php b/src/Network/FKOAuth1.php index 8af267be3d..addaeae115 100644 --- a/src/Network/FKOAuth1.php +++ b/src/Network/FKOAuth1.php @@ -7,10 +7,9 @@ namespace Friendica\Network; use Friendica\Core\Addon; use Friendica\Core\PConfig; use Friendica\Core\System; +use Friendica\Database\dba; use Friendica\Database\DBM; -use Friendica\Network\FKOAuthDataStore; use Friendica\Util\DateTimeFormat; -use dba; use OAuthServer; use OAuthSignatureMethod_HMAC_SHA1; use OAuthSignatureMethod_PLAINTEXT; diff --git a/src/Network/FKOAuthDataStore.php b/src/Network/FKOAuthDataStore.php index 7a3329776a..154d63b72f 100644 --- a/src/Network/FKOAuthDataStore.php +++ b/src/Network/FKOAuthDataStore.php @@ -10,8 +10,8 @@ namespace Friendica\Network; use Friendica\Core\Config; +use Friendica\Database\dba; use Friendica\Database\DBM; -use dba; use OAuthConsumer; use OAuthDataStore; use OAuthToken; diff --git a/src/Network/Probe.php b/src/Network/Probe.php index 6b278a965f..1a5ccbfae1 100644 --- a/src/Network/Probe.php +++ b/src/Network/Probe.php @@ -9,21 +9,19 @@ namespace Friendica\Network; * @brief Functions for probing URL */ -use Friendica\App; -use Friendica\Core\System; +use DOMDocument; use Friendica\Core\Cache; use Friendica\Core\Config; +use Friendica\Core\System; +use Friendica\Database\dba; use Friendica\Database\DBM; use Friendica\Model\Profile; use Friendica\Protocol\Email; use Friendica\Protocol\Feed; use Friendica\Util\Crypto; +use Friendica\Util\DateTimeFormat; use Friendica\Util\Network; use Friendica\Util\XML; -use Friendica\Util\DateTimeFormat; -use dba; -use DOMXPath; -use DOMDocument; require_once 'include/dba.php'; diff --git a/src/Object/Post.php b/src/Object/Post.php index 8b05abc566..71431b10db 100644 --- a/src/Object/Post.php +++ b/src/Object/Post.php @@ -11,12 +11,12 @@ use Friendica\Core\Addon; use Friendica\Core\Config; use Friendica\Core\L10n; use Friendica\Core\PConfig; +use Friendica\Database\dba; use Friendica\Database\DBM; use Friendica\Model\Contact; use Friendica\Model\Item; use Friendica\Util\DateTimeFormat; use Friendica\Util\Temporal; -use dba; require_once 'include/dba.php'; require_once 'include/text.php'; diff --git a/src/Protocol/DFRN.php b/src/Protocol/DFRN.php index 5326e49ac9..0769d3b1d9 100644 --- a/src/Protocol/DFRN.php +++ b/src/Protocol/DFRN.php @@ -8,6 +8,8 @@ */ namespace Friendica\Protocol; +use DOMDocument; +use DOMXPath; use Friendica\App; use Friendica\Content\OEmbed; use Friendica\Content\Text\BBCode; @@ -16,7 +18,7 @@ use Friendica\Core\Addon; use Friendica\Core\Config; use Friendica\Core\L10n; use Friendica\Core\System; -use Friendica\Core\Worker; +use Friendica\Database\dba; use Friendica\Database\DBM; use Friendica\Model\Contact; use Friendica\Model\Event; @@ -26,15 +28,10 @@ use Friendica\Model\Item; use Friendica\Model\Profile; use Friendica\Model\User; use Friendica\Object\Image; -use Friendica\Protocol\OStatus; use Friendica\Util\Crypto; use Friendica\Util\DateTimeFormat; use Friendica\Util\Network; use Friendica\Util\XML; -use Friendica\Protocol\Diaspora; -use dba; -use DOMDocument; -use DOMXPath; use HTMLPurifier; use HTMLPurifier_Config; diff --git a/src/Protocol/Diaspora.php b/src/Protocol/Diaspora.php index 6b6e75cda4..40caa4f06d 100644 --- a/src/Protocol/Diaspora.php +++ b/src/Protocol/Diaspora.php @@ -18,6 +18,7 @@ use Friendica\Core\L10n; use Friendica\Core\PConfig; use Friendica\Core\System; use Friendica\Core\Worker; +use Friendica\Database\dba; use Friendica\Database\DBM; use Friendica\Model\Contact; use Friendica\Model\GContact; @@ -29,12 +30,11 @@ use Friendica\Model\User; use Friendica\Network\Probe; use Friendica\Util\Crypto; use Friendica\Util\DateTimeFormat; +use Friendica\Util\Map; use Friendica\Util\Network; use Friendica\Util\XML; -use Friendica\Util\Map; -use dba; -use stdClass; use SimpleXMLElement; +use stdClass; require_once 'include/dba.php'; require_once 'include/items.php'; diff --git a/src/Protocol/Feed.php b/src/Protocol/Feed.php index d989b99622..3ebf37e4c7 100644 --- a/src/Protocol/Feed.php +++ b/src/Protocol/Feed.php @@ -6,17 +6,15 @@ */ namespace Friendica\Protocol; -use Friendica\Database\DBM; +use DOMDocument; +use DOMXPath; +use Friendica\Content\Text\HTML; use Friendica\Core\System; +use Friendica\Database\DBM; use Friendica\Model\Item; use Friendica\Util\Network; -use Friendica\Content\Text\HTML; use Friendica\Util\XML; -use dba; -use DOMDocument; -use DOMXPath; - require_once 'include/dba.php'; require_once 'include/items.php'; diff --git a/src/Protocol/OStatus.php b/src/Protocol/OStatus.php index f0f4bed01a..bd0defa32a 100644 --- a/src/Protocol/OStatus.php +++ b/src/Protocol/OStatus.php @@ -4,7 +4,6 @@ */ namespace Friendica\Protocol; -use dba; use DOMDocument; use DOMXPath; use Friendica\Content\Text\BBCode; @@ -14,6 +13,7 @@ use Friendica\Core\Config; use Friendica\Core\L10n; use Friendica\Core\Lock; use Friendica\Core\System; +use Friendica\Database\dba; use Friendica\Database\DBM; use Friendica\Model\Contact; use Friendica\Model\Conversation; diff --git a/src/Protocol/PortableContact.php b/src/Protocol/PortableContact.php index a9e06d19a8..848662538b 100644 --- a/src/Protocol/PortableContact.php +++ b/src/Protocol/PortableContact.php @@ -9,21 +9,20 @@ namespace Friendica\Protocol; +use DOMDocument; +use DOMXPath; +use Exception; use Friendica\Content\Text\HTML; use Friendica\Core\Config; use Friendica\Core\Worker; +use Friendica\Database\dba; use Friendica\Database\DBM; use Friendica\Model\GContact; use Friendica\Model\Profile; use Friendica\Network\Probe; use Friendica\Util\DateTimeFormat; use Friendica\Util\Network; -use Friendica\Protocol\Diaspora; use Friendica\Util\XML; -use dba; -use DOMDocument; -use DOMXPath; -use Exception; require_once 'include/dba.php'; diff --git a/src/Util/ExAuth.php b/src/Util/ExAuth.php index d4436e32af..a01a7c721e 100644 --- a/src/Util/ExAuth.php +++ b/src/Util/ExAuth.php @@ -36,10 +36,9 @@ namespace Friendica\Util; use Friendica\Core\Config; use Friendica\Core\PConfig; +use Friendica\Database\dba; use Friendica\Database\DBM; use Friendica\Model\User; -use Friendica\Util\Network; -use dba; require_once 'include/dba.php'; diff --git a/src/Util/HTTPSignature.php b/src/Util/HTTPSignature.php index a91b6b37e3..c3a45205c3 100644 --- a/src/Util/HTTPSignature.php +++ b/src/Util/HTTPSignature.php @@ -6,16 +6,14 @@ namespace Friendica\Util; use Friendica\Core\Config; +use Friendica\Database\dba; use Friendica\Database\DBM; -use Friendica\Util\Crypto; -use Friendica\Util\HTTPHeaders; -use dba; /** * @brief Implements HTTP Signatures per draft-cavage-http-signatures-07. * * Ported from Hubzilla: https://framagit.org/hubzilla/core/blob/master/Zotlabs/Web/HTTPSig.php - * + * * @see https://tools.ietf.org/html/draft-cavage-http-signatures-07 */ @@ -26,13 +24,13 @@ class HTTPSignature * * Disabled until Friendica's ActivityPub implementation * is ready. - * + * * @see https://tools.ietf.org/html/rfc5843 * * @param string $body The value to create the digest for * @param boolean $set (optional, default true) * If set send a Digest HTTP header - * + * * @return string The generated digest of $body */ // public static function generateDigest($body, $set = true) @@ -174,7 +172,7 @@ class HTTPSignature /** * Fetch the public key for Activity Pub contact. - * + * * @param string|int The identifier (contact addr or contact ID). * @return string|boolean The public key or false on failure. */ @@ -222,7 +220,7 @@ class HTTPSignature * @param string $alg (optional, default 'sha256') * @param string $crypt_key (optional, default null) * @param string $crypt_algo (optional, default 'aes256ctr') - * + * * @return array */ public static function createSig($request, $head, $prvkey, $keyid = 'Key', $send_headers = false, $auth = false, $alg = 'sha256', $crypt_key = null, $crypt_algo = 'aes256ctr') @@ -285,7 +283,7 @@ class HTTPSignature * @param array $head * @param string $prvkey * @param string $alg (optional) default 'sha256' - * + * * @return array */ private static function sign($request, $head, $prvkey, $alg = 'sha256') @@ -315,7 +313,7 @@ class HTTPSignature $ret['headers'] = $fields; $ret['signature'] = $sig; - + return $ret; } @@ -367,7 +365,7 @@ class HTTPSignature * * @param string $header * @param string $prvkey (optional), if not set use site private key - * + * * @return array|string associative array, empty string if failue * - \e string \b iv * - \e string \b key diff --git a/src/Util/ParseUrl.php b/src/Util/ParseUrl.php index 8fff3bcd87..80761032e9 100644 --- a/src/Util/ParseUrl.php +++ b/src/Util/ParseUrl.php @@ -5,15 +5,12 @@ */ namespace Friendica\Util; +use DOMDocument; +use DOMXPath; use Friendica\Content\OEmbed; use Friendica\Core\Addon; +use Friendica\Database\dba; use Friendica\Object\Image; -use Friendica\Util\Network; -use Friendica\Util\XML; - -use dba; -use DOMXPath; -use DOMDocument; require_once 'include/dba.php'; diff --git a/src/Worker/Cron.php b/src/Worker/Cron.php index a0dfda3309..df7a18a179 100644 --- a/src/Worker/Cron.php +++ b/src/Worker/Cron.php @@ -4,12 +4,13 @@ */ namespace Friendica\Worker; +use Friendica\BaseObject; use Friendica\Core\Addon; use Friendica\Core\Config; use Friendica\Core\Worker; +use Friendica\Database\dba; use Friendica\Database\DBM; use Friendica\Util\DateTimeFormat; -use dba; require_once 'include/dba.php'; @@ -17,7 +18,7 @@ class Cron { public static function execute($parameter = '', $generation = 0) { - $a = \Friendica\BaseObject::getApp(); + $a = BaseObject::getApp(); // Poll contacts with specific parameters if (!empty($parameter)) { diff --git a/src/Worker/CronJobs.php b/src/Worker/CronJobs.php index 8b9d3b9bcf..6454be3e58 100644 --- a/src/Worker/CronJobs.php +++ b/src/Worker/CronJobs.php @@ -5,8 +5,10 @@ namespace Friendica\Worker; use Friendica\App; +use Friendica\BaseObject; use Friendica\Core\Cache; use Friendica\Core\Config; +use Friendica\Database\dba; use Friendica\Database\DBM; use Friendica\Database\PostUpdate; use Friendica\Model\Contact; @@ -15,7 +17,6 @@ use Friendica\Model\Photo; use Friendica\Model\User; use Friendica\Network\Probe; use Friendica\Protocol\PortableContact; -use dba; require_once 'include/dba.php'; require_once 'mod/nodeinfo.php'; @@ -24,7 +25,7 @@ class CronJobs { public static function execute($command = '') { - $a = \Friendica\BaseObject::getApp(); + $a = BaseObject::getApp(); // No parameter set? So return if ($command == '') { diff --git a/src/Worker/DBClean.php b/src/Worker/DBClean.php index 7a0b1f8473..05955167f3 100644 --- a/src/Worker/DBClean.php +++ b/src/Worker/DBClean.php @@ -8,7 +8,7 @@ namespace Friendica\Worker; use Friendica\Core\Config; use Friendica\Core\Worker; -use dba; +use Friendica\Database\dba; require_once 'include/dba.php'; diff --git a/src/Worker/Delivery.php b/src/Worker/Delivery.php index b2781d5874..13ecc3ad44 100644 --- a/src/Worker/Delivery.php +++ b/src/Worker/Delivery.php @@ -8,6 +8,7 @@ use Friendica\BaseObject; use Friendica\Core\Config; use Friendica\Core\L10n; use Friendica\Core\System; +use Friendica\Database\dba; use Friendica\Database\DBM; use Friendica\Model\Contact; use Friendica\Model\Item; @@ -16,7 +17,6 @@ use Friendica\Model\User; use Friendica\Protocol\DFRN; use Friendica\Protocol\Diaspora; use Friendica\Protocol\Email; -use dba; require_once 'include/items.php'; diff --git a/src/Worker/DiscoverPoCo.php b/src/Worker/DiscoverPoCo.php index c77830d60a..2e36ab514d 100644 --- a/src/Worker/DiscoverPoCo.php +++ b/src/Worker/DiscoverPoCo.php @@ -7,13 +7,13 @@ namespace Friendica\Worker; use Friendica\Core\Cache; use Friendica\Core\Config; use Friendica\Core\Worker; +use Friendica\Database\dba; use Friendica\Database\DBM; use Friendica\Model\GContact; use Friendica\Network\Probe; use Friendica\Protocol\PortableContact; use Friendica\Util\DateTimeFormat; use Friendica\Util\Network; -use dba; class DiscoverPoCo { diff --git a/src/Worker/Expire.php b/src/Worker/Expire.php index a4342722d5..1d4efb29cd 100644 --- a/src/Worker/Expire.php +++ b/src/Worker/Expire.php @@ -6,12 +6,13 @@ namespace Friendica\Worker; +use Friendica\BaseObject; use Friendica\Core\Addon; use Friendica\Core\Config; use Friendica\Core\Worker; +use Friendica\Database\dba; use Friendica\Database\DBM; use Friendica\Model\Item; -use dba; require_once 'include/dba.php'; @@ -19,7 +20,7 @@ class Expire { public static function execute($param = '', $hook_name = '') { - $a = \Friendica\BaseObject::getApp(); + $a = BaseObject::getApp(); require_once 'include/items.php'; diff --git a/src/Worker/Notifier.php b/src/Worker/Notifier.php index 385892f991..986ade27bf 100644 --- a/src/Worker/Notifier.php +++ b/src/Worker/Notifier.php @@ -4,21 +4,21 @@ */ namespace Friendica\Worker; +use Friendica\BaseObject; use Friendica\Core\Addon; use Friendica\Core\Config; use Friendica\Core\Worker; +use Friendica\Database\dba; use Friendica\Database\DBM; use Friendica\Model\Contact; use Friendica\Model\Group; use Friendica\Model\Item; -use Friendica\Model\User; use Friendica\Model\PushSubscriber; +use Friendica\Model\User; use Friendica\Network\Probe; use Friendica\Protocol\Diaspora; use Friendica\Protocol\OStatus; use Friendica\Protocol\Salmon; -use Friendica\Worker\Delivery; -use dba; require_once 'include/dba.php'; require_once 'include/items.php'; @@ -52,7 +52,7 @@ class Notifier { public static function execute($cmd, $item_id) { - $a = \Friendica\BaseObject::getApp(); + $a = BaseObject::getApp(); logger('notifier: invoked: '.$cmd.': '.$item_id, LOGGER_DEBUG); diff --git a/src/Worker/OnePoll.php b/src/Worker/OnePoll.php index 951a20b012..7704c3826a 100644 --- a/src/Worker/OnePoll.php +++ b/src/Worker/OnePoll.php @@ -4,9 +4,11 @@ */ namespace Friendica\Worker; +use Friendica\BaseObject; use Friendica\Content\Text\BBCode; use Friendica\Core\Config; use Friendica\Core\PConfig; +use Friendica\Database\dba; use Friendica\Database\DBM; use Friendica\Model\Contact; use Friendica\Model\Item; @@ -15,7 +17,6 @@ use Friendica\Protocol\PortableContact; use Friendica\Util\DateTimeFormat; use Friendica\Util\Network; use Friendica\Util\XML; -use dba; require_once 'include/dba.php'; @@ -23,7 +24,7 @@ class OnePoll { public static function execute($contact_id = 0, $command = '') { - $a = \Friendica\BaseObject::getApp(); + $a = BaseObject::getApp(); require_once 'include/items.php'; diff --git a/src/Worker/PubSubPublish.php b/src/Worker/PubSubPublish.php index b90fc11a49..50f01e294e 100644 --- a/src/Worker/PubSubPublish.php +++ b/src/Worker/PubSubPublish.php @@ -5,13 +5,13 @@ namespace Friendica\Worker; -use Friendica\App; +use Friendica\BaseObject; use Friendica\Core\System; +use Friendica\Database\dba; use Friendica\Database\DBM; +use Friendica\Model\PushSubscriber; use Friendica\Protocol\OStatus; use Friendica\Util\Network; -use Friendica\Model\PushSubscriber; -use dba; require_once 'include/items.php'; @@ -28,7 +28,7 @@ class PubSubPublish private static function publish($id) { - $a = \Friendica\BaseObject::getApp(); + $a = BaseObject::getApp(); $subscriber = dba::selectFirst('push_subscriber', [], ['id' => $id]); if (!DBM::is_result($subscriber)) { diff --git a/src/Worker/Queue.php b/src/Worker/Queue.php index 1ec4090565..53d93ba910 100644 --- a/src/Worker/Queue.php +++ b/src/Worker/Queue.php @@ -8,15 +8,15 @@ use Friendica\Core\Addon; use Friendica\Core\Cache; use Friendica\Core\Config; use Friendica\Core\Worker; +use Friendica\Database\dba; use Friendica\Database\DBM; -use Friendica\Model\Queue as QueueModel; use Friendica\Model\PushSubscriber; +use Friendica\Model\Queue as QueueModel; use Friendica\Model\User; use Friendica\Protocol\DFRN; use Friendica\Protocol\Diaspora; use Friendica\Protocol\PortableContact; use Friendica\Protocol\Salmon; -use dba; require_once 'include/dba.php'; require_once 'include/items.php'; diff --git a/src/Worker/RemoveContact.php b/src/Worker/RemoveContact.php index 9a7a257770..aa2325d549 100644 --- a/src/Worker/RemoveContact.php +++ b/src/Worker/RemoveContact.php @@ -5,8 +5,7 @@ */ namespace Friendica\Worker; -use Friendica\Core\Config; -use dba; +use Friendica\Database\dba; require_once 'include/dba.php'; diff --git a/src/Worker/TagUpdate.php b/src/Worker/TagUpdate.php index 1ecc4b5e9b..6db06380c8 100644 --- a/src/Worker/TagUpdate.php +++ b/src/Worker/TagUpdate.php @@ -2,7 +2,7 @@ namespace Friendica\Worker; -use dba; +use Friendica\Database\dba; class TagUpdate { diff --git a/tests/DatabaseTest.php b/tests/DatabaseTest.php index 579e45084d..9f0990a72d 100644 --- a/tests/DatabaseTest.php +++ b/tests/DatabaseTest.php @@ -5,12 +5,11 @@ namespace Friendica\Test; -use dba; -use Friendica\Database\DBStructure; -use PHPUnit_Extensions_Database_DB_IDatabaseConnection; +use Friendica\Database\dba; use PHPUnit\DbUnit\DataSet\YamlDataSet; use PHPUnit\DbUnit\TestCaseTrait; use PHPUnit\Framework\TestCase; +use PHPUnit_Extensions_Database_DB_IDatabaseConnection; /** * Abstract class used by tests that need a database. diff --git a/tests/src/Core/Lock/DatabaseLockDriverTest.php b/tests/src/Core/Lock/DatabaseLockDriverTest.php index f55ab0f9e2..1fd728888e 100644 --- a/tests/src/Core/Lock/DatabaseLockDriverTest.php +++ b/tests/src/Core/Lock/DatabaseLockDriverTest.php @@ -2,12 +2,8 @@ namespace Friendica\Test\src\Core\Lock; -use dba; use Friendica\Core\Lock\DatabaseLockDriver; -use Friendica\Database\DBStructure; -use PHPUnit\DbUnit\DataSet\YamlDataSet; -use PHPUnit\DbUnit\TestCaseTrait; -use PHPUnit_Extensions_Database_DB_IDatabaseConnection; +use Friendica\Database\dba; class DatabaseLockDriverTest extends LockTest { diff --git a/update.php b/update.php index ca427186d4..47055852ca 100644 --- a/update.php +++ b/update.php @@ -2,13 +2,14 @@ use Friendica\Core\Addon; use Friendica\Core\Config; +use Friendica\Core\L10n; use Friendica\Core\PConfig; use Friendica\Core\Worker; +use Friendica\Database\dba; use Friendica\Database\DBM; use Friendica\Model\Contact; use Friendica\Model\Item; use Friendica\Model\User; -use Friendica\Core\L10n; require_once 'include/dba.php';