Exemple #1
0
 /**
  * Get a trace reader for the specific file.
  * 
  * If the file has not been preprocessed yet this will be done first.
  *
  * @param string File to read
  * @param Cost format for the reader
  * @return Webgrind_Reader Reader for $file
  */
 public function getTraceReader($file, $costFormat)
 {
     $prepFile = Webgrind::$config->storageDir . '/' . $file . Webgrind::$config->preprocessedSuffix;
     try {
         $r = new Reader($prepFile, $costFormat);
     } catch (Exception $e) {
         // Preprocessed file does not exist or other error
         Preprocessor::parse(Webgrind::$config->xdebugOutputDir . '/' . $file, $prepFile);
         $r = new Reader($prepFile, $costFormat);
     }
     return $r;
 }