jInstallerPlugin

Extends \jInstallerBase Implements \jIInstallerComponent

a class to install a plugin.

package

jelix

subpackage

installer

since 1.2

Methods

__construct

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

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) 
inherited 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) 
inherited 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
inherited

Response

\jDbConnection

the connection to the database used for the module

dbTool

dbTool() : \jDbTools
inherited

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
inherited

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) 
inherited
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) 
inherited 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) 
inherited

Arguments

$path

firstConfExec

firstConfExec( $config = '') 
inherited

Arguments

$config

firstDbExec

firstDbExec( $profile = '') 
inherited

Arguments

$profile

firstExec

firstExec( $contextId) 
inherited

Arguments

$contextId

getContexts

getContexts() 
inherited

getDbType

getDbType(string $profile = null) : string
inherited

Arguments

$profile

string

the db profile

Response

string

the name of the type of database

getParameter

getParameter( $name) 
inherited

Arguments

$name

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

insertDaoData(string $relativeSourcePath, integer $option,  $module = null) : integer
inherited 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

should configure the plugin, install table into the database etc.

install() 

. If an error occurs during the installation, you are responsible to cancel/revert all things the method did before the error

Throws
\jException

if an error occurs during the install.

Redefine this method if you do some additionnal process after the installation of all other modules/plugins (dependents modules or the whole application)

postInstall() 
Throws
\jException

if an error occurs during the post installation.

postUninstall

postUninstall() 
notimplemented

not used for the current version of the installer

Throws
\jException

if an error occurs during the install.

Called before the installation of all other modules and plugins (dependents modules or the whole application).

preInstall() 

Here, you should check if the plugin can be installed or not

Throws
\jException

if an error occurs during the check of the installation

Called before the uninstallation of all other modules (dependents modules or the whole application).

preUninstall() 

Here, you should check if the module can be uninstalled or not

notimplemented

not used for the current version of the installer

Throws
\jException

if an error occurs during the check of the installation

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) 
inherited

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) 
inherited

Arguments

$parameters

should configure the module, install table into the database etc.

uninstall() 

.

notimplemented

not used for the current version of the installer

Throws
\jException

if an error occurs during the install.

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) 
inherited

Arguments

$dbProfile

string

the profile name

Properties

name of the component

componentName : string
inherited
var

name of the component

Type(s)

string

name of the installer

name : string
inherited
var

name of the installer

Type(s)

string

the versions for which the installer should be called.

targetVersions : array
inherited

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
inherited
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
inherited
var

the version for which the installer is called

Type(s)

string

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

config : \jIniMultiFilesModifier
inherited

the entry point property on which the installer is called

entryPoint : \jInstallerEntryPoint
inherited
var

Type(s)

\jInstallerEntryPoint

The path of the module

path : string
inherited
var

Type(s)

string

the jDb profile for the component

dbProfile : string
inherited
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
inherited
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
inherited
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
inherited
var

Type(s)

array

_dbConn

_dbConn : \jDbConnection
inherited
var

Type(s)

\jDbConnection

contextId

contextId : 
inherited

Type(s)

newContextId

newContextId : 
inherited

Type(s)