12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- h1. Introduction
- This library is an implementation of the PENS specification (see http:
- h1. Requirements
- You need at least PHP 5.2 with the curl extension installed to use this library.
- h1. State
- Currently, some features are missing (such as the possibility to send alerts or the possibility to send receipts to a mailto url), and the library is not considered as stable.
- h1. How do I create a server ?
- Assuming the URL of your server is http://www.myserver.com, create a file called pens.php at the root so that it is accessible through http://www.myserver.com/pens.php.
- In this file, write the following code:
- pre.. // Assuming the library is accessible through pens/pens.php
- require_once("pens/pens.php");
- class MyPackageHandler extends PENSPackageHandler {
-
- public function processPackage($request, $path_to_package) {
-
- }
- }
- $handler = new MyPackageHandler();
- $handler->setSupportedPackageTypes(array("scorm-pif"));
- $handler->setSupportedPackageFormats(array("zip"));
- $server = PENSServer::singleton();
- $server->setPackageHandler($handler);
- $server->receiveCollect();
- h1. How do I create a client ?
- The role of the PENSClient is simply to receive receipts and alerts from the server and process them. Here is how to create a client.
- pre.. require_once("pens/pens.php");
- class MyRequestHandler extends PENSRequestHandler {
- public function processRequest($request, $response) {
-
- }
- }
- $handler = new MyRequestHandler();
- $client = PENSClient::singleton();
- $client->setRequestHandler($handler);
- $client->receiveRequest();
- h1. Licence
- The php-pens library is published under the GNU GPL 3 licence (see COPYING)
- h1. Credits
- The author of the library is Guillaume Viguier-Just <guillaume@viguierjust.com> and this library has been realized mainly for use in the Chamilo project (http://www.chamilo.org).
- This library was realized as part of my work in Beeznest Latino (http://www.beeznest.com), for the Chamilo project.
- Also note the use of a library called rfc2396regexes written by Rudy Desjardins and distributed as GPL v2
|