Merge pull request #649 from MrPetovan/task/5410-move-dba-to-src

[multiple] Move \dba to \Friendica\Database\dba
pull/651/head
Michael Vogel 2018-07-20 06:50:49 +02:00 committed by GitHub
commit 18e43c0138
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 35 additions and 16 deletions

View File

@ -34,15 +34,22 @@
*/ */
use Friendica\App; use Friendica\App;
use Friendica\Content\Text\Markdown;
use Friendica\Core\Addon; use Friendica\Core\Addon;
use Friendica\Core\Cache;
use Friendica\Core\L10n; use Friendica\Core\L10n;
use Friendica\Core\System; use Friendica\Core\System;
use Friendica\Database\dba;
use Friendica\Database\DBM;
use Friendica\Database\DBStructure; use Friendica\Database\DBStructure;
use Friendica\Model\Item;
use Friendica\Model\Term;
use Friendica\Module\Login;
use Friendica\Network\HTTPException; use Friendica\Network\HTTPException;
use Friendica\Util\DateTimeFormat;
use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface; use Psr\Http\Message\ServerRequestInterface;
use Symfony\Component\ExpressionLanguage; use Symfony\Component\ExpressionLanguage;
use Friendica\Model\Item;
require_once 'boot.php'; require_once 'boot.php';
require_once 'include/conversation.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; $vars[str_replace('-', '_', $key)] = $value;
} }
$rules = Friendica\Core\Cache::get('rules_' . local_user()); $rules = Cache::get('rules_' . local_user());
if (!isset($rules)) { if (!isset($rules)) {
$rules = dba::inArray(dba::select( $rules = dba::inArray(dba::select(
'advancedcontentfilter_rules', 'advancedcontentfilter_rules',
@ -179,7 +186,7 @@ function advancedcontentfilter_init(App $a)
function advancedcontentfilter_content(App $a) function advancedcontentfilter_content(App $a)
{ {
if (!local_user()) { 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') { if ($a->argc > 0 && $a->argv[1] == 'help') {
@ -194,7 +201,7 @@ function advancedcontentfilter_content(App $a)
$content = file_get_contents($help_path); $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); $html = str_replace('code>', 'key>', $html);
@ -332,7 +339,7 @@ function advancedcontentfilter_post_rules(ServerRequestInterface $request)
} }
$fields['uid'] = local_user(); $fields['uid'] = local_user();
$fields['created'] = \Friendica\Util\DateTimeFormat::utcNow(); $fields['created'] = DateTimeFormat::utcNow();
if (!dba::insert('advancedcontentfilter_rules', $fields)) { if (!dba::insert('advancedcontentfilter_rules', $fields)) {
throw new HTTPException\ServiceUnavaiableException(dba::errorMessage()); throw new HTTPException\ServiceUnavaiableException(dba::errorMessage());
@ -407,11 +414,11 @@ function advancedcontentfilter_get_variables_guid(ServerRequestInterface $reques
$params = ['order' => ['uid' => true]]; $params = ['order' => ['uid' => true]];
$item = Item::selectFirstForUser(local_user(), [], $condition, $params); $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'])); 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['tags'] = $tags['tags'];
$item['hashtags'] = $tags['hashtags']; $item['hashtags'] = $tags['hashtags'];

View File

@ -13,6 +13,7 @@ use Friendica\Core\Addon;
use Friendica\Core\Config; use Friendica\Core\Config;
use Friendica\Core\L10n; use Friendica\Core\L10n;
use Friendica\Core\PConfig; use Friendica\Core\PConfig;
use Friendica\Database\dba;
use Friendica\Model\ItemContent; use Friendica\Model\ItemContent;
function buffer_install() { function buffer_install() {

View File

@ -5,17 +5,18 @@
* Version: 1.1 * Version: 1.1
* Author: Fabio <https://kirgroup.com/profile/fabrixxm> * Author: Fabio <https://kirgroup.com/profile/fabrixxm>
*/ */
use Friendica\App; use Friendica\App;
use Friendica\Core\Addon; use Friendica\Core\Addon;
use Friendica\Core\Config; use Friendica\Core\Config;
use Friendica\Core\L10n; use Friendica\Core\L10n;
use Friendica\Core\Worker;
use Friendica\Core\PConfig; use Friendica\Core\PConfig;
use Friendica\Util\DateTimeFormat; use Friendica\Core\Worker;
use Friendica\Network\HTTPException\NotFoundException; use Friendica\Database\dba;
use Friendica\Database\DBM;
use Friendica\Model\Contact; use Friendica\Model\Contact;
use Friendica\Model\Photo; use Friendica\Model\Photo;
use Friendica\Database\DBM; use Friendica\Network\HTTPException\NotFoundException;
define("CATAVATAR_SIZE", 256); define("CATAVATAR_SIZE", 256);

View File

@ -13,6 +13,7 @@ use Friendica\Content\Text\BBCode;
use Friendica\Core\Addon; use Friendica\Core\Addon;
use Friendica\Core\L10n; use Friendica\Core\L10n;
use Friendica\Core\PConfig; use Friendica\Core\PConfig;
use Friendica\Database\dba;
use Friendica\Database\DBM; use Friendica\Database\DBM;
use Friendica\Model\Queue; use Friendica\Model\Queue;

View File

@ -14,6 +14,7 @@ use Friendica\App;
use Friendica\Core\Addon; use Friendica\Core\Addon;
use Friendica\Core\L10n; use Friendica\Core\L10n;
use Friendica\Core\PConfig; use Friendica\Core\PConfig;
use Friendica\Database\dba;
use Friendica\Database\DBM; use Friendica\Database\DBM;
use Friendica\Model\Item; use Friendica\Model\Item;

View File

@ -10,6 +10,7 @@ use Friendica\Content\Text\BBCode;
use Friendica\Core\Addon; use Friendica\Core\Addon;
use Friendica\Core\L10n; use Friendica\Core\L10n;
use Friendica\Core\PConfig; use Friendica\Core\PConfig;
use Friendica\Database\dba;
use Friendica\Util\Network; use Friendica\Util\Network;
function libertree_install() { function libertree_install() {

View File

@ -9,6 +9,7 @@
use Friendica\Core\Addon; use Friendica\Core\Addon;
use Friendica\Core\Config; use Friendica\Core\Config;
use Friendica\Core\L10n; use Friendica\Core\L10n;
use Friendica\Database\dba;
use Friendica\Database\DBM; use Friendica\Database\DBM;
use Friendica\Util\DateTimeFormat; use Friendica\Util\DateTimeFormat;

View File

@ -13,6 +13,8 @@ use Friendica\Core\Config;
use Friendica\Core\L10n; use Friendica\Core\L10n;
use Friendica\Core\PConfig; use Friendica\Core\PConfig;
use Friendica\Core\Worker; use Friendica\Core\Worker;
use Friendica\Database\dba;
use Friendica\Database\DBM;
use Friendica\Model\Contact; use Friendica\Model\Contact;
use Friendica\Model\GContact; use Friendica\Model\GContact;
use Friendica\Model\Group; use Friendica\Model\Group;
@ -21,7 +23,6 @@ use Friendica\Model\Queue;
use Friendica\Model\User; use Friendica\Model\User;
use Friendica\Util\DateTimeFormat; use Friendica\Util\DateTimeFormat;
use Friendica\Util\Network; use Friendica\Util\Network;
use Friendica\Database\DBM;
require 'addon/pumpio/oauth/http.php'; require 'addon/pumpio/oauth/http.php';
require 'addon/pumpio/oauth/oauth_client.php'; require 'addon/pumpio/oauth/oauth_client.php';

View File

@ -47,6 +47,8 @@ use Friendica\Core\Addon;
use Friendica\Core\Config; use Friendica\Core\Config;
use Friendica\Core\L10n; use Friendica\Core\L10n;
use Friendica\Core\PConfig; use Friendica\Core\PConfig;
use Friendica\Database\dba;
use Friendica\Database\DBM;
use Friendica\Model\GContact; use Friendica\Model\GContact;
use Friendica\Model\Group; use Friendica\Model\Group;
use Friendica\Model\Item; use Friendica\Model\Item;
@ -55,7 +57,6 @@ use Friendica\Model\Photo;
use Friendica\Model\User; use Friendica\Model\User;
use Friendica\Util\DateTimeFormat; use Friendica\Util\DateTimeFormat;
use Friendica\Util\Network; use Friendica\Util\Network;
use Friendica\Database\DBM;
function statusnet_install() function statusnet_install()
{ {

View File

@ -14,6 +14,7 @@ use Friendica\Core\Addon;
use Friendica\Core\Config; use Friendica\Core\Config;
use Friendica\Core\L10n; use Friendica\Core\L10n;
use Friendica\Core\PConfig; use Friendica\Core\PConfig;
use Friendica\Database\dba;
function tumblr_install() { function tumblr_install() {
Addon::registerHook('post_local', 'addon/tumblr/tumblr.php', 'tumblr_post_local'); Addon::registerHook('post_local', 'addon/tumblr/tumblr.php', 'tumblr_post_local');

View File

@ -71,8 +71,10 @@ use Friendica\Core\Config;
use Friendica\Core\L10n; use Friendica\Core\L10n;
use Friendica\Core\PConfig; use Friendica\Core\PConfig;
use Friendica\Core\Worker; use Friendica\Core\Worker;
use Friendica\Model\GContact; use Friendica\Database\dba;
use Friendica\Database\DBM;
use Friendica\Model\Contact; use Friendica\Model\Contact;
use Friendica\Model\GContact;
use Friendica\Model\Group; use Friendica\Model\Group;
use Friendica\Model\Item; use Friendica\Model\Item;
use Friendica\Model\ItemContent; use Friendica\Model\ItemContent;
@ -81,7 +83,6 @@ use Friendica\Model\User;
use Friendica\Object\Image; use Friendica\Object\Image;
use Friendica\Util\DateTimeFormat; use Friendica\Util\DateTimeFormat;
use Friendica\Util\Network; use Friendica\Util\Network;
use Friendica\Database\DBM;
require_once 'boot.php'; require_once 'boot.php';
require_once 'include/dba.php'; require_once 'include/dba.php';

View File

@ -32,8 +32,9 @@ use Friendica\Content\Text\HTML;
use Friendica\Core\Addon; use Friendica\Core\Addon;
use Friendica\Core\L10n; use Friendica\Core\L10n;
use Friendica\Core\PConfig; use Friendica\Core\PConfig;
use Friendica\Model\User; use Friendica\Database\dba;
use Friendica\Model\Item; use Friendica\Model\Item;
use Friendica\Model\User;
function windowsphonepush_install() function windowsphonepush_install()
{ {

View File

@ -11,6 +11,7 @@ use Friendica\Content\Text\HTML;
use Friendica\Core\Addon; use Friendica\Core\Addon;
use Friendica\Core\L10n; use Friendica\Core\L10n;
use Friendica\Core\PConfig; use Friendica\Core\PConfig;
use Friendica\Database\dba;
use Friendica\Util\Network; use Friendica\Util\Network;
function wppost_install() { function wppost_install() {