PHPackages                             lfvcodes/microbridge-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. lfvcodes/microbridge-php

ActiveLibrary[API Development](/categories/api)

lfvcodes/microbridge-php
========================

PHP's lightweight microservice communicator

v1.0.0(9mo ago)211MITPHP

Since Aug 14Pushed 8mo agoCompare

[ Source](https://github.com/lfvcodes/MicroBridge-PHP)[ Packagist](https://packagist.org/packages/lfvcodes/microbridge-php)[ Docs](https://github.com/lfvcodes/microbridge-php)[ RSS](/packages/lfvcodes-microbridge-php/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)DependenciesVersions (2)Used By (0)

 [![](https://camo.githubusercontent.com/51e821c94429469d8ed78df7860169bc1b6fd60fd4c119ea94d979f46c9d73b1/68747470733a2f2f736b696c6c69636f6e732e6465762f69636f6e733f693d706870267065726c696e653d3135)](https://skillicons.dev) MicroBridge-PHP
 PHP's lightweight microservices/API communicator
==================================================================================================================================================================================================================================================================================================

[](#----microbridge-php--phps-lightweight-microservicesapi-communicator)

 MicroBridge-PHP is a lightweight (less than 500 lines of code) PHP 7.1+ tool for issuing internal API requests without network overhead.

 [ ![Packagist Version](https://camo.githubusercontent.com/c9fe96e537b245c85f14825a41d1beeac2b1db89e7eb0cfcd5d9d378b9524f74/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6c6676636f6465732f6d6963726f6272696467652d7068703f7374796c653d666c61742d737175617265) ](https://packagist.org/packages/lfvcodes/microbridge-php) [ ![Total Downloads](https://camo.githubusercontent.com/67c0ad8512412ff53534aff74b8fb283c86e23e22d2e6253653c99e475d9b8cb/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6c6676636f6465732f6d6963726f6272696467652d7068703f7374796c653d666c61742d737175617265) ](https://packagist.org/packages/lfvcodes/microbridge-php) [ ![License](https://camo.githubusercontent.com/ff6c251112d419d8b9d1f9409cd32ba1d2deedd7a0666d62a35f7dfc210b9817/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6c6676636f6465732f6d6963726f6272696467652d7068703f7374796c653d666c61742d737175617265) ](https://github.com/lfvcodes/microbridge-php/blob/main/LICENSE)

Features
--------

[](#features)

- **Lightweight**: Less than 500 lines of code
- **Zero Dependencies**: No external dependencies required
- **PHP 7.1+ Compatible**: Works with modern PHP versions
- **Multiple HTTP Methods**: Supports GET, POST, PUT, PATCH, DELETE
- **State Management**: Preserves and restores PHP superglobals
- **Error Handling**: Comprehensive error handling and validation
- **Stream Simulation**: Mock php://input stream for request body handling

Requirements
------------

[](#requirements)

- PHP 7.1 or higher
- Composer (recommended) or manual installation

Installation
------------

[](#installation)

### Using Composer (Recommended)

[](#using-composer-recommended)

Install by running:

```
composer require lfvcodes/microbridge-php
```

### Manual Installation

[](#manual-installation)

If you're not using Composer, you can manually integrate MicroBridge into your project by following these steps:

#### 1. Copy the Files

[](#1-copy-the-files)

Download or clone the repository and copy the `src/` folder into your project:

```
your-project/
├── src/
│   ├── MicroBridge.php
│   ├── RequestContext.php
│   └── MockPhpStream.php
└── your-code.php

```

#### 2. Manually Include the Classes

[](#2-manually-include-the-classes)

In your main file (`index.php` or similar), include the class file and use the namespace:

```

```

Usage
-----

[](#usage)

### Basic POST Request

[](#basic-post-request)

```
