Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bearsunday/bear.project
A PSR-7 Resource Oriented project skeleton
https://github.com/bearsunday/bear.project
bearsunday psr7-middleware skeleton-application
Last synced: 27 days ago
JSON representation
A PSR-7 Resource Oriented project skeleton
- Host: GitHub
- URL: https://github.com/bearsunday/bear.project
- Owner: bearsunday
- Created: 2015-10-02T08:07:01.000Z (about 9 years ago)
- Default Branch: 1.x
- Last Pushed: 2017-08-26T01:47:13.000Z (over 7 years ago)
- Last Synced: 2024-11-18T07:00:00.945Z (about 1 month ago)
- Topics: bearsunday, psr7-middleware, skeleton-application
- Language: PHP
- Size: 285 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# A PSR-7 BEAR.Sunday application project skeleton
## Installing BEAR.Sunday PSR-7 application
```
composer create-project bear/project MyVendor.MyProject
cd MyVendor.MyProject
php -S 127.0.0.1:8080 -t public
```## PHP Streams for message bodies
```php
class Index extends ResourceObject
{
public function onGet(string $name = 'BEAR.Sunday') : ResourceObject
{
$fp = fopen(__DIR__ . '/image.jpg', 'r');
stream_filter_append($fp, 'convert.base64-encode');
$this->body = [
'greting' => 'Hello ' . $name,
'image' => $fp
];return $this;
}
}
``````
// curl -i http://127.0.0.1:8080HTTP/1.1 200 OK
Host: 127.0.0.1:8080
Connection: close
X-Powered-By: PHP/5.6.8
Content-Type: application/json{"greeting":"Hello BEAR.Sunday","image":"/9j/4AAQZJ ... rpu/l56H//Z"}
```
## DocumentationYou can read the documentation [here](http://bearsunday.github.io/).