forked from moodle/moodle
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
jerome
committed
Jan 29, 2009
1 parent
58e6c59
commit a520100
Showing
1 changed file
with
48 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
*/ | ||
|
||
?> |