Download the PHP package luk-z/api-proxy-php without Composer
On this page you can find all versions of the php package luk-z/api-proxy-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download luk-z/api-proxy-php
More information about luk-z/api-proxy-php
Files in luk-z/api-proxy-php
Package api-proxy-php
Short Description API Proxy written in PHP using Lumen framework
License MIT
Homepage https://github.com/Luk-z/api-proxy-php
Informations about the package api-proxy-php
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
-
Add custom includes To add custom Controllers and Routes just define these constants:
- Copy the environment file:
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:
-
Install suggested vscode extensions
- Copy the
php-cs-fixer-wrapper.shfile:
change WORKSPACE_ROOT="<absolute path to your workspace>" inserting the application absolute path (use pwd command to obtain absolute path)
- Install dependencies:
Running the Application
Start the development server:
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:
Automatically fix coding standard violations:
Format code using PHP CS Fixer:
Check what PHP CS Fixer would change (dry run):
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:
Run tests with coverage:
Tests are located in the tests/ directory and follow the PSR-12 coding standard.
API Endpoints
Root Endpoint
Returns the Lumen version information.
Hello World Endpoint
Returns a simple JSON response:
Project Structure
License
This project is open-sourced software licensed under the MIT license.
All versions of api-proxy-php with dependencies
laravel/lumen-framework Version ^8.0
luk-z/php-api-token-auth Version ^0.1.18