MDL-19415 fixing deprecated use of contructors

This commit is contained in:
skodak 2009-07-02 14:58:41 +00:00
parent 430c12fa74
commit 66491cf130
3 changed files with 8 additions and 8 deletions

View File

@ -57,7 +57,7 @@ function pear_handle_error($error){
print_object($error->backtrace);
}
if ($CFG->debug >= DEBUG_ALL){
if (!empty($CFG->debug) and $CFG->debug >= DEBUG_ALL){
PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, 'pear_handle_error');
}
@ -141,7 +141,7 @@ class moodleform {
$this->_formname = get_class($this); // '_form' suffix kept in order to prevent collisions of form id and other element
$this->_customdata = $customdata;
$this->_form =& new MoodleQuickForm($this->_formname, $method, $action, $target, $attributes);
$this->_form = new MoodleQuickForm($this->_formname, $method, $action, $target, $attributes);
if (!$editable){
$this->_form->hardFreeze();
}
@ -2192,7 +2192,7 @@ class MoodleQuickForm_Renderer extends HTML_QuickForm_Renderer_Tableless{
* @global object $GLOBALS['_HTML_QuickForm_default_renderer']
* @name $_HTML_QuickForm_default_renderer
*/
$GLOBALS['_HTML_QuickForm_default_renderer'] =& new MoodleQuickForm_Renderer();
$GLOBALS['_HTML_QuickForm_default_renderer'] = new MoodleQuickForm_Renderer();
/** Please keep this list in alphabetical order. */
MoodleQuickForm::registerElementType('advcheckbox', "$CFG->libdir/form/advcheckbox.php", 'MoodleQuickForm_advcheckbox');

View File

@ -563,7 +563,7 @@ class HTML_QuickForm extends HTML_Common {
$className = $GLOBALS['HTML_QUICKFORM_ELEMENT_TYPES'][$type][1];
$includeFile = $GLOBALS['HTML_QUICKFORM_ELEMENT_TYPES'][$type][0];
include_once($includeFile);
$elementObject =& new $className();
$elementObject = new $className(); //Moodle: PHP 5.3 compatibility
for ($i = 0; $i < 5; $i++) {
if (!isset($args[$i])) {
$args[$i] = null;
@ -1643,7 +1643,7 @@ class HTML_QuickForm extends HTML_Common {
{
if (!isset($GLOBALS['_HTML_QuickForm_default_renderer'])) {
include_once('HTML/QuickForm/Renderer/Default.php');
$GLOBALS['_HTML_QuickForm_default_renderer'] =& new HTML_QuickForm_Renderer_Default();
$GLOBALS['_HTML_QuickForm_default_renderer'] = new HTML_QuickForm_Renderer_Default(); //Moodle: PHP 5.3 compatibility
}
return $GLOBALS['_HTML_QuickForm_default_renderer'];
} // end func defaultRenderer
@ -1800,7 +1800,7 @@ class HTML_QuickForm extends HTML_Common {
function toArray($collectHidden = false)
{
include_once 'HTML/QuickForm/Renderer/Array.php';
$renderer =& new HTML_QuickForm_Renderer_Array($collectHidden);
$renderer = new HTML_QuickForm_Renderer_Array($collectHidden); //Moodle: PHP 5.3 compatibility
$this->accept($renderer);
return $renderer->toArray();
} // end func toArray

View File

@ -554,10 +554,10 @@ class PEAR
$ec = 'PEAR_Error';
}
if ($skipmsg) {
$a = &new $ec($code, $mode, $options, $userinfo);
$a = new $ec($code, $mode, $options, $userinfo); //Moodle: PHP 5.3 compatibility
return $a;
} else {
$a = &new $ec($message, $code, $mode, $options, $userinfo);
$a = new $ec($message, $code, $mode, $options, $userinfo); //Moodle: PHP 5.3 compatibility
return $a;
}
}