From abc76a42aed6b2f00e75f98117b114b841cc6a98 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Thu, 19 Jul 2018 22:18:02 -0400 Subject: [PATCH] [multiple] Move \dba to \Friendica\Database\dba - Updated use statement lists --- .../advancedcontentfilter.php | 21 ++++++++++++------- buffer/buffer.php | 1 + catavatar/catavatar.php | 9 ++++---- diaspora/diaspora.php | 1 + ifttt/ifttt.php | 1 + libertree/libertree.php | 1 + public_server/public_server.php | 1 + pumpio/pumpio.php | 3 ++- statusnet/statusnet.php | 3 ++- tumblr/tumblr.php | 1 + twitter/twitter.php | 5 +++-- windowsphonepush/windowsphonepush.php | 3 ++- wppost/wppost.php | 1 + 13 files changed, 35 insertions(+), 16 deletions(-) diff --git a/advancedcontentfilter/advancedcontentfilter.php b/advancedcontentfilter/advancedcontentfilter.php index eebec4b0..239f3d9f 100644 --- a/advancedcontentfilter/advancedcontentfilter.php +++ b/advancedcontentfilter/advancedcontentfilter.php @@ -34,15 +34,22 @@ */ use Friendica\App; +use Friendica\Content\Text\Markdown; use Friendica\Core\Addon; +use Friendica\Core\Cache; use Friendica\Core\L10n; use Friendica\Core\System; +use Friendica\Database\dba; +use Friendica\Database\DBM; use Friendica\Database\DBStructure; +use Friendica\Model\Item; +use Friendica\Model\Term; +use Friendica\Module\Login; use Friendica\Network\HTTPException; +use Friendica\Util\DateTimeFormat; use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ServerRequestInterface; use Symfony\Component\ExpressionLanguage; -use Friendica\Model\Item; require_once 'boot.php'; require_once 'include/conversation.php'; @@ -110,7 +117,7 @@ function advancedcontentfilter_prepare_body_content_filter(App $a, &$hook_data) $vars[str_replace('-', '_', $key)] = $value; } - $rules = Friendica\Core\Cache::get('rules_' . local_user()); + $rules = Cache::get('rules_' . local_user()); if (!isset($rules)) { $rules = dba::inArray(dba::select( 'advancedcontentfilter_rules', @@ -179,7 +186,7 @@ function advancedcontentfilter_init(App $a) function advancedcontentfilter_content(App $a) { if (!local_user()) { - return \Friendica\Module\Login::form('/' . implode('/', $a->argv)); + return Login::form('/' . implode('/', $a->argv)); } if ($a->argc > 0 && $a->argv[1] == 'help') { @@ -194,7 +201,7 @@ function advancedcontentfilter_content(App $a) $content = file_get_contents($help_path); - $html = \Friendica\Content\Text\Markdown::convert($content, false); + $html = Markdown::convert($content, false); $html = str_replace('code>', 'key>', $html); @@ -332,7 +339,7 @@ function advancedcontentfilter_post_rules(ServerRequestInterface $request) } $fields['uid'] = local_user(); - $fields['created'] = \Friendica\Util\DateTimeFormat::utcNow(); + $fields['created'] = DateTimeFormat::utcNow(); if (!dba::insert('advancedcontentfilter_rules', $fields)) { throw new HTTPException\ServiceUnavaiableException(dba::errorMessage()); @@ -407,11 +414,11 @@ function advancedcontentfilter_get_variables_guid(ServerRequestInterface $reques $params = ['order' => ['uid' => true]]; $item = Item::selectFirstForUser(local_user(), [], $condition, $params); - if (!\Friendica\Database\DBM::is_result($item)) { + if (!DBM::is_result($item)) { throw new HTTPException\NotFoundException(L10n::t('Unknown post with guid: %s', $args['guid'])); } - $tags = \Friendica\Model\Term::populateTagsFromItem($item); + $tags = Term::populateTagsFromItem($item); $item['tags'] = $tags['tags']; $item['hashtags'] = $tags['hashtags']; diff --git a/buffer/buffer.php b/buffer/buffer.php index 9d14fd83..0fef4848 100644 --- a/buffer/buffer.php +++ b/buffer/buffer.php @@ -13,6 +13,7 @@ use Friendica\Core\Addon; use Friendica\Core\Config; use Friendica\Core\L10n; use Friendica\Core\PConfig; +use Friendica\Database\dba; use Friendica\Model\ItemContent; function buffer_install() { diff --git a/catavatar/catavatar.php b/catavatar/catavatar.php index 72fc1e07..20291b5b 100644 --- a/catavatar/catavatar.php +++ b/catavatar/catavatar.php @@ -5,17 +5,18 @@ * Version: 1.1 * Author: Fabio */ + use Friendica\App; use Friendica\Core\Addon; use Friendica\Core\Config; use Friendica\Core\L10n; -use Friendica\Core\Worker; use Friendica\Core\PConfig; -use Friendica\Util\DateTimeFormat; -use Friendica\Network\HTTPException\NotFoundException; +use Friendica\Core\Worker; +use Friendica\Database\dba; +use Friendica\Database\DBM; use Friendica\Model\Contact; use Friendica\Model\Photo; -use Friendica\Database\DBM; +use Friendica\Network\HTTPException\NotFoundException; define("CATAVATAR_SIZE", 256); diff --git a/diaspora/diaspora.php b/diaspora/diaspora.php index 04d3c7ec..7f955ce3 100644 --- a/diaspora/diaspora.php +++ b/diaspora/diaspora.php @@ -13,6 +13,7 @@ use Friendica\Content\Text\BBCode; use Friendica\Core\Addon; use Friendica\Core\L10n; use Friendica\Core\PConfig; +use Friendica\Database\dba; use Friendica\Database\DBM; use Friendica\Model\Queue; diff --git a/ifttt/ifttt.php b/ifttt/ifttt.php index 48278d5c..ac79cc9a 100644 --- a/ifttt/ifttt.php +++ b/ifttt/ifttt.php @@ -14,6 +14,7 @@ use Friendica\App; use Friendica\Core\Addon; use Friendica\Core\L10n; use Friendica\Core\PConfig; +use Friendica\Database\dba; use Friendica\Database\DBM; use Friendica\Model\Item; diff --git a/libertree/libertree.php b/libertree/libertree.php index 4d159bf0..b1188e9a 100644 --- a/libertree/libertree.php +++ b/libertree/libertree.php @@ -10,6 +10,7 @@ use Friendica\Content\Text\BBCode; use Friendica\Core\Addon; use Friendica\Core\L10n; use Friendica\Core\PConfig; +use Friendica\Database\dba; use Friendica\Util\Network; function libertree_install() { diff --git a/public_server/public_server.php b/public_server/public_server.php index 0469a576..9e566641 100644 --- a/public_server/public_server.php +++ b/public_server/public_server.php @@ -9,6 +9,7 @@ use Friendica\Core\Addon; use Friendica\Core\Config; use Friendica\Core\L10n; +use Friendica\Database\dba; use Friendica\Database\DBM; use Friendica\Util\DateTimeFormat; diff --git a/pumpio/pumpio.php b/pumpio/pumpio.php index 479da7d0..be8d6f8a 100644 --- a/pumpio/pumpio.php +++ b/pumpio/pumpio.php @@ -13,6 +13,8 @@ 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\GContact; use Friendica\Model\Group; @@ -21,7 +23,6 @@ use Friendica\Model\Queue; use Friendica\Model\User; use Friendica\Util\DateTimeFormat; use Friendica\Util\Network; -use Friendica\Database\DBM; require 'addon/pumpio/oauth/http.php'; require 'addon/pumpio/oauth/oauth_client.php'; diff --git a/statusnet/statusnet.php b/statusnet/statusnet.php index 62c3f41b..36534d73 100644 --- a/statusnet/statusnet.php +++ b/statusnet/statusnet.php @@ -47,6 +47,8 @@ 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\GContact; use Friendica\Model\Group; use Friendica\Model\Item; @@ -55,7 +57,6 @@ use Friendica\Model\Photo; use Friendica\Model\User; use Friendica\Util\DateTimeFormat; use Friendica\Util\Network; -use Friendica\Database\DBM; function statusnet_install() { diff --git a/tumblr/tumblr.php b/tumblr/tumblr.php index 9617a3a0..6026e9b1 100644 --- a/tumblr/tumblr.php +++ b/tumblr/tumblr.php @@ -14,6 +14,7 @@ use Friendica\Core\Addon; use Friendica\Core\Config; use Friendica\Core\L10n; use Friendica\Core\PConfig; +use Friendica\Database\dba; function tumblr_install() { Addon::registerHook('post_local', 'addon/tumblr/tumblr.php', 'tumblr_post_local'); diff --git a/twitter/twitter.php b/twitter/twitter.php index b17cf61a..3ff70ecc 100644 --- a/twitter/twitter.php +++ b/twitter/twitter.php @@ -71,8 +71,10 @@ use Friendica\Core\Config; use Friendica\Core\L10n; use Friendica\Core\PConfig; use Friendica\Core\Worker; -use Friendica\Model\GContact; +use Friendica\Database\dba; +use Friendica\Database\DBM; use Friendica\Model\Contact; +use Friendica\Model\GContact; use Friendica\Model\Group; use Friendica\Model\Item; use Friendica\Model\ItemContent; @@ -81,7 +83,6 @@ use Friendica\Model\User; use Friendica\Object\Image; use Friendica\Util\DateTimeFormat; use Friendica\Util\Network; -use Friendica\Database\DBM; require_once 'boot.php'; require_once 'include/dba.php'; diff --git a/windowsphonepush/windowsphonepush.php b/windowsphonepush/windowsphonepush.php index dd461ea4..725e8980 100644 --- a/windowsphonepush/windowsphonepush.php +++ b/windowsphonepush/windowsphonepush.php @@ -32,8 +32,9 @@ use Friendica\Content\Text\HTML; use Friendica\Core\Addon; use Friendica\Core\L10n; use Friendica\Core\PConfig; -use Friendica\Model\User; +use Friendica\Database\dba; use Friendica\Model\Item; +use Friendica\Model\User; function windowsphonepush_install() { diff --git a/wppost/wppost.php b/wppost/wppost.php index a2c11293..caa355e8 100644 --- a/wppost/wppost.php +++ b/wppost/wppost.php @@ -11,6 +11,7 @@ use Friendica\Content\Text\HTML; use Friendica\Core\Addon; use Friendica\Core\L10n; use Friendica\Core\PConfig; +use Friendica\Database\dba; use Friendica\Util\Network; function wppost_install() { -- 2.39.5