pjdietz/shamserver
Composer 安装命令:
composer require pjdietz/shamserver
包简介
Build mini web servers in PHP for testing
关键字:
README 文档
README
ShamServer allows you to build mini web servers for testing.
It uses PHP's built in web server feature to spawn a separate process that listens for incoming requests and responds to them using the router script you provide.
use pjdietz\ShamServer\ShamServer; $host = "localhost"; $port = 8080; $router = "/path/to/my/router.php"; // Start up a testing web server. $server = new ShamServer($host, $port, $router); // A server is now listening at http://localhost:8080 // Shut down the web server. $server->stop();
StringShamServer
You can also use StringShamServer to create the router file for you. When you instantiate, pass a string containing the entirety of a PHP router script. The instance will write this to a temporary file, use it for the server, and them remove it.
// Create a server that always responds with a 401 status code. $host = "localhost"; $port = 8080; $router = "<?php http_response_code(401);"; $server = new StringShamServer($host, $port, $router);
Routers
For more information on how to write router scripts, see the PHP Manual.
Install
Add an entry for "pjdietz/shamserver" to your composer.json file's require or require-dev section.
Copyright and License
Copyright © 2014 by PJ Dietz Licensed under the MIT license
pjdietz/shamserver 适用场景与选型建议
pjdietz/shamserver 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 252 次下载、GitHub Stars 达 0, 最近一次更新时间为 2014 年 07 月 26 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「curl」 「http」 「webserver」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 pjdietz/shamserver 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 pjdietz/shamserver 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 pjdietz/shamserver 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
cURL and cURL based Soap-Client for PHP
repository php library
Simple cURL wrapper
Fine-tuning on the PHP built-in web server.
An minimal app http server based on PHP cli-server for use in tests
A fluent PHP CURL wrapper
统计信息
- 总下载量: 252
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 8
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2014-07-26