Skip to content

Commit

Permalink
method_argument_space
Browse files Browse the repository at this point in the history
  • Loading branch information
Dillon-Brown committed Jan 25, 2019
1 parent cc23bbd commit 26fc406
Show file tree
Hide file tree
Showing 635 changed files with 3,400 additions and 3,405 deletions.
66 changes: 33 additions & 33 deletions ModuleInstall/ModuleInstaller.php
Original file line number Diff line number Diff line change
Expand Up @@ -219,9 +219,9 @@ function install($base_dir, $is_upgrade = false, $previous_version = '')
$this->rebuild_all(true);
require_once('modules/Administration/QuickRepairAndRebuild.php');
$rac = new RepairAndClear();
$rac->repairAndClearAll($selectedActions, $this->installed_modules,true, false);
$rac->repairAndClearAll($selectedActions, $this->installed_modules, true, false);
$this->rebuild_relationships();
UpdateSystemTabs('Add',$this->tab_modules);
UpdateSystemTabs('Add', $this->tab_modules);
//Clear out all the langauge cache files.
clearAllJsAndJsLangFilesWithoutOutput();
$cache_key = 'app_list_strings.'.$GLOBALS['current_language'];
Expand Down Expand Up @@ -342,7 +342,7 @@ function uninstall_copy()
*/
function uninstall_new_files($cp, $backup_path)
{
$zip_files = $this->dir_get_files($cp['from'],$cp['from']);
$zip_files = $this->dir_get_files($cp['from'], $cp['from']);
$backup_files = $this->dir_get_files($backup_path, $backup_path);
foreach ($zip_files as $k=>$v) {
//if it's not a backup then it is probably a new file but we'll check that it is not in the md5.files first
Expand Down Expand Up @@ -418,7 +418,7 @@ public function installExt($section, $extname, $module = '')
}
}
if (!empty($from)) {
copy_recursive($from , "$path/$target.php");
copy_recursive($from, "$path/$target.php");
}
}
}
Expand Down Expand Up @@ -575,10 +575,10 @@ public function enableExt($section, $extname, $module = '')
}
$disabled_path = $path.'/'.DISABLED_PATH;
if (file_exists("$disabled_path/$target.php")) {
rename("$disabled_path/$target.php", "$path/$target.php");
rename("$disabled_path/$target.php", "$path/$target.php");
}
if (!empty($from) && file_exists($disabled_path . '/'. basename($from))) {
rename($disabled_path.'/'. basename($from), $path . '/'. basename($from));
rename($disabled_path.'/'. basename($from), $path . '/'. basename($from));
}
}
}
Expand Down Expand Up @@ -804,7 +804,7 @@ function install_dashlets()
if (!file_exists($path)) {
mkdir_recursive($path, true);
}
copy_recursive($cp['from'] , $path);
copy_recursive($cp['from'], $path);
}
include('modules/Administration/RebuildDashlets.php');
}
Expand All @@ -830,7 +830,7 @@ function install_images()
{
if (isset($this->installdefs['image_dir'])) {
$this->log( translate('LBL_MI_IN_IMAGES') );
$this->copy_path($this->installdefs['image_dir'] , 'custom/themes');
$this->copy_path($this->installdefs['image_dir'], 'custom/themes');
}
}

Expand All @@ -845,7 +845,7 @@ function install_dcactions()
if (!file_exists($path)) {
mkdir_recursive($path, true);
}
copy_recursive($action['from'] , $path . '/'. $this->id_name . '.php');
copy_recursive($action['from'], $path . '/'. $this->id_name . '.php');
}
$this->rebuild_dashletcontainers();
}
Expand Down Expand Up @@ -876,14 +876,14 @@ function install_connectors()
if (isset($this->installdefs['connectors'])) {
foreach ($this->installdefs['connectors'] as $cp) {
$this->log(translate('LBL_MI_IN_CONNECTORS') . $cp['name']);
$dir = str_replace('_','/',$cp['name']);
$dir = str_replace('_', '/', $cp['name']);
$cp['connector'] = str_replace('<basepath>', $this->base_dir, $cp['connector']);
$source_path = 'custom/modules/Connectors/connectors/sources/' . $dir. '/';
$GLOBALS['log']->debug("Installing Connector " . $cp['name'] . "..." . $cp['connector'] );
if (!file_exists($source_path)) {
mkdir_recursive($source_path, true);
}
copy_recursive($cp['connector'] , $source_path);
copy_recursive($cp['connector'], $source_path);

//Install optional formatter code if it is specified
if (!empty($cp['formatter'])) {
Expand All @@ -892,7 +892,7 @@ function install_connectors()
if (!file_exists($formatter_path)) {
mkdir_recursive($formatter_path, true);
}
copy_recursive($cp['formatter'] , $formatter_path);
copy_recursive($cp['formatter'], $formatter_path);
}
}
require_once('include/connectors/utils/ConnectorUtils.php');
Expand All @@ -904,7 +904,7 @@ function uninstall_connectors()
if (isset($this->installdefs['connectors'])) {
foreach ($this->installdefs['connectors'] as $cp) {
$this->log(translate('LBL_MI_UN_CONNECTORS') . $cp['name']);
$dir = str_replace('_','/',$cp['name']);
$dir = str_replace('_', '/', $cp['name']);
$source_path = 'custom/modules/Connectors/connectors/sources/' . $dir;
$formatter_path = 'custom/modules/Connectors/connectors/formatters/' . $dir;
$GLOBALS['log']->debug('Unlink ' .$source_path);
Expand All @@ -927,7 +927,7 @@ function install_vardef($from, $to_module)
if (!file_exists($path)) {
mkdir_recursive($path, true);
}
copy_recursive($from , $path.'/'. basename($from));
copy_recursive($from, $path.'/'. basename($from));
}

function install_layoutdef($from, $to_module)
Expand All @@ -940,7 +940,7 @@ function install_layoutdef($from, $to_module)
if (!file_exists($path)) {
mkdir_recursive($path, true);
}
copy_recursive($from , $path.'/'. basename($from));
copy_recursive($from, $path.'/'. basename($from));
}

// Non-standard - needs special rebuild call
Expand Down Expand Up @@ -1074,10 +1074,10 @@ public function enable_languages()
}
$disabled_path = $path.'/'.DISABLED_PATH;
if (file_exists("$disabled_path/$target.php")) {
rename("$disabled_path/$target.php", "$path/$target.php");
rename("$disabled_path/$target.php", "$path/$target.php");
}
if (file_exists($disabled_path . '/'. basename($from))) {
rename($disabled_path.'/'. basename($from), $path . '/'. basename($from));
rename($disabled_path.'/'. basename($from), $path . '/'. basename($from));
}
}
$this->rebuild_languages($languages, $modules);
Expand Down Expand Up @@ -1420,7 +1420,7 @@ function install_relationship($file)
if (!$this->silent) {
$GLOBALS['log']->debug("Processing relationship meta for ". $rel_name."...");
}
SugarBean::createRelationshipMeta($rel_name, $this->db,$table,$rel_dictionary,'');
SugarBean::createRelationshipMeta($rel_name, $this->db, $table, $rel_dictionary, '');
Relationship::delete_cache();
if (!$this->silent) {
$GLOBALS['log']->debug( 'done<br>');
Expand Down Expand Up @@ -1469,7 +1469,7 @@ function uninstall_relationship($file, $rel_dictionary = null)
}

if ($this->db->tableExists($table) && isset($GLOBALS['mi_remove_tables']) && $GLOBALS['mi_remove_tables']) {
SugarBean::removeRelationshipMeta($rel_name, $this->db,$table,$rel_dictionary,'');
SugarBean::removeRelationshipMeta($rel_name, $this->db, $table, $rel_dictionary, '');
$this->db->dropTableName($table);
if (!$this->silent) {
$this->log( translate('LBL_MI_UN_RELATIONSHIPS_DROP') . $table);
Expand Down Expand Up @@ -1721,7 +1721,7 @@ function uninstall($base_dir)
echo '</div>';
}

UpdateSystemTabs('Restore',$installed_modules);
UpdateSystemTabs('Restore', $installed_modules);

//clear the unified_search_module.php file
require_once('modules/Home/UnifiedSearchAdvanced.php');
Expand Down Expand Up @@ -1849,13 +1849,13 @@ function merge_files($path, $name, $filter = '', $application = false)
} else {
$file = file_get_contents($module_install . '/' . $entry);
$GLOBALS['log']->debug(get_class($this)."->merge_files(): found {$module_install}{$entry}") ;
$extension .= "\n". str_replace(array('<?php', '?>', '<?PHP', '<?'), array('','', '' ,'') , $file);
$extension .= "\n". str_replace(array('<?php', '?>', '<?PHP', '<?'), array('','', '' ,''), $file);
}
}
}
foreach ($override as $entry) {
$file = file_get_contents($module_install . '/' . $entry);
$extension .= "\n". str_replace(array('<?php', '?>', '<?PHP', '<?'), array('','', '' ,'') , $file);
$extension .= "\n". str_replace(array('<?php', '?>', '<?PHP', '<?'), array('','', '' ,''), $file);
}
}
$extension .= "\n?>";
Expand All @@ -1865,7 +1865,7 @@ function merge_files($path, $name, $filter = '', $application = false)
mkdir_recursive("custom/$extpath", true);
}
$out = sugar_fopen("custom/$extpath/$name", 'w');
fwrite($out,$extension);
fwrite($out, $extension);
fclose($out);
} else {
if (file_exists("custom/$extpath/$name")) {
Expand All @@ -1888,7 +1888,7 @@ function merge_files($path, $name, $filter = '', $application = false)
if ((empty($filter) || substr_count($entry, $filter) > 0) && is_file($module_install.'/'.$entry)
&& $entry != '.' && $entry != '..' && strtolower(substr($entry, -4)) == ".php") {
$file = file_get_contents($module_install . '/' . $entry);
$extension .= "\n". str_replace(array('<?php', '?>', '<?PHP', '<?'), array('','', '' ,'') , $file);
$extension .= "\n". str_replace(array('<?php', '?>', '<?PHP', '<?'), array('','', '' ,''), $file);
}
}
}
Expand All @@ -1898,7 +1898,7 @@ function merge_files($path, $name, $filter = '', $application = false)
mkdir_recursive("custom/$extpath", true);
}
$out = sugar_fopen("custom/$extpath/$name", 'w');
fwrite($out,$extension);
fwrite($out, $extension);
fclose($out);
} else {
if (file_exists("custom/$extpath/$name")) {
Expand Down Expand Up @@ -1962,7 +1962,7 @@ function install_beans($beans)
if (is_subclass_of($mod, 'SugarBean') && $mod->disable_vardefs == false ) {
$GLOBALS['log']->debug( "Creating Tables Bean : $bean");
$mod->create_tables();
SugarBean::createRelationshipMeta($mod->getObjectName(), $mod->db,$mod->table_name,array(),$mod->module_dir);
SugarBean::createRelationshipMeta($mod->getObjectName(), $mod->db, $mod->table_name, array(), $mod->module_dir);
}
} else {
$GLOBALS['log']->debug( "File Does Not Exist:" . $beanFiles[$class] );
Expand Down Expand Up @@ -2099,7 +2099,7 @@ private function dir_get_files($path, $base_path)
continue;
}
if (is_file($path . '/' . $e)) {
$files[str_replace($base_path , '', $path . '/' . $e)] = str_replace($base_path , '', $path . '/' . $e);
$files[str_replace($base_path, '', $path . '/' . $e)] = str_replace($base_path, '', $path . '/' . $e);
}
if (is_dir($path . '/' . $e)) {
$files = array_merge($files, $this->dir_get_files($path . '/' . $e, $base_path));
Expand Down Expand Up @@ -2186,7 +2186,7 @@ function addFieldsToLayout($layoutAdditions)
$invalidModules = array ( 'emails' , 'kbdocuments' ) ;

foreach ( $layoutAdditions as $deployedModuleName => $fieldName ) {
if ( ! in_array( strtolower ( $deployedModuleName ) , $invalidModules ) ) {
if ( ! in_array( strtolower ( $deployedModuleName ), $invalidModules ) ) {
foreach ( array ( MB_EDITVIEW , MB_DETAILVIEW ) as $view ) {
$GLOBALS [ 'log' ]->debug ( get_class ( $this ) . ": adding $fieldName to $view layout for module $deployedModuleName" ) ;
$parser = new GridLayoutMetaDataParser ( $view, $deployedModuleName ) ;
Expand All @@ -2207,7 +2207,7 @@ function removeFieldsFromLayout($layoutAdditions)
$invalidModules = array ( 'emails' , 'kbdocuments' ) ;

foreach ( $layoutAdditions as $deployedModuleName => $fieldName ) {
if ( ! in_array( strtolower ( $deployedModuleName ) , $invalidModules ) ) {
if ( ! in_array( strtolower ( $deployedModuleName ), $invalidModules ) ) {
foreach ( array ( MB_EDITVIEW , MB_DETAILVIEW ) as $view ) {
$GLOBALS [ 'log' ]->debug ( get_class ( $this ) . ": adding $fieldName to $view layout for module $deployedModuleName" ) ;
$parser = new GridLayoutMetaDataParser ( $view, $deployedModuleName ) ;
Expand Down Expand Up @@ -2284,7 +2284,7 @@ function enable($base_dir, $is_upgrade = false, $previous_version = '')
update_progress_bar('install', $current_step, $total_steps);
echo '</div>';
}
UpdateSystemTabs('Add',$installed_modules);
UpdateSystemTabs('Add', $installed_modules);
$GLOBALS['log']->debug('Complete');
} else {
die("No \$installdefs Defined In $this->base_dir/manifest.php");
Expand Down Expand Up @@ -2338,7 +2338,7 @@ function disable($base_dir)
update_progress_bar('install', $current_step, $total_steps);
echo '</div>';
}
UpdateSystemTabs('Restore',$installed_modules);
UpdateSystemTabs('Restore', $installed_modules);
} else {
die("No manifest.php Defined In $this->base_dir/manifest.php");
}
Expand Down Expand Up @@ -2394,7 +2394,7 @@ function disable_relationships($action = 'disable')
if (isset($this->installdefs['relationships'])) {
foreach ($this->installdefs['relationships'] as $relationship) {
$filename = basename($relationship['meta_data']);
$relName = substr($filename, -12) == "MetaData.php" ? substr($filename,0,strlen($filename) - 12) : "";
$relName = substr($filename, -12) == "MetaData.php" ? substr($filename, 0, strlen($filename) - 12) : "";
if (empty($relationship['module']) && empty($relName)) {
continue;
}
Expand Down Expand Up @@ -2442,7 +2442,7 @@ function enable_dashlets()
$disabled_path = 'custom/modules/Home/'.DISABLED_PATH.'Dashlets/' . $cp['name'];
$GLOBALS['log']->debug("Enabling Dashlet " . $cp['name'] . "..." . $cp['from'] );
if (file_exists($disabled_path)) {
rename($disabled_path, $path);
rename($disabled_path, $path);
}
}
include('modules/Administration/RebuildDashlets.php');
Expand Down
2 changes: 1 addition & 1 deletion ModuleInstall/PackageManager/PackageController.php
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ function download()
$GLOBALS['log']->debug("CATEGORY ID: ".$category_id);
$GLOBALS['log']->debug("RELEASE ID: ".$release_id);
$result = $this->_pm->download($category_id, $package_id, $release_id);
$GLOBALS['log']->debug("RESULT: ".print_r($result,true));
$GLOBALS['log']->debug("RESULT: ".print_r($result, true));
$success = 'false';
if ($result != null) {
$GLOBALS['log']->debug("Performing Setup");
Expand Down
Loading

0 comments on commit 26fc406

Please sign in to comment.