PHP Класс 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.
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$installerIni it represents the installer.ini.php file.
$messages JInstallerMessageProvider
$reporter jIInstallReporter the object responsible of the results output

Защищенные свойства (Protected)

Свойство Тип Описание
$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

Открытые методы

Метод Описание
__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

Защищенные методы

Метод Описание
_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 )

Описание методов

__construct() публичный Метод

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() защищенный Метод

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
Результат boolean true if the installation is ok

_singleModules() защищенный Метод

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

completeInstallStatus() защищенный Метод

protected completeInstallStatus ( )

endMessage() защищенный Метод

protected endMessage ( )

error() защищенный Метод

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

forceModuleVersion() публичный Метод

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

getEntryPoint() публичный Метод

public getEntryPoint ( string $epId ) : EntryPoint
$epId string an entry point id
Результат EntryPoint the corresponding entry point object

getEntryPointObject() защищенный Метод

protected getEntryPointObject ( $configFile, $file, $type ) : EntryPoint
Результат EntryPoint

getInstallerIni() защищенный Метод

protected getInstallerIni ( ) : Jelix\IniFile\IniModifier
Результат Jelix\IniFile\IniModifier the modifier for the installer.ini.php file

installApplication() публичный Метод

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
Результат boolean true if succeed, false if there are some errors

installEntryPoint() публичный Метод

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
Результат boolean true if succeed, false if there are some errors

installModules() публичный Метод

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
Результат boolean true if the installation is ok

notice() защищенный Метод

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

ok() защищенный Метод

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

readEntryPointsData() защищенный Метод

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 resolveDependencies ( Resolver $resolver, $epId )
$resolver Jelix\Dependencies\Resolver

runInstall() защищенный Метод

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

runPostInstall() защищенный Метод

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

runPreInstall() защищенный Метод

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

setModuleParameters() публичный Метод

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 startMessage ( )

uninstallModules() публичный Метод

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
Результат boolean true if the uninstallation is ok

warning() защищенный Метод

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

Описание свойств

$allModules защищенное свойство

list of all modules of the application
protected $allModules

$entryPoints защищенное свойство

list of entry point and their properties
protected $entryPoints

$epId защищенное свойство

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

$installerIni публичное свойство

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

$localConfig защищенное свойство

the localconfig.ini.php content combined with $mainConfig
protected MultiIniModifier,Jelix\IniFile $localConfig
Результат Jelix\IniFile\MultiIniModifier

$mainConfig защищенное свойство

the mainconfig.ini.php combined with the defaultconfig.ini.php
protected MultiIniModifier,Jelix\IniFile $mainConfig
Результат Jelix\IniFile\MultiIniModifier

$messages публичное свойство

public JInstallerMessageProvider $messages
Результат JInstallerMessageProvider

$reporter публичное свойство

the object responsible of the results output
public jIInstallReporter $reporter
Результат jIInstallReporter

$xmlMapFile защищенное свойство

protected XmlMapModifier,Jelix\Routing\UrlMapping $xmlMapFile
Результат Jelix\Routing\UrlMapping\XmlMapModifier