Download the PHP package sparkinzy/cap_php_server without Composer

On this page you can find all versions of the php package sparkinzy/cap_php_server. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package cap_php_server

Cap PHP Server

🔐 基于PHP的现代化CAPTCHA替代方案 - 使用SHA-256工作量证明机制

一个轻量级、高性能的开源安全验证库,通过计算密集型任务来区分人类用户与自动化机器人,提供无需用户交互的安全验证方式。

PHP Version License Composer

✨ 核心特性

🚀 高性能架构

🛡️ 企业级安全

🔌 开发友好

📦 生产就绪

高级配置示例

基本使用(推荐 - 优化版)

简化使用(兼容模式)

企业级配置

🔦 安装

Composer 安装(推荐)

手动安装

  1. 下载源码并解压
  2. src/ 目录包含到项目中
  3. 手动引入所需文件

🎨 前端集成

cap.js自动化集成

手动集成示例

🌐 HTTP服务器集成

内置PHP服务器(开发环境)

HTTP服务器实现

Nginx生产环境部署

项目提供了 index.php 作为Nginx服务器的入口点,支持生产环境部署:

快速部署步骤

生产特性

查看 DEPLOY_NGINX.md 获取完整的Nginx部署指南。

🛡️ 安全机制

验证流程

安全特性

🛡️ DDoS 防护

🔒 防重放攻击

🔍 审计日志

⏱️ 自动过期

⚙️ 配置选项

基础配置

选项 类型 默认值 描述
challengeCount int 3 挑战数量(影响计算时间)
challengeSize int 16 盐值大小(字节)
challengeDifficulty int 2 挑战难度(影响计算复杂度)
challengeExpires int 600 挑战过期时间(秒)
tokenExpires int 1200 令牌过期时间(秒)
tokenVerifyOnce bool true 一次性令牌验证

安全配置

选项 类型 默认值 描述
rateLimitRps int 10 每秒请求限制
rateLimitBurst int 50 突发容量
autoCleanupInterval int 300 自动清理间隔(秒)

存储配置

选项 类型 默认值 描述
storage StorageInterface MemoryStorage 存储实现
tokensStorePath string '.data/tokensList.json' 文件存储路径
redis array null Redis配置参数
noFSState bool false 禁用文件状态

配置示例

基础配置

安全配置

Redis配置

📊 性能与统计

性能指标

指标 人类用户 机器人 描述
计算时间 1-3秒 数分钟-数小时 基于SHA-256的工作量证明
防止率 <1% >95% 防止自动化攻击
验证成功率 >99% <5% 正常用户体验
API响应时间 <100ms <100ms 服务器响应性能

系统统计

📚 API 参考

💡 提示: 使用 cap.js 0.1.26 时,客户端会自动处理 /challenge/redeem 端点,你只需要监听 solve 事件并使用返回的验证令牌。

POST /challenge - 创建挑战

请求:

响应:

POST /redeem - 验证解决方案

请求:

响应:

POST /validate - 验证令牌

请求:

响应:

GET /stats - 获取统计信息

请求:

响应:

错误响应

所有API在出错时都会返回统一格式的错误信息:

⚙️ 配置选项

基础配置

选项 类型 默认值 描述
challengeCount int 3 挑战数量(影响计算时间)
challengeSize int 16 盐值大小(字节)
challengeDifficulty int 2 挑战难度(影响计算复杂度)
challengeExpires int 600 挑战过期时间(秒)
tokenExpires int 1200 令牌过期时间(秒)
tokenVerifyOnce bool true 一次性令牌验证

安全配置

选项 类型 默认值 描述
rateLimitRps int 10 每秒请求限制
rateLimitBurst int 50 突发容量
autoCleanupInterval int 300 自动清理间隔(秒)

存储配置

选项 类型 默认值 描述
storage StorageInterface MemoryStorage 存储实现
tokensStorePath string '.data/tokensList.json' 文件存储路径
redis array null Redis配置参数
noFSState bool false 禁用文件状态

配置示例

基础配置

安全配置

Redis配置

🔄 版本历史

v2.0.0 (2025) - 🚀 重大架构升级

v1.x - 基础版本

🤝 贡献指南

欢迎贡献代码和建议!请查看以下指南:

开发流程

  1. 🐛 问题反馈: Issues
  2. 🔀 代码贡献: Pull Requests
  3. 📖 文档改进: 帮助完善文档和示例
  4. 🧪 测试用例: 贡献更多测试场景

开发环境设置

代码规范

🙏 致谢

本项目的发展得益于以下优秀项目的启发:

📄 许可证

Apache-2.0 License - 详见 LICENSE 文件

👤 作者与维护

sparkinzy


**🌟 如果这个项目对你有帮助,请给个 Star ⭐** **💡 有问题或建议?欢迎提交 [Issue](https://github.com/sparkinzy/cap_php_server/issues)** **🚀 现代化、高性能、安全的 CAPTCHA 替代方案 - 让验证更简单!** Made with ❤️ by [sparkinzy](https://github.com/sparkinzy)

All versions of cap_php_server with dependencies

PHP Build Version
Package Version
Requires php Version >=7.4
ext-json Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package sparkinzy/cap_php_server contains the following files

Loading the files please wait ...