Admidio API
  • Package
  • Class
  • Tree
  • Deprecated
  • Todo

Packages

  • com
    • tecnick
      • tcpdf
  • None
  • PHPMailer
    • easypeasyics
  • PHPWavUtils
  • Securimage
    • classes

Classes

  • AutoLogin
  • Component
  • ComponentUpdate
  • ConditionParser
  • Database
  • DateTimeExtended
  • Email
  • Folder
  • FormValidation
  • FunctionClass
  • Htaccess
  • HtmlDiv
  • HtmlElement
  • HtmlForm
  • HtmlFormBasic
  • HtmlFormInstallation
  • HtmlList
  • HtmlNavbar
  • HtmlPage
  • HtmlTable
  • HtmlTableBasic
  • Image
  • Inventory
  • InventoryFields
  • Language
  • LanguageData
  • ListConfiguration
  • Menu
  • Message
  • ModuleAnnouncements
  • ModuleDates
  • ModuleLists
  • ModuleMenu
  • ModuleMessages
  • Modules
  • ModuleWeblinks
  • MyFiles
  • Navigation
  • ntlm_sasl_client_class
  • Organization
  • Participants
  • PasswordHash
  • PasswordHashing
  • ProfileFields
  • RoleDependency
  • RolesRights
  • RSSfeed
  • Session
  • SystemMail
  • TableAccess
  • TableAnnouncement
  • TableCategory
  • TableDate
  • TableFile
  • TableFolder
  • TableGuestbook
  • TableGuestbookComment
  • TableInventory
  • TableInventoryField
  • TableLists
  • TableMembers
  • TableMessage
  • TablePhotos
  • TableRoles
  • TableRooms
  • TableText
  • TableUserField
  • TableUsers
  • TableWeblink
  • UploadHandlerDownload
  • UploadHandlerPhoto
  • User
  • UserRegistration

Exceptions

  • AdmException
  • WavFileException
  • WavFormatException

Functions

  • admFuncAutoload
  • admFuncGeneratePagination
  • admFuncGetBytesFromSize
  • admFuncGetDirectoryEntries
  • admFuncMaxUploadSize
  • admFuncProcessableImageSize
  • admFuncShowCreateChangeInfoById
  • admFuncShowCreateChangeInfoByName
  • admFuncVariableIsValid
  • admReadTemplateFile
  • admStrIsValidFileName
  • admStrStripTagsSpecial
  • admStrToLower
  • admStrToUpper
  • bzip2Version
  • checkDatabaseVersion
  • checkPhpVersion
  • EmailAttachment
  • FileSizeNiceDisplay
  • FormattedTimeRemaining
  • FunctionIsDisabled
  • getFormerRolesFromDatabase
  • getFutureRolesFromDatabase
  • getmicrotime
  • getRoleMemberships
  • getRolesFromDatabase
  • gzipVersion
  • hasRole
  • hl_attrval
  • hl_bal
  • hl_cmtcd
  • hl_ent
  • hl_prot
  • hl_regex
  • hl_spec
  • hl_tag
  • hl_tag2
  • hl_tidy
  • hl_version
  • htmLawed
  • HTMLFilter
  • isGroupLeader
  • isMember
  • kses
  • kses_hook
  • MySQLdumpVersion
  • OutputInformation
  • SafeExec
  • showNotice
  • strAddSlashesDeep
  • strNextLetter
  • strStripSlashesDeep
  • strStripTags
  • strValidCharacters
  • tln_body2div
  • tln_casenormalize
  • tln_deent
  • tln_defang
  • tln_findnxreg
  • tln_findnxstr
  • tln_fixatts
  • tln_fixstyle
  • tln_fixurl
  • tln_getnxtag
  • tln_sanitize
  • tln_skipspace
  • tln_tagprint
  • tln_unspace
  • version_compare_replacement
  • version_compare_replacement_sub

Class ComponentUpdate

TableAccess
Extended by Component
Extended by ComponentUpdate
Copyright: 2004-2016 The Admidio Team
License: GNU General Public License v2.0 only **********************************************************************************************
B:

adm_program/installation/db_scripts and for plugins there should be an install folder within the plugin directory. The xml files should have the prefix update and than the main und subversion within their filename e.g. @b update_3_0.xml .


Brief:

Manage the update of a component from the actual version to the target version

The class is an extension to the component class and will handle the update of a component. It will read the database version from the component and set this as source version. Then you should set the target version. The class will then search search for specific update xml files in special directories. For the system this should be


Class: ComponentUpdate
Code:

// update the system module to the actual filesystem version $componentUpdateHandle = new ComponentUpdate($gDb); $componentUpdateHandle->readDataByColumns(array('com_type' => 'SYSTEM', 'com_name_intern' => 'CORE')); $componentUpdateHandle->setTargetVersion(ADMIDIO_VERSION); $componentUpdateHandle->update(); @endcode


Par: Examples
Located at componentupdate.php

Methods summary

private boolean
# createXmlObject( string|integer $mainVersion, string|integer $subVersion )

Will open a XML file of a specific version that contains all the update steps that must be passed to successfully update Admidio to this version

Will open a XML file of a specific version that contains all the update steps that must be passed to successfully update Admidio to this version

Parameters

$mainVersion
Contains a string with the main version number e.g. 2 or 3 from 2.x or 3.x.
$subVersion
Contains a string with the main version number e.g. 1 or 2 from x.1 or x.2.

Returns

boolean
private
# executeStep( SimpleXMLElement $xmlNode )

Will execute the specific update step that is set through the parameter $xmlNode. If the step was successfully done the id will be stored in the component recordset so if the whole update crashs later we know that this step was successfully executed. When the node has an attribute @b database than this sql statement will only executed if the value of the attribute is equal to your current @b $gDbType . If the node has an attribute @b error and this is set to @b ignore than an sql error will not stop the update script.

Will execute the specific update step that is set through the parameter $xmlNode. If the step was successfully done the id will be stored in the component recordset so if the whole update crashs later we know that this step was successfully executed. When the node has an attribute @b database than this sql statement will only executed if the value of the attribute is equal to your current @b $gDbType . If the node has an attribute @b error and this is set to @b ignore than an sql error will not stop the update script.

Parameters

$xmlNode
A SimpleXML node of the current update step.
public integer
# getMaxUpdateStep( )

Goes step by step through the update xml file of the current database version and search for the maximum step. If the last step is found than the id of this step will be returned.

Goes step by step through the update xml file of the current database version and search for the maximum step. If the last step is found than the id of this step will be returned.

Returns

integer
Return the number of the last update step that was found in xml file of the current version.
public
# setTargetVersion( string $version )

Set the target version for the component after update. This information should be read from the files of the component.

Set the target version for the component after update. This information should be read from the files of the component.

Parameters

$version
Target version of the component after update
public
# update( )

Do a loop through all versions start with the current version and end with the target version. Within every subversion the method will search for an update xml file and execute all steps in this file until the end of file is reached. If an error occurred then the update will be stopped.

Do a loop through all versions start with the current version and end with the target version. Within every subversion the method will search for an update xml file and execute all steps in this file until the end of file is reached. If an error occurred then the update will be stopped.

public
# updateStepDeleteDateRoles( )

This method deletes all roles that belongs to still deleted dates.

This method deletes all roles that belongs to still deleted dates.

public
# updateStepMigrateToFolderRights( )

This method migrate the data of the table adm_folder_roles to the new table adm_roles_rights_data.

This method migrate the data of the table adm_folder_roles to the new table adm_roles_rights_data.

public
# updateStepNewDownloadRootFolderName( )

Create a unique folder name for the root folder of the download module that contains the shortname of the current organization

Create a unique folder name for the root folder of the download module that contains the shortname of the current organization

public
# updateStepRenameWebmasterToAdministrator( )

This method renames the webmaster role to administrator.

This method renames the webmaster role to administrator.

public
# updateStepSetDefaultConfiguration( )

This method set the default configuration for all organizations

This method set the default configuration for all organizations

Methods inherited from Component

__construct(), checkDatabaseVersion()

Methods inherited from TableAccess

__sleep(), clear(), connectAdditionalTable(), countAllRecords(), delete(), getValue(), hasColumnsValueChanged(), isNewRecord(), readData(), readDataByColumns(), readDataById(), save(), setArray(), setDatabase(), setValue()

Properties summary

private $updateFinished
#
private $xmlObject
#
private $currentVersionArray
#
private $targetVersionArray
#

Properties inherited from TableAccess

$additionalTables, $columnPrefix, $columnsInfos, $columnsValueChanged, $db, $dbColumns, $keyColumnName, $new_record, $tableName

Admidio API API documentation generated by ApiGen