[CORE][Router] Rename \App\Core\Router\Router to \App\Core\Router and merge \App\Core\Router\RouteLoader with \App\Core\Router
This commit is contained in:
parent
60af9f5e9b
commit
483983790a
@ -25,7 +25,7 @@ use App\Core\Cache;
|
||||
use App\Core\DB;
|
||||
use App\Core\Event;
|
||||
use App\Core\Modules\Component;
|
||||
use App\Core\Router\RouteLoader;
|
||||
use App\Core\Router;
|
||||
use App\Entity\Actor;
|
||||
use App\Entity\Note;
|
||||
use App\Util\Formatting;
|
||||
@ -37,7 +37,7 @@ use Doctrine\ORM\QueryBuilder;
|
||||
|
||||
class Attachment extends Component
|
||||
{
|
||||
public function onAddRoute(RouteLoader $r): bool
|
||||
public function onAddRoute(Router $r): bool
|
||||
{
|
||||
$r->connect('note_attachment_show', '/object/note/{note_id<\d+>}/attachment/{attachment_id<\d+>}', [C\Attachment::class, 'attachmentShowWithNote']);
|
||||
$r->connect('note_attachment_view', '/object/note/{note_id<\d+>}/attachment/{attachment_id<\d+>}/view', [C\Attachment::class, 'attachmentViewWithNote']);
|
||||
|
@ -30,7 +30,7 @@ use App\Core\Event;
|
||||
use App\Core\GSFile;
|
||||
use function App\Core\I18n\_m;
|
||||
use App\Core\Log;
|
||||
use App\Core\Router\Router;
|
||||
use App\Core\Router;
|
||||
use App\Entity\Note;
|
||||
use App\Util\Common;
|
||||
use App\Util\Exception\ClientException;
|
||||
|
@ -29,7 +29,7 @@ use App\Core\Entity;
|
||||
use App\Core\Event;
|
||||
use App\Core\GSFile;
|
||||
use App\Core\Log;
|
||||
use App\Core\Router\Router;
|
||||
use App\Core\Router;
|
||||
use App\Entity\Note;
|
||||
use App\Util\Common;
|
||||
use App\Util\Exception\ClientException;
|
||||
|
@ -24,7 +24,7 @@ namespace Component\Attachment\tests\Entity;
|
||||
use App\Core\DB;
|
||||
use App\Core\Event;
|
||||
use App\Core\GSFile;
|
||||
use App\Core\Router\Router;
|
||||
use App\Core\Router;
|
||||
use App\Entity\Note;
|
||||
use App\Util\GNUsocialTestCase;
|
||||
use App\Util\TemporaryFile;
|
||||
|
@ -26,8 +26,7 @@ use App\Core\DB;
|
||||
use App\Core\Event;
|
||||
use App\Core\GSFile;
|
||||
use App\Core\Modules\Component;
|
||||
use App\Core\Router\RouteLoader;
|
||||
use App\Core\Router\Router;
|
||||
use App\Core\Router;
|
||||
use App\Util\Common;
|
||||
use Component\Attachment\Entity\Attachment;
|
||||
use Component\Attachment\Entity\AttachmentThumbnail;
|
||||
@ -41,7 +40,7 @@ class Avatar extends Component
|
||||
{
|
||||
}
|
||||
|
||||
public function onAddRoute(RouteLoader $r): bool
|
||||
public function onAddRoute(Router $r): bool
|
||||
{
|
||||
$r->connect('avatar_actor', '/actor/{actor_id<\d+>}/avatar/{size<full|big|medium|small>?medium}', [Controller\Avatar::class, 'avatar_view']);
|
||||
$r->connect('avatar_default', '/avatar/default/{size<full|big|medium|small>?medium}', [Controller\Avatar::class, 'default_avatar_view']);
|
||||
|
@ -27,7 +27,7 @@ use App\Core\Cache;
|
||||
use App\Core\DB;
|
||||
use App\Core\Entity;
|
||||
use App\Core\Event;
|
||||
use App\Core\Router\Router;
|
||||
use App\Core\Router;
|
||||
use App\Util\Common;
|
||||
use Component\Attachment\Entity\Attachment;
|
||||
use Component\Attachment\Entity\AttachmentThumbnail;
|
||||
|
@ -24,12 +24,12 @@ namespace Component\Blog;
|
||||
|
||||
use App\Core\Event;
|
||||
use App\Core\Modules\Plugin;
|
||||
use App\Core\Router\RouteLoader;
|
||||
use App\Core\Router;
|
||||
use Component\Blog\Controller as C;
|
||||
|
||||
class Blog extends Plugin
|
||||
{
|
||||
public function onAddRoute(RouteLoader $r): bool
|
||||
public function onAddRoute(Router $r): bool
|
||||
{
|
||||
$r->connect(id: 'blog_post', uri_path: '/blog/post', target: [C\Post::class, 'makePost']);
|
||||
return Event::next;
|
||||
|
@ -28,8 +28,7 @@ use App\Core\DB;
|
||||
use App\Core\Event;
|
||||
use function App\Core\I18n\_m;
|
||||
use App\Core\Modules\Component;
|
||||
use App\Core\Router\RouteLoader;
|
||||
use App\Core\Router\Router;
|
||||
use App\Core\Router;
|
||||
use App\Entity\Actor;
|
||||
use App\Entity\Feed;
|
||||
use App\Entity\LocalUser;
|
||||
@ -59,7 +58,7 @@ class Circle extends Component
|
||||
protected const SLUG = 'circle';
|
||||
protected const PLURAL_SLUG = 'circles';
|
||||
|
||||
public function onAddRoute(RouteLoader $r): bool
|
||||
public function onAddRoute(Router $r): bool
|
||||
{
|
||||
$r->connect('actor_circle_view_by_circle_id', '/circle/{circle_id<\d+>}', [CircleController\Circle::class, 'circleById']);
|
||||
// View circle members by (tagger id or nickname) and tag
|
||||
|
@ -25,7 +25,7 @@ namespace Component\Circle\Controller;
|
||||
|
||||
use App\Core\Cache;
|
||||
use App\Core\DB;
|
||||
use App\Core\Router\Router;
|
||||
use App\Core\Router;
|
||||
use App\Entity\Actor;
|
||||
use App\Entity\LocalUser;
|
||||
use Component\Circle\Entity\ActorCircle;
|
||||
|
@ -24,7 +24,7 @@ namespace Component\Circle\Entity;
|
||||
use App\Core\Cache;
|
||||
use App\Core\DB;
|
||||
use App\Core\Entity;
|
||||
use App\Core\Router\Router;
|
||||
use App\Core\Router;
|
||||
use DateTimeInterface;
|
||||
|
||||
/**
|
||||
|
@ -23,7 +23,7 @@ namespace Component\Circle\Entity;
|
||||
|
||||
use App\Core\DB;
|
||||
use App\Core\Entity;
|
||||
use App\Core\Router\Router;
|
||||
use App\Core\Router;
|
||||
use App\Entity\Actor;
|
||||
use Component\Tag\Tag;
|
||||
use DateTimeInterface;
|
||||
|
@ -32,7 +32,7 @@ use App\Core\DB;
|
||||
use App\Core\Form;
|
||||
use function App\Core\I18n\_m;
|
||||
use App\Core\Log;
|
||||
use App\Core\Router\Router;
|
||||
use App\Core\Router;
|
||||
use App\Entity\Note;
|
||||
use App\Util\Common;
|
||||
use App\Util\Exception\ClientException;
|
||||
|
@ -32,8 +32,7 @@ use App\Core\DB;
|
||||
use App\Core\Event;
|
||||
use function App\Core\I18n\_m;
|
||||
use App\Core\Modules\Component;
|
||||
use App\Core\Router\RouteLoader;
|
||||
use App\Core\Router\Router;
|
||||
use App\Core\Router;
|
||||
use App\Entity\Activity;
|
||||
use App\Entity\Actor;
|
||||
use App\Entity\Note;
|
||||
@ -46,7 +45,7 @@ use Symfony\Component\HttpFoundation\Request;
|
||||
|
||||
class Conversation extends Component
|
||||
{
|
||||
public function onAddRoute(RouteLoader $r): bool
|
||||
public function onAddRoute(Router $r): bool
|
||||
{
|
||||
$r->connect('conversation', '/conversation/{conversation_id<\d+>}', [Controller\Conversation::class, 'showConversation']);
|
||||
$r->connect('conversation_mute', '/conversation/{conversation_id<\d+>}/mute', [Controller\Conversation::class, 'muteConversation']);
|
||||
|
@ -25,7 +25,7 @@ namespace Component\Conversation\Entity;
|
||||
|
||||
use App\Core\DB;
|
||||
use App\Core\Entity;
|
||||
use App\Core\Router\Router;
|
||||
use App\Core\Router;
|
||||
|
||||
/**
|
||||
* Entity class for Conversations
|
||||
|
@ -25,12 +25,12 @@ namespace Component\Feed;
|
||||
|
||||
use App\Core\Event;
|
||||
use App\Core\Modules\Component;
|
||||
use App\Core\Router\RouteLoader;
|
||||
use App\Core\Router;
|
||||
use Component\Feed\Controller as C;
|
||||
|
||||
class Feed extends Component
|
||||
{
|
||||
public function onAddRoute(RouteLoader $r): bool
|
||||
public function onAddRoute(Router $r): bool
|
||||
{
|
||||
$r->connect('feed_public', '/feed/public', [C\Feeds::class, 'public']);
|
||||
$r->connect('feed_home', '/feed/home', [C\Feeds::class, 'home']);
|
||||
|
@ -23,7 +23,7 @@ declare(strict_types = 1);
|
||||
|
||||
namespace Component\Feed\tests\Controller;
|
||||
|
||||
use App\Core\Router\Router;
|
||||
use App\Core\Router;
|
||||
use App\Util\GNUsocialTestCase;
|
||||
use Component\Feed\Controller\Feeds;
|
||||
use Jchook\AssertThrows\AssertThrows;
|
||||
|
@ -28,8 +28,7 @@ use App\Core\HTTPClient;
|
||||
use function App\Core\I18n\_m;
|
||||
use App\Core\Log;
|
||||
use App\Core\Modules\Component;
|
||||
use App\Core\Router\RouteLoader;
|
||||
use App\Core\Router\Router;
|
||||
use App\Core\Router;
|
||||
use App\Entity\Activity;
|
||||
use App\Entity\Actor;
|
||||
use App\Entity\LocalUser;
|
||||
@ -86,7 +85,7 @@ class FreeNetwork extends Component
|
||||
return Event::next;
|
||||
}
|
||||
|
||||
public function onAddRoute(RouteLoader $m): bool
|
||||
public function onAddRoute(Router $m): bool
|
||||
{
|
||||
// Feeds
|
||||
$m->connect('feed_network', '/feed/network', [Feeds::class, 'network']);
|
||||
|
@ -6,7 +6,7 @@ namespace Component\FreeNetwork\Util\WebfingerResource;
|
||||
|
||||
use App\Core\Event;
|
||||
use App\Core\Log;
|
||||
use App\Core\Router\Router;
|
||||
use App\Core\Router;
|
||||
use App\Entity\Actor;
|
||||
use App\Util\Common;
|
||||
use Component\FreeNetwork\Exception\WebfingerReconstructionException;
|
||||
|
@ -27,7 +27,7 @@ use App\Core\Cache;
|
||||
use App\Core\DB;
|
||||
use App\Core\Form;
|
||||
use function App\Core\I18n\_m;
|
||||
use App\Core\Router\Router;
|
||||
use App\Core\Router;
|
||||
use App\Entity\Actor;
|
||||
use App\Entity as E;
|
||||
use App\Util\Common;
|
||||
|
@ -24,8 +24,7 @@ namespace Component\Group;
|
||||
use App\Core\Event;
|
||||
use function App\Core\I18n\_m;
|
||||
use App\Core\Modules\Component;
|
||||
use App\Core\Router\RouteLoader;
|
||||
use App\Core\Router\Router;
|
||||
use App\Core\Router;
|
||||
use App\Entity\Activity;
|
||||
use App\Entity\Actor;
|
||||
use App\Util\Common;
|
||||
@ -38,7 +37,7 @@ use Symfony\Component\HttpFoundation\Request;
|
||||
|
||||
class Group extends Component
|
||||
{
|
||||
public function onAddRoute(RouteLoader $r): bool
|
||||
public function onAddRoute(Router $r): bool
|
||||
{
|
||||
$r->connect(id: 'group_actor_view_id', uri_path: '/group/{id<\d+>}', target: [C\GroupFeed::class, 'groupViewId']);
|
||||
$r->connect(id: 'group_actor_view_nickname', uri_path: '/!{nickname<' . Nickname::DISPLAY_FMT . '>}', target: [C\GroupFeed::class, 'groupViewNickname']);
|
||||
|
@ -23,7 +23,7 @@ namespace Component\Language;
|
||||
|
||||
use App\Core\Event;
|
||||
use App\Core\Modules\Component;
|
||||
use App\Core\Router\RouteLoader;
|
||||
use App\Core\Router;
|
||||
use App\Entity\Actor;
|
||||
use App\Entity\Note;
|
||||
use App\Util\Formatting;
|
||||
@ -38,7 +38,7 @@ use Symfony\Component\HttpFoundation\Request;
|
||||
|
||||
class Language extends Component
|
||||
{
|
||||
public function onAddRoute(RouteLoader $r): bool
|
||||
public function onAddRoute(Router $r): bool
|
||||
{
|
||||
$r->connect('settings_sort_languages', '/settings/sort_languages', [C\Language::class, 'sortLanguages']);
|
||||
return Event::next;
|
||||
|
@ -28,7 +28,7 @@ use App\Core\Controller;
|
||||
use App\Core\DB;
|
||||
use App\Core\Form;
|
||||
use function App\Core\I18n\_m;
|
||||
use App\Core\Router\Router;
|
||||
use App\Core\Router;
|
||||
use App\Entity\Feed;
|
||||
use App\Util\Common;
|
||||
use App\Util\Exception\ClientException;
|
||||
|
@ -26,8 +26,7 @@ use App\Core\DB;
|
||||
use App\Core\Event;
|
||||
use function App\Core\I18n\_m;
|
||||
use App\Core\Modules\Component;
|
||||
use App\Core\Router\RouteLoader;
|
||||
use App\Core\Router\Router;
|
||||
use App\Core\Router;
|
||||
use App\Entity\Actor;
|
||||
use App\Entity\Feed;
|
||||
use App\Util\Exception\ClientException;
|
||||
@ -36,7 +35,7 @@ use Component\LeftPanel\Controller as C;
|
||||
|
||||
class LeftPanel extends Component
|
||||
{
|
||||
public function onAddRoute(RouteLoader $r): bool
|
||||
public function onAddRoute(Router $r): bool
|
||||
{
|
||||
$r->connect('edit_feeds', '/edit-feeds', C\EditFeeds::class);
|
||||
return Event::next;
|
||||
|
@ -27,8 +27,7 @@ use function App\Core\I18n\_m;
|
||||
use App\Core\Log;
|
||||
use App\Core\Modules\Component;
|
||||
use App\Core\Queue;
|
||||
use App\Core\Router\RouteLoader;
|
||||
use App\Core\Router\Router;
|
||||
use App\Core\Router;
|
||||
use App\Entity\Activity;
|
||||
use App\Entity\Actor;
|
||||
use App\Entity\LocalUser;
|
||||
@ -40,7 +39,7 @@ use Throwable;
|
||||
|
||||
class Notification extends Component
|
||||
{
|
||||
public function onAddRoute(RouteLoader $m): bool
|
||||
public function onAddRoute(Router $m): bool
|
||||
{
|
||||
$m->connect('feed_notifications', '/feed/notifications', [Feed::class, 'notifications']);
|
||||
return Event::next;
|
||||
|
@ -24,7 +24,7 @@ declare(strict_types = 1);
|
||||
namespace Component\Person\Controller;
|
||||
|
||||
use function App\Core\I18n\_m;
|
||||
use App\Core\Router\Router;
|
||||
use App\Core\Router;
|
||||
use App\Entity\Actor;
|
||||
use App\Entity as E;
|
||||
use App\Entity\LocalUser;
|
||||
|
@ -23,13 +23,13 @@ namespace Component\Person;
|
||||
|
||||
use App\Core\Event;
|
||||
use App\Core\Modules\Component;
|
||||
use App\Core\Router\RouteLoader;
|
||||
use App\Core\Router;
|
||||
use App\Util\Nickname;
|
||||
use Component\Person\Controller as C;
|
||||
|
||||
class Person extends Component
|
||||
{
|
||||
public function onAddRoute(RouteLoader $r): bool
|
||||
public function onAddRoute(Router $r): bool
|
||||
{
|
||||
$r->connect(id: 'person_actor_view_id', uri_path: '/person/{id<\d+>}', target: [C\PersonFeed::class, 'personViewId']);
|
||||
$r->connect(id: 'person_actor_view_nickname', uri_path: '/@{nickname<' . Nickname::DISPLAY_FMT . '>}', target: [C\PersonFeed::class, 'personViewNickname'], options: ['is_system_path' => false]);
|
||||
|
@ -24,7 +24,7 @@ declare(strict_types = 1);
|
||||
namespace Component\Person\tests\Controller;
|
||||
|
||||
use App\Core\DB;
|
||||
use App\Core\Router\Router;
|
||||
use App\Core\Router;
|
||||
use App\Entity\LocalUser;
|
||||
use App\Util\GNUsocialTestCase;
|
||||
use Jchook\AssertThrows\AssertThrows;
|
||||
|
@ -8,7 +8,7 @@ use App\Core\ActorLocalRoles;
|
||||
use App\Core\Event;
|
||||
use App\Core\Form;
|
||||
use function App\Core\I18n\_m;
|
||||
use App\Core\Router\Router;
|
||||
use App\Core\Router;
|
||||
use App\Core\VisibilityScope;
|
||||
use App\Entity\Actor;
|
||||
use App\Util\Common;
|
||||
|
@ -29,8 +29,7 @@ use App\Core\Event;
|
||||
use App\Core\GSFile;
|
||||
use function App\Core\I18n\_m;
|
||||
use App\Core\Modules\Component;
|
||||
use App\Core\Router\RouteLoader;
|
||||
use App\Core\Router\Router;
|
||||
use App\Core\Router;
|
||||
use App\Core\VisibilityScope;
|
||||
use App\Entity\Activity;
|
||||
use App\Entity\Actor;
|
||||
@ -55,7 +54,7 @@ class Posting extends Component
|
||||
{
|
||||
public const route = 'posting_form_action';
|
||||
|
||||
public function onAddRoute(RouteLoader $r): bool
|
||||
public function onAddRoute(Router $r): bool
|
||||
{
|
||||
$r->connect(self::route, '/form/posting', Controller\Posting::class);
|
||||
return Event::next;
|
||||
|
@ -27,7 +27,7 @@ use App\Core\DB;
|
||||
use App\Core\Form;
|
||||
use function App\Core\I18n\_m;
|
||||
use App\Core\Log;
|
||||
use App\Core\Router\Router;
|
||||
use App\Core\Router;
|
||||
use App\Entity\Actor;
|
||||
use App\Util\Common;
|
||||
use App\Util\Exception\ClientException;
|
||||
|
@ -28,8 +28,7 @@ use App\Core\DB;
|
||||
use App\Core\Event;
|
||||
use function App\Core\I18n\_m;
|
||||
use App\Core\Modules\Component;
|
||||
use App\Core\Router\RouteLoader;
|
||||
use App\Core\Router\Router;
|
||||
use App\Core\Router;
|
||||
use App\Entity\Activity;
|
||||
use App\Entity\Actor;
|
||||
use App\Entity\LocalUser;
|
||||
@ -44,7 +43,7 @@ use Symfony\Component\HttpFoundation\Request;
|
||||
|
||||
class Subscription extends Component
|
||||
{
|
||||
public function onAddRoute(RouteLoader $r): bool
|
||||
public function onAddRoute(Router $r): bool
|
||||
{
|
||||
$r->connect(id: 'actor_subscribe_add', uri_path: '/actor/subscribe/{object_id<\d+>}', target: [SubscribersController::class, 'subscribersAdd']);
|
||||
$r->connect(id: 'actor_subscribe_remove', uri_path: '/actor/unsubscribe/{object_id<\d+>}', target: [SubscribersController::class, 'subscribersRemove']);
|
||||
|
@ -24,7 +24,7 @@ namespace Component\Tag\Entity;
|
||||
use App\Core\Cache;
|
||||
use App\Core\DB;
|
||||
use App\Core\Entity;
|
||||
use App\Core\Router\Router;
|
||||
use App\Core\Router;
|
||||
use App\Entity\Actor;
|
||||
use App\Entity\Note;
|
||||
use Component\Language\Entity\Language;
|
||||
|
@ -28,7 +28,7 @@ use App\Core\DB;
|
||||
use App\Core\Event;
|
||||
use function App\Core\I18n\_m;
|
||||
use App\Core\Modules\Component;
|
||||
use App\Core\Router\Router;
|
||||
use App\Core\Router;
|
||||
use App\Entity\Actor;
|
||||
use App\Entity\Note;
|
||||
use App\Util\Common;
|
||||
|
@ -24,7 +24,7 @@ services:
|
||||
resource: '../src/Controller'
|
||||
tags: ['controller.service_arguments']
|
||||
|
||||
App\Core\Router\RouteLoader:
|
||||
App\Core\Router:
|
||||
tags: ['routing.loader']
|
||||
|
||||
# Wrapper around Doctrine's StaticPHP metadata driver
|
||||
|
@ -41,8 +41,7 @@ use function App\Core\I18n\_m;
|
||||
use App\Core\Log;
|
||||
use App\Core\Modules\Plugin;
|
||||
use App\Core\Queue;
|
||||
use App\Core\Router\RouteLoader;
|
||||
use App\Core\Router\Router;
|
||||
use App\Core\Router;
|
||||
use App\Entity\Activity;
|
||||
use App\Entity\Actor;
|
||||
use App\Entity\Note;
|
||||
@ -156,9 +155,9 @@ class ActivityPub extends Plugin
|
||||
* This code executes when GNU social creates the page routing, and we hook
|
||||
* on this event to add our Inbox and Outbox handler for ActivityPub.
|
||||
*
|
||||
* @param RouteLoader $r the router that was initialized
|
||||
* @param Router $r the router that was initialized
|
||||
*/
|
||||
public function onAddRoute(RouteLoader $r): bool
|
||||
public function onAddRoute(Router $r): bool
|
||||
{
|
||||
$r->connect(
|
||||
'activitypub_inbox',
|
||||
|
@ -37,7 +37,7 @@ use App\Core\DB;
|
||||
use function App\Core\I18n\_m;
|
||||
use App\Core\Log;
|
||||
use App\Core\Queue;
|
||||
use App\Core\Router\Router;
|
||||
use App\Core\Router;
|
||||
use App\Util\Common;
|
||||
use App\Util\Exception\ClientException;
|
||||
use Exception;
|
||||
|
@ -34,7 +34,7 @@ namespace Plugin\ActivityPub\Controller;
|
||||
|
||||
use function App\Core\I18n\_m;
|
||||
use App\Core\Log;
|
||||
use App\Core\Router\Router;
|
||||
use App\Core\Router;
|
||||
use App\Entity\Activity;
|
||||
use App\Entity\Actor;
|
||||
use App\Util\Exception\ClientException;
|
||||
|
@ -37,7 +37,7 @@ use ActivityPhp\Type\AbstractObject;
|
||||
use App\Core\DB;
|
||||
use App\Core\Event;
|
||||
use App\Core\Log;
|
||||
use App\Core\Router\Router;
|
||||
use App\Core\Router;
|
||||
use App\Entity\Activity as GSActivity;
|
||||
use App\Util\Common;
|
||||
use App\Util\Exception\ClientException;
|
||||
|
@ -39,7 +39,7 @@ use App\Core\Event;
|
||||
use App\Core\GSFile;
|
||||
use App\Core\HTTPClient;
|
||||
use App\Core\Log;
|
||||
use App\Core\Router\Router;
|
||||
use App\Core\Router;
|
||||
use App\Entity\Actor as GSActor;
|
||||
use App\Util\Exception\ServerException;
|
||||
use App\Util\TemporaryFile;
|
||||
|
@ -41,7 +41,7 @@ use App\Core\GSFile;
|
||||
use App\Core\HTTPClient;
|
||||
use function App\Core\I18n\_m;
|
||||
use App\Core\Log;
|
||||
use App\Core\Router\Router;
|
||||
use App\Core\Router;
|
||||
use App\Core\VisibilityScope;
|
||||
use App\Entity\Note as GSNote;
|
||||
use App\Util\Common;
|
||||
|
@ -34,7 +34,7 @@ namespace Plugin\ActivityPub\Util;
|
||||
|
||||
use ActivityPhp\Type\Core\OrderedCollection;
|
||||
use ActivityPhp\Type\Core\OrderedCollectionPage;
|
||||
use App\Core\Router\Router;
|
||||
use App\Core\Router;
|
||||
use Component\Collection\Util\Controller\CircleController;
|
||||
use Component\Collection\Util\Controller\FeedController;
|
||||
use Component\Collection\Util\Controller\OrderedCollection as GSOrderedCollection;
|
||||
|
@ -35,8 +35,7 @@ use App\Core\DB;
|
||||
use App\Core\Event;
|
||||
use function App\Core\I18n\_m;
|
||||
use App\Core\Modules\Plugin;
|
||||
use App\Core\Router\RouteLoader;
|
||||
use App\Core\Router\Router;
|
||||
use App\Core\Router;
|
||||
use App\Entity\Actor;
|
||||
use App\Entity\Feed;
|
||||
use App\Entity\LocalUser;
|
||||
@ -123,7 +122,7 @@ class AttachmentCollections extends Plugin
|
||||
return array_map(fn ($x) => $x['attachment_collection_id'], $res);
|
||||
}
|
||||
|
||||
public function onAddRoute(RouteLoader $r): bool
|
||||
public function onAddRoute(Router $r): bool
|
||||
{
|
||||
// View all collections by actor id and nickname
|
||||
$r->connect(
|
||||
|
@ -24,7 +24,7 @@ declare(strict_types = 1);
|
||||
namespace Plugin\AttachmentCollections\Controller;
|
||||
|
||||
use App\Core\DB;
|
||||
use App\Core\Router\Router;
|
||||
use App\Core\Router;
|
||||
use Component\Collection\Util\Controller\MetaCollectionController;
|
||||
use Plugin\AttachmentCollections\Entity\AttachmentCollection;
|
||||
|
||||
|
@ -24,7 +24,7 @@ declare(strict_types = 1);
|
||||
namespace Plugin\Bundles\Controller;
|
||||
|
||||
use App\Core\DB;
|
||||
use App\Core\Router\Router;
|
||||
use App\Core\Router;
|
||||
use Component\Collection\Util\Controller\MetaCollectionController;
|
||||
use Plugin\Bundles\Entity\BundleCollection;
|
||||
|
||||
|
@ -25,7 +25,7 @@ namespace Plugin\Cover;
|
||||
use App\Core\DB;
|
||||
use App\Core\Event;
|
||||
use App\Core\Modules\Plugin;
|
||||
use App\Core\Router\RouteLoader;
|
||||
use App\Core\Router;
|
||||
use App\Util\Common;
|
||||
use Plugin\Cover\Controller as C;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
@ -47,7 +47,7 @@ class Cover extends Plugin
|
||||
*
|
||||
* @return bool hook value; true means continue processing, false means stop
|
||||
*/
|
||||
public function onAddRoute(RouteLoader $r): bool
|
||||
public function onAddRoute(Router $r): bool
|
||||
{
|
||||
$r->connect('settings_profile_cover', 'settings/cover', [Controller\Cover::class, 'coversettings']);
|
||||
$r->connect('cover', '/cover', [Controller\Cover::class, 'cover']);
|
||||
|
@ -28,7 +28,7 @@ use App\Core\DB;
|
||||
use App\Core\Form;
|
||||
use function App\Core\I18n\_m;
|
||||
use App\Core\Log;
|
||||
use App\Core\Router\Router;
|
||||
use App\Core\Router;
|
||||
use App\Entity\Note;
|
||||
use App\Util\Common;
|
||||
use App\Util\Exception\ClientException;
|
||||
|
@ -27,8 +27,7 @@ use App\Core\DB;
|
||||
use App\Core\Event;
|
||||
use function App\Core\I18n\_m;
|
||||
use App\Core\Modules\NoteHandlerPlugin;
|
||||
use App\Core\Router\RouteLoader;
|
||||
use App\Core\Router\Router;
|
||||
use App\Core\Router;
|
||||
use App\Entity\Activity;
|
||||
use App\Entity\Actor;
|
||||
use App\Entity\Note;
|
||||
@ -47,7 +46,7 @@ use Symfony\Component\HttpFoundation\Request;
|
||||
* @category DeleteNote
|
||||
*
|
||||
* @author Eliseu Amaro <mail@eliseuama.ro>
|
||||
* @copyright 2021 Free Software Foundation, Inc http://www.fsf.org
|
||||
* @copyright 2021-2022 Free Software Foundation, Inc http://www.fsf.org
|
||||
* @license https://www.gnu.org/licenses/agpl.html GNU AGPL v3 or later
|
||||
*/
|
||||
class DeleteNote extends NoteHandlerPlugin
|
||||
@ -136,7 +135,7 @@ class DeleteNote extends NoteHandlerPlugin
|
||||
*
|
||||
* @return bool Event hook
|
||||
*/
|
||||
public function onAddRoute(RouteLoader $r)
|
||||
public function onAddRoute(Router $r)
|
||||
{
|
||||
$r->connect(id: 'delete_note_action', uri_path: '/object/note/{note_id<\d+>}/delete', target: Controller\DeleteNote::class);
|
||||
|
||||
|
@ -25,8 +25,7 @@ namespace Plugin\Directory;
|
||||
|
||||
use App\Core\Event;
|
||||
use App\Core\Modules\Plugin;
|
||||
use App\Core\Router\RouteLoader;
|
||||
use App\Core\Router\Router;
|
||||
use App\Core\Router;
|
||||
use App\Util\Common;
|
||||
use App\Util\Exception\RedirectException;
|
||||
use App\Util\Exception\ServerException;
|
||||
@ -41,7 +40,7 @@ class Directory extends Plugin
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function onAddRoute(RouteLoader $r)
|
||||
public function onAddRoute(Router $r)
|
||||
{
|
||||
$r->connect('directory_people', '/directory/people', [Controller\Directory::class, 'people']);
|
||||
$r->connect('directory_groups', '/directory/groups', [Controller\Directory::class, 'groups']);
|
||||
|
@ -31,7 +31,7 @@ declare(strict_types = 1);
|
||||
* @author Miguel Dantas
|
||||
* @author Hugo Sales <hugo@hsal.es>
|
||||
* @author Diogo Peralta Cordeiro <mail@diogo.site>
|
||||
* @copyright 2014-2021 Free Software Foundation, Inc http://www.fsf.org
|
||||
* @copyright 2014-2022 Free Software Foundation, Inc http://www.fsf.org
|
||||
* @license https://www.gnu.org/licenses/agpl.html GNU AGPL v3 or later
|
||||
*/
|
||||
|
||||
@ -45,8 +45,7 @@ use App\Core\HTTPClient;
|
||||
use function App\Core\I18n\_m;
|
||||
use App\Core\Log;
|
||||
use App\Core\Modules\Plugin;
|
||||
use App\Core\Router\RouteLoader;
|
||||
use App\Core\Router\Router;
|
||||
use App\Core\Router;
|
||||
use App\Entity\Note;
|
||||
use App\Util\Common;
|
||||
use App\Util\Exception\ClientException;
|
||||
@ -108,11 +107,11 @@ class Embed extends Plugin
|
||||
* This code executes when GNU social creates the page routing, and we hook
|
||||
* on this event to add our action handler for Embed.
|
||||
*
|
||||
* @param RouteLoader $m the router that was initialized
|
||||
* @param Router $m the router that was initialized
|
||||
*
|
||||
* @throws Exception
|
||||
*/
|
||||
public function onAddRoute(RouteLoader $m): bool
|
||||
public function onAddRoute(Router $m): bool
|
||||
{
|
||||
$m->connect('oembed', 'main/oembed', Controller\OEmbed::class);
|
||||
return Event::next;
|
||||
|
@ -26,9 +26,8 @@ namespace Plugin\Favourite\Controller;
|
||||
use App\Core\DB;
|
||||
use App\Core\Event;
|
||||
use App\Core\Form;
|
||||
use function App\Core\I18n\_m;
|
||||
use App\Core\Log;
|
||||
use App\Core\Router\Router;
|
||||
use App\Core\Router;
|
||||
use App\Entity\Activity;
|
||||
use App\Entity\Actor;
|
||||
use App\Entity\LocalUser;
|
||||
@ -42,6 +41,7 @@ use App\Util\Exception\RedirectException;
|
||||
use App\Util\Exception\ServerException;
|
||||
use Component\Collection\Util\Controller\FeedController;
|
||||
use Component\Notification\Entity\Attention;
|
||||
use function App\Core\I18n\_m;
|
||||
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
|
||||
|
@ -35,8 +35,7 @@ use App\Core\DB;
|
||||
use App\Core\Event;
|
||||
use function App\Core\I18n\_m;
|
||||
use App\Core\Modules\NoteHandlerPlugin;
|
||||
use App\Core\Router\RouteLoader;
|
||||
use App\Core\Router\Router;
|
||||
use App\Core\Router;
|
||||
use App\Entity\Activity;
|
||||
use App\Entity\Actor;
|
||||
use App\Entity\Feed;
|
||||
@ -211,7 +210,7 @@ class Favourite extends NoteHandlerPlugin
|
||||
/**
|
||||
* Maps Routes to their respective Controllers
|
||||
*/
|
||||
public function onAddRoute(RouteLoader $r): bool
|
||||
public function onAddRoute(Router $r): bool
|
||||
{
|
||||
// Add/remove note to/from favourites
|
||||
$r->connect(id: 'favourite_add', uri_path: '/object/note/{id<\d+>}/favour', target: [Controller\Favourite::class, 'favouriteAddNote']);
|
||||
|
@ -35,8 +35,7 @@ namespace Plugin\OAuth2;
|
||||
|
||||
use App\Core\Event;
|
||||
use App\Core\Modules\Plugin;
|
||||
use App\Core\Router\RouteLoader;
|
||||
use App\Core\Router\Router;
|
||||
use App\Core\Router;
|
||||
use App\Util\Common;
|
||||
use DateInterval;
|
||||
use Exception;
|
||||
@ -93,9 +92,9 @@ class OAuth2 extends Plugin
|
||||
* This code executes when GNU social creates the page routing, and we hook
|
||||
* on this event to add our Inbox and Outbox handler for ActivityPub.
|
||||
*
|
||||
* @param RouteLoader $r the router that was initialized
|
||||
* @param Router $r the router that was initialized
|
||||
*/
|
||||
public function onAddRoute(RouteLoader $r): bool
|
||||
public function onAddRoute(Router $r): bool
|
||||
{
|
||||
$r->connect('oauth2_mastodon_api_apps', '/api/v1/apps', C\Client::class, ['http-methods' => ['POST']]);
|
||||
$r->connect('oauth2_client', '/oauth/client', C\Client::class, ['http-methods' => ['POST']]);
|
||||
|
@ -26,8 +26,7 @@ use App\Core\Cache;
|
||||
use App\Core\DB;
|
||||
use App\Core\Event;
|
||||
use App\Core\Modules\Plugin;
|
||||
use App\Core\Router\RouteLoader;
|
||||
use App\Core\Router\Router;
|
||||
use App\Core\Router;
|
||||
use App\Entity\LocalUser;
|
||||
use App\Util\Common;
|
||||
use App\Util\Exception\NotFoundException;
|
||||
@ -51,7 +50,7 @@ class Oomox extends Plugin
|
||||
/**
|
||||
* Maps Routes to their respective Controllers
|
||||
*/
|
||||
public function onAddRoute(RouteLoader $r): bool
|
||||
public function onAddRoute(Router $r): bool
|
||||
{
|
||||
$r->connect('oomox_settings', 'settings/oomox', [Controller\Oomox::class, 'oomoxSettings']);
|
||||
$r->connect('oomox_css', 'plugins/oomox/colours', [Controller\Oomox::class, 'oomoxCSS']);
|
||||
|
@ -26,7 +26,7 @@ namespace Plugin\PinnedNotes\Controller;
|
||||
use App\Core\DB;
|
||||
use App\Core\Form;
|
||||
use function App\Core\I18n\_m;
|
||||
use App\Core\Router\Router;
|
||||
use App\Core\Router;
|
||||
use App\Entity\Actor;
|
||||
use App\Entity\LocalUser;
|
||||
use App\Util\Common;
|
||||
|
@ -34,8 +34,7 @@ namespace Plugin\PinnedNotes;
|
||||
use App\Core\DB;
|
||||
use App\Core\Event;
|
||||
use App\Core\Modules\Plugin;
|
||||
use App\Core\Router\RouteLoader;
|
||||
use App\Core\Router\Router;
|
||||
use App\Core\Router;
|
||||
use App\Entity\Actor;
|
||||
use App\Entity\LocalUser;
|
||||
use App\Entity\Note;
|
||||
@ -54,7 +53,7 @@ use Symfony\Component\HttpFoundation\Request;
|
||||
|
||||
class PinnedNotes extends Plugin
|
||||
{
|
||||
public function onAddRoute(RouteLoader $r): bool
|
||||
public function onAddRoute(Router $r): bool
|
||||
{
|
||||
// Pin and unpin notes
|
||||
$r->connect(id: 'toggle_note_pin', uri_path: '/object/note/{id<\d+>}/pin', target: [C\PinnedNotes::class, 'togglePin']);
|
||||
|
@ -27,7 +27,7 @@ use App\Core\Event;
|
||||
use App\Core\Form;
|
||||
use function App\Core\I18n\_m;
|
||||
use App\Core\Modules\NoteHandlerPlugin;
|
||||
use App\Core\Router\RouteLoader;
|
||||
use App\Core\Router;
|
||||
use App\Entity\Note;
|
||||
use App\Util\Common;
|
||||
use App\Util\Exception\InvalidFormException;
|
||||
@ -57,7 +57,7 @@ class Poll extends NoteHandlerPlugin
|
||||
*
|
||||
* @return bool hook value; true means continue processing, false means stop
|
||||
*/
|
||||
public function onAddRoute(RouteLoader $r): bool
|
||||
public function onAddRoute(Router $r): bool
|
||||
{
|
||||
$r->connect('newpoll', 'main/poll/new/{num<\\d+>?3}', [Controller\NewPoll::class, 'newpoll']);
|
||||
|
||||
|
@ -26,7 +26,7 @@ use App\Core\Cache;
|
||||
use App\Core\DB;
|
||||
use App\Core\Event;
|
||||
use App\Core\Modules\Plugin;
|
||||
use App\Core\Router\RouteLoader;
|
||||
use App\Core\Router;
|
||||
use App\Util\Exception\RedirectException;
|
||||
use App\Util\Exception\ServerException;
|
||||
use App\Util\Formatting;
|
||||
@ -51,7 +51,7 @@ class ProfileColor extends Plugin
|
||||
*
|
||||
* @return bool hook value; true means continue processing, false means stop
|
||||
*/
|
||||
public function onAddRoute(RouteLoader $r): bool
|
||||
public function onAddRoute(Router $r): bool
|
||||
{
|
||||
$r->connect('settings_profile_color', 'settings/color', [Controller\ProfileColor::class, 'profileColorSettings']);
|
||||
return Event::next;
|
||||
|
@ -27,9 +27,8 @@ use App\Core\Controller;
|
||||
use App\Core\DB;
|
||||
use App\Core\Event;
|
||||
use App\Core\Form;
|
||||
use function App\Core\I18n\_m;
|
||||
use App\Core\Log;
|
||||
use App\Core\Router\Router;
|
||||
use App\Core\Router;
|
||||
use App\Entity\Activity;
|
||||
use App\Entity\Actor;
|
||||
use App\Entity\Note;
|
||||
@ -39,6 +38,7 @@ use App\Util\Exception\NoLoggedInUser;
|
||||
use App\Util\Exception\RedirectException;
|
||||
use App\Util\Exception\ServerException;
|
||||
use Component\Notification\Entity\Attention;
|
||||
use function App\Core\I18n\_m;
|
||||
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
|
||||
|
@ -33,8 +33,7 @@ use App\Core\DB;
|
||||
use App\Core\Event;
|
||||
use function App\Core\I18n\_m;
|
||||
use App\Core\Modules\NoteHandlerPlugin;
|
||||
use App\Core\Router\RouteLoader;
|
||||
use App\Core\Router\Router;
|
||||
use App\Core\Router;
|
||||
use App\Entity\Activity;
|
||||
use App\Entity\Actor;
|
||||
use App\Entity\Note;
|
||||
@ -341,7 +340,7 @@ class RepeatNote extends NoteHandlerPlugin
|
||||
*
|
||||
* @return bool Event hook, Event::next (true) is returned to allow Event to be handled by other handlers
|
||||
*/
|
||||
public function onAddRoute(RouteLoader $r): bool
|
||||
public function onAddRoute(Router $r): bool
|
||||
{
|
||||
// Add/remove note to/from repeats
|
||||
$r->connect(id: 'repeat_add', uri_path: '/object/note/{note_id<\d+>}/repeat', target: [Controller\Repeat::class, 'repeatAddNote']);
|
||||
|
@ -28,8 +28,7 @@ use App\Core\DB;
|
||||
use App\Core\Event;
|
||||
use function App\Core\I18n\_m;
|
||||
use App\Core\Modules\Plugin;
|
||||
use App\Core\Router\RouteLoader;
|
||||
use App\Core\Router\Router;
|
||||
use App\Core\Router;
|
||||
use App\Entity\Actor;
|
||||
use App\Entity\LocalUser;
|
||||
use App\Entity\Note;
|
||||
@ -52,7 +51,7 @@ class TagBasedFiltering extends Plugin
|
||||
return ['note' => "blocked-note-tags-{$actor_id}", 'actor' => "blocked-actor-tags-{$actor_id}"];
|
||||
}
|
||||
|
||||
public function onAddRoute(RouteLoader $r)
|
||||
public function onAddRoute(Router $r)
|
||||
{
|
||||
$r->connect(id: self::NOTE_TAG_FILTER_ROUTE, uri_path: '/filter/edit-blocked-note-tags/{note_id<\d+>}', target: [Controller\AddBlocked::class, 'addBlockedNoteTags']);
|
||||
$r->connect(id: self::ACTOR_TAG_FILTER_ROUTE, uri_path: '/filter/edit-blocked-actor-tags/{actor_id<\d+>}', target: [Controller\AddBlocked::class, 'addBlockedActorTags']);
|
||||
|
@ -27,7 +27,7 @@ use App\Core\Controller;
|
||||
use App\Core\DB;
|
||||
use App\Core\Form;
|
||||
use function App\Core\I18n\_m;
|
||||
use App\Core\Router\Router;
|
||||
use App\Core\Router;
|
||||
use App\Util\Common;
|
||||
use App\Util\Exception\ClientException;
|
||||
use Functional as F;
|
||||
|
@ -27,7 +27,7 @@ use App\Core\HTTPClient;
|
||||
use App\Core\Log;
|
||||
use App\Core\Modules\Plugin;
|
||||
use App\Core\Queue;
|
||||
use App\Core\Router\RouteLoader;
|
||||
use App\Core\Router;
|
||||
use App\Entity\Activity;
|
||||
use App\Entity\Actor;
|
||||
use App\Entity\LocalUser;
|
||||
@ -43,7 +43,7 @@ class WebHooks extends Plugin
|
||||
{
|
||||
public const controller_route = 'webhook';
|
||||
|
||||
public function onAddRoute(RouteLoader $r)
|
||||
public function onAddRoute(Router $r)
|
||||
{
|
||||
$r->connect(self::controller_route, '/webhook-settings', C\WebHooks::class);
|
||||
}
|
||||
|
@ -24,7 +24,7 @@ declare(strict_types = 1);
|
||||
namespace App\Controller;
|
||||
|
||||
use App\Core\Controller;
|
||||
use App\Core\Router\Router;
|
||||
use App\Core\Router;
|
||||
use App\Entity\Actor;
|
||||
use InvalidArgumentException;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
|
@ -11,7 +11,7 @@ use App\Core\Event;
|
||||
use App\Core\Form;
|
||||
use function App\Core\I18n\_m;
|
||||
use App\Core\Log;
|
||||
use App\Core\Router\Router;
|
||||
use App\Core\Router;
|
||||
use App\Entity\Actor;
|
||||
use App\Entity\Feed;
|
||||
use App\Entity\LocalUser;
|
||||
|
@ -34,7 +34,7 @@ namespace App\Core;
|
||||
|
||||
use App\Core\DB;
|
||||