project project
BEAR.Sunday psr7 skeleton.
bear/project
BEAR.Sunday psr7 skeleton.
- Saturday, August 26, 2017
- by koriym
- Repository
- 2 Watchers
- 2 Stars
- 47 Installations
- PHP
- 0 Dependents
- 0 Suggesters
- 0 Forks
- 1 Open issues
- 3 Versions
- 0 % Grown
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
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:8080
HTTP/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"}
Documentation
You can read the documentation here., (*1)
1.x-dev
1.9999999.9999999.9999999-dev
BEAR.Sunday psr7 skeleton.
Sources
Download
MIT
The Requires
The Development Requires
0.2.0
0.2.0.0
BEAR.Sunday psr7 skeleton.
Sources
Download
MIT
The Requires
The Development Requires
0.1.0
0.1.0.0
A Resource Oriented project skeleton.
Sources
Download
MIT
The Requires