Exemple #1
0
 /**
  * Cleans and returns a line. Removes php tag added to make highlight-string
  * work
  * 
  * @param unknown_type $traceline
  * @param unknown_type $relativePosition
  * @param unknown_type $style
  * @return Ambigous <string, mixed>
  */
 protected function getLine($traceline, $relativePosition, $style = 'normal')
 {
     $line = new \Text_Template($this->templateDir() . '/Line.html.dist');
     $code = str_replace(array('<span style="color: #0000BB">&lt;?php&nbsp;</span>', '<code>', '</code>'), '', highlight_string('<?php ' . Backtrace::readLine($traceline['file'], $traceline['line'] + $relativePosition), true));
     $code = preg_replace('/\\n/', '', $code);
     $code = preg_replace('/<span style="color: #0000BB">&lt;\\?php&nbsp;(.*)(<\\/span>+?)/', '$1', $code);
     $line->setVar(array('line' => $traceline['line'] + $relativePosition, 'class' => $style, 'code' => ' ' . $code));
     return $line->render();
 }
Exemple #2
0
 /**
  * Cleans and returns a line. Removes php tag added to make
  * highlight-string work
  * 
  * @param array   $traceline
  * @param integer $relativePosition
  * @param string  $style
  * @return string
  */
 protected function getLine($traceline, $relativePosition, $style = 'normal')
 {
     $code = Backtrace::readLine($traceline['file'], $traceline['line'] + $relativePosition);
     return '    ' . $code . PHP_EOL;
 }