atk14/cloudflare-env-adjuster
最新稳定版本:v0.1.2
Composer 安装命令:
composer require atk14/cloudflare-env-adjuster
包简介
Adjust the environment of a web app behind Cloudflare protection.
README 文档
README
Adjust the environment of a web app behind Cloudflare protection.
Basically if CloudflareEnvAdjuster detects that the remote address in the current request is from one of Cloudflare's ranges, it transparently replaces $_SERVER["REMOTE_ADDR"] with $_SERVER["HTTP_X_FORWARDED_FOR"] and stores the original REMOTE_ADDR into $_SERVER["X_CF_REMOTE_ADDR"].
Usage in an ATK14 application
<?php
// file: config/after_initialize.php
CloudflareEnvAdjuster::AdjustEnv();
Usage in a non-ATK14 application
Place the call to CloudflareEnvAdjuster::AdjustEnv() as close to the beginning of your PHP script as you can.
Installation
Just use the Composer:
composer require atk14/cloudflare-env-adjuster
License
CloudflareEnvAdjuster is free software distributed under the terms of the MIT license
统计信息
- 总下载量: 49
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 4
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-07-24