https://github.com/jbenner-radham/sleepy-server-php
A RESTful PHP native C library. It's not really working at all right now and is an experiment, we'll see how it goes...
https://github.com/jbenner-radham/sleepy-server-php
Last synced: 3 months ago
JSON representation
A RESTful PHP native C library. It's not really working at all right now and is an experiment, we'll see how it goes...
- Host: GitHub
- URL: https://github.com/jbenner-radham/sleepy-server-php
- Owner: jbenner-radham
- License: mit
- Created: 2013-12-04T05:11:44.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2014-04-18T00:41:55.000Z (over 11 years ago)
- Last Synced: 2025-06-08T04:25:35.948Z (4 months ago)
- Language: C
- Size: 262 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
sleepy-server-php
=================A RESTful PHP native C library. It's not really anything at all right now and is an experiment, we'll see how it goes...
Class Constants
---------------```php
Sleepy::HTTP_ACCEPT;
Sleepy::QUERY_STRING;
Sleepy::REQUEST_METHOD;
Sleepy::REQUEST_URI;
Sleepy::RESPONSE_CODE
```Class Methods
-------------### `Sleepy::createJsonResponse([array]);`
Sets the appropriate header and then encodes JSON from the provided array.
### `Sleepy::encodeJson([array]);`
The equivalent of `json_encode([array], JSON_PRETTY_PRINT);`
### `Sleepy::setJsonHeader();`
Sets the `Content-Type` header to `application/json`.
### `Sleepy::setStatusCode($status_code);`
Sets the HTTP status code as the provided integer.
Building
--------```
phpize
./configure
make clean
make
make install
```Or if you have a shell environment and are lazy like me...
```
./lazy-build.sh
```