Implement a server class that composes the other servers

Useful for local development using PHP-PM. :)
This commit is contained in:
Franz Liedke 2016-04-16 23:19:10 +09:00
parent f177c0d8a0
commit 02b110e545
No known key found for this signature in database
GPG Key ID: 9A0231A879B055F4

View 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;
}
}