PHP Класс Jelix\Installer\AbstractInstaller

С версии: 1.2
Показать файл Открыть проект

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

Свойство Тип Описание
$date the date of the release of the update. format: yyyy-mm-dd hh:ii
$name name of the installer
$targetVersions array Useful for an upgrade which target multiple branches of a project. Put the version for multiple branches. The installer will be called only once, for the needed version. If you don't fill it, the name of the class file should contain the target version (deprecated behavior though)
$version the version for which the installer is called

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

Свойство Тип Описание
$componentName name of the component
$config Jelix\IniFile\MultiIniModifier combination between mainconfig.ini.php (master) and entrypoint config (overrider)
$contextId
$dbProfile the jDb profile for the component
$defaultDbProfile the default profile name for the component, if it exist. keep it to '' if not
$entryPoint EntryPoint the entry point property on which the installer is called
$installWholeApp true if this is an installation for the whole application. false if this is an installation in an already installed application. Always False for upgraders.
$newContextId
$parameters array parameters for the installer, indicated in the configuration file or dynamically, by a launcher in a command line for instance.
$path string The path of the module

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

Метод Описание
__construct ( string $componentName, string $name, string $path, string $version, boolean $installWholeApp = false )
getConfigIni ( ) : Jelix\IniFile\MultiIniModifier the entry point config combined with $localConfigIni
getContexts ( )
getLocalConfigIni ( ) : Jelix\IniFile\MultiIniModifier the localconfig.ini.php file combined with $mainConfigIni
getMainConfigIni ( ) : Jelix\IniFile\MultiIniModifier the mainconfig.ini.php file combined with defaultconfig.ini.php
getParameter ( $name )
setEntryPoint ( EntryPoint $ep, string $dbProfile, array $contexts ) is called to indicate that the installer will be called for the given configuration, entry point and db profile.
setParameters ( $parameters )

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

Метод Описание
copyDirectoryContent ( string $relativeSourcePath, string $targetPath, $overwrite = false ) copy the whole content of a directory existing in the install/ directory of the component, to the given directory
copyFile ( string $relativeSourcePath, string $targetPath, $overwrite = false ) copy a file from the install/ directory to an other
dbConnection ( ) : jDbConnection
dbTool ( ) : jDbTools
declareDbProfile ( string $name, null | string | array $sectionContent = null, boolean $force = true ) : boolean declare a new db profile. if the content of the section is not given, it will declare an alias to the default profile
declareNewEntryPoint ( $epId, $epType, $configFileName )
execSQLScript ( string $name, string $module = null, boolean $inTransaction = true ) import a sql script into the current profile.
expandPath ( $path )
firstConfExec ( $config = '' )
firstDbExec ( $profile = '' )
firstExec ( $contextId )
getDbType ( string $profile = null ) : string
useDbProfile ( string $dbProfile ) use the given database profile. check if this is an alias and use the real db profiel if this is the case.

Приватные методы

Метод Описание
_copyDirectoryContent ( string $sourcePath, string $targetPath, $overwrite ) private function which copy the content of a directory to an other

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

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

public __construct ( string $componentName, string $name, string $path, string $version, boolean $installWholeApp = false )
$componentName string name of the component
$name string name of the installer
$path string the component path
$version string version of the component
$installWholeApp boolean true if the installation is during the whole app installation false if it is only few modules and this module

copyDirectoryContent() закрытый защищенный Метод

copy the whole content of a directory existing in the install/ directory of the component, to the given directory
final protected copyDirectoryContent ( string $relativeSourcePath, string $targetPath, $overwrite = false )
$relativeSourcePath string relative path to the install/ directory of the component
$targetPath string the full path where to copy the content

copyFile() закрытый защищенный Метод

copy a file from the install/ directory to an other
final protected copyFile ( string $relativeSourcePath, string $targetPath, $overwrite = false )
$relativeSourcePath string relative path to the install/ directory of the file to copy
$targetPath string the full path where to copy the file

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

protected dbConnection ( ) : jDbConnection
Результат jDbConnection the connection to the database used for the module

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

protected dbTool ( ) : jDbTools
Результат jDbTools the tool class of jDb

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

declare a new db profile. if the content of the section is not given, it will declare an alias to the default profile
protected declareDbProfile ( string $name, null | string | array $sectionContent = null, boolean $force = true ) : boolean
$name string the name of the new section/alias
$sectionContent null | string | array the content of the new section, or null to create an alias.
$force boolean true:erase the existing profile
Результат boolean true if the ini file has been changed

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

protected declareNewEntryPoint ( $epId, $epType, $configFileName )

execSQLScript() закрытый защищенный Метод

The name of the script should be store in install/$name.databasetype.sql in the directory of the component. (replace databasetype by mysql, pgsql etc.) You can however provide a script compatible with all databases, but then you should indicate the full name of the script, with a .sql extension.
final protected execSQLScript ( string $name, string $module = null, boolean $inTransaction = true )
$name string the name of the script
$module string the module from which we should take the sql file. null for the current module
$inTransaction boolean indicate if queries should be executed inside a transaction

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

protected expandPath ( $path )

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

protected firstConfExec ( $config = '' )

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

protected firstDbExec ( $profile = '' )

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

protected firstExec ( $contextId )

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

the entry point config combined with $localConfigIni
С версии: 1.7
public getConfigIni ( ) : Jelix\IniFile\MultiIniModifier
Результат Jelix\IniFile\MultiIniModifier

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

public getContexts ( )

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

protected getDbType ( string $profile = null ) : string
$profile string the db profile
Результат string the name of the type of database

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

the localconfig.ini.php file combined with $mainConfigIni
С версии: 1.7
public getLocalConfigIni ( ) : Jelix\IniFile\MultiIniModifier
Результат Jelix\IniFile\MultiIniModifier

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

the mainconfig.ini.php file combined with defaultconfig.ini.php
С версии: 1.7
public getMainConfigIni ( ) : Jelix\IniFile\MultiIniModifier
Результат Jelix\IniFile\MultiIniModifier

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

public getParameter ( $name )

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

is called to indicate that the installer will be called for the given configuration, entry point and db profile.
public setEntryPoint ( EntryPoint $ep, string $dbProfile, array $contexts )
$ep EntryPoint the entry point
$dbProfile string the name of the current jdb profile. It will be replaced by $defaultDbProfile if it exists
$contexts array list of contexts already executed

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

public setParameters ( $parameters )

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

use the given database profile. check if this is an alias and use the real db profiel if this is the case.
protected useDbProfile ( string $dbProfile )
$dbProfile string the profile name

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

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

name of the component
protected $componentName

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

combination between mainconfig.ini.php (master) and entrypoint config (overrider)
Устаревший: use entryPoint methods to access to different configuration files.
protected MultiIniModifier,Jelix\IniFile $config
Результат Jelix\IniFile\MultiIniModifier

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

protected $contextId

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

the date of the release of the update. format: yyyy-mm-dd hh:ii
С версии: 1.2.6
public $date

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

the jDb profile for the component
protected $dbProfile

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

the default profile name for the component, if it exist. keep it to '' if not
protected $defaultDbProfile

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

the entry point property on which the installer is called
protected EntryPoint,Jelix\Installer $entryPoint
Результат EntryPoint

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

true if this is an installation for the whole application. false if this is an installation in an already installed application. Always False for upgraders.
protected $installWholeApp

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

name of the installer
public $name

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

protected $newContextId

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

parameters for the installer, indicated in the configuration file or dynamically, by a launcher in a command line for instance.
protected array $parameters
Результат array

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

The path of the module
protected string $path
Результат string

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

Useful for an upgrade which target multiple branches of a project. Put the version for multiple branches. The installer will be called only once, for the needed version. If you don't fill it, the name of the class file should contain the target version (deprecated behavior though)
С версии: 1.2.6
public array $targetVersions
Результат array

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

the version for which the installer is called
public $version