mirror of
https://github.com/friendica/friendica
synced 2024-10-13 13:14:44 +02:00
add missing namespaces/fix wrong class-names
This commit is contained in:
parent
3b16829484
commit
174129af94
|
@ -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__);
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
||||
/**
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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';
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue