mirror of
https://github.com/flarum/framework.git
synced 2025-02-02 01:11:25 +08:00
Implement a server class that composes the other servers
Useful for local development using PHP-PM. :)
This commit is contained in:
parent
f177c0d8a0
commit
02b110e545
35
src/Http/FullStackServer.php
Normal file
35
src/Http/FullStackServer.php
Normal file
|
@ -0,0 +1,35 @@
|
|||
<?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.
|
||||
*/
|
||||
|
||||
namespace Flarum\Http;
|
||||
|
||||
use Flarum\Admin\Server as AdminServer;
|
||||
use Flarum\Api\Server as ApiServer;
|
||||
use Flarum\Forum\Server as ForumServer;
|
||||
use Flarum\Foundation\Application;
|
||||
use Zend\Stratigility\MiddlewarePipe;
|
||||
|
||||
class FullStackServer extends AbstractServer
|
||||
{
|
||||
/**
|
||||
* @param Application $app
|
||||
* @return \Zend\Stratigility\MiddlewareInterface
|
||||
*/
|
||||
protected function getMiddleware(Application $app)
|
||||
{
|
||||
$pipe = new MiddlewarePipe;
|
||||
|
||||
$pipe->pipe(new ApiServer);
|
||||
$pipe->pipe(new AdminServer);
|
||||
$pipe->pipe(new ForumServer);
|
||||
|
||||
return $pipe;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user