Details

    • Type: Improvement
    • Status: Closed
    • Priority: Trivial
    • Resolution: Fixed
    • Affects Version/s: 2.4
    • Fix Version/s: 2.5
    • Component/s: Other
    • Labels:

      Description

      Today I've started looking at MUC to (try to) improve the performances of my debugging tool, DAVRoot, when resolving file properties on browsing with a Windows client. Time to learn something new .

      While reading the static cache code I found a return $cache;; in cachestore_static::initialise_test_instance().
      Grepping the master branch code have revealed more places where a ;; has been used:

      $ find . -type f -name '*.php' -exec grep -H -n ';;' {} \;
       
      ./backup/util/xml/output/xml_output.class.php:54:        $this->finishtime = $this->inittime;;
      ./cache/classes/dummystore.php:267:        return $cache;;
      ./cache/stores/mongodb/lib.php:242:        return false;;
      ./cache/stores/static/lib.php:363:        return $cache;;
      ./calendar/lib.php:402:                $cell = html_writer::link('#', $day, array('aria-controls' => $popupid.'_panel', 'id' => $popupid));;
      ./course/lib.php:530:        echo "</td>\n";;
      ./course/reset.php:75:        $data = array();;
      ./enrol/paypal/ipn.php:187:            message_paypal_error_to_admin("Course $data->courseid doesn't exist", $data);;
      ./enrol/users.php:206:    $user['enrol'] = $renderer->user_enrolments_and_actions($user['enrolments']);;
      ./grade/edit/tree/lib.php:318:            $returnrows[] = new html_table_row(array($endcell));;
      ./lib/adodb/adodb-time.inc.php:958:		for ($a = 1970 ;; $a++) {
      ./lib/adodb/drivers/adodb-oci8.inc.php:1531:		if (!$this->fields = @oci_fetch_array($this->_queryID,$this->fetchMode)) return $arr;;
      ./lib/ddl/tests/ddl_test.php:1216:            $result = false;;
      ./lib/dtl/xml_database_importer.php:123:                $this->current_row = null;;
      ./lib/enrollib.php:1498:        return new moodle_url("/enrol/$name/unenrolself.php", array('enrolid'=>$instance->id));;
      ./lib/eventslib.php:518:                    $errormessage = 'Unknown error';;
      ./lib/filelib.php:1285:            $response = new stdClass();;
      ./lib/filestorage/file_storage.php:1677:        $reference['filepath']  = is_null($params['filepath'])  ? null : clean_param($params['filepath'],  PARAM_PATH);;
      ./lib/htmlpurifier/HTMLPurifier/AttrDef/CSS/FontFamily.php:29:          for (p = s1;;) {
      ./lib/markdown.php:1434:								'&amp;', $text);;
      ./lib/minify/lib/Minify/YUI/CssCompressor.php:130:        $css = preg_replace("@;;+@", ";", $css);
      ./lib/moodlelib.php:5881:    static $fp = array();;
      ./lib/odslib.class.php:68:        return $format;;
      ./lib/outputrenderers.php:1959:        $output = html_writer::empty_tag('img', $attributes);;
      ./lib/portfolio/exporter.php:338:                return false;;
      ./lib/statslib.php:365:                    $DB->sql_null_from_clause();;
      ./lib/tests/conditionlib_test.php:44:        $user = $this->getDataGenerator()->create_user();;
      ./lib/tests/csslib_test.php:629:            '.one {;;;;;}',
      ./lib/tests/csslib_test.php:631:            '.one {:;:;:;:::;;;}',
      ./lib/tests/navigationlib_test.php:71:        $hiddendemo1->add('hiddendemo2', $this->inactiveurl, navigation_node::TYPE_COURSE, null, 'hiddendemo2', new pix_icon('i/course', ''))->helpbutton = 'Here is a help button';;
      ./lib/upgradelib.php:789:                $post_install_function = 'xmldb_block_'.$blockname.'_install';;
      ./lib/zend/Zend/Date/DateObject.php:753:            for ($i = 1970;;$i++) {
      ./lib/zend/Zend/Service/Amazon.php:247:            $options['Timestamp'] = gmdate("Y-m-d\TH:i:s\Z");;
      ./mnet/lib.php:313:    global $CFG, $DB;;
      ./mod/feedback/item/info/lib.php:109:        $analysed_val = new stdClass();;
      ./mod/forum/index.php:231:        $forumname = format_string($forum->name, true);;
      ./mod/forum/index.php:369:            $forumname = format_string($forum->name,true);;
      ./mod/forum/lib.php:7143:        $rm = new rating_manager();;
      ./mod/lesson/continue.php:33:$cm = get_coursemodule_from_id('lesson', $id, 0, false, MUST_EXIST);;
      ./mod/lesson/edit.php:32:$cm = get_coursemodule_from_id('lesson', $id, 0, false, MUST_EXIST);;
      ./mod/lesson/editpage.php:37:$cm = get_coursemodule_from_id('lesson', $id, 0, false, MUST_EXIST);;
      ./mod/lesson/essay.php:35:$cm = get_coursemodule_from_id('lesson', $id, 0, false, MUST_EXIST);;
      ./mod/lesson/grade.php:34:$cm = get_coursemodule_from_id('lesson', $id, 0, false, MUST_EXIST);;
      ./mod/lesson/highscores.php:35:$cm = get_coursemodule_from_id('lesson', $id, 0, false, MUST_EXIST);;
      ./mod/lesson/import.php:38:$cm = get_coursemodule_from_id('lesson', $id, 0, false, MUST_EXIST);;
      ./mod/lesson/lesson.php:39:$cm = get_coursemodule_from_id('lesson', $id, 0, false, MUST_EXIST);;
      ./mod/lesson/locallib.php:951:        $DB->delete_records("lesson", array("id"=>$this->properties->id));;
      ./mod/lesson/mediafile.php:36:$cm = get_coursemodule_from_id('lesson', $id, 0, false, MUST_EXIST);;
      ./mod/lesson/pagetypes/endofbranch.php:125:        $answer->timemodified = time();;
      ./mod/lesson/pagetypes/endofcluster.php:94:        $answer->timemodified = time();;
      ./mod/lesson/view.php:38:$cm = get_coursemodule_from_id('lesson', $id, 0, false, MUST_EXIST);;
      ./mod/lesson/view.php:477:                    $grade = new stdClass();;
      ./mod/quiz/editlib.php:1311:    $tooltip = implode(', ', $dates);;
      ./mod/scorm/datamodels/scormlib.php:370:                                    $scoes->elements[$manifest][$parent->organization][$parent->identifier]->rollupobjectivesatisfied = $sequencing['attrs']['ROLLUPOBJECTIVESATISFIED'] == 'true'?1:0;;
      ./question/format/xhtml/format.php:135:                $expout .= html_writer::tag('li', $quest_text);;
      ./question/type/calculated/questiontype.php:1153:            $answer->answer = $qtext.$qtextremaining;;
      ./question/type/questiontypebase.php:345:            $question->questiontext = trim($form->questiontext['text']);;
      ./rating/lib.php:183:        $rm = new rating_manager();;
      ./report/log/lib.php:85:        $all = true;;
      ./report/outline/index.php:130:        $activitycell->text = $activityicon . html_writer::link("$CFG->wwwroot/mod/$cm->modname/view.php?id=$cm->id", format_string($cm->name), $attributes);;
      ./report/security/locallib.php:566:    $result->link    = "<a href=\"$CFG->wwwroot/$CFG->admin/settings.php?section=userpolicies\">".get_string('userpolicies', 'admin').'</a>';;
      ./report/security/locallib.php:624:    $result->link    = "<a href=\"$CFG->wwwroot/$CFG->admin/settings.php?section=userpolicies\">".get_string('userpolicies', 'admin').'</a>';;
      ./report/security/locallib.php:682:    $result->link    = "<a href=\"$CFG->wwwroot/$CFG->admin/settings.php?section=frontpagesettings\">".get_string('frontpagesettings','admin').'</a>';;
      ./repository/coursefiles/lib.php:68:                $filepath  = is_null($params['filepath']) ? NULL : clean_param($params['filepath'], PARAM_PATH);;
      ./repository/coursefiles/lib.php:158:        $filepath = clean_param($params['filepath'], PARAM_PATH);;
      ./repository/lib.php:1322:            $event['existingfile']->url      = moodle_url::make_draftfile_url($draftitemid, $record->filepath, $old_filename)->out();;
      ./repository/local/lib.php:64:                $filepath  = is_null($params['filepath']) ? NULL : clean_param($params['filepath'], PARAM_PATH);;
      ./repository/repository_ajax.php:269:                    $event['existingfile']->url      = moodle_url::make_draftfile_url($itemid, $saveas_path, $saveas_filename)->out();;
      ./repository/user/lib.php:66:                $filepath = clean_param($params['filepath'], PARAM_PATH);;
      ./user/view.php:291:                $ccontext = context_course::instance($mycourse->id);;
      ./webservice/upload.php:134:    $file_record->author    = fullname($authenticationinfo['user']);;

      There are some exclusions to be done in the list above, e.g.:

      • ./lib/adodb/adodb-time.inc.php
      • ./lib/htmlpurifier/HTMLPurifier/AttrDef/CSS/FontFamily.php
      • ./lib/minify/lib/Minify/YUI/CssCompressor.php
      • ./lib/zend/Zend/Date/DateObject.php:753:, maybe ./lib/zend
      • ...

      Yet Another Code Cleanup? I'm not sure if it will be really required.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  14/May/13