mirrored from git://git.moodle.org/moodle.git
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MDL-12886 rewritten xmlrpc client, not finished yet - need to solve e…
…rror sending when exception occures outside of the executed method; the test client needs a lot of refactoring too
- Loading branch information
skodak
committed
Oct 19, 2009
1 parent
de61c75
commit d4e764a
Showing
9 changed files
with
253 additions
and
223 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
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,12 @@ | ||
<?php | ||
|
||
$webservice_xmlrpc_capabilities = array( | ||
|
||
'webservice/xmlrpc:use' => array( | ||
'captype' => 'read', // in fact this may be considered read and write at the same time | ||
'contextlevel' => CONTEXT_COURSE, // the context level should be probably CONTEXT_MODULE | ||
'legacy' => array( | ||
), | ||
), | ||
|
||
); |
This file was deleted.
Oops, something went wrong.
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,43 @@ | ||
<?php | ||
|
||
// This file is part of Moodle - http://moodle.org/ | ||
// | ||
// Moodle is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
// | ||
// Moodle is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU General Public License | ||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
/** | ||
* XML-RPC web service implementation classes and methods. | ||
* | ||
* @package webservice | ||
* @copyright 2009 Moodle Pty Ltd (http://moodle.com) | ||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later | ||
*/ | ||
|
||
require_once("$CFG->dirroot/webservice/lib.php"); | ||
|
||
/** | ||
* XML-RPC service server implementation. | ||
* @author Petr Skoda (skodak) | ||
*/ | ||
class webservice_xmlrpc_server extends webservice_zend_server { | ||
/** | ||
* Contructor | ||
*/ | ||
public function __construct() { | ||
parent::__construct('Zend_XmlRpc_Server'); | ||
$this->wsname = 'xmlrpc'; | ||
} | ||
|
||
|
||
} | ||
|
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 |
---|---|---|
@@ -1,46 +1,38 @@ | ||
<?php | ||
|
||
// This file is part of Moodle - http://moodle.org/ | ||
// | ||
// Moodle is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
// | ||
// Moodle is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU General Public License | ||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
/** | ||
* Moodle - Modular Object-Oriented Dynamic Learning Environment | ||
* http://moodle.com | ||
* | ||
* LICENSE | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation; either version 2 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details: | ||
* | ||
* http://www.gnu.org/copyleft/gpl.html | ||
* XML-RPC web service entry point. The authentication is done via tokens. | ||
* | ||
* @category Moodle | ||
* @package webservice | ||
* @copyright Copyright (c) 1999 onwards Martin Dougiamas http://dougiamas.com | ||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL License | ||
*/ | ||
/** | ||
* Main script - XML-RPC server | ||
* | ||
* @author Jerome Mouneyrac <jerome@moodle.com> | ||
* @version 1.0 | ||
* @package webservices | ||
* @copyright 2009 Moodle Pty Ltd (http://moodle.com) | ||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later | ||
*/ | ||
|
||
/* | ||
* Zend XML-RPC server | ||
*/ | ||
require_once(dirname(__FILE__) . '/../../config.php'); | ||
require_once('lib.php'); | ||
define('NO_MOODLE_COOKIES', true); | ||
|
||
require('../../config.php'); | ||
require_once("$CFG->dirroot/webservice/xmlrpc/locallib.php"); | ||
|
||
if (empty($CFG->enablewebservices)) { | ||
if (!webservice_protocol_is_enabled('xmlrpc')) { | ||
die; | ||
} | ||
|
||
$server = new xmlrpc_server(); | ||
$server->run(); | ||
$server = new webservice_xmlrpc_server(); | ||
$server->run(false); | ||
die; | ||
|
||
?> |
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,50 @@ | ||
<?php | ||
|
||
// This file is part of Moodle - http://moodle.org/ | ||
// | ||
// Moodle is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
// | ||
// Moodle is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU General Public License | ||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
/** | ||
* XML-RPC web service entry point. The authentication is done via tokens. | ||
* | ||
* @package webservice | ||
* @copyright 2009 Moodle Pty Ltd (http://moodle.com) | ||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later | ||
*/ | ||
|
||
define('NO_MOODLE_COOKIES', true); | ||
|
||
require('../../config.php'); | ||
require_once("$CFG->dirroot/webservice/xmlrpc/locallib.php"); | ||
|
||
//ob_start(); | ||
|
||
//TODO: for now disable all mess in xml | ||
ini_set('display_errors', '0'); | ||
ini_set('log_errors', '1'); | ||
$CFG->debug = 0; | ||
$CFG->debugdisplay = false; | ||
|
||
//error_log('yy'); | ||
//error_log(var_export($_SERVER, true)); | ||
|
||
if (!webservice_protocol_is_enabled('xmlrpc')) { | ||
die; | ||
} | ||
|
||
$server = new webservice_xmlrpc_server(); | ||
$server->run(true); | ||
die; | ||
|
||
|
Oops, something went wrong.