Skip to content
This repository has been archived by the owner on Jun 14, 2023. It is now read-only.

Commit

Permalink
Extend README.md; Basic init for CHANGELOG
Browse files Browse the repository at this point in the history
  • Loading branch information
pachico committed Feb 9, 2018
1 parent 1f7cdd2 commit 4355be5
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 3 deletions.
6 changes: 4 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@ All notable changes to `slim-swoole` will be documented in this file.

Updates should follow the [Keep a CHANGELOG](http://keepachangelog.com/) principles.

## NEXT - YYYY-MM-DD
## [Unreleased]

### Added
- Nothing
- Basic functionality
- Basic example
- Basic documentation

### Deprecated
- Nothing
Expand Down
29 changes: 28 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,34 @@

This is a brige library to run [Slim framework](https://www.slimframework.com/) Slim framework applications using [Swoole engine](https://www.swoole.co.uk/).

It is still in development so any contribution and test will be more than welcome.
## Overview

The main purpose of this library is to easily run your already existing SlimPHP applications using Swoole Framework.
It requires you to bootstrap your application only once when you start Swoole HTTP server and, thanks to its event driven design, it will process each request reusing your already started application for better performance.

The execution sequence is as follows:

1. You bootstrap your SlimPHP application as you would normally do.
2. You instantiate the `BrigeManager` passing to it your SlimPHP application.
3. You start Swoole's HTTP server.
4. You bind to the `on('request')` event handler the `BridgeManager` instance which will:
1. Transform the Swoole request to a SlimPHP based on server and request attributes.
2. Process your request through SlimPHP's application stack (including middlewares)
3. Merge SlimPHP Response to Swoole Response
4. End the request.
All this is done under the hood, so you will just need to call:

```php
$bridgeManager->process($swooleRequest, $swooleResponse)->end();
```
(See usage paragraph for a complete example.)

**Caution**: it is still in development so any contribution and test will be more than welcome.

## Requirements

* PHP-CLI >= 5.6
* Swoole framework (this has been tested with version 1.10.1)

## Install

Expand Down
8 changes: 8 additions & 0 deletions tests/Integration/AbstractTestCase.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php

namespace Pachico\SlimSwooleUnitTest;

abstract class AbstractTestCase extends \PHPUnit\Framework\TestCase
{

}

0 comments on commit 4355be5

Please sign in to comment.