svn: /pear2/Pyrus_Developer/trunk/src/Pyrus/Developer/CoverageAnalyzer/ Sqlite.php

From: Date: Sun, 05 Sep 2010 13:32:31 +0000
Subject: svn: /pear2/Pyrus_Developer/trunk/src/Pyrus/Developer/CoverageAnalyzer/ Sqlite.php
Groups: php.pear.cvs php.pear.core 
Request: Send a blank email to pear-cvs+get-60252@lists.php.net to get a copy of this message
saltybeagle Sun, 05 Sep 2010 13:32:31 +0000 Revision: http://svn.php.net/viewvc?view=revision&revision=303054 Log: When adding files with no coverage, fatal errors may occur due to dependencies on external classes which are not defined. In this instance, fake the class definition. Changed paths: U pear2/Pyrus_Developer/trunk/src/Pyrus/Developer/CoverageAnalyzer/Sqlite.php Modified: pear2/Pyrus_Developer/trunk/src/Pyrus/Developer/CoverageAnalyzer/Sqlite.php =================================================================== --- pear2/Pyrus_Developer/trunk/src/Pyrus/Developer/CoverageAnalyzer/Sqlite.php 2010-09-05 12:29:47 UTC (rev 303053) +++ pear2/Pyrus_Developer/trunk/src/Pyrus/Developer/CoverageAnalyzer/Sqlite.php 2010-09-05 13:32:31 UTC (rev 303054) @@ -2,19 +2,20 @@ namespace PEAR2\Pyrus\Developer\CoverageAnalyzer; class Sqlite { - protected $db; - protected $totallines = 0; - protected $coveredlines = 0; - protected $deadlines = 0; - protected $pathCovered = array(); - protected $pathTotal = array(); - protected $pathDead = array(); public $codepath; public $testpath; + protected $db; + protected $totallines = 0; + protected $coveredlines = 0; + protected $deadlines = 0; + protected $pathCovered = array(); + protected $pathTotal = array(); + protected $pathDead = array(); + private $statement; - private $lines = array(); - private $files = array(); + private $lines = array(); + private $files = array(); private $deleted = array(); const COVERAGE_COVERED = 1; @@ -712,7 +713,12 @@ include $file; return true; } - return false; + $fake_class = '<?php class '.$class.' {}'; + $fake_class_file = tempnam(sys_get_temp_dir(), 'pyrus_tmp'); + file_put_contents($fake_class_file, $fake_class); + include $fake_class_file; + unlink($fake_class_file); + return true; }); foreach ($this->files as $file) {

« previous php.pear.cvs (#60252) next »