base class for installers
| package |
jelix |
|---|---|
| subpackage |
installer |
| since | 1.2 |
__construct(string $componentName, string $name, string $path, string $version, boolean $installWholeApp = false)
stringname of the component
stringname of the installer
stringthe component path
stringversion of the component
booleantrue if the installation is during the whole app installation false if it is only few modules and this module
copyDirectoryContent(string $relativeSourcePath, string $targetPath, $overwrite = false)
stringrelative path to the install/ directory of the component
stringthe full path where to copy the content
copyFile(string $relativeSourcePath, string $targetPath, $overwrite = false)
stringrelative path to the install/ directory of the file to copy
stringthe full path where to copy the file
dbConnection() : \jDbConnection
declareDbProfile(string $name, null|string|array $sectionContent = null, boolean $force = true) : boolean
stringthe name of the new section/alias
null|string|arraythe content of the new section, or null to create an alias.
booleantrue:erase the existing profile
booleantrue if the ini file has been changed
declarePluginsPath(string $path)
| since | 1.4 |
|---|---|
stringa path. it could contains aliases like 'app:', 'lib:' or 'module:'
execSQLScript(string $name, string $module = null, boolean $inTransaction = true)
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.
| Throws |
|
|---|
stringthe name of the script
stringthe module from which we should take the sql file. null for the current module
booleanindicate if queries should be executed inside a transaction
firstConfExec( $config = '')
firstDbExec( $profile = '')
firstExec( $contextId)
getContexts()
getDbType(string $profile = null) : string
stringthe db profile
stringthe name of the type of database
getParameter( $name)
insertDaoData(string $relativeSourcePath, integer $option, $module = null) : integer
| since | 1.6.16 |
|---|---|
| Throws |
|
stringname of the json file into the install directory
integerone of jDbTools::IBD_* const
integernumber of records inserted/updated
setEntryPoint(\jInstallerEntryPoint $ep, \jIniMultiFilesModifier $config, string $dbProfile, array $contexts)
stringthe name of the current jdb profile. It will be replaced by $defaultDbProfile if it exists
arraylist of contexts already executed
setParameters( $parameters)
useDbProfile(string $dbProfile)
stringthe profile name
componentName : string
| var |
name of the component |
|---|
string
name : string
| var |
name of the installer |
|---|
string
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)
| var |
list of version by asc order |
|---|---|
| since |
array
date : string
| var |
the date of the release of the update. format: yyyy-mm-dd hh:ii |
|---|---|
| since |
string
version : string
| var |
the version for which the installer is called |
|---|
string
config : \jIniMultiFilesModifier
entryPoint : \jInstallerEntryPoint
path : string
| var |
|---|
string
dbProfile : string
| var |
the jDb profile for the component |
|---|
string
defaultDbProfile : string
| var |
the default profile name for the component, if it exist. keep it to '' if not |
|---|
string
installWholeApp : boolean
| var |
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. |
|---|
boolean
parameters : array
| var |
|---|
array
contextId :
newContextId :