承接 luk-z/api-proxy-php 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

luk-z/api-proxy-php

最新稳定版本:v1.0.3

Composer 安装命令:

composer require luk-z/api-proxy-php

包简介

API Proxy written in PHP using Lumen framework

README 文档

README

Latest Stable Version

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

  1. Install as dependency
composer require luk-z/api-proxy-php
  1. Add custom includes To add custom Controllers and Routes just define these constants:
  1. 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 routes
  • APP_CUSTOM_INCLUDES_PATH
  • APP_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.

  1. Clone the repository:
git clone https://github.com/lukzed/api-proxy-php.git project_name && rm -rf ./project_name/.git
cd project_name
  1. Install suggested vscode extensions

  2. Copy the php-cs-fixer-wrapper.sh file:

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)

  1. 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

  1. 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)
  2. 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 configuration
  • phpunit.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.

统计信息

  • 总下载量: 4
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 3
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-05

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固