Skip to content

Commit

Permalink
MDL-39484 core: Undefined ostype during installation process
Browse files Browse the repository at this point in the history
  • Loading branch information
Frederic Massart committed May 6, 2013
1 parent 95190fd commit cf4cef7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions admin/cli/install.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@
$CFG->docroot = 'http://docs.moodle.org';
$CFG->running_installer = true;
$CFG->early_install_lang = true;
$CFG->ostype = (stristr(PHP_OS, 'win') && !stristr(PHP_OS, 'darwin')) ? 'WINDOWS' : 'UNIX';

$parts = explode('/', str_replace('\\', '/', dirname(dirname(__FILE__))));
$CFG->admin = array_pop($parts);
Expand Down
3 changes: 2 additions & 1 deletion install.php
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@
$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 and weblib.php
// Fake some settings so that we can use selected functions from moodlelib.php, weblib.php and filelib.php.
$CFG = new stdClass();
$CFG->lang = $config->lang;
$CFG->dirroot = dirname(__FILE__);
Expand All @@ -168,6 +168,7 @@
$CFG->directorypermissions = isset($distro->directorypermissions) ? $distro->directorypermissions : 00777; // let distros set dir permissions
$CFG->running_installer = true;
$CFG->early_install_lang = true;
$CFG->ostype = (stristr(PHP_OS, 'win') && !stristr(PHP_OS, 'darwin')) ? 'WINDOWS' : 'UNIX';

// Require all needed libs
require_once($CFG->libdir.'/setuplib.php');
Expand Down

0 comments on commit cf4cef7

Please sign in to comment.