A microdata-based API server written in PHP using PostgreSQL
A PHP implementation of shgysk8zer0/api-specs using PostgreSQL.
git submodule add git://github.com/superuserdev/schemaserver.git path/to/classes/superuserdev/schemaserver
If you or on Fedora, install PostgreSQL using:
sudo dnf install php-pgsql
<?php
namespace Project\Example;
// Setup auto-loading using `spl_autoload`
set_include_path(realpath('path/to/classes') . PATH_SEPARATOR . get_include_path());
spl_autoload_extensions('.php');
spl_autoload_register();
// Alias
use \SuperUserDev\SchemaServer\{Thing}
// Use (need to set Content-Type header)
header('Content-Type: ' . Thing::CONTENT_TYPE);
$thing = new Thing();
$thing->name = 'Thing 1';
echo json_encode($thing);