wyrihaximus / react-http-middleware-webroot-preload
react/http中间件静态webroot服务
2.3.1
2023-01-14 19:58 UTC
Requires
- php: ^7.4 || ^8.0
- ancarda/psr7-string-stream: ^1.3
- league/mime-type-detection: ^1.9
- psr/http-message: ^1
- psr/log: ^3 || ^2 || ^1.1
- react/cache: ^1
- react/http: ^1
- react/promise: ^2.8
- scriptfusion/byte-formatter: ^3.2 || ^4.0
- thecodingmachine/safe: ^2 || ^1.3
- wyrihaximus/constants: ^1.5
Requires (Dev)
- brunty/cigar: ^1.12
- wyrihaximus/async-test-utilities: ^4.2
- dev-master
- 304.x-dev
- 2.3.1
- 2.3.0
- 2.2.0
- 2.1.1
- 2.1.0
- 2.0.0
- 1.5.0
- 1.4.0
- 1.3.0
- 1.2.0
- 1.1.1
- 1.1.0
- 1.0.0
- dev-renovate/configure
- dev-dependabot/composer/composer/composer-1.10.27
- dev-dependabot/composer/guzzlehttp/psr7-2.5.0
- dev-dependabot/composer/psr/http-message-1.1
- dev-replace-mime-detector-with-one-that-supports-php-8
- dev-add-missing-thecodingmachine-safe
- dev-etag
- dev-use-react-cache-instead-of-an-array
- dev-imgbot
- dev-smoke
This package is auto-updated.
Last update: 2024-09-05 09:49:26 UTC
README
安装
要通过Composer安装,请使用以下命令,它将自动检测最新版本并将其绑定到^
。
composer require wyrihaximus/react-http-middleware-webroot-preload
用法
中间件接受两个参数,首先是webroot目录,其次是可选的PSR-3日志记录器。需要注意的是,webroot中的所有文件都将被服务,无论文件类型如何。因此,不应包含PHP文件或包含密码等的文件。
$webroot = '/var/www/'; $logger = new Psr3Logger(); // Require, PSR-3 logger for bootstrap logging $cache = new ArrayCache(); // Required, custom cache configuration $server = new Server([ /** Other middleware */ new WebrootPreloadMiddleware($webroot, $logger, $cache), /** Other middleware */ ]);
许可
MIT许可(MIT)
版权所有 © 2017 Cees-Jan Kiewiet
特此授予任何人免费获得此软件及其相关文档文件(“软件”)的副本(以下简称“软件”),在软件上不受限制地进行交易,包括但不限于使用、复制、修改、合并、发布、分发、再许可和/或出售软件副本,并允许获得软件的人进行此类交易,前提是遵守以下条件
上述版权声明和本许可声明应包含在软件的所有副本或主要部分中。
软件按“原样”提供,不提供任何明示或暗示的保证,包括但不限于适销性、特定用途适用性和非侵权性保证。在任何情况下,作者或版权所有者均不对任何索赔、损害或其他责任负责,无论是基于合同、侵权或其他法律依据,无论该索赔、损害或其他责任是否源于、产生于或与软件或其使用或其他交易有关。