MDL-24321 switching to stdClass in /lib/

This commit is contained in:
Petr Skoda 2010-09-21 08:07:44 +00:00
parent ac6f1a82f9
commit 365a594107
40 changed files with 157 additions and 157 deletions

View File

@ -1689,7 +1689,7 @@ function create_context($contextlevel, $instanceid, $strictness=IGNORE_MISSING)
return get_system_context();
}
$context = new object();
$context = new stdClass();
$context->contextlevel = $contextlevel;
$context->instanceid = $instanceid;
@ -1843,7 +1843,7 @@ function get_system_context($cache=true) {
global $DB, $ACCESSLIB_PRIVATE;
if ($cache and defined('SYSCONTEXTID')) {
if (is_null($ACCESSLIB_PRIVATE->systemcontext)) {
$ACCESSLIB_PRIVATE->systemcontext = new object();
$ACCESSLIB_PRIVATE->systemcontext = new stdClass();
$ACCESSLIB_PRIVATE->systemcontext->id = SYSCONTEXTID;
$ACCESSLIB_PRIVATE->systemcontext->contextlevel = CONTEXT_SYSTEM;
$ACCESSLIB_PRIVATE->systemcontext->instanceid = 0;
@ -1860,7 +1860,7 @@ function get_system_context($cache=true) {
}
if (!$context) {
$context = new object();
$context = new stdClass();
$context->contextlevel = CONTEXT_SYSTEM;
$context->instanceid = 0;
$context->depth = 1;
@ -2350,7 +2350,7 @@ function create_role($name, $shortname, $description, $archetype='') {
$context = get_context_instance(CONTEXT_SYSTEM);
// Insert the role record.
$role = new object();
$role = new stdClass();
$role->name = $name;
$role->shortname = $shortname;
$role->description = $description;
@ -2424,7 +2424,7 @@ function assign_capability($capability, $permission, $roleid, $contextid, $overw
return true;
}
$cap = new object;
$cap = new stdClass();
$cap->contextid = $contextid;
$cap->roleid = $roleid;
$cap->capability = $capability;
@ -2581,7 +2581,7 @@ function role_assign($roleid, $userid, $contextid, $component = '', $itemid = 0,
}
// Create a new entry
$ra = new object();
$ra = new stdClass();
$ra->roleid = $roleid;
$ra->contextid = $context->id;
$ra->userid = $userid;
@ -3265,13 +3265,13 @@ function update_capabilities($component='moodle') {
$filecaps[$cachedcap->name]['riskbitmask'] = 0; // no risk if not specified
}
if ($cachedcap->captype != $filecaps[$cachedcap->name]['captype']) {
$updatecap = new object();
$updatecap = new stdClass();
$updatecap->id = $cachedcap->id;
$updatecap->captype = $filecaps[$cachedcap->name]['captype'];
$DB->update_record('capabilities', $updatecap);
}
if ($cachedcap->riskbitmask != $filecaps[$cachedcap->name]['riskbitmask']) {
$updatecap = new object();
$updatecap = new stdClass();
$updatecap->id = $cachedcap->id;
$updatecap->riskbitmask = $filecaps[$cachedcap->name]['riskbitmask'];
$DB->update_record('capabilities', $updatecap);
@ -3281,7 +3281,7 @@ function update_capabilities($component='moodle') {
$filecaps[$cachedcap->name]['contextlevel'] = 0; // no context level defined
}
if ($cachedcap->contextlevel != $filecaps[$cachedcap->name]['contextlevel']) {
$updatecap = new object();
$updatecap = new stdClass();
$updatecap->id = $cachedcap->id;
$updatecap->contextlevel = $filecaps[$cachedcap->name]['contextlevel'];
$DB->update_record('capabilities', $updatecap);
@ -3304,7 +3304,7 @@ function update_capabilities($component='moodle') {
}
// Add new capabilities to the stored definition.
foreach ($newcaps as $capname => $capdef) {
$capability = new object();
$capability = new stdClass();
$capability->name = $capname;
$capability->captype = $capdef['captype'];
$capability->contextlevel = $capdef['contextlevel'];
@ -4315,7 +4315,7 @@ function get_user_roles($context, $userid=0, $checkparentcontexts=true, $order='
function allow_override($sroleid, $troleid) {
global $DB;
$record = new object();
$record = new stdClass();
$record->roleid = $sroleid;
$record->allowoverride = $troleid;
$DB->insert_record('role_allow_override', $record);
@ -4332,7 +4332,7 @@ function allow_override($sroleid, $troleid) {
function allow_assign($fromroleid, $targetroleid) {
global $DB;
$record = new object();
$record = new stdClass();
$record->roleid = $fromroleid;
$record->allowassign = $targetroleid;
$DB->insert_record('role_allow_assign', $record);
@ -4349,7 +4349,7 @@ function allow_assign($fromroleid, $targetroleid) {
function allow_switch($fromroleid, $targetroleid) {
global $DB;
$record = new object();
$record = new stdClass();
$record->roleid = $fromroleid;
$record->allowswitch = $targetroleid;
$DB->insert_record('role_allow_switch', $record);
@ -5796,7 +5796,7 @@ function context_instance_preload(stdClass $rec) {
}
// note: in PHP5 the objects are passed by reference, no need to return $rec
$context = new object();
$context = new stdClass();
$context->id = $rec->ctxid; unset($rec->ctxid);
$context->path = $rec->ctxpath; unset($rec->ctxpath);
$context->depth = $rec->ctxdepth; unset($rec->ctxdepth);
@ -5876,7 +5876,7 @@ function fix_role_sortorder($allroles) {
foreach ($allroles as $role) {
$rolesort[$i] = $role->id;
if ($role->sortorder != $i) {
$r = new object();
$r = new stdClass();
$r->id = $role->id;
$r->sortorder = $i;
$DB->update_record('role', $r);

View File

@ -1063,7 +1063,7 @@ class admin_externalpage implements part_of_admin_tree {
$found = true;
}
if ($found) {
$result = new object();
$result = new stdClass();
$result->page = $this;
$result->settings = array();
return array($this->name => $result);
@ -1146,7 +1146,7 @@ class admin_settingpage implements part_of_admin_tree {
* if you specify something other than system or front page. Defaults to system.
*/
public function __construct($name, $visiblename, $req_capability='moodle/site:config', $hidden=false, $context=NULL) {
$this->settings = new object();
$this->settings = new stdClass();
$this->name = $name;
$this->visiblename = $visiblename;
if (is_array($req_capability)) {
@ -1194,7 +1194,7 @@ class admin_settingpage implements part_of_admin_tree {
}
if ($found) {
$result = new object();
$result = new stdClass();
$result->page = $this;
$result->settings = $found;
return array($this->name => $result);
@ -1209,7 +1209,7 @@ class admin_settingpage implements part_of_admin_tree {
$found = true;
}
if ($found) {
$result = new object();
$result = new stdClass();
$result->page = $this;
$result->settings = array();
return array($this->name => $result);
@ -1437,7 +1437,7 @@ abstract class admin_setting {
set_config($name, $value, $this->plugin);
// log change
$log = new object();
$log = new stdClass();
$log->userid = during_initial_install() ? 0 :$USER->id; // 0 as user id during install
$log->timemodified = time();
$log->plugin = $this->plugin;
@ -3076,7 +3076,7 @@ class admin_setting_sitesetcheckbox extends admin_setting_configcheckbox {
*/
public function write_setting($data) {
global $DB, $SITE;
$record = new object();
$record = new stdClass();
$record->id = SITEID;
$record->{$this->name} = ($data == '1' ? 1 : 0);
$record->timemodified = time();
@ -3135,7 +3135,7 @@ class admin_setting_sitesettext extends admin_setting_configtext {
return $validated;
}
$record = new object();
$record = new stdClass();
$record->id = SITEID;
$record->{$this->name} = $data;
$record->timemodified = time();
@ -3176,7 +3176,7 @@ class admin_setting_special_frontpagedesc extends admin_setting {
*/
public function write_setting($data) {
global $DB, $SITE;
$record = new object();
$record = new stdClass();
$record->id = SITEID;
$record->{$this->name} = $data;
$record->timemodified = time();
@ -4442,7 +4442,7 @@ class admin_page_managemods extends admin_externalpage {
}
}
if ($found) {
$result = new object();
$result = new stdClass();
$result->page = $this;
$result->settings = array();
return array($this->name => $result);
@ -4695,7 +4695,7 @@ class admin_page_manageblocks extends admin_externalpage {
}
}
if ($found) {
$result = new object();
$result = new stdClass();
$result->page = $this;
$result->settings = array();
return array($this->name => $result);
@ -4742,7 +4742,7 @@ class admin_page_manageqtypes extends admin_externalpage {
}
}
if ($found) {
$result = new object();
$result = new stdClass();
$result->page = $this;
$result->settings = array();
return array($this->name => $result);
@ -5651,7 +5651,7 @@ function admin_write_settings($formdata) {
$original = serialize($setting->get_setting()); // comparison must work for arrays too
$error = $setting->write_setting($data[$fullname]);
if ($error !== '') {
$adminroot->errors[$fullname] = new object();
$adminroot->errors[$fullname] = new stdClass();
$adminroot->errors[$fullname]->data = $data[$fullname];
$adminroot->errors[$fullname]->id = $setting->get_id();
$adminroot->errors[$fullname]->error = $error;
@ -7022,7 +7022,7 @@ class admin_setting_managewebserviceprotocols extends admin_setting {
foreach ($protocols_available as $protocol => $location) {
$name = get_string('pluginname', 'webservice_'.$protocol);
$plugin = new object();
$plugin = new stdClass();
if (file_exists($CFG->dirroot.'/webservice/'.$protocol.'/version.php')) {
include($CFG->dirroot.'/webservice/'.$protocol.'/version.php');
}

View File

@ -1413,7 +1413,7 @@ function block_method_result($blockname, $method, $param = NULL) {
}
/**
* Creates a new object of the specified block class.
* Creates a new instance of the specified block class.
*
* @param string $blockname the name of the block.
* @param $instance block_instances DB table row (optional).

View File

@ -249,7 +249,7 @@ class completion_criteria_activity extends completion_criteria {
global $DB, $CFG;
// Get completion info
$course = new object();
$course = new stdClass();
$course->id = $completion->course;
$info = new completion_info($course);

View File

@ -205,7 +205,7 @@ class completion_criteria_course extends completion_criteria {
global $CFG, $DB;
// Get completion info
$course = new object();
$course = new stdClass();
$course->id = $completion->course;
$info = new completion_info($course);

View File

@ -230,7 +230,7 @@ abstract class data_object {
* Returns object with fields and values that are defined in database
*/
public function get_record_data() {
$data = new object();
$data = new stdClass();
foreach ($this as $var=>$value) {
if (in_array($var, $this->required_fields) or array_key_exists($var, $this->optional_fields)) {

View File

@ -918,7 +918,7 @@ function get_course_category($catid=0) {
$category = reset($category);
} else {
$cat = new object();
$cat = new stdClass();
$cat->name = get_string('miscellaneous');
$cat->depth = 1;
$cat->sortorder = MAX_COURSES_IN_CATEGORY;
@ -1727,7 +1727,7 @@ function user_accesstime_log($courseid=0) {
/// Update $USER->lastaccess for next checks
$USER->lastaccess = $timenow;
$last = new object();
$last = new stdClass();
$last->id = $USER->id;
$last->lastip = getremoteaddr();
$last->lastaccess = $timenow;
@ -1749,7 +1749,7 @@ function user_accesstime_log($courseid=0) {
// Update course lastaccess for next checks
$USER->currentcourseaccess[$courseid] = $timenow;
$last = new object();
$last = new stdClass();
$last->userid = $USER->id;
$last->courseid = $courseid;
$last->timeaccess = $timenow;
@ -1892,7 +1892,7 @@ function count_login_failures($mode, $username, $lastlogin) {
$params = array('mode'=>$mode, 'username'=>$username, 'lastlogin'=>$lastlogin);
$select = "module='login' AND action='error' AND time > :lastlogin";
$count = new object();
$count = new stdClass();
if (is_siteadmin()) {
if ($count->attempts = $DB->count_records_select('log', $select, $params)) {

View File

@ -37,7 +37,7 @@ function xmldb_main_install() {
/// create site course
$newsite = new object();
$newsite = new stdClass();
$newsite->fullname = '';
$newsite->shortname = '';
$newsite->summary = NULL;
@ -82,7 +82,7 @@ function xmldb_main_install() {
/// bootstrap mnet
$mnethost = new object();
$mnethost = new stdClass();
$mnethost->wwwroot = $CFG->wwwroot;
$mnethost->name = '';
$mnethost->name = '';
@ -106,7 +106,7 @@ function xmldb_main_install() {
set_config('mnet_localhost_id', $mnetid);
// Initial insert of mnet applications info
$mnet_app = new object();
$mnet_app = new stdClass();
$mnet_app->name = 'moodle';
$mnet_app->display_name = 'Moodle';
$mnet_app->xmlrpc_server_url = '/mnet/xmlrpc/server.php';
@ -114,7 +114,7 @@ function xmldb_main_install() {
$mnet_app->sso_jump_url = '/auth/mnet/jump.php';
$moodleapplicationid = $DB->insert_record('mnet_application', $mnet_app);
$mnet_app = new object();
$mnet_app = new stdClass();
$mnet_app->name = 'mahara';
$mnet_app->display_name = 'Mahara';
$mnet_app->xmlrpc_server_url = '/api/xmlrpc/server.php';
@ -123,7 +123,7 @@ function xmldb_main_install() {
$DB->insert_record('mnet_application', $mnet_app);
// Set up the probably-to-be-removed-soon 'All hosts' record
$mnetallhosts = new object();
$mnetallhosts = new stdClass();
$mnetallhosts->wwwroot = '';
$mnetallhosts->ip_address = '';
$mnetallhosts->public_key = '';
@ -137,7 +137,7 @@ function xmldb_main_install() {
set_config('mnet_all_hosts_id', $mnetallhosts->id);
/// Create guest record - do not assign any role, guest user get's the default guest role automatically on the fly
$guest = new object();
$guest = new stdClass();
$guest->auth = 'manual';
$guest->username = 'guest';
$guest->password = hash_internal_user_password('guest');
@ -158,7 +158,7 @@ function xmldb_main_install() {
/// Now create admin user
$admin = new object();
$admin = new stdClass();
$admin->auth = 'manual';
$admin->firstname = get_string('admin');
$admin->lastname = get_string('user');
@ -264,7 +264,7 @@ function xmldb_main_install() {
license_manager::install_licenses();
/// Add two lines of data into this new table
$mypage = new object();
$mypage = new stdClass();
$mypage->userid = NULL;
$mypage->name = '__default';
$mypage->private = 0;

View File

@ -1788,7 +1788,7 @@ WHERE gradeitemid IS NOT NULL AND grademax IS NOT NULL");
if (!isset($blocks[$stickyblock->blockid]) || empty($blocks[$stickyblock->blockid]->name)) {
continue;
}
$newblock = new object();
$newblock = new stdClass();
$newblock->blockname = $blocks[$stickyblock->blockid]->name;
$newblock->contextid = $syscontext->id;
$newblock->showinsubcontexts = 1;
@ -3034,7 +3034,7 @@ WHERE gradeitemid IS NOT NULL AND grademax IS NOT NULL");
$existingrolecontextlevels->close();
// Put the data into the database.
$rcl = new object();
$rcl = new stdClass();
foreach ($rolecontextlevels as $roleid => $contextlevels) {
$rcl->roleid = $roleid;
foreach ($contextlevels as $level) {
@ -3593,7 +3593,7 @@ WHERE gradeitemid IS NOT NULL AND grademax IS NOT NULL");
}
/// Add two lines of data into this new table. These are the default pages.
$mypage = new object();
$mypage = new stdClass();
$mypage->userid = NULL;
$mypage->name = '__default';
$mypage->private = 0;

View File

@ -105,7 +105,7 @@ class ddl_field_missing_exception extends ddl_exception {
* @param string $debuginfo
*/
function __construct($fieldname, $tablename, $debuginfo=null) {
$a = new object();
$a = new stdClass();
$a->fieldname = $fieldname;
$a->tablename = $tablename;
parent::__construct('ddlfieldnotexist', $a, $debuginfo);
@ -138,7 +138,7 @@ class ddl_change_structure_exception extends ddl_exception {
class ddl_dependency_exception extends ddl_exception {
function __construct($targettype, $targetname, $offendingtype, $offendingname, $debuginfo=null) {
$a = new object();
$a = new stdClass();
$a->targettype = $targettype;
$a->targetname = $targetname;
$a->offendingtype = $offendingtype;

View File

@ -2821,7 +2821,7 @@ function print_user_picture($user, $courseid, $picture=NULL, $size=0, $return=fa
if (!is_object($user)) {
$userid = $user;
$user = new object();
$user = new stdClass();
$user->id = $userid;
}

View File

@ -84,7 +84,7 @@ abstract class xml_database_importer extends database_importer {
if (isset($this->current_row) || !isset($this->current_table)) {
throw new dbtransfer_exception('malformedxmlexception');
}
$this->current_row = new object();
$this->current_row = new stdClass();
break;
case 'field' :
if (isset($this->current_field) || !isset($this->current_row)) {

View File

@ -829,7 +829,7 @@ abstract class enrol_plugin {
if (!isset($this->config)) {
$name = $this->get_name();
if (!$config = get_config("enrol_$name")) {
$config = new object();
$config = new stdClass();
}
$this->config = $config;
}
@ -981,7 +981,7 @@ abstract class enrol_plugin {
$DB->update_record('user_enrolments', $ue);
}
} else {
$ue = new object();
$ue = new stdClass();
$ue->enrolid = $instance->id;
$ue->status = ENROL_USER_ACTIVE;
$ue->userid = $userid;
@ -1286,7 +1286,7 @@ abstract class enrol_plugin {
throw new coding_exception('Invalid request to add enrol instance to frontpage.');
}
$instance = new object();
$instance = new stdClass();
$instance->enrol = $this->get_name();
$instance->status = ENROL_INSTANCE_ENABLED;
$instance->courseid = $course->id;
@ -1391,7 +1391,7 @@ abstract class enrol_plugin {
$name = $this->get_name();
$versionfile = "$CFG->dirroot/enrol/$name/version.php";
$plugin = new object();
$plugin = new stdClass();
include($versionfile);
if (empty($plugin->cron)) {
return false;

View File

@ -339,7 +339,7 @@ function environment_get_errors($environment_results) {
$status = $environment_result->getStatus();
$error_code = $environment_result->getErrorCode();
$a = new object();
$a = new stdClass();
if ($error_code) {
$a->error_code = $error_code;
$errors[] = array($info, get_string('environmentxmlerror', 'admin', $a));
@ -367,7 +367,7 @@ function environment_get_errors($environment_results) {
}
// We are comparing versions
$rec = new object();
$rec = new stdClass();
if ($rec->needed = $environment_result->getNeededVersion()) {
$rec->current = $environment_result->getCurrentVersion();
if ($environment_result->getLevel() == 'required') {

View File

@ -153,7 +153,7 @@ function events_update_definition($component='moodle') {
} else {
// same event name matches, this event has been updated, update the datebase
$handler = new object();
$handler = new stdClass();
$handler->id = $cachedhandlers[$eventname]['id'];
$handler->handlerfile = $filehandler['handlerfile'];
$handler->handlerfunction = serialize($filehandler['handlerfunction']); // static class methods stored as array
@ -169,7 +169,7 @@ function events_update_definition($component='moodle') {
} else {
// if we are here, this event handler is not present in db (new)
// add it
$handler = new object();
$handler = new stdClass();
$handler->eventname = $eventname;
$handler->component = $component;
$handler->handlerfile = $filehandler['handlerfile'];
@ -251,7 +251,7 @@ function events_queue_handler($handler, $event, $errormessage) {
}
// make a new queue handler
$qhandler = new object();
$qhandler = new stdClass();
$qhandler->queuedeventid = $event->id;
$qhandler->handlerid = $handler->id;
$qhandler->errormessage = $errormessage;
@ -349,7 +349,7 @@ function events_process_queued_handler($qhandler) {
}
//dispatching failed
$qh = new object();
$qh = new stdClass();
$qh->id = $qhandler->id;
$qh->errormessage = $errormessage;
$qh->timemodified = time();
@ -542,7 +542,7 @@ function events_trigger($eventname, $eventdata) {
}
// if even type is not instant, or dispatch asked for retry, queue it
$event = new object();
$event = new stdClass();
$event->userid = $USER->id;
$event->eventdata = base64_encode(serialize($eventdata));
$event->timecreated = time();

View File

@ -421,7 +421,7 @@ function external_generate_token($tokentype, $serviceorid, $userid, $contextorid
throw new moodle_exception('tokengenerationfailed');
}
} while ($DB->record_exists('external_tokens', array('token'=>$generatedtoken)));
$newtoken = new object();
$newtoken = new stdClass();
$newtoken->token = $generatedtoken;
if (!is_object($serviceorid)){
$service = $DB->get_record('external_services', array('id' => $serviceorid));

View File

@ -903,7 +903,7 @@ function download_file_content($url, $headers=null, $postdata=null, $fullrespons
$url = str_replace($newlines, '', $url);
if (!preg_match('|^https?://|i', $url)) {
if ($fullresponse) {
$response = new object();
$response = new stdClass();
$response->status = 0;
$response->headers = array();
$response->response_code = 'Invalid protocol specified in url';
@ -962,7 +962,7 @@ function download_file_content($url, $headers=null, $postdata=null, $fullrespons
} else {
curl_close($ch);
if ($fullresponse) {
$response = new object();
$response = new stdClass();
$response->status = '0';
$response->headers = array();
$response->response_code = 'SOCKS5 proxy is not supported in PHP4';
@ -994,7 +994,7 @@ function download_file_content($url, $headers=null, $postdata=null, $fullrespons
}
// set up header and content handlers
$received = new object();
$received = new stdClass();
$received->headers = array(); // received headers array
$received->tofile = $tofile;
$received->fh = null;
@ -1021,7 +1021,7 @@ function download_file_content($url, $headers=null, $postdata=null, $fullrespons
curl_close($ch);
if ($fullresponse) {
$response = new object();
$response = new stdClass();
if ($error_no == 28) {
$response->status = '-100'; // mimic snoopy
} else {
@ -1043,7 +1043,7 @@ function download_file_content($url, $headers=null, $postdata=null, $fullrespons
if (empty($info['http_code'])) {
// for security reasons we support only true http connections (Location: file:// exploit prevention)
$response = new object();
$response = new stdClass();
$response->status = '0';
$response->headers = array();
$response->response_code = 'Unknown cURL error';
@ -1051,7 +1051,7 @@ function download_file_content($url, $headers=null, $postdata=null, $fullrespons
$response->error = 'Unknown cURL error';
} else {
$response = new object();;
$response = new stdClass();;
$response->status = (string)$info['http_code'];
$response->headers = $received->headers;
$response->response_code = $received->headers[0];
@ -1713,7 +1713,7 @@ function send_file($path, $filename, $lifetime = 'default' , $filter=0, $pathiss
}
} else { // Try to put the file through filters
if ($mimetype == 'text/html') {
$options = new object();
$options = new stdClass();
$options->noclean = true;
$options->nocache = true; // temporary workaround for MDL-5136
$text = $pathisstring ? $path : implode('', file($path));
@ -1731,7 +1731,7 @@ function send_file($path, $filename, $lifetime = 'default' , $filter=0, $pathiss
echo $output;
// only filter text if filter all files is selected
} else if (($mimetype == 'text/plain') and ($filter == 1)) {
$options = new object();
$options = new stdClass();
$options->newlines = false;
$options->noclean = true;
$text = htmlentities($pathisstring ? $path : implode('', file($path)));
@ -1905,7 +1905,7 @@ function send_stored_file($stored_file, $lifetime=86400 , $filter=0, $forcedownl
} else { // Try to put the file through filters
if ($mimetype == 'text/html') {
$options = new object();
$options = new stdClass();
$options->noclean = true;
$options->nocache = true; // temporary workaround for MDL-5136
$text = $stored_file->get_content();
@ -1922,7 +1922,7 @@ function send_stored_file($stored_file, $lifetime=86400 , $filter=0, $forcedownl
echo $output;
// only filter text if filter all files is selected
} else if (($mimetype == 'text/plain') and ($filter == 1)) {
$options = new object();
$options = new stdClass();
$options->newlines = false;
$options->noclean = true;
$text = $stored_file->get_content();

View File

@ -1813,7 +1813,7 @@ function validate_' . $this->_formName . '(frm) {
foreach ($this->_rules as $field => $rulesarr){
foreach ($rulesarr as $key => $rule){
if ($rule['message']===null){
$a=new object();
$a=new stdClass();
$a->format=$rule['format'];
$str=get_string('err_'.$rule['type'], 'form', $a);
if (strpos($str, '[[')!==0){

View File

@ -112,7 +112,7 @@ function process_new_icon($context, $component, $filearea, $itemid, $originalfil
return false;
}
$image = new object();
$image = new stdClass();
$image->width = $imageinfo[0];
$image->height = $imageinfo[1];
$image->type = $imageinfo[2];

View File

@ -1438,7 +1438,7 @@ class grade_item extends grade_object {
return false;
}
$oldgrade = new object();
$oldgrade = new stdClass();
$oldgrade->finalgrade = $grade->finalgrade;
$oldgrade->overridden = $grade->overridden;
$oldgrade->feedback = $grade->feedback;
@ -1555,7 +1555,7 @@ class grade_item extends grade_object {
return false;
}
$oldgrade = new object();
$oldgrade = new stdClass();
$oldgrade->finalgrade = $grade->finalgrade;
$oldgrade->rawgrade = $grade->rawgrade;
$oldgrade->rawgrademin = $grade->rawgrademin;

View File

@ -269,7 +269,7 @@ abstract class grade_object {
* Returns object with fields and values that are defined in database
*/
public function get_record_data() {
$data = new object();
$data = new stdClass();
foreach ($this as $var=>$value) {
if (in_array($var, $this->required_fields) or array_key_exists($var, $this->optional_fields)) {

View File

@ -123,7 +123,7 @@ class grade_outcome extends grade_object {
if ($result = parent::insert($source)) {
if (!empty($this->courseid)) {
$goc = new object();
$goc = new stdClass();
$goc->courseid = $this->courseid;
$goc->outcomeid = $this->id;
$DB->insert_record('grade_outcomes_courses', $goc);
@ -160,7 +160,7 @@ class grade_outcome extends grade_object {
}
if (!$DB->record_exists('grade_outcomes_courses', array('courseid' => $courseid, 'outcomeid' => $this->id))) {
$goc = new object();
$goc = new stdClass();
$goc->courseid = $courseid;
$goc->outcomeid = $this->id;
$DB->insert_record('grade_outcomes_courses', $goc);

View File

@ -345,7 +345,7 @@ function grade_update_outcomes($source, $courseid, $itemtype, $itemmodule, $item
function grade_get_grades($courseid, $itemtype, $itemmodule, $iteminstance, $userid_or_ids=null) {
global $CFG;
$return = new object();
$return = new stdClass();
$return->items = array();
$return->outcomes = array();
@ -364,7 +364,7 @@ function grade_get_grades($courseid, $itemtype, $itemmodule, $iteminstance, $use
if (empty($grade_item->outcomeid)) {
// prepare information about grade item
$item = new object();
$item = new stdClass();
$item->itemnumber = $grade_item->itemnumber;
$item->scaleid = $grade_item->scaleid;
$item->name = $grade_item->get_name();
@ -406,7 +406,7 @@ function grade_get_grades($courseid, $itemtype, $itemmodule, $iteminstance, $use
foreach ($userids as $userid) {
$grade_grades[$userid]->grade_item =& $grade_item;
$grade = new object();
$grade = new stdClass();
$grade->grade = $grade_grades[$userid]->finalgrade;
$grade->locked = $grade_grades[$userid]->is_locked();
$grade->hidden = $grade_grades[$userid]->is_hidden();
@ -437,7 +437,7 @@ function grade_get_grades($courseid, $itemtype, $itemmodule, $iteminstance, $use
if ($grade_item->gradetype == GRADE_TYPE_SCALE or $grade_item->get_displaytype() != GRADE_DISPLAY_TYPE_REAL) {
$grade->str_long_grade = $grade->str_grade;
} else {
$a = new object();
$a = new stdClass();
$a->grade = $grade->str_grade;
$a->max = grade_format_gradevalue($grade_item->grademax, $grade_item);
$grade->str_long_grade = get_string('gradelong', 'grades', $a);
@ -463,7 +463,7 @@ function grade_get_grades($courseid, $itemtype, $itemmodule, $iteminstance, $use
}
// outcome info
$outcome = new object();
$outcome = new stdClass();
$outcome->itemnumber = $grade_item->itemnumber;
$outcome->scaleid = $grade_outcome->scaleid;
$outcome->name = $grade_outcome->get_name();
@ -483,7 +483,7 @@ function grade_get_grades($courseid, $itemtype, $itemmodule, $iteminstance, $use
foreach ($userids as $userid) {
$grade_grades[$userid]->grade_item =& $grade_item;
$grade = new object();
$grade = new stdClass();
$grade->grade = $grade_grades[$userid]->finalgrade;
$grade->locked = $grade_grades[$userid]->is_locked();
$grade->hidden = $grade_grades[$userid]->is_hidden();
@ -600,7 +600,7 @@ function grade_get_setting($courseid, $name, $default=null, $resetcache=false) {
function grade_get_settings($courseid) {
global $DB;
$settings = new object();
$settings = new stdClass();
$settings->id = $courseid;
if ($records = $DB->get_records('grade_settings', array('courseid'=>$courseid))) {
@ -628,14 +628,14 @@ function grade_set_setting($courseid, $name, $value) {
$DB->delete_records('grade_settings', array('courseid'=>$courseid, 'name'=>$name));
} else if (!$existing = $DB->get_record('grade_settings', array('courseid'=>$courseid, 'name'=>$name))) {
$data = new object();
$data = new stdClass();
$data->courseid = $courseid;
$data->name = $name;
$data->value = $value;
$DB->insert_record('grade_settings', $data);
} else {
$data = new object();
$data = new stdClass();
$data->id = $existing->id;
$data->value = $value;
$DB->update_record('grade_settings', $data);

View File

@ -68,7 +68,7 @@ function message_send($eventdata) {
}
// Create the message object
$savemessage = new object();
$savemessage = new stdClass();
$savemessage->useridfrom = $eventdata->userfrom->id;
$savemessage->useridto = $eventdata->userto->id;
$savemessage->subject = $eventdata->subject;
@ -167,7 +167,7 @@ function message_update_providers($component='moodle') {
continue;
} else { // Update existing one
$provider = new object();
$provider = new stdClass();
$provider->id = $dbproviders[$messagename]->id;
$provider->capability = $fileprovider['capability'];
$DB->update_record('message_providers', $provider);
@ -177,7 +177,7 @@ function message_update_providers($component='moodle') {
} else { // New message provider, add it
$provider = new object();
$provider = new stdClass();
$provider->name = $messagename;
$provider->component = $component;
$provider->capability = $fileprovider['capability'];

View File

@ -964,7 +964,7 @@ function set_config($name, $value, $plugin=NULL) {
}
} else {
if ($value !== null) {
$config = new object();
$config = new stdClass();
$config->name = $name;
$config->value = $value;
$DB->insert_record('config', $config, false);
@ -980,7 +980,7 @@ function set_config($name, $value, $plugin=NULL) {
}
} else {
if ($value !== null) {
$config = new object();
$config = new stdClass();
$config->plugin = $plugin;
$config->name = $name;
$config->value = $value;
@ -1245,7 +1245,7 @@ function set_cache_flag($type, $name, $value, $expiry=NULL) {
$f->timemodified = $timemodified;
$DB->update_record('cache_flags', $f);
} else {
$f = new object();
$f = new stdClass();
$f->flagtype = $type;
$f->name = $name;
$f->value = $value;
@ -1383,7 +1383,7 @@ function set_user_preference($name, $value, $otheruserid=NULL) {
$DB->set_field('user_preferences', 'value', (string)$value, array('id'=>$preference->id));
} else {
$preference = new object();
$preference = new stdClass();
$preference->userid = $userid;
$preference->name = $name;
$preference->value = (string)$value;
@ -2736,7 +2736,7 @@ function require_user_key_login($script, $instance=null) {
function create_user_key($script, $userid, $instance=null, $iprestriction=null, $validuntil=null) {
global $DB;
$key = new object();
$key = new stdClass();
$key->script = $script;
$key->userid = $userid;
$key->instance = $instance;
@ -2801,7 +2801,7 @@ function get_user_key($script, $userid, $instance=null, $iprestriction=null, $va
function update_user_login_times() {
global $USER, $DB;
$user = new object();
$user = new stdClass();
$USER->lastlogin = $user->lastlogin = $USER->currentlogin;
$USER->currentlogin = $user->lastaccess = $user->currentlogin = time();
@ -2882,7 +2882,7 @@ function set_send_count($user,$reset=false) {
}
else if (!empty($reset)) { // if it's not there and we're resetting, don't bother.
// make a new one
$pref = new object();
$pref = new stdClass();
$pref->name = 'email_send_count';
$pref->value = 1;
$pref->userid = $user->id;
@ -2906,7 +2906,7 @@ function set_bounce_count($user,$reset=false) {
}
else if (!empty($reset)) { // if it's not there and we're resetting, don't bother.
// make a new one
$pref = new object();
$pref = new stdClass();
$pref->name = 'email_bounce_count';
$pref->value = 1;
$pref->userid = $user->id;
@ -2990,7 +2990,7 @@ function &get_fast_modinfo(&$course, $userid=0) {
$course->modinfo = $DB->get_field('course', 'modinfo', array('id'=>$course->id));
}
$modinfo = new object();
$modinfo = new stdClass();
$modinfo->courseid = $course->id;
$modinfo->userid = $userid;
$modinfo->sections = array();
@ -3033,7 +3033,7 @@ function &get_fast_modinfo(&$course, $userid=0) {
continue;
}
// reconstruct minimalistic $cm
$cm = new object();
$cm = new stdClass();
$cm->id = $mod->cm;
$cm->instance = $mod->id;
$cm->course = $course->id;
@ -3381,7 +3381,7 @@ function create_user_record($username, $password, $auth='manual') {
$authplugin = get_auth_plugin($auth);
$newuser = new object();
$newuser = new stdClass();
if ($newinfo = $authplugin->get_userinfo($username)) {
$newinfo = truncate_userinfo($newinfo);
@ -3558,7 +3558,7 @@ function delete_user($user) {
}
// mark internal user record as "deleted"
$updateuser = new object();
$updateuser = new stdClass();
$updateuser->id = $user->id;
$updateuser->deleted = 1;
$updateuser->username = $delname; // Remember it just in case
@ -3644,7 +3644,7 @@ function authenticate_user_login($username, $password) {
}
$auths = $authsenabled;
$user = new object();
$user = new stdClass();
$user->id = 0; // User does not exist
}
@ -4189,7 +4189,7 @@ function remove_course_contents($courseid, $showfeedback = true) {
fulldelete($CFG->dataroot.'/'.$course->id);
// cleanup course record - remove links to delted stuff
$oldcourse = new object();
$oldcourse = new stdClass();
$oldcourse->id = $course->id;
$oldcourse->summary = '';
$oldcourse->modinfo = NULL;
@ -4894,7 +4894,7 @@ function generate_email_supportuser() {
return $supportuser;
}
$supportuser = new object;
$supportuser = new stdClass();
$supportuser->email = $CFG->supportemail ? $CFG->supportemail : $CFG->noreplyaddress;
$supportuser->firstname = $CFG->supportname ? $CFG->supportname : get_string('noreplyname');
$supportuser->lastname = '';
@ -4924,7 +4924,7 @@ function setnew_password_and_mail($user) {
$DB->set_field('user', 'password', hash_internal_user_password($newpassword), array('id'=>$user->id));
$a = new object();
$a = new stdClass();
$a->firstname = fullname($user, true);
$a->sitename = format_string($site->fullname);
$a->username = $user->username;
@ -4966,7 +4966,7 @@ function reset_password_and_mail($user) {
print_error("cannotsetpassword");
}
$a = new object();
$a = new stdClass();
$a->firstname = $user->firstname;
$a->lastname = $user->lastname;
$a->sitename = format_string($site->fullname);
@ -4997,7 +4997,7 @@ function reset_password_and_mail($user) {
$site = get_site();
$supportuser = generate_email_supportuser();
$data = new object();
$data = new stdClass();
$data->firstname = fullname($user);
$data->sitename = format_string($site->fullname);
$data->admin = generate_email_signoff();
@ -5028,7 +5028,7 @@ function send_password_change_confirmation_email($user) {
$site = get_site();
$supportuser = generate_email_supportuser();
$data = new object();
$data = new stdClass();
$data->firstname = $user->firstname;
$data->lastname = $user->lastname;
$data->sitename = format_string($site->fullname);
@ -5057,7 +5057,7 @@ function send_password_change_info($user) {
$supportuser = generate_email_supportuser();
$systemcontext = get_context_instance(CONTEXT_SYSTEM);
$data = new object();
$data = new stdClass();
$data->firstname = $user->firstname;
$data->lastname = $user->lastname;
$data->sitename = format_string($site->fullname);
@ -7503,7 +7503,7 @@ function moodle_needs_upgrading() {
if ($mod === 'NEWMODULE') { // Someone has unzipped the template, ignore it
continue;
}
$module = new object();
$module = new stdClass();
if (!is_readable($fullmod.'/version.php')) {
continue;
}
@ -7527,7 +7527,7 @@ function moodle_needs_upgrading() {
if (!is_readable($fullblock.'/version.php')) {
continue;
}
$plugin = new object();
$plugin = new stdClass();
$plugin->version = NULL;
include($fullblock.'/version.php');
if (empty($installed[$blockname])) {
@ -7549,7 +7549,7 @@ function moodle_needs_upgrading() {
if (!is_readable($fullplug.'/version.php')) {
continue;
}
$plugin = new object();
$plugin = new stdClass();
include($fullplug.'/version.php'); // defines $plugin with version etc
$installedversion = get_config($component, 'version');
if (empty($installedversion)) { // new installation

View File

@ -151,7 +151,7 @@ class MoodleODSWorksheet {
if (!array_key_exists($row, $this->data)) {
$this->data[$row] = array();
}
$this->data[$row][$col] = new object();
$this->data[$row][$col] = new stdClass();
$this->data[$row][$col]->value = $str;
$this->data[$row][$col]->type = 'string';
$this->data[$row][$col]->format = $format;
@ -167,7 +167,7 @@ class MoodleODSWorksheet {
if (!array_key_exists($row, $this->data)) {
$this->data[$row] = array();
}
$this->data[$row][$col] = new object();
$this->data[$row][$col] = new stdClass();
$this->data[$row][$col]->value = $num;
$this->data[$row][$col]->type = 'float';
$this->data[$row][$col]->format = $format;
@ -183,7 +183,7 @@ class MoodleODSWorksheet {
if (!array_key_exists($row, $this->data)) {
$this->data[$row] = array();
}
$this->data[$row][$col] = new object();
$this->data[$row][$col] = new stdClass();
$this->data[$row][$col]->value = $url;
$this->data[$row][$col]->type = 'string';
$this->data[$row][$col]->format = $format;
@ -199,7 +199,7 @@ class MoodleODSWorksheet {
if (!array_key_exists($row, $this->data)) {
$this->data[$row] = array();
}
$this->data[$row][$col] = new object();
$this->data[$row][$col] = new stdClass();
$this->data[$row][$col]->value = $date;
$this->data[$row][$col]->type = 'date';
$this->data[$row][$col]->format = $format;
@ -273,7 +273,7 @@ class MoodleODSWorksheet {
* @param integer $level The optional outline level (0-7)
*/
function set_row($row, $height, $format = 0, $hidden = false, $level = 0) {
$this->rows[$row] = new object();
$this->rows[$row] = new stdClass();
$this->rows[$row]->height = $height;
//$this->rows[$row]->format = $format; // TODO: fix and enable
$this->rows[$row]->hidden = $hidden;
@ -289,7 +289,7 @@ class MoodleODSWorksheet {
*/
function set_column($firstcol, $lastcol, $width, $format = 0, $hidden = false, $level = 0) {
for($i=$firstcol; $i<=$lastcol; $i++) {
$this->columns[$i] = new object();
$this->columns[$i] = new stdClass();
$this->columns[$i]->width = $width;
//$this->columns[$i]->format = $format; // TODO: fix and enable
$this->columns[$i]->hidden = $hidden;

View File

@ -361,7 +361,7 @@ class theme_config {
$settings = get_config('theme_'.$themename);
} catch (dml_exception $e) {
// most probably moodle tables not created yet
$settings = new object();
$settings = new stdClass();
}
if ($config = theme_config::find_theme_config($themename, $settings)) {
@ -1016,7 +1016,7 @@ class theme_config {
return null;
}
$THEME = new object();
$THEME = new stdClass();
$THEME->name = $themename;
$THEME->dir = $dir;
$THEME->settings = $settings;

View File

@ -269,7 +269,7 @@ class portfolio_add_button {
$url = new moodle_url('/portfolio/add.php');
foreach ($this->callbackargs as $key => $value) {
if (!empty($value) && !is_string($value) && !is_numeric($value)) {
$a = new object();
$a = new stdClass();
$a->key = $key;
$a->value = print_r($value, true);
debugging(get_string('nonprimative', 'portfolio', $a));
@ -1103,7 +1103,7 @@ function portfolio_insane_notify_admins($insane, $instances=false) {
$smallbody = get_string('insanebodysmall', 'portfolio', $a);
foreach ($admins as $admin) {
$eventdata = new object();
$eventdata = new stdClass();
$eventdata->modulename = 'portfolio';
$eventdata->component = 'portfolio';
$eventdata->name = 'notices';

View File

@ -775,7 +775,7 @@ function question_save_from_deletion($questionids, $newcontextid, $oldplace, $ne
// Make a category in the parent context to move the questions to.
if (is_null($newcategory)) {
$newcategory = new object();
$newcategory = new stdClass();
$newcategory->parent = 0;
$newcategory->contextid = $newcontextid;
$newcategory->name = get_string('questionsrescuedfrom', 'question', $oldplace);
@ -1116,7 +1116,7 @@ function question_load_states(&$questions, &$states, $cmoptions, $attempt, $last
unset($states[$qid]->id);
} else {
// create a new empty state
$states[$qid] = new object;
$states[$qid] = new stdClass();
$states[$qid]->question = $qid;
$states[$qid]->responses = array('' => '');
$states[$qid]->raw_grade = 0;
@ -1601,7 +1601,7 @@ function regrade_question_in_attempt($question, $attempt, $cmoptions, $verbose=f
}
}
if ($changed){
$toinsert = new object();
$toinsert = new stdClass();
$toinsert->oldgrade = round((float)$states[count($states)-1]->grade, 5);
$toinsert->newgrade = round((float)$replaystate->grade, 5);
$toinsert->attemptid = $attempt->uniqueid;
@ -2548,7 +2548,7 @@ function question_add_context_in_key($categories){
function question_add_tops($categories, $pcontexts){
$topcats = array();
foreach ($pcontexts as $context){
$newcat = new object();
$newcat = new stdClass();
$newcat->id = "0,$context";
$newcat->name = get_string('top');
$newcat->parent = -1;

View File

@ -328,7 +328,7 @@ function rss_geterrorxmlfile($errortype = 'rsserror') {
//XML item
if ($return) {
$item = new object();
$item = new stdClass();
$item->title = "RSS Error";
$item->link = $CFG->wwwroot;
$item->pubdate = time();

View File

@ -458,7 +458,7 @@ try {
*/
define('SITEID', 1);
// And the 'default' course
$COURSE = new object(); // no site created yet
$COURSE = new stdClass(); // no site created yet
$COURSE->id = 1;
} else {
throw $e;

View File

@ -451,7 +451,7 @@ function get_exception_info($ex) {
}
}
$info = new object();
$info = new stdClass();
$info->message = $message;
$info->errorcode = $errorcode;
$info->backtrace = $backtrace;
@ -719,7 +719,7 @@ function init_performance_info() {
global $PERF, $CFG, $USER;
$PERF = new object();
$PERF = new stdClass();
$PERF->logwrites = 0;
if (function_exists('microtime')) {
$PERF->starttime = microtime();

View File

@ -51,7 +51,7 @@ class accesslib_test extends UnitTestCaseUsingDatabase {
accesslib_clear_all_caches_for_unit_testing();
$this->switch_to_test_db();
$course = new object();
$course = new stdClass();
$course->category = 0;
$this->testdb->insert_record('course', $course);
$syscontext = get_system_context(false);

View File

@ -71,7 +71,7 @@ class questionlib_test extends UnitTestCase {
}
function test_question_state_is_closed() {
$state = new object();
$state = new stdClass();
$state->event = QUESTION_EVENTOPEN;
$this->assertFalse(question_state_is_closed($state));
@ -104,7 +104,7 @@ class questionlib_test extends UnitTestCase {
}
function test_question_state_is_graded() {
$state = new object();
$state = new stdClass();
$state->event = QUESTION_EVENTOPEN;
$this->assertFalse(question_state_is_graded($state));

View File

@ -398,7 +398,7 @@ class moodle_coverage_reporter extends HtmlCoverageReporter {
parent::generateReport($data);
// head data
$data = new object();
$data = new stdClass();
$data->time = time();
$data->title = $this->heading;
$data->output = $this->outputDir;
@ -484,7 +484,7 @@ class moodle_coverage_reporter extends HtmlCoverageReporter {
$serfilepath = $CFG->dataroot . '/codecoverage/' . $type . '/codecoverage.ser';
if (file_exists($serfilepath) && is_readable($serfilepath)) {
if ($data = unserialize(file_get_contents($serfilepath))) {
$info = new object();
$info = new stdClass();
$info->date = userdate($data->time);
$info->files = format_float($data->totalfiles, 0);
$info->percentage = format_float($data->totalpercentage, 2) . '%';

View File

@ -1020,7 +1020,7 @@ function stats_clean_old() {
function stats_get_parameters($time,$report,$courseid,$mode,$roleid=0) {
global $CFG, $DB;
$param = new object();
$param = new stdClass();
$param->params = array();
if ($time < 10) { // dailies
@ -1449,7 +1449,7 @@ function stats_check_uptodate($courseid=0) {
return NULL;
}
$a = new object();
$a = new stdClass();
$a->daysdone = $DB->get_field_sql("SELECT COUNT(DISTINCT(timeend)) FROM {stats_daily}");
// how many days between the last day and now?

View File

@ -1104,7 +1104,7 @@ class flexible_table {
$lsortorder = get_string('asc');
}
$override = new object();
$override = new stdClass();
$override->firstname = 'firstname';
$override->lastname = 'lastname';
$fullnamelanguage = get_string('fullnamedisplay', '', $override);
@ -1305,7 +1305,7 @@ class table_sql extends flexible_table{
* appropriate clause of the query.
*/
function set_sql($fields, $from, $where, array $params = NULL){
$this->sql = new object();
$this->sql = new stdClass();
$this->sql->fields = $fields;
$this->sql->from = $from;
$this->sql->where = $where;

View File

@ -75,7 +75,7 @@ class downgrade_exception extends moodle_exception {
class upgrade_requires_exception extends moodle_exception {
function __construct($plugin, $pluginversion, $currentmoodle, $requiremoodle) {
global $CFG;
$a = new object();
$a = new stdClass();
$a->pluginname = $plugin;
$a->pluginversion = $pluginversion;
$a->currentmoodle = $currentmoodle;
@ -276,7 +276,7 @@ function upgrade_plugins($type, $startcallback, $endcallback, $verbose) {
continue;
}
$plugin = new object();
$plugin = new stdClass();
require($fullplug.'/version.php'); // defines $plugin with version etc
if (empty($plugin->version)) {
@ -406,7 +406,7 @@ function upgrade_plugins_modules($startcallback, $endcallback, $verbose) {
throw new plugin_defective_exception($component, 'Missing version.php');
}
$module = new object();
$module = new stdClass();
require($fullmod .'/version.php'); // defines $module with version etc
if (empty($module->version)) {
@ -551,7 +551,7 @@ function upgrade_plugins_blocks($startcallback, $endcallback, $verbose) {
if (!is_readable($fullblock.'/version.php')) {
throw new plugin_defective_exception('block/'.$blockname, 'Missing version.php file.');
}
$plugin = new object();
$plugin = new stdClass();
$plugin->version = NULL;
$plugin->cron = 0;
include($fullblock.'/version.php');
@ -819,7 +819,7 @@ function external_update_descriptions($component) {
}
}
foreach ($functions as $fname => $function) {
$dbfunction = new object();
$dbfunction = new stdClass();
$dbfunction->name = $fname;
$dbfunction->classname = $function['classname'];
$dbfunction->methodname = $function['methodname'];
@ -872,7 +872,7 @@ function external_update_descriptions($component) {
}
}
foreach ($service['functions'] as $fname) {
$newf = new object();
$newf = new stdClass();
$newf->externalserviceid = $dbservice->id;
$newf->functionname = $fname;
$DB->insert_record('external_services_functions', $newf);
@ -880,7 +880,7 @@ function external_update_descriptions($component) {
unset($functions);
}
foreach ($services as $name => $service) {
$dbservice = new object();
$dbservice = new stdClass();
$dbservice->name = $name;
$dbservice->enabled = empty($service['enabled']) ? 0 : $service['enabled'];
$dbservice->requiredcapability = empty($service['requiredcapability']) ? null : $service['requiredcapability'];
@ -889,7 +889,7 @@ function external_update_descriptions($component) {
$dbservice->timecreated = time();
$dbservice->id = $DB->insert_record('external_services', $dbservice);
foreach ($service['functions'] as $fname) {
$newf = new object();
$newf = new stdClass();
$newf->externalserviceid = $dbservice->id;
$newf->functionname = $fname;
$DB->insert_record('external_services_functions', $newf);
@ -988,7 +988,7 @@ function upgrade_log($type, $plugin, $info, $details=null, $backtrace=null) {
}
}
$log = new object();
$log = new stdClass();
$log->type = $type;
$log->plugin = $plugin;
$log->version = $version;

View File

@ -136,7 +136,7 @@ class upload_manager {
}
if (!$this->status) {
if (!$this->config->recoverifmultiple && count($this->files) > 1) {
$a = new object();
$a = new stdClass();
$a->name = $this->files[$name]['originalname'];
$a->problem = $this->files[$name]['uploadlog'];
if (!$this->config->silent) {
@ -162,7 +162,7 @@ class upload_manager {
else {
$newname = clean_filename($this->files[$name]['name']);
if ($newname != $this->files[$name]['name']) {
$a = new object();
$a = new stdClass();
$a->oldname = $this->files[$name]['name'];
$a->newname = $newname;
$this->files[$name]['uploadlog'] .= get_string('uploadrenamedchars','moodle', $a);
@ -347,7 +347,7 @@ class upload_manager {
while (!$this->check_before_renaming($destination, $name.'_'.$i.$extension, $file)) {
$i++;
}
$a = new object();
$a = new stdClass();
$a->oldname = $file['name'];
$file['name'] = $name.'_'.$i.$extension;
$a->newname = $file['name'];
@ -648,7 +648,7 @@ function clam_scan_moodle_file(&$file, $course) {
case 0: // glee! we're ok.
return 1; // translate clam return code into reasonable return code consistent with everything else.
case 1: // bad wicked evil, we have a virus.
$info = new object();
$info = new stdClass();
if (!empty($course)) {
$info->course = $course->fullname;
}
@ -696,7 +696,7 @@ function clam_message_admins($notice) {
$subject = get_string('clamemailsubject', 'moodle', format_string($site->fullname));
$admins = get_admins();
foreach ($admins as $admin) {
$eventdata = new object();
$eventdata = new stdClass();
$eventdata->modulename = 'moodle';
$eventdata->userfrom = get_admin();
$eventdata->userto = $admin;

View File

@ -1100,7 +1100,7 @@ function format_text($text, $format = FORMAT_MOODLE, $options = NULL, $courseid_
return $text;
}
$newcacheitem = new object();
$newcacheitem = new stdClass();
$newcacheitem->md5key = $md5key;
$newcacheitem->formattedtext = $text;
$newcacheitem->timemodified = time();