Skip to content

Commit

Permalink
Removed the option display output, useless
Browse files Browse the repository at this point in the history
  • Loading branch information
Emmanuel Dyan committed Dec 8, 2015
1 parent cacb5ae commit 4e55d93
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions src/System.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,22 @@ public function getLogger()
return $this->getEntryPoint()->getLogger();
}

/**
* Add a message to the array
* @param string $message
*/
public function addMessage($message)
{
$this->messages[] = $message;
}

/**
* Taken from fayebsg/sugarcrm-cli
* Repair and rebuild sugarcrm
* @param boolean $executeSql Launch the SQL queries
* @return array Messages
*/
public function repair($executeSql = false, $showOutput = false)
public function repair($executeSql = false)
{
// Config ang language
$sugarConfig = $this->getEntryPoint()->getApplication()->getSugarConfig();
Expand All @@ -88,15 +99,15 @@ public function repair($executeSql = false, $showOutput = false)
$message = preg_replace('#<(br\s*/?|/h3)>#i', PHP_EOL, $message);
$message = trim(strip_tags($message));
$message = preg_replace('#'.PHP_EOL.'{2,}#', PHP_EOL, $message);
$self->messages[] = trim($message);
$self->addMessage(trim($message));
return '';
});

// Repair and catch the output
require_once('include/utils/layout_utils.php');
$GLOBALS['mod_strings'] = return_module_language($currentLanguage, 'Administration');
$repair = new \RepairAndClear();
$repair->repairAndClearAll(array('clearAll'), array(translate('LBL_ALL_MODULES')), $executeSql, $showOutput);
$repair->repairAndClearAll(array('clearAll'), array(translate('LBL_ALL_MODULES')), $executeSql, true);
ob_end_flush();

//remove the js language files
Expand Down

0 comments on commit 4e55d93

Please sign in to comment.