Merge branch 'MDL-49560-master' of git://github.com/gurgus/moodle
This commit is contained in:
@@ -273,11 +273,6 @@ class webservice_soap_server extends webservice_zend_server {
|
||||
*/
|
||||
protected function generate_simple_struct_class(external_single_structure $structdesc) {
|
||||
global $USER;
|
||||
// let's use unique class name, there might be problem in unit tests
|
||||
$classname = 'webservices_struct_class_000000';
|
||||
while(class_exists($classname)) {
|
||||
$classname++;
|
||||
}
|
||||
|
||||
$fields = array();
|
||||
foreach ($structdesc->keys as $name => $fieldsdesc) {
|
||||
@@ -286,6 +281,12 @@ class webservice_soap_server extends webservice_zend_server {
|
||||
' public $'.$name.';';
|
||||
}
|
||||
|
||||
// We do this after the call to get_phpdoc_type() to avoid duplicate class creation.
|
||||
$classname = 'webservices_struct_class_000000';
|
||||
while (class_exists($classname)) {
|
||||
$classname++;
|
||||
}
|
||||
|
||||
$code = '
|
||||
/**
|
||||
* Virtual struct class for web services for user id '.$USER->id.' in context '.$this->restricted_context->id.'.
|
||||
|
||||
Reference in New Issue
Block a user