Elgg  Version 1.9
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
ElggInstaller Class Reference

Public Member Functions

 __construct ()
 Constructor bootstraps the Elgg engine. More...
 
 run ($step)
 Dispatches a request to one of the step controllers. More...
 
 setAutoLogin ($flag)
 Set the auto login flag. More...
 
 batchInstall (array $params, $createHtaccess=FALSE)
 A batch install of Elgg. More...
 

Protected Member Functions

 render ($step, $vars=array())
 Renders the data passed by a controller. More...
 
 welcome ($vars)
 Step controllers. More...
 
 requirements ($vars)
 Requirements controller. More...
 
 database ($submissionVars)
 Database set up controller. More...
 
 settings ($submissionVars)
 Site settings controller. More...
 
 admin ($submissionVars)
 Admin account controller. More...
 
 complete ()
 Controller for last step. More...
 
 getSteps ()
 Step management. 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...
 
 setInstallStatus ()
 Check the different install steps for completion. 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...
 
 bootstrapEngine ()
 Bootstraping. More...
 
 finishBootstraping ($step)
 Load remaining engine libraries and complete bootstraping (see start.php) More...
 
 bootstrapConfig ()
 Set up configuration variables. More...
 
 getBaseUrl ()
 Get the best guess at the base URL. More...
 
 loadSettingsFile ()
 Load settings.php. More...
 
 getPostVariables ()
 Action handling methods. More...
 
 makeFormSticky ($formVars, $submissionVars)
 If form is reshown, remember previously submitted variables. More...
 
 checkEngineDir (&$report)
 Requirement checks support methods. More...
 
 checkSettingsFile (&$report=array())
 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...
 
 processRewriteTest ()
 Check if the request is coming from the URL rewrite test on the requirements page. 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)
 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...
 
 setSubtypeClasses ()
 Register classes for core objects. More...
 
 enablePlugins ()
 Enable a set of default plugins. More...
 
 validateAdminVars ($submissionVars, $formVars)
 Admin account support methods. More...
 
 createAdminAccount ($submissionVars, $login=FALSE)
 Create a user account for the admin. More...
 

Protected Attributes

 $steps
 
 $status
 
 $isAction = FALSE
 
 $autoLogin = TRUE
 

Detailed Description

Definition at line 30 of file ElggInstaller.php.

Constructor & Destructor Documentation

ElggInstaller::__construct ( )

Constructor bootstraps the Elgg engine.

Definition at line 55 of file ElggInstaller.php.

Member Function Documentation

ElggInstaller::admin (   $submissionVars)
protected

Admin account controller.

Creates an admin user account

Parameters
array$submissionVarsSubmitted vars
Returns
void

Definition at line 473 of file ElggInstaller.php.

ElggInstaller::batchInstall ( array  $params,
  $createHtaccess = 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.

If the settings.php file exists, it will use that rather than the parameters passed to this function.

Parameters
array$paramsArray of key value pairs
bool$createHtaccessShould .htaccess be created
Returns
void
Exceptions
InstallationException

Definition at line 139 of file ElggInstaller.php.

ElggInstaller::bootstrapConfig ( )
protected

Set up configuration variables.

Returns
void

Definition at line 858 of file ElggInstaller.php.

ElggInstaller::bootstrapEngine ( )
protected

Bootstraping.

Load the essential libraries of the engine

Returns
void

Definition at line 727 of file ElggInstaller.php.

ElggInstaller::checkDatabaseSettings (   $user,
  $password,
  $dbname,
  $host 
)
protected

Confirm the settings for the database.

Parameters
string$userUsername
string$passwordPassword
string$dbnameDatabase name
string$hostHost
Returns
bool

Definition at line 1230 of file ElggInstaller.php.

ElggInstaller::checkEngineDir ( $report)
protected

Requirement checks support methods.

Check that the engine dir is writable

Parameters
array&$reportThe requirements report object
Returns
bool

Definition at line 972 of file ElggInstaller.php.

ElggInstaller::checkInstallCompletion (   $step)
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.

Parameters
string$stepInstallation step to check against
Returns
void

Definition at line 679 of file ElggInstaller.php.

ElggInstaller::checkPHP ( $report)
protected

Check version of PHP, extensions, and variables.

Parameters
array&$reportThe requirements report array
Returns
void

Definition at line 1022 of file ElggInstaller.php.

ElggInstaller::checkPhpDirectives ( $phpReport)
protected

Check PHP parameters.

Parameters
array&$phpReportThe PHP requirements report array
Returns
void

Definition at line 1091 of file ElggInstaller.php.

ElggInstaller::checkPhpExtensions ( $phpReport)
protected

Check the server's PHP extensions.

Parameters
array&$phpReportThe PHP requirements report array
Returns
void

Definition at line 1054 of file ElggInstaller.php.

ElggInstaller::checkRewriteRules ( $report)
protected

Confirm that the rewrite rules are firing.

Parameters
array&$reportThe requirements report array
Returns
void

Definition at line 1137 of file ElggInstaller.php.

ElggInstaller::checkSettingsFile ( $report = array())
protected

Check that the settings file exists.

Parameters
array&$reportThe requirements report array
Returns
bool

Definition at line 996 of file ElggInstaller.php.

ElggInstaller::complete ( )
protected

Controller for last step.

Returns
void

Definition at line 537 of file ElggInstaller.php.

ElggInstaller::connectToDatabase ( )
protected

Bootstrap database connection before entire engine is available.

Returns
bool

Definition at line 1293 of file ElggInstaller.php.

ElggInstaller::continueToNextStep (   $currentStep)
protected

Forwards the browser to the next step.

Parameters
string$currentStepCurrent installation step
Returns
void

Definition at line 569 of file ElggInstaller.php.

ElggInstaller::countNumConditions (   $report,
  $condition 
)
protected

Count the number of failures in the requirements report.

Parameters
array$reportThe requirements report array
string$condition'failure' or 'warning'
Returns
int

Definition at line 1166 of file ElggInstaller.php.

ElggInstaller::createAdminAccount (   $submissionVars,
  $login = FALSE 
)
protected

Create a user account for the admin.

Parameters
array$submissionVarsSubmitted vars
bool$loginLogin in the admin user?
Returns
bool

Definition at line 1594 of file ElggInstaller.php.

ElggInstaller::createDataDirectory ( $submissionVars,
  $formVars 
)
protected

Site settings support methods.

Create the data directory if requested

Parameters
array$submissionVarsSubmitted vars
array$formVarsVariables in the form
Returns
bool

Definition at line 1349 of file ElggInstaller.php.

ElggInstaller::createSettingsFile (   $params)
protected

Writes the settings file to the engine directory.

Parameters
array$paramsArray of inputted params from the user
Returns
bool

Definition at line 1264 of file ElggInstaller.php.

ElggInstaller::database (   $submissionVars)
protected

Database set up controller.

Creates the settings.php file and creates the database tables

Parameters
array$submissionVarsSubmitted form variables
Returns
void

Definition at line 310 of file ElggInstaller.php.

ElggInstaller::enablePlugins ( )
protected

Enable a set of default plugins.

Returns
void

Definition at line 1523 of file ElggInstaller.php.

ElggInstaller::finishBootstraping (   $step)
protected

Load remaining engine libraries and complete bootstraping (see start.php)

Parameters
string$stepWhich step to boot strap for. Required because boot strapping is different until the DB is populated.
Returns
void
Exceptions
InstallationException

Definition at line 768 of file ElggInstaller.php.

ElggInstaller::getBaseUrl ( )
protected

Get the best guess at the base URL.

Note
Cannot use current_page_url() because it depends on $CONFIG->wwwroot
Returns
string

Definition at line 892 of file ElggInstaller.php.

ElggInstaller::getNextStep (   $currentStep)
protected

Get the next step as a string.

Parameters
string$currentStepCurrent installation step
Returns
string

Definition at line 581 of file ElggInstaller.php.

ElggInstaller::getNextStepUrl (   $currentStep)
protected

Get the URL of the next step.

Parameters
string$currentStepCurrent installation step
Returns
string

Definition at line 597 of file ElggInstaller.php.

ElggInstaller::getPostVariables ( )
protected

Action handling methods.

Return an associative array of post variables (could be selective based on expected variables)

Does not filter as person installing the site should not be attempting XSS attacks. If filtering is added, it should not be done for passwords.

Returns
array

Definition at line 938 of file ElggInstaller.php.

ElggInstaller::getSteps ( )
protected

Step management.

Get an array of steps

Returns
array

Definition at line 558 of file ElggInstaller.php.

ElggInstaller::installDatabase ( )
protected

Create the database tables.

Returns
bool

Definition at line 1321 of file ElggInstaller.php.

ElggInstaller::loadSettingsFile ( )
protected

Load settings.php.

Returns
void
Exceptions
InstallationException

Definition at line 917 of file ElggInstaller.php.

ElggInstaller::makeFormSticky (   $formVars,
  $submissionVars 
)
protected

If form is reshown, remember previously submitted variables.

Parameters
array$formVarsVars int he form
array$submissionVarsSubmitted vars
Returns
array

Definition at line 954 of file ElggInstaller.php.

ElggInstaller::processRewriteTest ( )
protected

Check if the request is coming from the URL rewrite test on the requirements page.

Returns
void

Definition at line 1151 of file ElggInstaller.php.

ElggInstaller::render (   $step,
  $vars = array() 
)
protected

Renders the data passed by a controller.

Parameters
string$stepThe current step
array$varsArray of vars to pass to the view
Returns
void

Definition at line 221 of file ElggInstaller.php.

ElggInstaller::requirements (   $vars)
protected

Requirements controller.

Checks version of php, libraries, permissions, and rewrite rules

Parameters
array$varsVars
Returns
void

Definition at line 263 of file ElggInstaller.php.

ElggInstaller::resumeInstall (   $step)
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.

Parameters
string$stepInstallation step to resume from
Returns
string

Definition at line 696 of file ElggInstaller.php.

ElggInstaller::run (   $step)

Dispatches a request to one of the step controllers.

Parameters
string$stepThe installation step to run
Returns
void
Exceptions
InstallationException

Definition at line 83 of file ElggInstaller.php.

ElggInstaller::saveSiteSettings (   $submissionVars)
protected

Initialize the site including site entity, plugins, and configuration.

Parameters
array$submissionVarsSubmitted vars
Returns
bool

Definition at line 1453 of file ElggInstaller.php.

ElggInstaller::setAutoLogin (   $flag)

Set the auto login flag.

Parameters
bool$flagAuto login
Returns
void

Definition at line 117 of file ElggInstaller.php.

ElggInstaller::setInstallStatus ( )
protected

Check the different install steps for completion.

Returns
void
Exceptions
InstallationException

Definition at line 608 of file ElggInstaller.php.

ElggInstaller::setSubtypeClasses ( )
protected

Register classes for core objects.

Returns
void

Definition at line 1510 of file ElggInstaller.php.

ElggInstaller::settings (   $submissionVars)
protected

Site settings controller.

Sets the site name, URL, data directory, etc.

Parameters
array$submissionVarsSubmitted vars
Returns
void

Definition at line 395 of file ElggInstaller.php.

ElggInstaller::validateAdminVars (   $submissionVars,
  $formVars 
)
protected

Admin account support methods.

Validate account form variables

Parameters
array$submissionVarsSubmitted vars
array$formVarsForm vars
Returns
bool

Definition at line 1550 of file ElggInstaller.php.

ElggInstaller::validateDatabaseVars (   $submissionVars,
  $formVars 
)
protected

Database support methods.

Validate the variables for the database step

Parameters
array$submissionVarsSubmitted vars
array$formVarsVars in the form
Returns
bool

Definition at line 1192 of file ElggInstaller.php.

ElggInstaller::validateSettingsVars (   $submissionVars,
  $formVars 
)
protected

Validate the site settings form variables.

Parameters
array$submissionVarsSubmitted vars
array$formVarsVars in the form
Returns
bool

Definition at line 1383 of file ElggInstaller.php.

ElggInstaller::welcome (   $vars)
protected

Step controllers.

Welcome controller

Parameters
array$varsNot used
Returns
void

Definition at line 250 of file ElggInstaller.php.

Member Data Documentation

ElggInstaller::$autoLogin = TRUE
protected

Definition at line 50 of file ElggInstaller.php.

ElggInstaller::$isAction = FALSE
protected

Definition at line 48 of file ElggInstaller.php.

ElggInstaller::$status
protected
Initial value:
= array(
'config' => FALSE,
'database' => FALSE,
'settings' => FALSE,
'admin' => FALSE,
)

Definition at line 41 of file ElggInstaller.php.

ElggInstaller::$steps
protected
Initial value:
= array(
'welcome',
'requirements',
'database',
'settings',
'admin',
'complete',
)

Definition at line 32 of file ElggInstaller.php.


The documentation for this class was generated from the following file: