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
+2 -2
View File
@@ -39,7 +39,7 @@ class core_string_manager_standard_testcase extends advanced_testcase {
public function test_string_manager_instance() {
$this->resetAfterTest();
$otherroot = dirname(__FILE__).'/fixtures/langtest';
$otherroot = __DIR__.'/fixtures/langtest';
$stringman = testable_core_string_manager::instance($otherroot);
$this->assertInstanceOf('core_string_manager', $stringman);
}
@@ -47,7 +47,7 @@ class core_string_manager_standard_testcase extends advanced_testcase {
public function test_get_language_dependencies() {
$this->resetAfterTest();
$otherroot = dirname(__FILE__).'/fixtures/langtest';
$otherroot = __DIR__.'/fixtures/langtest';
$stringman = testable_core_string_manager::instance($otherroot);
// There is no parent language for 'en'.