Elgg
Version master
|
Public Member Functions | |
run () | |
Dispatches a request to one of the step controllers. More... | |
batchInstall (array $params, bool $create_htaccess=false) | |
A batch install of Elgg. More... | |
Public Attributes | |
const | MARIADB_MINIMAL_VERSION = '10.6' |
const | MYSQL_MINIMAL_VERSION = '8.0' |
const | PHP_MINIMAL_VERSION = '8.1.0' |
Protected Member Functions | |
getApp () | |
Build the application needed by the installer. More... | |
render (string $step, array $vars=[]) | |
Renders the data passed by a controller. More... | |
runWelcome () | |
Step controllers. More... | |
runRequirements (array $vars=[]) | |
Requirements controller. More... | |
runDatabase (array $submissionVars=[]) | |
Database set up controller. More... | |
runSettings (array $submissionVars=[]) | |
Site settings controller. More... | |
runAdmin (array $submissionVars=[]) | |
Admin account controller. More... | |
runComplete () | |
Controller for last step. More... | |
getSteps () | |
Step management. More... | |
getCurrentStep () | |
Returns current step. More... | |
continueToNextStep (string $currentStep) | |
Forwards the browser to the next step. More... | |
getNextStep (string $currentStep) | |
Get the next step as a string. More... | |
getNextStepUrl (string $currentStep) | |
Get the URL of the next step. More... | |
determineInstallStatus () | |
Updates $this->has_completed according to the current installation. More... | |
checkInstallCompletion (string $step) | |
Security check to ensure the installer cannot be run after installation has finished. More... | |
resumeInstall (string $step) | |
Check if this is a case of a install being resumed and figure out where to continue from. More... | |
finishBootstrapping (string $step) | |
Bootstrapping. More... | |
loadSettingsFile () | |
Load settings. More... | |
makeFormSticky (array $formVars=[], array $submissionVars=[]) | |
Action handling methods. More... | |
isInstallDirWritable (array &$report) | |
Indicates whether the webserver can add settings.php on its own or not. More... | |
checkSettingsFile (array &$report=[]) | |
Check that the settings file exists. More... | |
checkPHP (array &$report) | |
Check version of PHP, extensions, and variables. More... | |
checkPhpExtensions (array &$phpReport) | |
Check the server's PHP extensions. More... | |
checkPhpDirectives (array &$phpReport) | |
Check PHP parameters. More... | |
checkRewriteRules (array &$report) | |
Confirm that the rewrite rules are firing. More... | |
countNumConditions (array $report, string $condition) | |
Count the number of failures in the requirements report. More... | |
validateDatabaseVars (array $submissionVars, array $formVars) | |
Database support methods. More... | |
checkDatabaseSettings (DbConfig $config) | |
Confirm the settings for the database. More... | |
createSettingsFile (array $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 (array &$submissionVars, array $formVars) | |
Site settings support methods. More... | |
validateSettingsVars (array $submissionVars, array $formVars) | |
Validate the site settings form variables. More... | |
saveSiteSettings (array $submissionVars) | |
Initialize the site including site entity, plugins, and configuration. More... | |
validateAdminVars (array $submissionVars, array $formVars) | |
Validate account form variables. More... | |
createAdminAccount (array $submissionVars, bool $login=false) | |
Create a user account for the admin. More... | |
sanitizeInputValue ($input_value) | |
Sanitize input to help prevent XSS. More... | |
Protected Attributes | |
array | $steps |
array | $has_completed |
array bool | $is_action = false |
$app | |
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, |
bool | $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 187 of file ElggInstaller.php.
|
protected |
Confirm the settings for the database.
DbConfig | $config | database configuration |
Definition at line 1202 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 788 of file ElggInstaller.php.
|
protected |
Check version of PHP, extensions, and variables.
array | $report | The requirements report array |
Definition at line 955 of file ElggInstaller.php.
|
protected |
Check PHP parameters.
array | $phpReport | The PHP requirements report array |
Definition at line 1024 of file ElggInstaller.php.
|
protected |
Check the server's PHP extensions.
array | $phpReport | The PHP requirements report array |
Definition at line 986 of file ElggInstaller.php.
|
protected |
Confirm that the rewrite rules are firing.
array | $report | The requirements report array |
Definition at line 1069 of file ElggInstaller.php.
|
protected |
Check that the settings file exists.
array | $report | The requirements report array |
Definition at line 931 of file ElggInstaller.php.
|
protected |
Bootstrap database connection before entire engine is available.
Definition at line 1293 of file ElggInstaller.php.
|
protected |
Forwards the browser to the next step.
string | $currentStep | Current installation step |
Definition at line 676 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 1086 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 1532 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 1331 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 1240 of file ElggInstaller.php.
|
protected |
Updates $this->has_completed according to the current installation.
InstallationException |
Definition at line 715 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 843 of file ElggInstaller.php.
|
protected |
Build the application needed by the installer.
InstallationException |
Definition at line 110 of file ElggInstaller.php.
|
protected |
|
protected |
Get the next step as a string.
string | $currentStep | Current installation step |
Definition at line 689 of file ElggInstaller.php.
|
protected |
Get the URL of the next step.
string | $currentStep | Current installation step |
Definition at line 702 of file ElggInstaller.php.
|
protected |
Step management.
Get an array of steps
Definition at line 654 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 909 of file ElggInstaller.php.
|
protected |
Load settings.
InstallationException |
Definition at line 866 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 892 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 297 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 809 of file ElggInstaller.php.
ElggInstaller::run | ( | ) |
Dispatches a request to one of the step controllers.
Definition at line 75 of file ElggInstaller.php.
|
protected |
Admin account controller.
Creates an admin user account
array | $submissionVars | Submitted vars |
Definition at line 551 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 378 of file ElggInstaller.php.
|
protected |
Requirements controller.
Checks version of php, libraries, permissions, and rewrite rules
array | $vars | Vars |
Definition at line 338 of file ElggInstaller.php.
|
protected |
Site settings controller.
Sets the site name, URL, data directory, etc.
array | $submissionVars | Submitted vars |
Definition at line 493 of file ElggInstaller.php.
|
protected |
|
protected |
Sanitize input to help prevent XSS.
mixed | $input_value | the input to sanitize |
Definition at line 1580 of file ElggInstaller.php.
|
protected |
Initialize the site including site entity, plugins, and configuration.
array | $submissionVars | Submitted vars |
Definition at line 1397 of file ElggInstaller.php.
|
protected |
Validate account form variables.
array | $submissionVars | Submitted vars |
array | $formVars | Form vars |
Definition at line 1481 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 1111 of file ElggInstaller.php.
|
protected |
Validate the site settings form variables.
array | $submissionVars | Submitted vars |
array | $formVars | Vars in the form |
Definition at line 1366 of file ElggInstaller.php.
|
protected |
Definition at line 68 of file ElggInstaller.php.
|
protected |
Definition at line 56 of file ElggInstaller.php.
|
protected |
Definition at line 63 of file ElggInstaller.php.
|
protected |
Definition at line 47 of file ElggInstaller.php.
const ElggInstaller::MARIADB_MINIMAL_VERSION = '10.6' |
Definition at line 43 of file ElggInstaller.php.
const ElggInstaller::MYSQL_MINIMAL_VERSION = '8.0' |
Definition at line 44 of file ElggInstaller.php.
const ElggInstaller::PHP_MINIMAL_VERSION = '8.1.0' |
Definition at line 45 of file ElggInstaller.php.