PHP Класс AssetCompress\Middleware\AssetCompressMiddleware

Показать файл Открыть проект

Защищенные свойства (Protected)

Свойство Тип Описание
$config MiniAsset\AssetConfig Object containing configuration settings for asset compressor

Открытые методы

Метод Описание
__construct ( AssetConfig $config = null ) Constructor
__invoke ( Psr\Http\Message\ServerRequestInterface $request, Psr\Http\Message\ResponseInterface $response, callable $next ) : Psr\Http\Message\ResponseInterface Get an asset or delegate to the next middleware

Защищенные методы

Метод Описание
getName ( AssetConfig $config, string $url ) : boolean | string Returns the build name for a requested asset
mapType ( AssetTarget $build ) : string Map an extension to a content type
respond ( Psr\Http\Message\ResponseInterface $response, string $contents, AssetTarget $build ) : Psr\Http\Message\ResponseInterface Respond with the asset.

Описание методов

__construct() публичный метод

Constructor
public __construct ( AssetConfig $config = null )
$config MiniAsset\AssetConfig The config object to use. If null, \AssetCompress\ConfigFinder::loadAll() will be used.

__invoke() публичный метод

Get an asset or delegate to the next middleware
public __invoke ( Psr\Http\Message\ServerRequestInterface $request, Psr\Http\Message\ResponseInterface $response, callable $next ) : Psr\Http\Message\ResponseInterface
$request Psr\Http\Message\ServerRequestInterface The request.
$response Psr\Http\Message\ResponseInterface The response.
$next callable Callback to invoke the next middleware.
Результат Psr\Http\Message\ResponseInterface A response

getName() защищенный метод

Returns the build name for a requested asset
protected getName ( AssetConfig $config, string $url ) : boolean | string
$config MiniAsset\AssetConfig The config object to use.
$url string The url to get an asset name from.
Результат boolean | string false if no build can be parsed from URL with url path otherwise

mapType() защищенный метод

Map an extension to a content type
protected mapType ( AssetTarget $build ) : string
$build MiniAsset\AssetTarget The build target.
Результат string The mapped content type.

respond() защищенный метод

Respond with the asset.
protected respond ( Psr\Http\Message\ResponseInterface $response, string $contents, AssetTarget $build ) : Psr\Http\Message\ResponseInterface
$response Psr\Http\Message\ResponseInterface The response to augment
$contents string The asset contents.
$build MiniAsset\AssetTarget The build target.
Результат Psr\Http\Message\ResponseInterface

Описание свойств

$config защищенное свойство

Object containing configuration settings for asset compressor
protected AssetConfig,MiniAsset $config
Результат MiniAsset\AssetConfig