PHP Class Jelix\Installer\Installer

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.
Afficher le fichier Open project: jelix/jelix Class Usage Examples

Méthodes publiques

Свойство Type Description
$installerIni it represents the installer.ini.php file.
$messages JInstallerMessageProvider
$reporter jIInstallReporter the object responsible of the results output

Protected Properties

Свойство Type Description
$allModules list of all modules of the application
$entryPoints list of entry point and their properties
$epId identifiant of the entry point is the path+filename of the entry point without the php extension
$localConfig Jelix\IniFile\MultiIniModifier the localconfig.ini.php content combined with $mainConfig
$mainConfig Jelix\IniFile\MultiIniModifier the mainconfig.ini.php combined with the defaultconfig.ini.php
$xmlMapFile Jelix\Routing\UrlMapping\XmlMapModifier

Méthodes publiques

Méthode Description
__construct ( ReporterInterface $reporter, string $lang = '' ) initialize the installation
forceModuleVersion ( string $moduleName, string $version ) change the module version in readed informations, to simulate an update when we call installApplication or an other method.
getEntryPoint ( string $epId ) : EntryPoint
installApplication ( integer $flags = false ) : boolean 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.
installEntryPoint ( string $entrypoint ) : boolean 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.
installModules ( array $modulesList, string $entrypoint = null ) : boolean install given modules even if they don't have an access property > 0
setModuleParameters ( string $moduleName, array $parameters, string $entrypoint = null ) set parameters for the installer of a module
uninstallModules ( array $modulesList, string $entrypoint = null ) : boolean uninstall given modules

Méthodes protégées

Méthode Description
_installModules ( Resolver $resolver, EntryPoint $ep, boolean $installWholeApp, integer $flags = 7 ) : boolean core of the installation
_singleModules ( $action, $modulesList, $entrypoint )
completeInstallStatus ( )
endMessage ( )
error ( $msg, $params = null, $fullString = false )
getEntryPointObject ( $configFile, $file, $type ) : EntryPoint
getInstallerIni ( ) : Jelix\IniFile\IniModifier
notice ( $msg, $params = null, $fullString = false )
ok ( $msg, $params = null, $fullString = false )
readEntryPointsData ( Jelix\Core\Infos\AppInfos $appInfos ) read the list of entrypoint from the project.xml file and read all modules data used by each entry point
resolveDependencies ( Resolver $resolver, $epId )
runInstall ( $componentsToInstall, $ep, $epId, $flags )
runPostInstall ( $installedModules, $ep, $flags )
runPreInstall ( $moduleschain, $ep, $installWholeApp, $flags )
startMessage ( )
warning ( $msg, $params = null, $fullString = false )

Method Details

__construct() public méthode

it reads configurations files of all entry points, and prepare object for each module, needed to install/upgrade modules.
public __construct ( ReporterInterface $reporter, string $lang = '' )
$reporter ReporterInterface object which is responsible to process messages (display, storage or other..)
$lang string the language code for messages

_installModules() protected méthode

core of the installation
protected _installModules ( Resolver $resolver, EntryPoint $ep, boolean $installWholeApp, integer $flags = 7 ) : boolean
$resolver Jelix\Dependencies\Resolver
$ep EntryPoint the entrypoint
$installWholeApp boolean true if the installation is done during app installation
$flags integer to know what to do
Résultat boolean true if the installation is ok

_singleModules() protected méthode

protected _singleModules ( $action, $modulesList, $entrypoint )

completeInstallStatus() protected méthode

protected completeInstallStatus ( )

endMessage() protected méthode

protected endMessage ( )

error() protected méthode

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

forceModuleVersion() public méthode

internal use !!
public forceModuleVersion ( string $moduleName, string $version )
$moduleName string the name of the module
$version string the new version

getEntryPoint() public méthode

public getEntryPoint ( string $epId ) : EntryPoint
$epId string an entry point id
Résultat EntryPoint the corresponding entry point object

getEntryPointObject() protected méthode

protected getEntryPointObject ( $configFile, $file, $type ) : EntryPoint
Résultat EntryPoint

getInstallerIni() protected méthode

protected getInstallerIni ( ) : Jelix\IniFile\IniModifier
Résultat Jelix\IniFile\IniModifier the modifier for the installer.ini.php file

installApplication() public méthode

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.
public installApplication ( integer $flags = false ) : boolean
$flags integer flags indicating if we should install, and/or upgrade modules or only modify config files. internal use. see FLAG_* constants
Résultat boolean true if succeed, false if there are some errors

installEntryPoint() public méthode

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.
public installEntryPoint ( string $entrypoint ) : boolean
$entrypoint string the entrypoint name as it appears in project.xml
Résultat boolean true if succeed, false if there are some errors

installModules() public méthode

install given modules even if they don't have an access property > 0
public installModules ( array $modulesList, string $entrypoint = null ) : boolean
$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
Résultat boolean true if the installation is ok

notice() protected méthode

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

ok() protected méthode

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

readEntryPointsData() protected méthode

read the list of entrypoint from the project.xml file and read all modules data used by each entry point
protected readEntryPointsData ( Jelix\Core\Infos\AppInfos $appInfos )
$appInfos Jelix\Core\Infos\AppInfos

resolveDependencies() protected méthode

protected resolveDependencies ( Resolver $resolver, $epId )
$resolver Jelix\Dependencies\Resolver

runInstall() protected méthode

protected runInstall ( $componentsToInstall, $ep, $epId, $flags )

runPostInstall() protected méthode

protected runPostInstall ( $installedModules, $ep, $flags )

runPreInstall() protected méthode

protected runPreInstall ( $moduleschain, $ep, $installWholeApp, $flags )

setModuleParameters() public méthode

set parameters for the installer of a module
public setModuleParameters ( string $moduleName, array $parameters, string $entrypoint = null )
$moduleName string the name of the module
$parameters array parameters
$entrypoint string the entry point name for which parameters will be applied when installing the module. if null, parameters are valid for all entry points

startMessage() protected méthode

protected startMessage ( )

uninstallModules() public méthode

uninstall given modules
public uninstallModules ( array $modulesList, string $entrypoint = null ) : boolean
$modulesList array array of module names
$entrypoint string the entrypoint name as it appears in project.xml or null if modules should be uninstalled for all entry points
Résultat boolean true if the uninstallation is ok

warning() protected méthode

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

Property Details

$allModules protected_oe property

list of all modules of the application
protected $allModules

$entryPoints protected_oe property

list of entry point and their properties
protected $entryPoints

$epId protected_oe property

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

$installerIni public_oe property

it represents the installer.ini.php file.
public $installerIni

$localConfig protected_oe property

the localconfig.ini.php content combined with $mainConfig
protected MultiIniModifier,Jelix\IniFile $localConfig
Résultat Jelix\IniFile\MultiIniModifier

$mainConfig protected_oe property

the mainconfig.ini.php combined with the defaultconfig.ini.php
protected MultiIniModifier,Jelix\IniFile $mainConfig
Résultat Jelix\IniFile\MultiIniModifier

$messages public_oe property

public JInstallerMessageProvider $messages
Résultat JInstallerMessageProvider

$reporter public_oe property

the object responsible of the results output
public jIInstallReporter $reporter
Résultat jIInstallReporter

$xmlMapFile protected_oe property

protected XmlMapModifier,Jelix\Routing\UrlMapping $xmlMapFile
Résultat Jelix\Routing\UrlMapping\XmlMapModifier