Handles serving plugin assets in development mode.
This should not be used in production environments as it has sub-optimal performance when compared to serving files with a real webserver.
string
The amount of time to cache the asset.
__construct(array $options)
Constructor.
array
$options optional The options to use
_getAssetFile(string $url)
Builds asset file path based off url
string
$url Asset URL
string|null
Absolute path for asset file, null on failure
deliverAsset(\Psr\Http\Message\ServerRequestInterface $request, \SplFileInfo $file)
Sends an asset file to the client
\Psr\Http\Message\ServerRequestInterface
$request The request object to use.
\SplFileInfo
$file The file wrapper for the file.
\Cake\Http\Response
The response with the file & headers.
isNotModified(\Psr\Http\Message\ServerRequestInterface $request, \SplFileInfo $file)
Check the not modified header.
\Psr\Http\Message\ServerRequestInterface
$request The request to check.
\SplFileInfo
$file The file object to compare.
bool
process(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Server\RequestHandlerInterface $handler)
Serve assets if the path matches one.
\Psr\Http\Message\ServerRequestInterface
$request The request.
\Psr\Http\Server\RequestHandlerInterface
$handler The request handler.
\Psr\Http\Message\ResponseInterface
A response.
The amount of time to cache the asset.
string
© 2005–present The Cake Software Foundation, Inc.
Licensed under the MIT License.
CakePHP is a registered trademark of Cake Software Foundation, Inc.
We are not endorsed by or affiliated with CakePHP.
https://api.cakephp.org/4.1/class-Cake.Routing.Middleware.AssetMiddleware.html