add missing namespaces/fix wrong class-names

This commit is contained in:
nupplaPhil 2020-01-19 16:29:55 +01:00
parent 3b16829484
commit 174129af94
No known key found for this signature in database
GPG Key ID: D8365C3D36B77D90
13 changed files with 20 additions and 4 deletions

View File

@ -181,6 +181,8 @@ Put your tpl files in the *templates/* subfolder of your addon.
In your code, like in the function addon_name_content(), load the template file and execute it passing needed values:
```php
use Friendica\Core\Renderer;
# load template file. first argument is the template name,
# second is the addon path relative to friendica top folder
$tpl = Renderer::getMarkupTemplate('mytemplate.tpl', __DIR__);

View File

@ -47,8 +47,10 @@ The code will be something like:
// mod/network.php
<?php
use Friendica\App;
function network_content(App $a) {
$itemsmanager = new Friendica\ItemsManager();
$itemsmanager = new \Friendica\ItemsManager();
$items = $itemsmanager->getAll();
// pass $items to template
@ -117,6 +119,8 @@ If your code is in same namespace as the class you need, you don't need to prepe
namespace Friendica;
use Friendica\Protocol\DFRN;
// this is the same content of current include/delivery.php,
// but has been declared to be in "Friendica" namespace

View File

@ -7,6 +7,7 @@ use Friendica\App;
use Friendica\Core\ACL;
use Friendica\Core\Worker;
use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Util\DateTimeFormat;
use Friendica\Util\Strings;
use Friendica\Worker\Delivery;

View File

@ -7,6 +7,7 @@ use Friendica\App;
use Friendica\Core\Config;
use Friendica\Core\Session;
use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Model\Attach;
use Friendica\Model\User;
use Friendica\Util\Strings;

View File

@ -8,6 +8,7 @@ use FastRoute\Dispatcher;
use FastRoute\RouteCollector;
use FastRoute\RouteParser\Std;
use Friendica\Core\Hook;
use Friendica\DI;
use Friendica\Network\HTTPException;
/**

View File

@ -9,6 +9,7 @@ use Exception;
use Friendica\Core\Config\Cache\ConfigCache;
use Friendica\Database\Database;
use Friendica\Database\DBStructure;
use Friendica\DI;
use Friendica\Util\Images;
use Friendica\Util\Network;
use Friendica\Util\Strings;

View File

@ -9,6 +9,7 @@ use Exception;
use Friendica\Core\Config;
use Friendica\Core\Hook;
use Friendica\Core\Logger;
use Friendica\DI;
use Friendica\Util\DateTimeFormat;
require_once __DIR__ . '/../../include/dba.php';

View File

@ -342,7 +342,7 @@ class Contact
* @param integer $uid User ID
*
* @return integer|boolean Public contact id for given user id
* @throws Exception
* @throws \Exception
*/
public static function getPublicIdByUserId($uid)
{

View File

@ -4,6 +4,7 @@ namespace Friendica\Module;
use Friendica\BaseModule;
use Friendica\Core\Renderer;
use Friendica\DI;
/**
* Show a credits page for all the developers who helped with the project

View File

@ -5,6 +5,7 @@ namespace Friendica\Module\Debug;
use Friendica\BaseModule;
use Friendica\Content\Text;
use Friendica\Core\Renderer;
use Friendica\DI;
use Friendica\Model\Item;
use Friendica\Util\XML;

View File

@ -9,6 +9,7 @@ use Friendica\Core\Logger;
use Friendica\Core\Protocol;
use Friendica\Core\Search;
use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Model\Contact;
use Friendica\Model\Item;
use Friendica\Network\HTTPException;

View File

@ -209,7 +209,7 @@ class UserExport extends BaseSettingsModule
* echoes account data and items as separated json, one per line
*
* @param App $a
* @throws Exception
* @throws \Exception
*/
private static function exportAll(App $a)
{

View File

@ -2,6 +2,8 @@
namespace Friendica\Test\Util;
use Friendica\Core\Cache\Duration;
trait DbaCacheMockTrait
{
/**
@ -30,7 +32,7 @@ trait DbaCacheMockTrait
$this->mockIsResult(['v' => $value], isset($return), $times);
}
protected function mockSet($key, $value, $ttl = Cache::FIVE_MINUTES, $time = null, $return = true, $times = null)
protected function mockSet($key, $value, $ttl = Duration::FIVE_MINUTES, $time = null, $return = true, $times = null)
{
if ($time === null) {
$time = time();