mirror of
https://github.com/flarum/framework.git
synced 2025-02-21 07:38:08 +08:00
Restructure Flarum\Admin namespace
This commit is contained in:
parent
7df9594a04
commit
5127514d35
@ -55,13 +55,10 @@ class AdminServiceProvider extends AbstractServiceProvider
|
||||
*/
|
||||
protected function populateRoutes(RouteCollection $routes)
|
||||
{
|
||||
$route = $this->app->make(RouteHandlerFactory::class);
|
||||
$factory = $this->app->make(RouteHandlerFactory::class);
|
||||
|
||||
$routes->get(
|
||||
'/',
|
||||
'index',
|
||||
$route->toController(Controller\WebAppController::class)
|
||||
);
|
||||
$callback = include __DIR__.'/routes.php';
|
||||
$callback($routes, $factory);
|
||||
}
|
||||
|
||||
protected function flushWebAppAssetsWhenThemeChanged()
|
||||
@ -91,6 +88,6 @@ class AdminServiceProvider extends AbstractServiceProvider
|
||||
*/
|
||||
protected function getWebAppAssets()
|
||||
{
|
||||
return $this->app->make(WebApp::class)->getAssets();
|
||||
return $this->app->make(Frontend::class)->getAssets();
|
||||
}
|
||||
}
|
||||
|
@ -11,7 +11,7 @@
|
||||
|
||||
namespace Flarum\Admin\Controller;
|
||||
|
||||
use Flarum\Admin\WebApp;
|
||||
use Flarum\Admin\Frontend;
|
||||
use Flarum\Core\Permission;
|
||||
use Flarum\Event\PrepareUnserializedSettings;
|
||||
use Flarum\Extension\ExtensionManager;
|
||||
@ -20,7 +20,7 @@ use Flarum\Settings\SettingsRepositoryInterface;
|
||||
use Illuminate\Contracts\Events\Dispatcher;
|
||||
use Psr\Http\Message\ServerRequestInterface;
|
||||
|
||||
class WebAppController extends AbstractWebAppController
|
||||
class FrontendController extends AbstractWebAppController
|
||||
{
|
||||
/**
|
||||
* @var SettingsRepositoryInterface
|
||||
@ -33,12 +33,12 @@ class WebAppController extends AbstractWebAppController
|
||||
protected $extensions;
|
||||
|
||||
/**
|
||||
* @param WebApp $webApp
|
||||
* @param Frontend $webApp
|
||||
* @param Dispatcher $events
|
||||
* @param SettingsRepositoryInterface $settings
|
||||
* @param ExtensionManager $extensions
|
||||
*/
|
||||
public function __construct(WebApp $webApp, Dispatcher $events, SettingsRepositoryInterface $settings, ExtensionManager $extensions)
|
||||
public function __construct(Frontend $webApp, Dispatcher $events, SettingsRepositoryInterface $settings, ExtensionManager $extensions)
|
||||
{
|
||||
$this->webApp = $webApp;
|
||||
$this->events = $events;
|
@ -13,7 +13,7 @@ namespace Flarum\Admin;
|
||||
|
||||
use Flarum\Http\WebApp\AbstractWebApp;
|
||||
|
||||
class WebApp extends AbstractWebApp
|
||||
class Frontend extends AbstractWebApp
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
22
src/Admin/routes.php
Normal file
22
src/Admin/routes.php
Normal file
@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Flarum.
|
||||
*
|
||||
* (c) Toby Zerner <toby.zerner@gmail.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
use Flarum\Admin\Controller;
|
||||
use Flarum\Http\Handler\RouteHandlerFactory;
|
||||
use Flarum\Http\RouteCollection;
|
||||
|
||||
return function (RouteCollection $map, RouteHandlerFactory $route) {
|
||||
$map->get(
|
||||
'/',
|
||||
'index',
|
||||
$route->toController(Controller\FrontendController::class)
|
||||
);
|
||||
};
|
@ -11,7 +11,7 @@
|
||||
|
||||
namespace Flarum\Debug\Console;
|
||||
|
||||
use Flarum\Admin\WebApp as AdminWebApp;
|
||||
use Flarum\Admin\Frontend as AdminWebApp;
|
||||
use Flarum\Console\Command\AbstractCommand;
|
||||
use Flarum\Forum\WebApp as ForumWebApp;
|
||||
use Illuminate\Contracts\Cache\Store;
|
||||
@ -29,7 +29,7 @@ class CacheClearCommand extends AbstractCommand
|
||||
protected $forum;
|
||||
|
||||
/**
|
||||
* @var \Flarum\Admin\WebApp
|
||||
* @var \Flarum\Admin\Frontend
|
||||
*/
|
||||
protected $admin;
|
||||
|
||||
|
@ -11,7 +11,7 @@
|
||||
|
||||
namespace Flarum\Event;
|
||||
|
||||
use Flarum\Admin\Controller\WebAppController as AdminWebAppController;
|
||||
use Flarum\Admin\Controller\FrontendController as AdminWebAppController;
|
||||
use Flarum\Forum\Controller\WebAppController as ForumWebAppController;
|
||||
use Flarum\Http\Controller\AbstractWebAppController;
|
||||
use Flarum\Http\WebApp\WebAppView;
|
||||
|
Loading…
x
Reference in New Issue
Block a user