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.
This commit is contained in:
Russell Smith
2016-06-10 08:06:49 +10:00
parent 4ee8ef5d41
commit 1fcf0ca8a5
352 changed files with 499 additions and 499 deletions
+3 -3
View File
@@ -28,9 +28,9 @@ defined('MOODLE_INTERNAL') || die();
global $CFG; // access to global variables during unit test
require_once(dirname(dirname(__FILE__)) . '/lib.php'); // interface definition
require_once(dirname(dirname(dirname(__FILE__))) . '/locallib.php'); // workshop internal API
require_once(dirname(__FILE__) . '/settings_form.php'); // settings form
require_once(__DIR__ . '/../lib.php'); // interface definition
require_once(__DIR__ . '/../../locallib.php'); // workshop internal API
require_once(__DIR__ . '/settings_form.php'); // settings form
/**
* Allocates the submissions randomly