dev-master
9999999-devwebmachine for PHP
BSD-3-Clause
The Requires
- symfony/http-foundation ~2.6
- php >=5.4
The Development Requires
Wallogit.com
2017 © Pedro Peláez
webmachine for PHP
restmachine is a webmachine implementation for PHP., (*2)
Webmachine brings HTTP semantic awareness to your application. It allows you to declaratively specify dynamic HTTP resources so you don't have to worry about implementation details., (*3)
Resource::create(self::defaults())
->allowedMethods(['GET', 'PUT', 'DELETE'])
->isProcessable(self::validator())
->canPutToMissing(false)
->isNew(false)
->isRespondWithEntity(function(Context $context) {
return $context->getRequest()->isMethod('PUT');
})
->exists(function($context) use ($db, $id) {
return Todo::exists($db, $id);
})
->put(function($context) use ($db, $id) {
Todo::update($db, $id, $context->entity);
})
->delete(function($context) use ($db, $id) {
Todo::delete($db, $id);
})
->handleOk(function(Context $context) use ($db, $id) {
return Todo::fetchOne($db, $id);
});
With composer:, (*4)
{
"require": {
"steos/restmachine": "dev-master"
}
}
restmachine currently requires PHP >= 7.4., (*5)
Credits go to, (*6)
clojure-liberator where we extracted the decision graph and which we heavily used as reference and documentation to understand the webmachine execution model, (*7)
Symfony HttpFoundation which RestMachine is built on., (*8)
This is beta software. Some functionality is still missing. There will be bugs. The API may still change, but should be fairly stable., (*9)
Utils::parseHttpDate)Copyright © 2020 Stefan Oestreicher and contributors., (*10)
Distributed under the terms of the BSD-3-Clause license., (*11)
webmachine for PHP
BSD-3-Clause