75 public function run(): \
Elgg\Http\ResponseBuilder {
78 $this->is_action =
$app->internal_services->request->getMethod() ===
'POST';
97 $params =
$app->internal_services->request->request->all();
99 $method =
'run' . ucwords(
$step);
101 return $this->$method(
$params);
117 $config->installer_running =
true;
118 $config->dbencoding =
'utf8mb4';
120 $config->system_cache_enabled =
false;
121 $config->simplecache_enabled =
false;
122 $config->debug = \Psr\Log\LogLevel::WARNING;
123 $config->cacheroot = sys_get_temp_dir() .
'elgginstaller/caches';
124 $config->assetroot = sys_get_temp_dir() .
'elgginstaller/assets';
126 $app = Application::factory([
128 'handle_exceptions' =>
false,
129 'handle_shutdown' =>
false,
137 Application::setInstance($app);
141 $app->internal_services->bootCache->disable();
142 $app->internal_services->pluginsCache->disable();
143 $app->internal_services->accessCache->disable();
144 $app->internal_services->metadataCache->disable();
145 $app->internal_services->serverCache->disable();
148 $index_admin = array_search(
'admin', $this->getSteps());
149 $index_complete = array_search(
'complete', $this->getSteps());
150 $index_step = array_search(
$current_step, $this->getSteps());
154 $use_elgg_session = ($index_step == $index_admin) || ($index_step == $index_complete);
155 if (!$use_elgg_session) {
158 $app->internal_services->set(
'session',
$session);
161 $app->internal_services->views->setViewtype(
'installation');
162 $app->internal_services->views->registerViewtypeFallback(
'installation');
163 $app->internal_services->views->registerViewsFromPath(
Paths::elgg());
164 $app->internal_services->translator->registerTranslations(
Paths::elgg() .
'install/languages/',
true);
188 $app = $this->getApp();
191 'dbhost' =>
'localhost',
193 'dbprefix' =>
'elgg_',
211 foreach ($required_params as
$key) {
221 if ($create_htaccess) {
223 if (!$rewrite_tester->createHtaccess(
$params[
'wwwroot'])) {
228 if (!\
Elgg\Http\Urls::isValidMultiByteUrl(
$params[
'wwwroot'])) {
235 $this->determineInstallStatus();
237 if (!$this->has_completed[
'config']) {
238 if (!$this->createSettingsFile(
$params)) {
243 $this->loadSettingsFile();
246 $config = $app->internal_services->config;
251 $db_config = $app->internal_services->dbConfig->getConnectionConfig();
257 'dbpassword' =>
'password',
258 'dbname' =>
'database',
259 'dbprefix' =>
'prefix',
261 foreach ($db_config_keys as $params_key => $db_config_key) {
262 if (
$params[$params_key] !== (
string) $db_config[$db_config_key]) {
267 if (!$this->connectToDatabase()) {
271 if (!$this->has_completed[
'database']) {
272 if (!$this->installDatabase()) {
278 $this->finishBootstrapping(
'settings');
280 if (!$this->saveSiteSettings(
$params)) {
284 if (!$this->createAdminAccount(
$params)) {
298 $vars[
'next_step'] = $this->getNextStep(
$step);
309 'steps' => $this->getSteps(),
313 return new \Elgg\Http\OkResponse(
$output);
326 return $this->render(
'welcome');
346 $this->checkRewriteRules(
$report);
349 if ($this->checkSettingsFile(
$report) !==
true) {
351 $this->isInstallDirWritable(
$report);
357 'severity' =>
'notice',
358 'message' =>
elgg_echo(
'install:check:database'),
362 return $this->render(
'requirements', [
364 'num_failures' => $this->countNumConditions(
$report,
'error'),
365 'num_warnings' => $this->countNumConditions(
$report,
'warning'),
378 protected function runDatabase(array $submissionVars = []): \
Elgg\Http\ResponseBuilder {
380 $app = $this->getApp();
389 'type' =>
'password',
400 'value' =>
'localhost',
422 'value' => $app->internal_services->config->wwwroot,
426 'type' =>
'dropdown',
428 'options' => \DateTimeZone::listIdentifiers(),
433 if ($this->checkSettingsFile()) {
435 $this->is_action =
true;
438 if ($this->is_action) {
439 $getResponse =
function () use ($app, $submissionVars, $formVars) {
441 if (!$this->checkSettingsFile()) {
442 if (!$this->validateDatabaseVars($submissionVars, $formVars)) {
447 if (!$this->createSettingsFile($submissionVars)) {
453 if (!$this->connectToDatabase()) {
457 if (!$this->installDatabase()) {
461 $app->internal_services->system_messages->addSuccessMessage(
elgg_echo(
'install:success:database'));
463 return $this->continueToNextStep(
'database');
472 $formVars = $this->makeFormSticky($formVars, $submissionVars);
474 $params = [
'variables' => $formVars,];
476 if ($this->checkSettingsFile()) {
481 return $this->render(
'database',
$params);
493 protected function runSettings(array $submissionVars = []): \
Elgg\Http\ResponseBuilder {
495 $app = $this->getApp();
500 'value' =>
'My New Community',
515 if ($this->is_action) {
516 $getResponse =
function () use ($app, $submissionVars, $formVars) {
518 if (!$this->validateSettingsVars($submissionVars, $formVars)) {
522 if (!$this->saveSiteSettings($submissionVars)) {
526 $app->internal_services->system_messages->addSuccessMessage(
elgg_echo(
'install:success:settings'));
528 return $this->continueToNextStep(
'settings');
537 $formVars = $this->makeFormSticky($formVars, $submissionVars);
539 return $this->render(
'settings', [
'variables' => $formVars]);
551 protected function runAdmin(array $submissionVars = []): \
Elgg\Http\ResponseBuilder {
552 $app = $this->getApp();
571 'type' =>
'password',
574 'pattern' =>
'.{6,}',
577 'type' =>
'password',
583 if ($this->is_action) {
584 $getResponse =
function () use ($app, $submissionVars, $formVars) {
585 if (!$this->validateAdminVars($submissionVars, $formVars)) {
589 if (!$this->createAdminAccount($submissionVars,
true)) {
593 $app->internal_services->system_messages->addSuccessMessage(
elgg_echo(
'install:success:admin'));
595 return $this->continueToNextStep(
'admin');
607 $lang = $app->internal_services->translator->getCurrentLanguage();
608 $translations = $app->internal_services->translator->getLoadedTranslations();
610 $app->internal_services->translator->addTranslation(
$lang, [
611 'install:admin:help:password1' => sprintf(
613 $app->internal_services->config->min_password_length
617 $formVars = $this->makeFormSticky($formVars, $submissionVars);
619 return $this->render(
'admin', [
'variables' => $formVars]);
638 $result = $this->render(
'complete');
666 return in_array(
$step, $this->getSteps()) ?
$step :
'welcome';
677 $this->is_action = false;
679 return new \Elgg\Http\RedirectResponse($this->getNextStepUrl($currentStep));
690 $index = 1 + array_search($currentStep, $this->steps);
692 return $this->steps[
$index] ??
'';
703 $app = $this->getApp();
704 $nextStep = $this->getNextStep($currentStep);
706 return $app->internal_services->config->wwwroot .
"install.php?step={$nextStep}";
716 $app = $this->getApp();
718 $path = Config::resolvePath();
723 $this->loadSettingsFile();
725 $this->has_completed[
'config'] =
true;
728 $dbSettingsPass = $this->checkDatabaseSettings($app->internal_services->dbConfig);
730 if (!$dbSettingsPass) {
734 $db = $app->internal_services->db;
738 $result =
$db->getConnection(
'read')->executeQuery(
'SHOW TABLES');
744 if (in_array(
"{$db->prefix}config",
$table)) {
745 $this->has_completed[
'database'] =
true;
749 if ($this->has_completed[
'database'] ===
false) {
754 $qb = \Elgg\Database\Select::fromTable(\
Elgg\
Database\ConfigTable::TABLE_NAME);
755 $qb->select(
'COUNT(*) AS total');
759 $this->has_completed[
'settings'] =
true;
766 $qb->select(
'COUNT(*) AS total')
771 $this->has_completed[
'admin'] =
true;
776 throw new InstallationException(
'Elgg can not connect to the database: ' . $ex->getMessage(), $ex->getCode(), $ex);
793 if (!in_array(
false, $this->has_completed)) {
795 return new \Elgg\Http\RedirectResponse(
'/');
815 if ($this->has_completed[
'database'] ===
false) {
819 if ($this->has_completed[
'settings'] ===
false) {
820 return new \Elgg\Http\RedirectResponse(
'install.php?step=settings');
823 if ($this->has_completed[
'admin'] ===
false) {
824 return new \Elgg\Http\RedirectResponse(
'install.php?step=admin');
828 return new \Elgg\Http\RedirectResponse(
'install.php?step=complete');
845 $app = $this->getApp();
847 $index_db = array_search(
'database', $this->getSteps());
848 $index_step = array_search(
$step, $this->getSteps());
850 if ($index_step > $index_db) {
854 $app->internal_services->config->site = new \ElggSite();
868 $app = $this->getApp();
871 $app->internal_services->set(
'config', $app->internal_services->initConfig(
$config));
874 $app->internal_services->db->resetConnections($app->internal_services->dbConfig);
875 }
catch (\Exception $e) {
892 protected function makeFormSticky(array $formVars = [], array $submissionVars = []): array {
910 if (!is_writable(
Paths::projectConfig())) {
913 'severity' =>
'error',
914 'message' =>
elgg_echo(
'install:check:installdir', [Paths::PATH_TO_CONFIG]),
932 if (!is_file(
Config::resolvePath())) {
936 if (!is_readable(Config::resolvePath())) {
939 'severity' =>
'error',
940 'message' =>
elgg_echo(
'install:check:readsettings'),
958 if (version_compare(PHP_VERSION, self::PHP_MINIMAL_VERSION,
'<')) {
960 'severity' =>
'error',
961 'message' =>
elgg_echo(
'install:check:php:version', [self::PHP_MINIMAL_VERSION, PHP_VERSION]),
965 $this->checkPhpExtensions($phpReport);
967 $this->checkPhpDirectives($phpReport);
969 if (count($phpReport) == 0) {
971 'severity' =>
'success',
972 'message' =>
elgg_echo(
'install:check:php:success'),
998 'severity' =>
'error',
1010 'severity' =>
'warning',
1025 if (ini_get(
'open_basedir')) {
1027 'severity' =>
'warning',
1028 'message' =>
elgg_echo(
'install:check:php:open_basedir'),
1032 if (ini_get(
'safe_mode')) {
1034 'severity' =>
'warning',
1035 'message' =>
elgg_echo(
'install:check:php:safe_mode'),
1039 if (ini_get(
'arg_separator.output') !==
'&') {
1040 $separator = htmlspecialchars(ini_get(
'arg_separator.output'));
1042 'severity' =>
'error',
1047 if (ini_get(
'register_globals')) {
1049 'severity' =>
'error',
1050 'message' =>
elgg_echo(
'install:check:php:register_globals'),
1054 if (ini_get(
'session.auto_start')) {
1056 'severity' =>
'error',
1057 'message' =>
elgg_echo(
'install:check:php:session.auto_start'),
1072 $url = $this->getApp()->internal_services->config->wwwroot;
1073 $url .= Request::REWRITE_TEST_TOKEN .
'?' . http_build_query([Request::REWRITE_TEST_TOKEN =>
'1']);
1088 foreach (
$report as $checks) {
1089 foreach ($checks as $check) {
1090 if ($check[
'severity'] === $condition) {
1113 $app = $this->getApp();
1116 if (
$info[
'required'] ===
true && !$submissionVars[
$field]) {
1118 $app->internal_services->system_messages->addErrorMessage(
elgg_echo(
'install:error:requiredfield', [
$name]));
1124 if (!empty($submissionVars[
'wwwroot']) && !\
Elgg\Http\Urls::isValidMultiByteUrl($submissionVars[
'wwwroot'])) {
1125 $save_value = $this->sanitizeInputValue($submissionVars[
'wwwroot']);
1126 $app->internal_services->system_messages->addErrorMessage(
elgg_echo(
'install:error:wwwroot', [$save_value]));
1132 if (stripos(PHP_OS,
'win') === 0) {
1133 if (strpos($submissionVars[
'dataroot'],
':') !== 1) {
1134 $save_value = $this->sanitizeInputValue($submissionVars[
'dataroot']);
1135 $app->internal_services->system_messages->addErrorMessage(
elgg_echo(
'install:error:relative_path', [$save_value]));
1140 if (!str_starts_with($submissionVars[
'dataroot'],
'/')) {
1141 $save_value = $this->sanitizeInputValue($submissionVars[
'dataroot']);
1142 $app->internal_services->system_messages->addErrorMessage(
elgg_echo(
'install:error:relative_path', [$save_value]));
1149 if (!is_dir($submissionVars[
'dataroot'])) {
1150 $save_value = $this->sanitizeInputValue($submissionVars[
'dataroot']);
1151 $app->internal_services->system_messages->addErrorMessage(
elgg_echo(
'install:error:datadirectoryexists', [$save_value]));
1157 if (!is_writable($submissionVars[
'dataroot'])) {
1158 $save_value = $this->sanitizeInputValue($submissionVars[
'dataroot']);
1159 $app->internal_services->system_messages->addErrorMessage(
elgg_echo(
'install:error:writedatadirectory', [$save_value]));
1165 if (stripos($submissionVars[
'dataroot'],
Paths::project()) === 0) {
1166 $save_value = $this->sanitizeInputValue($submissionVars[
'dataroot']);
1167 $app->internal_services->system_messages->addErrorMessage(
elgg_echo(
'install:error:locationdatadirectory', [$save_value]));
1177 if (!empty($submissionVars[
'dbprefix']) && !preg_match(
'/^[a-zA-Z_][\w]*$/', $submissionVars[
'dbprefix'])) {
1178 $app->internal_services->system_messages->addErrorMessage(
elgg_echo(
'install:error:database_prefix'));
1184 'dbhost' => $submissionVars[
'dbhost'],
1185 'dbport' => $submissionVars[
'dbport'],
1186 'dbuser' => $submissionVars[
'dbuser'],
1187 'dbpass' => $submissionVars[
'dbpassword'],
1188 'dbname' => $submissionVars[
'dbname'],
1189 'dbencoding' =>
'utf8mb4',
1192 return $this->checkDatabaseSettings(
$config);
1203 $app = $this->getApp();
1205 $db =
new Database(
$config, $app->internal_services->queryCache, $app->internal_services->config);
1208 $db->getConnection(
'read')->executeQuery(
'SELECT 1');
1210 if (str_starts_with($e->getMessage(),
"Elgg couldn't connect")) {
1211 $app->internal_services->system_messages->addErrorMessage(
elgg_echo(
'install:error:databasesettings'));
1214 $app->internal_services->system_messages->addErrorMessage(
elgg_echo(
'install:error:nodatabase', [$database]));
1222 $min_version =
$db->isMariaDB() ? self::MARIADB_MINIMAL_VERSION : self::MYSQL_MINIMAL_VERSION;
1241 $app = $this->getApp();
1243 $template = file_get_contents(
Paths::elgg() .
'elgg-config/settings.example.php');
1245 $app->internal_services->system_messages->addErrorMessage(
elgg_echo(
'install:error:readsettingsphp'));
1250 foreach (
$params as $k => $v) {
1254 $v = Paths::sanitize($v);
1257 $v = addslashes($v);
1261 $template = str_replace(
'{{' . $k .
'}}', $v, $template);
1264 $result = file_put_contents(Config::resolvePath(), $template);
1266 $app->internal_services->system_messages->addErrorMessage(
elgg_echo(
'install:error:writesettingphp'));
1282 $this->getApp()->internal_services->set(
'dbConfig', $dbConfig);
1283 $this->getApp()->internal_services->db->resetConnections($dbConfig);
1295 $app = $this->getApp();
1296 $app->internal_services->db->setupConnections();
1298 $app->internal_services->system_messages->addErrorMessage($e->getMessage());
1313 return $this->getApp()->migrate();
1314 }
catch (\Exception $e) {
1333 if ($formVars[
'dataroot'][
'type'] !==
'combo') {
1338 if ($submissionVars[
'dataroot'] !==
'dataroot-checkbox') {
1343 if (file_exists($dir) || mkdir($dir, 0755)) {
1344 $submissionVars[
'dataroot'] = $dir;
1345 if (!file_exists(
"{$dir}/.htaccess")) {
1346 $htaccess =
"Order Deny,Allow\nDeny from All\n";
1347 if (!file_put_contents(
"$dir/.htaccess", $htaccess)) {
1367 $app = $this->getApp();
1370 $submissionVars[
$field] = trim($submissionVars[
$field]);
1371 if (
$info[
'required'] ===
true && $submissionVars[
$field] ===
'') {
1373 $app->internal_services->system_messages->addErrorMessage(
elgg_echo(
'install:error:requiredfield', [
$name]));
1380 if ($submissionVars[
'siteemail'] && !
elgg_is_valid_email((
string) $submissionVars[
'siteemail'])) {
1381 $save_value = $this->sanitizeInputValue($submissionVars[
'siteemail']);
1382 $app->internal_services->system_messages->addErrorMessage(
elgg_echo(
'install:error:emailaddress', [$save_value]));
1398 $app = $this->getApp();
1403 $site = new \ElggSite();
1404 $site->name = strip_tags($submissionVars[
'sitename']);
1406 $site->email = $submissionVars[
'siteemail'];
1410 if (
$site->guid !== 1) {
1411 $app->internal_services->system_messages->addErrorMessage(
elgg_echo(
'install:error:createsite'));
1416 $app->internal_services->config->site =
$site;
1419 'installed' => time(),
1420 'simplecache_enabled' => 1,
1421 'system_cache_enabled' => 1,
1422 'simplecache_minify_js' =>
true,
1423 'simplecache_minify_css' =>
true,
1424 'lastcache' => time(),
1426 'default_access' => $submissionVars[
'siteaccess'],
1427 'allow_registration' =>
false,
1428 'require_admin_validation' =>
false,
1429 'walled_garden' =>
false,
1430 'allow_user_default_access' =>
'',
1431 'default_limit' => 10,
1441 $app->internal_services->reset(
'plugins');
1443 if (
elgg_extract(
'activate_plugins', $submissionVars,
true)) {
1444 $plugins = $app->internal_services->plugins->find(
'all');
1446 foreach ($plugins as
$plugin) {
1447 $plugin_config =
$plugin->getStaticConfig(
'plugin', []);
1448 if (!
elgg_extract(
'activate_on_install', $plugin_config,
false)) {
1461 $app->internal_services->events->unregisterHandler(
'create:after',
'object', \
Elgg\Upgrade\CreateAdminNoticeHandler::class);
1462 $upgrades = $app->internal_services->upgradeLocator->locate();
1466 }
catch (\Exception $e) {
1467 $app->internal_services->logger->log(\Psr\Log\LogLevel::ERROR, $e);
1483 $app = $this->getApp();
1486 if (
$info[
'required'] ===
true && !$submissionVars[
$field]) {
1488 $app->internal_services->system_messages->addErrorMessage(
elgg_echo(
'install:error:requiredfield', [
$name]));
1494 if ($submissionVars[
'password1'] !== $submissionVars[
'password2']) {
1495 $app->internal_services->system_messages->addErrorMessage(
elgg_echo(
'install:admin:password:mismatch'));
1500 if (trim($submissionVars[
'password1']) ===
'') {
1501 $app->internal_services->system_messages->addErrorMessage(
elgg_echo(
'install:admin:password:empty'));
1506 $minLength = $app->internal_services->configTable->get(
'min_password_length');
1507 if (strlen($submissionVars[
'password1']) < $minLength) {
1508 $app->internal_services->system_messages->addErrorMessage(
elgg_echo(
'install:admin:password:tooshort'));
1514 if ($submissionVars[
'email'] && !
elgg_is_valid_email((
string) $submissionVars[
'email'])) {
1515 $save_value = $this->sanitizeInputValue($submissionVars[
'email']);
1516 $app->internal_services->system_messages->addErrorMessage(
elgg_echo(
'install:error:emailaddress', [$save_value]));
1533 $app = $this->getApp();
1537 'username' => $submissionVars[
'username'],
1538 'password' => $submissionVars[
'password1'],
1539 'name' => $submissionVars[
'displayname'],
1540 'email' => $submissionVars[
'email'],
1543 $app->internal_services->system_messages->addErrorMessage($e->getMessage());
1549 if (!
$user->makeAdmin()) {
1550 $app->internal_services->system_messages->addErrorMessage(elgg_echo(
'install:error:adminaccess'));
1555 $user->validated =
true;
1556 $user->validated_method =
'admin_user';
1565 $app->internal_services->system_messages->addErrorMessage(
elgg_echo(
'install:error:adminlogin'));
1581 if (is_array($input_value)) {
1582 return array_map([$this, __FUNCTION__], $input_value);
1585 if (!is_string($input_value)) {
1586 return $input_value;
1589 return htmlspecialchars($input_value);
if(empty($guid)) $upgrade
if(! $user||! $user->canDelete()) $name
$params
Saves global plugin settings.
return[ 'admin/delete_admin_notices'=>['access'=> 'admin'], 'admin/menu/save'=>['access'=> 'admin'], 'admin/plugins/activate'=>['access'=> 'admin'], 'admin/plugins/activate_all'=>['access'=> 'admin'], 'admin/plugins/deactivate'=>['access'=> 'admin'], 'admin/plugins/deactivate_all'=>['access'=> 'admin'], 'admin/plugins/set_priority'=>['access'=> 'admin'], 'admin/security/security_txt'=>['access'=> 'admin'], 'admin/security/settings'=>['access'=> 'admin'], 'admin/security/regenerate_site_secret'=>['access'=> 'admin'], 'admin/site/cache/invalidate'=>['access'=> 'admin'], 'admin/site/flush_cache'=>['access'=> 'admin'], 'admin/site/icons'=>['access'=> 'admin'], 'admin/site/set_maintenance_mode'=>['access'=> 'admin'], 'admin/site/set_robots'=>['access'=> 'admin'], 'admin/site/theme'=>['access'=> 'admin'], 'admin/site/unlock_upgrade'=>['access'=> 'admin'], 'admin/site/settings'=>['access'=> 'admin'], 'admin/upgrade'=>['access'=> 'admin'], 'admin/upgrade/reset'=>['access'=> 'admin'], 'admin/user/ban'=>['access'=> 'admin'], 'admin/user/bulk/ban'=>['access'=> 'admin'], 'admin/user/bulk/delete'=>['access'=> 'admin'], 'admin/user/bulk/unban'=>['access'=> 'admin'], 'admin/user/bulk/validate'=>['access'=> 'admin'], 'admin/user/change_email'=>['access'=> 'admin'], 'admin/user/delete'=>['access'=> 'admin'], 'admin/user/login_as'=>['access'=> 'admin'], 'admin/user/logout_as'=>[], 'admin/user/makeadmin'=>['access'=> 'admin'], 'admin/user/resetpassword'=>['access'=> 'admin'], 'admin/user/removeadmin'=>['access'=> 'admin'], 'admin/user/unban'=>['access'=> 'admin'], 'admin/user/validate'=>['access'=> 'admin'], 'annotation/delete'=>[], 'avatar/upload'=>[], 'comment/save'=>[], 'diagnostics/download'=>['access'=> 'admin'], 'entity/chooserestoredestination'=>[], 'entity/delete'=>[], 'entity/mute'=>[], 'entity/restore'=>[], 'entity/subscribe'=>[], 'entity/trash'=>[], 'entity/unmute'=>[], 'entity/unsubscribe'=>[], 'login'=>['access'=> 'logged_out'], 'logout'=>[], 'notifications/mute'=>['access'=> 'public'], 'plugins/settings/remove'=>['access'=> 'admin'], 'plugins/settings/save'=>['access'=> 'admin'], 'plugins/usersettings/save'=>[], 'register'=>['access'=> 'logged_out', 'middleware'=>[\Elgg\Router\Middleware\RegistrationAllowedGatekeeper::class,],], 'river/delete'=>[], 'settings/notifications'=>[], 'settings/notifications/subscriptions'=>[], 'user/changepassword'=>['access'=> 'public'], 'user/requestnewpassword'=>['access'=> 'public'], 'useradd'=>['access'=> 'admin'], 'usersettings/save'=>[], 'widgets/add'=>[], 'widgets/delete'=>[], 'widgets/move'=>[], 'widgets/save'=>[],]
foreach( $paths as $path)
getNextStepUrl(string $currentStep)
Get the URL of the next step.
run()
Dispatches a request to one of the step controllers.
batchInstall(array $params, bool $create_htaccess=false)
A batch install of Elgg.
const PHP_MINIMAL_VERSION
runWelcome()
Step controllers.
sanitizeInputValue($input_value)
Sanitize input to help prevent XSS.
runDatabase(array $submissionVars=[])
Database set up controller.
getApp()
Build the application needed by the installer.
getSteps()
Step management.
resumeInstall(string $step)
Check if this is a case of a install being resumed and figure out where to continue from.
continueToNextStep(string $currentStep)
Forwards the browser to the next step.
saveSiteSettings(array $submissionVars)
Initialize the site including site entity, plugins, and configuration.
determineInstallStatus()
Updates $this->has_completed according to the current installation.
const MYSQL_MINIMAL_VERSION
runComplete()
Controller for last step.
validateAdminVars(array $submissionVars, array $formVars)
Validate account form variables.
getNextStep(string $currentStep)
Get the next step as a string.
checkSettingsFile(array &$report=[])
Check that the settings file exists.
validateSettingsVars(array $submissionVars, array $formVars)
Validate the site settings form variables.
createSettingsFile(array $params)
Writes the settings file to the engine directory.
createAdminAccount(array $submissionVars, bool $login=false)
Create a user account for the admin.
render(string $step, array $vars=[])
Renders the data passed by a controller.
checkPhpExtensions(array &$phpReport)
Check the server's PHP extensions.
validateDatabaseVars(array $submissionVars, array $formVars)
Database support methods.
finishBootstrapping(string $step)
Bootstrapping.
runAdmin(array $submissionVars=[])
Admin account controller.
checkInstallCompletion(string $step)
Security check to ensure the installer cannot be run after installation has finished.
getCurrentStep()
Returns current step.
const MARIADB_MINIMAL_VERSION
countNumConditions(array $report, string $condition)
Count the number of failures in the requirements report.
connectToDatabase()
Bootstrap database connection before entire engine is available.
runRequirements(array $vars=[])
Requirements controller.
makeFormSticky(array $formVars=[], array $submissionVars=[])
Action handling methods.
checkPHP(array &$report)
Check version of PHP, extensions, and variables.
loadSettingsFile()
Load settings.
checkPhpDirectives(array &$phpReport)
Check PHP parameters.
checkRewriteRules(array &$report)
Confirm that the rewrite rules are firing.
createDataDirectory(array &$submissionVars, array $formVars)
Site settings support methods.
installDatabase()
Create the database tables.
checkDatabaseSettings(DbConfig $config)
Confirm the settings for the database.
runSettings(array $submissionVars=[])
Site settings controller.
isInstallDirWritable(array &$report)
Indicates whether the webserver can add settings.php on its own or not.
static fromFiles(Config $config)
Create a session stored in files.
Load, boot, and implement a front controller for an Elgg application.
Database configuration service.
A generic parent class for Configuration exceptions.
Thrown when there is a major problem with the installation.
Could not register a new user for whatever reason.
A generic parent class for database exceptions.
Generic parent class for login exceptions.
Find Elgg and project paths.
static sanitize($path, $append_slash=true)
Sanitize file paths ensuring that they begin and end with slashes etc.
Test if URL rewriting is working.
elgg_save_config(string $name, $value)
Save a configuration setting.
const ELGG_IGNORE_ACCESS
elgg_call() flags
if(! $item instanceof ElggEntity) $link
foreach($plugin_guids as $guid) if(empty($deactivated_plugins)) $url
$config
Advanced site settings, debugging section.
foreach($requiredExtensions as $extension) $recommendedExtensions
foreach($recommendedExtensions as $extension) if(empty(ini_get('session.gc_probability'))||empty(ini_get('session.gc_divisor'))) $db
elgg()
Bootstrapping and helper procedural code available for use in Elgg core and plugins.
_elgg_services()
Get the global service provider.
elgg_call(int $flags, Closure $closure)
Calls a callable autowiring the arguments using public DI services and applying logic based on flags.
elgg_extract($key, $array, $default=null, bool $strict=true)
Checks for $array[$key] and returns its value if it exists, else returns $default.
elgg_add_admin_notice(string $id, string $message)
Write a persistent message to the admin view.
elgg_register_user(array $params=[])
Registers a user.
elgg_get_site_entity()
Get the current site entity.
elgg_delete_directory(string $directory, bool $leave_base_directory=false)
Delete a directory and all its contents.
foreach(array_keys($combine_languages) as $language) $translations
elgg_echo(string $message_key, array $args=[], string $language='')
Elgg language module Functions to manage language and translations.
elgg_view_page(string $title, string|array $body, string $page_shell='default', array $vars=[])
Assembles and outputs a full page.
elgg_view_url(string $href, ?string $text=null, array $options=[])
Helper function for outputting urls.
elgg_view(string $view, array $vars=[], string $viewtype='')
Return a parsed view.
if(isset($_COOKIE['elggperm'])) $session
elgg_normalize_url(string $url)
elgg_format_element(string $tag_name, array $attributes=[], string $text='', array $options=[])
Format an HTML element.
if($container instanceof ElggGroup && $container->guid !=elgg_get_page_owner_guid()) $key
if(parse_url(elgg_get_site_url(), PHP_URL_PATH) !=='/') if(file_exists(elgg_get_root_path() . 'robots.txt'))
Set robots.txt.
elgg_login(\ElggUser $user, bool $persistent=false)
Log in a user.
$upgrades
Lists pending upgrades.