Skip to content

Commit

Permalink
web service MDL-12886 AMF server
Browse files Browse the repository at this point in the history
  • Loading branch information
jerome committed Jan 29, 2009
1 parent 58e6c59 commit a520100
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions webservice/amf/server.php
Original file line number Diff line number Diff line change
@@ -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;
}
*/

?>

0 comments on commit a520100

Please sign in to comment.