Package DE_EPAGES::Core::API::BaseInstaller
base installer
@EXPORT_OK |
Functions
- ResetInstallerCache
- addReason
- call
- cartridgeDirectory
- cartridgePackage
- dependentCartridges
- directDependentCartridges
- directRequiredCartridges
- doPatch
- finishInstall
- finishPatch
- finishUninstall
- force
- getReasons
- hasReasons
- id
- install
- installRequiredCartridges
- installedVersion
- isCompliant
- isInstalled
- isRecursive
- loadInstaller
- new
- noScheduler
- noSharedConfig
- patch
- patchCartridgeDir
- patchStoreTypeDir
- patches
- patchesDirectory
- requiredCartridges
- setVersion
- startInstall
- startPatch
- startUninstall
- storeName
- storeType
- storeTypeDir
- storeTypeVersion
- supportedVersions
- test
- testCartridgeCompliant
- testDirectory
- testExists
- testInstall
- testInstallRequiredCartridges
- testNotExists
- testUninstall
- testUninstallDependentCartridges
- uninstall
- uninstallDependentCartridges
- version
ResetInstallerCache
Reset the internal installer cache
Syntax |
ResetInstallerCache(); |
addReason
Adds reason to collect problems on install/uninstall/patch/...
Syntax |
$Installer->addReason($hReason); |
Input |
|
call
Executes the code reference. Depending on the force flag, errors are degraded to warnings.
Syntax |
$Installer->call( $Code ); |
Example |
$Installer->call( sub { ImportObject( "Objects.xml" ) } ); |
Input |
|
cartridgeDirectory
Gets cartridge directory name.
Syntax |
$CartridgeDirectory = $Installer->cartridgeDirectory; |
Return |
|
cartridgePackage
Gets cartridge package name.
Syntax |
$CartridgePackage = $Installer->cartridgePackage; |
Return |
|
dependentCartridges
Returns a list of all cartridges that depend on this cartridge. The list includes direct and indirect dependencies. The cartridges can be uninstalled in the order of the list. The default implementation returns an empty list.
Syntax |
$aDependentCartridges = $Installer->dependentCartridges; |
Return |
|
directDependentCartridges
Returns a list of cartridges that have declared dependencies on this cartridge. The list does not include indirect dependencies. The default implementation returns an empty list.
Syntax |
$aDependentCartridges = $Installer->directDependentCartridges; |
Return |
|
directRequiredCartridges
Returns a list of all cartridges that are directly required by this cartridges. The list does not include cartridges that are required by the required cartridges.
Syntax |
$aRequiredCartridges = $Installer->directRequiredCartridges; |
Return |
|
doPatch
Patches cartridge in active store. This function calls methods named "patch_$InstalledVersion". InstalledVersion is actual version of cartridge '.' are replaced with '_' (version on 1.0.1.0 will call patch_1_0_1_0). At the end of each patch call the called function returns the new version (eg: 1.1.0.0).
Syntax |
$Installer->doPatch; $Installer->doPatch('6.12.0'); |
Input |
|
finishInstall
Finalizes the cartridge installation. Writes a info 'finish install 'at log. Sets the cartridge version.
Syntax |
$Installer->finishInstall; |
finishPatch
Finalizes the cartridge patch. Writes a info 'finish patch 'at log.
Syntax |
$Installer->finishPatch; |
finishUninstall
Finalizes the cartridge uninstallation. Writes 'finish uninstall' to log. Delete Cartridge entry from Cartridges.d/$Store.conf
Syntax |
$Installer->finishUninstall; |
force
Forces uninstallation.
Syntax |
$Force = $Installer->force; |
Example |
die "Installation failed" unless $Installer->force; |
Return |
|
getReasons
Returns collected reasons and deletes reasons.
Syntax |
$ahReasons = $Installer->getReasons(); |
Return |
|
hasReasons
Returns if reasons exists.
Syntax |
$Has = $Installer->hasReasons(); |
Return |
|
id
Returns the cartridge id from the current database or undef if the cartridge is not installed in the current database.
Syntax |
$CartridgeID = $Installer->id; |
Return |
|
install
Installs the files and database objects of a cartridge to the current store/database.
Syntax |
$Installer->install; |
installRequiredCartridges
Installs required cartridges.
Syntax |
$Installer->installRequiredCartridges; |
installedVersion
Returns the installed version of the cartridge in the current database.
Syntax |
my $Version = $Installer->installedVersion(); |
Return |
|
isCompliant
Returns whether or not the current version is compliant to the new version of patch. Returns true if the major version is equal and the current minor version is equal or higher than required.
Syntax |
$IsCompliant = $Installer->isCompliant($RequiredVersion, $CurrentVersion); |
Example |
$IsCompliant = $Installer->isCompliant('5.0.0.4'); $IsCompliant = $Installer->isCompliant('5.0.0.4', '6.1'); # false $IsCompliant = $Installer->isCompliant('5.0.0.4', '5.0.1'); # true |
Input |
|
Return |
|
isInstalled
Returns true if the cartridge is installed in the current database.
Syntax |
$IsInstalled = $Installer->isInstalled; |
Return |
|
isRecursive
Returns true if required cartridges are to be installed automatically or dependent cartridges are uninstalled automatically.
Syntax |
$IsRecursive = $Installer->isRecursive; |
Return |
|
loadInstaller
Loads other installer.
Syntax |
$OtherInstaller = $Installer->loadInstaller( $Package ); |
Input |
|
Return |
|
new
Creates a new installer object.
Syntax |
$Installer = DE_EPAGES::Core::API::BaseInstaller->new(%Options); |
Input |
|
Return |
|
noScheduler
Returns true if cartridges are to be installed without scheduler files
Syntax |
$NoScheduler = $Installer->noScheduler; |
Return |
|
noSharedConfig
Returns true if cartridges are to be installed without config files
Syntax |
$NoSharedConfig = $Installer->noSharedConfig; |
Return |
|
patch
Patches the files and database objects of a cartridge to the current store/database if the cartridge is installed.
Syntax |
$Installer->patch; $Installer->patch('6.12.0'); |
Input |
|
patchCartridgeDir
Patches cartridge directory. This function calls methods named "patchCartridgeDir_$CartridgeDirVersion". CartridgeDirVersion is first patch version of cartridge '.' are replaced with '_' (version on 1.0.1.0 will call patchCartridgeDir_1_0_1_0). At the end of each patch call the called function returns the new version (eg: 1.1.0.0). note: if version is given, the function is only called for this specific version, not for all versions between current version and goal version
Syntax |
$Installer->patchCartridgeDir; $Installer->patchCartridgeDir('6.13.0'); |
Input |
|
patchStoreTypeDir
Patches cartridge directory. This function calls methods named "patchStoreTypeDir_$CartridgeDirVersion". CartridgeDirVersion is first patch version of cartridge '.' are replaced with '_' (version on 1.0.1.0 will call patchStoreTypeDir_1_0_1_0). At the end of each patch call the called function returns the new version (eg: 1.1.0.0).
Syntax |
$Installer->patchStoreTypeDir; |
patches
Returns older versions which can be patched by this cartridge.
Syntax |
$aPatchVersions = $Installer->patches; |
Return |
|
patchesDirectory
Gets cartridge patch directory name.
Syntax |
$CartridgePatchDirectory = $Installer->patchesDirectory; |
Return |
|
requiredCartridges
Returns a list of all required cartridges, including indirectly required cartridges. The cartridges can be installed in the order of the list. The default implementation returns an empty list.
Syntax |
$aRequiredCartridges = $Installer->requiredCartridges; |
Return |
|
setVersion
Updates the cartridge version in the current database.
Syntax |
$Installer->setVersion( $Version ); |
Example |
$Installer->setVersion('1.0.2'); |
Input |
|
startInstall
Prepares the cartridge installation.
Syntax |
$Installer->startInstall; |
startPatch
Prepares the cartridge patch. Writes a info 'start patch' at log.
Syntax |
$Installer->startPatch; |
startUninstall
Prepares the cartridge uninstallation.
Syntax |
$Installer->startUninstall; |
storeName
The cartridge will be installed at this store.
Syntax |
$StoreName = $Installer->storeName; |
Return |
|
storeType
The cartridge will be installed for this store type.
Syntax |
$StoreType = $Installer->storeType; |
Return |
|
storeTypeDir
The cartridge will be installed into this store type directory.
Syntax |
$StoreTypeDir = $Installer->storeTypeDir; |
Return |
|
storeTypeVersion
The cartridge will be installed for this store type version.
Syntax |
$StoreTypeVersion = $Installer->storeTypeVersion; |
Return |
|
supportedVersions
Returns a list of supported versions of the required cartridge.
Syntax |
$aVersions = $Installer->supportedVersions($Package); |
Input |
|
Return |
|
test
base method for overwriting in subclasses
Syntax |
$self->test; |
testCartridgeCompliant
Tests if a required cartridge exists with a supported version. Calls addReason if the version of the required cartridge is not compatible.
Syntax |
$Installer->testCartridgeCompliant($Cartridge); |
Input |
|
testDirectory
Gets test directory path of a cartridge.
Syntax |
$TestDirectory = $Installer->testDirectory; |
Return |
|
testExists
Adds a reason if cartridge is not installed. Calls addReason if the cartridge is not yet installed.
Syntax |
$Installer->testExists; |
testInstall
Tests installation of cartridge. Calls addReason for each reason why the cartridge cannot be installed.
Syntax |
$Installer->testInstall; |
testInstallRequiredCartridges
Tests installation of required cartridges. Calls addReason for each reason why a required cartridge cannot be installed.
Syntax |
$Installer->testInstallRequiredCartridges; |
testNotExists
Adds a reason if cartridge is installed. Calls addReason if the cartridge is already installed.
Syntax |
$Installer->testNotExists; |
testUninstall
Tests uninstallation of cartridge. Calls addReason for each reason why the cartridge cannot be uninstalled.
Syntax |
$Installer->testUninstall; |
testUninstallDependentCartridges
Tests deinstallation of dependent cartridges. Calls addReason for each reason why a dependent cartridge cannot be uninstalled.
Syntax |
$Installer->testUninstallDependentCartridges; |
uninstall
Removes cartridge files and database objects from the current store/database.
Syntax |
$Installer->uninstall; |
uninstallDependentCartridges
Uninstalls dependent cartridges (does nothing).
Syntax |
$Installer->uninstallDependentCartridges; |
version
Returns the current cartridge version.
Syntax |
$Version = $Installer->version; |
Return |
|