- create update.log on update in folder /install/
This commit is contained in:
@@ -414,13 +414,14 @@ if(isFroxlorVersion('0.9.4'))
|
||||
) {
|
||||
showUpdateStep("Updating awstats path setting");
|
||||
$db->query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `value` = '/usr/bin/' WHERE `settinggroup` = 'system' AND `varname` = 'awstats_path';");
|
||||
lastStepStatus(0);
|
||||
}
|
||||
else
|
||||
elseif(!isset($settings['system']['awstats_path']))
|
||||
{
|
||||
showUpdateStep("Adding new awstats path setting");
|
||||
$db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('system', 'awstats_path', '/usr/bin/');");
|
||||
}
|
||||
lastStepStatus(0);
|
||||
}
|
||||
|
||||
if(isset($settings['system']['awstats_domain_file'])
|
||||
&& $settings['system']['awstats_domain_file'] != ''
|
||||
|
||||
@@ -89,7 +89,12 @@ if(!isFroxlor())
|
||||
|
||||
if(isFroxlor())
|
||||
{
|
||||
$filelog = FileLogger::getInstanceOf(array('loginname' => 'updater'), $db, $settings);
|
||||
$filelog->setLogFile(makeCorrectFile(dirname(__FILE__).'update.log'));
|
||||
$filelog->logAction(ADM_ACTION, LOG_NOTICE, '-------------- START LOG --------------');
|
||||
include_once (makeCorrectFile(dirname(__FILE__).'/updates/froxlor/0.9/update_0.9.inc.php'));
|
||||
$filelog->logAction(ADM_ACTION, LOG_NOTICE, '--------------- END LOG ---------------');
|
||||
unset($filelog);
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
@@ -169,7 +169,7 @@ class FileLogger extends AbstractLogger
|
||||
}
|
||||
}
|
||||
|
||||
private function setLogFile($filename = null)
|
||||
public function setLogFile($filename = null)
|
||||
{
|
||||
if($filename != null
|
||||
&& $filename != ''
|
||||
|
||||
@@ -115,7 +115,7 @@ function hasUpdates($to_check = null)
|
||||
*/
|
||||
function showUpdateStep($task = null, $needs_status = true)
|
||||
{
|
||||
global $updatelog;
|
||||
global $updatelog, $filelog;
|
||||
|
||||
// output
|
||||
echo $task;
|
||||
@@ -126,6 +126,7 @@ function showUpdateStep($task = null, $needs_status = true)
|
||||
}
|
||||
|
||||
$updatelog->logAction(ADM_ACTION, LOG_WARNING, $task);
|
||||
$filelog->logAction(ADM_ACTION, LOG_WARNING, $task);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -140,7 +141,7 @@ function showUpdateStep($task = null, $needs_status = true)
|
||||
*/
|
||||
function lastStepStatus($status = -1, $message = '')
|
||||
{
|
||||
global $updatelog;
|
||||
global $updatelog, $filelog;
|
||||
|
||||
switch($status)
|
||||
{
|
||||
@@ -164,8 +165,13 @@ function lastStepStatus($status = -1, $message = '')
|
||||
// output
|
||||
echo "<span style=\"margin-left: 5em; font-weight: bold; color: #".$status_color."\">".$status_sign."</span><br />";
|
||||
|
||||
if($status == -1)
|
||||
if($status == -1 || $status == 2)
|
||||
{
|
||||
$updatelog->logAction(ADM_ACTION, LOG_WARNING, 'Attention - last update task failed!!!');
|
||||
$filelog->logAction(ADM_ACTION, LOG_WARNING, 'Attention - last update task failed!!!');
|
||||
}
|
||||
elseif($status == 0 || $status == 1)
|
||||
{
|
||||
$filelog->logAction(ADM_ACTION, LOG_NOTICE, 'Success');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user