mako/haste
Composer 安装命令:
composer require mako/haste
包简介
(Experimental) Boost your application performance by running it on a application server like FrankenPHP
关键字:
README 文档
README
The mako/haste package allows you to boost your application performance by running it on an application server like FrankenPHP.
The performance gains will vary based on the application but a basic "Hello, world!" application will run about 4-5 times faster than on a php+apache setup.
It is important to make sure that you do not leak data between requests by using static variables!
Requirements
Mako 12.0 or greater.
Setup
First you'll need to install the package as a dependency to your project.
composer require mako/haste
Next you'll have to replace the index.php contents with the following.
<?php use mako\haste\FrankenPhp; use mako\application\web\Application; /** * Include the application init file. */ include dirname(__DIR__) . '/app/init.php'; /* * Start and run the application. */ FrankenPhp::run(new Application(MAKO_APPLICATION_PATH));
That's it! Enjoy your (hopefully) improved performance 🎉
Docker setup
The following basic dockerfile will help to get you started:
FROM dunglas/frankenphp:1.11.2-php8.5 ARG USER=haste RUN install-php-extensions \ opcache \ pdo_mysql RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini" COPY . /app RUN mv ./php-overrides.ini /usr/local/etc/php/conf.d/. RUN useradd ${USER} RUN setcap CAP_NET_BIND_SERVICE=+eip /usr/local/bin/frankenphp RUN chown -R ${USER}:${USER} /data/caddy && chown -R ${USER}:${USER} /config/caddy RUN chown -R ${USER}:${USER} ./app/storage USER ${USER} ENV SERVER_NAME=:80 ENV FRANKENPHP_CONFIG="worker ./public/index.php" #ENV CADDY_GLOBAL_OPTIONS="debug"
Note that the example setup includes a
php-overrides.inifile with custom OPcache settings for optimal performance. These settings should work well in most cases, but feel free to customize them as needed.
expose_php = Off zend.exception_ignore_args=0 memory_limit=512M register_argc_argv = Off opcache.enable=1 opcache.memory_consumption=256 opcache.interned_strings_buffer=16 opcache.max_accelerated_files=20000 opcache.validate_timestamps=0
mako/haste 适用场景与选型建议
mako/haste 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 1.13k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2024 年 11 月 06 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「framework」 「mako」 「frankenphp」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 mako/haste 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 mako/haste 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 mako/haste 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
PHP Framework HLEB2 is the foundation of the web application. Provides ease of development and application performance.
The faithful assistant for your FrankenPHP Workers.
Generate routes based on OpenAPI specifications and OpenAPI specifications from code
A debug toolbar for the Mako Framework
A REPL for the Mako Framework
Mako Framework
统计信息
- 总下载量: 1.13k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 26
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: BSD-3-Clause
- 更新时间: 2024-11-06