Ejemplo n.º 1
0
    $config->prefix   = 'mdl_';
    $config->dbport   = empty($distro->dbport) ? '' : $distro->dbport;
    $config->dbsocket = empty($distro->dbsocket) ? '' : $distro->dbsocket;

    $config->admin    = 'admin';

    $config->dataroot = empty($distro->dataroot) ? null  : $distro->dataroot; // initialised later after including libs or by distro
}

// Fake some settings so that we can use selected functions from moodlelib.php, weblib.php and filelib.php.
global $CFG;
$CFG = new stdClass();
$CFG->lang                 = $config->lang;
$CFG->dirroot              = dirname(__FILE__);
$CFG->libdir               = "$CFG->dirroot/lib";
$CFG->wwwroot              = install_guess_wwwroot(); // can not be changed - ppl must use the real address when installing
$CFG->httpswwwroot         = $CFG->wwwroot;
$CFG->dataroot             = $config->dataroot;
$CFG->tempdir              = $CFG->dataroot.'/temp';
$CFG->cachedir             = $CFG->dataroot.'/cache';
$CFG->localcachedir        = $CFG->dataroot.'/localcache';
$CFG->admin                = $config->admin;
$CFG->docroot              = 'http://docs.moodle.org';
$CFG->langotherroot        = $CFG->dataroot.'/lang';
$CFG->langlocalroot        = $CFG->dataroot.'/lang';
$CFG->directorypermissions = isset($distro->directorypermissions) ? $distro->directorypermissions : 00777; // let distros set dir permissions
$CFG->filepermissions      = ($CFG->directorypermissions & 0666);
$CFG->umaskpermissions     = (($CFG->directorypermissions & 0777) ^ 0777);
$CFG->running_installer    = true;
$CFG->early_install_lang   = true;
$CFG->ostype               = (stristr(PHP_OS, 'win') && !stristr(PHP_OS, 'darwin')) ? 'WINDOWS' : 'UNIX';
Ejemplo n.º 2
0
    $config->dbpass = '';
    $config->dbname = 'moodle';
    $config->prefix = 'mdl_';
    $config->dbport = empty($distro->dbport) ? '' : $distro->dbport;
    $config->dbsocket = empty($distro->dbsocket) ? '' : $distro->dbsocket;
    $config->admin = 'admin';
    $config->dataroot = empty($distro->dataroot) ? null : $distro->dataroot;
    // initialised later after including libs or by distro
}
// Fake some settings so that we can use selected functions from moodlelib.php, weblib.php and filelib.php.
global $CFG;
$CFG = new stdClass();
$CFG->lang = $config->lang;
$CFG->dirroot = __DIR__;
$CFG->libdir = "{$CFG->dirroot}/lib";
$CFG->wwwroot = install_guess_wwwroot();
// can not be changed - ppl must use the real address when installing
$CFG->httpswwwroot = $CFG->wwwroot;
$CFG->dataroot = $config->dataroot;
$CFG->tempdir = $CFG->dataroot . '/temp';
$CFG->cachedir = $CFG->dataroot . '/cache';
$CFG->localcachedir = $CFG->dataroot . '/localcache';
$CFG->admin = $config->admin;
$CFG->docroot = 'http://docs.moodle.org';
$CFG->langotherroot = $CFG->dataroot . '/lang';
$CFG->langlocalroot = $CFG->dataroot . '/lang';
$CFG->directorypermissions = isset($distro->directorypermissions) ? $distro->directorypermissions : 0777;
// let distros set dir permissions
$CFG->filepermissions = $CFG->directorypermissions & 0666;
$CFG->umaskpermissions = $CFG->directorypermissions & 0777 ^ 0777;
$CFG->running_installer = true;