Skip to content

Commit

Permalink
MDL-19415 fixing deprecated use of contructors
Browse files Browse the repository at this point in the history
  • Loading branch information
skodak committed Jul 2, 2009
1 parent 430c12f commit 66491cf
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions lib/formslib.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}

Expand Down Expand Up @@ -141,7 +141,7 @@ function moodleform($action=null, $customdata=null, $method='post', $target='',

$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();
}
Expand Down Expand Up @@ -2192,7 +2192,7 @@ function getStopFieldsetElements(){
* @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');
Expand Down
6 changes: 3 additions & 3 deletions lib/pear/HTML/QuickForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,7 @@ function &_loadElement($event, $type, $args)
$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;
Expand Down Expand Up @@ -1643,7 +1643,7 @@ function &defaultRenderer()
{
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
Expand Down Expand Up @@ -1800,7 +1800,7 @@ function getSubmitValues($mergeFiles = false)
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
Expand Down
4 changes: 2 additions & 2 deletions lib/pear/PEAR.php
Original file line number Diff line number Diff line change
Expand Up @@ -554,10 +554,10 @@ function &raiseError($message = null,
$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;
}
}
Expand Down

0 comments on commit 66491cf

Please sign in to comment.