Changeset 183


Ignore:
Timestamp:
2006-09-19T02:30:08+02:00 (8 years ago)
Author:
moo
Message:

Coverager: use script if extension is not loaded or coverager is not compiled

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/coverager/coverager.php

    r174 r183  
    131131        } 
    132132 
    133         $xcache_version = XCACHE_VERSION; 
     133        $xcache_version = defined('XCACHE_VERSION') ? XCACHE_VERSION : ''; 
    134134        include("coverager.tpl.php"); 
    135135    } 
     
    310310    return implode('', $lines); 
    311311} 
     312if (!function_exists('xcache_coverager_decode')) { 
     313    function xcache_coverager_decode($bytes) 
     314    { 
     315        $bytes = unpack('l*', $bytes); 
     316        $i = 1; 
     317        if ($bytes[$i ++] != 0x564f4350) { 
     318            return null; 
     319        } 
     320        $end = count($bytes); 
     321        $cov = array(); 
     322        for (/* empty*/; $i <= $end; $i += 2) { 
     323            $cov[$bytes[$i]] = $bytes[$i + 1]; 
     324        } 
     325        return $cov; 
     326    } 
     327} 
    312328 
    313329$app = new XcacheCoverageViewer(); 
Note: See TracChangeset for help on using the changeset viewer.