| Línea 44... |
Línea 44... |
| 44 |
}
|
44 |
}
|
| Línea 45... |
Línea 45... |
| 45 |
|
45 |
|
| 46 |
define('CLI_SCRIPT', false); // prevents some warnings later
|
46 |
define('CLI_SCRIPT', false); // prevents some warnings later
|
| 47 |
define('AJAX_SCRIPT', false); // prevents some warnings later
|
47 |
define('AJAX_SCRIPT', false); // prevents some warnings later
|
| - |
|
48 |
define('CACHE_DISABLE_ALL', true); // Disables caching.. just in case.
|
| 48 |
define('CACHE_DISABLE_ALL', true); // Disables caching.. just in case.
|
49 |
define('NO_DEBUG_DISPLAY', false);
|
| 49 |
define('PHPUNIT_TEST', false);
|
50 |
define('PHPUNIT_TEST', false);
|
| 50 |
define('IGNORE_COMPONENT_CACHE', true);
|
51 |
define('IGNORE_COMPONENT_CACHE', true);
|
| 51 |
define('MDL_PERF_TEST', false);
|
52 |
define('MDL_PERF_TEST', false);
|
| 52 |
define('MDL_PERF', false);
|
53 |
define('MDL_PERF', false);
|
| Línea 178... |
Línea 179... |
| 178 |
$CFG->filepermissions = ($CFG->directorypermissions & 0666);
|
179 |
$CFG->filepermissions = ($CFG->directorypermissions & 0666);
|
| 179 |
$CFG->umaskpermissions = (($CFG->directorypermissions & 0777) ^ 0777);
|
180 |
$CFG->umaskpermissions = (($CFG->directorypermissions & 0777) ^ 0777);
|
| 180 |
$CFG->running_installer = true;
|
181 |
$CFG->running_installer = true;
|
| 181 |
$CFG->early_install_lang = true;
|
182 |
$CFG->early_install_lang = true;
|
| 182 |
$CFG->ostype = (stristr(PHP_OS, 'win') && !stristr(PHP_OS, 'darwin')) ? 'WINDOWS' : 'UNIX';
|
183 |
$CFG->ostype = (stristr(PHP_OS, 'win') && !stristr(PHP_OS, 'darwin')) ? 'WINDOWS' : 'UNIX';
|
| 183 |
$CFG->debug = (E_ALL | E_STRICT);
|
184 |
$CFG->debug = (E_ALL);
|
| 184 |
$CFG->debugdisplay = true;
|
185 |
$CFG->debugdisplay = true;
|
| 185 |
$CFG->debugdeveloper = true;
|
186 |
$CFG->debugdeveloper = true;
|
| Línea 186... |
Línea 187... |
| 186 |
|
187 |
|
| 187 |
// Require all needed libs
|
188 |
// Require all needed libs
|
| Línea 196... |
Línea 197... |
| 196 |
echo "Please contact server administrator to fix PHP.ini memory settings.";
|
197 |
echo "Please contact server administrator to fix PHP.ini memory settings.";
|
| 197 |
die;
|
198 |
die;
|
| 198 |
}
|
199 |
}
|
| 199 |
}
|
200 |
}
|
| Línea -... |
Línea 201... |
| - |
|
201 |
|
| - |
|
202 |
// Point pear include path to moodles lib/pear so that includes and requires will search there for files before anywhere else
|
| - |
|
203 |
// the problem is that we need specific version of quickforms and hacked excel files :-(.
|
| - |
|
204 |
ini_set('include_path', $CFG->libdir.'/pear' . PATH_SEPARATOR . ini_get('include_path'));
|
| - |
|
205 |
|
| - |
|
206 |
// Register our classloader.
|
| - |
|
207 |
\core\component::register_autoloader();
|
| 200 |
|
208 |
|
| 201 |
// Continue with lib loading
|
209 |
// Continue with lib loading.
|
| 202 |
require_once($CFG->libdir.'/classes/text.php');
|
210 |
require_once($CFG->libdir.'/classes/text.php');
|
| 203 |
require_once($CFG->libdir.'/classes/string_manager.php');
|
211 |
require_once($CFG->libdir.'/classes/string_manager.php');
|
| 204 |
require_once($CFG->libdir.'/classes/string_manager_install.php');
|
212 |
require_once($CFG->libdir.'/classes/string_manager_install.php');
|
| 205 |
require_once($CFG->libdir.'/classes/string_manager_standard.php');
|
213 |
require_once($CFG->libdir.'/classes/string_manager_standard.php');
|
| Línea 210... |
Línea 218... |
| 210 |
require_once($CFG->libdir .'/pagelib.php');
|
218 |
require_once($CFG->libdir .'/pagelib.php');
|
| 211 |
require_once($CFG->libdir.'/deprecatedlib.php');
|
219 |
require_once($CFG->libdir.'/deprecatedlib.php');
|
| 212 |
require_once($CFG->libdir.'/adminlib.php');
|
220 |
require_once($CFG->libdir.'/adminlib.php');
|
| 213 |
require_once($CFG->libdir.'/environmentlib.php');
|
221 |
require_once($CFG->libdir.'/environmentlib.php');
|
| 214 |
require_once($CFG->libdir.'/componentlib.class.php');
|
222 |
require_once($CFG->libdir.'/componentlib.class.php');
|
| 215 |
require_once($CFG->dirroot.'/cache/lib.php');
|
- |
|
| 216 |
|
- |
|
| 217 |
//point pear include path to moodles lib/pear so that includes and requires will search there for files before anywhere else
|
- |
|
| 218 |
//the problem is that we need specific version of quickforms and hacked excel files :-(
|
- |
|
| 219 |
ini_set('include_path', $CFG->libdir.'/pear' . PATH_SEPARATOR . ini_get('include_path'));
|
- |
|
| 220 |
|
- |
|
| 221 |
// Register our classloader, in theory somebody might want to replace it to load other hacked core classes.
|
- |
|
| 222 |
// Required because the database checks below lead to session interaction which is going to lead us to requiring autoloaded classes.
|
- |
|
| 223 |
if (defined('COMPONENT_CLASSLOADER')) {
|
- |
|
| 224 |
spl_autoload_register(COMPONENT_CLASSLOADER);
|
- |
|
| 225 |
} else {
|
- |
|
| 226 |
spl_autoload_register('core_component::classloader');
|
- |
|
| 227 |
}
|
- |
|
| Línea 228... |
Línea 223... |
| 228 |
|
223 |
|
| 229 |
require('version.php');
|
224 |
require('version.php');
|
| Línea 230... |
Línea 225... |
| 230 |
$CFG->target_release = $release;
|
225 |
$CFG->target_release = $release;
|
| Línea 243... |
Línea 238... |
| 243 |
|
238 |
|
| 244 |
$hint_dataroot = '';
|
239 |
$hint_dataroot = '';
|
| 245 |
$hint_admindir = '';
|
240 |
$hint_admindir = '';
|
| Línea 246... |
Línea -... |
| 246 |
$hint_database = '';
|
- |
|
| 247 |
|
- |
|
| 248 |
// Are we in help mode?
|
- |
|
| 249 |
if (isset($_GET['help'])) {
|
- |
|
| 250 |
install_print_help_page($_GET['help']);
|
- |
|
| 251 |
}
|
241 |
$hint_database = '';
|
| 252 |
|
242 |
|
| 253 |
//first time here? find out suitable dataroot
|
243 |
//first time here? find out suitable dataroot
|
| Línea 254... |
Línea 244... |
| 254 |
if (is_null($CFG->dataroot)) {
|
244 |
if (is_null($CFG->dataroot)) {
|
| Línea 432... |
Línea 422... |
| 432 |
$strdbsocket = get_string('databasesocket', 'install');
|
422 |
$strdbsocket = get_string('databasesocket', 'install');
|
| Línea 433... |
Línea 423... |
| 433 |
|
423 |
|
| Línea 434... |
Línea 424... |
| 434 |
echo '<div class="row mb-4">';
|
424 |
echo '<div class="row mb-4">';
|
| 435 |
|
425 |
|
| 436 |
$disabled = empty($distro->dbhost) ? '' : 'disabled="disabled';
|
426 |
$disabled = empty($distro->dbhost) ? '' : 'disabled="disabled';
|
| 437 |
echo '<div class="col-md-3 text-md-right pt-1"><label for="id_dbhost">'.$strdbhost.'</label></div>';
|
427 |
echo '<div class="col-md-3 text-md-end pt-1"><label for="id_dbhost">'.$strdbhost.'</label></div>';
|
| 438 |
echo '<div class="col-md-9" data-fieldtype="text">';
|
428 |
echo '<div class="col-md-9" data-fieldtype="text">';
|
| Línea 439... |
Línea 429... |
| 439 |
echo '<input id="id_dbhost" name="dbhost" '.$disabled.' type="text" class="form-control text-ltr" value="'.s($config->dbhost).'" size="50" /></div>';
|
429 |
echo '<input id="id_dbhost" name="dbhost" '.$disabled.' type="text" class="form-control text-ltr" value="'.s($config->dbhost).'" size="50" /></div>';
|
| 440 |
echo '</div>';
|
430 |
echo '</div>';
|
| 441 |
|
431 |
|
| 442 |
echo '<div class="row mb-4">';
|
432 |
echo '<div class="row mb-4">';
|
| 443 |
echo '<div class="col-md-3 text-md-right pt-1"><label for="id_dbname">'.$strdbname.'</label></div>';
|
433 |
echo '<div class="col-md-3 text-md-end pt-1"><label for="id_dbname">'.$strdbname.'</label></div>';
|
| Línea 444... |
Línea 434... |
| 444 |
echo '<div class="col-md-9" data-fieldtype="text">';
|
434 |
echo '<div class="col-md-9" data-fieldtype="text">';
|
| 445 |
echo '<input id="id_dbname" name="dbname" type="text" class="form-control text-ltr" value="'.s($config->dbname).'" size="50" /></div>';
|
435 |
echo '<input id="id_dbname" name="dbname" type="text" class="form-control text-ltr" value="'.s($config->dbname).'" size="50" /></div>';
|
| 446 |
echo '</div>';
|
436 |
echo '</div>';
|
| 447 |
|
437 |
|
| 448 |
$disabled = empty($distro->dbuser) ? '' : 'disabled="disabled';
|
438 |
$disabled = empty($distro->dbuser) ? '' : 'disabled="disabled';
|
| 449 |
echo '<div class="row mb-4">';
|
439 |
echo '<div class="row mb-4">';
|
| Línea 450... |
Línea 440... |
| 450 |
echo '<div class="col-md-3 text-md-right pt-1"><label for="id_dbuser">'.$strdbuser.'</label></div>';
|
440 |
echo '<div class="col-md-3 text-md-end pt-1"><label for="id_dbuser">'.$strdbuser.'</label></div>';
|
| 451 |
echo '<div class="col-md-9" data-fieldtype="text">';
|
441 |
echo '<div class="col-md-9" data-fieldtype="text">';
|
| 452 |
echo '<input id="id_dbuser" name="dbuser" '.$disabled.' type="text" class="form-control text-ltr" value="'.s($config->dbuser).'" size="50" /></div>';
|
442 |
echo '<input id="id_dbuser" name="dbuser" '.$disabled.' type="text" class="form-control text-ltr" value="'.s($config->dbuser).'" size="50" /></div>';
|
| 453 |
echo '</div>';
|
443 |
echo '</div>';
|
| 454 |
|
444 |
|
| 455 |
echo '<div class="row mb-4">';
|
445 |
echo '<div class="row mb-4">';
|
| Línea 456... |
Línea 446... |
| 456 |
echo '<div class="col-md-3 text-md-right pt-1"><label for="id_dbpass">'.$strdbpass.'</label></div>';
|
446 |
echo '<div class="col-md-3 text-md-end pt-1"><label for="id_dbpass">'.$strdbpass.'</label></div>';
|
| 457 |
// no password field here, the password may be visible in config.php if we can not write it to disk
|
447 |
// no password field here, the password may be visible in config.php if we can not write it to disk
|
| 458 |
echo '<div class="col-md-9" data-fieldtype="text">';
|
448 |
echo '<div class="col-md-9" data-fieldtype="text">';
|
| 459 |
echo '<input id="id_dbpass" name="dbpass" type="text" class="form-control text-ltr" value="'.s($config->dbpass).'" size="50" /></div>';
|
449 |
echo '<input id="id_dbpass" name="dbpass" type="text" class="form-control text-ltr" value="'.s($config->dbpass).'" size="50" /></div>';
|
| 460 |
echo '</div>';
|
450 |
echo '</div>';
|
| Línea 461... |
Línea 451... |
| 461 |
|
451 |
|
| 462 |
echo '<div class="row mb-4">';
|
452 |
echo '<div class="row mb-4">';
|
| 463 |
echo '<div class="col-md-3 text-md-right pt-1"><label for="id_prefix">'.$strprefix.'</label></div>';
|
453 |
echo '<div class="col-md-3 text-md-end pt-1"><label for="id_prefix">'.$strprefix.'</label></div>';
|
| 464 |
echo '<div class="col-md-9" data-fieldtype="text">';
|
454 |
echo '<div class="col-md-9" data-fieldtype="text">';
|
| 465 |
echo '<input id="id_prefix" name="prefix" type="text" class="form-control text-ltr" value="'.s($config->prefix).'" size="10" /></div>';
|
455 |
echo '<input id="id_prefix" name="prefix" type="text" class="form-control text-ltr" value="'.s($config->prefix).'" size="10" /></div>';
|
| Línea 466... |
Línea 456... |
| 466 |
echo '</div>';
|
456 |
echo '</div>';
|
| 467 |
|
457 |
|
| 468 |
echo '<div class="row mb-4">';
|
458 |
echo '<div class="row mb-4">';
|
| 469 |
echo '<div class="col-md-3 text-md-right pt-1"><label for="id_prefix">'.$strdbport.'</label></div>';
|
459 |
echo '<div class="col-md-3 text-md-end pt-1"><label for="id_prefix">'.$strdbport.'</label></div>';
|
| 470 |
echo '<div class="col-md-9" data-fieldtype="text">';
|
460 |
echo '<div class="col-md-9" data-fieldtype="text">';
|
| 471 |
echo '<input id="id_dbport" name="dbport" type="text" class="form-control text-ltr" value="'.s($config->dbport).'" size="10" /></div>';
|
461 |
echo '<input id="id_dbport" name="dbport" type="text" class="form-control text-ltr" value="'.s($config->dbport).'" size="10" /></div>';
|
| 472 |
echo '</div>';
|
462 |
echo '</div>';
|
| Línea 498... |
Línea 488... |
| 498 |
|
488 |
|
| 499 |
$databases = array('mysqli' => moodle_database::get_driver_instance('mysqli', 'native'),
|
489 |
$databases = array('mysqli' => moodle_database::get_driver_instance('mysqli', 'native'),
|
| 500 |
'auroramysql' => moodle_database::get_driver_instance('auroramysql', 'native'),
|
490 |
'auroramysql' => moodle_database::get_driver_instance('auroramysql', 'native'),
|
| 501 |
'mariadb'=> moodle_database::get_driver_instance('mariadb', 'native'),
|
491 |
'mariadb'=> moodle_database::get_driver_instance('mariadb', 'native'),
|
| 502 |
'pgsql' => moodle_database::get_driver_instance('pgsql', 'native'),
|
- |
|
| 503 |
'oci' => moodle_database::get_driver_instance('oci', 'native'),
|
492 |
'pgsql' => moodle_database::get_driver_instance('pgsql', 'native'),
|
| 504 |
'sqlsrv' => moodle_database::get_driver_instance('sqlsrv', 'native'), // MS SQL*Server PHP driver
|
493 |
'sqlsrv' => moodle_database::get_driver_instance('sqlsrv', 'native'), // MS SQL*Server PHP driver
|
| Línea 505... |
Línea 494... |
| 505 |
);
|
494 |
);
|
| 506 |
|
495 |
|
| 507 |
echo '<div class="row mb-4">';
|
496 |
echo '<div class="row mb-4">';
|
| 508 |
echo '<div class="col-md-3 text-md-right pt-1"><label for="dbtype">'.get_string('dbtype', 'install').'</label></div>';
|
497 |
echo '<div class="col-md-3 text-md-end pt-1"><label for="dbtype">'.get_string('dbtype', 'install').'</label></div>';
|
| 509 |
echo '<div class="col-md-9" data-fieldtype="select">';
|
498 |
echo '<div class="col-md-9" data-fieldtype="select">';
|
| 510 |
echo '<select class="form-control" id="dbtype" name="dbtype">';
|
499 |
echo '<select class="form-control" id="dbtype" name="dbtype">';
|
| 511 |
$disabled = array();
|
500 |
$disabled = array();
|
| Línea 582... |
Línea 571... |
| 582 |
$strdirroot = get_string('dirroot', 'install');
|
571 |
$strdirroot = get_string('dirroot', 'install');
|
| 583 |
$strdataroot = get_string('dataroot', 'install');
|
572 |
$strdataroot = get_string('dataroot', 'install');
|
| 584 |
$stradmindirname = get_string('admindirname', 'install');
|
573 |
$stradmindirname = get_string('admindirname', 'install');
|
| Línea 585... |
Línea 574... |
| 585 |
|
574 |
|
| 586 |
echo '<div class="row mb-4">';
|
575 |
echo '<div class="row mb-4">';
|
| 587 |
echo '<div class="col-md-3 text-md-right pt-1"><label for="id_wwwroot">'.$paths['wwwroot'].'</label></div>';
|
576 |
echo '<div class="col-md-3 text-md-end pt-1"><label for="id_wwwroot">'.$paths['wwwroot'].'</label></div>';
|
| 588 |
echo '<div class="col-md-9" data-fieldtype="text">';
|
577 |
echo '<div class="col-md-9" data-fieldtype="text">';
|
| 589 |
echo '<input id="id_wwwroot" name="wwwroot" type="text" class="form-control text-ltr" value="'.s($CFG->wwwroot).'" disabled="disabled" size="70" /></div>';
|
578 |
echo '<input id="id_wwwroot" name="wwwroot" type="text" class="form-control text-ltr" value="'.s($CFG->wwwroot).'" disabled="disabled" size="70" /></div>';
|
| Línea 590... |
Línea 579... |
| 590 |
echo '</div>';
|
579 |
echo '</div>';
|
| 591 |
|
580 |
|
| 592 |
echo '<div class="row mb-4">';
|
581 |
echo '<div class="row mb-4">';
|
| 593 |
echo '<div class="col-md-3 text-md-right pt-1"><label for="id_dirroot">'.$paths['dirroot'].'</label></div>';
|
582 |
echo '<div class="col-md-3 text-md-end pt-1"><label for="id_dirroot">'.$paths['dirroot'].'</label></div>';
|
| 594 |
echo '<div class="col-md-9" data-fieldtype="text">';
|
583 |
echo '<div class="col-md-9" data-fieldtype="text">';
|
| Línea 595... |
Línea 584... |
| 595 |
echo '<input id="id_dirroot" name="dirroot" type="text" class="form-control text-ltr" value="'.s($CFG->dirroot).'" disabled="disabled" size="70" /></div>';
|
584 |
echo '<input id="id_dirroot" name="dirroot" type="text" class="form-control text-ltr" value="'.s($CFG->dirroot).'" disabled="disabled" size="70" /></div>';
|
| 596 |
echo '</div>';
|
585 |
echo '</div>';
|
| 597 |
|
586 |
|
| 598 |
echo '<div class="row mb-4">';
|
587 |
echo '<div class="row mb-4">';
|
| 599 |
echo '<div class="col-md-3 text-md-right pt-1"><label for="id_dataroot">'.$paths['dataroot'].'</label></div>';
|
588 |
echo '<div class="col-md-3 text-md-end pt-1"><label for="id_dataroot">'.$paths['dataroot'].'</label></div>';
|
| 600 |
echo '<div class="col-md-9" data-fieldtype="text">';
|
589 |
echo '<div class="col-md-9" data-fieldtype="text">';
|
| 601 |
echo '<input id="id_dataroot" name="dataroot" type="text" class="form-control text-ltr" value="'.s($config->dataroot).'" size="70" /></div>';
|
590 |
echo '<input id="id_dataroot" name="dataroot" type="text" class="form-control text-ltr" value="'.s($config->dataroot).'" size="70" /></div>';
|
| 602 |
echo '</div>';
|
591 |
echo '</div>';
|
| Línea 603... |
Línea 592... |
| 603 |
if ($hint_dataroot !== '') {
|
592 |
if ($hint_dataroot !== '') {
|
| 604 |
echo '<div class="alert alert-danger">'.$hint_dataroot.'</div>';
|
593 |
echo '<div class="alert alert-danger">'.$hint_dataroot.'</div>';
|
| 605 |
}
|
594 |
}
|
| 606 |
|
595 |
|
| 607 |
|
596 |
|
| 608 |
if (!file_exists("$CFG->dirroot/admin/environment.xml")) {
|
597 |
if (!file_exists("$CFG->dirroot/admin/environment.xml")) {
|
| 609 |
echo '<div class="row mb-4">';
|
598 |
echo '<div class="row mb-4">';
|
| 610 |
echo '<div class="col-md-3 text-md-right pt-1"><label for="id_admin">'.$paths['admindir'].'</label></div>';
|
599 |
echo '<div class="col-md-3 text-md-end pt-1"><label for="id_admin">'.$paths['admindir'].'</label></div>';
|
| Línea 639... |
Línea 628... |
| 639 |
get_string('chooselanguagesub', 'install'));
|
628 |
get_string('chooselanguagesub', 'install'));
|
| 640 |
}
|
629 |
}
|
| Línea 641... |
Línea 630... |
| 641 |
|
630 |
|
| 642 |
$languages = get_string_manager()->get_list_of_translations();
|
631 |
$languages = get_string_manager()->get_list_of_translations();
|
| 643 |
echo '<div class="row mb-4">';
|
632 |
echo '<div class="row mb-4">';
|
| 644 |
echo '<div class="col-md-3 text-md-right pt-1"><label for="langselect">'.get_string('language').'</label></div>';
|
633 |
echo '<div class="col-md-3 text-md-end pt-1"><label for="langselect">'.get_string('language').'</label></div>';
|
| 645 |
echo '<div class="col-md-9" data-fieldtype="select">';
|
634 |
echo '<div class="col-md-9" data-fieldtype="select">';
|
| 646 |
echo '<select id="langselect" class="form-control" name="lang" onchange="this.form.submit()">';
|
635 |
echo '<select id="langselect" class="form-control" name="lang" onchange="this.form.submit()">';
|
| 647 |
foreach ($languages as $name=>$value) {
|
636 |
foreach ($languages as $name=>$value) {
|
| 648 |
$selected = ($name == $CFG->lang) ? 'selected="selected"' : '';
|
637 |
$selected = ($name == $CFG->lang) ? 'selected="selected"' : '';
|
| Línea 651... |
Línea 640... |
| 651 |
echo '</select></div>';
|
640 |
echo '</select></div>';
|
| 652 |
echo '</div>';
|
641 |
echo '</div>';
|
| Línea 653... |
Línea 642... |
| 653 |
|
642 |
|
| 654 |
install_print_footer($config);
|
643 |
install_print_footer($config);
|
| 655 |
die;
|
- |
|