modules/UpgradeWizard/SugarMerge/SugarMerge.php

Show: inherited
Table of Contents

\SugarMerge

Package: SugarCRM

SugarMerge wraps around all the merge functionality of Sugar given a module name and the path to an unzipped patch

Properties

Propertyprivate  $custom_path= ''custom''
Default value'custom'Details
Type
n/a
Propertyprivate  $fp= 'NULL'
Default valueNULLDetails
Type
n/a
Propertyprivate  $mergeMapping= 'array()'
Default valuearray()Details
Type
n/a
Propertyprivate  $merged= 'array()'
Default valuearray()Details
Type
n/a
Propertyprivate  $new_path= ''''
Default value''Details
Type
n/a
Propertyprivate  $original_path= ''''
Default value''Details
Type
n/a

Methods

methodpublicSugarMerge(  $new_path = '',  $original_path = '',  $custom_path = 'custom' ) : void

Parameters
Name Type Description
$new_path
$original_path
$custom_path
methodprotectedcreateHistoryLog( 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
  • name of the module
$customFile STRING
  • Path to the custom file that will be merged
$file STRING
  • name of the file
methodpublicgetCustomPath( ) : STRING

Return the custom modules path

Returns
Type Description
STRING directory where custom module files are located
methodpublicgetNewPath( ) : STRING

Return the new upgrade modules path

Returns
Type Description
STRING directory where new module files are located
methodpublicgetOriginalPath( ) : STRING

Return the original modules path

Returns
Type Description
STRING directory where new module files are located
methodpublicmergeAll( 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
methodpublicmergeFile( 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
  • name of the module
$file STRING
  • name of the file
$save STRING
  • should the merged file be saved to the custom directory
$logHistory
Returns
Type Description
BOOLEAN - success or failure of the merge
methodpublicmergeModule( 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
methodpublicsetLogFilePointer(  $fp ) : void

Parameters
Name Type Description
$fp
Documentation was generated by DocBlox 0.18.1.