mirror of
https://github.com/flarum/framework.git
synced 2025-03-15 00:05:12 +08:00
Implement a server class that composes the other servers
Useful for local development using PHP-PM. :)
This commit is contained in:
parent
103f4fddcf
commit
bdc4a45466
35
framework/core/src/Http/FullStackServer.php
Normal file
35
framework/core/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…
x
Reference in New Issue
Block a user