modules/UpgradeWizard/SugarMerge/SugarMerge.php
Package: SugarCRMSugarMerge wraps around all the merge functionality of Sugar given a module name and the path to an unzipped patch
Properties
Methods
createHistoryLog(
STRING $module, STRING $customFile, STRING $file
)
:
void
Create a history copy of the custom file that will be merged so that it can be access through
studio if admins wish to revert at a later date.
Parameters
Name |
Type |
Description |
$module |
STRING |
|
$customFile |
STRING |
- Path to the custom file that will be merged
|
$file |
STRING |
|
getCustomPath(
)
:
STRING
Return the custom modules path
Returns
Type |
Description |
STRING |
directory where custom module files are located |
getNewPath(
)
:
STRING
Return the new upgrade modules path
Returns
Type |
Description |
STRING |
directory where new module files are located |
getOriginalPath(
)
:
STRING
Return the original modules path
Returns
Type |
Description |
STRING |
directory where new module files are located |
mergeAll(
BOOLEAN | ARRAY $merge
=
true, BOOLEAN $save
=
true, BOOLEAN $logHistory
=
true
)
:
ARRAY
This will run through all the modules that may need merging and determine if there is anything to merge
if $merge is set to true it will perform the merge
if $merge and $save are set to true it will perform the merge and save the results in the custom directory
Parameters
Name |
Type |
Description |
$merge |
BOOLEAN | ARRAY |
- do we wish to perform the merge if false it will just return a list of files that can be merged. If an array is passed, only those modules present in the array will be merged.
|
$save |
BOOLEAN |
- do we wish to save the merged files to true - $merge must be true for this to apply - otherwise it will simulate merging so you can view the log files of the merge
|
$logHistory |
BOOLEAN |
- do we wish to create history entries for any of the merges
|
Returns
Type |
Description |
ARRAY |
- an associative array of module names to files that were either merged or have the potential to be merged depeneding if $merge and $save are set to true |
mergeFile(
STRING $module, STRING $file, STRING $save
=
true, $logHistory
=
true
)
:
BOOLEAN
This function will merge a single file for a module
Parameters
Name |
Type |
Description |
$module |
STRING |
|
$file |
STRING |
|
$save |
STRING |
- should the merged file be saved to the custom directory
|
$logHistory |
|
|
Returns
Type |
Description |
BOOLEAN |
- success or failure of the merge |
mergeModule(
STRING $module, BOOLEAN $merge
=
true, BOOLEAN $save
=
true, BOOLEAN $logHistory
=
true
)
:
ARRAY
This will merge any files that need merging for a given module
if $merge is set to true it will perform the merge
if $merge and $save are set to true it will perform the merge and save the results in the custom directory
Parameters
Name |
Type |
Description |
$module |
STRING |
- the name of the module to merge files for
|
$merge |
BOOLEAN |
- do we wish to perform the merge if false it will just return a list of files that can be merged
|
$save |
BOOLEAN |
- do we wish to save the merged files to true - $merge must be true for this to apply - otherwise it will simulate merging so you can view the log files of the merge
|
$logHistory |
BOOLEAN |
- do we wish to create history entries for any of the merges
|
Returns
Type |
Description |
ARRAY |
- an associative array of files that were either merged or have the potential to be merged depeneding if $merge and $save are set to true |