コード例 #1
0
ファイル: serverdatafunctions.php プロジェクト: kanbang/Colt
function LoadLogFileTable(&$targetTable, $firstIndex, $lastIndex, $serverAdmin, $targetLogType)
{
    $allLogs = GetAllLogFiles($serverAdmin);
    $logFiles = GetLogFiles($serverAdmin, $targetLogType);
    // Load the table
    $targetTable = array();
    for ($i = $firstIndex; $i <= $lastIndex; $i++) {
        $logFileName = $logFiles[$i];
        $targetTable[$logFileName] = $allLogs[$logFileName];
    }
}
コード例 #2
0
ファイル: logmanagement.php プロジェクト: kanbang/Colt
        $serverAdmin->DeleteLog($selectedItem);
        $confirmationMsg = sprintf($confSuccessfulDeletion, $selectedItem);
    }
} catch (MgException $e) {
    CheckForFatalMgException($e);
    $errorMsg = $e->GetExceptionMessage();
} catch (Exception $e) {
    $errorMsg = $e->getMessage();
}
// Load display data
try {
    if (!$serverRec->poweredUp) {
        throw new Exception(sprintf($errServerIsDown, $selectedServer));
    }
    if ($selectedLog != ACTIVE_LOGS) {
        $logFiles = GetLogFiles($serverAdmin, $selectedLog);
        $numLogFiles = count($logFiles);
        $currPage = GetPageNumber($logFiles, $selectedItem, $pageSize);
        GetPageRange($currPage, $numLogFiles, $pageSize, $firstPageIndex, $lastPageIndex);
        LoadLogFileTable($logFilesTable, $firstPageIndex, $lastPageIndex, $serverAdmin, $selectedLog);
        if (!array_key_exists($selectedItem, $logFilesTable) && $numLogFiles > 0) {
            $selectedItem = $logFiles[$firstPageIndex];
        }
    }
    $serverAdmin->Close();
} catch (MgException $e) {
    CheckForFatalMgException($e);
    if (empty($errorMsg)) {
        $errorMsg = $e->GetExceptionMessage();
    }
} catch (Exception $e) {