mirror of
https://github.com/flarum/framework.git
synced 2024-12-12 14:13:37 +08:00
c41e58531a
These will be replaced by etenders soon.
61 lines
1.0 KiB
PHP
61 lines
1.0 KiB
PHP
<?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\Event;
|
|
|
|
use Zend\Stratigility\MiddlewarePipe;
|
|
|
|
/**
|
|
* @deprecated
|
|
*/
|
|
class ConfigureMiddleware
|
|
{
|
|
/**
|
|
* @var MiddlewarePipe
|
|
*/
|
|
public $pipe;
|
|
|
|
/**
|
|
* @var string
|
|
*/
|
|
public $stackName;
|
|
|
|
/**
|
|
* @param MiddlewarePipe $pipe
|
|
* @param string $stackName
|
|
*/
|
|
public function __construct(MiddlewarePipe $pipe, $stackName)
|
|
{
|
|
$this->pipe = $pipe;
|
|
$this->stackName = $stackName;
|
|
}
|
|
|
|
public function pipe(callable $middleware)
|
|
{
|
|
$this->pipe->pipe($middleware);
|
|
}
|
|
|
|
public function isForum()
|
|
{
|
|
return $this->stackName === 'forum';
|
|
}
|
|
|
|
public function isAdmin()
|
|
{
|
|
return $this->stackName === 'admin';
|
|
}
|
|
|
|
public function isApi()
|
|
{
|
|
return $this->stackName === 'api';
|
|
}
|
|
}
|