Changeset 240 for branches/1.0


Ignore:
Timestamp:
2006-10-11T07:42:41+02:00 (8 years ago)
Author:
moo
Message:

trunk->1.0: merged coverager

  • [184] fix tplcov
  • [176] leaked by outfilename (efree by zend_mm tho)
  • [175] remove double Content-Language
  • [174] avoid double slash
  • [173] make dir ended with dir sep
  • [172] DIRECTORY_SEPARATOR for coverager config example
Location:
branches/1.0
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/1.0/coverager.c

    r51 r240  
    234234            zend_hash_move_forward(XG(coverages)); 
    235235        } 
     236        efree(outfilename); 
    236237    } 
    237238 
  • branches/1.0/coverager/config.php.example

    r33 r240  
    1313function ob_filter_path_nicer($o) 
    1414{ 
    15     $o = str_replace("/home/", "{H}/", $o); 
     15    $sep = DIRECTORY_SEPARATOR; 
     16    $o = str_replace($_SERVER['DOCUMENT_ROOT'],  "{DOCROOT}$sep", $o); 
     17    $xcachedir = realpath(dirname(__FILE__) . "$sep..$sep"); 
     18    $o = str_replace($xcachedir . $sep, "{XCache}$sep", $o); 
     19    if ($sep == '/') { 
     20        $o = str_replace("/home/", "{H}/", $o); 
     21    } 
    1622    return $o; 
    1723} 
  • branches/1.0/coverager/coverager.php

    r33 r240  
    5858        $this->path = isset($_GET['path']) ? $_GET['path'] : ''; 
    5959        $this->path = preg_replace('!\.{2,}!', '.', $this->path); 
    60         $this->path = preg_replace('![\\\\/]{2,}!', '/', $this->path); 
     60        $qsep = preg_quote(DIRECTORY_SEPARATOR, '!'); 
     61        $this->path = preg_replace("![\\\\$qsep]{2,}!", DIRECTORY_SEPARATOR, $this->path); 
     62        $this->path = preg_replace("!$qsep$!", '', $this->path); 
    6163        if ($this->path == '/') { 
    6264            $this->path = ''; 
     
    114116            list($tplfile, $tpllines, $tplcov) = $this->loadTplCov($fileinfo['cov'], substr($this->outpath, $this->datadir_len)); 
    115117            if ($tplfile) { 
    116                 $tplcov = sprint_cov($tplinfo['tplcov'], $tpllines); 
     118                $tplcov = sprint_cov($tplcov, $tpllines); 
    117119                unset($tpllines); 
    118120            } 
  • branches/1.0/coverager/coverager.tpl.php

    r33 r240  
    22<html xmlns="http://www.w3.org/1999/xhtml"> 
    33<head> 
    4     <meta http-equiv="Content-Language" content="en-us" /> 
    54<?php 
    65echo <<<HEAD 
     
    6160    global $cycle; 
    6261    if ($info['files'] || $info['todos']) { 
     62        $srcdir .= DIRECTORY_SEPARATOR; 
    6363        $c = $cycle->next(); 
    6464        $srcdir_html = htmlspecialchars($srcdir); 
Note: See TracChangeset for help on using the changeset viewer.