MDL-35628 performance: Remove dirname() where possible.
authorRussell Smith <mr-russ@smith2001.net>
Fri, 26 Feb 2016 06:47:58 +0000 (17:47 +1100)
committerRussell Smith <mr-russ@smith2001.net>
Thu, 9 Jun 2016 22:06:49 +0000 (08:06 +1000)
commit1fcf0ca8a5b792a59d59f1eb64bbb56e2dfeb06b
treecd2f762f4aee029cd8961e200afdc6223fd1adeb
parent4ee8ef5d4167afa00b21889a5fca3d39350ec2ef
MDL-35628 performance: Remove dirname() where possible.

dirname() is a slow function compared with __DIR__ and using
'/../'.  Moodle has a large number of legacy files that are included
each time a page loads and is not able to use an autoloader as it is
functional code.  This allows those required includes to perform as
best as possible in this situation.
352 files changed:
admin/cli/automated_backups.php
admin/cli/backup.php
admin/cli/cron.php
admin/cli/install.php
admin/cli/install_database.php
admin/cli/mysql_collation.php
admin/cli/mysql_compressed_rows.php
admin/cli/mysql_engine.php
admin/cli/purge_caches.php
admin/cli/reset_password.php
admin/cli/upgrade.php
admin/filters.php
admin/localplugins.php
admin/mailout-debugger.php
admin/message.php
admin/mnet/access_control.php
admin/mnet/delete.php
admin/mnet/index.php
admin/mnet/peers.php
admin/mnet/profilefields.php
admin/mnet/services.php
admin/mnet/testclient.php
admin/mnet/trustedhosts.php
admin/oauth2callback.php
admin/plagiarism.php
admin/plugins.php
admin/portfolio.php
admin/process_email.php
admin/qbehaviours.php
admin/qtypes.php
admin/reports.php
admin/repository.php
admin/repositoryinstance.php
admin/resetemoticons.php
admin/roles/allow.php
admin/roles/check.php
admin/roles/define.php
admin/roles/manage.php
admin/tool/assignmentupgrade/batchupgrade.php
admin/tool/assignmentupgrade/index.php
admin/tool/assignmentupgrade/listnotupgraded.php
admin/tool/assignmentupgrade/upgradesingle.php
admin/tool/assignmentupgrade/upgradesingleconfirm.php
admin/tool/capability/index.php
admin/tool/cohortroles/index.php
admin/tool/customlang/edit.php
admin/tool/customlang/index.php
admin/tool/generator/cli/maketestcourse.php
admin/tool/generator/cli/maketestplan.php
admin/tool/generator/index.php
admin/tool/installaddon/index.php
admin/tool/installaddon/permcheck.php
admin/tool/messageinbound/index.php
admin/tool/phpunit/index.php
admin/tool/phpunit/webrunner.php
admin/tool/profiling/export.php
admin/tool/profiling/import.php
admin/tool/profiling/index.php
admin/tool/recyclebin/index.php
admin/tool/task/scheduledtasks.php
admin/tool/unsuproles/index.php
admin/tool/xmldb/actions/generate_all_documentation/generate_all_documentation.class.php
admin/tool/xmldb/actions/generate_documentation/generate_documentation.class.php
admin/tools.php
auth/cas/cli/sync_users.php
auth/ldap/cli/sync_users.php
auth/ldap/ntlmsso_attempt.php
auth/ldap/ntlmsso_finish.php
auth/ldap/ntlmsso_magic.php
auth/mnet/jump.php
auth/mnet/land.php
backup/backupfilesedit.php
backup/cc/cc_lib/gral_lib/ccdependencyparser.php
backup/cc/cc_lib/gral_lib/functions.php
backup/converter/moodle1/lib.php
backup/restorefile.php
badges/action.php
badges/ajax.php
badges/assertion.php
badges/award.php
badges/backpackconnect.php
badges/badge.php
badges/criteria.php
badges/criteria_action.php
badges/criteria_settings.php
badges/edit.php
badges/external.php
badges/index.php
badges/mybackpack.php
badges/mybadges.php
badges/newbadge.php
badges/overview.php
badges/preferences.php
badges/recipients.php
badges/view.php
blocks/completionstatus/details.php
blocks/course_overview/move.php
blocks/course_overview/save.php
blocks/rss_client/editfeed.php
blocks/rss_client/managefeeds.php
blocks/rss_client/tests/cron_test.php
blocks/rss_client/viewfeed.php
blog/edit.php
blog/index.php
config-dist.php
course/category.ajax.php
course/changenumsections.php
course/delete.php
course/dndupload.php
course/modduplicate.php
course/pending.php
course/request.php
course/rest.php
enrol/imsenterprise/importnow.php
enrol/lti/index.php
enrol/lti/tool.php
enrol/meta/cli/sync.php
enrol/mnet/enrol.php
files/coursefilesedit.php
filter/manage.php
filter/mediaplugin/dev/perftest.php
grade/edit/outcome/import.php
grade/edit/outcome/index.php
grade/grading/form/guide/edit.php
grade/grading/form/guide/edit_form.php
grade/grading/form/guide/preview.php
grade/grading/form/rubric/edit.php
grade/grading/form/rubric/edit_form.php
grade/grading/form/rubric/preview.php
grade/grading/manage.php
grade/grading/pick.php
grade/import/keymanager.php
group/members.php
help.php
install.php
install/css.php
lib/adminlib.php
lib/ajax/blocks.php
lib/ajax/getnavbranch.php
lib/ajax/getsiteadminbranch.php
lib/ajax/service.php
lib/ajax/setuserpref.php
lib/badgeslib.php
lib/editor/atto/autosave-ajax.php
lib/editor/atto/plugins/equation/ajax.php
lib/editor/tinymce/plugins/moodleemoticon/dialog.php
lib/editor/tinymce/plugins/moodlemedia/preview.php
lib/editor/tinymce/plugins/spellchecker/includes/general.php
lib/installlib.php
lib/messagelib.php
lib/pdflib.php
lib/sessionkeepalive_ajax.php
lib/setup.php
lib/setuplib.php
lib/tests/other/jquerypage.php
lib/tests/other/pdflibtestpage.php
lib/tests/other/todochecker.php
lib/tests/performance/filtersettingsperformancetester.php
lib/tests/string_manager_standard_test.php
login/token.php
message/defaultoutputs.php
message/discussion.php
message/edit.php
message/output/airnotifier/rest.php
message/output/popup/message_output_popup.php
mnet/publickey.php
mnet/service/enrol/course.php
mnet/service/enrol/host.php
mnet/service/enrol/index.php
mnet/xmlrpc/server.php
mod/assign/adminmanageplugins.php
mod/assign/feedback/editpdf/testunoconv.php
mod/book/delete.php
mod/book/edit.php
mod/book/index.php
mod/book/lib.php
mod/book/locallib.php
mod/book/mod_form.php
mod/book/move.php
mod/book/settings.php
mod/book/show.php
mod/book/tool/exportimscp/index.php
mod/book/tool/exportimscp/locallib.php
mod/book/tool/importhtml/index.php
mod/book/tool/importhtml/locallib.php
mod/book/tool/print/index.php
mod/book/tool/print/locallib.php
mod/book/view.php
mod/chat/chat_ajax.php
mod/chat/chatd.php
mod/chat/gui_ajax/index.php
mod/chat/view.php
mod/data/view.php
mod/feedback/ajax.php
mod/forum/index.php
mod/forum/maildigest.php
mod/forum/subscribe.php
mod/forum/subscribe_ajax.php
mod/forum/user.php
mod/lesson/overridedelete.php
mod/lesson/overrideedit.php
mod/lesson/overrides.php
mod/lesson/view.php
mod/lti/ajax.php
mod/lti/service.php
mod/lti/services.php
mod/quiz/attempt.php
mod/quiz/autosave.ajax.php
mod/quiz/grade.php
mod/quiz/overridedelete.php
mod/quiz/overrideedit.php
mod/quiz/overrides.php
mod/quiz/processattempt.php
mod/quiz/report.php
mod/quiz/report/overview/overviewgraph.php
mod/quiz/report/statistics/statistics_graph.php
mod/quiz/review.php
mod/quiz/reviewquestion.php
mod/quiz/startattempt.php
mod/quiz/summary.php
mod/quiz/view.php
mod/scorm/report/graphs/graph.php
mod/wiki/create.php
mod/wiki/filesedit.php
mod/wiki/pagelib.php
mod/workshop/aggregate.php
mod/workshop/allocation.php
mod/workshop/allocation/manual/lib.php
mod/workshop/allocation/random/lib.php
mod/workshop/allocation/random/settings.php
mod/workshop/allocation/scheduled/lib.php
mod/workshop/allocation/scheduled/settings_form.php
mod/workshop/assessment.php
mod/workshop/backup/moodle1/lib.php
mod/workshop/editform.php
mod/workshop/editformpreview.php
mod/workshop/eval/best/lib.php
mod/workshop/exassessment.php
mod/workshop/excompare.php
mod/workshop/exsubmission.php
mod/workshop/form/accumulative/assessment_form.php
mod/workshop/form/accumulative/edit_form.php
mod/workshop/form/accumulative/lib.php
mod/workshop/form/comments/assessment_form.php
mod/workshop/form/comments/edit_form.php
mod/workshop/form/comments/lib.php
mod/workshop/form/numerrors/assessment_form.php
mod/workshop/form/numerrors/edit_form.php
mod/workshop/form/numerrors/lib.php
mod/workshop/form/rubric/assessment_form.php
mod/workshop/form/rubric/edit_form.php
mod/workshop/form/rubric/lib.php
mod/workshop/index.php
mod/workshop/lib.php
mod/workshop/locallib.php
mod/workshop/mod_form.php
mod/workshop/submission.php
mod/workshop/switchphase.php
mod/workshop/toolbox.php
mod/workshop/view.php
my/index.php
my/indexsys.php
portfolio/add.php
portfolio/download/file.php
portfolio/file.php
portfolio/mahara/preconfig.php
question/addquestion.php
question/behaviour/adaptive/tests/behaviourtype_test.php
question/behaviour/adaptive/tests/mark_display_test.php
question/behaviour/adaptive/tests/walkthrough_test.php
question/behaviour/adaptivenopenalty/behaviour.php
question/behaviour/adaptivenopenalty/behaviourtype.php
question/behaviour/adaptivenopenalty/renderer.php
question/behaviour/adaptivenopenalty/tests/walkthrough_test.php
question/behaviour/deferredcbm/behaviour.php
question/behaviour/deferredcbm/behaviourtype.php
question/behaviour/deferredcbm/tests/behaviourtype_test.php
question/behaviour/deferredcbm/tests/question_cbm_test.php
question/behaviour/deferredcbm/tests/walkthrough_test.php
question/behaviour/deferredfeedback/tests/behaviourtype_test.php
question/behaviour/deferredfeedback/tests/walkthrough_test.php
question/behaviour/immediatecbm/behaviour.php
question/behaviour/immediatecbm/behaviourtype.php
question/behaviour/immediatecbm/renderer.php
question/behaviour/immediatecbm/tests/behaviourtype_test.php
question/behaviour/immediatecbm/tests/walkthrough_test.php
question/behaviour/immediatefeedback/tests/behaviourtype_test.php
question/behaviour/immediatefeedback/tests/walkthrough_test.php
question/behaviour/informationitem/tests/behaviourtype_test.php
question/behaviour/informationitem/tests/walkthrough_test.php
question/behaviour/interactive/tests/behaviourtype_test.php
question/behaviour/interactive/tests/walkthrough_test.php
question/behaviour/interactivecountback/behaviour.php
question/behaviour/interactivecountback/behaviourtype.php
question/behaviour/interactivecountback/renderer.php
question/behaviour/interactivecountback/tests/behaviourtype_test.php
question/behaviour/interactivecountback/tests/walkthrough_test.php
question/behaviour/manualgraded/tests/behaviourtype_test.php
question/behaviour/manualgraded/tests/walkthrough_test.php
question/behaviour/missing/tests/behaviourtype_test.php
question/behaviour/missing/tests/missingbehaviour_test.php
question/edit.php
question/engine/bank.php
question/engine/lib.php
question/engine/tests/datalib_reporting_queries_test.php
question/engine/tests/datalib_test.php
question/engine/tests/qubaid_condition_test.php
question/engine/tests/questionattempt_db_test.php
question/engine/tests/questionattempt_test.php
question/engine/tests/questionattempt_with_steps_test.php
question/engine/tests/questionattemptiterator_test.php
question/engine/tests/questionattemptstep_db_test.php
question/engine/tests/questionattemptstep_test.php
question/engine/tests/questionattemptstepiterator_test.php
question/engine/tests/questionbank_test.php
question/engine/tests/questionengine_test.php
question/engine/tests/questionstate_test.php
question/engine/tests/questionusage_autosave_test.php
question/engine/tests/questionusagebyactivity_data_test.php
question/engine/tests/questionusagebyactivity_test.php
question/engine/tests/questionutils_test.php
question/engine/tests/unitofwork_test.php
question/engine/upgrade/tests/helper.php
question/export.php
question/import.php
question/preview.php
question/question.php
question/type/missingtype/tests/missingtype_test.php
report/completion/index.php
report/configlog/index.php
report/log/locallib.php
report/outline/locallib.php
report/questioninstances/index.php
report/stats/locallib.php
repository/dropbox/lib.php
repository/dropbox/thumbnail.php
repository/equella/callback.php
repository/flickr_public/lib.php
repository/manage_instances.php
repository/repository_ajax.php
repository/repository_callback.php
repository/url/lib.php
repository/wikimedia/lib.php
theme/index.php
user/portfolio.php
user/portfoliologs.php
user/profile.php
user/profilesys.php
user/repository.php
user/selector/search.php
webservice/pluginfile.php
webservice/upload.php