ppp / libmodule
Lib that helps the creation of PHP modules for the PPP
Installs: 2 034
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 7
Forks: 1
Open Issues: 1
Requires
- php: >=5.3.0
- ppp/data-model: *
This package is not auto-updated.
Last update: 2024-12-17 05:14:22 UTC
README
On Packagist:
Installation
Use one of the below methods:
1 - Use composer to install the library and all its dependencies using the master branch:
composer require "ppp/libmodule":"dev-master"
2 - Create a composer.json file that just defines a dependency on version 0.2 of this package, and run 'composer install' in the directory:
{
"require": {
"ppp/ppp/libmodule"": "~0.2.0"
}
}
Example
Here is a small usage example:
// Load everything require_once(__DIR__ . "/vendor/autoload.php"); // A very simple class implementing RequestHandler interface class MyRequestHandler implements PPP\Module\RequestHandler { public function buildResponse(PPP\Module\DataModel\ModuleRequest $request) { return new PPP\Module\DataModel\ModuleResponse( $request->getLanguageCode(), new PPP\DataModel\MissingNode(), 0 ); } } // Lets run the entry point! $entryPoint = new PPP\Module\ModuleEntryPoint(new MyRequestHandler()); $entryPoint->exec();