web service MDL-12886 AMF server

This commit is contained in:
jerome 2009-01-29 08:26:00 +00:00
parent 58e6c593f4
commit a520100b5d

48
webservice/amf/server.php Normal file
View File

@ -0,0 +1,48 @@
<?php
/**
* Created on 01/20/2009
*
* AMF Moodle server.
*
* @author Jerome Mouneyrac
*/
require_once(dirname(__FILE__) . '/../../config.php');
include "Zend/Loader.php";
Zend_Loader::registerAutoload();
if (empty($CFG->enablewebservices)) {
die;
}
/*
* FULL SERVER
*
*/
//retrieve the api name
$classpath = optional_param(classpath,'user',PARAM_ALPHA);
require_once(dirname(__FILE__) . '/../../'.$classpath.'/external.php');
/// run the server
$server = new Zend_Amf_Server();
$server->setClass($classpath."_external");
$response = $server->handle();
echo $response;
/*
*
varlog("-- The Moodle AMF server is running --");
//basic test server
$server = new Zend_Amf_Server();
$server->addFunction('hello');
$response = $server->handle();
echo $response;
function hello($name, $greeting = 'The Moodle server say Hi to')
{
varlog($greeting . ', ' . $name);
return $greeting . ', ' . $name;
}
*/
?>