PHP 클래스 AssetCompress\Middleware\AssetCompressMiddleware

파일 보기 프로젝트 열기: markstory/asset_compress

보호된 프로퍼티들

프로퍼티 타입 설명
$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