|
90 | 90 |
|
91 | 91 |
|
92 | 92 | // distro specific customisation |
93 | | -$distrolibfile = dirname(dirname(dirname(__FILE__))).'/install/distrolib.php'; |
| 93 | +$distrolibfile = __DIR__.'/../../install/distrolib.php'; |
94 | 94 | $distro = null; |
95 | 95 | if (file_exists($distrolibfile)) { |
96 | 96 | require_once($distrolibfile); |
|
100 | 100 | } |
101 | 101 |
|
102 | 102 | // Nothing to do if config.php exists |
103 | | -$configfile = dirname(dirname(dirname(__FILE__))).'/config.php'; |
| 103 | +$configfile = __DIR__.'/../../config.php'; |
104 | 104 | if (file_exists($configfile)) { |
105 | 105 | require($configfile); |
106 | 106 | require_once($CFG->libdir.'/clilib.php'); |
|
159 | 159 | global $CFG; |
160 | 160 | $CFG = new stdClass(); |
161 | 161 | $CFG->lang = 'en'; |
162 | | -$CFG->dirroot = dirname(dirname(dirname(__FILE__))); |
| 162 | +$CFG->dirroot = dirname(dirname(__DIR__)); |
163 | 163 | $CFG->libdir = "$CFG->dirroot/lib"; |
164 | 164 | $CFG->wwwroot = "http://localhost"; |
165 | 165 | $CFG->httpswwwroot = $CFG->wwwroot; |
|
172 | 172 | $CFG->debugdisplay = true; |
173 | 173 | $CFG->debugdeveloper = true; |
174 | 174 |
|
175 | | -$parts = explode('/', str_replace('\\', '/', dirname(dirname(__FILE__)))); |
| 175 | +$parts = explode('/', str_replace('\\', '/', dirname(__DIR__))); |
176 | 176 | $CFG->admin = array_pop($parts); |
177 | 177 |
|
178 | 178 | //point pear include path to moodles lib/pear so that includes and requires will search there for files before anywhere else |
|
244 | 244 | 'chmod' => isset($distro->directorypermissions) ? sprintf('%04o',$distro->directorypermissions) : '2777', // let distros set dir permissions |
245 | 245 | 'lang' => $CFG->lang, |
246 | 246 | 'wwwroot' => '', |
247 | | - 'dataroot' => empty($distro->dataroot) ? str_replace('\\', '/', dirname(dirname(dirname(dirname(__FILE__)))).'/moodledata'): $distro->dataroot, // initialised later after including libs or by distro |
| 247 | + 'dataroot' => empty($distro->dataroot) ? str_replace('\\', '/', dirname(dirname(dirname(__DIR__))).'/moodledata'): $distro->dataroot, // initialised later after including libs or by distro |
248 | 248 | 'dbtype' => empty($distro->dbtype) ? $defaultdb : $distro->dbtype, // let distro skip dbtype selection |
249 | 249 | 'dbhost' => empty($distro->dbhost) ? 'localhost' : $distro->dbhost, // let distros set dbhost |
250 | 250 | 'dbname' => 'moodle', |
|
0 commit comments