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)) {
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;
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;
$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']];
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
*
* @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" => []];
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;
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;
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;
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;
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;
// 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);
/**
* @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;
/**
* @file mod/attach.php
*/
+
use Friendica\App;
use Friendica\Core\L10n;
+use Friendica\Database\dba;
use Friendica\Database\DBM;
require_once 'include/dba.php';
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;
/**
* @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;
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)
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;
/**
* @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;
/**
* @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;
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;
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;
/**
* @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;
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;
/**
* @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;
/**
* @file mod/dirfind.php
*/
+
use Friendica\App;
use Friendica\Content\ContactSelector;
use Friendica\Content\Widget;
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';
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;
use Friendica\App;
use Friendica\Core\L10n;
+use Friendica\Database\dba;
use Friendica\Model\Contact;
use Friendica\Protocol\Feed;
use Friendica\Util\Network;
* Author: Rabuzarus <https://github.com/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)
{
*/
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;
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;
'replyTo' => $a->user['email'],
'messageSubject' => $subject,
'htmlVersion' => $message,
- 'textVersion' => Friendica\Content\Text\HTML::toPlaintext($html.$disclaimer)
+ 'textVersion' => HTML::toPlaintext($html.$disclaimer)
];
Emailer::send($params);
}
*/
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;
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;
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;
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';
/**
* @file mod/noscrape.php
*/
+
use Friendica\App;
use Friendica\Core\System;
+use Friendica\Database\dba;
use Friendica\Database\DBM;
use Friendica\Model\Profile;
/**
* @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)
{
* @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)
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;
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;
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;
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;
<?php
use Friendica\App;
+use Friendica\Database\dba;
use Friendica\Database\DBM;
use Friendica\Protocol\OStatus;
use Friendica\App;
use Friendica\Core\Config;
use Friendica\Core\System;
+use Friendica\Database\dba;
use Friendica\Database\DBM;
-use Friendica\Util\Network;
use Friendica\Model\PushSubscriber;
+use Friendica\Util\Network;
function post_var($name) {
return (x($_POST, $name)) ? notags(trim($_POST[$name])) : '';
use Friendica\App;
use Friendica\Core\Config;
use Friendica\Core\System;
+use Friendica\Database\dba;
use Friendica\Database\DBM;
use Friendica\Protocol\Diaspora;
use Friendica\App;
use Friendica\Core\L10n;
use Friendica\Core\System;
+use Friendica\Database\dba;
use Friendica\Database\DBM;
use Friendica\Model\Contact;
use Friendica\Model\Profile;
use Friendica\Core\L10n;
use Friendica\Core\System;
use Friendica\Core\Worker;
+use Friendica\Database\dba;
use Friendica\Database\DBM;
use Friendica\Model\User;
use Friendica\Module\Login;
use Friendica\Core\Config;
use Friendica\Core\L10n;
use Friendica\Core\System;
+use Friendica\Database\dba;
use Friendica\Database\DBM;
use Friendica\Model\User;
/**
* @file mod/search.php
*/
+
use Friendica\App;
use Friendica\Content\Feature;
use Friendica\Content\Nav;
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\Core\System;
use Friendica\Core\Theme;
use Friendica\Core\Worker;
+use Friendica\Database\dba;
use Friendica\Database\DBM;
use Friendica\Model\Contact;
use Friendica\Model\GContact;
/**
* @file mod/suggest.php
*/
+
use Friendica\App;
use Friendica\Content\ContactSelector;
use Friendica\Content\Widget;
use Friendica\Core\L10n;
use Friendica\Core\System;
+use Friendica\Database\dba;
use Friendica\Database\DBM;
use Friendica\Model\Contact;
use Friendica\Model\GContact;
-use Friendica\Model\Profile;
function suggest_init(App $a) {
if (! local_user()) {
/**
* @file mod/unfollow.php
*/
+
use Friendica\App;
use Friendica\Core\L10n;
use Friendica\Core\System;
+use Friendica\Database\dba;
use Friendica\Database\DBM;
use Friendica\Model\Contact;
use Friendica\Model\Profile;
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\Mimetype;
use Friendica\Core\Config;
use Friendica\Core\Worker;
+use Friendica\Database\dba;
use Friendica\Util\DateTimeFormat;
function worker_init()
/**
* @file mod/xrd.php
*/
+
use Friendica\App;
use Friendica\Core\Addon;
use Friendica\Core\System;
+use Friendica\Database\dba;
use Friendica\Database\DBM;
use Friendica\Protocol\Salmon;
*/
namespace Friendica;
+use Detection\MobileDetect;
+use Exception;
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 dba;
-
-use Detection\MobileDetect;
-
-use Exception;
require_once 'boot.php';
require_once 'include/dba.php';
$this->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;
}
public function loadDatabase()
{
- if (\dba::connected()) {
+ if (dba::connected()) {
return;
}
$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');
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
*/
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';
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';
*/
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';
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';
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';
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
*/
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';
/**
* @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) {
namespace Friendica\Core\Cache;
-use dba;
use Friendica\Core\Cache;
+use Friendica\Database\dba;
use Friendica\Database\DBM;
use Friendica\Util\DateTimeFormat;
<?php
namespace Friendica\Core\Config;
-use dba;
use Friendica\BaseObject;
+use Friendica\Database\dba;
use Friendica\Database\DBM;
require_once 'include/dba.php';
<?php
namespace Friendica\Core\Config;
-use dba;
use Friendica\BaseObject;
+use Friendica\Database\dba;
use Friendica\Database\DBM;
require_once 'include/dba.php';
namespace Friendica\Core\Config;
-use dba;
use Exception;
-use Friendica\App;
use Friendica\BaseObject;
+use Friendica\Database\dba;
use Friendica\Database\DBM;
require_once 'include/dba.php';
namespace Friendica\Core\Config;
-use dba;
use Exception;
-use Friendica\App;
use Friendica\BaseObject;
+use Friendica\Database\dba;
use Friendica\Database\DBM;
require_once 'include/dba.php';
namespace Friendica\Core\Console;
+use Friendica\App;
use Friendica\Core\L10n;
-use dba;
+use Friendica\Database\dba;
+use RuntimeException;
/**
* @brief tool to archive a contact on the server
}
if ($a->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;
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';
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';
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');
}
$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);
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');
}
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';
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();
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';
}
if ($a->isInstallMode()) {
- throw new \RuntimeException('Database isn\'t ready or populated yet');
+ throw new RuntimeException('Database isn\'t ready or populated yet');
}
/**
* */
$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;
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
}
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);
}
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.'));
*/
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';
* 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
namespace Friendica\Core\Lock;
-use dba;
use Friendica\Core\Cache;
+use Friendica\Database\dba;
use Friendica\Database\DBM;
use Friendica\Util\DateTimeFormat;
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';
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';
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";
*/
namespace Friendica\Core;
-use dba;
+use Friendica\Database\dba;
use Friendica\Database\DBM;
use Friendica\Model\Process;
use Friendica\Util\DateTimeFormat;
*/
namespace Friendica\Database;
-use dba;
use Friendica\Util\DateTimeFormat;
require_once 'include/dba.php';
*/
namespace Friendica\Database;
-use dba;
+use Exception;
+use Friendica\Core\Addon;
use Friendica\Core\Config;
use Friendica\Core\L10n;
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") {
]
];
- \Friendica\Core\Addon::callHooks('dbstructure_definition', $database);
+ Addon::callHooks('dbstructure_definition', $database);
return $database;
}
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';
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';
*/
namespace Friendica\Model;
+use Friendica\Database\dba;
use Friendica\Database\DBM;
-use dba;
require_once "include/dba.php";
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;
*/
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';
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';
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;
*/
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);
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';
*/
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.
{
/**
* 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)
/**
* 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)
/**
* Purge entries of a verify-type older than interval.
- *
+ *
* @param string $type Verify type.
* @param string $interval SQL compatible time interval
*/
namespace Friendica\Model;
use Friendica\BaseObject;
+use Friendica\Database\dba;
use Friendica\Database\DBM;
-use dba;
require_once 'include/dba.php';
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';
namespace Friendica\Model;
use Friendica\BaseObject;
+use Friendica\Database\dba;
use Friendica\Util\DateTimeFormat;
-use dba;
require_once 'include/dba.php';
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';
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';
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';
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';
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;
use Friendica\BaseModule;
use Friendica\Core\System;
-use dba;
+use Friendica\Database\dba;
require_once 'include/dba.php';
require_once 'include/text.php';
*/
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';
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.
*
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
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;
namespace Friendica\Network;
use Friendica\Core\Config;
+use Friendica\Database\dba;
use Friendica\Database\DBM;
-use dba;
use OAuthConsumer;
use OAuthDataStore;
use OAuthToken;
* @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';
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';
*/
namespace Friendica\Protocol;
+use DOMDocument;
+use DOMXPath;
use Friendica\App;
use Friendica\Content\OEmbed;
use Friendica\Content\Text\BBCode;
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;
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;
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\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';
*/
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';
*/
namespace Friendica\Protocol;
-use dba;
use DOMDocument;
use DOMXPath;
use Friendica\Content\Text\BBCode;
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;
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';
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';
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
*/
*
* 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)
/**
* 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.
*/
* @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')
* @param array $head
* @param string $prvkey
* @param string $alg (optional) default 'sha256'
- *
+ *
* @return array
*/
private static function sign($request, $head, $prvkey, $alg = 'sha256')
$ret['headers'] = $fields;
$ret['signature'] = $sig;
-
+
return $ret;
}
*
* @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
*/
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';
*/
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';
{
public static function execute($parameter = '', $generation = 0)
{
- $a = \Friendica\BaseObject::getApp();
+ $a = BaseObject::getApp();
// Poll contacts with specific parameters
if (!empty($parameter)) {
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;
use Friendica\Model\User;
use Friendica\Network\Probe;
use Friendica\Protocol\PortableContact;
-use dba;
require_once 'include/dba.php';
require_once 'mod/nodeinfo.php';
{
public static function execute($command = '')
{
- $a = \Friendica\BaseObject::getApp();
+ $a = BaseObject::getApp();
// No parameter set? So return
if ($command == '') {
use Friendica\Core\Config;
use Friendica\Core\Worker;
-use dba;
+use Friendica\Database\dba;
require_once 'include/dba.php';
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;
use Friendica\Protocol\DFRN;
use Friendica\Protocol\Diaspora;
use Friendica\Protocol\Email;
-use dba;
require_once 'include/items.php';
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
{
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';
{
public static function execute($param = '', $hook_name = '')
{
- $a = \Friendica\BaseObject::getApp();
+ $a = BaseObject::getApp();
require_once 'include/items.php';
*/
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';
{
public static function execute($cmd, $item_id)
{
- $a = \Friendica\BaseObject::getApp();
+ $a = BaseObject::getApp();
logger('notifier: invoked: '.$cmd.': '.$item_id, LOGGER_DEBUG);
*/
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;
use Friendica\Util\DateTimeFormat;
use Friendica\Util\Network;
use Friendica\Util\XML;
-use dba;
require_once 'include/dba.php';
{
public static function execute($contact_id = 0, $command = '')
{
- $a = \Friendica\BaseObject::getApp();
+ $a = BaseObject::getApp();
require_once 'include/items.php';
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';
private static function publish($id)
{
- $a = \Friendica\BaseObject::getApp();
+ $a = BaseObject::getApp();
$subscriber = dba::selectFirst('push_subscriber', [], ['id' => $id]);
if (!DBM::is_result($subscriber)) {
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';
*/
namespace Friendica\Worker;
-use Friendica\Core\Config;
-use dba;
+use Friendica\Database\dba;
require_once 'include/dba.php';
namespace Friendica\Worker;
-use dba;
+use Friendica\Database\dba;
class TagUpdate
{
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.
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
{
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';