jInstallerBase

base class for installers

package

jelix

subpackage

installer

since 1.2

Methods

__construct

__construct(string $componentName, string $name, string $path, string $version, boolean $installWholeApp = false) 

Arguments

$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

copy the whole content of a directory existing in the install/ directory of the component, to the given directory

copyDirectoryContent(string $relativeSourcePath, string $targetPath,  $overwrite = false) 
final

Arguments

$relativeSourcePath

string

relative path to the install/ directory of the component

$targetPath

string

the full path where to copy the content

$overwrite

copy a file from the install/ directory to an other

copyFile(string $relativeSourcePath, string $targetPath,  $overwrite = false) 
final

Arguments

$relativeSourcePath

string

relative path to the install/ directory of the file to copy

$targetPath

string

the full path where to copy the file

$overwrite

dbConnection

dbConnection() : \jDbConnection

Response

\jDbConnection

the connection to the database used for the module

dbTool

dbTool() : \jDbTools

Response

\jDbTools

the tool class of jDb

declare a new db profile. if the content of the section is not given, it will declare an alias to the default profile

declareDbProfile(string $name, null|string|array $sectionContent = null, boolean $force = true) : boolean

Arguments

$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

Response

boolean

true if the ini file has been changed

declare a plugins directory

declarePluginsPath(string $path) 
since 1.4

Arguments

$path

string

a path. it could contains aliases like 'app:', 'lib:' or 'module:'

import a sql script into the current profile.

execSQLScript(string $name, string $module = null, boolean $inTransaction = true) 
final

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
\Exception

Arguments

$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

expandPath( $path) 

Arguments

$path

firstConfExec

firstConfExec( $config = '') 

Arguments

$config

firstDbExec

firstDbExec( $profile = '') 

Arguments

$profile

firstExec

firstExec( $contextId) 

Arguments

$contextId

getContexts

getContexts() 

getDbType

getDbType(string $profile = null) : string

Arguments

$profile

string

the db profile

Response

string

the name of the type of database

getParameter

getParameter( $name) 

Arguments

$name

Insert data into a database, from a json file, using a DAO mapping

insertDaoData(string $relativeSourcePath, integer $option,  $module = null) : integer
final
since 1.6.16
Throws
\Exception

Arguments

$relativeSourcePath

string

name of the json file into the install directory

$option

integer

one of jDbTools::IBD_* const

$module

Response

integer

number of records inserted/updated

is called to indicate that the installer will be called for the given configuration, entry point and db profile.

setEntryPoint(\jInstallerEntryPoint $ep, \jIniMultiFilesModifier $config, string $dbProfile, array $contexts) 

Arguments

$ep

\jInstallerEntryPoint

the entry point

$config

\jIniMultiFilesModifier

the configuration of 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

setParameters( $parameters) 

Arguments

$parameters

use the given database profile. check if this is an alias and use the real db profiel if this is the case.

useDbProfile(string $dbProfile) 

Arguments

$dbProfile

string

the profile name

Properties

name of the component

componentName : string
var

name of the component

Type(s)

string

name of the installer

name : string
var

name of the installer

Type(s)

string

the versions for which the installer should be called.

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

Type(s)

array

the date of the release of the update. format: yyyy-mm-dd hh:ii

date : string
var

the date of the release of the update. format: yyyy-mm-dd hh:ii

since

Type(s)

string

the version for which the installer is called

version : string
var

the version for which the installer is called

Type(s)

string

combination between mainconfig.ini.php (master) and entrypoint config (overrider)

config : \jIniMultiFilesModifier

the entry point property on which the installer is called

entryPoint : \jInstallerEntryPoint
var

Type(s)

\jInstallerEntryPoint

The path of the module

path : string
var

Type(s)

string

the jDb profile for the component

dbProfile : string
var

the jDb profile for the component

Type(s)

string

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

defaultDbProfile : string
var

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

Type(s)

string

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.

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.

Type(s)

boolean

parameters for the installer, indicated in the configuration file or dynamically, by a launcher in a command line for instance.

parameters : array
var

Type(s)

array

_dbConn

_dbConn : \jDbConnection
var

Type(s)

\jDbConnection

contextId

contextId : 

Type(s)

newContextId

newContextId : 

Type(s)