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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user