luk-z/api-proxy-php
Composer 安装命令:
composer require luk-z/api-proxy-php
包简介
API Proxy written in PHP using Lumen framework
README 文档
README
api-proxy-php
A PHP API proxy (headless) project built using the Lumen framework.
This is a lightweight API proxy built with Lumen (Laravel micro-framework). It provides a simple REST API structure without database or view management.
Usage in applications
- Install as dependency
composer require luk-z/api-proxy-php
- Add custom includes To add custom Controllers and Routes just define these constants:
- Copy the environment file:
cp .env.example .env
Required define
In order to work the following php define should be defined:
- APP_TABLE_APPS
These php defined are optional
APP_ADD_DEFAULT_ROUTES: add default hello world and test routesAPP_CUSTOM_INCLUDES_PATHAPP_CUSTOM_ROUTES_PATH
Requirements
- PHP 7.3 or higher
- Composer
Development
Setup local machine
To install dependencies php 7.3+ and composer are needed. Instead installing them in the local machine use a dockerized composer (requires Docker Desktop).
Create php and composer aliases following this guide.
- Clone the repository:
git clone https://github.com/lukzed/api-proxy-php.git project_name && rm -rf ./project_name/.git cd project_name
-
Install suggested vscode extensions
-
Copy the
php-cs-fixer-wrapper.shfile:
cp php-cs-fixer-wrapper.sh.example php-cs-fixer-wrapper.sh
change WORKSPACE_ROOT="<absolute path to your workspace>" inserting the application absolute path (use pwd command to obtain absolute path)
- Install dependencies:
composer install
Running the Application
Start the development server:
php -S localhost:8000 -t public
The application will be available at http://localhost:8000.
Development Tools
Code Quality and Formatting
This project includes PHP linting and formatting tools that work seamlessly with Visual Studio Code.
Tools Included
- PHP_CodeSniffer (PHPCS): Linter for detecting coding standard violations (PSR-12)
- PHP CS Fixer: Automatic code formatter
- PHPUnit: Testing framework for unit and integration tests
Visual Studio Code Setup
-
Install the recommended extensions when prompted, or manually install:
- PHP CS Fixer (
junstyle.php-cs-fixer) - PHP_CodeSniffer (
ikappas.phpcs) - PHP Intelephense (
bmewburn.vscode-intelephense-client)
- PHP CS Fixer (
-
The workspace settings (
.vscode/settings.json) are pre-configured to:- Enable format on save
- Run PHP CS Fixer automatically
- Show PHPCS violations in real-time
Command Line Usage
Check for coding standard violations:
composer lint
Automatically fix coding standard violations:
composer lint:fix
Format code using PHP CS Fixer:
composer format
Check what PHP CS Fixer would change (dry run):
composer format:check
Configuration Files
phpcs.xml- PHP_CodeSniffer configuration (PSR-12 standard).php-cs-fixer.php- PHP CS Fixer configurationphpunit.xml- PHPUnit configuration.vscode/settings.json- VS Code workspace settings.vscode/extensions.json- Recommended VS Code extensions
Testing
This project uses PHPUnit for testing.
Run all tests:
composer test
Run tests with coverage:
./vendor/bin/phpunit --coverage-html coverage
Tests are located in the tests/ directory and follow the PSR-12 coding standard.
API Endpoints
Root Endpoint
GET /
Returns the Lumen version information.
Hello World Endpoint
GET /hello
Returns a simple JSON response:
{
"message": "Hello World!"
}
Project Structure
.
├── app/
│ ├── Console/ # Console commands
│ ├── Exceptions/ # Exception handlers
│ └── Http/
│ └── Controllers/ # API controllers
├── bootstrap/ # Framework bootstrap
├── public/ # Public web root
├── routes/ # Route definitions
└── storage/ # Logs and cache
License
This project is open-sourced software licensed under the MIT license.
luk-z/api-proxy-php 适用场景与选型建议
luk-z/api-proxy-php 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 4 次下载、GitHub Stars 达 0, 最近一次更新时间为 2026 年 01 月 05 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「php」 「api」 「proxy」 「middleware」 「api-gateway」 「lumen」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 luk-z/api-proxy-php 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 luk-z/api-proxy-php 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 luk-z/api-proxy-php 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Lazy loading for middleware and request handlers
A PSR-7 compatible library for making CRUD API endpoints
Get working public proxy list for free by PubProxy (No API key required).
Alfabank REST API integration
Standalone proxy server in PHP sockets, I am using Guzzle to route the requests. Idea was if I can make HTTP Proxy Server in php to get more control over proxy and custom logic. Currently it only supports http requests you can choose port of your own choice plus if you want to make it public or priv
A ServiceProvider for setting trusted proxies in Laravel applications
统计信息
- 总下载量: 4
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 23
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-01-05