Exemplo n.º 1
0
    }
}
// call all the steps
if (!regenerate_configs()) {
    trigger_error('Config Generation Failed', E_USER_ERROR);
}
require_once $SYSTEM_ROOT . '/install/generate_install_key.php';
// check if the $packageList variable has been defined at all
if (!isset($package_list)) {
    $package_list = array();
}
// generate the char map first, creating asset will need this
generate_lang_char_map();
generate_import_tools_manager_config();
disable_missing_packages();
install_core($package_list);
$deferred = install_packages($package_list);
// if there were deferred packages, try to reinstall them.
if (is_array($deferred)) {
    // try and install the deferred packages again in a loop until the result
    // package is the same as the install package, at which point we know
    // the dependency has failed.
    $deferred = install_deferred($deferred);
    if (is_array($deferred)) {
        trigger_error('The following assets could not be installed due to dependency failures (see previous warnings for details): ' . "\n" . format_deferred_packages($deferred), E_USER_ERROR);
    }
}
echo "\n";
install_authentication_types();
generate_global_preferences();
install_event_listeners();
Exemplo n.º 2
0
    //TODO: add a page with list of non-standard plugins here
    $strdatabasesetup = get_string('databasesetup');
    upgrade_init_javascript();
    $PAGE->navbar->add($strdatabasesetup);
    $PAGE->set_title($strinstallation . ' - Moodle ' . $CFG->target_release);
    $PAGE->set_heading($strinstallation);
    $PAGE->set_cacheable(false);
    $output = $PAGE->get_renderer('core', 'admin');
    echo $output->header();
    if (!$DB->setup_is_unicodedb()) {
        if (!$DB->change_db_encoding()) {
            // If could not convert successfully, throw error, and prevent installation
            print_error('unicoderequired', 'admin');
        }
    }
    install_core($version, true);
}
// Check version of Moodle code on disk compared with database
// and upgrade if possible.
$stradministration = get_string('administration');
$PAGE->set_context(get_context_instance(CONTEXT_SYSTEM));
if (empty($CFG->version)) {
    print_error('missingconfigversion', 'debug');
}
if ($version > $CFG->version) {
    // upgrade
    purge_all_caches();
    $PAGE->set_pagelayout('maintenance');
    $PAGE->set_popup_notification_allowed(false);
    if (upgrade_stale_php_files_present()) {
        $PAGE->set_title($stradministration);
Exemplo n.º 3
0
$settings['module_data']['fileManager']['path'] = 'modules/fileManager/';
$settings['module_data']['themer']['path'] = 'modules/themer/';
$settings['home_page'] = 'user/login';
$settings['default_theme'] = 'default';
$settings['clean_urls'] = FALSE;
$settings['footer_message'] = "running_on_agave();";
$settings['sess_method'] = 'database';
//ROUTE INSTALL PROCESS
if (bootstrap()) {
    $mode = $_SESSION['install-mode'];
    if (!isset($mode)) {
        install_begin();
    } else {
        switch ($mode) {
            case 'core':
                install_core();
                break;
            case 'user':
                install_user();
                break;
            case 'info':
                install_site_info();
                break;
            case 'finish':
                install_finish();
                break;
        }
    }
}
/**
 *	Function pile
Exemplo n.º 4
0
/**
 * Install Moodle DB,
 * config.php must exist, there must not be any tables in db yet.
 *
 * @param array $options adminpass is mandatory
 * @param bool $interactive
 * @return void
 */
function install_cli_database(array $options, $interactive)
{
    global $CFG, $DB;
    require_once $CFG->libdir . '/environmentlib.php';
    require_once $CFG->libdir . '/upgradelib.php';
    // show as much debug as possible
    @error_reporting(E_ALL | E_STRICT);
    @ini_set('display_errors', '1');
    $CFG->debug = E_ALL | E_STRICT;
    $CFG->debugdisplay = true;
    $CFG->version = '';
    $CFG->release = '';
    $CFG->branch = '';
    $version = null;
    $release = null;
    $branch = null;
    // read $version and $release
    require $CFG->dirroot . '/version.php';
    if ($DB->get_tables()) {
        cli_error(get_string('clitablesexist', 'install'));
    }
    if (empty($options['adminpass'])) {
        cli_error('Missing required admin password');
    }
    // test environment first
    list($envstatus, $environment_results) = check_moodle_environment(normalize_version($release), ENV_SELECT_RELEASE);
    if (!$envstatus) {
        $errors = environment_get_errors($environment_results);
        cli_heading(get_string('environment', 'admin'));
        foreach ($errors as $error) {
            list($info, $report) = $error;
            echo "!! {$info} !!\n{$report}\n\n";
        }
        exit(1);
    }
    if (!$DB->setup_is_unicodedb()) {
        if (!$DB->change_db_encoding()) {
            // If could not convert successfully, throw error, and prevent installation
            cli_error(get_string('unicoderequired', 'admin'));
        }
    }
    if ($interactive) {
        cli_separator();
        cli_heading(get_string('databasesetup'));
    }
    // install core
    install_core($version, true);
    set_config('release', $release);
    set_config('branch', $branch);
    if (PHPUNIT_TEST) {
        // mark as test database as soon as possible
        set_config('phpunittest', 'na');
    }
    // install all plugins types, local, etc.
    upgrade_noncore(true);
    // set up admin user password
    $DB->set_field('user', 'password', hash_internal_user_password($options['adminpass']), array('username' => 'admin'));
    // rename admin username if needed
    if (isset($options['adminuser']) and $options['adminuser'] !== 'admin' and $options['adminuser'] !== 'guest') {
        $DB->set_field('user', 'username', $options['adminuser'], array('username' => 'admin'));
    }
    // indicate that this site is fully configured
    set_config('rolesactive', 1);
    upgrade_finished();
    // log in as admin - we need do anything when applying defaults
    $admins = get_admins();
    $admin = reset($admins);
    session_set_user($admin);
    // apply all default settings, do it twice to fill all defaults - some settings depend on other setting
    admin_apply_default_settings(NULL, true);
    admin_apply_default_settings(NULL, true);
    set_config('registerauth', '');
    // set the site name
    if (isset($options['shortname']) and $options['shortname'] !== '') {
        $DB->set_field('course', 'shortname', $options['shortname'], array('format' => 'site'));
    }
    if (isset($options['fullname']) and $options['fullname'] !== '') {
        $DB->set_field('course', 'fullname', $options['fullname'], array('format' => 'site'));
    }
}
Exemplo n.º 5
0
######################
### Security Check ###
######################
if (!GWF_IP6::isLocal()) {
    if ($_SERVER['REMOTE_ADDR'] !== $worker_ip) {
        GWF3::logDie(sprintf('You have no valid $worker_ip in %s line %s.', __FILE__, __LINE__));
    }
}
GWF_Debug::setDieOnError(false);
GWF_Language::initEnglish();
GWF_HTML::init();
GWF_Log::init(false, true, GWF_WWW_PATH . 'protected/logs');
require_once GWF_CORE_PATH . 'inc/install/GWF_InstallFunctions.php';
if (false !== Common::getPost('core')) {
    $success = true;
    install_core(false, $success);
}
if (false !== Common::getPost('lang')) {
    install_createLanguage(true, true, false);
}
if (false !== Common::getPost('lang2')) {
    install_createLanguage(true, true, true);
}
if (false !== Common::getPost('mods')) {
    install_all_modules();
}
if (false !== Common::getPost('users')) {
    install_default_users();
}
if (false !== Common::getPost('gwf23')) {
    require_once GWF_CORE_PATH . 'inc/install/upgrade/install23.php';