* LOGGER_DATA
* LOGGER_ALL
*
- * @global App $a
* @global array $LOGGER_LEVELS
* @param string $msg
* @param int $level
* LOGGER_DATA
* LOGGER_ALL
*
- * @global App $a
* @global array $LOGGER_LEVELS
* @param string $msg
* @param int $level
*/
-
function dlogger($msg, $level = 0) {
$a = get_app();
function update_table($table_name, $fields, $old_url, $new_url)
{
- global $a;
-
$dbold = dbesc($old_url);
$dbnew = dbesc($new_url);
* Checking the upstream version is optional (opt-in) and can be done to either
* the master or the develop branch in the repository.
*/
-class CheckVersion {
- public static function execute() {
- global $a;
-
+class CheckVersion
+{
+ public static function execute()
+ {
logger('checkversion: start');
$checkurl = Config::get('system', 'check_new_version_url', 'none');
require_once 'include/dba.php';
-Class Cron {
- public static function execute($parameter = '', $generation = 0) {
- global $a;
+class Cron
+{
+ public static function execute($parameter = '', $generation = 0)
+ {
+ $a = \Friendica\BaseObject::getApp();
// Poll contacts with specific parameters
if (!empty($parameter)) {
{
public static function execute($command = '')
{
- global $a;
+ $a = \Friendica\BaseObject::getApp();
// No parameter set? So return
if ($command == '') {
use Friendica\Core\Config;
-class DBUpdate {
- public static function execute() {
- $a = get_app();
+class DBUpdate
+{
+ public static function execute()
+ {
+ $a = \Friendica\BaseObject::getApp();
// We are deleting the latest dbupdate entry.
// This is done to avoid endless loops because the update was interupted.
use Friendica\Util\Network;
use dba;
-class DiscoverPoCo {
+class DiscoverPoCo
+{
/// @todo Clean up this mess of a parameter hell and split it in several classes
public static function execute($command = '', $param1 = '', $param2 = '', $param3 = '', $param4 = '')
{
// It is not removed since I hope that there will be a successor.
return false;
- $a = get_app();
-
$url = "http://gstools.org/api/users_search/".urlencode($search);
$result = Network::curl($url);
require_once 'include/dba.php';
-class Expire {
- public static function execute($param = '', $hook_name = '') {
- global $a;
+class Expire
+{
+ public static function execute($param = '', $hook_name = '')
+ {
+ $a = \Friendica\BaseObject::getApp();
require_once 'include/items.php';
use Friendica\Core\Addon;
-Class ForkHook {
- public static function execute($name, $hook, $data) {
- global $a;
+Class ForkHook
+{
+ public static function execute($name, $hook, $data)
+ {
+ $a = \Friendica\BaseObject::getApp();
Addon::callSingleHook($a, $name, $hook, $data);
}
* and ITEM_ID is the id of the item in the database that needs to be sent to others.
*/
-class Notifier {
- public static function execute($cmd, $item_id) {
- global $a;
+class Notifier
+{
+ public static function execute($cmd, $item_id)
+ {
+ $a = \Friendica\BaseObject::getApp();
logger('notifier: invoked: '.$cmd.': '.$item_id, LOGGER_DEBUG);
class OnePoll
{
- public static function execute($contact_id = 0, $command = '') {
- global $a;
+ public static function execute($contact_id = 0, $command = '')
+ {
+ $a = \Friendica\BaseObject::getApp();
require_once 'include/items.php';
return;
}
- private static function RemoveReply($subject) {
+ private static function RemoveReply($subject)
+ {
while (in_array(strtolower(substr($subject, 0, 3)), ["re:", "aw:"])) {
$subject = trim(substr($subject, 4));
}
* @param array $contact The personal contact entry
* @param array $fields The fields that are updated
*/
- private static function updateContact($contact, $fields) {
+ private static function updateContact($contact, $fields)
+ {
dba::update('contact', $fields, ['id' => $contact['id']]);
dba::update('contact', $fields, ['uid' => 0, 'nurl' => $contact['nurl']]);
}
require_once 'include/items.php';
-class PubSubPublish {
+class PubSubPublish
+{
public static function execute($pubsubpublish_id = 0)
{
if ($pubsubpublish_id == 0) {
self::publish($pubsubpublish_id);
}
- private static function publish($id) {
- global $a;
+ private static function publish($id)
+ {
+ $a = \Friendica\BaseObject::getApp();
$subscriber = dba::selectFirst('push_subscriber', [], ['id' => $id]);
if (!DBM::is_result($subscriber)) {
{
public static function execute($queue_id = 0)
{
- global $a;
-
$cachekey_deadguy = 'queue_run:deadguy:';
$cachekey_server = 'queue_run:server:';
{
public static function execute($contact_id)
{
- global $a;
-
logger('update_gcontact: start');
if (empty($contact_id)) {
namespace Friendica\Test;
-use Friendica\App;
use Friendica\Core\Config;
use Friendica\Core\PConfig;
-use Friendica\Network\BadRequestException;
+use Friendica\Core\Protocol;
+use Friendica\Core\System;
use Friendica\Network\HTTPException;
-use Friendica\Render\FriendicaSmarty;
/**
* Tests for the API functions.
*/
protected function setUp()
{
- global $a;
parent::setUp();
// Reusable App object
- $this->app = new App(__DIR__.'/../');
- $a = $this->app;
+ $this->app = \Friendica\BaseObject::getApp();
// User data that the test database is populated with
$this->selfUser = [
public function testApiFormatItemsEmbededImages()
{
$this->assertEquals(
- 'text ' . \Friendica\Core\System::baseUrl() . '/display/item_guid',
+ 'text ' . System::baseUrl() . '/display/item_guid',
api_format_items_embeded_images(['guid' => 'item_guid'], 'text data:image/foo')
);
}
'body' => '',
'verb' => '',
'author-id' => 43,
- 'author-network' => \Friendica\Core\Protocol::DFRN,
+ 'author-network' => Protocol::DFRN,
'author-link' => 'http://localhost/profile/othercontact',
'plink' => '',
]
'body' => '',
'verb' => '',
'author-id' => 43,
- 'author-network' => \Friendica\Core\Protocol::DFRN,
+ 'author-network' => Protocol::DFRN,
'author-link' => 'http://localhost/profile/othercontact',
'plink' => '',
]
$result = api_statusnet_config('json');
$this->assertEquals('localhost', $result['config']['site']['server']);
$this->assertEquals('default', $result['config']['site']['theme']);
- $this->assertEquals(\Friendica\Core\System::baseUrl() . '/images/friendica-64.png', $result['config']['site']['logo']);
+ $this->assertEquals(System::baseUrl() . '/images/friendica-64.png', $result['config']['site']['logo']);
$this->assertTrue($result['config']['site']['fancy']);
$this->assertEquals('en', $result['config']['site']['language']);
$this->assertEquals('UTC', $result['config']['site']['timezone']);
namespace Friendica\Test\src\Core\Cache;
-use Friendica\App;
use Friendica\Core\Config;
use Friendica\Test\DatabaseTest;
use Friendica\Util\DateTimeFormat;
protected function setUp()
{
- global $a;
parent::setUp();
$this->instance = $this->getInstance();
// Reusable App object
$this->app = \Friendica\BaseObject::getApp();
- $a = $this->app;
// Default config
Config::set('config', 'hostname', 'localhost');
namespace Friendica\Test\src\Core\Lock;
-use Friendica\App;
use Friendica\Core\Config;
use Friendica\Test\DatabaseTest;
-use PHPUnit\Framework\TestCase;
abstract class LockTest extends DatabaseTest
{
protected function setUp()
{
- global $a;
parent::setUp();
$this->instance = $this->getInstance();
// Reusable App object
$this->app = \Friendica\BaseObject::getApp();
- $a = $this->app;
// Default config
Config::set('config', 'hostname', 'localhost');