public function log($nv_update_config, $content, $status)
{
global $client_info;
// Danh dau phien bat dau khoi tao
if (!isset($nv_update_config['updatelog']['starttime'])) {
$nv_update_config['updatelog']['starttime'] = NV_CURRENTTIME;
$this->set_data_log($nv_update_config['updatelog']);
}
$file_log = 'log-update-' . nv_date('H-i-s-d-m-Y', $nv_update_config['updatelog']['starttime']) . '-' . NV_CHECK_SESSION . '.log';
$time = nv_date('H:i:s_d-m-Y');
if (!is_array($content)) {
$content = array(0 => $content);
$status = array(0 => $status);
}
$contents = '';
foreach ($content as $key => $mess) {
$st = empty($status[$key]) ? 'FAILURE' : 'SUCCESS';
$contents .= $time . ' | ' . $client_info['ip'] . ' | ' . $mess . ' | ' . $st . "\n";
}
if (!file_exists(NV_ROOTDIR . '/' . NV_LOGS_DIR . '/data_logs/' . $file_log)) {
$contents = $this->lang['update_log_start'] . ': ' . $time . "\n" . $contents;
}
file_put_contents(NV_ROOTDIR . '/' . NV_LOGS_DIR . '/data_logs/' . $file_log, $contents, FILE_APPEND);
}