CRM_Extension_Upgrader_TasksTrait
The TasksTrait provides a library of tasks that are useful to run during an upgrade.
Table of Contents
Methods
- executeCustomDataFile() : bool
- Run a CustomData file.
- executeSql() : bool
- Run one SQL query.
- executeSqlFile() : bool
- Run a SQL file.
- executeSqlTemplate() : bool
- Run the sql commands in the specified file.
- getExtensionDir() : string
- executeCustomDataFileByAbsPath() : bool
- Run a CustomData file
Methods
executeCustomDataFile()
Run a CustomData file.
public
executeCustomDataFile(string $relativePath) : bool
Parameters
- $relativePath : string
-
the CustomData XML file path (relative to this extension's dir)
Return values
boolexecuteSql()
Run one SQL query.
public
executeSql(mixed $query[, mixed $params = [] ]) : bool
This is just a wrapper for CRM_Core_DAO::executeSql, but it provides syntactic sugar for queueing several tasks that run different queries
Parameters
- $query : mixed
- $params : mixed = []
Return values
boolexecuteSqlFile()
Run a SQL file.
public
executeSqlFile(string $tplFile) : bool
Parameters
- $tplFile : string
-
The SQL file path (relative to this extension's dir, or absolute)
Return values
boolexecuteSqlTemplate()
Run the sql commands in the specified file.
public
executeSqlTemplate(string $tplFile) : bool
Parameters
- $tplFile : string
-
The SQL file path (relative to this extension's dir, or absolute). Ex: "sql/mydata.mysql.tpl".
Tags
Return values
boolgetExtensionDir()
public
abstract getExtensionDir() : string
Return values
stringexecuteCustomDataFileByAbsPath()
Run a CustomData file
protected
executeCustomDataFileByAbsPath(string $xml_file) : bool
Parameters
- $xml_file : string
-
the CustomData XML file path (absolute path)