예제 #1
0
 /**
  * parseLogFileData
  *
  * returns data from inside log file in array
  * if $data is array then grabs multiple files of data and
  * uses array_merge when log files are across multiple days / ranges
  *
  */
 public static function parseLogFileData($data, &$newDataArray)
 {
     //do some checks first
     if (!$data || $data == null || !isset($data)) {
         return false;
     }
     //loop through all data files and add them up here
     //data is a array of log files to parse, the depth being used for multiple days
     //for eg when we have a date range
     //log file data is then read from disk and parsed into newDataArray
     $contents = "";
     $loop = 0;
     //used to show log files that are being parsed
     //var_dump($data);
     foreach ($data as $dataKey => $logFileArray) {
         //now grab data from disk
         $contents = LoadUtility::getLogFileDataFromDisk($logFileArray);
         //merge results sequentially when more than one file is read in
         $newDataArray = array_merge($newDataArray, $contents);
     }
     //echo '<pre>';
     //print_r ($newDataArray);
     //echo '</pre>';
     //TODO: what if getLogFileDataFromDisk was false ? need to return false here
     return true;
 }