jInstaller

main class for the installation

It load all entry points configurations. Each configurations has its own activated modules. jInstaller then construct a tree dependencies for these activated modules, and launch their installation and the installation of their dependencies. An installation can be an initial installation, or just an upgrade if the module is already installed.

internal

The object which drives the installation of a component (module, plugin...) is an object which inherits from jInstallerComponentBase. This object calls load a file from the directory of the component. this file should contain a class which should inherits from jInstallerModule or jInstallerPlugin. this class should implements processes to install the component.

package

jelix

Methods

initialize the installation

__construct(\jIInstallReporter $reporter, string $lang = '') 

it reads configurations files of all entry points, and prepare object for each module, needed to install/upgrade modules.

Arguments

$reporter

\jIInstallReporter

object which is responsible to process messages (display, storage or other..)

$lang

string

the language code for messages

check dependencies of a module

_checkDependencies(\jInstallerComponentBase $component, string $epId) 
Throws
\jInstallerException

Arguments

$epId

string

core of the installation

_installModules(array &$modules, string $epId, boolean $installWholeApp, integer $flags = 3) : boolean

Arguments

$modules

array

list of jInstallerComponentModule

$epId

string

the entrypoint id

$installWholeApp

boolean

true if the installation is done during app installation

$flags

integer

to know what to do

Response

boolean

true if the installation is ok

check dependencies of given modules and plugins

checkDependencies(array $list,  $epId) : boolean
Throws
\jException

if the install has failed

Arguments

$list

array

list of jInstallerComponentModule/jInstallerComponentPlugin objects

$epId

Response

boolean

true if the dependencies are ok

endMessage

endMessage() 

error

error( $msg,  $params = null,  $fullString = false) 

Arguments

$msg

$params

$fullString

change the module version in readed informations, to simulate an update when we call installApplication or an other method.

forceModuleVersion(string $moduleName, string $version) 

internal use !!

Arguments

$moduleName

string

the name of the module

$version

string

the new version

getEntryPoint

getEntryPoint(string $epId) : \jInstallerEntryPoint

Arguments

$epId

string

an entry point id

Response

\jInstallerEntryPoint

the corresponding entry point object

install and upgrade if needed, all modules for each entry point. Only modules which have an access property > 0 are installed. Errors appeared during the installation are passed to the reporter.

installApplication(integer $flags = false) : boolean

Arguments

$flags

integer

flags indicating if we should install, and/or upgrade modules or only modify config files. internal use. see FLAG_* constants

Response

boolean

true if succeed, false if there are some errors

install and upgrade if needed, all modules for the given entry point. Only modules which have an access property > 0 are installed. Errors appeared during the installation are passed to the reporter.

installEntryPoint(string $entrypoint) : boolean
Throws
\Exception

Arguments

$entrypoint

string

the entrypoint name as it appears in project.xml

Response

boolean

true if succeed, false if there are some errors

installEntryPointModules

installEntryPointModules(string $epId,  $flags = 3) : boolean

Arguments

$epId

string

the entrypoint id

$flags

Response

boolean

true if succeed, false if there are some errors

install given modules even if they don't have an access property > 0

installModules(array $modulesList, string $entrypoint = null) : boolean
Throws
\Exception

Arguments

$modulesList

array

array of module names

$entrypoint

string

the entrypoint name as it appears in project.xml or null if modules should be installed for all entry points

Response

boolean

true if the installation is ok

notice

notice( $msg,  $params = null,  $fullString = false) 

Arguments

$msg

$params

$fullString

ok

ok( $msg,  $params = null,  $fullString = false) 

Arguments

$msg

$params

$fullString

read the list of entrypoint from the project.xml file and read all modules data used by each entry point

readEntryPointData(\SimpleXmlElement $xml) 

Arguments

$xml

\SimpleXmlElement

set parameters for the installer of a module

setModuleParameters(string $moduleName, array $parameters, string $entrypoint = null) 

Arguments

$moduleName

string

the name of the module

$parameters

array

parameters

$entrypoint

string

the entry point for which parameters will be applied when installing the module. if null, parameters are valid for all entry points

startMessage

startMessage() 

warning

warning( $msg,  $params = null,  $fullString = false) 

Arguments

$msg

$params

$fullString

Constants

value for the installation status of a component: "uninstalled" status

STATUS_UNINSTALLED

value for the installation status of a component: "installed" status

STATUS_INSTALLED

value for the access level of a component: "forbidden" level.

ACCESS_FORBIDDEN

a module which have this level won't be installed

value for the access level of a component: "private" level.

ACCESS_PRIVATE

a module which have this level won't be accessible directly from the web, but only from other modules

value for the access level of a component: "public" level.

ACCESS_PUBLIC

the module is accessible from the web

error code stored in a component: impossible to install the module because dependencies are missing

INSTALL_ERROR_MISSING_DEPENDENCIES

error code stored in a component: impossible to install the module because of circular dependencies

INSTALL_ERROR_CIRCULAR_DEPENDENCY

FLAG_INSTALL_MODULE

FLAG_INSTALL_MODULE

FLAG_UPGRADE_MODULE

FLAG_UPGRADE_MODULE

FLAG_ALL

FLAG_ALL

FLAG_MIGRATION_11X

FLAG_MIGRATION_11X

Properties

it represents the installer.ini.php file.

installerIni : \jIniFileModifier
var

it represents the installer.ini.php file.

Type(s)

\jIniFileModifier

list of entry point and their properties

entryPoints : array
var

of jInstallerEntryPoint. keys are entry point id.

Type(s)

array

list of entry point identifiant (provided by the configuration compiler).

epId : array

identifiant of the entry point is the path+filename of the entry point without the php extension

var

key=entry point name, value=url id

Type(s)

array

list of modules for each entry point

modules : array<mixed,\jInstallerComponentModule[]>
var

first key: entry point id, second key: module name, value = jInstallerComponentModule

Type(s)

array<mixed,\jInstallerComponentModule[]>

list of all modules of the application

allModules : array
var

key=path of the module, value = jInstallerComponentModule

Type(s)

array

the object responsible of the results output

reporter : \jIInstallReporter
var

Type(s)

\jIInstallReporter

messages

messages : \JInstallerMessageProvider
var

Type(s)

\JInstallerMessageProvider

the number of errors appeared during the installation

nbError : integer
var

the number of errors appeared during the installation

Type(s)

integer

the number of ok messages appeared during the installation

nbOk : integer
var

the number of ok messages appeared during the installation

Type(s)

integer

the number of warnings appeared during the installation

nbWarning : integer
var

the number of warnings appeared during the installation

Type(s)

integer

the number of notices appeared during the installation

nbNotice : integer
var

the number of notices appeared during the installation

Type(s)

integer

the mainconfig.ini.php content

mainConfig : \jIniFileModifier
var

Type(s)

\jIniFileModifier

combination between mainconfig.ini.php (master) and localconfig.ini.php (overrider)

localConfig : \jIniMultiFilesModifier

liveconfig.ini.php

liveConfig : \jIniFileModifier
var

Type(s)

\jIniFileModifier

_componentsToInstall

_componentsToInstall : 

Type(s)

_checkedComponents

_checkedComponents : 

Type(s)

_checkedCircularDependency

_checkedCircularDependency : 

Type(s)