InstallerController

Extends \CController

Installer

todo

Output code belongs into view

package

LimeSurvey

author

Shubham Sachdeva

copyright

2011

access

public

Methods

check requirements

_check_requirements( &$aData) : boolean

Arguments

$aData

Response

boolean

requirements met

Installer::_checkInstallation()

_checkInstallation() : 

Based on existance of 'sample_installer_file.txt' file, check if installation should proceed further or not.

Response

Connect to the database

_dbConnect(array $aDbConfig = array(), array $aData = array()) : boolean

Arguments

$aDbConfig

array

: The config to be tested

$aData

array

Response

boolean

Executes an SQL file

_executeSQLFile(string $sFileName, string $sDatabasePrefix) 

Arguments

$sFileName

string

$sDatabasePrefix

string

Gets the database configuration from the session

_getDatabaseConfig() : array

Response

array

Database Config

Use with \Yii::app()->setComponent() to set connection at runtime.

_getDatabaseConfigArray() : array

Response

array

Get the default port if database port is not set

_getDbPort(string $sDatabaseType, string $sDatabasePort = '') : string

Arguments

$sDatabaseType

string

$sDatabasePort

string

Response

string

Get the dsn for the database connection

_getDsn(string $sDatabaseType,  $sDatabaseLocation, string $sDatabasePort,  $sDatabaseName,  $sDatabaseUser,  $sDatabasePwd) : string

Arguments

$sDatabaseType

string

$sDatabaseLocation

$sDatabasePort

string

$sDatabaseName

$sDatabaseUser

$sDatabasePwd

Response

string

Create a random ASCII string

_getRandomString() : string

Response

string

Load and set session vars

_sessioncontrol() : void
access

protected

Installer::_setup_tables() Function that actually modify the database.

_setup_tables(string $sFileName, array $aDbConfig = array()) : array<mixed,string>|true

Arguments

$sFileName

string

$aDbConfig

array

Response

array<mixed,string>|true

True if everything was okay, otherwise array of error messages.

Function to write given database settings in APPPATH.'config/config.php'

_writeConfigFile() 

check image HTML template

check_HTML_image(boolean $result) : string

Arguments

$result

boolean

Response

string

Span with check if $result is true; otherwise a span with warning

Contains a number of extensions that can be expected to be installed by default, but maybe not on BSD systems etc.

checkDefaultExtensions() : void

Check them silently and die if they are missing.

check if directory exists and is writeable, returns via parameters by reference

checkDirectoryWriteable(string $directory, string &$data, string $base, string $keyError,  $bRecursive = false) : boolean

Arguments

$directory

string

to check

$data

string

to manipulate

$base

string

key for data manipulation

$keyError

string

key for error data

$bRecursive

Response

boolean

result of check (that it is writeable which implies existance)

check if file exists and is writeable, returns via parameters by reference

checkFileWriteable(string $file, string &$data, string $base, string $keyError) : boolean

Arguments

$file

string

to check

$data

string

to manipulate

$base

string

key for data manipulation

$keyError

string

key for error data

Response

boolean

result of check (that it is writeable which implies existance)

check if file or directory exists and is writeable, returns via parameters by reference

checkPathWriteable(string $path, integer $type, string &$aData, string $base, string $keyError,  $bRecursive = false) : boolean

Arguments

$path

string

file or directory to check

$type

integer

0:undefined (invalid), 1:file, 2:directory

$aData

string

$base

string

key for data manipulation

$keyError

string

key for error data

$bRecursive

Response

boolean

result of check (that it is writeable which implies existance)

check for a specific PHPFunction, return HTML image

checkPHPFunction(string $sFunctionName, string &$sImage) : boolean

Arguments

$sFunctionName

string

$sImage

string

return

Response

boolean

result

Trye a connexion to the DB and add error in model if exist

dbTest(array $aDbConfig = array(), array $aData = array()) : boolean

Arguments

$aDbConfig

array

: The config to be tested

$aData

array

Response

boolean

if connection is done

is_writable_recursive

is_writable_recursive(string $sDirectory) 

Arguments

$sDirectory

string

Loads a helper

loadHelper(string $helper) : void
access

public

Arguments

$helper

string

Loads a library

loadLibrary( $library) : void
access

public

Arguments

$library

Checks for action specific authorization and then executes an action

run(string $action = 'index') : boolean|null
access

public

Arguments

$action

string

Response

boolean|null

Installer::stepCreateDb() Create database.

stepCreateDb() : 

Response

Configure database screen

stepDatabaseConfiguration() 

Display license

stepLicense() 

Optional settings screen

stepOptionalConfiguration() 

Installer::stepPopulateDb() Function to populate the database.

stepPopulateDb() : 

Response

check a few writing permissions and optional settings

stepPreInstallationCheck() 

display the license file as IIS for example does not display it via the server.

stepViewLicense() 

welcome and language selection install step

stepWelcome() 

Properties

connection

connection : \CDbConnection
var

Type(s)

\CDbConnection

clang

lang : 

Type(s)

layout

layout : 

Type(s)