Elgg
Version master
|
Public Member Functions | |
run () | |
Dispatches a request to one of the step controllers. More... | |
setAutoLogin ($flag) | |
Set the auto login flag. More... | |
batchInstall (array $params, $create_htaccess=false) | |
A batch install of Elgg. More... | |
Public Attributes | |
const | MARIADB_MINIMAL_VERSION = '10.3' |
const | MYSQL_MINIMAL_VERSION = '5.7' |
const | PHP_MINIMAL_VERSION = '8.0.0' |
Protected Member Functions | |
getApp () | |
Build the application needed by the installer. More... | |
render ($step, $vars=[]) | |
Renders the data passed by a controller. More... | |
runWelcome ($vars) | |
Step controllers. More... | |
runRequirements ($vars) | |
Requirements controller. More... | |
runDatabase ($submissionVars) | |
Database set up controller. More... | |
runSettings ($submissionVars) | |
Site settings controller. More... | |
runAdmin ($submissionVars) | |
Admin account controller. More... | |
runComplete () | |
Controller for last step. More... | |
getSteps () | |
Step management. More... | |
getCurrentStep () | |
Returns current step. More... | |
continueToNextStep ($currentStep) | |
Forwards the browser to the next step. More... | |
getNextStep ($currentStep) | |
Get the next step as a string. More... | |
getNextStepUrl ($currentStep) | |
Get the URL of the next step. More... | |
determineInstallStatus () | |
Updates $this->has_completed according to the current installation. More... | |
checkInstallCompletion ($step) | |
Security check to ensure the installer cannot be run after installation has finished. More... | |
resumeInstall ($step) | |
Check if this is a case of a install being resumed and figure out where to continue from. More... | |
finishBootstrapping ($step) | |
Bootstrapping. More... | |
loadSettingsFile () | |
Load settings. More... | |
makeFormSticky ($formVars, $submissionVars) | |
Action handling methods. More... | |
isInstallDirWritable (&$report) | |
Indicates whether the webserver can add settings.php on its own or not. More... | |
checkSettingsFile (&$report=[]) | |
Check that the settings file exists. More... | |
checkPHP (&$report) | |
Check version of PHP, extensions, and variables. More... | |
checkPhpExtensions (&$phpReport) | |
Check the server's PHP extensions. More... | |
checkPhpDirectives (&$phpReport) | |
Check PHP parameters. More... | |
checkRewriteRules (&$report) | |
Confirm that the rewrite rules are firing. More... | |
countNumConditions ($report, $condition) | |
Count the number of failures in the requirements report. More... | |
validateDatabaseVars ($submissionVars, $formVars) | |
Database support methods. More... | |
checkDatabaseSettings ($user, $password, $dbname, $host, $port) | |
Confirm the settings for the database. More... | |
createSettingsFile ($params) | |
Writes the settings file to the engine directory. More... | |
connectToDatabase () | |
Bootstrap database connection before entire engine is available. More... | |
installDatabase () | |
Create the database tables. More... | |
createDataDirectory (&$submissionVars, $formVars) | |
Site settings support methods. More... | |
validateSettingsVars ($submissionVars, $formVars) | |
Validate the site settings form variables. More... | |
saveSiteSettings ($submissionVars) | |
Initialize the site including site entity, plugins, and configuration. More... | |
validateAdminVars ($submissionVars, $formVars) | |
Validate account form variables. More... | |
createAdminAccount ($submissionVars, $login=false) | |
Create a user account for the admin. More... | |
sanitizeInputValue ($input_value) | |
Sanitize input to help prevent XSS. More... | |
Elgg Installer.
Controller for installing Elgg. Supports both web-based on CLI installation.
This controller steps the user through the install process. The method for each step handles both the GET and POST requests. There is no XSS/CSRF protection on the POST processing since the installer is only run once by the administrator.
The installation process can be resumed by hitting the first page. The installer will try to figure out where to pick up again.
All the logic for the installation process is in this class, but it depends on the core libraries. To do this, we selectively load a subset of the core libraries for the first few steps and then load the entire engine once the database and site settings are configured. In addition, this controller does its own session handling until the database is setup.
There is an aborted attempt in the code at creating the data directory for users as a subdirectory of Elgg's root. The idea was to protect this directory through a .htaccess file. The problem is that a malicious user can upload a .htaccess of his own that overrides the protection for his user directory. The best solution is server level configuration that turns off AllowOverride for the data directory. See ticket #3453 for discussion on this.
Definition at line 41 of file ElggInstaller.php.
ElggInstaller::batchInstall | ( | array | $params, |
$create_htaccess = false |
|||
) |
A batch install of Elgg.
All required parameters must be passed in as an associative array. See $requiredParams for a list of them. This creates the necessary files, loads the database, configures the site settings, and creates the admin account. If it fails, an exception is thrown. It does not check any of the requirements as the multiple step web installer does.
array | $params | Array of key value pairs |
bool | $create_htaccess | Should .htaccess be created |
InstallationException |
Definition at line 200 of file ElggInstaller.php.
|
protected |
Confirm the settings for the database.
string | $user | Username |
string | $password | Password |
string | $dbname | Database name |
string | $host | Host |
int | $port | Port |
Definition at line 1231 of file ElggInstaller.php.
|
protected |
Security check to ensure the installer cannot be run after installation has finished.
If this is detected, the viewer is sent to the front page.
string | $step | Installation step to check against |
Definition at line 817 of file ElggInstaller.php.
|
protected |
Check version of PHP, extensions, and variables.
array | $report | The requirements report array |
Definition at line 982 of file ElggInstaller.php.
|
protected |
Check PHP parameters.
array | $phpReport | The PHP requirements report array |
Definition at line 1050 of file ElggInstaller.php.
|
protected |
Check the server's PHP extensions.
array | $phpReport | The PHP requirements report array |
Definition at line 1013 of file ElggInstaller.php.
|
protected |
Confirm that the rewrite rules are firing.
array | $report | The requirements report array |
Definition at line 1095 of file ElggInstaller.php.
|
protected |
Check that the settings file exists.
array | $report | The requirements report array |
Definition at line 958 of file ElggInstaller.php.
|
protected |
Bootstrap database connection before entire engine is available.
Definition at line 1330 of file ElggInstaller.php.
|
protected |
Forwards the browser to the next step.
string | $currentStep | Current installation step |
Definition at line 699 of file ElggInstaller.php.
|
protected |
Count the number of failures in the requirements report.
array | $report | The requirements report array |
string | $condition | 'failure' or 'warning' |
Definition at line 1114 of file ElggInstaller.php.
|
protected |
Create a user account for the admin.
array | $submissionVars | Submitted vars |
bool | $login | Login in the admin user? |
Definition at line 1567 of file ElggInstaller.php.
|
protected |
Site settings support methods.
Create the data directory if requested
array | $submissionVars | Submitted vars |
array | $formVars | Variables in the form |
Definition at line 1368 of file ElggInstaller.php.
|
protected |
Writes the settings file to the engine directory.
array | $params | Array of inputted params from the user |
Definition at line 1277 of file ElggInstaller.php.
|
protected |
Updates $this->has_completed according to the current installation.
InstallationException |
Definition at line 738 of file ElggInstaller.php.
|
protected |
Bootstrapping.
Load remaining engine libraries and complete bootstrapping
string | $step | Which step to boot strap for. Required because boot strapping is different until the DB is populated. |
Definition at line 870 of file ElggInstaller.php.
|
protected |
Build the application needed by the installer.
InstallationException |
Definition at line 112 of file ElggInstaller.php.
|
protected |
|
protected |
Get the next step as a string.
string | $currentStep | Current installation step |
Definition at line 712 of file ElggInstaller.php.
|
protected |
Get the URL of the next step.
string | $currentStep | Current installation step |
Definition at line 725 of file ElggInstaller.php.
|
protected |
Step management.
Get an array of steps
Definition at line 673 of file ElggInstaller.php.
|
protected |
|
protected |
Indicates whether the webserver can add settings.php on its own or not.
array | $report | The requirements report object |
Definition at line 936 of file ElggInstaller.php.
|
protected |
Load settings.
InstallationException |
Definition at line 893 of file ElggInstaller.php.
|
protected |
Action handling methods.
If form is reshown, remember previously submitted variables
array | $formVars | Vars int he form |
array | $submissionVars | Submitted vars |
Definition at line 919 of file ElggInstaller.php.
|
protected |
Renders the data passed by a controller.
string | $step | The current step |
array | $vars | Array of vars to pass to the view |
Definition at line 306 of file ElggInstaller.php.
|
protected |
Check if this is a case of a install being resumed and figure out where to continue from.
Returns the best guess on the step.
string | $step | Installation step to resume from |
Definition at line 836 of file ElggInstaller.php.
ElggInstaller::run | ( | ) |
Dispatches a request to one of the step controllers.
Definition at line 77 of file ElggInstaller.php.
|
protected |
Admin account controller.
Creates an admin user account
array | $submissionVars | Submitted vars |
Definition at line 571 of file ElggInstaller.php.
|
protected |
|
protected |
Database set up controller.
Creates the settings.php file and creates the database tables
array | $submissionVars | Submitted form variables |
Definition at line 398 of file ElggInstaller.php.
|
protected |
Requirements controller.
Checks version of php, libraries, permissions, and rewrite rules
array | $vars | Vars |
Definition at line 349 of file ElggInstaller.php.
|
protected |
Site settings controller.
Sets the site name, URL, data directory, etc.
array | $submissionVars | Submitted vars |
Definition at line 513 of file ElggInstaller.php.
|
protected |
Step controllers.
Welcome controller
array | $vars | Not used |
Definition at line 336 of file ElggInstaller.php.
|
protected |
Sanitize input to help prevent XSS.
mixed | $input_value | the input to sanitize |
Definition at line 1616 of file ElggInstaller.php.
|
protected |
Initialize the site including site entity, plugins, and configuration.
array | $submissionVars | Submitted vars |
Definition at line 1434 of file ElggInstaller.php.
ElggInstaller::setAutoLogin | ( | $flag | ) |
Set the auto login flag.
bool | $flag | Auto login |
Definition at line 181 of file ElggInstaller.php.
|
protected |
Validate account form variables.
array | $submissionVars | Submitted vars |
array | $formVars | Form vars |
Definition at line 1516 of file ElggInstaller.php.
|
protected |
Database support methods.
Validate the variables for the database step
array | $submissionVars | Submitted vars |
array | $formVars | Vars in the form |
Definition at line 1139 of file ElggInstaller.php.
|
protected |
Validate the site settings form variables.
array | $submissionVars | Submitted vars |
array | $formVars | Vars in the form |
Definition at line 1403 of file ElggInstaller.php.
const ElggInstaller::MARIADB_MINIMAL_VERSION = '10.3' |
Definition at line 43 of file ElggInstaller.php.
const ElggInstaller::MYSQL_MINIMAL_VERSION = '5.7' |
Definition at line 44 of file ElggInstaller.php.
const ElggInstaller::PHP_MINIMAL_VERSION = '8.0.0' |
Definition at line 45 of file ElggInstaller.php.