ofs | hex dump | ascii |
---|
0000 | 3c 3f 70 68 70 0a 66 75 6e 63 74 69 6f 6e 20 5f 5f 61 75 74 6f 6c 6f 61 64 28 24 63 6c 61 73 73 | <?php.function.__autoload($class |
0020 | 29 0a 7b 0a 20 20 20 20 24 63 6c 61 73 73 20 3d 20 73 74 72 5f 72 65 70 6c 61 63 65 28 22 50 45 | ).{.....$class.=.str_replace("PE |
0040 | 41 52 32 5c 50 79 72 75 73 5c 44 65 76 65 6c 6f 70 65 72 5c 43 6f 76 65 72 61 67 65 41 6e 61 6c | AR2\Pyrus\Developer\CoverageAnal |
0060 | 79 7a 65 72 22 2c 20 22 22 2c 20 24 63 6c 61 73 73 29 3b 0a 20 20 20 20 69 6e 63 6c 75 64 65 20 | yzer",."",.$class);.....include. |
0080 | 22 70 68 61 72 3a 2f 2f 22 20 2e 20 5f 5f 46 49 4c 45 5f 5f 20 2e 20 22 2f 22 20 2e 20 73 74 72 | "phar://"...__FILE__..."/"...str |
00a0 | 5f 72 65 70 6c 61 63 65 28 22 5c 5c 22 2c 20 22 2f 22 2c 20 24 63 6c 61 73 73 29 20 2e 20 22 2e | _replace("\\",."/",.$class)...". |
00c0 | 70 68 70 22 3b 0a 7d 0a 50 68 61 72 3a 3a 77 65 62 50 68 61 72 28 22 70 65 61 72 32 63 6f 76 65 | php";.}.Phar::webPhar("pear2cove |
00e0 | 72 61 67 65 2e 70 68 61 72 2e 70 68 70 22 29 3b 0a 65 63 68 6f 20 22 54 68 69 73 20 70 68 61 72 | rage.phar.php");.echo."This.phar |
0100 | 20 69 73 20 61 20 77 65 62 20 61 70 70 6c 69 63 61 74 69 6f 6e 2c 20 72 75 6e 20 77 69 74 68 69 | .is.a.web.application,.run.withi |
0120 | 6e 20 79 6f 75 72 20 77 65 62 20 62 72 6f 77 73 65 72 20 74 6f 20 75 73 65 5c 6e 22 3b 0a 65 78 | n.your.web.browser.to.use\n";.ex |
0140 | 69 74 20 2d 31 3b 0a 5f 5f 48 41 4c 54 5f 43 4f 4d 50 49 4c 45 52 28 29 3b 20 3f 3e 0d 0a bd 01 | it.-1;.__HALT_COMPILER();.?>.... |
0160 | 00 00 0a 00 00 00 11 00 00 00 01 00 00 00 00 00 00 00 00 00 12 00 00 00 57 65 62 2f 43 6f 6e 74 | ........................Web/Cont |
0180 | 72 6f 6c 6c 65 72 2e 70 68 70 93 09 00 00 9b 30 e2 49 93 09 00 00 ba 8e 9e d5 b6 01 00 00 00 00 | roller.php.....0.I.............. |
01a0 | 00 00 0c 00 00 00 57 65 62 2f 56 69 65 77 2e 70 68 70 53 3a 00 00 9b 30 e2 49 53 3a 00 00 4c 65 | ......Web/View.phpS:...0.IS:..Le |
01c0 | 04 16 b6 01 00 00 00 00 00 00 12 00 00 00 57 65 62 2f 41 67 67 72 65 67 61 74 6f 72 2e 70 68 70 | ..............Web/Aggregator.php |
01e0 | 10 13 00 00 9b 30 e2 49 10 13 00 00 dd ba 2e 62 b6 01 00 00 00 00 00 00 11 00 00 00 57 65 62 2f | .....0.I.......b............Web/ |
0200 | 45 78 63 65 70 74 69 6f 6e 2e 70 68 70 68 00 00 00 9b 30 e2 49 68 00 00 00 05 1c 70 5a b6 01 00 | Exception.phph....0.Ih.....pZ... |
0220 | 00 00 00 00 00 0e 00 00 00 53 6f 75 72 63 65 46 69 6c 65 2e 70 68 70 3a 08 00 00 9b 30 e2 49 3a | .........SourceFile.php:....0.I: |
0240 | 08 00 00 7e 97 88 30 b6 01 00 00 00 00 00 00 0e 00 00 00 41 67 67 72 65 67 61 74 6f 72 2e 70 68 | ...~..0............Aggregator.ph |
0260 | 70 ac 16 00 00 9b 30 e2 49 ac 16 00 00 f6 33 6e 5c b6 01 00 00 00 00 00 00 0d 00 00 00 45 78 63 | p.....0.I.....3n\............Exc |
0280 | 65 70 74 69 6f 6e 2e 70 68 70 64 00 00 00 9b 30 e2 49 64 00 00 00 40 0d 95 94 b6 01 00 00 00 00 | eption.phpd....0.Id...@......... |
02a0 | 00 00 0a 00 00 00 53 71 6c 69 74 65 2e 70 68 70 30 58 00 00 9b 30 e2 49 30 58 00 00 b1 7b f7 2c | ......Sqlite.php0X...0.I0X...{., |
02c0 | b6 01 00 00 00 00 00 00 16 00 00 00 53 6f 75 72 63 65 46 69 6c 65 2f 50 65 72 54 65 73 74 2e 70 | ............SourceFile/PerTest.p |
02e0 | 68 70 85 04 00 00 9b 30 e2 49 85 04 00 00 f3 bd a4 52 b6 01 00 00 00 00 00 00 09 00 00 00 69 6e | hp.....0.I.......R............in |
0300 | 64 65 78 2e 70 68 70 46 01 00 00 9b 30 e2 49 46 01 00 00 6b 21 c2 5f b6 01 00 00 00 00 00 00 3c | dex.phpF....0.IF...k!._........< |
0320 | 3f 70 68 70 0a 6e 61 6d 65 73 70 61 63 65 20 50 45 41 52 32 5c 50 79 72 75 73 5c 44 65 76 65 6c | ?php.namespace.PEAR2\Pyrus\Devel |
0340 | 6f 70 65 72 5c 43 6f 76 65 72 61 67 65 41 6e 61 6c 79 7a 65 72 5c 57 65 62 20 7b 0a 75 73 65 20 | oper\CoverageAnalyzer\Web.{.use. |
0360 | 50 45 41 52 32 5c 50 79 72 75 73 5c 44 65 76 65 6c 6f 70 65 72 5c 43 6f 76 65 72 61 67 65 41 6e | PEAR2\Pyrus\Developer\CoverageAn |
0380 | 61 6c 79 7a 65 72 5c 53 71 6c 69 74 65 3b 0a 63 6c 61 73 73 20 43 6f 6e 74 72 6f 6c 6c 65 72 20 | alyzer\Sqlite;.class.Controller. |
03a0 | 7b 0a 20 20 20 20 70 72 6f 74 65 63 74 65 64 20 24 76 69 65 77 3b 0a 20 20 20 20 70 72 6f 74 65 | {.....protected.$view;.....prote |
03c0 | 63 74 65 64 20 24 73 71 6c 69 74 65 3b 0a 20 20 20 20 70 72 6f 74 65 63 74 65 64 20 24 72 6f 6f | cted.$sqlite;.....protected.$roo |
03e0 | 74 75 72 6c 3b 0a 0a 20 20 20 20 66 75 6e 63 74 69 6f 6e 20 5f 5f 63 6f 6e 73 74 72 75 63 74 28 | turl;......function.__construct( |
0400 | 56 69 65 77 20 24 76 69 65 77 2c 20 24 72 6f 6f 74 75 72 6c 29 0a 20 20 20 20 7b 0a 20 20 20 20 | View.$view,.$rooturl).....{..... |
0420 | 20 20 20 20 24 74 68 69 73 2d 3e 76 69 65 77 20 3d 20 24 76 69 65 77 3b 0a 20 20 20 20 20 20 20 | ....$this->view.=.$view;........ |
0440 | 20 24 76 69 65 77 2d 3e 73 65 74 43 6f 6e 74 72 6f 6c 6c 65 72 28 24 74 68 69 73 29 3b 0a 20 20 | .$view->setController($this);... |
0460 | 20 20 20 20 20 20 24 74 68 69 73 2d 3e 72 6f 6f 74 75 72 6c 20 3d 20 24 72 6f 6f 74 75 72 6c 3b | ......$this->rooturl.=.$rooturl; |
0480 | 0a 20 20 20 20 7d 0a 0a 20 20 20 20 66 75 6e 63 74 69 6f 6e 20 72 6f 75 74 65 28 29 0a 20 20 20 | .....}......function.route().... |
04a0 | 20 7b 0a 20 20 20 20 20 20 20 20 69 66 20 28 21 69 73 73 65 74 28 24 5f 53 45 53 53 49 4f 4e 5b | .{.........if.(!isset($_SESSION[ |
04c0 | 27 66 75 6c 6c 70 61 74 68 27 5d 29 29 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 | 'fullpath'])).{.............if.( |
04e0 | 69 73 73 65 74 28 24 5f 50 4f 53 54 5b 27 73 65 74 64 61 74 61 62 61 73 65 27 5d 29 29 20 7b 0a | isset($_POST['setdatabase'])).{. |
0500 | 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 66 69 6c 65 5f 65 78 69 73 74 73 28 | ................if.(file_exists( |
0520 | 24 5f 50 4f 53 54 5b 27 73 65 74 64 61 74 61 62 61 73 65 27 5d 29 29 20 7b 0a 20 20 20 20 20 20 | $_POST['setdatabase'])).{....... |
0540 | 20 20 20 20 20 20 20 20 20 20 20 20 20 20 24 74 68 69 73 2d 3e 73 71 6c 69 74 65 20 3d 20 6e 65 | ..............$this->sqlite.=.ne |
0560 | 77 20 5c 53 71 6c 69 74 65 33 28 24 5f 50 4f 53 54 5b 27 73 65 74 64 61 74 61 62 61 73 65 27 5d | w.\Sqlite3($_POST['setdatabase'] |
0580 | 29 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 24 5f 53 45 53 53 49 4f 4e | );.....................$_SESSION |
05a0 | 5b 27 66 75 6c 6c 70 61 74 68 27 5d 20 3d 20 24 5f 50 4f 53 54 5b 27 73 65 74 64 61 74 61 62 61 | ['fullpath'].=.$_POST['setdataba |
05c0 | 73 65 27 5d 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e | se'];.....................return |
05e0 | 20 24 74 68 69 73 2d 3e 76 69 65 77 2d 3e 54 4f 43 28 24 74 68 69 73 2d 3e 73 71 6c 69 74 65 29 | .$this->view->TOC($this->sqlite) |
0600 | 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7d 0a 20 20 20 20 20 20 20 20 20 20 20 20 | ;.................}............. |
0620 | 7d 0a 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 24 74 68 69 73 2d 3e 67 65 74 44 | }.............return.$this->getD |
0640 | 61 74 61 62 61 73 65 28 29 3b 0a 20 20 20 20 20 20 20 20 7d 20 65 6c 73 65 20 7b 0a 20 20 20 20 | atabase();.........}.else.{..... |
0660 | 20 20 20 20 20 20 20 20 24 74 68 69 73 2d 3e 73 71 6c 69 74 65 20 3d 20 6e 65 77 20 5c 53 71 6c | ........$this->sqlite.=.new.\Sql |
0680 | 69 74 65 33 28 24 5f 50 4f 53 54 5b 27 73 65 74 64 61 74 61 62 61 73 65 27 5d 29 3b 0a 20 20 20 | ite3($_POST['setdatabase']);.... |
06a0 | 20 20 20 20 20 20 20 20 20 69 66 20 28 69 73 73 65 74 28 24 5f 47 45 54 5b 27 74 65 73 74 27 5d | .........if.(isset($_GET['test'] |
06c0 | 29 29 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 24 5f 47 45 54 5b 27 | )).{.................if.($_GET[' |
06e0 | 74 65 73 74 27 5d 20 3d 3d 3d 20 27 54 4f 43 27 29 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 | test'].===.'TOC').{............. |
0700 | 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 24 74 68 69 73 2d 3e 76 69 65 77 2d 3e 74 65 73 74 | ........return.$this->view->test |
0720 | 54 4f 43 28 24 74 68 69 73 2d 3e 73 71 6c 69 74 65 29 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 | TOC($this->sqlite);............. |
0740 | 20 20 20 20 7d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 69 73 73 65 74 28 | ....}.................if.(isset( |
0760 | 24 5f 47 45 54 5b 27 66 69 6c 65 27 5d 29 29 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | $_GET['file'])).{............... |
0780 | 20 20 20 20 20 20 72 65 74 75 72 6e 20 24 74 68 69 73 2d 3e 76 69 65 77 2d 3e 66 69 6c 65 43 6f | ......return.$this->view->fileCo |
07a0 | 76 65 72 61 67 65 28 24 74 68 69 73 2d 3e 73 71 6c 69 74 65 2c 20 24 5f 47 45 54 5b 27 66 69 6c | verage($this->sqlite,.$_GET['fil |
07c0 | 65 27 5d 2c 20 24 5f 47 45 54 5b 27 74 65 73 74 27 5d 29 3b 0a 20 20 20 20 20 20 20 20 20 20 20 | e'],.$_GET['test']);............ |
07e0 | 20 20 20 20 20 7d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 24 74 | .....}.................return.$t |
0800 | 68 69 73 2d 3e 76 69 65 77 2d 3e 74 65 73 74 54 4f 43 28 24 74 68 69 73 2d 3e 73 71 6c 69 74 65 | his->view->testTOC($this->sqlite |
0820 | 2c 20 24 5f 47 45 54 5b 27 74 65 73 74 27 5d 29 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0a | ,.$_GET['test']);.............}. |
0840 | 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 69 73 73 65 74 28 24 5f 47 45 54 5b 27 66 69 6c | ............if.(isset($_GET['fil |
0860 | 65 27 5d 29 29 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 69 73 73 65 | e'])).{.................if.(isse |
0880 | 74 28 24 5f 47 45 54 5b 27 6c 69 6e 65 27 5d 29 29 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 | t($_GET['line'])).{............. |
08a0 | 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 24 74 68 69 73 2d 3e 76 69 65 77 2d 3e 66 69 6c 65 | ........return.$this->view->file |
08c0 | 4c 69 6e 65 54 4f 43 28 24 74 68 69 73 2d 3e 73 71 6c 69 74 65 2c 20 24 5f 47 45 54 5b 27 66 69 | LineTOC($this->sqlite,.$_GET['fi |
08e0 | 6c 65 27 5d 2c 20 24 5f 47 45 54 5b 27 6c 69 6e 65 27 5d 29 3b 0a 20 20 20 20 20 20 20 20 20 20 | le'],.$_GET['line']);........... |
0900 | 20 20 20 20 20 20 7d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 24 | ......}.................return.$ |
0920 | 74 68 69 73 2d 3e 76 69 65 77 2d 3e 66 69 6c 65 43 6f 76 65 72 61 67 65 28 24 74 68 69 73 2d 3e | this->view->fileCoverage($this-> |
0940 | 73 71 6c 69 74 65 2c 20 24 5f 47 45 54 5b 27 66 69 6c 65 27 5d 29 3b 0a 20 20 20 20 20 20 20 20 | sqlite,.$_GET['file']);......... |
0960 | 20 20 20 20 7d 0a 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 24 74 68 69 73 2d 3e | ....}.............return.$this-> |
0980 | 76 69 65 77 2d 3e 54 4f 43 28 24 74 68 69 73 2d 3e 73 71 6c 69 74 65 29 3b 0a 20 20 20 20 20 20 | view->TOC($this->sqlite);....... |
09a0 | 20 20 7d 0a 20 20 20 20 7d 0a 0a 20 20 20 20 66 75 6e 63 74 69 6f 6e 20 67 65 74 46 69 6c 65 4c | ..}.....}......function.getFileL |
09c0 | 69 6e 6b 28 24 66 69 6c 65 2c 20 24 74 65 73 74 20 3d 20 6e 75 6c 6c 2c 20 24 6c 69 6e 65 20 3d | ink($file,.$test.=.null,.$line.= |
09e0 | 20 6e 75 6c 6c 29 0a 20 20 20 20 7b 0a 20 20 20 20 20 20 20 20 69 66 20 28 24 6c 69 6e 65 29 20 | .null).....{.........if.($line). |
0a00 | 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 24 74 68 69 73 2d 3e 72 6f 6f 74 | {.............return.$this->root |
0a20 | 75 72 6c 20 2e 20 27 3f 66 69 6c 65 3d 27 20 2e 20 75 72 6c 65 6e 63 6f 64 65 28 24 66 69 6c 65 | url...'?file='...urlencode($file |
0a40 | 29 20 2e 20 27 26 6c 69 6e 65 3d 27 20 2e 20 24 6c 69 6e 65 3b 0a 20 20 20 20 20 20 20 20 7d 0a | )...'&line='...$line;.........}. |
0a60 | 20 20 20 20 20 20 20 20 69 66 20 28 24 74 65 73 74 29 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 | ........if.($test).{............ |
0a80 | 20 72 65 74 75 72 6e 20 24 74 68 69 73 2d 3e 72 6f 6f 74 75 72 6c 20 2e 20 27 3f 66 69 6c 65 3d | .return.$this->rooturl...'?file= |
0aa0 | 27 20 2e 20 75 72 6c 65 6e 63 6f 64 65 28 24 66 69 6c 65 29 20 2e 20 27 26 74 65 73 74 3d 27 20 | '...urlencode($file)...'&test='. |
0ac0 | 2e 20 24 74 65 73 74 3b 0a 20 20 20 20 20 20 20 20 7d 0a 20 20 20 20 20 20 20 20 72 65 74 75 72 | ..$test;.........}.........retur |
0ae0 | 6e 20 24 74 68 69 73 2d 3e 72 6f 6f 74 75 72 6c 20 2e 20 27 3f 66 69 6c 65 3d 27 20 2e 20 75 72 | n.$this->rooturl...'?file='...ur |
0b00 | 6c 65 6e 63 6f 64 65 28 24 66 69 6c 65 29 3b 0a 20 20 20 20 7d 0a 0a 20 20 20 20 66 75 6e 63 74 | lencode($file);.....}......funct |
0b20 | 69 6f 6e 20 67 65 74 54 4f 43 4c 69 6e 6b 28 24 74 65 73 74 20 3d 20 66 61 6c 73 65 29 0a 20 20 | ion.getTOCLink($test.=.false)... |
0b40 | 20 20 7b 0a 20 20 20 20 20 20 20 20 69 66 20 28 24 74 65 73 74 20 3d 3d 3d 20 66 61 6c 73 65 29 | ..{.........if.($test.===.false) |
0b60 | 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 24 74 68 69 73 2d 3e 72 6f 6f | .{.............return.$this->roo |
0b80 | 74 75 72 6c 3b 0a 20 20 20 20 20 20 20 20 7d 0a 20 20 20 20 20 20 20 20 69 66 20 28 24 74 65 73 | turl;.........}.........if.($tes |
0ba0 | 74 20 3d 3d 3d 20 74 72 75 65 29 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e | t.===.true).{.............return |
0bc0 | 20 24 74 68 69 73 2d 3e 72 6f 6f 74 75 72 6c 20 2e 20 27 3f 74 65 73 74 3d 54 4f 43 27 3b 0a 20 | .$this->rooturl...'?test=TOC';.. |
0be0 | 20 20 20 20 20 20 20 7d 0a 20 20 20 20 20 20 20 20 69 66 20 28 24 74 65 73 74 29 20 7b 0a 20 20 | .......}.........if.($test).{... |
0c00 | 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 24 74 68 69 73 2d 3e 72 6f 6f 74 75 72 6c 20 | ..........return.$this->rooturl. |
0c20 | 2e 20 27 3f 74 65 73 74 3d 27 20 2e 20 75 72 6c 65 6e 63 6f 64 65 28 24 74 65 73 74 29 3b 0a 20 | ..'?test='...urlencode($test);.. |
0c40 | 20 20 20 20 20 20 20 7d 0a 20 20 20 20 7d 0a 0a 20 20 20 20 66 75 6e 63 74 69 6f 6e 20 67 65 74 | .......}.....}......function.get |
0c60 | 44 61 74 61 62 61 73 65 28 29 0a 20 20 20 20 7b 0a 20 20 20 20 20 20 20 20 24 74 68 69 73 2d 3e | Database().....{.........$this-> |
0c80 | 73 71 6c 69 74 65 20 3d 20 24 74 68 69 73 2d 3e 76 69 65 77 2d 3e 67 65 74 44 61 74 61 62 61 73 | sqlite.=.$this->view->getDatabas |
0ca0 | 65 28 29 3b 0a 20 20 20 20 7d 0a 7d 0a 7d 0a 3f 3e 0a 3c 3f 70 68 70 0a 6e 61 6d 65 73 70 61 63 | e();.....}.}.}.?>.<?php.namespac |
0cc0 | 65 20 50 45 41 52 32 5c 50 79 72 75 73 5c 44 65 76 65 6c 6f 70 65 72 5c 43 6f 76 65 72 61 67 65 | e.PEAR2\Pyrus\Developer\Coverage |
0ce0 | 41 6e 61 6c 79 7a 65 72 5c 57 65 62 20 7b 0a 2f 2a 2a 0a 20 2a 20 54 61 6b 65 73 20 61 20 73 6f | Analyzer\Web.{./**..*.Takes.a.so |
0d00 | 75 72 63 65 20 66 69 6c 65 20 61 6e 64 20 6f 75 74 70 75 74 73 20 48 54 4d 4c 20 73 6f 75 72 63 | urce.file.and.outputs.HTML.sourc |
0d20 | 65 20 68 69 67 68 6c 69 67 68 74 69 6e 67 20 73 68 6f 77 69 6e 67 20 74 68 65 0a 20 2a 20 6e 75 | e.highlighting.showing.the..*.nu |
0d40 | 6d 62 65 72 20 6f 66 20 68 69 74 73 20 6f 6e 20 65 61 63 68 20 6c 69 6e 65 2c 20 68 69 67 68 6c | mber.of.hits.on.each.line,.highl |
0d60 | 69 67 68 74 73 20 75 6e 2d 65 78 65 63 75 74 65 64 20 6c 69 6e 65 73 20 69 6e 20 72 65 64 0a 20 | ights.un-executed.lines.in.red.. |
0d80 | 2a 2f 0a 63 6c 61 73 73 20 56 69 65 77 0a 7b 0a 20 20 20 20 70 72 6f 74 65 63 74 65 64 20 24 73 | */.class.View.{.....protected.$s |
0da0 | 61 76 65 50 61 74 68 3b 0a 20 20 20 20 70 72 6f 74 65 63 74 65 64 20 24 74 65 73 74 50 61 74 68 | avePath;.....protected.$testPath |
0dc0 | 3b 0a 20 20 20 20 70 72 6f 74 65 63 74 65 64 20 24 73 6f 75 72 63 65 50 61 74 68 3b 0a 20 20 20 | ;.....protected.$sourcePath;.... |
0de0 | 20 70 72 6f 74 65 63 74 65 64 20 24 73 6f 75 72 63 65 3b 0a 20 20 20 20 70 72 6f 74 65 63 74 65 | .protected.$source;.....protecte |
0e00 | 64 20 24 63 6f 6e 74 72 6f 6c 6c 65 72 3b 0a 0a 20 20 20 20 66 75 6e 63 74 69 6f 6e 20 67 65 74 | d.$controller;......function.get |
0e20 | 44 61 74 61 62 61 73 65 28 29 0a 20 20 20 20 7b 0a 20 20 20 20 20 20 20 20 24 6f 75 74 70 75 74 | Database().....{.........$output |
0e40 | 20 3d 20 6e 65 77 20 5c 58 4d 4c 57 72 69 74 65 72 3b 0a 20 20 20 20 20 20 20 20 69 66 20 28 21 | .=.new.\XMLWriter;.........if.(! |
0e60 | 24 6f 75 74 70 75 74 2d 3e 6f 70 65 6e 55 72 69 28 27 70 68 70 3a 2f 2f 6f 75 74 70 75 74 27 29 | $output->openUri('php://output') |
0e80 | 29 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 74 68 72 6f 77 20 6e 65 77 20 45 78 63 65 70 74 | ).{.............throw.new.Except |
0ea0 | 69 6f 6e 28 27 43 61 6e 6e 6f 74 20 6f 70 65 6e 20 6f 75 74 70 75 74 20 2d 20 74 68 69 73 20 73 | ion('Cannot.open.output.-.this.s |
0ec0 | 68 6f 75 6c 64 20 6e 65 76 65 72 20 68 61 70 70 65 6e 27 29 3b 0a 20 20 20 20 20 20 20 20 7d 0a | hould.never.happen');.........}. |
0ee0 | 20 20 20 20 20 20 20 20 24 6f 75 74 70 75 74 2d 3e 73 74 61 72 74 45 6c 65 6d 65 6e 74 28 27 68 | ........$output->startElement('h |
0f00 | 74 6d 6c 27 29 3b 0a 20 20 20 20 20 20 20 20 20 24 6f 75 74 70 75 74 2d 3e 73 74 61 72 74 45 6c | tml');..........$output->startEl |
0f20 | 65 6d 65 6e 74 28 27 68 65 61 64 27 29 3b 0a 20 20 20 20 20 20 20 20 20 20 24 6f 75 74 70 75 74 | ement('head');...........$output |
0f40 | 2d 3e 77 72 69 74 65 45 6c 65 6d 65 6e 74 28 27 74 69 74 6c 65 27 2c 20 27 45 6e 74 65 72 20 61 | ->writeElement('title',.'Enter.a |
0f60 | 20 70 61 74 68 20 74 6f 20 74 68 65 20 64 61 74 61 62 61 73 65 27 29 3b 0a 20 20 20 20 20 20 20 | .path.to.the.database');........ |
0f80 | 20 20 24 6f 75 74 70 75 74 2d 3e 65 6e 64 45 6c 65 6d 65 6e 74 28 29 3b 0a 20 20 20 20 20 20 20 | ..$output->endElement();........ |
0fa0 | 20 20 24 6f 75 74 70 75 74 2d 3e 73 74 61 72 74 45 6c 65 6d 65 6e 74 28 27 62 6f 64 79 27 29 3b | ..$output->startElement('body'); |
0fc0 | 0a 20 20 20 20 20 20 20 20 20 20 24 6f 75 74 70 75 74 2d 3e 77 72 69 74 65 45 6c 65 6d 65 6e 74 | ...........$output->writeElement |
0fe0 | 28 27 68 32 27 2c 20 27 50 6c 65 61 73 65 20 65 6e 74 65 72 20 74 68 65 20 70 61 74 68 20 74 6f | ('h2',.'Please.enter.the.path.to |
1000 | 20 61 20 63 6f 76 65 72 61 67 65 20 64 61 74 61 62 61 73 65 27 29 3b 0a 20 20 20 20 20 20 20 20 | .a.coverage.database');......... |
1020 | 20 20 24 6f 75 74 70 75 74 2d 3e 73 74 61 72 74 45 6c 65 6d 65 6e 74 28 27 66 6f 72 6d 27 29 3b | ..$output->startElement('form'); |
1040 | 0a 20 20 20 20 20 20 20 20 20 20 20 24 6f 75 74 70 75 74 2d 3e 77 72 69 74 65 41 74 74 72 69 62 | ............$output->writeAttrib |
1060 | 75 74 65 28 27 6e 61 6d 65 27 2c 20 27 67 65 74 64 61 74 61 62 61 73 65 27 29 3b 0a 20 20 20 20 | ute('name',.'getdatabase');..... |
1080 | 20 20 20 20 20 20 20 24 6f 75 74 70 75 74 2d 3e 77 72 69 74 65 41 74 74 72 69 62 75 74 65 28 27 | .......$output->writeAttribute(' |
10a0 | 6d 65 74 68 6f 64 27 2c 20 27 50 4f 53 54 27 29 3b 0a 20 20 20 20 20 20 20 20 20 20 20 24 6f 75 | method',.'POST');............$ou |
10c0 | 74 70 75 74 2d 3e 77 72 69 74 65 41 74 74 72 69 62 75 74 65 28 27 61 63 74 69 6f 6e 27 2c 20 24 | tput->writeAttribute('action',.$ |
10e0 | 74 68 69 73 2d 3e 63 6f 6e 74 72 6f 6c 6c 65 72 2d 3e 67 65 74 54 4f 43 4c 69 6e 6b 28 29 29 3b | this->controller->getTOCLink()); |
1100 | 0a 20 20 20 20 20 20 20 20 20 20 20 24 6f 75 74 70 75 74 2d 3e 73 74 61 72 74 45 6c 65 6d 65 6e | ............$output->startElemen |
1120 | 74 28 27 69 6e 70 75 74 27 29 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 24 6f 75 74 70 75 74 2d | t('input');.............$output- |
1140 | 3e 77 72 69 74 65 41 74 74 72 69 62 75 74 65 28 27 74 79 70 65 27 2c 20 27 74 65 78 74 27 29 3b | >writeAttribute('type',.'text'); |
1160 | 0a 20 20 20 20 20 20 20 20 20 20 20 20 24 6f 75 74 70 75 74 2d 3e 77 72 69 74 65 41 74 74 72 69 | .............$output->writeAttri |
1180 | 62 75 74 65 28 27 6e 61 6d 65 27 2c 20 27 73 65 74 64 61 74 61 62 61 73 65 27 29 3b 0a 20 20 20 | bute('name',.'setdatabase');.... |
11a0 | 20 20 20 20 20 20 20 20 24 6f 75 74 70 75 74 2d 3e 65 6e 64 45 6c 65 6d 65 6e 74 28 29 3b 0a 20 | ........$output->endElement();.. |
11c0 | 20 20 20 20 20 20 20 20 20 20 24 6f 75 74 70 75 74 2d 3e 73 74 61 72 74 45 6c 65 6d 65 6e 74 28 | ..........$output->startElement( |
11e0 | 27 69 6e 70 75 74 27 29 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 24 6f 75 74 70 75 74 2d 3e 77 | 'input');.............$output->w |
1200 | 72 69 74 65 41 74 74 72 69 62 75 74 65 28 27 74 79 70 65 27 2c 20 27 73 75 62 6d 69 74 27 29 3b | riteAttribute('type',.'submit'); |
1220 | 0a 20 20 20 20 20 20 20 20 20 20 20 24 6f 75 74 70 75 74 2d 3e 65 6e 64 45 6c 65 6d 65 6e 74 28 | ............$output->endElement( |
1240 | 29 3b 0a 20 20 20 20 20 20 20 20 20 20 24 6f 75 74 70 75 74 2d 3e 65 6e 64 45 6c 65 6d 65 6e 74 | );...........$output->endElement |
1260 | 28 29 3b 0a 20 20 20 20 20 20 20 20 20 24 6f 75 74 70 75 74 2d 3e 65 6e 64 45 6c 65 6d 65 6e 74 | ();..........$output->endElement |
1280 | 28 29 3b 0a 20 20 20 20 20 20 20 20 24 6f 75 74 70 75 74 2d 3e 65 6e 64 45 6c 65 6d 65 6e 74 28 | ();.........$output->endElement( |
12a0 | 29 3b 0a 20 20 20 20 20 20 20 20 24 6f 75 74 70 75 74 2d 3e 65 6e 64 44 6f 63 75 6d 65 6e 74 28 | );.........$output->endDocument( |
12c0 | 29 3b 0a 20 20 20 20 7d 0a 0a 20 20 20 20 66 75 6e 63 74 69 6f 6e 20 73 65 74 43 6f 6e 74 72 6f | );.....}......function.setContro |
12e0 | 6c 6c 65 72 28 24 63 6f 6e 74 72 6f 6c 6c 65 72 29 0a 20 20 20 20 7b 0a 20 20 20 20 20 20 20 20 | ller($controller).....{......... |
1300 | 24 74 68 69 73 2d 3e 63 6f 6e 74 72 6f 6c 6c 65 72 20 3d 20 24 63 6f 6e 74 72 6f 6c 6c 65 72 3b | $this->controller.=.$controller; |
1320 | 0a 20 20 20 20 7d 0a 0a 20 20 20 20 66 75 6e 63 74 69 6f 6e 20 54 4f 43 28 24 73 71 6c 69 74 65 | .....}......function.TOC($sqlite |
1340 | 29 0a 20 20 20 20 7b 0a 20 20 20 20 20 20 20 20 24 63 6f 76 65 72 61 67 65 20 3d 20 24 73 71 6c | ).....{.........$coverage.=.$sql |
1360 | 69 74 65 2d 3e 72 65 74 72 69 65 76 65 50 72 6f 6a 65 63 74 43 6f 76 65 72 61 67 65 28 29 3b 0a | ite->retrieveProjectCoverage();. |
1380 | 20 20 20 20 20 20 20 20 24 74 68 69 73 2d 3e 72 65 6e 64 65 72 53 75 6d 6d 61 72 79 28 24 73 71 | ........$this->renderSummary($sq |
13a0 | 6c 69 74 65 2c 20 24 73 71 6c 69 74 65 2d 3e 72 65 74 72 69 65 76 65 50 61 74 68 73 28 29 2c 20 | lite,.$sqlite->retrievePaths(),. |
13c0 | 66 61 6c 73 65 2c 20 24 63 6f 76 65 72 61 67 65 5b 31 5d 2c 20 24 63 6f 76 65 72 65 64 5b 30 5d | false,.$coverage[1],.$covered[0] |
13e0 | 29 3b 0a 20 20 20 20 7d 0a 0a 20 20 20 20 66 75 6e 63 74 69 6f 6e 20 74 65 73 74 54 4f 43 28 24 | );.....}......function.testTOC($ |
1400 | 73 71 6c 69 74 65 29 0a 20 20 20 20 7b 0a 20 20 20 20 20 20 20 20 24 74 68 69 73 2d 3e 72 65 6e | sqlite).....{.........$this->ren |
1420 | 64 65 72 54 65 73 74 53 75 6d 6d 61 72 79 28 24 73 71 6c 69 74 65 29 3b 0a 20 20 20 20 7d 0a 0a | derTestSummary($sqlite);.....}.. |
1440 | 20 20 20 20 66 75 6e 63 74 69 6f 6e 20 66 69 6c 65 4c 69 6e 65 54 4f 43 28 24 73 71 6c 69 74 65 | ....function.fileLineTOC($sqlite |
1460 | 2c 20 24 66 69 6c 65 2c 20 24 6c 69 6e 65 29 0a 20 20 20 20 7b 0a 20 20 20 20 20 20 20 20 0a 20 | ,.$file,.$line).....{........... |
1480 | 20 20 20 7d 0a 0a 20 20 20 20 66 75 6e 63 74 69 6f 6e 20 66 69 6c 65 43 6f 76 65 72 61 67 65 28 | ...}......function.fileCoverage( |
14a0 | 24 73 71 6c 69 74 65 2c 20 24 66 69 6c 65 2c 20 24 74 65 73 74 20 3d 20 6e 75 6c 6c 29 0a 20 20 | $sqlite,.$file,.$test.=.null)... |
14c0 | 20 20 7b 0a 20 20 20 20 20 20 20 20 0a 20 20 20 20 7d 0a 0a 20 20 20 20 66 75 6e 63 74 69 6f 6e | ..{..............}......function |
14e0 | 20 6d 61 6e 67 6c 65 46 69 6c 65 28 24 70 61 74 68 2c 20 24 69 73 74 65 73 74 20 3d 20 66 61 6c | .mangleFile($path,.$istest.=.fal |
1500 | 73 65 29 0a 20 20 20 20 7b 0a 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 24 74 68 69 73 2d 3e | se).....{.........return.$this-> |
1520 | 63 6f 6e 74 72 6f 6c 6c 65 72 2d 3e 67 65 74 46 69 6c 65 4c 69 6e 6b 28 24 70 61 74 68 2c 20 24 | controller->getFileLink($path,.$ |
1540 | 69 73 74 65 73 74 29 3b 0a 20 20 20 20 7d 0a 0a 20 20 20 20 66 75 6e 63 74 69 6f 6e 20 6d 61 6e | istest);.....}......function.man |
1560 | 67 6c 65 54 65 73 74 46 69 6c 65 28 24 70 61 74 68 29 0a 20 20 20 20 7b 0a 20 20 20 20 20 20 20 | gleTestFile($path).....{........ |
1580 | 20 72 65 74 75 72 6e 20 24 74 68 69 73 2d 3e 63 6f 6e 74 72 6f 6c 6c 65 72 2d 3e 67 65 74 54 4f | .return.$this->controller->getTO |
15a0 | 43 6c 69 6e 6b 28 24 70 61 74 68 29 3b 0a 20 20 20 20 7d 0a 0a 20 20 20 20 66 75 6e 63 74 69 6f | Clink($path);.....}......functio |
15c0 | 6e 20 67 65 74 4c 69 6e 65 4c 69 6e 6b 28 24 6e 61 6d 65 2c 20 24 6c 69 6e 65 29 0a 20 20 20 20 | n.getLineLink($name,.$line)..... |
15e0 | 7b 0a 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 24 74 68 69 73 2d 3e 63 6f 6e 74 72 6f 6c 6c | {.........return.$this->controll |
1600 | 65 72 2d 3e 67 65 74 46 69 6c 65 4c 69 6e 6b 28 24 6e 61 6d 65 2c 20 6e 75 6c 6c 2c 20 24 6c 69 | er->getFileLink($name,.null,.$li |
1620 | 6e 65 29 3b 0a 20 20 20 20 7d 0a 0a 20 20 20 20 66 75 6e 63 74 69 6f 6e 20 72 65 6e 64 65 72 4c | ne);.....}......function.renderL |
1640 | 69 6e 65 53 75 6d 6d 61 72 79 28 24 6e 61 6d 65 2c 20 24 6c 69 6e 65 2c 20 24 74 65 73 74 70 61 | ineSummary($name,.$line,.$testpa |
1660 | 74 68 2c 20 24 74 65 73 74 73 29 0a 20 20 20 20 7b 0a 20 20 20 20 20 20 20 20 24 6f 75 74 70 75 | th,.$tests).....{.........$outpu |
1680 | 74 20 3d 20 6e 65 77 20 5c 58 4d 4c 57 72 69 74 65 72 3b 0a 20 20 20 20 20 20 20 20 69 66 20 28 | t.=.new.\XMLWriter;.........if.( |
16a0 | 21 24 6f 75 74 70 75 74 2d 3e 6f 70 65 6e 55 72 69 28 24 74 68 69 73 2d 3e 67 65 74 4c 69 6e 65 | !$output->openUri($this->getLine |
16c0 | 50 61 74 68 28 24 6e 61 6d 65 2c 20 24 6c 69 6e 65 29 29 29 20 7b 0a 20 20 20 20 20 20 20 20 20 | Path($name,.$line))).{.......... |
16e0 | 20 20 20 74 68 72 6f 77 20 6e 65 77 20 45 78 63 65 70 74 69 6f 6e 28 27 43 61 6e 6e 6f 74 20 72 | ...throw.new.Exception('Cannot.r |
1700 | 65 6e 64 65 72 20 27 20 2e 20 24 6e 61 6d 65 20 2e 20 27 20 6c 69 6e 65 20 27 20 2e 20 24 6c 69 | ender.'...$name...'.line.'...$li |
1720 | 6e 65 20 2e 20 27 2c 20 6f 70 65 6e 69 6e 67 20 58 4d 4c 20 66 61 69 6c 65 64 27 29 3b 0a 20 20 | ne...',.opening.XML.failed');... |
1740 | 20 20 20 20 20 20 7d 0a 20 20 20 20 20 20 20 20 24 6f 75 74 70 75 74 2d 3e 73 65 74 49 6e 64 65 | ......}.........$output->setInde |
1760 | 6e 74 53 74 72 69 6e 67 28 27 20 27 29 3b 0a 20 20 20 20 20 20 20 20 24 6f 75 74 70 75 74 2d 3e | ntString('.');.........$output-> |
1780 | 73 65 74 49 6e 64 65 6e 74 28 74 72 75 65 29 3b 0a 20 20 20 20 20 20 20 20 24 6f 75 74 70 75 74 | setIndent(true);.........$output |
17a0 | 2d 3e 73 74 61 72 74 45 6c 65 6d 65 6e 74 28 27 68 74 6d 6c 27 29 3b 0a 20 20 20 20 20 20 20 20 | ->startElement('html');......... |
17c0 | 24 6f 75 74 70 75 74 2d 3e 73 74 61 72 74 45 6c 65 6d 65 6e 74 28 27 68 65 61 64 27 29 3b 0a 20 | $output->startElement('head');.. |
17e0 | 20 20 20 20 20 20 20 24 6f 75 74 70 75 74 2d 3e 77 72 69 74 65 45 6c 65 6d 65 6e 74 28 27 74 69 | .......$output->writeElement('ti |
1800 | 74 6c 65 27 2c 20 27 54 65 73 74 73 20 63 6f 76 65 72 69 6e 67 20 6c 69 6e 65 20 27 20 2e 20 24 | tle',.'Tests.covering.line.'...$ |
1820 | 6c 69 6e 65 20 2e 20 27 20 6f 66 20 27 20 2e 20 24 6e 61 6d 65 29 3b 0a 20 20 20 20 20 20 20 20 | line...'.of.'...$name);......... |
1840 | 24 6f 75 74 70 75 74 2d 3e 73 74 61 72 74 45 6c 65 6d 65 6e 74 28 27 6c 69 6e 6b 27 29 3b 0a 20 | $output->startElement('link');.. |
1860 | 20 20 20 20 20 20 20 24 6f 75 74 70 75 74 2d 3e 77 72 69 74 65 41 74 74 72 69 62 75 74 65 28 27 | .......$output->writeAttribute(' |
1880 | 68 72 65 66 27 2c 20 27 63 6f 76 65 72 2e 63 73 73 27 29 3b 0a 20 20 20 20 20 20 20 20 24 6f 75 | href',.'cover.css');.........$ou |
18a0 | 74 70 75 74 2d 3e 77 72 69 74 65 41 74 74 72 69 62 75 74 65 28 27 72 65 6c 27 2c 20 27 73 74 79 | tput->writeAttribute('rel',.'sty |
18c0 | 6c 65 73 68 65 65 74 27 29 3b 0a 20 20 20 20 20 20 20 20 24 6f 75 74 70 75 74 2d 3e 77 72 69 74 | lesheet');.........$output->writ |
18e0 | 65 41 74 74 72 69 62 75 74 65 28 27 74 79 70 65 27 2c 20 27 74 65 78 74 2f 63 73 73 27 29 3b 0a | eAttribute('type',.'text/css');. |
1900 | 20 20 20 20 20 20 20 20 24 6f 75 74 70 75 74 2d 3e 65 6e 64 45 6c 65 6d 65 6e 74 28 29 3b 0a 20 | ........$output->endElement();.. |
1920 | 20 20 20 20 20 20 20 24 6f 75 74 70 75 74 2d 3e 65 6e 64 45 6c 65 6d 65 6e 74 28 29 3b 0a 20 20 | .......$output->endElement();... |
1940 | 20 20 20 20 20 20 24 6f 75 74 70 75 74 2d 3e 73 74 61 72 74 45 6c 65 6d 65 6e 74 28 27 62 6f 64 | ......$output->startElement('bod |
1960 | 79 27 29 3b 0a 20 20 20 20 20 20 20 20 24 6f 75 74 70 75 74 2d 3e 77 72 69 74 65 45 6c 65 6d 65 | y');.........$output->writeEleme |
1980 | 6e 74 28 27 68 32 27 2c 20 27 54 65 73 74 73 20 63 6f 76 65 72 69 6e 67 20 6c 69 6e 65 20 27 20 | nt('h2',.'Tests.covering.line.'. |
19a0 | 2e 20 24 6c 69 6e 65 20 2e 20 27 20 6f 66 20 27 20 2e 20 24 6e 61 6d 65 29 3b 0a 20 20 20 20 20 | ..$line...'.of.'...$name);...... |
19c0 | 20 20 20 24 6f 75 74 70 75 74 2d 3e 73 74 61 72 74 45 6c 65 6d 65 6e 74 28 27 70 27 29 3b 0a 20 | ...$output->startElement('p');.. |
19e0 | 20 20 20 20 20 20 20 24 6f 75 74 70 75 74 2d 3e 73 74 61 72 74 45 6c 65 6d 65 6e 74 28 27 61 27 | .......$output->startElement('a' |
1a00 | 29 3b 0a 20 20 20 20 20 20 20 20 24 6f 75 74 70 75 74 2d 3e 77 72 69 74 65 41 74 74 72 69 62 75 | );.........$output->writeAttribu |
1a20 | 74 65 28 27 68 72 65 66 27 2c 20 27 69 6e 64 65 78 2e 68 74 6d 6c 27 29 3b 0a 20 20 20 20 20 20 | te('href',.'index.html');....... |
1a40 | 20 20 24 6f 75 74 70 75 74 2d 3e 74 65 78 74 28 27 41 67 67 72 65 67 61 74 65 20 43 6f 64 65 20 | ..$output->text('Aggregate.Code. |
1a60 | 43 6f 76 65 72 61 67 65 20 66 6f 72 20 61 6c 6c 20 74 65 73 74 73 27 29 3b 0a 20 20 20 20 20 20 | Coverage.for.all.tests');....... |
1a80 | 20 20 24 6f 75 74 70 75 74 2d 3e 65 6e 64 45 6c 65 6d 65 6e 74 28 29 3b 0a 20 20 20 20 20 20 20 | ..$output->endElement();........ |
1aa0 | 20 24 6f 75 74 70 75 74 2d 3e 65 6e 64 45 6c 65 6d 65 6e 74 28 29 3b 0a 20 20 20 20 20 20 20 20 | .$output->endElement();......... |
1ac0 | 24 6f 75 74 70 75 74 2d 3e 73 74 61 72 74 45 6c 65 6d 65 6e 74 28 27 70 27 29 3b 0a 20 20 20 20 | $output->startElement('p');..... |
1ae0 | 20 20 20 20 24 6f 75 74 70 75 74 2d 3e 73 74 61 72 74 45 6c 65 6d 65 6e 74 28 27 61 27 29 3b 0a | ....$output->startElement('a');. |
1b00 | 20 20 20 20 20 20 20 20 24 6f 75 74 70 75 74 2d 3e 77 72 69 74 65 41 74 74 72 69 62 75 74 65 28 | ........$output->writeAttribute( |
1b20 | 27 68 72 65 66 27 2c 20 24 74 68 69 73 2d 3e 6d 61 6e 67 6c 65 46 69 6c 65 28 24 6e 61 6d 65 29 | 'href',.$this->mangleFile($name) |
1b40 | 29 3b 0a 20 20 20 20 20 20 20 20 24 6f 75 74 70 75 74 2d 3e 74 65 78 74 28 27 46 69 6c 65 20 27 | );.........$output->text('File.' |
1b60 | 20 2e 20 24 6e 61 6d 65 20 2e 20 27 20 63 6f 64 65 20 63 6f 76 65 72 61 67 65 27 29 3b 0a 20 20 | ...$name...'.code.coverage');... |
1b80 | 20 20 20 20 20 20 24 6f 75 74 70 75 74 2d 3e 65 6e 64 45 6c 65 6d 65 6e 74 28 29 3b 0a 20 20 20 | ......$output->endElement();.... |
1ba0 | 20 20 20 20 20 24 6f 75 74 70 75 74 2d 3e 65 6e 64 45 6c 65 6d 65 6e 74 28 29 3b 0a 20 20 20 20 | .....$output->endElement();..... |
1bc0 | 20 20 20 20 24 6f 75 74 70 75 74 2d 3e 73 74 61 72 74 45 6c 65 6d 65 6e 74 28 27 75 6c 27 29 3b | ....$output->startElement('ul'); |
1be0 | 0a 20 20 20 20 20 20 20 20 66 6f 72 65 61 63 68 20 28 24 74 65 73 74 73 20 61 73 20 24 74 65 73 | .........foreach.($tests.as.$tes |
1c00 | 74 66 69 6c 65 29 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 24 6f 75 74 70 75 74 2d 3e 73 74 | tfile).{.............$output->st |
1c20 | 61 72 74 45 6c 65 6d 65 6e 74 28 27 6c 69 27 29 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 24 6f | artElement('li');.............$o |
1c40 | 75 74 70 75 74 2d 3e 73 74 61 72 74 45 6c 65 6d 65 6e 74 28 27 61 27 29 3b 0a 20 20 20 20 20 20 | utput->startElement('a');....... |
1c60 | 20 20 20 20 20 20 24 6f 75 74 70 75 74 2d 3e 77 72 69 74 65 41 74 74 72 69 62 75 74 65 28 27 68 | ......$output->writeAttribute('h |
1c80 | 72 65 66 27 2c 20 24 74 68 69 73 2d 3e 6d 61 6e 67 6c 65 54 65 73 74 46 69 6c 65 28 24 74 65 73 | ref',.$this->mangleTestFile($tes |
1ca0 | 74 66 69 6c 65 29 29 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 24 6f 75 74 70 75 74 2d 3e 74 65 | tfile));.............$output->te |
1cc0 | 78 74 28 73 74 72 5f 72 65 70 6c 61 63 65 28 24 74 65 73 74 70 61 74 68 20 2e 20 27 2f 27 2c 20 | xt(str_replace($testpath...'/',. |
1ce0 | 27 27 2c 20 24 74 65 73 74 66 69 6c 65 29 29 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 24 6f 75 | '',.$testfile));.............$ou |
1d00 | 74 70 75 74 2d 3e 65 6e 64 45 6c 65 6d 65 6e 74 28 29 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 | tput->endElement();............. |
1d20 | 24 6f 75 74 70 75 74 2d 3e 65 6e 64 45 6c 65 6d 65 6e 74 28 29 3b 0a 20 20 20 20 20 20 20 20 7d | $output->endElement();.........} |
1d40 | 0a 20 20 20 20 20 20 20 20 24 6f 75 74 70 75 74 2d 3e 65 6e 64 45 6c 65 6d 65 6e 74 28 29 3b 0a | .........$output->endElement();. |
1d60 | 20 20 20 20 20 20 20 20 24 6f 75 74 70 75 74 2d 3e 65 6e 64 45 6c 65 6d 65 6e 74 28 29 3b 0a 20 | ........$output->endElement();.. |
1d80 | 20 20 20 20 20 20 20 24 6f 75 74 70 75 74 2d 3e 65 6e 64 44 6f 63 75 6d 65 6e 74 28 29 3b 0a 20 | .......$output->endDocument();.. |
1da0 | 20 20 20 7d 0a 0a 20 20 20 20 2f 2a 2a 0a 20 20 20 20 20 2a 20 40 70 61 72 61 6d 20 50 45 41 52 | ...}....../**......*.@param.PEAR |
1dc0 | 32 5c 50 79 72 75 73 5c 44 65 76 65 6c 6f 70 65 72 5c 43 6f 64 65 43 6f 76 65 72 61 67 65 5c 53 | 2\Pyrus\Developer\CodeCoverage\S |
1de0 | 6f 75 72 63 65 46 69 6c 65 20 24 73 6f 75 72 63 65 0a 20 20 20 20 20 2a 20 40 70 61 72 61 6d 20 | ourceFile.$source......*.@param. |
1e00 | 73 74 72 69 6e 67 20 24 69 73 74 65 73 74 20 70 61 74 68 20 74 6f 20 74 65 73 74 20 66 69 6c 65 | string.$istest.path.to.test.file |
1e20 | 20 74 68 69 73 20 69 73 20 63 6f 76 65 72 69 6e 67 2c 20 6f 72 20 66 61 6c 73 65 20 66 6f 72 20 | .this.is.covering,.or.false.for. |
1e40 | 61 67 67 72 65 67 61 74 65 0a 20 20 20 20 20 2a 2f 0a 20 20 20 20 66 75 6e 63 74 69 6f 6e 20 72 | aggregate......*/.....function.r |
1e60 | 65 6e 64 65 72 28 53 6f 75 72 63 65 46 69 6c 65 20 24 73 6f 75 72 63 65 2c 20 24 69 73 74 65 73 | ender(SourceFile.$source,.$istes |
1e80 | 74 20 3d 20 66 61 6c 73 65 29 0a 20 20 20 20 7b 0a 20 20 20 20 20 20 20 20 24 6f 75 74 70 75 74 | t.=.false).....{.........$output |
1ea0 | 20 3d 20 6e 65 77 20 5c 58 4d 4c 57 72 69 74 65 72 3b 0a 20 20 20 20 20 20 20 20 69 66 20 28 21 | .=.new.\XMLWriter;.........if.(! |
1ec0 | 24 6f 75 74 70 75 74 2d 3e 6f 70 65 6e 55 72 69 28 24 74 68 69 73 2d 3e 6d 61 6e 67 6c 65 50 61 | $output->openUri($this->manglePa |
1ee0 | 74 68 28 24 73 6f 75 72 63 65 2d 3e 6e 61 6d 65 28 29 2c 20 24 69 73 74 65 73 74 29 29 29 20 7b | th($source->name(),.$istest))).{ |
1f00 | 0a 20 20 20 20 20 20 20 20 20 20 20 20 74 68 72 6f 77 20 6e 65 77 20 45 78 63 65 70 74 69 6f 6e | .............throw.new.Exception |
1f20 | 28 27 43 61 6e 6e 6f 74 20 72 65 6e 64 65 72 20 27 20 2e 20 24 73 6f 75 72 63 65 2d 3e 6e 61 6d | ('Cannot.render.'...$source->nam |
1f40 | 65 28 29 20 2e 20 27 2c 20 6f 70 65 6e 69 6e 67 20 58 4d 4c 20 66 61 69 6c 65 64 27 29 3b 0a 20 | e()...',.opening.XML.failed');.. |
1f60 | 20 20 20 20 20 20 20 7d 0a 20 20 20 20 20 20 20 20 24 6f 75 74 70 75 74 2d 3e 73 65 74 49 6e 64 | .......}.........$output->setInd |
1f80 | 65 6e 74 28 66 61 6c 73 65 29 3b 0a 20 20 20 20 20 20 20 20 24 6f 75 74 70 75 74 2d 3e 73 74 61 | ent(false);.........$output->sta |
1fa0 | 72 74 45 6c 65 6d 65 6e 74 28 27 68 74 6d 6c 27 29 3b 0a 20 20 20 20 20 20 20 20 24 6f 75 74 70 | rtElement('html');.........$outp |
1fc0 | 75 74 2d 3e 74 65 78 74 28 22 5c 6e 20 22 29 3b 0a 20 20 20 20 20 20 20 20 24 6f 75 74 70 75 74 | ut->text("\n.");.........$output |
1fe0 | 2d 3e 73 74 61 72 74 45 6c 65 6d 65 6e 74 28 27 68 65 61 64 27 29 3b 0a 20 20 20 20 20 20 20 20 | ->startElement('head');......... |
2000 | 24 6f 75 74 70 75 74 2d 3e 74 65 78 74 28 22 5c 6e 20 20 22 29 3b 0a 20 20 20 20 20 20 20 20 69 | $output->text("\n..");.........i |
2020 | 66 20 28 24 69 73 74 65 73 74 29 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 24 6f 75 74 70 75 | f.($istest).{.............$outpu |
2040 | 74 2d 3e 77 72 69 74 65 45 6c 65 6d 65 6e 74 28 27 74 69 74 6c 65 27 2c 20 27 43 6f 64 65 20 43 | t->writeElement('title',.'Code.C |
2060 | 6f 76 65 72 61 67 65 20 66 6f 72 20 27 20 2e 20 24 73 6f 75 72 63 65 2d 3e 73 68 6f 72 74 4e 61 | overage.for.'...$source->shortNa |
2080 | 6d 65 28 29 20 2e 20 27 20 69 6e 20 27 20 2e 20 24 69 73 74 65 73 74 29 3b 0a 20 20 20 20 20 20 | me()...'.in.'...$istest);....... |
20a0 | 20 20 7d 20 65 6c 73 65 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 24 6f 75 74 70 75 74 2d 3e | ..}.else.{.............$output-> |
20c0 | 77 72 69 74 65 45 6c 65 6d 65 6e 74 28 27 74 69 74 6c 65 27 2c 20 27 43 6f 64 65 20 43 6f 76 65 | writeElement('title',.'Code.Cove |
20e0 | 72 61 67 65 20 66 6f 72 20 27 20 2e 20 24 73 6f 75 72 63 65 2d 3e 73 68 6f 72 74 4e 61 6d 65 28 | rage.for.'...$source->shortName( |
2100 | 29 29 3b 0a 20 20 20 20 20 20 20 20 7d 0a 20 20 20 20 20 20 20 20 24 6f 75 74 70 75 74 2d 3e 74 | ));.........}.........$output->t |
2120 | 65 78 74 28 22 5c 6e 20 20 22 29 3b 0a 20 20 20 20 20 20 20 20 24 6f 75 74 70 75 74 2d 3e 73 74 | ext("\n..");.........$output->st |
2140 | 61 72 74 45 6c 65 6d 65 6e 74 28 27 6c 69 6e 6b 27 29 3b 0a 20 20 20 20 20 20 20 20 24 6f 75 74 | artElement('link');.........$out |
2160 | 70 75 74 2d 3e 77 72 69 74 65 41 74 74 72 69 62 75 74 65 28 27 68 72 65 66 27 2c 20 27 63 6f 76 | put->writeAttribute('href',.'cov |
2180 | 65 72 2e 63 73 73 27 29 3b 0a 20 20 20 20 20 20 20 20 24 6f 75 74 70 75 74 2d 3e 77 72 69 74 65 | er.css');.........$output->write |
21a0 | 41 74 74 72 69 62 75 74 65 28 27 72 65 6c 27 2c 20 27 73 74 79 6c 65 73 68 65 65 74 27 29 3b 0a | Attribute('rel',.'stylesheet');. |
21c0 | 20 20 20 20 20 20 20 20 24 6f 75 74 70 75 74 2d 3e 77 72 69 74 65 41 74 74 72 69 62 75 74 65 28 | ........$output->writeAttribute( |
21e0 | 27 74 79 70 65 27 2c 20 27 74 65 78 74 2f 63 73 73 27 29 3b 0a 20 20 20 20 20 20 20 20 24 6f 75 | 'type',.'text/css');.........$ou |
2200 | 74 70 75 74 2d 3e 65 6e 64 45 6c 65 6d 65 6e 74 28 29 3b 0a 20 20 20 20 20 20 20 20 24 6f 75 74 | tput->endElement();.........$out |
2220 | 70 75 74 2d 3e 74 65 78 74 28 22 5c 6e 20 20 22 29 3b 0a 20 20 20 20 20 20 20 20 24 6f 75 74 70 | put->text("\n..");.........$outp |
2240 | 75 74 2d 3e 65 6e 64 45 6c 65 6d 65 6e 74 28 29 3b 0a 20 20 20 20 20 20 20 20 24 6f 75 74 70 75 | ut->endElement();.........$outpu |
2260 | 74 2d 3e 74 65 78 74 28 22 5c 6e 20 22 29 3b 0a 20 20 20 20 20 20 20 20 24 6f 75 74 70 75 74 2d | t->text("\n.");.........$output- |
2280 | 3e 73 74 61 72 74 45 6c 65 6d 65 6e 74 28 27 62 6f 64 79 27 29 3b 0a 20 20 20 20 20 20 20 20 24 | >startElement('body');.........$ |
22a0 | 6f 75 74 70 75 74 2d 3e 74 65 78 74 28 22 5c 6e 20 22 29 3b 0a 20 20 20 20 20 20 20 20 69 66 20 | output->text("\n.");.........if. |
22c0 | 28 24 69 73 74 65 73 74 29 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 24 6f 75 74 70 75 74 2d | ($istest).{.............$output- |
22e0 | 3e 77 72 69 74 65 45 6c 65 6d 65 6e 74 28 27 68 32 27 2c 20 27 43 6f 64 65 20 43 6f 76 65 72 61 | >writeElement('h2',.'Code.Covera |
2300 | 67 65 20 66 6f 72 20 27 20 2e 20 24 73 6f 75 72 63 65 2d 3e 73 68 6f 72 74 4e 61 6d 65 28 29 20 | ge.for.'...$source->shortName(). |
2320 | 2e 20 27 20 69 6e 20 27 20 2e 20 24 69 73 74 65 73 74 29 3b 0a 20 20 20 20 20 20 20 20 7d 20 65 | ..'.in.'...$istest);.........}.e |
2340 | 6c 73 65 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 24 6f 75 74 70 75 74 2d 3e 77 72 69 74 65 | lse.{.............$output->write |
2360 | 45 6c 65 6d 65 6e 74 28 27 68 32 27 2c 20 27 43 6f 64 65 20 43 6f 76 65 72 61 67 65 20 66 6f 72 | Element('h2',.'Code.Coverage.for |
2380 | 20 27 20 2e 20 24 73 6f 75 72 63 65 2d 3e 73 68 6f 72 74 4e 61 6d 65 28 29 29 3b 0a 20 20 20 20 | .'...$source->shortName());..... |
23a0 | 20 20 20 20 7d 0a 20 20 20 20 20 20 20 20 24 6f 75 74 70 75 74 2d 3e 74 65 78 74 28 22 5c 6e 20 | ....}.........$output->text("\n. |
23c0 | 22 29 3b 0a 20 20 20 20 20 20 20 20 24 6f 75 74 70 75 74 2d 3e 77 72 69 74 65 45 6c 65 6d 65 6e | ");.........$output->writeElemen |
23e0 | 74 28 27 68 33 27 2c 20 27 43 6f 76 65 72 61 67 65 3a 20 27 20 2e 20 24 73 6f 75 72 63 65 2d 3e | t('h3',.'Coverage:.'...$source-> |
2400 | 63 6f 76 65 72 61 67 65 50 65 72 63 65 6e 74 61 67 65 28 29 20 2e 20 27 25 27 29 3b 0a 20 20 20 | coveragePercentage()...'%');.... |
2420 | 20 20 20 20 20 24 6f 75 74 70 75 74 2d 3e 74 65 78 74 28 22 5c 6e 20 22 29 3b 0a 20 20 20 20 20 | .....$output->text("\n.");...... |
2440 | 20 20 20 24 6f 75 74 70 75 74 2d 3e 73 74 61 72 74 45 6c 65 6d 65 6e 74 28 27 70 27 29 3b 0a 20 | ...$output->startElement('p');.. |
2460 | 20 20 20 20 20 20 20 24 6f 75 74 70 75 74 2d 3e 73 74 61 72 74 45 6c 65 6d 65 6e 74 28 27 61 27 | .......$output->startElement('a' |
2480 | 29 3b 0a 20 20 20 20 20 20 20 20 24 6f 75 74 70 75 74 2d 3e 77 72 69 74 65 41 74 74 72 69 62 75 | );.........$output->writeAttribu |
24a0 | 74 65 28 27 68 72 65 66 27 2c 20 27 69 6e 64 65 78 2e 68 74 6d 6c 27 29 3b 0a 20 20 20 20 20 20 | te('href',.'index.html');....... |
24c0 | 20 20 24 6f 75 74 70 75 74 2d 3e 74 65 78 74 28 27 41 67 67 72 65 67 61 74 65 20 43 6f 64 65 20 | ..$output->text('Aggregate.Code. |
24e0 | 43 6f 76 65 72 61 67 65 20 66 6f 72 20 61 6c 6c 20 74 65 73 74 73 27 29 3b 0a 20 20 20 20 20 20 | Coverage.for.all.tests');....... |
2500 | 20 20 24 6f 75 74 70 75 74 2d 3e 65 6e 64 45 6c 65 6d 65 6e 74 28 29 3b 0a 20 20 20 20 20 20 20 | ..$output->endElement();........ |
2520 | 20 24 6f 75 74 70 75 74 2d 3e 65 6e 64 45 6c 65 6d 65 6e 74 28 29 3b 0a 20 20 20 20 20 20 20 20 | .$output->endElement();......... |
2540 | 24 6f 75 74 70 75 74 2d 3e 73 74 61 72 74 45 6c 65 6d 65 6e 74 28 27 70 72 65 27 29 3b 0a 20 20 | $output->startElement('pre');... |
2560 | 20 20 20 20 20 20 66 6f 72 65 61 63 68 20 28 24 73 6f 75 72 63 65 2d 3e 73 6f 75 72 63 65 28 29 | ......foreach.($source->source() |
2580 | 20 61 73 20 24 6e 75 6d 20 3d 3e 20 24 6c 69 6e 65 29 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 | .as.$num.=>.$line).{............ |
25a0 | 20 24 63 6f 76 65 72 61 67 65 20 3d 20 24 73 6f 75 72 63 65 2d 3e 63 6f 76 65 72 61 67 65 28 24 | .$coverage.=.$source->coverage($ |
25c0 | 6e 75 6d 29 3b 0a 0a 20 20 20 20 20 20 20 20 20 20 20 20 24 6f 75 74 70 75 74 2d 3e 73 74 61 72 | num);..............$output->star |
25e0 | 74 45 6c 65 6d 65 6e 74 28 27 73 70 61 6e 27 29 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 24 6f | tElement('span');.............$o |
2600 | 75 74 70 75 74 2d 3e 77 72 69 74 65 41 74 74 72 69 62 75 74 65 28 27 63 6c 61 73 73 27 2c 20 27 | utput->writeAttribute('class',.' |
2620 | 6c 6e 27 29 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 24 6f 75 74 70 75 74 2d 3e 74 65 78 74 28 | ln');.............$output->text( |
2640 | 73 74 72 5f 70 61 64 28 24 6e 75 6d 2c 20 38 2c 20 27 20 27 2c 20 53 54 52 5f 50 41 44 5f 4c 45 | str_pad($num,.8,.'.',.STR_PAD_LE |
2660 | 46 54 29 29 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 24 6f 75 74 70 75 74 2d 3e 65 6e 64 45 6c | FT));.............$output->endEl |
2680 | 65 6d 65 6e 74 28 29 3b 0a 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 24 63 6f 76 65 72 | ement();..............if.($cover |
26a0 | 61 67 65 20 3d 3d 3d 20 66 61 6c 73 65 29 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | age.===.false).{................ |
26c0 | 20 24 6f 75 74 70 75 74 2d 3e 74 65 78 74 28 73 74 72 5f 70 61 64 28 27 3a 20 27 2c 20 31 33 2c | .$output->text(str_pad(':.',.13, |
26e0 | 20 27 20 27 2c 20 53 54 52 5f 50 41 44 5f 4c 45 46 54 29 20 2e 20 24 6c 69 6e 65 29 3b 0a 20 20 | .'.',.STR_PAD_LEFT)...$line);... |
2700 | 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 6f 6e 74 69 6e 75 65 3b 0a 20 20 20 20 20 20 20 20 | ..............continue;......... |
2720 | 20 20 20 20 7d 0a 0a 20 20 20 20 20 20 20 20 20 20 20 20 24 6f 75 74 70 75 74 2d 3e 73 74 61 72 | ....}..............$output->star |
2740 | 74 45 6c 65 6d 65 6e 74 28 27 73 70 61 6e 27 29 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 | tElement('span');.............if |
2760 | 20 28 24 63 6f 76 65 72 61 67 65 20 3c 20 31 29 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 | .($coverage.<.1).{.............. |
2780 | 20 20 20 24 6f 75 74 70 75 74 2d 3e 77 72 69 74 65 41 74 74 72 69 62 75 74 65 28 27 63 6c 61 73 | ...$output->writeAttribute('clas |
27a0 | 73 27 2c 20 27 6e 63 27 29 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 24 6f 75 74 70 | s',.'nc');.................$outp |
27c0 | 75 74 2d 3e 74 65 78 74 28 27 20 20 20 20 20 20 20 20 20 20 20 27 29 3b 0a 20 20 20 20 20 20 20 | ut->text('...........');........ |
27e0 | 20 20 20 20 20 7d 20 65 6c 73 65 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 24 6f | .....}.else.{.................$o |
2800 | 75 74 70 75 74 2d 3e 77 72 69 74 65 41 74 74 72 69 62 75 74 65 28 27 63 6c 61 73 73 27 2c 20 27 | utput->writeAttribute('class',.' |
2820 | 63 76 27 29 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 21 24 69 73 74 65 | cv');.................if.(!$iste |
2840 | 73 74 29 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 24 6f 75 74 70 75 | st).{.....................$outpu |
2860 | 74 2d 3e 73 74 61 72 74 45 6c 65 6d 65 6e 74 28 27 61 27 29 3b 0a 20 20 20 20 20 20 20 20 20 20 | t->startElement('a');........... |
2880 | 20 20 20 20 20 20 20 20 20 20 24 6f 75 74 70 75 74 2d 3e 77 72 69 74 65 41 74 74 72 69 62 75 74 | ..........$output->writeAttribut |
28a0 | 65 28 27 68 72 65 66 27 2c 20 24 74 68 69 73 2d 3e 67 65 74 4c 69 6e 65 4c 69 6e 6b 28 24 73 6f | e('href',.$this->getLineLink($so |
28c0 | 75 72 63 65 2d 3e 6e 61 6d 65 28 29 2c 20 24 6e 75 6d 29 29 3b 0a 20 20 20 20 20 20 20 20 20 20 | urce->name(),.$num));........... |
28e0 | 20 20 20 20 20 20 7d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 24 6f 75 74 70 75 74 2d | ......}.................$output- |
2900 | 3e 74 65 78 74 28 73 74 72 5f 70 61 64 28 24 63 6f 76 65 72 61 67 65 2c 20 31 30 2c 20 27 20 27 | >text(str_pad($coverage,.10,.'.' |
2920 | 2c 20 53 54 52 5f 50 41 44 5f 4c 45 46 54 29 20 2e 20 27 20 27 29 3b 0a 20 20 20 20 20 20 20 20 | ,.STR_PAD_LEFT)...'.');......... |
2940 | 20 20 20 20 20 20 20 20 69 66 20 28 21 24 69 73 74 65 73 74 29 20 7b 0a 20 20 20 20 20 20 20 20 | ........if.(!$istest).{......... |
2960 | 20 20 20 20 20 20 20 20 20 20 20 20 24 6f 75 74 70 75 74 2d 3e 65 6e 64 45 6c 65 6d 65 6e 74 28 | ............$output->endElement( |
2980 | 29 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 24 74 68 69 73 2d 3e 72 65 | );.....................$this->re |
29a0 | 6e 64 65 72 4c 69 6e 65 53 75 6d 6d 61 72 79 28 24 73 6f 75 72 63 65 2d 3e 6e 61 6d 65 28 29 2c | nderLineSummary($source->name(), |
29c0 | 20 24 6e 75 6d 2c 20 24 73 6f 75 72 63 65 2d 3e 74 65 73 74 70 61 74 68 28 29 2c 0a 20 20 20 20 | .$num,.$source->testpath(),..... |
29e0 | 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | ................................ |
2a00 | 20 20 20 20 20 20 20 20 20 24 73 6f 75 72 63 65 2d 3e 67 65 74 4c 69 6e 65 4c 69 6e 6b 73 28 24 | .........$source->getLineLinks($ |
2a20 | 6e 75 6d 29 29 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7d 0a 20 20 20 20 20 20 20 | num));.................}........ |
2a40 | 20 20 20 20 20 7d 0a 0a 20 20 20 20 20 20 20 20 20 20 20 20 24 6f 75 74 70 75 74 2d 3e 74 65 78 | .....}..............$output->tex |
2a60 | 74 28 27 3a 20 27 20 2e 20 20 24 6c 69 6e 65 29 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 24 6f | t(':.'....$line);.............$o |
2a80 | 75 74 70 75 74 2d 3e 65 6e 64 45 6c 65 6d 65 6e 74 28 29 3b 0a 20 20 20 20 20 20 20 20 7d 0a 20 | utput->endElement();.........}.. |
2aa0 | 20 20 20 20 20 20 20 24 6f 75 74 70 75 74 2d 3e 65 6e 64 45 6c 65 6d 65 6e 74 28 29 3b 0a 20 20 | .......$output->endElement();... |
2ac0 | 20 20 20 20 20 20 24 6f 75 74 70 75 74 2d 3e 74 65 78 74 28 22 5c 6e 20 22 29 3b 0a 20 20 20 20 | ......$output->text("\n.");..... |
2ae0 | 20 20 20 20 24 6f 75 74 70 75 74 2d 3e 65 6e 64 45 6c 65 6d 65 6e 74 28 29 3b 0a 20 20 20 20 20 | ....$output->endElement();...... |
2b00 | 20 20 20 24 6f 75 74 70 75 74 2d 3e 74 65 78 74 28 22 5c 6e 20 22 29 3b 0a 20 20 20 20 20 20 20 | ...$output->text("\n.");........ |
2b20 | 20 24 6f 75 74 70 75 74 2d 3e 65 6e 64 45 6c 65 6d 65 6e 74 28 29 3b 0a 20 20 20 20 20 20 20 20 | .$output->endElement();......... |
2b40 | 24 6f 75 74 70 75 74 2d 3e 65 6e 64 44 6f 63 75 6d 65 6e 74 28 29 3b 0a 20 20 20 20 7d 0a 0a 20 | $output->endDocument();.....}... |
2b60 | 20 20 20 66 75 6e 63 74 69 6f 6e 20 72 65 6e 64 65 72 53 75 6d 6d 61 72 79 28 41 67 67 72 65 67 | ...function.renderSummary(Aggreg |
2b80 | 61 74 6f 72 20 24 61 67 67 2c 20 61 72 72 61 79 20 24 72 65 73 75 6c 74 73 2c 20 24 69 73 74 65 | ator.$agg,.array.$results,.$iste |
2ba0 | 73 74 20 3d 20 66 61 6c 73 65 2c 20 24 74 6f 74 61 6c 20 3d 20 31 2c 20 24 63 6f 76 65 72 65 64 | st.=.false,.$total.=.1,.$covered |
2bc0 | 20 3d 20 31 29 0a 20 20 20 20 7b 0a 20 20 20 20 20 20 20 20 24 6f 75 74 70 75 74 20 3d 20 6e 65 | .=.1).....{.........$output.=.ne |
2be0 | 77 20 5c 58 4d 4c 57 72 69 74 65 72 3b 0a 20 20 20 20 20 20 20 20 69 66 20 28 21 24 6f 75 74 70 | w.\XMLWriter;.........if.(!$outp |
2c00 | 75 74 2d 3e 6f 70 65 6e 55 72 69 28 27 70 68 70 3a 2f 2f 6f 75 74 70 75 74 27 29 29 20 7b 0a 20 | ut->openUri('php://output')).{.. |
2c20 | 20 20 20 20 20 20 20 20 20 20 20 74 68 72 6f 77 20 6e 65 77 20 45 78 63 65 70 74 69 6f 6e 28 27 | ...........throw.new.Exception(' |
2c40 | 43 61 6e 6e 6f 74 20 72 65 6e 64 65 72 20 74 65 73 74 20 73 75 6d 6d 61 72 79 2c 20 6f 70 65 6e | Cannot.render.test.summary,.open |
2c60 | 69 6e 67 20 58 4d 4c 20 66 61 69 6c 65 64 27 29 3b 0a 20 20 20 20 20 20 20 20 7d 0a 20 20 20 20 | ing.XML.failed');.........}..... |
2c80 | 20 20 20 20 24 6f 75 74 70 75 74 2d 3e 73 65 74 49 6e 64 65 6e 74 53 74 72 69 6e 67 28 27 20 27 | ....$output->setIndentString('.' |
2ca0 | 29 3b 0a 20 20 20 20 20 20 20 20 24 6f 75 74 70 75 74 2d 3e 73 65 74 49 6e 64 65 6e 74 28 74 72 | );.........$output->setIndent(tr |
2cc0 | 75 65 29 3b 0a 20 20 20 20 20 20 20 20 24 6f 75 74 70 75 74 2d 3e 73 74 61 72 74 45 6c 65 6d 65 | ue);.........$output->startEleme |
2ce0 | 6e 74 28 27 68 74 6d 6c 27 29 3b 0a 20 20 20 20 20 20 20 20 24 6f 75 74 70 75 74 2d 3e 73 74 61 | nt('html');.........$output->sta |
2d00 | 72 74 45 6c 65 6d 65 6e 74 28 27 68 65 61 64 27 29 3b 0a 20 20 20 20 20 20 20 20 69 66 20 28 24 | rtElement('head');.........if.($ |
2d20 | 69 73 74 65 73 74 29 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 24 6f 75 74 70 75 74 2d 3e 77 | istest).{.............$output->w |
2d40 | 72 69 74 65 45 6c 65 6d 65 6e 74 28 27 74 69 74 6c 65 27 2c 20 27 43 6f 64 65 20 43 6f 76 65 72 | riteElement('title',.'Code.Cover |
2d60 | 61 67 65 20 53 75 6d 6d 61 72 79 20 5b 27 20 2e 20 24 69 73 74 65 73 74 20 2e 20 27 5d 27 29 3b | age.Summary.['...$istest...']'); |
2d80 | 0a 20 20 20 20 20 20 20 20 7d 20 65 6c 73 65 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 24 6f | .........}.else.{.............$o |
2da0 | 75 74 70 75 74 2d 3e 77 72 69 74 65 45 6c 65 6d 65 6e 74 28 27 74 69 74 6c 65 27 2c 20 27 43 6f | utput->writeElement('title',.'Co |
2dc0 | 64 65 20 43 6f 76 65 72 61 67 65 20 53 75 6d 6d 61 72 79 27 29 3b 0a 20 20 20 20 20 20 20 20 7d | de.Coverage.Summary');.........} |
2de0 | 0a 20 20 20 20 20 20 20 20 24 6f 75 74 70 75 74 2d 3e 73 74 61 72 74 45 6c 65 6d 65 6e 74 28 27 | .........$output->startElement(' |
2e00 | 6c 69 6e 6b 27 29 3b 0a 20 20 20 20 20 20 20 20 24 6f 75 74 70 75 74 2d 3e 77 72 69 74 65 41 74 | link');.........$output->writeAt |
2e20 | 74 72 69 62 75 74 65 28 27 68 72 65 66 27 2c 20 27 63 6f 76 65 72 2e 63 73 73 27 29 3b 0a 20 20 | tribute('href',.'cover.css');... |
2e40 | 20 20 20 20 20 20 24 6f 75 74 70 75 74 2d 3e 77 72 69 74 65 41 74 74 72 69 62 75 74 65 28 27 72 | ......$output->writeAttribute('r |
2e60 | 65 6c 27 2c 20 27 73 74 79 6c 65 73 68 65 65 74 27 29 3b 0a 20 20 20 20 20 20 20 20 24 6f 75 74 | el',.'stylesheet');.........$out |
2e80 | 70 75 74 2d 3e 77 72 69 74 65 41 74 74 72 69 62 75 74 65 28 27 74 79 70 65 27 2c 20 27 74 65 78 | put->writeAttribute('type',.'tex |
2ea0 | 74 2f 63 73 73 27 29 3b 0a 20 20 20 20 20 20 20 20 24 6f 75 74 70 75 74 2d 3e 65 6e 64 45 6c 65 | t/css');.........$output->endEle |
2ec0 | 6d 65 6e 74 28 29 3b 0a 20 20 20 20 20 20 20 20 24 6f 75 74 70 75 74 2d 3e 65 6e 64 45 6c 65 6d | ment();.........$output->endElem |
2ee0 | 65 6e 74 28 29 3b 0a 20 20 20 20 20 20 20 20 24 6f 75 74 70 75 74 2d 3e 73 74 61 72 74 45 6c 65 | ent();.........$output->startEle |
2f00 | 6d 65 6e 74 28 27 62 6f 64 79 27 29 3b 0a 20 20 20 20 20 20 20 20 69 66 20 28 24 69 73 74 65 73 | ment('body');.........if.($istes |
2f20 | 74 29 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 24 6f 75 74 70 75 74 2d 3e 77 72 69 74 65 45 | t).{.............$output->writeE |
2f40 | 6c 65 6d 65 6e 74 28 27 68 32 27 2c 20 27 43 6f 64 65 20 43 6f 76 65 72 61 67 65 20 46 69 6c 65 | lement('h2',.'Code.Coverage.File |
2f60 | 73 20 66 6f 72 20 74 65 73 74 20 27 20 2e 20 24 69 73 74 65 73 74 29 3b 0a 20 20 20 20 20 20 20 | s.for.test.'...$istest);........ |
2f80 | 20 7d 20 65 6c 73 65 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 24 6f 75 74 70 75 74 2d 3e 77 | .}.else.{.............$output->w |
2fa0 | 72 69 74 65 45 6c 65 6d 65 6e 74 28 27 68 32 27 2c 20 27 43 6f 64 65 20 43 6f 76 65 72 61 67 65 | riteElement('h2',.'Code.Coverage |
2fc0 | 20 46 69 6c 65 73 27 29 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 24 6f 75 74 70 75 74 2d 3e 77 | .Files');.............$output->w |
2fe0 | 72 69 74 65 45 6c 65 6d 65 6e 74 28 27 68 33 27 2c 20 27 54 6f 74 61 6c 20 6c 69 6e 65 73 3a 20 | riteElement('h3',.'Total.lines:. |
3000 | 27 20 2e 20 24 74 6f 74 61 6c 20 2e 20 27 2c 20 63 6f 76 65 72 65 64 20 6c 69 6e 65 73 3a 20 27 | '...$total...',.covered.lines:.' |
3020 | 20 2e 20 24 63 6f 76 65 72 65 64 29 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 24 70 65 72 63 65 | ...$covered);.............$perce |
3040 | 6e 74 20 3d 20 30 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 24 74 6f 74 61 6c 20 3e | nt.=.0;.............if.($total.> |
3060 | 20 30 29 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 24 70 65 72 63 65 6e 74 20 3d | .0).{.................$percent.= |
3080 | 20 72 6f 75 6e 64 28 28 24 63 6f 76 65 72 65 64 20 2f 20 24 74 6f 74 61 6c 29 20 2a 20 31 30 30 | .round(($covered./.$total).*.100 |
30a0 | 29 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0a 20 20 20 20 20 20 20 20 20 20 20 20 24 6f 75 | );.............}.............$ou |
30c0 | 74 70 75 74 2d 3e 73 74 61 72 74 45 6c 65 6d 65 6e 74 28 27 70 27 29 3b 0a 20 20 20 20 20 20 20 | tput->startElement('p');........ |
30e0 | 20 20 20 20 20 69 66 20 28 24 70 65 72 63 65 6e 74 20 3c 20 35 30 29 20 7b 0a 20 20 20 20 20 20 | .....if.($percent.<.50).{....... |
3100 | 20 20 20 20 20 20 20 20 20 20 24 6f 75 74 70 75 74 2d 3e 77 72 69 74 65 41 74 74 72 69 62 75 74 | ..........$output->writeAttribut |
3120 | 65 28 27 63 6c 61 73 73 27 2c 20 27 62 61 64 27 29 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d | e('class',.'bad');.............} |
3140 | 20 65 6c 73 65 69 66 20 28 24 70 65 72 63 65 6e 74 20 3c 20 37 35 29 20 7b 0a 20 20 20 20 20 20 | .elseif.($percent.<.75).{....... |
3160 | 20 20 20 20 20 20 20 20 20 20 24 6f 75 74 70 75 74 2d 3e 77 72 69 74 65 41 74 74 72 69 62 75 74 | ..........$output->writeAttribut |
3180 | 65 28 27 63 6c 61 73 73 27 2c 20 27 6f 6b 27 29 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 20 | e('class',.'ok');.............}. |
31a0 | 65 6c 73 65 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 24 6f 75 74 70 75 74 2d 3e | else.{.................$output-> |
31c0 | 77 72 69 74 65 41 74 74 72 69 62 75 74 65 28 27 63 6c 61 73 73 27 2c 20 27 67 6f 6f 64 27 29 3b | writeAttribute('class',.'good'); |
31e0 | 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0a 20 20 20 20 20 20 20 20 20 20 20 20 24 6f 75 74 70 | .............}.............$outp |
3200 | 75 74 2d 3e 74 65 78 74 28 24 70 65 72 63 65 6e 74 20 2e 20 27 25 20 63 6f 64 65 20 63 6f 76 65 | ut->text($percent...'%.code.cove |
3220 | 72 61 67 65 27 29 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 24 6f 75 74 70 75 74 2d 3e 65 6e 64 | rage');.............$output->end |
3240 | 45 6c 65 6d 65 6e 74 28 29 3b 0a 20 20 20 20 20 20 20 20 7d 0a 20 20 20 20 20 20 20 20 24 6f 75 | Element();.........}.........$ou |
3260 | 74 70 75 74 2d 3e 73 74 61 72 74 45 6c 65 6d 65 6e 74 28 27 70 27 29 3b 0a 20 20 20 20 20 20 20 | tput->startElement('p');........ |
3280 | 20 24 6f 75 74 70 75 74 2d 3e 73 74 61 72 74 45 6c 65 6d 65 6e 74 28 27 61 27 29 3b 0a 20 20 20 | .$output->startElement('a');.... |
32a0 | 20 20 20 20 20 24 6f 75 74 70 75 74 2d 3e 77 72 69 74 65 41 74 74 72 69 62 75 74 65 28 27 68 72 | .....$output->writeAttribute('hr |
32c0 | 65 66 27 2c 20 24 74 68 69 73 2d 3e 63 6f 6e 74 72 6f 6c 6c 65 72 2d 3e 67 65 74 54 4f 43 4c 69 | ef',.$this->controller->getTOCLi |
32e0 | 6e 6b 28 74 72 75 65 29 29 3b 0a 20 20 20 20 20 20 20 20 24 6f 75 74 70 75 74 2d 3e 74 65 78 74 | nk(true));.........$output->text |
3300 | 28 27 43 6f 64 65 20 43 6f 76 65 72 61 67 65 20 70 65 72 20 50 48 50 54 20 74 65 73 74 27 29 3b | ('Code.Coverage.per.PHPT.test'); |
3320 | 0a 20 20 20 20 20 20 20 20 24 6f 75 74 70 75 74 2d 3e 65 6e 64 45 6c 65 6d 65 6e 74 28 29 3b 0a | .........$output->endElement();. |
3340 | 20 20 20 20 20 20 20 20 24 6f 75 74 70 75 74 2d 3e 65 6e 64 45 6c 65 6d 65 6e 74 28 29 3b 0a 20 | ........$output->endElement();.. |
3360 | 20 20 20 20 20 20 20 24 6f 75 74 70 75 74 2d 3e 73 74 61 72 74 45 6c 65 6d 65 6e 74 28 27 75 6c | .......$output->startElement('ul |
3380 | 27 29 3b 0a 20 20 20 20 20 20 20 20 66 6f 72 65 61 63 68 20 28 24 72 65 73 75 6c 74 73 20 61 73 | ');.........foreach.($results.as |
33a0 | 20 24 69 20 3d 3e 20 24 6e 61 6d 65 29 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 24 73 6f 75 | .$i.=>.$name).{.............$sou |
33c0 | 72 63 65 20 3d 20 6e 65 77 20 53 6f 75 72 63 65 46 69 6c 65 28 24 6e 61 6d 65 2c 20 24 61 67 67 | rce.=.new.SourceFile($name,.$agg |
33e0 | 2c 20 24 74 68 69 73 2d 3e 74 65 73 74 50 61 74 68 2c 20 24 74 68 69 73 2d 3e 73 6f 75 72 63 65 | ,.$this->testPath,.$this->source |
3400 | 50 61 74 68 29 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 24 6f 75 74 70 75 74 2d 3e 73 74 61 72 | Path);.............$output->star |
3420 | 74 45 6c 65 6d 65 6e 74 28 27 6c 69 27 29 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 24 70 65 72 | tElement('li');.............$per |
3440 | 63 65 6e 74 20 3d 20 24 73 6f 75 72 63 65 2d 3e 63 6f 76 65 72 61 67 65 50 65 72 63 65 6e 74 61 | cent.=.$source->coveragePercenta |
3460 | 67 65 28 29 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 24 6f 75 74 70 75 74 2d 3e 73 74 61 72 74 | ge();.............$output->start |
3480 | 45 6c 65 6d 65 6e 74 28 27 73 70 61 6e 27 29 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 | Element('span');.............if. |
34a0 | 28 24 70 65 72 63 65 6e 74 20 3c 20 35 30 29 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | ($percent.<.50).{............... |
34c0 | 20 20 24 6f 75 74 70 75 74 2d 3e 77 72 69 74 65 41 74 74 72 69 62 75 74 65 28 27 63 6c 61 73 73 | ..$output->writeAttribute('class |
34e0 | 27 2c 20 27 62 61 64 27 29 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 20 65 6c 73 65 69 66 20 | ',.'bad');.............}.elseif. |
3500 | 28 24 70 65 72 63 65 6e 74 20 3c 20 37 35 29 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | ($percent.<.75).{............... |
3520 | 20 20 24 6f 75 74 70 75 74 2d 3e 77 72 69 74 65 41 74 74 72 69 62 75 74 65 28 27 63 6c 61 73 73 | ..$output->writeAttribute('class |
3540 | 27 2c 20 27 6f 6b 27 29 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 20 65 6c 73 65 20 7b 0a 20 | ',.'ok');.............}.else.{.. |
3560 | 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 24 6f 75 74 70 75 74 2d 3e 77 72 69 74 65 41 74 74 | ...............$output->writeAtt |
3580 | 72 69 62 75 74 65 28 27 63 6c 61 73 73 27 2c 20 27 67 6f 6f 64 27 29 3b 0a 20 20 20 20 20 20 20 | ribute('class',.'good');........ |
35a0 | 20 20 20 20 20 7d 0a 20 20 20 20 20 20 20 20 20 20 20 20 24 6f 75 74 70 75 74 2d 3e 74 65 78 74 | .....}.............$output->text |
35c0 | 28 27 20 43 6f 76 65 72 61 67 65 3a 20 27 20 2e 20 73 74 72 5f 70 61 64 28 24 70 65 72 63 65 6e | ('.Coverage:.'...str_pad($percen |
35e0 | 74 20 2e 20 27 25 27 2c 20 34 2c 20 27 20 27 2c 20 53 54 52 5f 50 41 44 5f 4c 45 46 54 29 29 3b | t...'%',.4,.'.',.STR_PAD_LEFT)); |
3600 | 0a 20 20 20 20 20 20 20 20 20 20 20 20 24 6f 75 74 70 75 74 2d 3e 65 6e 64 45 6c 65 6d 65 6e 74 | .............$output->endElement |
3620 | 28 29 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 24 6f 75 74 70 75 74 2d 3e 73 74 61 72 74 45 6c | ();.............$output->startEl |
3640 | 65 6d 65 6e 74 28 27 61 27 29 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 24 6f 75 74 70 75 74 2d | ement('a');.............$output- |
3660 | 3e 77 72 69 74 65 41 74 74 72 69 62 75 74 65 28 27 68 72 65 66 27 2c 20 24 74 68 69 73 2d 3e 6d | >writeAttribute('href',.$this->m |
3680 | 61 6e 67 6c 65 46 69 6c 65 28 24 6e 61 6d 65 2c 20 24 69 73 74 65 73 74 29 29 3b 0a 20 20 20 20 | angleFile($name,.$istest));..... |
36a0 | 20 20 20 20 20 20 20 20 24 6f 75 74 70 75 74 2d 3e 74 65 78 74 28 24 73 6f 75 72 63 65 2d 3e 73 | ........$output->text($source->s |
36c0 | 68 6f 72 74 4e 61 6d 65 28 29 29 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 24 6f 75 74 70 75 74 | hortName());.............$output |
36e0 | 2d 3e 65 6e 64 45 6c 65 6d 65 6e 74 28 29 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 24 6f 75 74 | ->endElement();.............$out |
3700 | 70 75 74 2d 3e 65 6e 64 45 6c 65 6d 65 6e 74 28 29 3b 0a 20 20 20 20 20 20 20 20 7d 0a 20 20 20 | put->endElement();.........}.... |
3720 | 20 20 20 20 20 24 6f 75 74 70 75 74 2d 3e 65 6e 64 45 6c 65 6d 65 6e 74 28 29 3b 0a 20 20 20 20 | .....$output->endElement();..... |
3740 | 20 20 20 20 24 6f 75 74 70 75 74 2d 3e 65 6e 64 45 6c 65 6d 65 6e 74 28 29 3b 0a 20 20 20 20 20 | ....$output->endElement();...... |
3760 | 20 20 20 24 6f 75 74 70 75 74 2d 3e 65 6e 64 44 6f 63 75 6d 65 6e 74 28 29 3b 0a 20 20 20 20 7d | ...$output->endDocument();.....} |
3780 | 0a 0a 20 20 20 20 66 75 6e 63 74 69 6f 6e 20 72 65 6e 64 65 72 54 65 73 74 53 75 6d 6d 61 72 79 | ......function.renderTestSummary |
37a0 | 28 41 67 67 72 65 67 61 74 6f 72 20 24 61 67 67 29 0a 20 20 20 20 7b 0a 20 20 20 20 20 20 20 20 | (Aggregator.$agg).....{......... |
37c0 | 24 6f 75 74 70 75 74 20 3d 20 6e 65 77 20 5c 58 4d 4c 57 72 69 74 65 72 3b 0a 20 20 20 20 20 20 | $output.=.new.\XMLWriter;....... |
37e0 | 20 20 69 66 20 28 21 24 6f 75 74 70 75 74 2d 3e 6f 70 65 6e 55 72 69 28 27 70 68 70 3a 2f 2f 6f | ..if.(!$output->openUri('php://o |
3800 | 75 74 70 75 74 27 29 29 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 74 68 72 6f 77 | utput')).{.................throw |
3820 | 20 6e 65 77 20 45 78 63 65 70 74 69 6f 6e 28 27 43 61 6e 6e 6f 74 20 72 65 6e 64 65 72 20 74 65 | .new.Exception('Cannot.render.te |
3840 | 73 74 73 20 73 75 6d 6d 61 72 79 2c 20 6f 70 65 6e 69 6e 67 20 58 4d 4c 20 66 61 69 6c 65 64 27 | sts.summary,.opening.XML.failed' |
3860 | 29 3b 0a 20 20 20 20 20 20 20 20 7d 0a 20 20 20 20 20 20 20 20 24 6f 75 74 70 75 74 2d 3e 73 65 | );.........}.........$output->se |
3880 | 74 49 6e 64 65 6e 74 53 74 72 69 6e 67 28 27 20 27 29 3b 0a 20 20 20 20 20 20 20 20 24 6f 75 74 | tIndentString('.');.........$out |
38a0 | 70 75 74 2d 3e 73 65 74 49 6e 64 65 6e 74 28 74 72 75 65 29 3b 0a 20 20 20 20 20 20 20 20 24 6f | put->setIndent(true);.........$o |
38c0 | 75 74 70 75 74 2d 3e 73 74 61 72 74 45 6c 65 6d 65 6e 74 28 27 68 74 6d 6c 27 29 3b 0a 20 20 20 | utput->startElement('html');.... |
38e0 | 20 20 20 20 20 24 6f 75 74 70 75 74 2d 3e 73 74 61 72 74 45 6c 65 6d 65 6e 74 28 27 68 65 61 64 | .....$output->startElement('head |
3900 | 27 29 3b 0a 20 20 20 20 20 20 20 20 24 6f 75 74 70 75 74 2d 3e 77 72 69 74 65 45 6c 65 6d 65 6e | ');.........$output->writeElemen |
3920 | 74 28 27 74 69 74 6c 65 27 2c 20 27 54 65 73 74 20 53 75 6d 6d 61 72 79 27 29 3b 0a 20 20 20 20 | t('title',.'Test.Summary');..... |
3940 | 20 20 20 20 24 6f 75 74 70 75 74 2d 3e 73 74 61 72 74 45 6c 65 6d 65 6e 74 28 27 6c 69 6e 6b 27 | ....$output->startElement('link' |
3960 | 29 3b 0a 20 20 20 20 20 20 20 20 24 6f 75 74 70 75 74 2d 3e 77 72 69 74 65 41 74 74 72 69 62 75 | );.........$output->writeAttribu |
3980 | 74 65 28 27 68 72 65 66 27 2c 20 27 63 6f 76 65 72 2e 63 73 73 27 29 3b 0a 20 20 20 20 20 20 20 | te('href',.'cover.css');........ |
39a0 | 20 24 6f 75 74 70 75 74 2d 3e 77 72 69 74 65 41 74 74 72 69 62 75 74 65 28 27 72 65 6c 27 2c 20 | .$output->writeAttribute('rel',. |
39c0 | 27 73 74 79 6c 65 73 68 65 65 74 27 29 3b 0a 20 20 20 20 20 20 20 20 24 6f 75 74 70 75 74 2d 3e | 'stylesheet');.........$output-> |
39e0 | 77 72 69 74 65 41 74 74 72 69 62 75 74 65 28 27 74 79 70 65 27 2c 20 27 74 65 78 74 2f 63 73 73 | writeAttribute('type',.'text/css |
3a00 | 27 29 3b 0a 20 20 20 20 20 20 20 20 24 6f 75 74 70 75 74 2d 3e 65 6e 64 45 6c 65 6d 65 6e 74 28 | ');.........$output->endElement( |
3a20 | 29 3b 0a 20 20 20 20 20 20 20 20 24 6f 75 74 70 75 74 2d 3e 65 6e 64 45 6c 65 6d 65 6e 74 28 29 | );.........$output->endElement() |
3a40 | 3b 0a 20 20 20 20 20 20 20 20 24 6f 75 74 70 75 74 2d 3e 73 74 61 72 74 45 6c 65 6d 65 6e 74 28 | ;.........$output->startElement( |
3a60 | 27 62 6f 64 79 27 29 3b 0a 20 20 20 20 20 20 20 20 24 6f 75 74 70 75 74 2d 3e 77 72 69 74 65 45 | 'body');.........$output->writeE |
3a80 | 6c 65 6d 65 6e 74 28 27 68 32 27 2c 20 27 54 65 73 74 73 20 45 78 65 63 75 74 65 64 2c 20 63 6c | lement('h2',.'Tests.Executed,.cl |
3aa0 | 69 63 6b 20 66 6f 72 20 63 6f 64 65 20 63 6f 76 65 72 61 67 65 20 73 75 6d 6d 61 72 79 27 29 3b | ick.for.code.coverage.summary'); |
3ac0 | 0a 20 20 20 20 20 20 20 20 24 6f 75 74 70 75 74 2d 3e 73 74 61 72 74 45 6c 65 6d 65 6e 74 28 27 | .........$output->startElement(' |
3ae0 | 70 27 29 3b 0a 20 20 20 20 20 20 20 20 24 6f 75 74 70 75 74 2d 3e 73 74 61 72 74 45 6c 65 6d 65 | p');.........$output->startEleme |
3b00 | 6e 74 28 27 61 27 29 3b 0a 20 20 20 20 20 20 20 20 24 6f 75 74 70 75 74 2d 3e 77 72 69 74 65 41 | nt('a');.........$output->writeA |
3b20 | 74 74 72 69 62 75 74 65 28 27 68 72 65 66 27 2c 20 24 74 68 69 73 2d 3e 63 6f 6e 74 72 6f 6c 6c | ttribute('href',.$this->controll |
3b40 | 65 72 2d 3e 67 65 74 54 4f 43 6c 69 6e 6b 28 29 29 3b 0a 20 20 20 20 20 20 20 20 24 6f 75 74 70 | er->getTOClink());.........$outp |
3b60 | 75 74 2d 3e 74 65 78 74 28 27 41 67 67 72 65 67 61 74 65 20 43 6f 64 65 20 43 6f 76 65 72 61 67 | ut->text('Aggregate.Code.Coverag |
3b80 | 65 20 66 6f 72 20 61 6c 6c 20 74 65 73 74 73 27 29 3b 0a 20 20 20 20 20 20 20 20 24 6f 75 74 70 | e.for.all.tests');.........$outp |
3ba0 | 75 74 2d 3e 65 6e 64 45 6c 65 6d 65 6e 74 28 29 3b 0a 20 20 20 20 20 20 20 20 24 6f 75 74 70 75 | ut->endElement();.........$outpu |
3bc0 | 74 2d 3e 65 6e 64 45 6c 65 6d 65 6e 74 28 29 3b 0a 20 20 20 20 20 20 20 20 24 6f 75 74 70 75 74 | t->endElement();.........$output |
3be0 | 2d 3e 73 74 61 72 74 45 6c 65 6d 65 6e 74 28 27 75 6c 27 29 3b 0a 20 20 20 20 20 20 20 20 66 6f | ->startElement('ul');.........fo |
3c00 | 72 65 61 63 68 20 28 24 61 67 67 2d 3e 72 65 74 72 69 65 76 65 54 65 73 74 50 61 74 68 73 28 29 | reach.($agg->retrieveTestPaths() |
3c20 | 20 61 73 20 24 74 65 73 74 29 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 24 6f 75 74 70 75 74 | .as.$test).{.............$output |
3c40 | 2d 3e 73 74 61 72 74 45 6c 65 6d 65 6e 74 28 27 6c 69 27 29 3b 0a 20 20 20 20 20 20 20 20 20 20 | ->startElement('li');........... |
3c60 | 20 20 24 6f 75 74 70 75 74 2d 3e 73 74 61 72 74 45 6c 65 6d 65 6e 74 28 27 61 27 29 3b 0a 20 20 | ..$output->startElement('a');... |
3c80 | 20 20 20 20 20 20 20 20 20 20 24 6f 75 74 70 75 74 2d 3e 77 72 69 74 65 41 74 74 72 69 62 75 74 | ..........$output->writeAttribut |
3ca0 | 65 28 27 68 72 65 66 27 2c 20 24 74 68 69 73 2d 3e 6d 61 6e 67 6c 65 54 65 73 74 46 69 6c 65 28 | e('href',.$this->mangleTestFile( |
3cc0 | 24 74 65 73 74 29 29 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 24 6f 75 74 70 75 74 2d 3e 74 65 | $test));.............$output->te |
3ce0 | 78 74 28 73 74 72 5f 72 65 70 6c 61 63 65 28 24 61 67 67 2d 3e 74 65 73 74 70 61 74 68 20 2e 20 | xt(str_replace($agg->testpath... |
3d00 | 27 2f 27 2c 20 27 27 2c 20 24 74 65 73 74 29 29 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 24 6f | '/',.'',.$test));.............$o |
3d20 | 75 74 70 75 74 2d 3e 65 6e 64 45 6c 65 6d 65 6e 74 28 29 3b 0a 20 20 20 20 20 20 20 20 20 20 20 | utput->endElement();............ |
3d40 | 20 24 6f 75 74 70 75 74 2d 3e 65 6e 64 45 6c 65 6d 65 6e 74 28 29 3b 0a 20 20 20 20 20 20 20 20 | .$output->endElement();......... |
3d60 | 7d 0a 20 20 20 20 20 20 20 20 24 6f 75 74 70 75 74 2d 3e 65 6e 64 45 6c 65 6d 65 6e 74 28 29 3b | }.........$output->endElement(); |
3d80 | 0a 20 20 20 20 20 20 20 20 24 6f 75 74 70 75 74 2d 3e 65 6e 64 45 6c 65 6d 65 6e 74 28 29 3b 0a | .........$output->endElement();. |
3da0 | 20 20 20 20 20 20 20 20 24 6f 75 74 70 75 74 2d 3e 65 6e 64 44 6f 63 75 6d 65 6e 74 28 29 3b 0a | ........$output->endDocument();. |
3dc0 | 20 20 20 20 7d 0a 0a 20 20 20 20 66 75 6e 63 74 69 6f 6e 20 72 65 6e 64 65 72 54 65 73 74 43 6f | ....}......function.renderTestCo |
3de0 | 76 65 72 61 67 65 28 41 67 67 72 65 67 61 74 6f 72 20 24 61 67 67 2c 20 24 74 65 73 74 70 61 74 | verage(Aggregator.$agg,.$testpat |
3e00 | 68 2c 20 24 74 65 73 74 29 0a 20 20 20 20 7b 0a 20 20 20 20 20 20 20 20 24 72 65 6c 74 65 73 74 | h,.$test).....{.........$reltest |
3e20 | 20 3d 20 73 74 72 5f 72 65 70 6c 61 63 65 28 24 74 65 73 74 70 61 74 68 20 2e 20 27 2f 27 2c 20 | .=.str_replace($testpath...'/',. |
3e40 | 27 27 2c 20 24 74 65 73 74 29 3b 0a 20 20 20 20 20 20 20 20 24 6f 75 74 70 75 74 20 3d 20 6e 65 | '',.$test);.........$output.=.ne |
3e60 | 77 20 5c 58 4d 4c 57 72 69 74 65 72 3b 0a 20 20 20 20 20 20 20 20 69 66 20 28 21 24 6f 75 74 70 | w.\XMLWriter;.........if.(!$outp |
3e80 | 75 74 2d 3e 6f 70 65 6e 55 72 69 28 27 70 68 70 3a 2f 2f 6f 75 74 70 75 74 27 29 29 20 7b 0a 20 | ut->openUri('php://output')).{.. |
3ea0 | 20 20 20 20 20 20 20 20 20 20 20 74 68 72 6f 77 20 6e 65 77 20 45 78 63 65 70 74 69 6f 6e 28 27 | ...........throw.new.Exception(' |
3ec0 | 43 61 6e 6e 6f 74 20 72 65 6e 64 65 72 20 74 65 73 74 20 27 20 2e 20 24 72 65 6c 74 65 73 74 20 | Cannot.render.test.'...$reltest. |
3ee0 | 2e 20 27 20 63 6f 76 65 72 61 67 65 2c 20 6f 70 65 6e 69 6e 67 20 58 4d 4c 20 66 61 69 6c 65 64 | ..'.coverage,.opening.XML.failed |
3f00 | 27 29 3b 0a 20 20 20 20 20 20 20 20 7d 0a 20 20 20 20 20 20 20 20 20 20 20 20 24 6f 75 74 70 75 | ');.........}.............$outpu |
3f20 | 74 2d 3e 73 65 74 49 6e 64 65 6e 74 53 74 72 69 6e 67 28 27 20 27 29 3b 0a 20 20 20 20 20 20 20 | t->setIndentString('.');........ |
3f40 | 20 20 20 20 20 24 6f 75 74 70 75 74 2d 3e 73 65 74 49 6e 64 65 6e 74 28 74 72 75 65 29 3b 0a 20 | .....$output->setIndent(true);.. |
3f60 | 20 20 20 20 20 20 20 20 20 20 20 24 6f 75 74 70 75 74 2d 3e 73 74 61 72 74 45 6c 65 6d 65 6e 74 | ...........$output->startElement |
3f80 | 28 27 68 74 6d 6c 27 29 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 24 6f 75 74 70 75 74 2d 3e 73 | ('html');.............$output->s |
3fa0 | 74 61 72 74 45 6c 65 6d 65 6e 74 28 27 68 65 61 64 27 29 3b 0a 20 20 20 20 20 20 20 20 20 20 20 | tartElement('head');............ |
3fc0 | 20 24 6f 75 74 70 75 74 2d 3e 77 72 69 74 65 45 6c 65 6d 65 6e 74 28 27 74 69 74 6c 65 27 2c 20 | .$output->writeElement('title',. |
3fe0 | 27 43 6f 64 65 20 43 6f 76 65 72 61 67 65 20 53 75 6d 6d 61 72 79 20 66 6f 72 20 74 65 73 74 20 | 'Code.Coverage.Summary.for.test. |
4000 | 27 20 2e 20 24 72 65 6c 74 65 73 74 29 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 24 6f 75 74 70 | '...$reltest);.............$outp |
4020 | 75 74 2d 3e 73 74 61 72 74 45 6c 65 6d 65 6e 74 28 27 6c 69 6e 6b 27 29 3b 0a 20 20 20 20 20 20 | ut->startElement('link');....... |
4040 | 20 20 20 20 20 20 24 6f 75 74 70 75 74 2d 3e 77 72 69 74 65 41 74 74 72 69 62 75 74 65 28 27 68 | ......$output->writeAttribute('h |
4060 | 72 65 66 27 2c 20 27 63 6f 76 65 72 2e 63 73 73 27 29 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 | ref',.'cover.css');............. |
4080 | 24 6f 75 74 70 75 74 2d 3e 77 72 69 74 65 41 74 74 72 69 62 75 74 65 28 27 72 65 6c 27 2c 20 27 | $output->writeAttribute('rel',.' |
40a0 | 73 74 79 6c 65 73 68 65 65 74 27 29 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 24 6f 75 74 70 75 | stylesheet');.............$outpu |
40c0 | 74 2d 3e 77 72 69 74 65 41 74 74 72 69 62 75 74 65 28 27 74 79 70 65 27 2c 20 27 74 65 78 74 2f | t->writeAttribute('type',.'text/ |
40e0 | 63 73 73 27 29 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 24 6f 75 74 70 75 74 2d 3e 65 6e 64 45 | css');.............$output->endE |
4100 | 6c 65 6d 65 6e 74 28 29 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 24 6f 75 74 70 75 74 2d 3e 65 | lement();.............$output->e |
4120 | 6e 64 45 6c 65 6d 65 6e 74 28 29 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 24 6f 75 74 70 75 74 | ndElement();.............$output |
4140 | 2d 3e 73 74 61 72 74 45 6c 65 6d 65 6e 74 28 27 62 6f 64 79 27 29 3b 0a 20 20 20 20 20 20 20 20 | ->startElement('body');......... |
4160 | 20 20 20 20 24 6f 75 74 70 75 74 2d 3e 77 72 69 74 65 45 6c 65 6d 65 6e 74 28 27 68 32 27 2c 20 | ....$output->writeElement('h2',. |
4180 | 27 43 6f 64 65 20 43 6f 76 65 72 61 67 65 20 46 69 6c 65 73 20 66 6f 72 20 74 65 73 74 20 27 20 | 'Code.Coverage.Files.for.test.'. |
41a0 | 2e 20 24 72 65 6c 74 65 73 74 29 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 24 6f 75 74 70 75 74 | ..$reltest);.............$output |
41c0 | 2d 3e 73 74 61 72 74 45 6c 65 6d 65 6e 74 28 27 75 6c 27 29 3b 0a 20 20 20 20 20 20 20 20 20 20 | ->startElement('ul');........... |
41e0 | 20 20 24 70 61 74 68 73 20 3d 20 24 61 67 67 2d 3e 72 65 74 72 69 65 76 65 50 61 74 68 73 46 6f | ..$paths.=.$agg->retrievePathsFo |
4200 | 72 54 65 73 74 28 24 74 65 73 74 29 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 66 6f 72 65 61 63 | rTest($test);.............foreac |
4220 | 68 20 28 24 70 61 74 68 73 20 61 73 20 24 6e 61 6d 65 29 20 7b 0a 20 20 20 20 20 20 20 20 20 20 | h.($paths.as.$name).{........... |
4240 | 20 20 20 20 20 20 65 63 68 6f 20 27 2e 27 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | ......echo.'.';................. |
4260 | 24 73 6f 75 72 63 65 20 3d 20 6e 65 77 20 53 6f 75 72 63 65 46 69 6c 65 5c 50 65 72 54 65 73 74 | $source.=.new.SourceFile\PerTest |
4280 | 28 24 6e 61 6d 65 2c 20 24 61 67 67 2c 20 24 74 65 73 74 70 61 74 68 2c 20 24 62 61 73 65 50 61 | ($name,.$agg,.$testpath,.$basePa |
42a0 | 74 68 2c 20 24 74 65 73 74 29 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 24 74 68 69 | th,.$test);.................$thi |
42c0 | 73 2d 3e 72 65 6e 64 65 72 28 24 73 6f 75 72 63 65 2c 20 24 72 65 6c 74 65 73 74 29 3b 0a 20 20 | s->render($source,.$reltest);... |
42e0 | 20 20 20 20 20 20 20 20 20 20 20 20 20 20 24 6f 75 74 70 75 74 2d 3e 73 74 61 72 74 45 6c 65 6d | ..............$output->startElem |
4300 | 65 6e 74 28 27 6c 69 27 29 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 24 70 65 72 63 | ent('li');.................$perc |
4320 | 65 6e 74 20 3d 20 24 73 6f 75 72 63 65 2d 3e 63 6f 76 65 72 61 67 65 50 65 72 63 65 6e 74 61 67 | ent.=.$source->coveragePercentag |
4340 | 65 28 29 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 24 6f 75 74 70 75 74 2d 3e 73 74 | e();.................$output->st |
4360 | 61 72 74 45 6c 65 6d 65 6e 74 28 27 73 70 61 6e 27 29 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 | artElement('span');............. |
4380 | 20 20 20 20 69 66 20 28 24 70 65 72 63 65 6e 74 20 3c 20 35 30 29 20 7b 0a 20 20 20 20 20 20 20 | ....if.($percent.<.50).{........ |
43a0 | 20 20 20 20 20 20 20 20 20 20 20 20 20 24 6f 75 74 70 75 74 2d 3e 77 72 69 74 65 41 74 74 72 69 | .............$output->writeAttri |
43c0 | 62 75 74 65 28 27 63 6c 61 73 73 27 2c 20 27 62 61 64 27 29 3b 0a 20 20 20 20 20 20 20 20 20 20 | bute('class',.'bad');........... |
43e0 | 20 20 20 20 20 20 7d 20 65 6c 73 65 69 66 20 28 24 70 65 72 63 65 6e 74 20 3c 20 37 35 29 20 7b | ......}.elseif.($percent.<.75).{ |
4400 | 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 24 6f 75 74 70 75 74 2d 3e 77 72 | .....................$output->wr |
4420 | 69 74 65 41 74 74 72 69 62 75 74 65 28 27 63 6c 61 73 73 27 2c 20 27 6f 6b 27 29 3b 0a 20 20 20 | iteAttribute('class',.'ok');.... |
4440 | 20 20 20 20 20 20 20 20 20 20 20 20 20 7d 20 65 6c 73 65 20 7b 0a 20 20 20 20 20 20 20 20 20 20 | .............}.else.{........... |
4460 | 20 20 20 20 20 20 20 20 20 20 24 6f 75 74 70 75 74 2d 3e 77 72 69 74 65 41 74 74 72 69 62 75 74 | ..........$output->writeAttribut |
4480 | 65 28 27 63 6c 61 73 73 27 2c 20 27 67 6f 6f 64 27 29 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 | e('class',.'good');............. |
44a0 | 20 20 20 20 7d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 24 6f 75 74 70 75 74 2d 3e 74 | ....}.................$output->t |
44c0 | 65 78 74 28 27 20 43 6f 76 65 72 61 67 65 3a 20 27 20 2e 20 73 74 72 5f 70 61 64 28 24 73 6f 75 | ext('.Coverage:.'...str_pad($sou |
44e0 | 72 63 65 2d 3e 63 6f 76 65 72 61 67 65 50 65 72 63 65 6e 74 61 67 65 28 29 20 2e 20 27 25 27 2c | rce->coveragePercentage()...'%', |
4500 | 20 34 2c 20 27 20 27 2c 20 53 54 52 5f 50 41 44 5f 4c 45 46 54 29 29 3b 0a 20 20 20 20 20 20 20 | .4,.'.',.STR_PAD_LEFT));........ |
4520 | 20 20 20 20 20 20 20 20 20 24 6f 75 74 70 75 74 2d 3e 65 6e 64 45 6c 65 6d 65 6e 74 28 29 3b 0a | .........$output->endElement();. |
4540 | 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 24 6f 75 74 70 75 74 2d 3e 73 74 61 72 74 45 6c | ................$output->startEl |
4560 | 65 6d 65 6e 74 28 27 61 27 29 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 24 6f 75 74 | ement('a');.................$out |
4580 | 70 75 74 2d 3e 77 72 69 74 65 41 74 74 72 69 62 75 74 65 28 27 68 72 65 66 27 2c 20 24 74 68 69 | put->writeAttribute('href',.$thi |
45a0 | 73 2d 3e 6d 61 6e 67 6c 65 46 69 6c 65 28 24 6e 61 6d 65 2c 20 24 72 65 6c 74 65 73 74 29 29 3b | s->mangleFile($name,.$reltest)); |
45c0 | 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 24 6f 75 74 70 75 74 2d 3e 74 65 78 74 28 24 | .................$output->text($ |
45e0 | 73 6f 75 72 63 65 2d 3e 73 68 6f 72 74 4e 61 6d 65 28 29 29 3b 0a 20 20 20 20 20 20 20 20 20 20 | source->shortName());........... |
4600 | 20 20 20 20 20 20 24 6f 75 74 70 75 74 2d 3e 65 6e 64 45 6c 65 6d 65 6e 74 28 29 3b 0a 20 20 20 | ......$output->endElement();.... |
4620 | 20 20 20 20 20 20 20 20 20 20 20 20 20 24 6f 75 74 70 75 74 2d 3e 65 6e 64 45 6c 65 6d 65 6e 74 | .............$output->endElement |
4640 | 28 29 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0a 20 20 20 20 20 20 20 20 20 20 20 20 65 63 | ();.............}.............ec |
4660 | 68 6f 20 22 64 6f 6e 65 5c 6e 22 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 24 6f 75 74 70 75 74 | ho."done\n";.............$output |
4680 | 2d 3e 65 6e 64 45 6c 65 6d 65 6e 74 28 29 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 24 6f 75 74 | ->endElement();.............$out |
46a0 | 70 75 74 2d 3e 65 6e 64 45 6c 65 6d 65 6e 74 28 29 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 24 | put->endElement();.............$ |
46c0 | 6f 75 74 70 75 74 2d 3e 65 6e 64 44 6f 63 75 6d 65 6e 74 28 29 3b 0a 20 20 20 20 20 20 20 20 7d | output->endDocument();.........} |
46e0 | 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 64 6f 6e 65 5c 6e 22 3b 0a 20 20 20 20 7d 0a 7d 0a | .........echo."done\n";.....}.}. |
4700 | 7d 0a 3f 3e 0a 3c 3f 70 68 70 0a 6e 61 6d 65 73 70 61 63 65 20 50 45 41 52 32 5c 50 79 72 75 73 | }.?>.<?php.namespace.PEAR2\Pyrus |
4720 | 5c 44 65 76 65 6c 6f 70 65 72 5c 43 6f 76 65 72 61 67 65 41 6e 61 6c 79 7a 65 72 5c 57 65 62 20 | \Developer\CoverageAnalyzer\Web. |
4740 | 7b 0a 75 73 65 20 50 45 41 52 32 5c 50 79 72 75 73 5c 44 65 76 65 6c 6f 70 65 72 5c 43 6f 76 65 | {.use.PEAR2\Pyrus\Developer\Cove |
4760 | 72 61 67 65 41 6e 61 6c 79 7a 65 72 3b 0a 63 6c 61 73 73 20 41 67 67 72 65 67 61 74 6f 72 20 65 | rageAnalyzer;.class.Aggregator.e |
4780 | 78 74 65 6e 64 73 20 43 6f 76 65 72 61 67 65 41 6e 61 6c 79 7a 65 72 5c 41 67 67 72 65 67 61 74 | xtends.CoverageAnalyzer\Aggregat |
47a0 | 6f 72 3b 0a 7b 0a 20 20 20 20 70 72 6f 74 65 63 74 65 64 20 24 63 6f 64 65 70 61 74 68 3b 0a 20 | or;.{.....protected.$codepath;.. |
47c0 | 20 20 20 70 72 6f 74 65 63 74 65 64 20 24 74 65 73 74 70 61 74 68 3b 0a 20 20 20 20 70 72 6f 74 | ...protected.$testpath;.....prot |
47e0 | 65 63 74 65 64 20 24 73 71 6c 69 74 65 3b 0a 20 20 20 20 70 75 62 6c 69 63 20 24 74 6f 74 61 6c | ected.$sqlite;.....public.$total |
4800 | 6c 69 6e 65 73 20 3d 20 30 3b 0a 20 20 20 20 70 75 62 6c 69 63 20 24 74 6f 74 61 6c 63 6f 76 65 | lines.=.0;.....public.$totalcove |
4820 | 72 65 64 6c 69 6e 65 73 20 3d 20 30 3b 0a 0a 20 20 20 20 2f 2a 2a 0a 20 20 20 20 20 2a 20 40 76 | redlines.=.0;....../**......*.@v |
4840 | 61 72 20 73 74 72 69 6e 67 20 24 74 65 73 74 70 61 74 68 20 4c 6f 63 61 74 69 6f 6e 20 6f 66 20 | ar.string.$testpath.Location.of. |
4860 | 2e 70 68 70 74 20 66 69 6c 65 73 0a 20 20 20 20 20 2a 20 40 76 61 72 20 73 74 72 69 6e 67 20 24 | .phpt.files......*.@var.string.$ |
4880 | 63 6f 64 65 70 61 74 68 20 4c 6f 63 61 74 69 6f 6e 20 6f 66 20 63 6f 64 65 20 77 68 6f 73 65 20 | codepath.Location.of.code.whose. |
48a0 | 63 6f 76 65 72 61 67 65 20 77 65 20 61 72 65 20 74 65 73 74 69 6e 67 0a 20 20 20 20 20 2a 2f 0a | coverage.we.are.testing......*/. |
48c0 | 20 20 20 20 66 75 6e 63 74 69 6f 6e 20 5f 5f 63 6f 6e 73 74 72 75 63 74 28 24 74 65 73 74 70 61 | ....function.__construct($testpa |
48e0 | 74 68 2c 20 24 63 6f 64 65 70 61 74 68 2c 20 24 64 62 20 3d 20 27 3a 6d 65 6d 6f 72 79 3a 27 29 | th,.$codepath,.$db.=.':memory:') |
4900 | 0a 20 20 20 20 7b 0a 20 20 20 20 20 20 20 20 24 6e 65 77 63 6f 64 65 70 61 74 68 20 3d 20 72 65 | .....{.........$newcodepath.=.re |
4920 | 61 6c 70 61 74 68 28 24 63 6f 64 65 70 61 74 68 29 3b 0a 20 20 20 20 20 20 20 20 69 66 20 28 21 | alpath($codepath);.........if.(! |
4940 | 24 6e 65 77 63 6f 64 65 70 61 74 68 29 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 | $newcodepath).{.............if.( |
4960 | 21 73 74 72 70 6f 73 28 24 63 6f 64 65 70 61 74 68 2c 20 27 3a 2f 2f 27 29 20 7c 7c 20 21 66 69 | !strpos($codepath,.'://').||.!fi |
4980 | 6c 65 5f 65 78 69 73 74 73 28 24 63 6f 64 65 70 61 74 68 29 29 20 7b 0a 20 20 20 20 20 20 20 20 | le_exists($codepath)).{......... |
49a0 | 20 20 20 20 20 20 20 20 2f 2f 20 73 74 72 65 61 6d 20 77 72 61 70 70 65 72 20 6e 6f 74 20 66 6f | ........//.stream.wrapper.not.fo |
49c0 | 75 6e 64 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 74 68 72 6f 77 20 6e 65 77 20 45 78 | und.................throw.new.Ex |
49e0 | 63 65 70 74 69 6f 6e 28 27 43 61 6e 20 6e 6f 74 20 66 69 6e 64 20 63 6f 64 65 20 70 61 74 68 20 | ception('Can.not.find.code.path. |
4a00 | 24 63 6f 64 65 70 61 74 68 27 29 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0a 20 20 20 20 20 | $codepath');.............}...... |
4a20 | 20 20 20 7d 20 65 6c 73 65 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 24 63 6f 64 65 70 61 74 | ...}.else.{.............$codepat |
4a40 | 68 20 3d 20 24 6e 65 77 63 6f 64 65 70 61 74 68 3b 0a 20 20 20 20 20 20 20 20 7d 0a 20 20 20 20 | h.=.$newcodepath;.........}..... |
4a60 | 20 20 20 20 24 74 68 69 73 2d 3e 73 71 6c 69 74 65 20 3d 20 6e 65 77 20 53 71 6c 69 74 65 28 24 | ....$this->sqlite.=.new.Sqlite($ |
4a80 | 63 6f 64 65 70 61 74 68 2c 20 24 64 62 29 3b 0a 20 20 20 20 20 20 20 20 24 74 68 69 73 2d 3e 63 | codepath,.$db);.........$this->c |
4aa0 | 6f 64 65 70 61 74 68 20 3d 20 24 63 6f 64 65 70 61 74 68 3b 0a 20 20 20 20 7d 0a 0a 20 20 20 20 | odepath.=.$codepath;.....}...... |
4ac0 | 66 75 6e 63 74 69 6f 6e 20 72 65 74 72 69 65 76 65 4c 69 6e 65 4c 69 6e 6b 73 28 24 66 69 6c 65 | function.retrieveLineLinks($file |
4ae0 | 29 0a 20 20 20 20 7b 0a 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 24 74 68 69 73 2d 3e 73 71 | ).....{.........return.$this->sq |
4b00 | 6c 69 74 65 2d 3e 72 65 74 72 69 65 76 65 4c 69 6e 65 4c 69 6e 6b 73 28 24 66 69 6c 65 29 3b 0a | lite->retrieveLineLinks($file);. |
4b20 | 20 20 20 20 7d 0a 0a 20 20 20 20 66 75 6e 63 74 69 6f 6e 20 72 65 74 72 69 65 76 65 50 61 74 68 | ....}......function.retrievePath |
4b40 | 73 28 29 0a 20 20 20 20 7b 0a 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 24 74 68 69 73 2d 3e | s().....{.........return.$this-> |
4b60 | 73 71 6c 69 74 65 2d 3e 72 65 74 72 69 65 76 65 50 61 74 68 73 28 29 3b 0a 20 20 20 20 7d 0a 0a | sqlite->retrievePaths();.....}.. |
4b80 | 20 20 20 20 66 75 6e 63 74 69 6f 6e 20 72 65 74 72 69 65 76 65 50 61 74 68 73 46 6f 72 54 65 73 | ....function.retrievePathsForTes |
4ba0 | 74 28 24 74 65 73 74 29 0a 20 20 20 20 7b 0a 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 24 74 | t($test).....{.........return.$t |
4bc0 | 68 69 73 2d 3e 73 71 6c 69 74 65 2d 3e 72 65 74 72 69 65 76 65 50 61 74 68 73 46 6f 72 54 65 73 | his->sqlite->retrievePathsForTes |
4be0 | 74 28 24 74 65 73 74 29 3b 0a 20 20 20 20 7d 0a 0a 20 20 20 20 66 75 6e 63 74 69 6f 6e 20 72 65 | t($test);.....}......function.re |
4c00 | 74 72 69 65 76 65 54 65 73 74 50 61 74 68 73 28 29 0a 20 20 20 20 7b 0a 20 20 20 20 20 20 20 20 | trieveTestPaths().....{......... |
4c20 | 72 65 74 75 72 6e 20 24 74 68 69 73 2d 3e 73 71 6c 69 74 65 2d 3e 72 65 74 72 69 65 76 65 54 65 | return.$this->sqlite->retrieveTe |
4c40 | 73 74 50 61 74 68 73 28 29 3b 0a 20 20 20 20 7d 0a 0a 20 20 20 20 66 75 6e 63 74 69 6f 6e 20 63 | stPaths();.....}......function.c |
4c60 | 6f 76 65 72 61 67 65 50 65 72 63 65 6e 74 61 67 65 28 24 73 6f 75 72 63 65 66 69 6c 65 2c 20 24 | overagePercentage($sourcefile,.$ |
4c80 | 74 65 73 74 66 69 6c 65 20 3d 20 6e 75 6c 6c 29 0a 20 20 20 20 7b 0a 20 20 20 20 20 20 20 20 72 | testfile.=.null).....{.........r |
4ca0 | 65 74 75 72 6e 20 24 74 68 69 73 2d 3e 73 71 6c 69 74 65 2d 3e 63 6f 76 65 72 61 67 65 50 65 72 | eturn.$this->sqlite->coveragePer |
4cc0 | 63 65 6e 74 61 67 65 28 24 73 6f 75 72 63 65 66 69 6c 65 2c 20 24 74 65 73 74 66 69 6c 65 29 3b | centage($sourcefile,.$testfile); |
4ce0 | 0a 20 20 20 20 7d 0a 0a 20 20 20 20 66 75 6e 63 74 69 6f 6e 20 63 6f 76 65 72 61 67 65 49 6e 66 | .....}......function.coverageInf |
4d00 | 6f 28 24 70 61 74 68 29 0a 20 20 20 20 7b 0a 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 24 74 | o($path).....{.........return.$t |
4d20 | 68 69 73 2d 3e 73 71 6c 69 74 65 2d 3e 72 65 74 72 69 65 76 65 50 61 74 68 43 6f 76 65 72 61 67 | his->sqlite->retrievePathCoverag |
4d40 | 65 28 24 70 61 74 68 29 3b 0a 20 20 20 20 7d 0a 0a 20 20 20 20 66 75 6e 63 74 69 6f 6e 20 63 6f | e($path);.....}......function.co |
4d60 | 76 65 72 61 67 65 49 6e 66 6f 42 79 54 65 73 74 28 24 70 61 74 68 2c 20 24 74 65 73 74 29 0a 20 | verageInfoByTest($path,.$test).. |
4d80 | 20 20 20 7b 0a 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 24 74 68 69 73 2d 3e 73 71 6c 69 74 | ...{.........return.$this->sqlit |
4da0 | 65 2d 3e 72 65 74 72 69 65 76 65 50 61 74 68 43 6f 76 65 72 61 67 65 42 79 54 65 73 74 28 24 70 | e->retrievePathCoverageByTest($p |
4dc0 | 61 74 68 2c 20 24 74 65 73 74 29 3b 0a 20 20 20 20 7d 0a 0a 20 20 20 20 66 75 6e 63 74 69 6f 6e | ath,.$test);.....}......function |
4de0 | 20 72 65 74 72 69 65 76 65 43 6f 76 65 72 61 67 65 28 24 70 61 74 68 29 0a 20 20 20 20 7b 0a 20 | .retrieveCoverage($path).....{.. |
4e00 | 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 24 74 68 69 73 2d 3e 73 71 6c 69 74 65 2d 3e 72 65 74 | .......return.$this->sqlite->ret |
4e20 | 72 69 65 76 65 43 6f 76 65 72 61 67 65 28 24 70 61 74 68 29 3b 0a 20 20 20 20 7d 0a 0a 20 20 20 | rieveCoverage($path);.....}..... |
4e40 | 20 66 75 6e 63 74 69 6f 6e 20 72 65 74 72 69 65 76 65 43 6f 76 65 72 61 67 65 42 79 54 65 73 74 | .function.retrieveCoverageByTest |
4e60 | 28 24 70 61 74 68 2c 20 24 74 65 73 74 29 0a 20 20 20 20 7b 0a 20 20 20 20 20 20 20 20 72 65 74 | ($path,.$test).....{.........ret |
4e80 | 75 72 6e 20 24 74 68 69 73 2d 3e 73 71 6c 69 74 65 2d 3e 72 65 74 72 69 65 76 65 43 6f 76 65 72 | urn.$this->sqlite->retrieveCover |
4ea0 | 61 67 65 42 79 54 65 73 74 28 24 70 61 74 68 2c 20 24 74 65 73 74 29 3b 0a 20 20 20 20 7d 0a 0a | ageByTest($path,.$test);.....}.. |
4ec0 | 20 20 20 20 66 75 6e 63 74 69 6f 6e 20 72 65 74 72 69 65 76 65 58 64 65 62 75 67 28 24 70 61 74 | ....function.retrieveXdebug($pat |
4ee0 | 68 2c 20 24 74 65 73 74 69 64 29 0a 20 20 20 20 7b 0a 20 20 20 20 20 20 20 20 24 73 6f 75 72 63 | h,.$testid).....{.........$sourc |
4f00 | 65 20 3d 20 27 24 78 64 65 62 75 67 20 3d 20 27 20 2e 20 66 69 6c 65 5f 67 65 74 5f 63 6f 6e 74 | e.=.'$xdebug.=.'...file_get_cont |
4f20 | 65 6e 74 73 28 24 70 61 74 68 29 20 2e 20 22 3b 5c 6e 22 3b 0a 20 20 20 20 20 20 20 20 65 76 61 | ents($path)...";\n";.........eva |
4f40 | 6c 28 24 73 6f 75 72 63 65 29 3b 0a 20 20 20 20 20 20 20 20 24 74 68 69 73 2d 3e 73 71 6c 69 74 | l($source);.........$this->sqlit |
4f60 | 65 2d 3e 61 64 64 43 6f 76 65 72 61 67 65 28 73 74 72 5f 72 65 70 6c 61 63 65 28 27 2e 78 64 65 | e->addCoverage(str_replace('.xde |
4f80 | 62 75 67 27 2c 20 27 2e 70 68 70 74 27 2c 20 24 70 61 74 68 29 2c 20 24 74 65 73 74 69 64 2c 20 | bug',.'.phpt',.$path),.$testid,. |
4fa0 | 24 78 64 65 62 75 67 29 3b 0a 20 20 20 20 7d 0a 0a 20 20 20 20 66 75 6e 63 74 69 6f 6e 20 73 63 | $xdebug);.....}......function.sc |
4fc0 | 61 6e 28 24 74 65 73 74 70 61 74 68 29 0a 20 20 20 20 7b 0a 20 20 20 20 20 20 20 20 24 61 20 3d | an($testpath).....{.........$a.= |
4fe0 | 20 24 74 65 73 74 70 61 74 68 3b 0a 20 20 20 20 20 20 20 20 24 74 65 73 74 70 61 74 68 20 3d 20 | .$testpath;.........$testpath.=. |
5000 | 72 65 61 6c 70 61 74 68 28 24 74 65 73 74 70 61 74 68 29 3b 0a 20 20 20 20 20 20 20 20 69 66 20 | realpath($testpath);.........if. |
5020 | 28 21 24 74 65 73 74 70 61 74 68 29 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 74 68 72 6f 77 | (!$testpath).{.............throw |
5040 | 20 6e 65 77 20 45 78 63 65 70 74 69 6f 6e 28 27 55 6e 61 62 6c 65 20 74 6f 20 70 72 6f 63 65 73 | .new.Exception('Unable.to.proces |
5060 | 73 20 70 61 74 68 27 20 2e 20 24 61 29 3b 0a 20 20 20 20 20 20 20 20 7d 0a 20 20 20 20 20 20 20 | s.path'...$a);.........}........ |
5080 | 20 24 74 65 73 74 70 61 74 68 20 3d 20 73 74 72 5f 72 65 70 6c 61 63 65 28 27 5c 5c 27 2c 20 27 | .$testpath.=.str_replace('\\',.' |
50a0 | 2f 27 2c 20 24 74 65 73 74 70 61 74 68 29 3b 0a 20 20 20 20 20 20 20 20 24 74 68 69 73 2d 3e 74 | /',.$testpath);.........$this->t |
50c0 | 65 73 74 70 61 74 68 20 3d 20 24 74 65 73 74 70 61 74 68 3b 0a 0a 20 20 20 20 20 20 20 20 2f 2f | estpath.=.$testpath;..........// |
50e0 | 20 66 69 72 73 74 20 67 65 74 20 61 20 6c 69 73 74 20 6f 66 20 61 6c 6c 20 64 69 72 65 63 74 6f | .first.get.a.list.of.all.directo |
5100 | 72 69 65 73 0a 20 20 20 20 20 20 20 20 24 64 69 72 73 20 3d 20 24 67 6c 6f 62 64 69 72 73 20 3d | ries.........$dirs.=.$globdirs.= |
5120 | 20 61 72 72 61 79 28 29 3b 0a 20 20 20 20 20 20 20 20 24 69 6e 64 65 78 20 3d 20 30 3b 0a 20 20 | .array();.........$index.=.0;... |
5140 | 20 20 20 20 20 20 24 64 69 72 20 3d 20 24 74 65 73 74 70 61 74 68 3b 0a 20 20 20 20 20 20 20 20 | ......$dir.=.$testpath;......... |
5160 | 64 6f 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 24 67 6c 6f 62 64 69 72 73 20 3d 20 67 6c 6f | do.{.............$globdirs.=.glo |
5180 | 62 28 24 64 69 72 20 2e 20 27 2f 2a 27 2c 20 47 4c 4f 42 5f 4f 4e 4c 59 44 49 52 29 3b 0a 20 20 | b($dir...'/*',.GLOB_ONLYDIR);... |
51a0 | 20 20 20 20 20 20 20 20 20 20 69 66 20 28 24 67 6c 6f 62 64 69 72 73 29 20 7b 0a 20 20 20 20 20 | ..........if.($globdirs).{...... |
51c0 | 20 20 20 20 20 20 20 20 20 20 20 24 64 69 72 73 20 3d 20 61 72 72 61 79 5f 6d 65 72 67 65 28 24 | ...........$dirs.=.array_merge($ |
51e0 | 64 69 72 73 2c 20 24 67 6c 6f 62 64 69 72 73 29 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | dirs,.$globdirs);............... |
5200 | 20 20 24 64 69 72 20 3d 20 24 64 69 72 73 5b 24 69 6e 64 65 78 2b 2b 5d 3b 0a 20 20 20 20 20 20 | ..$dir.=.$dirs[$index++];....... |
5220 | 20 20 20 20 20 20 7d 20 65 6c 73 65 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 77 | ......}.else.{.................w |
5240 | 68 69 6c 65 20 28 21 69 73 73 65 74 28 24 64 69 72 73 5b 24 69 6e 64 65 78 2b 2b 5d 29 20 26 26 | hile.(!isset($dirs[$index++]).&& |
5260 | 20 24 69 6e 64 65 78 20 3c 3d 20 63 6f 75 6e 74 28 24 64 69 72 73 29 29 3b 0a 20 20 20 20 20 20 | .$index.<=.count($dirs));....... |
5280 | 20 20 20 20 20 20 20 20 20 20 69 66 20 28 69 73 73 65 74 28 24 64 69 72 73 5b 24 69 6e 64 65 78 | ..........if.(isset($dirs[$index |
52a0 | 5d 29 29 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 24 64 69 72 20 3d | ])).{.....................$dir.= |
52c0 | 20 24 64 69 72 73 5b 24 69 6e 64 65 78 5d 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | .$dirs[$index];................. |
52e0 | 7d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0a 20 20 20 20 20 20 20 20 7d 20 77 68 69 6c 65 20 | }.............}.........}.while. |
5300 | 28 24 69 6e 64 65 78 20 3c 3d 20 63 6f 75 6e 74 28 24 64 69 72 73 29 29 3b 0a 0a 20 20 20 20 20 | ($index.<=.count($dirs));....... |
5320 | 20 20 20 2f 2f 20 74 68 65 6e 20 66 69 6e 64 20 61 6c 6c 20 63 6f 64 65 20 63 6f 76 65 72 61 67 | ...//.then.find.all.code.coverag |
5340 | 65 20 66 69 6c 65 73 0a 20 20 20 20 20 20 20 20 24 78 64 65 62 75 67 73 20 3d 20 61 72 72 61 79 | e.files.........$xdebugs.=.array |
5360 | 28 29 3b 0a 20 20 20 20 20 20 20 20 66 6f 72 65 61 63 68 20 28 24 64 69 72 73 20 61 73 20 24 64 | ();.........foreach.($dirs.as.$d |
5380 | 69 72 29 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 24 67 6c 6f 62 62 69 65 20 3d 20 67 6c 6f | ir).{.............$globbie.=.glo |
53a0 | 62 28 24 64 69 72 20 2e 20 27 2f 2a 2e 78 64 65 62 75 67 27 29 3b 0a 20 20 20 20 20 20 20 20 20 | b($dir...'/*.xdebug');.......... |
53c0 | 20 20 20 24 78 64 65 62 75 67 73 20 3d 20 61 72 72 61 79 5f 6d 65 72 67 65 28 24 78 64 65 62 75 | ...$xdebugs.=.array_merge($xdebu |
53e0 | 67 73 2c 20 24 67 6c 6f 62 62 69 65 29 3b 0a 20 20 20 20 20 20 20 20 7d 0a 20 20 20 20 20 20 20 | gs,.$globbie);.........}........ |
5400 | 20 24 78 64 65 62 75 67 73 20 3d 20 61 72 72 61 79 5f 75 6e 69 71 75 65 28 24 78 64 65 62 75 67 | .$xdebugs.=.array_unique($xdebug |
5420 | 73 29 3b 0a 20 20 20 20 20 20 20 20 24 6d 6f 64 69 66 69 65 64 20 3d 20 61 72 72 61 79 28 29 3b | s);.........$modified.=.array(); |
5440 | 0a 20 20 20 20 20 20 20 20 24 75 6e 6d 6f 64 69 66 69 65 64 20 3d 20 61 72 72 61 79 28 29 3b 0a | .........$unmodified.=.array();. |
5460 | 20 20 20 20 20 20 20 20 66 6f 72 65 61 63 68 20 28 24 78 64 65 62 75 67 73 20 61 73 20 24 70 61 | ........foreach.($xdebugs.as.$pa |
5480 | 74 68 29 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 24 74 68 69 73 2d 3e 73 71 6c | th).{.............if.($this->sql |
54a0 | 69 74 65 2d 3e 75 6e 43 68 61 6e 67 65 64 58 64 65 62 75 67 28 24 70 61 74 68 29 29 20 7b 0a 20 | ite->unChangedXdebug($path)).{.. |
54c0 | 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 24 75 6e 6d 6f 64 69 66 69 65 64 5b 24 70 61 74 68 | ...............$unmodified[$path |
54e0 | 5d 20 3d 20 74 72 75 65 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 6f 6e 74 69 6e | ].=.true;.................contin |
5500 | 75 65 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0a 20 20 20 20 20 20 20 20 20 20 20 20 24 6d | ue;.............}.............$m |
5520 | 6f 64 69 66 69 65 64 5b 5d 20 3d 20 24 70 61 74 68 3b 0a 20 20 20 20 20 20 20 20 7d 0a 20 20 20 | odified[].=.$path;.........}.... |
5540 | 20 20 20 20 20 24 78 64 65 62 75 67 73 20 3d 20 24 6d 6f 64 69 66 69 65 64 3b 0a 20 20 20 20 20 | .....$xdebugs.=.$modified;...... |
5560 | 20 20 20 73 6f 72 74 28 24 78 64 65 62 75 67 73 29 3b 0a 20 20 20 20 20 20 20 20 2f 2f 20 69 6e | ...sort($xdebugs);.........//.in |
5580 | 64 65 78 20 66 72 6f 6d 20 31 0a 20 20 20 20 20 20 20 20 61 72 72 61 79 5f 75 6e 73 68 69 66 74 | dex.from.1.........array_unshift |
55a0 | 28 24 78 64 65 62 75 67 73 2c 20 27 27 29 3b 0a 20 20 20 20 20 20 20 20 75 6e 73 65 74 28 24 78 | ($xdebugs,.'');.........unset($x |
55c0 | 64 65 62 75 67 73 5b 30 5d 29 3b 0a 20 20 20 20 20 20 20 20 24 74 65 73 74 20 3d 20 61 72 72 61 | debugs[0]);.........$test.=.arra |
55e0 | 79 5f 66 6c 69 70 28 24 78 64 65 62 75 67 73 29 3b 0a 20 20 20 20 20 20 20 20 66 6f 72 65 61 63 | y_flip($xdebugs);.........foreac |
5600 | 68 20 28 24 74 68 69 73 2d 3e 73 71 6c 69 74 65 2d 3e 72 65 74 72 69 65 76 65 54 65 73 74 50 61 | h.($this->sqlite->retrieveTestPa |
5620 | 74 68 73 28 29 20 61 73 20 24 70 61 74 68 29 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 24 78 | ths().as.$path).{.............$x |
5640 | 64 65 62 75 67 70 61 74 68 20 3d 20 73 74 72 5f 72 65 70 6c 61 63 65 28 27 2e 70 68 70 74 27 2c | debugpath.=.str_replace('.phpt', |
5660 | 20 27 2e 78 64 65 62 75 67 27 2c 20 24 70 61 74 68 29 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 | .'.xdebug',.$path);............. |
5680 | 69 66 20 28 69 73 73 65 74 28 24 74 65 73 74 5b 24 78 64 65 62 75 67 70 61 74 68 5d 29 20 7c 7c | if.(isset($test[$xdebugpath]).|| |
56a0 | 20 69 73 73 65 74 28 24 75 6e 6d 6f 64 69 66 69 65 64 5b 24 78 64 65 62 75 67 70 61 74 68 5d 29 | .isset($unmodified[$xdebugpath]) |
56c0 | 29 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 6f 6e 74 69 6e 75 65 3b 0a 20 20 | ).{.................continue;... |
56e0 | 20 20 20 20 20 20 20 20 20 20 7d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 72 65 6d 6f 76 | ..........}.............//.remov |
5700 | 65 20 6f 75 74 64 61 74 65 64 20 74 65 73 74 73 0a 20 20 20 20 20 20 20 20 20 20 20 20 65 63 68 | e.outdated.tests.............ech |
5720 | 6f 20 22 52 65 6d 6f 76 69 6e 67 20 72 65 73 75 6c 74 73 20 66 72 6f 6d 20 24 78 64 65 62 75 67 | o."Removing.results.from.$xdebug |
5740 | 70 61 74 68 5c 6e 22 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 24 74 68 69 73 2d 3e 73 71 6c 69 | path\n";.............$this->sqli |
5760 | 74 65 2d 3e 72 65 6d 6f 76 65 4f 6c 64 54 65 73 74 28 24 70 61 74 68 2c 20 24 78 64 65 62 75 67 | te->removeOldTest($path,.$xdebug |
5780 | 70 61 74 68 29 3b 0a 20 20 20 20 20 20 20 20 7d 0a 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 | path);.........}.........return. |
57a0 | 24 78 64 65 62 75 67 73 3b 0a 20 20 20 20 7d 0a 0a 20 20 20 20 66 75 6e 63 74 69 6f 6e 20 72 65 | $xdebugs;.....}......function.re |
57c0 | 6e 64 65 72 28 24 74 6f 50 61 74 68 29 0a 20 20 20 20 7b 0a 20 20 20 20 20 20 20 20 24 64 65 63 | nder($toPath).....{.........$dec |
57e0 | 6f 72 61 74 6f 72 20 3d 20 6e 65 77 20 44 65 66 61 75 6c 74 53 6f 75 72 63 65 44 65 63 6f 72 61 | orator.=.new.DefaultSourceDecora |
5800 | 74 6f 72 28 24 74 6f 50 61 74 68 2c 20 24 74 68 69 73 2d 3e 74 65 73 74 70 61 74 68 2c 20 24 74 | tor($toPath,.$this->testpath,.$t |
5820 | 68 69 73 2d 3e 63 6f 64 65 70 61 74 68 29 3b 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 47 65 | his->codepath);.........echo."Ge |
5840 | 6e 65 72 61 74 69 6e 67 20 70 72 6f 6a 65 63 74 20 63 6f 76 65 72 61 67 65 20 64 61 74 61 2e 2e | nerating.project.coverage.data.. |
5860 | 2e 22 3b 0a 20 20 20 20 20 20 20 20 24 63 6f 76 65 72 61 67 65 20 3d 20 24 74 68 69 73 2d 3e 73 | .";.........$coverage.=.$this->s |
5880 | 71 6c 69 74 65 2d 3e 72 65 74 72 69 65 76 65 50 72 6f 6a 65 63 74 43 6f 76 65 72 61 67 65 28 29 | qlite->retrieveProjectCoverage() |
58a0 | 3b 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 64 6f 6e 65 5c 6e 22 3b 0a 20 20 20 20 20 20 20 | ;.........echo."done\n";........ |
58c0 | 20 24 64 65 63 6f 72 61 74 6f 72 2d 3e 72 65 6e 64 65 72 53 75 6d 6d 61 72 79 28 24 74 68 69 73 | .$decorator->renderSummary($this |
58e0 | 2c 20 24 74 68 69 73 2d 3e 72 65 74 72 69 65 76 65 50 61 74 68 73 28 29 2c 20 24 74 68 69 73 2d | ,.$this->retrievePaths(),.$this- |
5900 | 3e 63 6f 64 65 70 61 74 68 2c 20 66 61 6c 73 65 2c 20 24 63 6f 76 65 72 61 67 65 5b 31 5d 2c 20 | >codepath,.false,.$coverage[1],. |
5920 | 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | ................................ |
5940 | 20 20 20 24 63 6f 76 65 72 61 67 65 5b 30 5d 29 3b 0a 20 20 20 20 20 20 20 20 24 61 20 3d 20 24 | ...$coverage[0]);.........$a.=.$ |
5960 | 74 68 69 73 2d 3e 63 6f 64 65 70 61 74 68 3b 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 5b 53 | this->codepath;.........echo."[S |
5980 | 74 65 70 20 32 20 6f 66 20 32 5d 20 52 65 6e 64 65 72 69 6e 67 20 70 65 72 2d 74 65 73 74 20 63 | tep.2.of.2].Rendering.per-test.c |
59a0 | 6f 76 65 72 61 67 65 2e 2e 2e 22 3b 0a 20 20 20 20 20 20 20 20 24 64 65 63 6f 72 61 74 6f 72 2d | overage...";.........$decorator- |
59c0 | 3e 72 65 6e 64 65 72 54 65 73 74 43 6f 76 65 72 61 67 65 28 24 74 68 69 73 2c 20 24 74 68 69 73 | >renderTestCoverage($this,.$this |
59e0 | 2d 3e 74 65 73 74 70 61 74 68 2c 20 24 61 29 3b 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 64 | ->testpath,.$a);.........echo."d |
5a00 | 6f 6e 65 5c 6e 22 3b 0a 20 20 20 20 7d 0a 7d 0a 7d 0a 3f 3e 0a 3c 3f 70 68 70 0a 6e 61 6d 65 73 | one\n";.....}.}.}.?>.<?php.names |
5a20 | 70 61 63 65 20 50 45 41 52 32 5c 50 79 72 75 73 5c 44 65 76 65 6c 6f 70 65 72 5c 43 6f 76 65 72 | pace.PEAR2\Pyrus\Developer\Cover |
5a40 | 61 67 65 41 6e 61 6c 79 7a 65 72 5c 57 65 62 20 7b 0a 63 6c 61 73 73 20 45 78 63 65 70 74 69 6f | ageAnalyzer\Web.{.class.Exceptio |
5a60 | 6e 20 65 78 74 65 6e 64 73 20 5c 45 78 63 65 70 74 69 6f 6e 20 7b 7d 0a 7d 0a 3f 3e 0a 3c 3f 70 | n.extends.\Exception.{}.}.?>.<?p |
5a80 | 68 70 0a 6e 61 6d 65 73 70 61 63 65 20 50 45 41 52 32 5c 50 79 72 75 73 5c 44 65 76 65 6c 6f 70 | hp.namespace.PEAR2\Pyrus\Develop |
5aa0 | 65 72 5c 43 6f 76 65 72 61 67 65 41 6e 61 6c 79 7a 65 72 20 7b 0a 63 6c 61 73 73 20 53 6f 75 72 | er\CoverageAnalyzer.{.class.Sour |
5ac0 | 63 65 46 69 6c 65 0a 7b 0a 20 20 20 20 70 72 6f 74 65 63 74 65 64 20 24 73 6f 75 72 63 65 3b 0a | ceFile.{.....protected.$source;. |
5ae0 | 20 20 20 20 70 72 6f 74 65 63 74 65 64 20 24 70 61 74 68 3b 0a 20 20 20 20 70 72 6f 74 65 63 74 | ....protected.$path;.....protect |
5b00 | 65 64 20 24 73 6f 75 72 63 65 70 61 74 68 3b 0a 20 20 20 20 70 72 6f 74 65 63 74 65 64 20 24 63 | ed.$sourcepath;.....protected.$c |
5b20 | 6f 76 65 72 61 67 65 3b 0a 20 20 20 20 70 72 6f 74 65 63 74 65 64 20 24 61 67 67 72 65 67 61 74 | overage;.....protected.$aggregat |
5b40 | 6f 72 3b 0a 20 20 20 20 70 72 6f 74 65 63 74 65 64 20 24 74 65 73 74 70 61 74 68 3b 0a 20 20 20 | or;.....protected.$testpath;.... |
5b60 | 20 70 72 6f 74 65 63 74 65 64 20 24 6c 69 6e 65 6c 69 6e 6b 73 3b 0a 0a 20 20 20 20 66 75 6e 63 | .protected.$linelinks;......func |
5b80 | 74 69 6f 6e 20 5f 5f 63 6f 6e 73 74 72 75 63 74 28 24 70 61 74 68 2c 20 41 67 67 72 65 67 61 74 | tion.__construct($path,.Aggregat |
5ba0 | 6f 72 20 24 61 67 67 2c 20 24 74 65 73 74 70 61 74 68 2c 20 24 73 6f 75 72 63 65 70 61 74 68 29 | or.$agg,.$testpath,.$sourcepath) |
5bc0 | 0a 20 20 20 20 7b 0a 20 20 20 20 20 20 20 20 24 74 68 69 73 2d 3e 73 6f 75 72 63 65 20 3d 20 66 | .....{.........$this->source.=.f |
5be0 | 69 6c 65 28 24 70 61 74 68 29 3b 0a 20 20 20 20 20 20 20 20 24 74 68 69 73 2d 3e 70 61 74 68 20 | ile($path);.........$this->path. |
5c00 | 3d 20 24 70 61 74 68 3b 0a 20 20 20 20 20 20 20 20 24 74 68 69 73 2d 3e 73 6f 75 72 63 65 70 61 | =.$path;.........$this->sourcepa |
5c20 | 74 68 20 3d 20 24 73 6f 75 72 63 65 70 61 74 68 3b 0a 0a 20 20 20 20 20 20 20 20 61 72 72 61 79 | th.=.$sourcepath;..........array |
5c40 | 5f 75 6e 73 68 69 66 74 28 24 74 68 69 73 2d 3e 73 6f 75 72 63 65 2c 20 27 27 29 3b 0a 20 20 20 | _unshift($this->source,.'');.... |
5c60 | 20 20 20 20 20 75 6e 73 65 74 28 24 74 68 69 73 2d 3e 73 6f 75 72 63 65 5b 30 5d 29 3b 20 2f 2f | .....unset($this->source[0]);.// |
5c80 | 20 6d 61 6b 65 20 73 6f 75 72 63 65 20 61 72 72 61 79 20 69 6e 64 65 78 65 64 20 62 79 20 6c 69 | .make.source.array.indexed.by.li |
5ca0 | 6e 65 20 6e 75 6d 62 65 72 0a 0a 20 20 20 20 20 20 20 20 24 74 68 69 73 2d 3e 61 67 67 72 65 67 | ne.number..........$this->aggreg |
5cc0 | 61 74 6f 72 20 3d 20 24 61 67 67 3b 0a 20 20 20 20 20 20 20 20 24 74 68 69 73 2d 3e 74 65 73 74 | ator.=.$agg;.........$this->test |
5ce0 | 70 61 74 68 20 3d 20 24 74 65 73 74 70 61 74 68 3b 0a 20 20 20 20 20 20 20 20 24 74 68 69 73 2d | path.=.$testpath;.........$this- |
5d00 | 3e 73 65 74 43 6f 76 65 72 61 67 65 28 29 3b 0a 20 20 20 20 7d 0a 0a 20 20 20 20 66 75 6e 63 74 | >setCoverage();.....}......funct |
5d20 | 69 6f 6e 20 73 65 74 43 6f 76 65 72 61 67 65 28 29 0a 20 20 20 20 7b 0a 20 20 20 20 20 20 20 20 | ion.setCoverage().....{......... |
5d40 | 24 74 68 69 73 2d 3e 63 6f 76 65 72 61 67 65 20 3d 20 24 74 68 69 73 2d 3e 61 67 67 72 65 67 61 | $this->coverage.=.$this->aggrega |
5d60 | 74 6f 72 2d 3e 72 65 74 72 69 65 76 65 43 6f 76 65 72 61 67 65 28 24 74 68 69 73 2d 3e 70 61 74 | tor->retrieveCoverage($this->pat |
5d80 | 68 29 3b 0a 20 20 20 20 7d 0a 0a 20 20 20 20 66 75 6e 63 74 69 6f 6e 20 61 67 67 72 65 67 61 74 | h);.....}......function.aggregat |
5da0 | 6f 72 28 29 0a 20 20 20 20 7b 0a 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 24 74 68 69 73 2d | or().....{.........return.$this- |
5dc0 | 3e 61 67 67 72 65 67 61 74 6f 72 3b 0a 20 20 20 20 7d 0a 0a 20 20 20 20 66 75 6e 63 74 69 6f 6e | >aggregator;.....}......function |
5de0 | 20 74 65 73 74 70 61 74 68 28 29 0a 20 20 20 20 7b 0a 20 20 20 20 20 20 20 20 72 65 74 75 72 6e | .testpath().....{.........return |
5e00 | 20 24 74 68 69 73 2d 3e 74 65 73 74 70 61 74 68 3b 0a 20 20 20 20 7d 0a 0a 20 20 20 20 66 75 6e | .$this->testpath;.....}......fun |
5e20 | 63 74 69 6f 6e 20 72 65 6e 64 65 72 28 41 62 73 74 72 61 63 74 53 6f 75 72 63 65 44 65 63 6f 72 | ction.render(AbstractSourceDecor |
5e40 | 61 74 6f 72 20 24 64 65 63 6f 72 61 74 6f 72 20 3d 20 6e 75 6c 6c 29 0a 20 20 20 20 7b 0a 20 20 | ator.$decorator.=.null).....{... |
5e60 | 20 20 20 20 20 20 69 66 20 28 24 64 65 63 6f 72 61 74 6f 72 20 3d 3d 3d 20 6e 75 6c 6c 29 20 7b | ......if.($decorator.===.null).{ |
5e80 | 0a 20 20 20 20 20 20 20 20 20 20 20 20 24 64 65 63 6f 72 61 74 6f 72 20 3d 20 6e 65 77 20 44 65 | .............$decorator.=.new.De |
5ea0 | 66 61 75 6c 74 53 6f 75 72 63 65 44 65 63 6f 72 61 74 6f 72 28 27 2e 27 29 3b 0a 20 20 20 20 20 | faultSourceDecorator('.');...... |
5ec0 | 20 20 20 7d 0a 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 24 64 65 63 6f 72 61 74 6f 72 2d 3e | ...}.........return.$decorator-> |
5ee0 | 72 65 6e 64 65 72 28 24 74 68 69 73 29 3b 0a 20 20 20 20 7d 0a 0a 20 20 20 20 66 75 6e 63 74 69 | render($this);.....}......functi |
5f00 | 6f 6e 20 63 6f 76 65 72 61 67 65 28 24 6c 69 6e 65 29 0a 20 20 20 20 7b 0a 20 20 20 20 20 20 20 | on.coverage($line).....{........ |
5f20 | 20 69 66 20 28 21 69 73 73 65 74 28 24 74 68 69 73 2d 3e 63 6f 76 65 72 61 67 65 5b 24 6c 69 6e | .if.(!isset($this->coverage[$lin |
5f40 | 65 5d 29 29 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 66 61 6c 73 65 3b | e])).{.............return.false; |
5f60 | 0a 20 20 20 20 20 20 20 20 7d 0a 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 24 74 68 69 73 2d | .........}.........return.$this- |
5f80 | 3e 63 6f 76 65 72 61 67 65 5b 24 6c 69 6e 65 5d 3b 0a 20 20 20 20 7d 0a 0a 20 20 20 20 66 75 6e | >coverage[$line];.....}......fun |
5fa0 | 63 74 69 6f 6e 20 63 6f 76 65 72 61 67 65 50 65 72 63 65 6e 74 61 67 65 28 29 0a 20 20 20 20 7b | ction.coveragePercentage().....{ |
5fc0 | 0a 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 24 74 68 69 73 2d 3e 61 67 67 72 65 67 61 74 6f | .........return.$this->aggregato |
5fe0 | 72 2d 3e 63 6f 76 65 72 61 67 65 50 65 72 63 65 6e 74 61 67 65 28 24 74 68 69 73 2d 3e 70 61 74 | r->coveragePercentage($this->pat |
6000 | 68 29 3b 0a 20 20 20 20 7d 0a 0a 20 20 20 20 66 75 6e 63 74 69 6f 6e 20 6e 61 6d 65 28 29 0a 20 | h);.....}......function.name().. |
6020 | 20 20 20 7b 0a 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 24 74 68 69 73 2d 3e 70 61 74 68 3b | ...{.........return.$this->path; |
6040 | 0a 20 20 20 20 7d 0a 0a 20 20 20 20 66 75 6e 63 74 69 6f 6e 20 73 68 6f 72 74 4e 61 6d 65 28 29 | .....}......function.shortName() |
6060 | 0a 20 20 20 20 7b 0a 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 73 74 72 5f 72 65 70 6c 61 63 | .....{.........return.str_replac |
6080 | 65 28 24 74 68 69 73 2d 3e 73 6f 75 72 63 65 70 61 74 68 20 2e 20 44 49 52 45 43 54 4f 52 59 5f | e($this->sourcepath...DIRECTORY_ |
60a0 | 53 45 50 41 52 41 54 4f 52 2c 20 27 27 2c 20 24 74 68 69 73 2d 3e 70 61 74 68 29 3b 0a 20 20 20 | SEPARATOR,.'',.$this->path);.... |
60c0 | 20 7d 0a 0a 20 20 20 20 66 75 6e 63 74 69 6f 6e 20 73 6f 75 72 63 65 28 29 0a 20 20 20 20 7b 0a | .}......function.source().....{. |
60e0 | 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 24 74 68 69 73 2d 3e 73 6f 75 72 63 65 3b 0a 20 20 | ........return.$this->source;... |
6100 | 20 20 7d 0a 0a 20 20 20 20 66 75 6e 63 74 69 6f 6e 20 63 6f 76 65 72 65 64 4c 69 6e 65 73 28 29 | ..}......function.coveredLines() |
6120 | 0a 20 20 20 20 7b 0a 20 20 20 20 20 20 20 20 24 69 6e 66 6f 20 3d 20 24 74 68 69 73 2d 3e 61 67 | .....{.........$info.=.$this->ag |
6140 | 67 72 65 67 61 74 6f 72 2d 3e 63 6f 76 65 72 61 67 65 49 6e 66 6f 28 24 74 68 69 73 2d 3e 70 61 | gregator->coverageInfo($this->pa |
6160 | 74 68 29 3b 0a 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 24 69 6e 66 6f 5b 30 5d 3b 0a 20 20 | th);.........return.$info[0];... |
6180 | 20 20 7d 0a 0a 20 20 20 20 66 75 6e 63 74 69 6f 6e 20 67 65 74 4c 69 6e 65 4c 69 6e 6b 73 28 24 | ..}......function.getLineLinks($ |
61a0 | 6c 69 6e 65 29 0a 20 20 20 20 7b 0a 20 20 20 20 20 20 20 20 69 66 20 28 21 69 73 73 65 74 28 24 | line).....{.........if.(!isset($ |
61c0 | 74 68 69 73 2d 3e 6c 69 6e 65 6c 69 6e 6b 73 29 29 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 | this->linelinks)).{............. |
61e0 | 24 74 68 69 73 2d 3e 6c 69 6e 65 6c 69 6e 6b 73 20 3d 20 24 74 68 69 73 2d 3e 61 67 67 72 65 67 | $this->linelinks.=.$this->aggreg |
6200 | 61 74 6f 72 2d 3e 72 65 74 72 69 65 76 65 4c 69 6e 65 4c 69 6e 6b 73 28 24 74 68 69 73 2d 3e 70 | ator->retrieveLineLinks($this->p |
6220 | 61 74 68 29 3b 0a 20 20 20 20 20 20 20 20 7d 0a 20 20 20 20 20 20 20 20 69 66 20 28 69 73 73 65 | ath);.........}.........if.(isse |
6240 | 74 28 24 74 68 69 73 2d 3e 6c 69 6e 65 6c 69 6e 6b 73 5b 24 6c 69 6e 65 5d 29 29 20 7b 0a 20 20 | t($this->linelinks[$line])).{... |
6260 | 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 24 74 68 69 73 2d 3e 6c 69 6e 65 6c 69 6e 6b | ..........return.$this->linelink |
6280 | 73 5b 24 6c 69 6e 65 5d 3b 0a 20 20 20 20 20 20 20 20 7d 0a 20 20 20 20 20 20 20 20 72 65 74 75 | s[$line];.........}.........retu |
62a0 | 72 6e 20 66 61 6c 73 65 3b 0a 20 20 20 20 7d 0a 7d 0a 7d 0a 3f 3e 0a 3c 3f 70 68 70 0a 6e 61 6d | rn.false;.....}.}.}.?>.<?php.nam |
62c0 | 65 73 70 61 63 65 20 50 45 41 52 32 5c 50 79 72 75 73 5c 44 65 76 65 6c 6f 70 65 72 5c 43 6f 76 | espace.PEAR2\Pyrus\Developer\Cov |
62e0 | 65 72 61 67 65 41 6e 61 6c 79 7a 65 72 20 7b 0a 63 6c 61 73 73 20 41 67 67 72 65 67 61 74 6f 72 | erageAnalyzer.{.class.Aggregator |
6300 | 0a 7b 0a 20 20 20 20 70 72 6f 74 65 63 74 65 64 20 24 63 6f 64 65 70 61 74 68 3b 0a 20 20 20 20 | .{.....protected.$codepath;..... |
6320 | 70 72 6f 74 65 63 74 65 64 20 24 74 65 73 74 70 61 74 68 3b 0a 20 20 20 20 70 72 6f 74 65 63 74 | protected.$testpath;.....protect |
6340 | 65 64 20 24 73 71 6c 69 74 65 3b 0a 20 20 20 20 70 75 62 6c 69 63 20 24 74 6f 74 61 6c 6c 69 6e | ed.$sqlite;.....public.$totallin |
6360 | 65 73 20 3d 20 30 3b 0a 20 20 20 20 70 75 62 6c 69 63 20 24 74 6f 74 61 6c 63 6f 76 65 72 65 64 | es.=.0;.....public.$totalcovered |
6380 | 6c 69 6e 65 73 20 3d 20 30 3b 0a 0a 20 20 20 20 2f 2a 2a 0a 20 20 20 20 20 2a 20 40 76 61 72 20 | lines.=.0;....../**......*.@var. |
63a0 | 73 74 72 69 6e 67 20 24 74 65 73 74 70 61 74 68 20 4c 6f 63 61 74 69 6f 6e 20 6f 66 20 2e 70 68 | string.$testpath.Location.of..ph |
63c0 | 70 74 20 66 69 6c 65 73 0a 20 20 20 20 20 2a 20 40 76 61 72 20 73 74 72 69 6e 67 20 24 63 6f 64 | pt.files......*.@var.string.$cod |
63e0 | 65 70 61 74 68 20 4c 6f 63 61 74 69 6f 6e 20 6f 66 20 63 6f 64 65 20 77 68 6f 73 65 20 63 6f 76 | epath.Location.of.code.whose.cov |
6400 | 65 72 61 67 65 20 77 65 20 61 72 65 20 74 65 73 74 69 6e 67 0a 20 20 20 20 20 2a 2f 0a 20 20 20 | erage.we.are.testing......*/.... |
6420 | 20 66 75 6e 63 74 69 6f 6e 20 5f 5f 63 6f 6e 73 74 72 75 63 74 28 24 74 65 73 74 70 61 74 68 2c | .function.__construct($testpath, |
6440 | 20 24 63 6f 64 65 70 61 74 68 2c 20 24 64 62 20 3d 20 27 3a 6d 65 6d 6f 72 79 3a 27 29 0a 20 20 | .$codepath,.$db.=.':memory:')... |
6460 | 20 20 7b 0a 20 20 20 20 20 20 20 20 24 6e 65 77 63 6f 64 65 70 61 74 68 20 3d 20 72 65 61 6c 70 | ..{.........$newcodepath.=.realp |
6480 | 61 74 68 28 24 63 6f 64 65 70 61 74 68 29 3b 0a 20 20 20 20 20 20 20 20 69 66 20 28 21 24 6e 65 | ath($codepath);.........if.(!$ne |
64a0 | 77 63 6f 64 65 70 61 74 68 29 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 21 73 74 | wcodepath).{.............if.(!st |
64c0 | 72 70 6f 73 28 24 63 6f 64 65 70 61 74 68 2c 20 27 3a 2f 2f 27 29 20 7c 7c 20 21 66 69 6c 65 5f | rpos($codepath,.'://').||.!file_ |
64e0 | 65 78 69 73 74 73 28 24 63 6f 64 65 70 61 74 68 29 29 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 | exists($codepath)).{............ |
6500 | 20 20 20 20 20 2f 2f 20 73 74 72 65 61 6d 20 77 72 61 70 70 65 72 20 6e 6f 74 20 66 6f 75 6e 64 | .....//.stream.wrapper.not.found |
6520 | 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 74 68 72 6f 77 20 6e 65 77 20 45 78 63 65 70 | .................throw.new.Excep |
6540 | 74 69 6f 6e 28 27 43 61 6e 20 6e 6f 74 20 66 69 6e 64 20 63 6f 64 65 20 70 61 74 68 20 24 63 6f | tion('Can.not.find.code.path.$co |
6560 | 64 65 70 61 74 68 27 29 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0a 20 20 20 20 20 20 20 20 | depath');.............}......... |
6580 | 7d 20 65 6c 73 65 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 24 63 6f 64 65 70 61 74 68 20 3d | }.else.{.............$codepath.= |
65a0 | 20 24 6e 65 77 63 6f 64 65 70 61 74 68 3b 0a 20 20 20 20 20 20 20 20 7d 0a 20 20 20 20 20 20 20 | .$newcodepath;.........}........ |
65c0 | 20 24 74 68 69 73 2d 3e 73 71 6c 69 74 65 20 3d 20 6e 65 77 20 53 71 6c 69 74 65 28 24 64 62 2c | .$this->sqlite.=.new.Sqlite($db, |
65e0 | 20 24 63 6f 64 65 70 61 74 68 2c 20 24 74 65 73 74 70 61 74 68 29 3b 0a 20 20 20 20 20 20 20 20 | .$codepath,.$testpath);......... |
6600 | 24 74 68 69 73 2d 3e 63 6f 64 65 70 61 74 68 20 3d 20 24 63 6f 64 65 70 61 74 68 3b 0a 20 20 20 | $this->codepath.=.$codepath;.... |
6620 | 20 20 20 20 20 24 74 68 69 73 2d 3e 73 71 6c 69 74 65 2d 3e 62 65 67 69 6e 28 29 3b 0a 20 20 20 | .....$this->sqlite->begin();.... |
6640 | 20 20 20 20 20 65 63 68 6f 20 22 53 63 61 6e 6e 69 6e 67 20 66 6f 72 20 78 64 65 62 75 67 20 63 | .....echo."Scanning.for.xdebug.c |
6660 | 6f 76 65 72 61 67 65 20 66 69 6c 65 73 2e 2e 2e 22 3b 0a 20 20 20 20 20 20 20 20 24 66 69 6c 65 | overage.files...";.........$file |
6680 | 73 20 3d 20 24 74 68 69 73 2d 3e 73 63 61 6e 28 24 74 65 73 74 70 61 74 68 29 3b 0a 20 20 20 20 | s.=.$this->scan($testpath);..... |
66a0 | 20 20 20 20 65 63 68 6f 20 22 64 6f 6e 65 5c 6e 22 3b 0a 20 20 20 20 20 20 20 20 24 69 6e 66 6f | ....echo."done\n";.........$info |
66c0 | 73 74 72 69 6e 67 20 3d 20 27 27 3b 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 50 61 72 73 69 | string.=.'';.........echo."Parsi |
66e0 | 6e 67 20 78 64 65 62 75 67 20 72 65 73 75 6c 74 73 5c 6e 22 3b 0a 20 20 20 20 20 20 20 20 69 66 | ng.xdebug.results\n";.........if |
6700 | 20 28 63 6f 75 6e 74 28 24 66 69 6c 65 73 29 29 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 66 | .(count($files)).{.............f |
6720 | 6f 72 65 61 63 68 20 28 24 66 69 6c 65 73 20 61 73 20 24 74 65 73 74 69 64 20 3d 3e 20 24 78 64 | oreach.($files.as.$testid.=>.$xd |
6740 | 65 62 75 67 66 69 6c 65 29 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 | ebugfile).{.................if.( |
6760 | 21 66 69 6c 65 5f 65 78 69 73 74 73 28 73 74 72 5f 72 65 70 6c 61 63 65 28 27 2e 78 64 65 62 75 | !file_exists(str_replace('.xdebu |
6780 | 67 27 2c 20 27 2e 70 68 70 74 27 2c 20 24 78 64 65 62 75 67 66 69 6c 65 29 29 29 20 7b 0a 20 20 | g',.'.phpt',.$xdebugfile))).{... |
67a0 | 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 5c 6e 57 41 52 4e 49 4e | ..................echo."\nWARNIN |
67c0 | 47 3a 20 6f 75 74 64 61 74 65 64 20 2e 78 64 65 62 75 67 20 66 69 6c 65 20 24 78 64 65 62 75 67 | G:.outdated..xdebug.file.$xdebug |
67e0 | 66 69 6c 65 2c 20 64 65 6c 65 74 65 20 74 68 69 73 20 72 65 6c 69 63 5c 6e 22 3b 0a 20 20 20 20 | file,.delete.this.relic\n";..... |
6800 | 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 6f 6e 74 69 6e 75 65 3b 0a 20 20 20 20 20 20 | ................continue;....... |
6820 | 20 20 20 20 20 20 20 20 20 20 7d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 24 69 64 20 | ..........}.................$id. |
6840 | 3d 20 24 74 68 69 73 2d 3e 73 71 6c 69 74 65 2d 3e 61 64 64 54 65 73 74 28 73 74 72 5f 72 65 70 | =.$this->sqlite->addTest(str_rep |
6860 | 6c 61 63 65 28 27 2e 78 64 65 62 75 67 27 2c 20 27 2e 70 68 70 74 27 2c 20 24 78 64 65 62 75 67 | lace('.xdebug',.'.phpt',.$xdebug |
6880 | 66 69 6c 65 29 29 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 65 63 68 6f 20 27 28 27 | file));.................echo.'(' |
68a0 | 20 2e 20 24 74 65 73 74 69 64 20 2e 20 27 20 6f 66 20 27 20 2e 20 63 6f 75 6e 74 28 24 66 69 6c | ...$testid...'.of.'...count($fil |
68c0 | 65 73 29 20 2e 20 27 29 20 27 20 2e 20 24 78 64 65 62 75 67 66 69 6c 65 3b 0a 20 20 20 20 20 20 | es)...').'...$xdebugfile;....... |
68e0 | 20 20 20 20 20 20 20 20 20 20 24 74 68 69 73 2d 3e 72 65 74 72 69 65 76 65 58 64 65 62 75 67 28 | ..........$this->retrieveXdebug( |
6900 | 24 78 64 65 62 75 67 66 69 6c 65 2c 20 24 69 64 29 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 | $xdebugfile,.$id);.............. |
6920 | 20 20 20 65 63 68 6f 20 22 64 6f 6e 65 5c 6e 22 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0a | ...echo."done\n";.............}. |
6940 | 20 20 20 20 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 64 6f 6e 65 5c 6e 22 3b 0a 20 20 20 20 20 | ............echo."done\n";...... |
6960 | 20 20 20 20 20 20 20 24 74 68 69 73 2d 3e 73 71 6c 69 74 65 2d 3e 75 70 64 61 74 65 54 6f 74 61 | .......$this->sqlite->updateTota |
6980 | 6c 43 6f 76 65 72 61 67 65 28 29 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 24 74 68 69 73 2d 3e | lCoverage();.............$this-> |
69a0 | 73 71 6c 69 74 65 2d 3e 63 6f 6d 6d 69 74 28 29 3b 0a 20 20 20 20 20 20 20 20 7d 20 65 6c 73 65 | sqlite->commit();.........}.else |
69c0 | 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 64 6f 6e 65 20 28 6e 6f 20 6d 6f | .{.............echo."done.(no.mo |
69e0 | 64 69 66 69 65 64 20 78 64 65 62 75 67 20 66 69 6c 65 73 29 5c 6e 22 3b 0a 20 20 20 20 20 20 20 | dified.xdebug.files)\n";........ |
6a00 | 20 7d 0a 20 20 20 20 7d 0a 0a 20 20 20 20 66 75 6e 63 74 69 6f 6e 20 72 65 74 72 69 65 76 65 4c | .}.....}......function.retrieveL |
6a20 | 69 6e 65 4c 69 6e 6b 73 28 24 66 69 6c 65 29 0a 20 20 20 20 7b 0a 20 20 20 20 20 20 20 20 72 65 | ineLinks($file).....{.........re |
6a40 | 74 75 72 6e 20 24 74 68 69 73 2d 3e 73 71 6c 69 74 65 2d 3e 72 65 74 72 69 65 76 65 4c 69 6e 65 | turn.$this->sqlite->retrieveLine |
6a60 | 4c 69 6e 6b 73 28 24 66 69 6c 65 29 3b 0a 20 20 20 20 7d 0a 0a 20 20 20 20 66 75 6e 63 74 69 6f | Links($file);.....}......functio |
6a80 | 6e 20 72 65 74 72 69 65 76 65 50 61 74 68 73 28 29 0a 20 20 20 20 7b 0a 20 20 20 20 20 20 20 20 | n.retrievePaths().....{......... |
6aa0 | 72 65 74 75 72 6e 20 24 74 68 69 73 2d 3e 73 71 6c 69 74 65 2d 3e 72 65 74 72 69 65 76 65 50 61 | return.$this->sqlite->retrievePa |
6ac0 | 74 68 73 28 29 3b 0a 20 20 20 20 7d 0a 0a 20 20 20 20 66 75 6e 63 74 69 6f 6e 20 72 65 74 72 69 | ths();.....}......function.retri |
6ae0 | 65 76 65 50 61 74 68 73 46 6f 72 54 65 73 74 28 24 74 65 73 74 29 0a 20 20 20 20 7b 0a 20 20 20 | evePathsForTest($test).....{.... |
6b00 | 20 20 20 20 20 72 65 74 75 72 6e 20 24 74 68 69 73 2d 3e 73 71 6c 69 74 65 2d 3e 72 65 74 72 69 | .....return.$this->sqlite->retri |
6b20 | 65 76 65 50 61 74 68 73 46 6f 72 54 65 73 74 28 24 74 65 73 74 29 3b 0a 20 20 20 20 7d 0a 0a 20 | evePathsForTest($test);.....}... |
6b40 | 20 20 20 66 75 6e 63 74 69 6f 6e 20 72 65 74 72 69 65 76 65 54 65 73 74 50 61 74 68 73 28 29 0a | ...function.retrieveTestPaths(). |
6b60 | 20 20 20 20 7b 0a 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 24 74 68 69 73 2d 3e 73 71 6c 69 | ....{.........return.$this->sqli |
6b80 | 74 65 2d 3e 72 65 74 72 69 65 76 65 54 65 73 74 50 61 74 68 73 28 29 3b 0a 20 20 20 20 7d 0a 0a | te->retrieveTestPaths();.....}.. |
6ba0 | 20 20 20 20 66 75 6e 63 74 69 6f 6e 20 63 6f 76 65 72 61 67 65 50 65 72 63 65 6e 74 61 67 65 28 | ....function.coveragePercentage( |
6bc0 | 24 73 6f 75 72 63 65 66 69 6c 65 2c 20 24 74 65 73 74 66 69 6c 65 20 3d 20 6e 75 6c 6c 29 0a 20 | $sourcefile,.$testfile.=.null).. |
6be0 | 20 20 20 7b 0a 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 24 74 68 69 73 2d 3e 73 71 6c 69 74 | ...{.........return.$this->sqlit |
6c00 | 65 2d 3e 63 6f 76 65 72 61 67 65 50 65 72 63 65 6e 74 61 67 65 28 24 73 6f 75 72 63 65 66 69 6c | e->coveragePercentage($sourcefil |
6c20 | 65 2c 20 24 74 65 73 74 66 69 6c 65 29 3b 0a 20 20 20 20 7d 0a 0a 20 20 20 20 66 75 6e 63 74 69 | e,.$testfile);.....}......functi |
6c40 | 6f 6e 20 63 6f 76 65 72 61 67 65 49 6e 66 6f 28 24 70 61 74 68 29 0a 20 20 20 20 7b 0a 20 20 20 | on.coverageInfo($path).....{.... |
6c60 | 20 20 20 20 20 72 65 74 75 72 6e 20 24 74 68 69 73 2d 3e 73 71 6c 69 74 65 2d 3e 72 65 74 72 69 | .....return.$this->sqlite->retri |
6c80 | 65 76 65 50 61 74 68 43 6f 76 65 72 61 67 65 28 24 70 61 74 68 29 3b 0a 20 20 20 20 7d 0a 0a 20 | evePathCoverage($path);.....}... |
6ca0 | 20 20 20 66 75 6e 63 74 69 6f 6e 20 63 6f 76 65 72 61 67 65 49 6e 66 6f 42 79 54 65 73 74 28 24 | ...function.coverageInfoByTest($ |
6cc0 | 70 61 74 68 2c 20 24 74 65 73 74 29 0a 20 20 20 20 7b 0a 20 20 20 20 20 20 20 20 72 65 74 75 72 | path,.$test).....{.........retur |
6ce0 | 6e 20 24 74 68 69 73 2d 3e 73 71 6c 69 74 65 2d 3e 72 65 74 72 69 65 76 65 50 61 74 68 43 6f 76 | n.$this->sqlite->retrievePathCov |
6d00 | 65 72 61 67 65 42 79 54 65 73 74 28 24 70 61 74 68 2c 20 24 74 65 73 74 29 3b 0a 20 20 20 20 7d | erageByTest($path,.$test);.....} |
6d20 | 0a 0a 20 20 20 20 66 75 6e 63 74 69 6f 6e 20 72 65 74 72 69 65 76 65 43 6f 76 65 72 61 67 65 28 | ......function.retrieveCoverage( |
6d40 | 24 70 61 74 68 29 0a 20 20 20 20 7b 0a 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 24 74 68 69 | $path).....{.........return.$thi |
6d60 | 73 2d 3e 73 71 6c 69 74 65 2d 3e 72 65 74 72 69 65 76 65 43 6f 76 65 72 61 67 65 28 24 70 61 74 | s->sqlite->retrieveCoverage($pat |
6d80 | 68 29 3b 0a 20 20 20 20 7d 0a 0a 20 20 20 20 66 75 6e 63 74 69 6f 6e 20 72 65 74 72 69 65 76 65 | h);.....}......function.retrieve |
6da0 | 43 6f 76 65 72 61 67 65 42 79 54 65 73 74 28 24 70 61 74 68 2c 20 24 74 65 73 74 29 0a 20 20 20 | CoverageByTest($path,.$test).... |
6dc0 | 20 7b 0a 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 24 74 68 69 73 2d 3e 73 71 6c 69 74 65 2d | .{.........return.$this->sqlite- |
6de0 | 3e 72 65 74 72 69 65 76 65 43 6f 76 65 72 61 67 65 42 79 54 65 73 74 28 24 70 61 74 68 2c 20 24 | >retrieveCoverageByTest($path,.$ |
6e00 | 74 65 73 74 29 3b 0a 20 20 20 20 7d 0a 0a 20 20 20 20 66 75 6e 63 74 69 6f 6e 20 72 65 74 72 69 | test);.....}......function.retri |
6e20 | 65 76 65 58 64 65 62 75 67 28 24 70 61 74 68 2c 20 24 74 65 73 74 69 64 29 0a 20 20 20 20 7b 0a | eveXdebug($path,.$testid).....{. |
6e40 | 20 20 20 20 20 20 20 20 24 73 6f 75 72 63 65 20 3d 20 27 24 78 64 65 62 75 67 20 3d 20 27 20 2e | ........$source.=.'$xdebug.=.'.. |
6e60 | 20 66 69 6c 65 5f 67 65 74 5f 63 6f 6e 74 65 6e 74 73 28 24 70 61 74 68 29 20 2e 20 22 3b 5c 6e | .file_get_contents($path)...";\n |
6e80 | 22 3b 0a 20 20 20 20 20 20 20 20 65 76 61 6c 28 24 73 6f 75 72 63 65 29 3b 0a 20 20 20 20 20 20 | ";.........eval($source);....... |
6ea0 | 20 20 24 74 68 69 73 2d 3e 73 71 6c 69 74 65 2d 3e 61 64 64 43 6f 76 65 72 61 67 65 28 73 74 72 | ..$this->sqlite->addCoverage(str |
6ec0 | 5f 72 65 70 6c 61 63 65 28 27 2e 78 64 65 62 75 67 27 2c 20 27 2e 70 68 70 74 27 2c 20 24 70 61 | _replace('.xdebug',.'.phpt',.$pa |
6ee0 | 74 68 29 2c 20 24 74 65 73 74 69 64 2c 20 24 78 64 65 62 75 67 29 3b 0a 20 20 20 20 7d 0a 0a 20 | th),.$testid,.$xdebug);.....}... |
6f00 | 20 20 20 66 75 6e 63 74 69 6f 6e 20 73 63 61 6e 28 24 74 65 73 74 70 61 74 68 29 0a 20 20 20 20 | ...function.scan($testpath)..... |
6f20 | 7b 0a 20 20 20 20 20 20 20 20 24 61 20 3d 20 24 74 65 73 74 70 61 74 68 3b 0a 20 20 20 20 20 20 | {.........$a.=.$testpath;....... |
6f40 | 20 20 24 74 65 73 74 70 61 74 68 20 3d 20 72 65 61 6c 70 61 74 68 28 24 74 65 73 74 70 61 74 68 | ..$testpath.=.realpath($testpath |
6f60 | 29 3b 0a 20 20 20 20 20 20 20 20 69 66 20 28 21 24 74 65 73 74 70 61 74 68 29 20 7b 0a 20 20 20 | );.........if.(!$testpath).{.... |
6f80 | 20 20 20 20 20 20 20 20 20 74 68 72 6f 77 20 6e 65 77 20 45 78 63 65 70 74 69 6f 6e 28 27 55 6e | .........throw.new.Exception('Un |
6fa0 | 61 62 6c 65 20 74 6f 20 70 72 6f 63 65 73 73 20 70 61 74 68 27 20 2e 20 24 61 29 3b 0a 20 20 20 | able.to.process.path'...$a);.... |
6fc0 | 20 20 20 20 20 7d 0a 20 20 20 20 20 20 20 20 24 74 65 73 74 70 61 74 68 20 3d 20 73 74 72 5f 72 | .....}.........$testpath.=.str_r |
6fe0 | 65 70 6c 61 63 65 28 27 5c 5c 27 2c 20 27 2f 27 2c 20 24 74 65 73 74 70 61 74 68 29 3b 0a 20 20 | eplace('\\',.'/',.$testpath);... |
7000 | 20 20 20 20 20 20 24 74 68 69 73 2d 3e 74 65 73 74 70 61 74 68 20 3d 20 24 74 65 73 74 70 61 74 | ......$this->testpath.=.$testpat |
7020 | 68 3b 0a 0a 20 20 20 20 20 20 20 20 2f 2f 20 66 69 72 73 74 20 67 65 74 20 61 20 6c 69 73 74 20 | h;..........//.first.get.a.list. |
7040 | 6f 66 20 61 6c 6c 20 64 69 72 65 63 74 6f 72 69 65 73 0a 20 20 20 20 20 20 20 20 24 64 69 72 73 | of.all.directories.........$dirs |
7060 | 20 3d 20 24 67 6c 6f 62 64 69 72 73 20 3d 20 61 72 72 61 79 28 29 3b 0a 20 20 20 20 20 20 20 20 | .=.$globdirs.=.array();......... |
7080 | 24 69 6e 64 65 78 20 3d 20 30 3b 0a 20 20 20 20 20 20 20 20 24 64 69 72 20 3d 20 24 74 65 73 74 | $index.=.0;.........$dir.=.$test |
70a0 | 70 61 74 68 3b 0a 20 20 20 20 20 20 20 20 64 6f 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 24 | path;.........do.{.............$ |
70c0 | 67 6c 6f 62 64 69 72 73 20 3d 20 67 6c 6f 62 28 24 64 69 72 20 2e 20 27 2f 2a 27 2c 20 47 4c 4f | globdirs.=.glob($dir...'/*',.GLO |
70e0 | 42 5f 4f 4e 4c 59 44 49 52 29 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 24 67 6c 6f | B_ONLYDIR);.............if.($glo |
7100 | 62 64 69 72 73 29 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 24 64 69 72 73 20 3d | bdirs).{.................$dirs.= |
7120 | 20 61 72 72 61 79 5f 6d 65 72 67 65 28 24 64 69 72 73 2c 20 24 67 6c 6f 62 64 69 72 73 29 3b 0a | .array_merge($dirs,.$globdirs);. |
7140 | 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 24 64 69 72 20 3d 20 24 64 69 72 73 5b 24 69 6e | ................$dir.=.$dirs[$in |
7160 | 64 65 78 2b 2b 5d 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 20 65 6c 73 65 20 7b 0a 20 20 20 | dex++];.............}.else.{.... |
7180 | 20 20 20 20 20 20 20 20 20 20 20 20 20 77 68 69 6c 65 20 28 21 69 73 73 65 74 28 24 64 69 72 73 | .............while.(!isset($dirs |
71a0 | 5b 24 69 6e 64 65 78 2b 2b 5d 29 20 26 26 20 24 69 6e 64 65 78 20 3c 3d 20 63 6f 75 6e 74 28 24 | [$index++]).&&.$index.<=.count($ |
71c0 | 64 69 72 73 29 29 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 69 73 73 65 | dirs));.................if.(isse |
71e0 | 74 28 24 64 69 72 73 5b 24 69 6e 64 65 78 5d 29 29 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 | t($dirs[$index])).{............. |
7200 | 20 20 20 20 20 20 20 20 24 64 69 72 20 3d 20 24 64 69 72 73 5b 24 69 6e 64 65 78 5d 3b 0a 20 20 | ........$dir.=.$dirs[$index];... |
7220 | 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0a 20 20 | ..............}.............}... |
7240 | 20 20 20 20 20 20 7d 20 77 68 69 6c 65 20 28 24 69 6e 64 65 78 20 3c 3d 20 63 6f 75 6e 74 28 24 | ......}.while.($index.<=.count($ |
7260 | 64 69 72 73 29 29 3b 0a 0a 20 20 20 20 20 20 20 20 2f 2f 20 74 68 65 6e 20 66 69 6e 64 20 61 6c | dirs));..........//.then.find.al |
7280 | 6c 20 63 6f 64 65 20 63 6f 76 65 72 61 67 65 20 66 69 6c 65 73 0a 20 20 20 20 20 20 20 20 24 78 | l.code.coverage.files.........$x |
72a0 | 64 65 62 75 67 73 20 3d 20 61 72 72 61 79 28 29 3b 0a 20 20 20 20 20 20 20 20 66 6f 72 65 61 63 | debugs.=.array();.........foreac |
72c0 | 68 20 28 24 64 69 72 73 20 61 73 20 24 64 69 72 29 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 | h.($dirs.as.$dir).{............. |
72e0 | 24 67 6c 6f 62 62 69 65 20 3d 20 67 6c 6f 62 28 24 64 69 72 20 2e 20 27 2f 2a 2e 78 64 65 62 75 | $globbie.=.glob($dir...'/*.xdebu |
7300 | 67 27 29 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 24 78 64 65 62 75 67 73 20 3d 20 61 72 72 61 | g');.............$xdebugs.=.arra |
7320 | 79 5f 6d 65 72 67 65 28 24 78 64 65 62 75 67 73 2c 20 24 67 6c 6f 62 62 69 65 29 3b 0a 20 20 20 | y_merge($xdebugs,.$globbie);.... |
7340 | 20 20 20 20 20 7d 0a 20 20 20 20 20 20 20 20 24 78 64 65 62 75 67 73 20 3d 20 61 72 72 61 79 5f | .....}.........$xdebugs.=.array_ |
7360 | 75 6e 69 71 75 65 28 24 78 64 65 62 75 67 73 29 3b 0a 20 20 20 20 20 20 20 20 24 6d 6f 64 69 66 | unique($xdebugs);.........$modif |
7380 | 69 65 64 20 3d 20 61 72 72 61 79 28 29 3b 0a 20 20 20 20 20 20 20 20 24 75 6e 6d 6f 64 69 66 69 | ied.=.array();.........$unmodifi |
73a0 | 65 64 20 3d 20 61 72 72 61 79 28 29 3b 0a 20 20 20 20 20 20 20 20 66 6f 72 65 61 63 68 20 28 24 | ed.=.array();.........foreach.($ |
73c0 | 78 64 65 62 75 67 73 20 61 73 20 24 70 61 74 68 29 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 | xdebugs.as.$path).{............. |
73e0 | 69 66 20 28 24 74 68 69 73 2d 3e 73 71 6c 69 74 65 2d 3e 75 6e 43 68 61 6e 67 65 64 58 64 65 62 | if.($this->sqlite->unChangedXdeb |
7400 | 75 67 28 24 70 61 74 68 29 29 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 24 75 6e | ug($path)).{.................$un |
7420 | 6d 6f 64 69 66 69 65 64 5b 24 70 61 74 68 5d 20 3d 20 74 72 75 65 3b 0a 20 20 20 20 20 20 20 20 | modified[$path].=.true;......... |
7440 | 20 20 20 20 20 20 20 20 63 6f 6e 74 69 6e 75 65 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0a | ........continue;.............}. |
7460 | 20 20 20 20 20 20 20 20 20 20 20 20 24 6d 6f 64 69 66 69 65 64 5b 5d 20 3d 20 24 70 61 74 68 3b | ............$modified[].=.$path; |
7480 | 0a 20 20 20 20 20 20 20 20 7d 0a 20 20 20 20 20 20 20 20 24 78 64 65 62 75 67 73 20 3d 20 24 6d | .........}.........$xdebugs.=.$m |
74a0 | 6f 64 69 66 69 65 64 3b 0a 20 20 20 20 20 20 20 20 73 6f 72 74 28 24 78 64 65 62 75 67 73 29 3b | odified;.........sort($xdebugs); |
74c0 | 0a 20 20 20 20 20 20 20 20 2f 2f 20 69 6e 64 65 78 20 66 72 6f 6d 20 31 0a 20 20 20 20 20 20 20 | .........//.index.from.1........ |
74e0 | 20 61 72 72 61 79 5f 75 6e 73 68 69 66 74 28 24 78 64 65 62 75 67 73 2c 20 27 27 29 3b 0a 20 20 | .array_unshift($xdebugs,.'');... |
7500 | 20 20 20 20 20 20 75 6e 73 65 74 28 24 78 64 65 62 75 67 73 5b 30 5d 29 3b 0a 20 20 20 20 20 20 | ......unset($xdebugs[0]);....... |
7520 | 20 20 24 74 65 73 74 20 3d 20 61 72 72 61 79 5f 66 6c 69 70 28 24 78 64 65 62 75 67 73 29 3b 0a | ..$test.=.array_flip($xdebugs);. |
7540 | 20 20 20 20 20 20 20 20 66 6f 72 65 61 63 68 20 28 24 74 68 69 73 2d 3e 73 71 6c 69 74 65 2d 3e | ........foreach.($this->sqlite-> |
7560 | 72 65 74 72 69 65 76 65 54 65 73 74 50 61 74 68 73 28 29 20 61 73 20 24 70 61 74 68 29 20 7b 0a | retrieveTestPaths().as.$path).{. |
7580 | 20 20 20 20 20 20 20 20 20 20 20 20 24 78 64 65 62 75 67 70 61 74 68 20 3d 20 73 74 72 5f 72 65 | ............$xdebugpath.=.str_re |
75a0 | 70 6c 61 63 65 28 27 2e 70 68 70 74 27 2c 20 27 2e 78 64 65 62 75 67 27 2c 20 24 70 61 74 68 29 | place('.phpt',.'.xdebug',.$path) |
75c0 | 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 69 73 73 65 74 28 24 74 65 73 74 5b 24 78 | ;.............if.(isset($test[$x |
75e0 | 64 65 62 75 67 70 61 74 68 5d 29 20 7c 7c 20 69 73 73 65 74 28 24 75 6e 6d 6f 64 69 66 69 65 64 | debugpath]).||.isset($unmodified |
7600 | 5b 24 78 64 65 62 75 67 70 61 74 68 5d 29 29 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | [$xdebugpath])).{............... |
7620 | 20 20 63 6f 6e 74 69 6e 75 65 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0a 20 20 20 20 20 20 | ..continue;.............}....... |
7640 | 20 20 20 20 20 20 2f 2f 20 72 65 6d 6f 76 65 20 6f 75 74 64 61 74 65 64 20 74 65 73 74 73 0a 20 | ......//.remove.outdated.tests.. |
7660 | 20 20 20 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 52 65 6d 6f 76 69 6e 67 20 72 65 73 75 6c 74 | ...........echo."Removing.result |
7680 | 73 20 66 72 6f 6d 20 24 78 64 65 62 75 67 70 61 74 68 5c 6e 22 3b 0a 20 20 20 20 20 20 20 20 20 | s.from.$xdebugpath\n";.......... |
76a0 | 20 20 20 24 74 68 69 73 2d 3e 73 71 6c 69 74 65 2d 3e 72 65 6d 6f 76 65 4f 6c 64 54 65 73 74 28 | ...$this->sqlite->removeOldTest( |
76c0 | 24 70 61 74 68 2c 20 24 78 64 65 62 75 67 70 61 74 68 29 3b 0a 20 20 20 20 20 20 20 20 7d 0a 20 | $path,.$xdebugpath);.........}.. |
76e0 | 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 24 78 64 65 62 75 67 73 3b 0a 20 20 20 20 7d 0a 0a 20 | .......return.$xdebugs;.....}... |
7700 | 20 20 20 66 75 6e 63 74 69 6f 6e 20 72 65 6e 64 65 72 28 24 74 6f 50 61 74 68 29 0a 20 20 20 20 | ...function.render($toPath)..... |
7720 | 7b 0a 20 20 20 20 20 20 20 20 24 64 65 63 6f 72 61 74 6f 72 20 3d 20 6e 65 77 20 44 65 66 61 75 | {.........$decorator.=.new.Defau |
7740 | 6c 74 53 6f 75 72 63 65 44 65 63 6f 72 61 74 6f 72 28 24 74 6f 50 61 74 68 2c 20 24 74 68 69 73 | ltSourceDecorator($toPath,.$this |
7760 | 2d 3e 74 65 73 74 70 61 74 68 2c 20 24 74 68 69 73 2d 3e 63 6f 64 65 70 61 74 68 29 3b 0a 20 20 | ->testpath,.$this->codepath);... |
7780 | 20 20 20 20 20 20 65 63 68 6f 20 22 47 65 6e 65 72 61 74 69 6e 67 20 70 72 6f 6a 65 63 74 20 63 | ......echo."Generating.project.c |
77a0 | 6f 76 65 72 61 67 65 20 64 61 74 61 2e 2e 2e 22 3b 0a 20 20 20 20 20 20 20 20 24 63 6f 76 65 72 | overage.data...";.........$cover |
77c0 | 61 67 65 20 3d 20 24 74 68 69 73 2d 3e 73 71 6c 69 74 65 2d 3e 72 65 74 72 69 65 76 65 50 72 6f | age.=.$this->sqlite->retrievePro |
77e0 | 6a 65 63 74 43 6f 76 65 72 61 67 65 28 29 3b 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 64 6f | jectCoverage();.........echo."do |
7800 | 6e 65 5c 6e 22 3b 0a 20 20 20 20 20 20 20 20 24 64 65 63 6f 72 61 74 6f 72 2d 3e 72 65 6e 64 65 | ne\n";.........$decorator->rende |
7820 | 72 53 75 6d 6d 61 72 79 28 24 74 68 69 73 2c 20 24 74 68 69 73 2d 3e 72 65 74 72 69 65 76 65 50 | rSummary($this,.$this->retrieveP |
7840 | 61 74 68 73 28 29 2c 20 24 74 68 69 73 2d 3e 63 6f 64 65 70 61 74 68 2c 20 66 61 6c 73 65 2c 20 | aths(),.$this->codepath,.false,. |
7860 | 24 63 6f 76 65 72 61 67 65 5b 31 5d 2c 20 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | $coverage[1],................... |
7880 | 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 24 63 6f 76 65 72 61 67 65 5b 30 5d 29 3b 0a | .................$coverage[0]);. |
78a0 | 20 20 20 20 20 20 20 20 24 61 20 3d 20 24 74 68 69 73 2d 3e 63 6f 64 65 70 61 74 68 3b 0a 20 20 | ........$a.=.$this->codepath;... |
78c0 | 20 20 20 20 20 20 65 63 68 6f 20 22 5b 53 74 65 70 20 32 20 6f 66 20 32 5d 20 52 65 6e 64 65 72 | ......echo."[Step.2.of.2].Render |
78e0 | 69 6e 67 20 70 65 72 2d 74 65 73 74 20 63 6f 76 65 72 61 67 65 2e 2e 2e 22 3b 0a 20 20 20 20 20 | ing.per-test.coverage...";...... |
7900 | 20 20 20 24 64 65 63 6f 72 61 74 6f 72 2d 3e 72 65 6e 64 65 72 54 65 73 74 43 6f 76 65 72 61 67 | ...$decorator->renderTestCoverag |
7920 | 65 28 24 74 68 69 73 2c 20 24 74 68 69 73 2d 3e 74 65 73 74 70 61 74 68 2c 20 24 61 29 3b 0a 20 | e($this,.$this->testpath,.$a);.. |
7940 | 20 20 20 20 20 20 20 65 63 68 6f 20 22 64 6f 6e 65 5c 6e 22 3b 0a 20 20 20 20 7d 0a 7d 0a 7d 0a | .......echo."done\n";.....}.}.}. |
7960 | 3f 3e 0a 3c 3f 70 68 70 0a 6e 61 6d 65 73 70 61 63 65 20 50 45 41 52 32 5c 50 79 72 75 73 5c 44 | ?>.<?php.namespace.PEAR2\Pyrus\D |
7980 | 65 76 65 6c 6f 70 65 72 5c 43 6f 76 65 72 61 67 65 41 6e 61 6c 79 7a 65 72 20 7b 0a 63 6c 61 73 | eveloper\CoverageAnalyzer.{.clas |
79a0 | 73 20 45 78 63 65 70 74 69 6f 6e 20 65 78 74 65 6e 64 73 20 5c 45 78 63 65 70 74 69 6f 6e 20 7b | s.Exception.extends.\Exception.{ |
79c0 | 7d 0a 7d 0a 3f 3e 0a 3c 3f 70 68 70 0a 6e 61 6d 65 73 70 61 63 65 20 50 45 41 52 32 5c 50 79 72 | }.}.?>.<?php.namespace.PEAR2\Pyr |
79e0 | 75 73 5c 44 65 76 65 6c 6f 70 65 72 5c 43 6f 76 65 72 61 67 65 41 6e 61 6c 79 7a 65 72 20 7b 0a | us\Developer\CoverageAnalyzer.{. |
7a00 | 63 6c 61 73 73 20 53 71 6c 69 74 65 0a 7b 0a 20 20 20 20 70 72 6f 74 65 63 74 65 64 20 24 64 62 | class.Sqlite.{.....protected.$db |
7a20 | 3b 0a 20 20 20 20 70 72 6f 74 65 63 74 65 64 20 24 74 6f 74 61 6c 6c 69 6e 65 73 20 3d 20 30 3b | ;.....protected.$totallines.=.0; |
7a40 | 0a 20 20 20 20 70 72 6f 74 65 63 74 65 64 20 24 63 6f 76 65 72 65 64 6c 69 6e 65 73 20 3d 20 30 | .....protected.$coveredlines.=.0 |
7a60 | 3b 0a 20 20 20 20 70 72 6f 74 65 63 74 65 64 20 24 70 61 74 68 43 6f 76 65 72 65 64 20 3d 20 61 | ;.....protected.$pathCovered.=.a |
7a80 | 72 72 61 79 28 29 3b 0a 20 20 20 20 70 72 6f 74 65 63 74 65 64 20 24 70 61 74 68 54 6f 74 61 6c | rray();.....protected.$pathTotal |
7aa0 | 20 3d 20 61 72 72 61 79 28 29 3b 0a 20 20 20 20 70 75 62 6c 69 63 20 24 63 6f 64 65 70 61 74 68 | .=.array();.....public.$codepath |
7ac0 | 3b 0a 20 20 20 20 70 75 62 6c 69 63 20 24 74 65 73 74 70 61 74 68 3b 0a 0a 20 20 20 20 66 75 6e | ;.....public.$testpath;......fun |
7ae0 | 63 74 69 6f 6e 20 5f 5f 63 6f 6e 73 74 72 75 63 74 28 24 70 61 74 68 20 3d 20 27 3a 6d 65 6d 6f | ction.__construct($path.=.':memo |
7b00 | 72 79 3a 27 2c 20 24 63 6f 64 65 70 61 74 68 20 3d 20 6e 75 6c 6c 2c 20 24 74 65 73 74 70 61 74 | ry:',.$codepath.=.null,.$testpat |
7b20 | 68 20 3d 20 6e 75 6c 6c 29 0a 20 20 20 20 7b 0a 20 20 20 20 20 20 20 20 24 74 68 69 73 2d 3e 64 | h.=.null).....{.........$this->d |
7b40 | 62 20 3d 20 6e 65 77 20 5c 53 71 6c 69 74 65 33 28 24 70 61 74 68 29 3b 0a 0a 20 20 20 20 20 20 | b.=.new.\Sqlite3($path);........ |
7b60 | 20 20 24 73 71 6c 20 3d 20 27 53 45 4c 45 43 54 20 76 65 72 73 69 6f 6e 20 46 52 4f 4d 20 61 6e | ..$sql.=.'SELECT.version.FROM.an |
7b80 | 61 6c 79 7a 65 72 76 65 72 73 69 6f 6e 27 3b 0a 20 20 20 20 20 20 20 20 69 66 20 28 40 24 74 68 | alyzerversion';.........if.(@$th |
7ba0 | 69 73 2d 3e 64 62 2d 3e 71 75 65 72 79 53 69 6e 67 6c 65 28 24 73 71 6c 29 20 3d 3d 20 27 32 2e | is->db->querySingle($sql).==.'2. |
7bc0 | 31 2e 30 27 29 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 24 74 68 69 73 2d 3e 63 6f 64 65 70 | 1.0').{.............$this->codep |
7be0 | 61 74 68 20 3d 20 24 74 68 69 73 2d 3e 64 62 2d 3e 71 75 65 72 79 53 69 6e 67 6c 65 28 27 53 45 | ath.=.$this->db->querySingle('SE |
7c00 | 4c 45 43 54 20 63 6f 64 65 70 61 74 68 20 46 52 4f 4d 20 70 61 74 68 73 27 29 3b 0a 20 20 20 20 | LECT.codepath.FROM.paths');..... |
7c20 | 20 20 20 20 20 20 20 20 24 74 68 69 73 2d 3e 74 65 73 74 70 61 74 68 20 3d 20 24 74 68 69 73 2d | ........$this->testpath.=.$this- |
7c40 | 3e 64 62 2d 3e 71 75 65 72 79 53 69 6e 67 6c 65 28 27 53 45 4c 45 43 54 20 74 65 73 74 70 61 74 | >db->querySingle('SELECT.testpat |
7c60 | 68 20 46 52 4f 4d 20 70 61 74 68 73 27 29 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 | h.FROM.paths');.............retu |
7c80 | 72 6e 3b 0a 20 20 20 20 20 20 20 20 7d 0a 20 20 20 20 20 20 20 20 69 66 20 28 21 24 63 6f 64 65 | rn;.........}.........if.(!$code |
7ca0 | 70 61 74 68 20 7c 7c 20 21 24 74 65 73 74 70 61 74 68 29 20 7b 0a 20 20 20 20 20 20 20 20 20 20 | path.||.!$testpath).{........... |
7cc0 | 20 20 74 68 72 6f 77 20 6e 65 77 20 45 78 63 65 70 74 69 6f 6e 28 27 42 6f 74 68 20 63 6f 64 65 | ..throw.new.Exception('Both.code |
7ce0 | 70 61 74 68 20 61 6e 64 20 74 65 73 74 70 61 74 68 20 6d 75 73 74 20 62 65 20 73 65 74 20 69 6e | path.and.testpath.must.be.set.in |
7d00 | 20 27 20 2e 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | .'.............................. |
7d20 | 20 20 20 20 20 27 6f 72 64 65 72 20 74 6f 20 69 6e 69 74 69 61 6c 69 7a 65 20 61 20 63 6f 76 65 | .....'order.to.initialize.a.cove |
7d40 | 72 61 67 65 20 64 61 74 61 62 61 73 65 27 29 3b 0a 20 20 20 20 20 20 20 20 7d 0a 20 20 20 20 20 | rage.database');.........}...... |
7d60 | 20 20 20 24 74 68 69 73 2d 3e 63 6f 64 65 70 61 74 68 20 3d 20 24 63 6f 64 65 70 61 74 68 3b 0a | ...$this->codepath.=.$codepath;. |
7d80 | 20 20 20 20 20 20 20 20 24 74 68 69 73 2d 3e 74 65 73 74 70 61 74 68 20 3d 20 24 74 65 73 74 70 | ........$this->testpath.=.$testp |
7da0 | 61 74 68 3b 0a 20 20 20 20 20 20 20 20 2f 2f 20 72 65 73 74 61 72 74 20 74 68 65 20 64 61 74 61 | ath;.........//.restart.the.data |
7dc0 | 62 61 73 65 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 55 70 67 72 61 64 69 6e 67 20 64 61 74 | base.........echo."Upgrading.dat |
7de0 | 61 62 61 73 65 20 74 6f 20 76 65 72 73 69 6f 6e 20 32 2e 31 2e 30 5c 6e 22 3b 0a 20 20 20 20 20 | abase.to.version.2.1.0\n";...... |
7e00 | 20 20 20 24 74 68 69 73 2d 3e 64 62 2d 3e 65 78 65 63 28 27 0a 20 20 20 20 20 20 20 20 20 20 20 | ...$this->db->exec('............ |
7e20 | 20 44 52 4f 50 20 54 41 42 4c 45 20 63 6f 76 65 72 61 67 65 3b 0a 20 20 20 20 20 20 20 20 20 20 | .DROP.TABLE.coverage;........... |
7e40 | 20 20 44 52 4f 50 20 54 41 42 4c 45 20 66 69 6c 65 73 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 | ..DROP.TABLE.files;............. |
7e60 | 44 52 4f 50 20 54 41 42 4c 45 20 74 65 73 74 73 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 44 52 | DROP.TABLE.tests;.............DR |
7e80 | 4f 50 20 54 41 42 4c 45 20 63 6f 76 65 72 61 67 65 5f 70 65 72 5f 66 69 6c 65 3b 0a 20 20 20 20 | OP.TABLE.coverage_per_file;..... |
7ea0 | 20 20 20 20 20 20 20 20 44 52 4f 50 20 54 41 42 4c 45 20 78 64 65 62 75 67 73 3b 0a 20 20 20 20 | ........DROP.TABLE.xdebugs;..... |
7ec0 | 20 20 20 20 20 20 20 20 44 52 4f 50 20 54 41 42 4c 45 20 61 6e 61 6c 79 7a 65 72 76 65 72 73 69 | ........DROP.TABLE.analyzerversi |
7ee0 | 6f 6e 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 56 41 43 55 55 4d 3b 27 29 3b 0a 0a 20 20 20 20 | on;.............VACUUM;');...... |
7f00 | 20 20 20 20 24 74 68 69 73 2d 3e 64 62 2d 3e 65 78 65 63 28 27 42 45 47 49 4e 27 29 3b 0a 0a 20 | ....$this->db->exec('BEGIN');... |
7f20 | 20 20 20 20 20 20 20 24 71 75 65 72 79 20 3d 20 27 0a 20 20 20 20 20 20 20 20 20 20 43 52 45 41 | .......$query.=.'...........CREA |
7f40 | 54 45 20 54 41 42 4c 45 20 63 6f 76 65 72 61 67 65 20 28 0a 20 20 20 20 20 20 20 20 20 20 20 20 | TE.TABLE.coverage.(............. |
7f60 | 66 69 6c 65 73 5f 69 64 20 69 6e 74 65 67 65 72 20 4e 4f 54 20 4e 55 4c 4c 2c 0a 20 20 20 20 20 | files_id.integer.NOT.NULL,...... |
7f80 | 20 20 20 20 20 20 20 74 65 73 74 73 5f 69 64 20 69 6e 74 65 67 65 72 20 4e 4f 54 20 4e 55 4c 4c | .......tests_id.integer.NOT.NULL |
7fa0 | 2c 0a 20 20 20 20 20 20 20 20 20 20 20 20 6c 69 6e 65 6e 75 6d 62 65 72 20 49 4e 54 45 47 45 52 | ,.............linenumber.INTEGER |
7fc0 | 20 4e 4f 54 20 4e 55 4c 4c 2c 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 73 63 6f 76 65 72 65 64 | .NOT.NULL,.............iscovered |
7fe0 | 20 42 4f 4f 4c 20 4e 4f 54 20 4e 55 4c 4c 2c 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 73 73 6f | .BOOL.NOT.NULL,.............isso |
8000 | 75 72 63 65 20 42 4f 4f 4c 20 4e 4f 54 20 4e 55 4c 4c 2c 0a 20 20 20 20 20 20 20 20 20 20 20 20 | urce.BOOL.NOT.NULL,............. |
8020 | 50 52 49 4d 41 52 59 20 4b 45 59 20 28 66 69 6c 65 73 5f 69 64 2c 20 74 65 73 74 73 5f 69 64 2c | PRIMARY.KEY.(files_id,.tests_id, |
8040 | 20 6c 69 6e 65 6e 75 6d 62 65 72 29 0a 20 20 20 20 20 20 20 20 20 20 29 3b 0a 20 20 20 20 20 20 | .linenumber)...........);....... |
8060 | 20 20 20 20 43 52 45 41 54 45 20 49 4e 44 45 58 20 63 6f 76 65 72 61 67 65 5f 66 69 6c 65 73 5f | ....CREATE.INDEX.coverage_files_ |
8080 | 69 64 20 6f 6e 20 63 6f 76 65 72 61 67 65 20 28 66 69 6c 65 73 5f 69 64 29 3b 0a 20 20 20 20 20 | id.on.coverage.(files_id);...... |
80a0 | 20 20 20 20 20 43 52 45 41 54 45 20 49 4e 44 45 58 20 63 6f 76 65 72 61 67 65 5f 74 65 73 74 73 | .....CREATE.INDEX.coverage_tests |
80c0 | 5f 69 64 20 6f 6e 20 63 6f 76 65 72 61 67 65 20 28 74 65 73 74 73 5f 69 64 2c 20 69 73 73 6f 75 | _id.on.coverage.(tests_id,.issou |
80e0 | 72 63 65 29 3b 0a 20 20 20 20 20 20 20 20 20 20 43 52 45 41 54 45 20 49 4e 44 45 58 20 63 6f 76 | rce);...........CREATE.INDEX.cov |
8100 | 65 72 61 67 65 5f 74 65 73 74 73 5f 69 64 32 20 6f 6e 20 63 6f 76 65 72 61 67 65 20 28 74 65 73 | erage_tests_id2.on.coverage.(tes |
8120 | 74 73 5f 69 64 2c 20 66 69 6c 65 73 5f 69 64 2c 20 69 73 73 6f 75 72 63 65 29 3b 0a 20 20 20 20 | ts_id,.files_id,.issource);..... |
8140 | 20 20 20 20 20 20 43 52 45 41 54 45 20 49 4e 44 45 58 20 63 6f 76 65 72 61 67 65 5f 6c 69 6e 65 | ......CREATE.INDEX.coverage_line |
8160 | 6e 75 6d 62 65 72 20 6f 6e 20 63 6f 76 65 72 61 67 65 20 28 66 69 6c 65 73 5f 69 64 2c 20 6c 69 | number.on.coverage.(files_id,.li |
8180 | 6e 65 6e 75 6d 62 65 72 29 3b 0a 20 20 20 20 20 20 20 20 20 20 43 52 45 41 54 45 20 49 4e 44 45 | nenumber);...........CREATE.INDE |
81a0 | 58 20 63 6f 76 65 72 61 67 65 5f 69 73 73 6f 75 72 63 65 20 6f 6e 20 63 6f 76 65 72 61 67 65 20 | X.coverage_issource.on.coverage. |
81c0 | 28 69 73 73 6f 75 72 63 65 29 3b 0a 0a 20 20 20 20 20 20 20 20 20 20 43 52 45 41 54 45 20 54 41 | (issource);............CREATE.TA |
81e0 | 42 4c 45 20 63 6f 76 65 72 61 67 65 5f 70 65 72 5f 66 69 6c 65 20 28 0a 20 20 20 20 20 20 20 20 | BLE.coverage_per_file.(......... |
8200 | 20 20 20 20 66 69 6c 65 73 5f 69 64 20 69 6e 74 65 67 65 72 20 4e 4f 54 20 4e 55 4c 4c 2c 0a 20 | ....files_id.integer.NOT.NULL,.. |
8220 | 20 20 20 20 20 20 20 20 20 20 20 6c 69 6e 65 6e 75 6d 62 65 72 20 49 4e 54 45 47 45 52 20 4e 4f | ...........linenumber.INTEGER.NO |
8240 | 54 20 4e 55 4c 4c 2c 0a 20 20 20 20 20 20 20 20 20 20 20 20 63 6f 76 65 72 61 67 65 20 49 4e 54 | T.NULL,.............coverage.INT |
8260 | 45 47 45 52 20 4e 4f 54 20 4e 55 4c 4c 2c 0a 20 20 20 20 20 20 20 20 20 20 20 20 50 52 49 4d 41 | EGER.NOT.NULL,.............PRIMA |
8280 | 52 59 20 4b 45 59 20 28 66 69 6c 65 73 5f 69 64 2c 20 6c 69 6e 65 6e 75 6d 62 65 72 29 0a 20 20 | RY.KEY.(files_id,.linenumber)... |
82a0 | 20 20 20 20 20 20 20 20 29 3b 0a 20 20 20 20 20 20 20 20 20 20 43 52 45 41 54 45 20 49 4e 44 45 | ........);...........CREATE.INDE |
82c0 | 58 20 63 6f 76 65 72 61 67 65 5f 70 65 72 5f 66 69 6c 65 5f 6c 69 6e 65 6e 75 6d 62 65 72 20 6f | X.coverage_per_file_linenumber.o |
82e0 | 6e 20 63 6f 76 65 72 61 67 65 5f 70 65 72 5f 66 69 6c 65 20 28 6c 69 6e 65 6e 75 6d 62 65 72 29 | n.coverage_per_file.(linenumber) |
8300 | 3b 0a 20 20 20 20 20 20 20 20 20 20 27 3b 0a 20 20 20 20 20 20 20 20 24 77 6f 72 6b 65 64 20 3d | ;...........';.........$worked.= |
8320 | 20 24 74 68 69 73 2d 3e 64 62 2d 3e 65 78 65 63 28 24 71 75 65 72 79 29 3b 0a 20 20 20 20 20 20 | .$this->db->exec($query);....... |
8340 | 20 20 69 66 20 28 21 24 77 6f 72 6b 65 64 29 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 40 24 | ..if.(!$worked).{.............@$ |
8360 | 74 68 69 73 2d 3e 64 62 2d 3e 65 78 65 63 28 27 52 4f 4c 4c 42 41 43 4b 27 29 3b 0a 20 20 20 20 | this->db->exec('ROLLBACK');..... |
8380 | 20 20 20 20 20 20 20 20 24 65 72 72 6f 72 20 3d 20 24 74 68 69 73 2d 3e 64 62 2d 3e 6c 61 73 74 | ........$error.=.$this->db->last |
83a0 | 45 72 72 6f 72 4d 73 67 28 29 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 74 68 72 6f 77 20 6e 65 | ErrorMsg();.............throw.ne |
83c0 | 77 20 45 78 63 65 70 74 69 6f 6e 28 27 55 6e 61 62 6c 65 20 74 6f 20 63 72 65 61 74 65 20 43 6f | w.Exception('Unable.to.create.Co |
83e0 | 64 65 20 43 6f 76 65 72 61 67 65 20 53 51 4c 69 74 65 33 20 64 61 74 61 62 61 73 65 3a 20 27 20 | de.Coverage.SQLite3.database:.'. |
8400 | 2e 20 24 65 72 72 6f 72 29 3b 0a 20 20 20 20 20 20 20 20 7d 0a 0a 20 20 20 20 20 20 20 20 24 71 | ..$error);.........}..........$q |
8420 | 75 65 72 79 20 3d 20 27 0a 20 20 20 20 20 20 20 20 20 20 43 52 45 41 54 45 20 54 41 42 4c 45 20 | uery.=.'...........CREATE.TABLE. |
8440 | 66 69 6c 65 73 20 28 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 64 20 49 4e 54 45 47 45 52 20 4e | files.(.............id.INTEGER.N |
8460 | 4f 54 20 4e 55 4c 4c 20 50 52 49 4d 41 52 59 20 4b 45 59 20 41 55 54 4f 49 4e 43 52 45 4d 45 4e | OT.NULL.PRIMARY.KEY.AUTOINCREMEN |
8480 | 54 2c 0a 20 20 20 20 20 20 20 20 20 20 20 20 66 69 6c 65 70 61 74 68 20 54 45 58 54 28 35 30 30 | T,.............filepath.TEXT(500 |
84a0 | 29 20 4e 4f 54 20 4e 55 4c 4c 2c 0a 20 20 20 20 20 20 20 20 20 20 20 20 66 69 6c 65 70 61 74 68 | ).NOT.NULL,.............filepath |
84c0 | 6d 64 35 20 54 45 58 54 28 33 32 29 20 4e 4f 54 20 4e 55 4c 4c 2c 0a 20 20 20 20 20 20 20 20 20 | md5.TEXT(32).NOT.NULL,.......... |
84e0 | 20 20 20 69 73 73 6f 75 72 63 65 20 42 4f 4f 4c 20 4e 4f 54 20 4e 55 4c 4c 2c 0a 20 20 20 20 20 | ...issource.BOOL.NOT.NULL,...... |
8500 | 20 20 20 20 20 20 20 55 4e 49 51 55 45 20 28 66 69 6c 65 70 61 74 68 29 0a 20 20 20 20 20 20 20 | .......UNIQUE.(filepath)........ |
8520 | 20 20 20 29 3b 0a 20 20 20 20 20 20 20 20 20 20 43 52 45 41 54 45 20 49 4e 44 45 58 20 66 69 6c | ...);...........CREATE.INDEX.fil |
8540 | 65 73 5f 69 73 73 6f 75 72 63 65 20 6f 6e 20 66 69 6c 65 73 20 28 69 73 73 6f 75 72 63 65 29 3b | es_issource.on.files.(issource); |
8560 | 0a 20 20 20 20 20 20 20 20 20 20 27 3b 0a 20 20 20 20 20 20 20 20 24 77 6f 72 6b 65 64 20 3d 20 | ...........';.........$worked.=. |
8580 | 24 74 68 69 73 2d 3e 64 62 2d 3e 65 78 65 63 28 24 71 75 65 72 79 29 3b 0a 20 20 20 20 20 20 20 | $this->db->exec($query);........ |
85a0 | 20 69 66 20 28 21 24 77 6f 72 6b 65 64 29 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 40 24 74 | .if.(!$worked).{.............@$t |
85c0 | 68 69 73 2d 3e 64 62 2d 3e 65 78 65 63 28 27 52 4f 4c 4c 42 41 43 4b 27 29 3b 0a 20 20 20 20 20 | his->db->exec('ROLLBACK');...... |
85e0 | 20 20 20 20 20 20 20 24 65 72 72 6f 72 20 3d 20 24 74 68 69 73 2d 3e 64 62 2d 3e 6c 61 73 74 45 | .......$error.=.$this->db->lastE |
8600 | 72 72 6f 72 4d 73 67 28 29 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 74 68 72 6f 77 20 6e 65 77 | rrorMsg();.............throw.new |
8620 | 20 45 78 63 65 70 74 69 6f 6e 28 27 55 6e 61 62 6c 65 20 74 6f 20 63 72 65 61 74 65 20 43 6f 64 | .Exception('Unable.to.create.Cod |
8640 | 65 20 43 6f 76 65 72 61 67 65 20 53 51 4c 69 74 65 33 20 64 61 74 61 62 61 73 65 3a 20 27 20 2e | e.Coverage.SQLite3.database:.'.. |
8660 | 20 24 65 72 72 6f 72 29 3b 0a 20 20 20 20 20 20 20 20 7d 0a 0a 20 20 20 20 20 20 20 20 24 71 75 | .$error);.........}..........$qu |
8680 | 65 72 79 20 3d 20 27 0a 20 20 20 20 20 20 20 20 20 20 43 52 45 41 54 45 20 54 41 42 4c 45 20 78 | ery.=.'...........CREATE.TABLE.x |
86a0 | 64 65 62 75 67 73 20 28 0a 20 20 20 20 20 20 20 20 20 20 20 20 78 64 65 62 75 67 70 61 74 68 20 | debugs.(.............xdebugpath. |
86c0 | 54 45 58 54 28 35 30 30 29 20 4e 4f 54 20 4e 55 4c 4c 2c 0a 20 20 20 20 20 20 20 20 20 20 20 20 | TEXT(500).NOT.NULL,............. |
86e0 | 78 64 65 62 75 67 70 61 74 68 6d 64 35 20 54 45 58 54 28 33 32 29 20 4e 4f 54 20 4e 55 4c 4c 2c | xdebugpathmd5.TEXT(32).NOT.NULL, |
8700 | 0a 20 20 20 20 20 20 20 20 20 20 20 20 50 52 49 4d 41 52 59 20 4b 45 59 20 28 78 64 65 62 75 67 | .............PRIMARY.KEY.(xdebug |
8720 | 70 61 74 68 29 0a 20 20 20 20 20 20 20 20 20 20 29 3b 27 3b 0a 20 20 20 20 20 20 20 20 24 77 6f | path)...........);';.........$wo |
8740 | 72 6b 65 64 20 3d 20 24 74 68 69 73 2d 3e 64 62 2d 3e 65 78 65 63 28 24 71 75 65 72 79 29 3b 0a | rked.=.$this->db->exec($query);. |
8760 | 20 20 20 20 20 20 20 20 69 66 20 28 21 24 77 6f 72 6b 65 64 29 20 7b 0a 20 20 20 20 20 20 20 20 | ........if.(!$worked).{......... |
8780 | 20 20 20 20 40 24 74 68 69 73 2d 3e 64 62 2d 3e 65 78 65 63 28 27 52 4f 4c 4c 42 41 43 4b 27 29 | ....@$this->db->exec('ROLLBACK') |
87a0 | 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 24 65 72 72 6f 72 20 3d 20 24 74 68 69 73 2d 3e 64 62 | ;.............$error.=.$this->db |
87c0 | 2d 3e 6c 61 73 74 45 72 72 6f 72 4d 73 67 28 29 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 74 68 | ->lastErrorMsg();.............th |
87e0 | 72 6f 77 20 6e 65 77 20 45 78 63 65 70 74 69 6f 6e 28 27 55 6e 61 62 6c 65 20 74 6f 20 63 72 65 | row.new.Exception('Unable.to.cre |
8800 | 61 74 65 20 43 6f 64 65 20 43 6f 76 65 72 61 67 65 20 53 51 4c 69 74 65 33 20 64 61 74 61 62 61 | ate.Code.Coverage.SQLite3.databa |
8820 | 73 65 3a 20 27 20 2e 20 24 65 72 72 6f 72 29 3b 0a 20 20 20 20 20 20 20 20 7d 0a 0a 20 20 20 20 | se:.'...$error);.........}...... |
8840 | 20 20 20 20 24 71 75 65 72 79 20 3d 20 27 0a 20 20 20 20 20 20 20 20 20 20 43 52 45 41 54 45 20 | ....$query.=.'...........CREATE. |
8860 | 54 41 42 4c 45 20 74 65 73 74 73 20 28 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 64 20 49 4e 54 | TABLE.tests.(.............id.INT |
8880 | 45 47 45 52 20 4e 4f 54 20 4e 55 4c 4c 20 50 52 49 4d 41 52 59 20 4b 45 59 20 41 55 54 4f 49 4e | EGER.NOT.NULL.PRIMARY.KEY.AUTOIN |
88a0 | 43 52 45 4d 45 4e 54 2c 0a 20 20 20 20 20 20 20 20 20 20 20 20 74 65 73 74 70 61 74 68 20 54 45 | CREMENT,.............testpath.TE |
88c0 | 58 54 28 35 30 30 29 20 4e 4f 54 20 4e 55 4c 4c 2c 0a 20 20 20 20 20 20 20 20 20 20 20 20 74 65 | XT(500).NOT.NULL,.............te |
88e0 | 73 74 70 61 74 68 6d 64 35 20 54 45 58 54 28 33 32 29 20 4e 4f 54 20 4e 55 4c 4c 2c 0a 20 20 20 | stpathmd5.TEXT(32).NOT.NULL,.... |
8900 | 20 20 20 20 20 20 20 20 20 55 4e 49 51 55 45 20 28 74 65 73 74 70 61 74 68 29 0a 20 20 20 20 20 | .........UNIQUE.(testpath)...... |
8920 | 20 20 20 20 20 29 3b 27 3b 0a 20 20 20 20 20 20 20 20 24 77 6f 72 6b 65 64 20 3d 20 24 74 68 69 | .....);';.........$worked.=.$thi |
8940 | 73 2d 3e 64 62 2d 3e 65 78 65 63 28 24 71 75 65 72 79 29 3b 0a 20 20 20 20 20 20 20 20 69 66 20 | s->db->exec($query);.........if. |
8960 | 28 21 24 77 6f 72 6b 65 64 29 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 40 24 74 68 69 73 2d | (!$worked).{.............@$this- |
8980 | 3e 64 62 2d 3e 65 78 65 63 28 27 52 4f 4c 4c 42 41 43 4b 27 29 3b 0a 20 20 20 20 20 20 20 20 20 | >db->exec('ROLLBACK');.......... |
89a0 | 20 20 20 24 65 72 72 6f 72 20 3d 20 24 74 68 69 73 2d 3e 64 62 2d 3e 6c 61 73 74 45 72 72 6f 72 | ...$error.=.$this->db->lastError |
89c0 | 4d 73 67 28 29 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 74 68 72 6f 77 20 6e 65 77 20 45 78 63 | Msg();.............throw.new.Exc |
89e0 | 65 70 74 69 6f 6e 28 27 55 6e 61 62 6c 65 20 74 6f 20 63 72 65 61 74 65 20 43 6f 64 65 20 43 6f | eption('Unable.to.create.Code.Co |
8a00 | 76 65 72 61 67 65 20 53 51 4c 69 74 65 33 20 64 61 74 61 62 61 73 65 3a 20 27 20 2e 20 24 65 72 | verage.SQLite3.database:.'...$er |
8a20 | 72 6f 72 29 3b 0a 20 20 20 20 20 20 20 20 7d 0a 0a 20 20 20 20 20 20 20 20 24 71 75 65 72 79 20 | ror);.........}..........$query. |
8a40 | 3d 20 27 0a 20 20 20 20 20 20 20 20 20 20 43 52 45 41 54 45 20 54 41 42 4c 45 20 61 6e 61 6c 79 | =.'...........CREATE.TABLE.analy |
8a60 | 7a 65 72 76 65 72 73 69 6f 6e 20 28 0a 20 20 20 20 20 20 20 20 20 20 20 20 76 65 72 73 69 6f 6e | zerversion.(.............version |
8a80 | 20 54 45 58 54 28 35 29 20 4e 4f 54 20 4e 55 4c 4c 0a 20 20 20 20 20 20 20 20 20 20 29 3b 0a 0a | .TEXT(5).NOT.NULL...........);.. |
8aa0 | 20 20 20 20 20 20 20 20 20 20 49 4e 53 45 52 54 20 49 4e 54 4f 20 61 6e 61 6c 79 7a 65 72 76 65 | ..........INSERT.INTO.analyzerve |
8ac0 | 72 73 69 6f 6e 20 56 41 4c 55 45 53 28 22 32 2e 30 2e 30 22 29 3b 0a 0a 20 20 20 20 20 20 20 20 | rsion.VALUES("2.0.0");.......... |
8ae0 | 20 20 43 52 45 41 54 45 20 54 41 42 4c 45 20 70 61 74 68 73 20 28 0a 20 20 20 20 20 20 20 20 20 | ..CREATE.TABLE.paths.(.......... |
8b00 | 20 20 20 63 6f 64 65 70 61 74 68 20 54 45 58 54 20 4e 4f 54 20 4e 55 4c 4c 2c 0a 20 20 20 20 20 | ...codepath.TEXT.NOT.NULL,...... |
8b20 | 20 20 20 20 20 20 20 74 65 73 74 70 61 74 68 20 54 45 58 54 20 4e 4f 54 20 4e 55 4c 4c 2c 0a 20 | .......testpath.TEXT.NOT.NULL,.. |
8b40 | 20 20 20 20 20 20 20 20 20 29 3b 0a 20 20 20 20 20 20 20 20 20 20 0a 20 20 20 20 20 20 20 20 20 | .........);..................... |
8b60 | 20 49 4e 53 45 52 54 20 49 4e 54 4f 20 70 61 74 68 73 20 28 22 27 20 2e 20 24 74 68 69 73 2d 3e | .INSERT.INTO.paths.("'...$this-> |
8b80 | 64 62 2d 3e 65 73 63 61 70 65 53 74 72 69 6e 67 28 24 63 6f 64 65 70 61 74 68 29 20 2e 20 27 22 | db->escapeString($codepath)...'" |
8ba0 | 2c 20 22 27 20 2e 0a 20 20 20 20 20 20 20 20 20 20 24 74 68 69 73 2d 3e 64 62 2d 3e 65 73 63 61 | ,."'.............$this->db->esca |
8bc0 | 70 65 53 74 72 69 6e 67 28 24 74 65 73 74 70 61 74 68 29 2e 20 27 22 29 27 3b 0a 20 20 20 20 20 | peString($testpath)..'")';...... |
8be0 | 20 20 20 24 77 6f 72 6b 65 64 20 3d 20 24 74 68 69 73 2d 3e 64 62 2d 3e 65 78 65 63 28 24 71 75 | ...$worked.=.$this->db->exec($qu |
8c00 | 65 72 79 29 3b 0a 20 20 20 20 20 20 20 20 69 66 20 28 21 24 77 6f 72 6b 65 64 29 20 7b 0a 20 20 | ery);.........if.(!$worked).{... |
8c20 | 20 20 20 20 20 20 20 20 20 20 40 24 74 68 69 73 2d 3e 64 62 2d 3e 65 78 65 63 28 27 52 4f 4c 4c | ..........@$this->db->exec('ROLL |
8c40 | 42 41 43 4b 27 29 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 24 65 72 72 6f 72 20 3d 20 24 74 68 | BACK');.............$error.=.$th |
8c60 | 69 73 2d 3e 64 62 2d 3e 6c 61 73 74 45 72 72 6f 72 4d 73 67 28 29 3b 0a 20 20 20 20 20 20 20 20 | is->db->lastErrorMsg();......... |
8c80 | 20 20 20 20 74 68 72 6f 77 20 6e 65 77 20 45 78 63 65 70 74 69 6f 6e 28 27 55 6e 61 62 6c 65 20 | ....throw.new.Exception('Unable. |
8ca0 | 74 6f 20 63 72 65 61 74 65 20 43 6f 64 65 20 43 6f 76 65 72 61 67 65 20 53 51 4c 69 74 65 33 20 | to.create.Code.Coverage.SQLite3. |
8cc0 | 64 61 74 61 62 61 73 65 3a 20 27 20 2e 20 24 65 72 72 6f 72 29 3b 0a 20 20 20 20 20 20 20 20 7d | database:.'...$error);.........} |
8ce0 | 0a 20 20 20 20 20 20 20 20 24 74 68 69 73 2d 3e 64 62 2d 3e 65 78 65 63 28 27 43 4f 4d 4d 49 54 | .........$this->db->exec('COMMIT |
8d00 | 27 29 3b 0a 20 20 20 20 7d 0a 0a 20 20 20 20 66 75 6e 63 74 69 6f 6e 20 72 65 74 72 69 65 76 65 | ');.....}......function.retrieve |
8d20 | 4c 69 6e 65 4c 69 6e 6b 73 28 24 66 69 6c 65 29 0a 20 20 20 20 7b 0a 20 20 20 20 20 20 20 20 24 | LineLinks($file).....{.........$ |
8d40 | 69 64 20 3d 20 24 74 68 69 73 2d 3e 67 65 74 46 69 6c 65 49 64 28 24 66 69 6c 65 29 3b 0a 20 20 | id.=.$this->getFileId($file);... |
8d60 | 20 20 20 20 20 20 24 71 75 65 72 79 20 3d 20 27 53 45 4c 45 43 54 20 74 2e 74 65 73 74 70 61 74 | ......$query.=.'SELECT.t.testpat |
8d80 | 68 2c 20 63 2e 6c 69 6e 65 6e 75 6d 62 65 72 0a 20 20 20 20 20 20 20 20 20 20 20 20 46 52 4f 4d | h,.c.linenumber.............FROM |
8da0 | 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 6f 76 65 72 61 67 65 20 63 2c 20 74 65 73 | .................coverage.c,.tes |
8dc0 | 74 73 20 74 0a 20 20 20 20 20 20 20 20 20 20 20 20 57 48 45 52 45 0a 20 20 20 20 20 20 20 20 20 | ts.t.............WHERE.......... |
8de0 | 20 20 20 20 20 20 20 63 2e 66 69 6c 65 73 5f 69 64 3d 27 20 2e 20 24 69 64 20 2e 20 27 20 41 4e | .......c.files_id='...$id...'.AN |
8e00 | 44 20 74 2e 69 64 3d 63 2e 74 65 73 74 73 5f 69 64 27 20 3b 0a 20 20 20 20 20 20 20 20 24 72 65 | D.t.id=c.tests_id'.;.........$re |
8e20 | 73 75 6c 74 20 3d 20 24 74 68 69 73 2d 3e 64 62 2d 3e 71 75 65 72 79 28 24 71 75 65 72 79 29 3b | sult.=.$this->db->query($query); |
8e40 | 0a 20 20 20 20 20 20 20 20 69 66 20 28 21 24 72 65 73 75 6c 74 29 20 7b 0a 20 20 20 20 20 20 20 | .........if.(!$result).{........ |
8e60 | 20 20 20 20 20 24 65 72 72 6f 72 20 3d 20 24 74 68 69 73 2d 3e 64 62 2d 3e 6c 61 73 74 45 72 72 | .....$error.=.$this->db->lastErr |
8e80 | 6f 72 4d 73 67 28 29 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 74 68 72 6f 77 20 6e 65 77 20 45 | orMsg();.............throw.new.E |
8ea0 | 78 63 65 70 74 69 6f 6e 28 27 43 61 6e 6e 6f 74 20 72 65 74 72 69 65 76 65 20 6c 69 6e 65 20 6c | xception('Cannot.retrieve.line.l |
8ec0 | 69 6e 6b 73 20 66 6f 72 20 27 20 2e 20 24 66 69 6c 65 20 2e 0a 20 20 20 20 20 20 20 20 20 20 20 | inks.for.'...$file.............. |
8ee0 | 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 27 20 6c 69 6e 65 20 23 27 20 2e | .....................'.line.#'.. |
8f00 | 20 24 6c 69 6e 65 20 2e 20 20 27 3a 20 27 20 2e 20 24 65 72 72 6f 72 29 3b 0a 20 20 20 20 20 20 | .$line....':.'...$error);....... |
8f20 | 20 20 7d 0a 0a 20 20 20 20 20 20 20 20 24 72 65 74 20 3d 20 61 72 72 61 79 28 29 3b 0a 20 20 20 | ..}..........$ret.=.array();.... |
8f40 | 20 20 20 20 20 77 68 69 6c 65 20 28 24 72 65 73 20 3d 20 24 72 65 73 75 6c 74 2d 3e 66 65 74 63 | .....while.($res.=.$result->fetc |
8f60 | 68 41 72 72 61 79 28 53 51 4c 49 54 45 33 5f 41 53 53 4f 43 29 29 20 7b 0a 20 20 20 20 20 20 20 | hArray(SQLITE3_ASSOC)).{........ |
8f80 | 20 20 20 20 20 24 72 65 74 5b 24 72 65 73 5b 27 6c 69 6e 65 6e 75 6d 62 65 72 27 5d 5d 5b 5d 20 | .....$ret[$res['linenumber']][]. |
8fa0 | 3d 20 24 72 65 73 5b 27 74 65 73 74 70 61 74 68 27 5d 3b 0a 20 20 20 20 20 20 20 20 7d 0a 20 20 | =.$res['testpath'];.........}... |
8fc0 | 20 20 20 20 20 20 72 65 74 75 72 6e 20 24 72 65 74 3b 0a 20 20 20 20 7d 0a 0a 20 20 20 20 66 75 | ......return.$ret;.....}......fu |
8fe0 | 6e 63 74 69 6f 6e 20 72 65 74 72 69 65 76 65 54 65 73 74 50 61 74 68 73 28 29 0a 20 20 20 20 7b | nction.retrieveTestPaths().....{ |
9000 | 0a 20 20 20 20 20 20 20 20 24 71 75 65 72 79 20 3d 20 27 53 45 4c 45 43 54 20 74 65 73 74 70 61 | .........$query.=.'SELECT.testpa |
9020 | 74 68 20 66 72 6f 6d 20 74 65 73 74 73 20 4f 52 44 45 52 20 42 59 20 74 65 73 74 70 61 74 68 27 | th.from.tests.ORDER.BY.testpath' |
9040 | 3b 0a 20 20 20 20 20 20 20 20 24 72 65 73 75 6c 74 20 3d 20 24 74 68 69 73 2d 3e 64 62 2d 3e 71 | ;.........$result.=.$this->db->q |
9060 | 75 65 72 79 28 24 71 75 65 72 79 29 3b 0a 20 20 20 20 20 20 20 20 69 66 20 28 21 24 72 65 73 75 | uery($query);.........if.(!$resu |
9080 | 6c 74 29 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 24 65 72 72 6f 72 20 3d 20 24 74 68 69 73 | lt).{.............$error.=.$this |
90a0 | 2d 3e 64 62 2d 3e 6c 61 73 74 45 72 72 6f 72 4d 73 67 28 29 3b 0a 20 20 20 20 20 20 20 20 20 20 | ->db->lastErrorMsg();........... |
90c0 | 20 20 74 68 72 6f 77 20 6e 65 77 20 45 78 63 65 70 74 69 6f 6e 28 27 43 61 6e 6e 6f 74 20 72 65 | ..throw.new.Exception('Cannot.re |
90e0 | 74 72 69 65 76 65 20 74 65 73 74 20 70 61 74 68 73 20 3a 27 20 2e 20 24 65 72 72 6f 72 29 3b 0a | trieve.test.paths.:'...$error);. |
9100 | 20 20 20 20 20 20 20 20 7d 0a 20 20 20 20 20 20 20 20 24 72 65 74 20 3d 20 61 72 72 61 79 28 29 | ........}.........$ret.=.array() |
9120 | 3b 0a 20 20 20 20 20 20 20 20 77 68 69 6c 65 20 28 24 72 65 73 20 3d 20 24 72 65 73 75 6c 74 2d | ;.........while.($res.=.$result- |
9140 | 3e 66 65 74 63 68 41 72 72 61 79 28 53 51 4c 49 54 45 33 5f 4e 55 4d 29 29 20 7b 0a 20 20 20 20 | >fetchArray(SQLITE3_NUM)).{..... |
9160 | 20 20 20 20 20 20 20 20 24 72 65 74 5b 5d 20 3d 20 24 72 65 73 5b 30 5d 3b 0a 20 20 20 20 20 20 | ........$ret[].=.$res[0];....... |
9180 | 20 20 7d 0a 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 24 72 65 74 3b 0a 20 20 20 20 7d 0a 0a | ..}.........return.$ret;.....}.. |
91a0 | 20 20 20 20 66 75 6e 63 74 69 6f 6e 20 72 65 74 72 69 65 76 65 50 61 74 68 73 46 6f 72 54 65 73 | ....function.retrievePathsForTes |
91c0 | 74 28 24 74 65 73 74 2c 20 24 61 6c 6c 20 3d 20 30 29 0a 20 20 20 20 7b 0a 20 20 20 20 20 20 20 | t($test,.$all.=.0).....{........ |
91e0 | 20 24 69 64 20 3d 20 24 74 68 69 73 2d 3e 67 65 74 54 65 73 74 49 64 28 24 74 65 73 74 29 3b 0a | .$id.=.$this->getTestId($test);. |
9200 | 20 20 20 20 20 20 20 20 69 66 20 28 24 61 6c 6c 29 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 | ........if.($all).{............. |
9220 | 24 71 75 65 72 79 20 3d 20 27 53 45 4c 45 43 54 20 44 49 53 54 49 4e 43 54 20 66 69 6c 65 70 61 | $query.=.'SELECT.DISTINCT.filepa |
9240 | 74 68 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 46 52 4f 4d 20 63 6f 76 65 72 61 67 65 | th.................FROM.coverage |
9260 | 20 63 2c 20 66 69 6c 65 73 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 57 48 45 52 45 20 | .c,.files.................WHERE. |
9280 | 63 2e 74 65 73 74 73 5f 69 64 3d 27 20 2e 20 24 69 64 20 2e 20 27 0a 20 20 20 20 20 20 20 20 20 | c.tests_id='...$id...'.......... |
92a0 | 20 20 20 20 20 20 20 20 20 20 20 41 4e 44 20 66 69 6c 65 73 2e 69 64 3d 63 2e 66 69 6c 65 73 5f | ...........AND.files.id=c.files_ |
92c0 | 69 64 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 47 52 4f 55 50 20 42 59 20 63 2e 66 69 | id.................GROUP.BY.c.fi |
92e0 | 6c 65 73 5f 69 64 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 4f 52 44 45 52 20 42 59 20 | les_id.................ORDER.BY. |
9300 | 66 69 6c 65 70 61 74 68 27 3b 0a 20 20 20 20 20 20 20 20 7d 20 65 6c 73 65 20 7b 0a 20 20 20 20 | filepath';.........}.else.{..... |
9320 | 20 20 20 20 20 20 20 20 24 71 75 65 72 79 20 3d 20 27 53 45 4c 45 43 54 20 44 49 53 54 49 4e 43 | ........$query.=.'SELECT.DISTINC |
9340 | 54 20 66 69 6c 65 70 61 74 68 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 46 52 4f 4d 20 | T.filepath.................FROM. |
9360 | 63 6f 76 65 72 61 67 65 20 63 2c 20 66 69 6c 65 73 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | coverage.c,.files............... |
9380 | 20 20 57 48 45 52 45 20 63 2e 74 65 73 74 73 5f 69 64 3d 27 20 2e 20 24 69 64 20 2e 20 27 0a 20 | ..WHERE.c.tests_id='...$id...'.. |
93a0 | 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 41 4e 44 20 63 2e 69 73 73 6f 75 72 63 | ...................AND.c.issourc |
93c0 | 65 3d 31 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 41 4e 44 20 66 69 6c 65 | e=1.....................AND.file |
93e0 | 73 2e 69 64 3d 63 2e 66 69 6c 65 73 5f 69 64 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | s.id=c.files_id................. |
9400 | 47 52 4f 55 50 20 42 59 20 63 2e 66 69 6c 65 73 5f 69 64 0a 20 20 20 20 20 20 20 20 20 20 20 20 | GROUP.BY.c.files_id............. |
9420 | 20 20 20 20 4f 52 44 45 52 20 42 59 20 66 69 6c 65 70 61 74 68 27 3b 0a 20 20 20 20 20 20 20 20 | ....ORDER.BY.filepath';......... |
9440 | 7d 0a 20 20 20 20 20 20 20 20 24 72 65 73 75 6c 74 20 3d 20 24 74 68 69 73 2d 3e 64 62 2d 3e 71 | }.........$result.=.$this->db->q |
9460 | 75 65 72 79 28 24 71 75 65 72 79 29 3b 0a 20 20 20 20 20 20 20 20 69 66 20 28 21 24 72 65 73 75 | uery($query);.........if.(!$resu |
9480 | 6c 74 29 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 24 65 72 72 6f 72 20 3d 20 24 74 68 69 73 | lt).{.............$error.=.$this |
94a0 | 2d 3e 64 62 2d 3e 6c 61 73 74 45 72 72 6f 72 4d 73 67 28 29 3b 0a 20 20 20 20 20 20 20 20 20 20 | ->db->lastErrorMsg();........... |
94c0 | 20 20 74 68 72 6f 77 20 6e 65 77 20 45 78 63 65 70 74 69 6f 6e 28 27 43 61 6e 6e 6f 74 20 72 65 | ..throw.new.Exception('Cannot.re |
94e0 | 74 72 69 65 76 65 20 66 69 6c 65 20 70 61 74 68 73 20 66 6f 72 20 74 65 73 74 20 27 20 2e 20 24 | trieve.file.paths.for.test.'...$ |
9500 | 74 65 73 74 20 2e 20 27 3a 27 20 2e 20 24 65 72 72 6f 72 29 3b 0a 20 20 20 20 20 20 20 20 7d 0a | test...':'...$error);.........}. |
9520 | 20 20 20 20 20 20 20 20 24 72 65 74 20 3d 20 61 72 72 61 79 28 29 3b 0a 20 20 20 20 20 20 20 20 | ........$ret.=.array();......... |
9540 | 77 68 69 6c 65 20 28 24 72 65 73 20 3d 20 24 72 65 73 75 6c 74 2d 3e 66 65 74 63 68 41 72 72 61 | while.($res.=.$result->fetchArra |
9560 | 79 28 53 51 4c 49 54 45 33 5f 4e 55 4d 29 29 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 24 72 | y(SQLITE3_NUM)).{.............$r |
9580 | 65 74 5b 5d 20 3d 20 24 72 65 73 5b 30 5d 3b 0a 20 20 20 20 20 20 20 20 7d 0a 20 20 20 20 20 20 | et[].=.$res[0];.........}....... |
95a0 | 20 20 72 65 74 75 72 6e 20 24 72 65 74 3b 0a 20 20 20 20 7d 0a 0a 20 20 20 20 66 75 6e 63 74 69 | ..return.$ret;.....}......functi |
95c0 | 6f 6e 20 72 65 74 72 69 65 76 65 50 61 74 68 73 28 24 61 6c 6c 20 3d 20 30 29 0a 20 20 20 20 7b | on.retrievePaths($all.=.0).....{ |
95e0 | 0a 20 20 20 20 20 20 20 20 69 66 20 28 24 61 6c 6c 29 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 | .........if.($all).{............ |
9600 | 20 24 71 75 65 72 79 20 3d 20 27 53 45 4c 45 43 54 20 66 69 6c 65 70 61 74 68 20 66 72 6f 6d 20 | .$query.=.'SELECT.filepath.from. |
9620 | 66 69 6c 65 73 20 4f 52 44 45 52 20 42 59 20 66 69 6c 65 70 61 74 68 27 3b 0a 20 20 20 20 20 20 | files.ORDER.BY.filepath';....... |
9640 | 20 20 7d 20 65 6c 73 65 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 24 71 75 65 72 79 20 3d 20 | ..}.else.{.............$query.=. |
9660 | 27 53 45 4c 45 43 54 20 66 69 6c 65 70 61 74 68 20 66 72 6f 6d 20 66 69 6c 65 73 20 57 48 45 52 | 'SELECT.filepath.from.files.WHER |
9680 | 45 20 69 73 73 6f 75 72 63 65 3d 31 20 4f 52 44 45 52 20 42 59 20 66 69 6c 65 70 61 74 68 27 3b | E.issource=1.ORDER.BY.filepath'; |
96a0 | 0a 20 20 20 20 20 20 20 20 7d 0a 20 20 20 20 20 20 20 20 24 72 65 73 75 6c 74 20 3d 20 24 74 68 | .........}.........$result.=.$th |
96c0 | 69 73 2d 3e 64 62 2d 3e 71 75 65 72 79 28 24 71 75 65 72 79 29 3b 0a 20 20 20 20 20 20 20 20 69 | is->db->query($query);.........i |
96e0 | 66 20 28 21 24 72 65 73 75 6c 74 29 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 24 65 72 72 6f | f.(!$result).{.............$erro |
9700 | 72 20 3d 20 24 74 68 69 73 2d 3e 64 62 2d 3e 6c 61 73 74 45 72 72 6f 72 4d 73 67 28 29 3b 0a 20 | r.=.$this->db->lastErrorMsg();.. |
9720 | 20 20 20 20 20 20 20 20 20 20 20 74 68 72 6f 77 20 6e 65 77 20 45 78 63 65 70 74 69 6f 6e 28 27 | ...........throw.new.Exception(' |
9740 | 43 61 6e 6e 6f 74 20 72 65 74 72 69 65 76 65 20 66 69 6c 65 20 70 61 74 68 73 20 3a 27 20 2e 20 | Cannot.retrieve.file.paths.:'... |
9760 | 24 65 72 72 6f 72 29 3b 0a 20 20 20 20 20 20 20 20 7d 0a 20 20 20 20 20 20 20 20 24 72 65 74 20 | $error);.........}.........$ret. |
9780 | 3d 20 61 72 72 61 79 28 29 3b 0a 20 20 20 20 20 20 20 20 77 68 69 6c 65 20 28 24 72 65 73 20 3d | =.array();.........while.($res.= |
97a0 | 20 24 72 65 73 75 6c 74 2d 3e 66 65 74 63 68 41 72 72 61 79 28 53 51 4c 49 54 45 33 5f 4e 55 4d | .$result->fetchArray(SQLITE3_NUM |
97c0 | 29 29 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 24 72 65 74 5b 5d 20 3d 20 24 72 65 73 5b 30 | )).{.............$ret[].=.$res[0 |
97e0 | 5d 3b 0a 20 20 20 20 20 20 20 20 7d 0a 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 24 72 65 74 | ];.........}.........return.$ret |
9800 | 3b 0a 20 20 20 20 7d 0a 0a 20 20 20 20 66 75 6e 63 74 69 6f 6e 20 63 6f 76 65 72 61 67 65 50 65 | ;.....}......function.coveragePe |
9820 | 72 63 65 6e 74 61 67 65 28 24 73 6f 75 72 63 65 66 69 6c 65 2c 20 24 74 65 73 74 66 69 6c 65 20 | rcentage($sourcefile,.$testfile. |
9840 | 3d 20 6e 75 6c 6c 29 0a 20 20 20 20 7b 0a 20 20 20 20 20 20 20 20 69 66 20 28 24 74 65 73 74 66 | =.null).....{.........if.($testf |
9860 | 69 6c 65 29 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 24 63 6f 76 65 72 61 67 65 20 3d 20 24 | ile).{.............$coverage.=.$ |
9880 | 74 68 69 73 2d 3e 72 65 74 72 69 65 76 65 50 61 74 68 43 6f 76 65 72 61 67 65 42 79 54 65 73 74 | this->retrievePathCoverageByTest |
98a0 | 28 24 73 6f 75 72 63 65 66 69 6c 65 2c 20 24 74 65 73 74 66 69 6c 65 29 3b 0a 20 20 20 20 20 20 | ($sourcefile,.$testfile);....... |
98c0 | 20 20 7d 20 65 6c 73 65 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 24 63 6f 76 65 72 61 67 65 | ..}.else.{.............$coverage |
98e0 | 20 3d 20 24 74 68 69 73 2d 3e 72 65 74 72 69 65 76 65 50 61 74 68 43 6f 76 65 72 61 67 65 28 24 | .=.$this->retrievePathCoverage($ |
9900 | 73 6f 75 72 63 65 66 69 6c 65 29 3b 0a 20 20 20 20 20 20 20 20 7d 0a 20 20 20 20 20 20 20 20 72 | sourcefile);.........}.........r |
9920 | 65 74 75 72 6e 20 72 6f 75 6e 64 28 28 24 63 6f 76 65 72 61 67 65 5b 30 5d 20 2f 20 24 63 6f 76 | eturn.round(($coverage[0]./.$cov |
9940 | 65 72 61 67 65 5b 31 5d 29 20 2a 20 31 30 30 29 3b 0a 20 20 20 20 7d 0a 0a 20 20 20 20 66 75 6e | erage[1]).*.100);.....}......fun |
9960 | 63 74 69 6f 6e 20 72 65 74 72 69 65 76 65 50 72 6f 6a 65 63 74 43 6f 76 65 72 61 67 65 28 29 0a | ction.retrieveProjectCoverage(). |
9980 | 20 20 20 20 7b 0a 20 20 20 20 20 20 20 20 69 66 20 28 24 74 68 69 73 2d 3e 74 6f 74 61 6c 6c 69 | ....{.........if.($this->totalli |
99a0 | 6e 65 73 29 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 61 72 72 61 79 28 | nes).{.............return.array( |
99c0 | 24 74 68 69 73 2d 3e 63 6f 76 65 72 65 64 6c 69 6e 65 73 2c 20 24 74 68 69 73 2d 3e 74 6f 74 61 | $this->coveredlines,.$this->tota |
99e0 | 6c 6c 69 6e 65 73 29 3b 0a 20 20 20 20 20 20 20 20 7d 0a 20 20 20 20 20 20 20 20 24 71 75 65 72 | llines);.........}.........$quer |
9a00 | 79 20 3d 20 27 53 45 4c 45 43 54 20 43 4f 55 4e 54 28 6c 69 6e 65 6e 75 6d 62 65 72 29 2c 66 69 | y.=.'SELECT.COUNT(linenumber),fi |
9a20 | 6c 65 70 61 74 68 20 46 52 4f 4d 20 63 6f 76 65 72 61 67 65 5f 70 65 72 5f 66 69 6c 65 2c 20 66 | lepath.FROM.coverage_per_file,.f |
9a40 | 69 6c 65 73 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 57 48 45 52 45 20 66 69 6c 65 73 | iles.................WHERE.files |
9a60 | 2e 69 64 3d 63 6f 76 65 72 61 67 65 5f 70 65 72 5f 66 69 6c 65 2e 66 69 6c 65 73 5f 69 64 0a 20 | .id=coverage_per_file.files_id.. |
9a80 | 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 47 52 4f 55 50 20 42 59 20 66 69 6c 65 73 5f 69 64 | ...............GROUP.BY.files_id |
9aa0 | 27 3b 0a 20 20 20 20 20 20 20 20 24 72 65 73 75 6c 74 20 3d 20 24 74 68 69 73 2d 3e 64 62 2d 3e | ';.........$result.=.$this->db-> |
9ac0 | 71 75 65 72 79 28 24 71 75 65 72 79 29 3b 0a 20 20 20 20 20 20 20 20 69 66 20 28 21 24 72 65 73 | query($query);.........if.(!$res |
9ae0 | 75 6c 74 29 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 24 65 72 72 6f 72 20 3d 20 24 74 68 69 | ult).{.............$error.=.$thi |
9b00 | 73 2d 3e 64 62 2d 3e 6c 61 73 74 45 72 72 6f 72 4d 73 67 28 29 3b 0a 20 20 20 20 20 20 20 20 20 | s->db->lastErrorMsg();.......... |
9b20 | 20 20 20 74 68 72 6f 77 20 6e 65 77 20 45 78 63 65 70 74 69 6f 6e 28 27 43 61 6e 6e 6f 74 20 72 | ...throw.new.Exception('Cannot.r |
9b40 | 65 74 72 69 65 76 65 20 63 6f 76 65 72 61 67 65 20 66 6f 72 20 27 20 2e 20 24 70 61 74 68 2e 20 | etrieve.coverage.for.'...$path.. |
9b60 | 20 27 3a 20 27 20 2e 20 24 65 72 72 6f 72 29 3b 0a 20 20 20 20 20 20 20 20 7d 0a 20 20 20 20 20 | .':.'...$error);.........}...... |
9b80 | 20 20 20 77 68 69 6c 65 20 28 24 72 65 73 20 3d 20 24 72 65 73 75 6c 74 2d 3e 66 65 74 63 68 41 | ...while.($res.=.$result->fetchA |
9ba0 | 72 72 61 79 28 53 51 4c 49 54 45 33 5f 4e 55 4d 29 29 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 | rray(SQLITE3_NUM)).{............ |
9bc0 | 20 24 74 68 69 73 2d 3e 70 61 74 68 54 6f 74 61 6c 5b 24 72 65 73 5b 31 5d 5d 20 3d 20 24 72 65 | .$this->pathTotal[$res[1]].=.$re |
9be0 | 73 5b 30 5d 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 24 74 68 69 73 2d 3e 74 6f 74 61 6c 6c 69 | s[0];.............$this->totalli |
9c00 | 6e 65 73 20 2b 3d 20 24 72 65 73 5b 30 5d 3b 0a 20 20 20 20 20 20 20 20 7d 0a 0a 20 20 20 20 20 | nes.+=.$res[0];.........}....... |
9c20 | 20 20 20 24 71 75 65 72 79 20 3d 20 27 53 45 4c 45 43 54 20 43 4f 55 4e 54 28 6c 69 6e 65 6e 75 | ...$query.=.'SELECT.COUNT(linenu |
9c40 | 6d 62 65 72 29 2c 66 69 6c 65 70 61 74 68 20 46 52 4f 4d 20 63 6f 76 65 72 61 67 65 5f 70 65 72 | mber),filepath.FROM.coverage_per |
9c60 | 5f 66 69 6c 65 2c 20 66 69 6c 65 73 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 57 48 45 | _file,.files.................WHE |
9c80 | 52 45 20 63 6f 76 65 72 61 67 65 20 3e 20 30 20 41 4e 44 20 66 69 6c 65 73 2e 69 64 3d 63 6f 76 | RE.coverage.>.0.AND.files.id=cov |
9ca0 | 65 72 61 67 65 5f 70 65 72 5f 66 69 6c 65 2e 66 69 6c 65 73 5f 69 64 0a 20 20 20 20 20 20 20 20 | erage_per_file.files_id......... |
9cc0 | 20 20 20 20 20 20 20 20 47 52 4f 55 50 20 42 59 20 66 69 6c 65 73 5f 69 64 27 3b 0a 20 20 20 20 | ........GROUP.BY.files_id';..... |
9ce0 | 20 20 20 20 24 72 65 73 75 6c 74 20 3d 20 24 74 68 69 73 2d 3e 64 62 2d 3e 71 75 65 72 79 28 24 | ....$result.=.$this->db->query($ |
9d00 | 71 75 65 72 79 29 3b 0a 20 20 20 20 20 20 20 20 69 66 20 28 21 24 72 65 73 75 6c 74 29 20 7b 0a | query);.........if.(!$result).{. |
9d20 | 20 20 20 20 20 20 20 20 20 20 20 20 24 65 72 72 6f 72 20 3d 20 24 74 68 69 73 2d 3e 64 62 2d 3e | ............$error.=.$this->db-> |
9d40 | 6c 61 73 74 45 72 72 6f 72 4d 73 67 28 29 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 74 68 72 6f | lastErrorMsg();.............thro |
9d60 | 77 20 6e 65 77 20 45 78 63 65 70 74 69 6f 6e 28 27 43 61 6e 6e 6f 74 20 72 65 74 72 69 65 76 65 | w.new.Exception('Cannot.retrieve |
9d80 | 20 63 6f 76 65 72 61 67 65 20 66 6f 72 20 27 20 2e 20 24 70 61 74 68 2e 20 20 27 3a 20 27 20 2e | .coverage.for.'...$path...':.'.. |
9da0 | 20 24 65 72 72 6f 72 29 3b 0a 20 20 20 20 20 20 20 20 7d 0a 20 20 20 20 20 20 20 20 77 68 69 6c | .$error);.........}.........whil |
9dc0 | 65 20 28 24 72 65 73 20 3d 20 24 72 65 73 75 6c 74 2d 3e 66 65 74 63 68 41 72 72 61 79 28 53 51 | e.($res.=.$result->fetchArray(SQ |
9de0 | 4c 49 54 45 33 5f 4e 55 4d 29 29 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 24 74 68 69 73 2d | LITE3_NUM)).{.............$this- |
9e00 | 3e 70 61 74 68 43 6f 76 65 72 65 64 5b 24 72 65 73 5b 31 5d 5d 20 3d 20 24 72 65 73 5b 30 5d 3b | >pathCovered[$res[1]].=.$res[0]; |
9e20 | 0a 20 20 20 20 20 20 20 20 20 20 20 20 24 74 68 69 73 2d 3e 63 6f 76 65 72 65 64 6c 69 6e 65 73 | .............$this->coveredlines |
9e40 | 20 2b 3d 20 24 72 65 73 5b 30 5d 3b 0a 20 20 20 20 20 20 20 20 7d 0a 0a 20 20 20 20 20 20 20 20 | .+=.$res[0];.........}.......... |
9e60 | 72 65 74 75 72 6e 20 61 72 72 61 79 28 24 74 68 69 73 2d 3e 63 6f 76 65 72 65 64 6c 69 6e 65 73 | return.array($this->coveredlines |
9e80 | 2c 20 24 74 68 69 73 2d 3e 74 6f 74 61 6c 6c 69 6e 65 73 29 3b 0a 20 20 20 20 7d 0a 0a 20 20 20 | ,.$this->totallines);.....}..... |
9ea0 | 20 66 75 6e 63 74 69 6f 6e 20 72 65 74 72 69 65 76 65 50 61 74 68 43 6f 76 65 72 61 67 65 28 24 | .function.retrievePathCoverage($ |
9ec0 | 70 61 74 68 29 0a 20 20 20 20 7b 0a 20 20 20 20 20 20 20 20 69 66 20 28 21 24 74 68 69 73 2d 3e | path).....{.........if.(!$this-> |
9ee0 | 74 6f 74 61 6c 6c 69 6e 65 73 29 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 73 65 74 | totallines).{.............//.set |
9f00 | 20 75 70 20 74 68 65 20 63 61 63 68 65 0a 20 20 20 20 20 20 20 20 20 20 20 20 24 74 68 69 73 2d | .up.the.cache.............$this- |
9f20 | 3e 72 65 74 72 69 65 76 65 50 72 6f 6a 65 63 74 43 6f 76 65 72 61 67 65 28 29 3b 0a 20 20 20 20 | >retrieveProjectCoverage();..... |
9f40 | 20 20 20 20 7d 0a 20 20 20 20 20 20 20 20 69 66 20 28 21 69 73 73 65 74 28 24 74 68 69 73 2d 3e | ....}.........if.(!isset($this-> |
9f60 | 70 61 74 68 43 6f 76 65 72 65 64 5b 24 70 61 74 68 5d 29 29 20 7b 0a 20 20 20 20 20 20 20 20 20 | pathCovered[$path])).{.......... |
9f80 | 20 20 20 72 65 74 75 72 6e 20 61 72 72 61 79 28 30 2c 20 30 29 3b 0a 20 20 20 20 20 20 20 20 7d | ...return.array(0,.0);.........} |
9fa0 | 0a 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 61 72 72 61 79 28 24 74 68 69 73 2d 3e 70 61 74 | .........return.array($this->pat |
9fc0 | 68 43 6f 76 65 72 65 64 5b 24 70 61 74 68 5d 2c 20 24 74 68 69 73 2d 3e 70 61 74 68 54 6f 74 61 | hCovered[$path],.$this->pathTota |
9fe0 | 6c 5b 24 70 61 74 68 5d 29 3b 0a 20 20 20 20 7d 0a 0a 20 20 20 20 66 75 6e 63 74 69 6f 6e 20 72 | l[$path]);.....}......function.r |
a000 | 65 74 72 69 65 76 65 50 61 74 68 43 6f 76 65 72 61 67 65 42 79 54 65 73 74 28 24 70 61 74 68 2c | etrievePathCoverageByTest($path, |
a020 | 20 24 74 65 73 74 29 0a 20 20 20 20 7b 0a 20 20 20 20 20 20 20 20 24 69 64 20 3d 20 24 74 68 69 | .$test).....{.........$id.=.$thi |
a040 | 73 2d 3e 67 65 74 46 69 6c 65 49 64 28 24 70 61 74 68 29 3b 0a 20 20 20 20 20 20 20 20 24 74 65 | s->getFileId($path);.........$te |
a060 | 73 74 69 64 20 3d 20 24 74 68 69 73 2d 3e 67 65 74 54 65 73 74 49 64 28 24 74 65 73 74 29 3b 0a | stid.=.$this->getTestId($test);. |
a080 | 0a 20 20 20 20 20 20 20 20 24 71 75 65 72 79 20 3d 20 27 53 45 4c 45 43 54 20 43 4f 55 4e 54 28 | .........$query.=.'SELECT.COUNT( |
a0a0 | 6c 69 6e 65 6e 75 6d 62 65 72 29 0a 20 20 20 20 20 20 20 20 20 20 20 20 46 52 4f 4d 20 63 6f 76 | linenumber).............FROM.cov |
a0c0 | 65 72 61 67 65 0a 20 20 20 20 20 20 20 20 20 20 20 20 57 48 45 52 45 20 69 73 73 6f 75 72 63 65 | erage.............WHERE.issource |
a0e0 | 3d 31 20 41 4e 44 20 66 69 6c 65 73 5f 69 64 3d 27 20 2e 20 24 69 64 20 2e 20 27 20 41 4e 44 20 | =1.AND.files_id='...$id...'.AND. |
a100 | 74 65 73 74 73 5f 69 64 3d 27 20 2e 20 24 74 65 73 74 69 64 3b 0a 20 20 20 20 20 20 20 20 24 72 | tests_id='...$testid;.........$r |
a120 | 65 73 75 6c 74 20 3d 20 24 74 68 69 73 2d 3e 64 62 2d 3e 71 75 65 72 79 28 24 71 75 65 72 79 29 | esult.=.$this->db->query($query) |
a140 | 3b 0a 20 20 20 20 20 20 20 20 69 66 20 28 21 24 72 65 73 75 6c 74 29 20 7b 0a 20 20 20 20 20 20 | ;.........if.(!$result).{....... |
a160 | 20 20 20 20 20 20 24 65 72 72 6f 72 20 3d 20 24 74 68 69 73 2d 3e 64 62 2d 3e 6c 61 73 74 45 72 | ......$error.=.$this->db->lastEr |
a180 | 72 6f 72 4d 73 67 28 29 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 74 68 72 6f 77 20 6e 65 77 20 | rorMsg();.............throw.new. |
a1a0 | 45 78 63 65 70 74 69 6f 6e 28 27 43 61 6e 6e 6f 74 20 72 65 74 72 69 65 76 65 20 70 61 74 68 20 | Exception('Cannot.retrieve.path. |
a1c0 | 63 6f 76 65 72 61 67 65 20 66 6f 72 20 27 20 2e 20 24 70 61 74 68 20 2e 0a 20 20 20 20 20 20 20 | coverage.for.'...$path.......... |
a1e0 | 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 27 20 69 6e 20 74 65 | .........................'.in.te |
a200 | 73 74 20 27 20 2e 20 24 74 65 73 74 20 2e 20 27 3a 20 27 20 2e 20 24 65 72 72 6f 72 29 3b 0a 20 | st.'...$test...':.'...$error);.. |
a220 | 20 20 20 20 20 20 20 7d 0a 0a 20 20 20 20 20 20 20 20 24 72 65 74 20 3d 20 61 72 72 61 79 28 29 | .......}..........$ret.=.array() |
a240 | 3b 0a 20 20 20 20 20 20 20 20 77 68 69 6c 65 20 28 24 72 65 73 20 3d 20 24 72 65 73 75 6c 74 2d | ;.........while.($res.=.$result- |
a260 | 3e 66 65 74 63 68 41 72 72 61 79 28 53 51 4c 49 54 45 33 5f 4e 55 4d 29 29 20 7b 0a 20 20 20 20 | >fetchArray(SQLITE3_NUM)).{..... |
a280 | 20 20 20 20 20 20 20 20 24 74 6f 74 61 6c 20 3d 20 24 72 65 73 5b 30 5d 3b 0a 20 20 20 20 20 20 | ........$total.=.$res[0];....... |
a2a0 | 20 20 7d 0a 0a 20 20 20 20 20 20 20 20 24 71 75 65 72 79 20 3d 20 27 53 45 4c 45 43 54 20 43 4f | ..}..........$query.=.'SELECT.CO |
a2c0 | 55 4e 54 28 6c 69 6e 65 6e 75 6d 62 65 72 29 0a 20 20 20 20 20 20 20 20 20 20 20 20 46 52 4f 4d | UNT(linenumber).............FROM |
a2e0 | 20 63 6f 76 65 72 61 67 65 0a 20 20 20 20 20 20 20 20 20 20 20 20 57 48 45 52 45 20 69 73 73 6f | .coverage.............WHERE.isso |
a300 | 75 72 63 65 3d 31 20 41 4e 44 20 69 73 63 6f 76 65 72 65 64 20 41 4e 44 20 66 69 6c 65 73 5f 69 | urce=1.AND.iscovered.AND.files_i |
a320 | 64 3d 27 20 2e 20 24 69 64 2e 20 27 20 41 4e 44 20 74 65 73 74 73 5f 69 64 3d 27 20 2e 20 24 74 | d='...$id..'.AND.tests_id='...$t |
a340 | 65 73 74 69 64 3b 0a 20 20 20 20 20 20 20 20 24 72 65 73 75 6c 74 20 3d 20 24 74 68 69 73 2d 3e | estid;.........$result.=.$this-> |
a360 | 64 62 2d 3e 71 75 65 72 79 28 24 71 75 65 72 79 29 3b 0a 20 20 20 20 20 20 20 20 69 66 20 28 21 | db->query($query);.........if.(! |
a380 | 24 72 65 73 75 6c 74 29 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 24 65 72 72 6f 72 20 3d 20 | $result).{.............$error.=. |
a3a0 | 24 74 68 69 73 2d 3e 64 62 2d 3e 6c 61 73 74 45 72 72 6f 72 4d 73 67 28 29 3b 0a 20 20 20 20 20 | $this->db->lastErrorMsg();...... |
a3c0 | 20 20 20 20 20 20 20 74 68 72 6f 77 20 6e 65 77 20 45 78 63 65 70 74 69 6f 6e 28 27 43 61 6e 6e | .......throw.new.Exception('Cann |
a3e0 | 6f 74 20 72 65 74 72 69 65 76 65 20 70 61 74 68 20 63 6f 76 65 72 61 67 65 20 66 6f 72 20 27 20 | ot.retrieve.path.coverage.for.'. |
a400 | 2e 20 24 70 61 74 68 20 2e 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | ..$path......................... |
a420 | 20 20 20 20 20 20 20 20 20 20 27 20 69 6e 20 74 65 73 74 20 27 20 2e 20 24 74 65 73 74 20 2e 20 | ..........'.in.test.'...$test... |
a440 | 27 3a 20 27 20 2e 20 24 65 72 72 6f 72 29 3b 0a 20 20 20 20 20 20 20 20 7d 0a 0a 20 20 20 20 20 | ':.'...$error);.........}....... |
a460 | 20 20 20 24 72 65 74 20 3d 20 61 72 72 61 79 28 29 3b 0a 20 20 20 20 20 20 20 20 77 68 69 6c 65 | ...$ret.=.array();.........while |
a480 | 20 28 24 72 65 73 20 3d 20 24 72 65 73 75 6c 74 2d 3e 66 65 74 63 68 41 72 72 61 79 28 53 51 4c | .($res.=.$result->fetchArray(SQL |
a4a0 | 49 54 45 33 5f 4e 55 4d 29 29 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 24 63 6f 76 65 72 65 | ITE3_NUM)).{.............$covere |
a4c0 | 64 20 3d 20 24 72 65 73 5b 30 5d 3b 0a 20 20 20 20 20 20 20 20 7d 0a 20 20 20 20 20 20 20 20 72 | d.=.$res[0];.........}.........r |
a4e0 | 65 74 75 72 6e 20 61 72 72 61 79 28 24 63 6f 76 65 72 65 64 2c 20 24 74 6f 74 61 6c 29 3b 0a 20 | eturn.array($covered,.$total);.. |
a500 | 20 20 20 7d 0a 0a 20 20 20 20 66 75 6e 63 74 69 6f 6e 20 72 65 74 72 69 65 76 65 43 6f 76 65 72 | ...}......function.retrieveCover |
a520 | 61 67 65 42 79 54 65 73 74 28 24 70 61 74 68 2c 20 24 74 65 73 74 29 0a 20 20 20 20 7b 0a 20 20 | ageByTest($path,.$test).....{... |
a540 | 20 20 20 20 20 20 24 69 64 20 3d 20 24 74 68 69 73 2d 3e 67 65 74 46 69 6c 65 49 64 28 24 70 61 | ......$id.=.$this->getFileId($pa |
a560 | 74 68 29 3b 0a 20 20 20 20 20 20 20 20 24 74 65 73 74 69 64 20 3d 20 24 74 68 69 73 2d 3e 67 65 | th);.........$testid.=.$this->ge |
a580 | 74 54 65 73 74 49 64 28 24 74 65 73 74 29 3b 0a 0a 20 20 20 20 20 20 20 20 24 71 75 65 72 79 20 | tTestId($test);..........$query. |
a5a0 | 3d 20 27 53 45 4c 45 43 54 20 69 73 63 6f 76 65 72 65 64 20 61 73 20 63 6f 76 65 72 61 67 65 2c | =.'SELECT.iscovered.as.coverage, |
a5c0 | 20 6c 69 6e 65 6e 75 6d 62 65 72 20 46 52 4f 4d 20 63 6f 76 65 72 61 67 65 0a 20 20 20 20 20 20 | .linenumber.FROM.coverage....... |
a5e0 | 20 20 20 20 20 20 20 20 20 20 20 20 20 20 57 48 45 52 45 20 69 73 73 6f 75 72 63 65 3d 31 20 41 | ..............WHERE.issource=1.A |
a600 | 4e 44 20 66 69 6c 65 73 5f 69 64 3d 27 20 2e 20 24 69 64 20 2e 20 27 20 41 4e 44 20 74 65 73 74 | ND.files_id='...$id...'.AND.test |
a620 | 73 5f 69 64 3d 27 20 2e 20 24 74 65 73 74 69 64 3b 0a 20 20 20 20 20 20 20 20 24 72 65 73 75 6c | s_id='...$testid;.........$resul |
a640 | 74 20 3d 20 24 74 68 69 73 2d 3e 64 62 2d 3e 71 75 65 72 79 28 24 71 75 65 72 79 29 3b 0a 20 20 | t.=.$this->db->query($query);... |
a660 | 20 20 20 20 20 20 69 66 20 28 21 24 72 65 73 75 6c 74 29 20 7b 0a 20 20 20 20 20 20 20 20 20 20 | ......if.(!$result).{........... |
a680 | 20 20 24 65 72 72 6f 72 20 3d 20 24 74 68 69 73 2d 3e 64 62 2d 3e 6c 61 73 74 45 72 72 6f 72 4d | ..$error.=.$this->db->lastErrorM |
a6a0 | 73 67 28 29 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 74 68 72 6f 77 20 6e 65 77 20 45 78 63 65 | sg();.............throw.new.Exce |
a6c0 | 70 74 69 6f 6e 28 27 43 61 6e 6e 6f 74 20 72 65 74 72 69 65 76 65 20 74 65 73 74 20 27 20 2e 20 | ption('Cannot.retrieve.test.'... |
a6e0 | 24 74 65 73 74 20 2e 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | $test........................... |
a700 | 20 20 20 20 20 20 20 20 27 20 63 6f 76 65 72 61 67 65 20 66 6f 72 20 27 20 2e 20 24 70 61 74 68 | ........'.coverage.for.'...$path |
a720 | 2e 20 20 27 3a 20 27 20 2e 20 24 65 72 72 6f 72 29 3b 0a 20 20 20 20 20 20 20 20 7d 0a 0a 20 20 | ...':.'...$error);.........}.... |
a740 | 20 20 20 20 20 20 24 72 65 74 20 3d 20 61 72 72 61 79 28 29 3b 0a 20 20 20 20 20 20 20 20 77 68 | ......$ret.=.array();.........wh |
a760 | 69 6c 65 20 28 24 72 65 73 20 3d 20 24 72 65 73 75 6c 74 2d 3e 66 65 74 63 68 41 72 72 61 79 28 | ile.($res.=.$result->fetchArray( |
a780 | 53 51 4c 49 54 45 33 5f 41 53 53 4f 43 29 29 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 24 72 | SQLITE3_ASSOC)).{.............$r |
a7a0 | 65 74 5b 24 72 65 73 5b 27 6c 69 6e 65 6e 75 6d 62 65 72 27 5d 5d 20 3d 20 24 72 65 73 5b 27 63 | et[$res['linenumber']].=.$res['c |
a7c0 | 6f 76 65 72 61 67 65 27 5d 3b 0a 20 20 20 20 20 20 20 20 7d 0a 20 20 20 20 20 20 20 20 72 65 74 | overage'];.........}.........ret |
a7e0 | 75 72 6e 20 24 72 65 74 3b 0a 20 20 20 20 7d 0a 0a 20 20 20 20 66 75 6e 63 74 69 6f 6e 20 67 65 | urn.$ret;.....}......function.ge |
a800 | 74 46 69 6c 65 49 64 28 24 70 61 74 68 29 0a 20 20 20 20 7b 0a 20 20 20 20 20 20 20 20 24 71 75 | tFileId($path).....{.........$qu |
a820 | 65 72 79 20 3d 20 27 53 45 4c 45 43 54 20 69 64 20 46 52 4f 4d 20 66 69 6c 65 73 20 57 48 45 52 | ery.=.'SELECT.id.FROM.files.WHER |
a840 | 45 20 66 69 6c 65 70 61 74 68 3d 3a 66 69 6c 65 70 61 74 68 27 3b 0a 20 20 20 20 20 20 20 20 24 | E.filepath=:filepath';.........$ |
a860 | 73 74 6d 74 20 3d 20 24 74 68 69 73 2d 3e 64 62 2d 3e 70 72 65 70 61 72 65 28 24 71 75 65 72 79 | stmt.=.$this->db->prepare($query |
a880 | 29 3b 0a 20 20 20 20 20 20 20 20 24 73 74 6d 74 2d 3e 62 69 6e 64 56 61 6c 75 65 28 27 3a 66 69 | );.........$stmt->bindValue(':fi |
a8a0 | 6c 65 70 61 74 68 27 2c 20 24 70 61 74 68 29 3b 0a 20 20 20 20 20 20 20 20 69 66 20 28 21 28 24 | lepath',.$path);.........if.(!($ |
a8c0 | 72 65 73 75 6c 74 20 3d 20 24 73 74 6d 74 2d 3e 65 78 65 63 75 74 65 28 29 29 29 20 7b 0a 20 20 | result.=.$stmt->execute())).{... |
a8e0 | 20 20 20 20 20 20 20 20 20 20 74 68 72 6f 77 20 6e 65 77 20 45 78 63 65 70 74 69 6f 6e 28 27 55 | ..........throw.new.Exception('U |
a900 | 6e 61 62 6c 65 20 74 6f 20 72 65 74 72 69 65 76 65 20 66 69 6c 65 20 27 20 2e 20 24 70 61 74 68 | nable.to.retrieve.file.'...$path |
a920 | 20 2e 20 27 20 69 64 20 66 72 6f 6d 20 64 61 74 61 62 61 73 65 27 29 3b 0a 20 20 20 20 20 20 20 | ...'.id.from.database');........ |
a940 | 20 7d 0a 20 20 20 20 20 20 20 20 77 68 69 6c 65 20 28 24 69 64 20 3d 20 24 72 65 73 75 6c 74 2d | .}.........while.($id.=.$result- |
a960 | 3e 66 65 74 63 68 41 72 72 61 79 28 53 51 4c 49 54 45 33 5f 4e 55 4d 29 29 20 7b 0a 20 20 20 20 | >fetchArray(SQLITE3_NUM)).{..... |
a980 | 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 24 69 64 5b 30 5d 3b 0a 20 20 20 20 20 20 20 20 7d | ........return.$id[0];.........} |
a9a0 | 0a 20 20 20 20 20 20 20 20 74 68 72 6f 77 20 6e 65 77 20 45 78 63 65 70 74 69 6f 6e 28 27 55 6e | .........throw.new.Exception('Un |
a9c0 | 61 62 6c 65 20 74 6f 20 72 65 74 72 69 65 76 65 20 66 69 6c 65 20 27 20 2e 20 24 70 61 74 68 20 | able.to.retrieve.file.'...$path. |
a9e0 | 2e 20 27 20 69 64 20 66 72 6f 6d 20 64 61 74 61 62 61 73 65 27 29 3b 0a 20 20 20 20 7d 0a 0a 20 | ..'.id.from.database');.....}... |
aa00 | 20 20 20 66 75 6e 63 74 69 6f 6e 20 67 65 74 54 65 73 74 49 64 28 24 70 61 74 68 29 0a 20 20 20 | ...function.getTestId($path).... |
aa20 | 20 7b 0a 20 20 20 20 20 20 20 20 24 71 75 65 72 79 20 3d 20 27 53 45 4c 45 43 54 20 69 64 20 46 | .{.........$query.=.'SELECT.id.F |
aa40 | 52 4f 4d 20 74 65 73 74 73 20 57 48 45 52 45 20 74 65 73 74 70 61 74 68 3d 3a 66 69 6c 65 70 61 | ROM.tests.WHERE.testpath=:filepa |
aa60 | 74 68 27 3b 0a 20 20 20 20 20 20 20 20 24 73 74 6d 74 20 3d 20 24 74 68 69 73 2d 3e 64 62 2d 3e | th';.........$stmt.=.$this->db-> |
aa80 | 70 72 65 70 61 72 65 28 24 71 75 65 72 79 29 3b 0a 20 20 20 20 20 20 20 20 24 73 74 6d 74 2d 3e | prepare($query);.........$stmt-> |
aaa0 | 62 69 6e 64 56 61 6c 75 65 28 27 3a 66 69 6c 65 70 61 74 68 27 2c 20 24 70 61 74 68 29 3b 0a 20 | bindValue(':filepath',.$path);.. |
aac0 | 20 20 20 20 20 20 20 69 66 20 28 21 28 24 72 65 73 75 6c 74 20 3d 20 24 73 74 6d 74 2d 3e 65 78 | .......if.(!($result.=.$stmt->ex |
aae0 | 65 63 75 74 65 28 29 29 29 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 74 68 72 6f 77 20 6e 65 | ecute())).{.............throw.ne |
ab00 | 77 20 45 78 63 65 70 74 69 6f 6e 28 27 55 6e 61 62 6c 65 20 74 6f 20 72 65 74 72 69 65 76 65 20 | w.Exception('Unable.to.retrieve. |
ab20 | 74 65 73 74 20 66 69 6c 65 20 27 20 2e 20 24 70 61 74 68 20 2e 20 27 20 69 64 20 66 72 6f 6d 20 | test.file.'...$path...'.id.from. |
ab40 | 64 61 74 61 62 61 73 65 27 29 3b 0a 20 20 20 20 20 20 20 20 7d 0a 20 20 20 20 20 20 20 20 77 68 | database');.........}.........wh |
ab60 | 69 6c 65 20 28 24 69 64 20 3d 20 24 72 65 73 75 6c 74 2d 3e 66 65 74 63 68 41 72 72 61 79 28 53 | ile.($id.=.$result->fetchArray(S |
ab80 | 51 4c 49 54 45 33 5f 4e 55 4d 29 29 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 | QLITE3_NUM)).{.............retur |
aba0 | 6e 20 24 69 64 5b 30 5d 3b 0a 20 20 20 20 20 20 20 20 7d 0a 20 20 20 20 20 20 20 20 74 68 72 6f | n.$id[0];.........}.........thro |
abc0 | 77 20 6e 65 77 20 45 78 63 65 70 74 69 6f 6e 28 27 55 6e 61 62 6c 65 20 74 6f 20 72 65 74 72 69 | w.new.Exception('Unable.to.retri |
abe0 | 65 76 65 20 74 65 73 74 20 66 69 6c 65 20 27 20 2e 20 24 70 61 74 68 20 2e 20 27 20 69 64 20 66 | eve.test.file.'...$path...'.id.f |
ac00 | 72 6f 6d 20 64 61 74 61 62 61 73 65 27 29 3b 0a 20 20 20 20 7d 0a 0a 20 20 20 20 66 75 6e 63 74 | rom.database');.....}......funct |
ac20 | 69 6f 6e 20 72 65 6d 6f 76 65 4f 6c 64 54 65 73 74 28 24 74 65 73 74 70 61 74 68 2c 20 24 78 64 | ion.removeOldTest($testpath,.$xd |
ac40 | 65 62 75 67 70 61 74 68 29 0a 20 20 20 20 7b 0a 20 20 20 20 20 20 20 20 74 72 79 20 7b 0a 20 20 | ebugpath).....{.........try.{... |
ac60 | 20 20 20 20 20 20 20 20 20 20 24 69 64 20 3d 20 24 74 68 69 73 2d 3e 67 65 74 54 65 73 74 49 64 | ..........$id.=.$this->getTestId |
ac80 | 28 24 74 65 73 74 70 61 74 68 29 3b 0a 20 20 20 20 20 20 20 20 7d 20 63 61 74 63 68 20 28 5c 45 | ($testpath);.........}.catch.(\E |
aca0 | 78 63 65 70 74 69 6f 6e 20 24 65 29 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 67 65 | xception.$e).{.............//.ge |
acc0 | 74 20 61 20 75 6e 69 71 75 65 20 49 44 0a 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e | t.a.unique.ID.............return |
ace0 | 20 24 74 68 69 73 2d 3e 64 62 2d 3e 71 75 65 72 79 53 69 6e 67 6c 65 28 27 53 45 4c 45 43 54 20 | .$this->db->querySingle('SELECT. |
ad00 | 43 4f 55 4e 54 28 69 64 29 20 66 72 6f 6d 20 74 65 73 74 73 27 29 2b 31 3b 0a 20 20 20 20 20 20 | COUNT(id).from.tests')+1;....... |
ad20 | 20 20 7d 0a 20 20 20 20 20 20 20 20 24 74 68 69 73 2d 3e 64 62 2d 3e 65 78 65 63 28 27 44 45 4c | ..}.........$this->db->exec('DEL |
ad40 | 45 54 45 20 46 52 4f 4d 20 74 65 73 74 73 20 57 48 45 52 45 20 69 64 3d 27 20 2e 20 24 69 64 29 | ETE.FROM.tests.WHERE.id='...$id) |
ad60 | 3b 0a 20 20 20 20 20 20 20 20 24 74 68 69 73 2d 3e 64 62 2d 3e 65 78 65 63 28 27 44 45 4c 45 54 | ;.........$this->db->exec('DELET |
ad80 | 45 20 46 52 4f 4d 20 63 6f 76 65 72 61 67 65 20 57 48 45 52 45 20 74 65 73 74 73 5f 69 64 3d 27 | E.FROM.coverage.WHERE.tests_id=' |
ada0 | 20 2e 20 24 69 64 29 3b 0a 20 20 20 20 20 20 20 20 24 74 68 69 73 2d 3e 64 62 2d 3e 65 78 65 63 | ...$id);.........$this->db->exec |
adc0 | 28 27 44 45 4c 45 54 45 20 46 52 4f 4d 20 78 64 65 62 75 67 73 20 57 48 45 52 45 20 78 64 65 62 | ('DELETE.FROM.xdebugs.WHERE.xdeb |
ade0 | 75 67 70 61 74 68 3d 22 27 20 2e 20 24 74 68 69 73 2d 3e 64 62 2d 3e 65 73 63 61 70 65 53 74 72 | ugpath="'...$this->db->escapeStr |
ae00 | 69 6e 67 28 24 78 64 65 62 75 67 70 61 74 68 29 20 2e 20 27 22 27 29 3b 0a 20 20 20 20 20 20 20 | ing($xdebugpath)...'"');........ |
ae20 | 20 72 65 74 75 72 6e 20 24 69 64 3b 0a 20 20 20 20 7d 0a 0a 20 20 20 20 66 75 6e 63 74 69 6f 6e | .return.$id;.....}......function |
ae40 | 20 61 64 64 54 65 73 74 28 24 74 65 73 74 70 61 74 68 29 0a 20 20 20 20 7b 0a 20 20 20 20 20 20 | .addTest($testpath).....{....... |
ae60 | 20 20 24 69 64 20 3d 20 24 74 68 69 73 2d 3e 72 65 6d 6f 76 65 4f 6c 64 54 65 73 74 28 24 74 65 | ..$id.=.$this->removeOldTest($te |
ae80 | 73 74 70 61 74 68 2c 20 73 74 72 5f 72 65 70 6c 61 63 65 28 27 2e 70 68 70 74 27 2c 20 27 2e 78 | stpath,.str_replace('.phpt',.'.x |
aea0 | 64 65 62 75 67 27 2c 20 24 74 65 73 74 70 61 74 68 29 29 3b 0a 20 20 20 20 20 20 20 20 24 71 75 | debug',.$testpath));.........$qu |
aec0 | 65 72 79 20 3d 20 27 49 4e 53 45 52 54 20 49 4e 54 4f 20 74 65 73 74 73 0a 20 20 20 20 20 20 20 | ery.=.'INSERT.INTO.tests........ |
aee0 | 20 20 20 20 20 28 74 65 73 74 70 61 74 68 2c 20 74 65 73 74 70 61 74 68 6d 64 35 29 0a 20 20 20 | .....(testpath,.testpathmd5).... |
af00 | 20 20 20 20 20 20 20 20 20 56 41 4c 55 45 53 28 3a 74 65 73 74 70 61 74 68 2c 20 3a 6d 64 35 29 | .........VALUES(:testpath,.:md5) |
af20 | 27 3b 0a 20 20 20 20 20 20 20 20 24 73 74 6d 74 20 3d 20 24 74 68 69 73 2d 3e 64 62 2d 3e 70 72 | ';.........$stmt.=.$this->db->pr |
af40 | 65 70 61 72 65 28 24 71 75 65 72 79 29 3b 0a 20 20 20 20 20 20 20 20 24 73 74 6d 74 2d 3e 62 69 | epare($query);.........$stmt->bi |
af60 | 6e 64 56 61 6c 75 65 28 27 3a 74 65 73 74 70 61 74 68 27 2c 20 24 74 65 73 74 70 61 74 68 29 3b | ndValue(':testpath',.$testpath); |
af80 | 0a 20 20 20 20 20 20 20 20 24 6d 64 35 20 3d 20 6d 64 35 5f 66 69 6c 65 28 24 74 65 73 74 70 61 | .........$md5.=.md5_file($testpa |
afa0 | 74 68 29 3b 0a 20 20 20 20 20 20 20 20 24 73 74 6d 74 2d 3e 62 69 6e 64 56 61 6c 75 65 28 27 3a | th);.........$stmt->bindValue(': |
afc0 | 6d 64 35 27 2c 20 24 6d 64 35 29 3b 0a 20 20 20 20 20 20 20 20 24 73 74 6d 74 2d 3e 65 78 65 63 | md5',.$md5);.........$stmt->exec |
afe0 | 75 74 65 28 29 3b 0a 20 20 20 20 20 20 20 20 24 69 64 20 3d 20 24 74 68 69 73 2d 3e 64 62 2d 3e | ute();.........$id.=.$this->db-> |
b000 | 6c 61 73 74 49 6e 73 65 72 74 52 6f 77 49 44 28 29 3b 0a 0a 20 20 20 20 20 20 20 20 24 71 75 65 | lastInsertRowID();..........$que |
b020 | 72 79 20 3d 20 27 49 4e 53 45 52 54 20 49 4e 54 4f 20 78 64 65 62 75 67 73 0a 20 20 20 20 20 20 | ry.=.'INSERT.INTO.xdebugs....... |
b040 | 20 20 20 20 20 20 28 78 64 65 62 75 67 70 61 74 68 2c 20 78 64 65 62 75 67 70 61 74 68 6d 64 35 | ......(xdebugpath,.xdebugpathmd5 |
b060 | 29 0a 20 20 20 20 20 20 20 20 20 20 20 20 56 41 4c 55 45 53 28 3a 74 65 73 74 70 61 74 68 2c 20 | ).............VALUES(:testpath,. |
b080 | 3a 6d 64 35 29 27 3b 0a 20 20 20 20 20 20 20 20 24 73 74 6d 74 20 3d 20 24 74 68 69 73 2d 3e 64 | :md5)';.........$stmt.=.$this->d |
b0a0 | 62 2d 3e 70 72 65 70 61 72 65 28 24 71 75 65 72 79 29 3b 0a 20 20 20 20 20 20 20 20 24 73 74 6d | b->prepare($query);.........$stm |
b0c0 | 74 2d 3e 62 69 6e 64 56 61 6c 75 65 28 27 3a 74 65 73 74 70 61 74 68 27 2c 20 73 74 72 5f 72 65 | t->bindValue(':testpath',.str_re |
b0e0 | 70 6c 61 63 65 28 27 2e 70 68 70 74 27 2c 20 27 2e 78 64 65 62 75 67 27 2c 20 24 74 65 73 74 70 | place('.phpt',.'.xdebug',.$testp |
b100 | 61 74 68 29 29 3b 0a 20 20 20 20 20 20 20 20 24 6d 64 35 20 3d 20 6d 64 35 5f 66 69 6c 65 28 73 | ath));.........$md5.=.md5_file(s |
b120 | 74 72 5f 72 65 70 6c 61 63 65 28 27 2e 70 68 70 74 27 2c 20 27 2e 78 64 65 62 75 67 27 2c 20 24 | tr_replace('.phpt',.'.xdebug',.$ |
b140 | 74 65 73 74 70 61 74 68 29 29 3b 0a 20 20 20 20 20 20 20 20 24 73 74 6d 74 2d 3e 62 69 6e 64 56 | testpath));.........$stmt->bindV |
b160 | 61 6c 75 65 28 27 3a 6d 64 35 27 2c 20 24 6d 64 35 29 3b 0a 20 20 20 20 20 20 20 20 24 73 74 6d | alue(':md5',.$md5);.........$stm |
b180 | 74 2d 3e 65 78 65 63 75 74 65 28 29 3b 0a 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 24 69 64 | t->execute();.........return.$id |
b1a0 | 3b 0a 20 20 20 20 7d 0a 0a 20 20 20 20 66 75 6e 63 74 69 6f 6e 20 75 6e 43 68 61 6e 67 65 64 58 | ;.....}......function.unChangedX |
b1c0 | 64 65 62 75 67 28 24 70 61 74 68 29 0a 20 20 20 20 7b 0a 20 20 20 20 20 20 20 20 24 71 75 65 72 | debug($path).....{.........$quer |
b1e0 | 79 20 3d 20 27 53 45 4c 45 43 54 20 78 64 65 62 75 67 70 61 74 68 6d 64 35 20 46 52 4f 4d 20 78 | y.=.'SELECT.xdebugpathmd5.FROM.x |
b200 | 64 65 62 75 67 73 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 57 48 45 52 45 | debugs.....................WHERE |
b220 | 20 78 64 65 62 75 67 70 61 74 68 3d 3a 70 61 74 68 27 3b 0a 20 20 20 20 20 20 20 20 24 73 74 6d | .xdebugpath=:path';.........$stm |
b240 | 74 20 3d 20 24 74 68 69 73 2d 3e 64 62 2d 3e 70 72 65 70 61 72 65 28 24 71 75 65 72 79 29 3b 0a | t.=.$this->db->prepare($query);. |
b260 | 20 20 20 20 20 20 20 20 24 73 74 6d 74 2d 3e 62 69 6e 64 56 61 6c 75 65 28 27 3a 70 61 74 68 27 | ........$stmt->bindValue(':path' |
b280 | 2c 20 24 70 61 74 68 29 3b 0a 20 20 20 20 20 20 20 20 24 72 65 73 75 6c 74 20 3d 20 24 73 74 6d | ,.$path);.........$result.=.$stm |
b2a0 | 74 2d 3e 65 78 65 63 75 74 65 28 29 3b 0a 20 20 20 20 20 20 20 20 69 66 20 28 21 24 72 65 73 75 | t->execute();.........if.(!$resu |
b2c0 | 6c 74 29 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 66 61 6c 73 65 3b 0a | lt).{.............return.false;. |
b2e0 | 20 20 20 20 20 20 20 20 7d 0a 20 20 20 20 20 20 20 20 24 6d 64 35 20 3d 20 30 3b 0a 20 20 20 20 | ........}.........$md5.=.0;..... |
b300 | 20 20 20 20 77 68 69 6c 65 20 28 24 72 65 73 20 3d 20 24 72 65 73 75 6c 74 2d 3e 66 65 74 63 68 | ....while.($res.=.$result->fetch |
b320 | 41 72 72 61 79 28 53 51 4c 49 54 45 33 5f 4e 55 4d 29 29 20 7b 0a 20 20 20 20 20 20 20 20 20 20 | Array(SQLITE3_NUM)).{........... |
b340 | 20 20 24 6d 64 35 20 3d 20 24 72 65 73 5b 30 5d 3b 0a 20 20 20 20 20 20 20 20 7d 0a 20 20 20 20 | ..$md5.=.$res[0];.........}..... |
b360 | 20 20 20 20 69 66 20 28 21 24 6d 64 35 29 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 | ....if.(!$md5).{.............ret |
b380 | 75 72 6e 20 66 61 6c 73 65 3b 0a 20 20 20 20 20 20 20 20 7d 0a 20 20 20 20 20 20 20 20 69 66 20 | urn.false;.........}.........if. |
b3a0 | 28 24 6d 64 35 20 3d 3d 20 6d 64 35 5f 66 69 6c 65 28 24 70 61 74 68 29 29 20 7b 0a 20 20 20 20 | ($md5.==.md5_file($path)).{..... |
b3c0 | 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 74 72 75 65 3b 0a 20 20 20 20 20 20 20 20 7d 0a 20 | ........return.true;.........}.. |
b3e0 | 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 66 61 6c 73 65 3b 0a 20 20 20 20 7d 0a 0a 20 20 20 20 | .......return.false;.....}...... |
b400 | 66 75 6e 63 74 69 6f 6e 20 61 64 64 46 69 6c 65 28 24 66 69 6c 65 70 61 74 68 2c 20 24 69 73 73 | function.addFile($filepath,.$iss |
b420 | 6f 75 72 63 65 20 3d 20 30 29 0a 20 20 20 20 7b 0a 20 20 20 20 20 20 20 20 24 71 75 65 72 79 20 | ource.=.0).....{.........$query. |
b440 | 3d 20 27 53 45 4c 45 43 54 20 69 64 20 46 52 4f 4d 20 66 69 6c 65 73 20 57 48 45 52 45 20 66 69 | =.'SELECT.id.FROM.files.WHERE.fi |
b460 | 6c 65 70 61 74 68 3d 3a 66 69 6c 65 70 61 74 68 27 3b 0a 20 20 20 20 20 20 20 20 24 73 74 6d 74 | lepath=:filepath';.........$stmt |
b480 | 20 3d 20 24 74 68 69 73 2d 3e 64 62 2d 3e 70 72 65 70 61 72 65 28 24 71 75 65 72 79 29 3b 0a 20 | .=.$this->db->prepare($query);.. |
b4a0 | 20 20 20 20 20 20 20 24 73 74 6d 74 2d 3e 62 69 6e 64 50 61 72 61 6d 28 27 3a 66 69 6c 65 70 61 | .......$stmt->bindParam(':filepa |
b4c0 | 74 68 27 2c 20 24 66 69 6c 65 70 61 74 68 29 3b 0a 20 20 20 20 20 20 20 20 69 66 20 28 21 28 24 | th',.$filepath);.........if.(!($ |
b4e0 | 72 65 73 75 6c 74 20 3d 20 24 73 74 6d 74 2d 3e 65 78 65 63 75 74 65 28 29 29 29 20 7b 0a 20 20 | result.=.$stmt->execute())).{... |
b500 | 20 20 20 20 20 20 20 20 20 20 74 68 72 6f 77 20 6e 65 77 20 45 78 63 65 70 74 69 6f 6e 28 27 55 | ..........throw.new.Exception('U |
b520 | 6e 61 62 6c 65 20 74 6f 20 61 64 64 20 66 69 6c 65 20 27 20 2e 20 24 66 69 6c 65 70 61 74 68 20 | nable.to.add.file.'...$filepath. |
b540 | 2e 20 27 20 74 6f 20 64 61 74 61 62 61 73 65 27 29 3b 0a 20 20 20 20 20 20 20 20 7d 0a 20 20 20 | ..'.to.database');.........}.... |
b560 | 20 20 20 20 20 77 68 69 6c 65 20 28 24 69 64 20 3d 20 24 72 65 73 75 6c 74 2d 3e 66 65 74 63 68 | .....while.($id.=.$result->fetch |
b580 | 41 72 72 61 79 28 53 51 4c 49 54 45 33 5f 4e 55 4d 29 29 20 7b 0a 20 20 20 20 20 20 20 20 20 20 | Array(SQLITE3_NUM)).{........... |
b5a0 | 20 20 24 71 75 65 72 79 20 3d 20 27 55 50 44 41 54 45 20 66 69 6c 65 73 20 53 45 54 20 66 69 6c | ..$query.=.'UPDATE.files.SET.fil |
b5c0 | 65 70 61 74 68 6d 64 35 3d 3a 6d 64 35 20 57 48 45 52 45 20 66 69 6c 65 70 61 74 68 3d 3a 66 69 | epathmd5=:md5.WHERE.filepath=:fi |
b5e0 | 6c 65 70 61 74 68 27 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 24 73 74 6d 74 20 3d 20 24 74 68 | lepath';.............$stmt.=.$th |
b600 | 69 73 2d 3e 64 62 2d 3e 70 72 65 70 61 72 65 28 24 71 75 65 72 79 29 3b 0a 20 20 20 20 20 20 20 | is->db->prepare($query);........ |
b620 | 20 20 20 20 20 24 73 74 6d 74 2d 3e 62 69 6e 64 50 61 72 61 6d 28 27 3a 66 69 6c 65 70 61 74 68 | .....$stmt->bindParam(':filepath |
b640 | 27 2c 20 24 66 69 6c 65 70 61 74 68 29 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 24 6d 64 35 20 | ',.$filepath);.............$md5. |
b660 | 3d 20 6d 64 35 5f 66 69 6c 65 28 24 66 69 6c 65 70 61 74 68 29 3b 0a 20 20 20 20 20 20 20 20 20 | =.md5_file($filepath);.......... |
b680 | 20 20 20 24 73 74 6d 74 2d 3e 62 69 6e 64 50 61 72 61 6d 28 27 3a 6d 64 35 27 2c 20 24 6d 64 35 | ...$stmt->bindParam(':md5',.$md5 |
b6a0 | 29 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 21 24 73 74 6d 74 2d 3e 65 78 65 63 75 | );.............if.(!$stmt->execu |
b6c0 | 74 65 28 29 29 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 74 68 72 6f 77 20 6e 65 | te()).{.................throw.ne |
b6e0 | 77 20 45 78 63 65 70 74 69 6f 6e 28 27 55 6e 61 62 6c 65 20 74 6f 20 75 70 64 61 74 65 20 66 69 | w.Exception('Unable.to.update.fi |
b700 | 6c 65 20 27 20 2e 20 24 66 69 6c 65 70 61 74 68 20 2e 20 27 20 6d 64 35 20 69 6e 20 64 61 74 61 | le.'...$filepath...'.md5.in.data |
b720 | 62 61 73 65 27 29 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0a 20 20 20 20 20 20 20 20 20 20 | base');.............}........... |
b740 | 20 20 72 65 74 75 72 6e 20 24 69 64 5b 30 5d 3b 0a 20 20 20 20 20 20 20 20 7d 0a 20 20 20 20 20 | ..return.$id[0];.........}...... |
b760 | 20 20 20 24 73 74 6d 74 2d 3e 63 6c 65 61 72 28 29 3b 0a 20 20 20 20 20 20 20 20 24 71 75 65 72 | ...$stmt->clear();.........$quer |
b780 | 79 20 3d 20 27 49 4e 53 45 52 54 20 49 4e 54 4f 20 66 69 6c 65 73 0a 20 20 20 20 20 20 20 20 20 | y.=.'INSERT.INTO.files.......... |
b7a0 | 20 20 20 28 66 69 6c 65 70 61 74 68 2c 20 66 69 6c 65 70 61 74 68 6d 64 35 2c 20 69 73 73 6f 75 | ...(filepath,.filepathmd5,.issou |
b7c0 | 72 63 65 29 0a 20 20 20 20 20 20 20 20 20 20 20 20 56 41 4c 55 45 53 28 3a 74 65 73 74 70 61 74 | rce).............VALUES(:testpat |
b7e0 | 68 2c 20 3a 6d 64 35 2c 20 3a 69 73 73 6f 75 72 63 65 29 27 3b 0a 20 20 20 20 20 20 20 20 24 73 | h,.:md5,.:issource)';.........$s |
b800 | 74 6d 74 20 3d 20 24 74 68 69 73 2d 3e 64 62 2d 3e 70 72 65 70 61 72 65 28 24 71 75 65 72 79 29 | tmt.=.$this->db->prepare($query) |
b820 | 3b 0a 20 20 20 20 20 20 20 20 24 73 74 6d 74 2d 3e 62 69 6e 64 56 61 6c 75 65 28 27 3a 74 65 73 | ;.........$stmt->bindValue(':tes |
b840 | 74 70 61 74 68 27 2c 20 24 66 69 6c 65 70 61 74 68 29 3b 0a 20 20 20 20 20 20 20 20 24 6d 64 35 | tpath',.$filepath);.........$md5 |
b860 | 20 3d 20 6d 64 35 5f 66 69 6c 65 28 24 66 69 6c 65 70 61 74 68 29 3b 0a 20 20 20 20 20 20 20 20 | .=.md5_file($filepath);......... |
b880 | 24 73 74 6d 74 2d 3e 62 69 6e 64 56 61 6c 75 65 28 27 3a 6d 64 35 27 2c 20 24 6d 64 35 29 3b 0a | $stmt->bindValue(':md5',.$md5);. |
b8a0 | 20 20 20 20 20 20 20 20 24 73 74 6d 74 2d 3e 62 69 6e 64 56 61 6c 75 65 28 27 3a 69 73 73 6f 75 | ........$stmt->bindValue(':issou |
b8c0 | 72 63 65 27 2c 20 24 69 73 73 6f 75 72 63 65 29 3b 0a 20 20 20 20 20 20 20 20 69 66 20 28 21 24 | rce',.$issource);.........if.(!$ |
b8e0 | 73 74 6d 74 2d 3e 65 78 65 63 75 74 65 28 29 29 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 74 | stmt->execute()).{.............t |
b900 | 68 72 6f 77 20 6e 65 77 20 45 78 63 65 70 74 69 6f 6e 28 27 55 6e 61 62 6c 65 20 74 6f 20 61 64 | hrow.new.Exception('Unable.to.ad |
b920 | 64 20 66 69 6c 65 20 27 20 2e 20 24 66 69 6c 65 70 61 74 68 20 2e 20 27 20 74 6f 20 64 61 74 61 | d.file.'...$filepath...'.to.data |
b940 | 62 61 73 65 27 29 3b 0a 20 20 20 20 20 20 20 20 7d 0a 20 20 20 20 20 20 20 20 72 65 74 75 72 6e | base');.........}.........return |
b960 | 20 24 74 68 69 73 2d 3e 64 62 2d 3e 6c 61 73 74 49 6e 73 65 72 74 52 6f 77 49 44 28 29 3b 0a 20 | .$this->db->lastInsertRowID();.. |
b980 | 20 20 20 7d 0a 0a 20 20 20 20 66 75 6e 63 74 69 6f 6e 20 67 65 74 54 6f 74 61 6c 43 6f 76 65 72 | ...}......function.getTotalCover |
b9a0 | 61 67 65 28 24 66 69 6c 65 2c 20 24 6c 69 6e 65 6e 75 6d 62 65 72 29 0a 20 20 20 20 7b 0a 20 20 | age($file,.$linenumber).....{... |
b9c0 | 20 20 20 20 20 20 24 71 75 65 72 79 20 3d 20 27 53 45 4c 45 43 54 20 63 6f 76 65 72 61 67 65 63 | ......$query.=.'SELECT.coveragec |
b9e0 | 6f 75 6e 74 20 46 52 4f 4d 20 63 6f 76 65 72 61 67 65 5f 70 65 72 5f 66 69 6c 65 0a 20 20 20 20 | ount.FROM.coverage_per_file..... |
ba00 | 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 57 48 45 52 45 20 66 69 6c 65 73 5f 69 64 3d 27 | ................WHERE.files_id=' |
ba20 | 20 2e 20 24 74 68 69 73 2d 3e 67 65 74 46 69 6c 65 49 64 28 24 66 69 6c 65 29 20 2e 20 27 20 41 | ...$this->getFileId($file)...'.A |
ba40 | 4e 44 20 6c 69 6e 65 6e 75 6d 62 65 72 3d 27 20 2e 20 24 6c 69 6e 65 6e 75 6d 62 65 72 3b 0a 20 | ND.linenumber='...$linenumber;.. |
ba60 | 20 20 20 20 20 20 20 24 72 65 73 75 6c 74 20 3d 20 24 74 68 69 73 2d 3e 64 62 2d 3e 71 75 65 72 | .......$result.=.$this->db->quer |
ba80 | 79 28 24 71 75 65 72 79 29 3b 0a 20 20 20 20 20 20 20 20 69 66 20 28 21 24 72 65 73 75 6c 74 29 | y($query);.........if.(!$result) |
baa0 | 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 66 61 6c 73 65 3b 0a 20 20 20 | .{.............return.false;.... |
bac0 | 20 20 20 20 20 7d 0a 20 20 20 20 20 20 20 20 24 63 6f 76 65 72 61 67 65 20 3d 20 30 3b 0a 20 20 | .....}.........$coverage.=.0;... |
bae0 | 20 20 20 20 20 20 77 68 69 6c 65 20 28 24 72 65 73 20 3d 20 24 72 65 73 75 6c 74 2d 3e 66 65 74 | ......while.($res.=.$result->fet |
bb00 | 63 68 41 72 72 61 79 28 53 51 4c 49 54 45 33 5f 4e 55 4d 29 29 20 7b 0a 20 20 20 20 20 20 20 20 | chArray(SQLITE3_NUM)).{......... |
bb20 | 20 20 20 20 24 63 6f 76 65 72 61 67 65 20 3d 20 24 72 65 73 5b 30 5d 3b 0a 20 20 20 20 20 20 20 | ....$coverage.=.$res[0];........ |
bb40 | 20 7d 0a 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 24 63 6f 76 65 72 61 67 65 3b 0a 20 20 20 | .}.........return.$coverage;.... |
bb60 | 20 7d 0a 0a 20 20 20 20 66 75 6e 63 74 69 6f 6e 20 72 65 74 72 69 65 76 65 43 6f 76 65 72 61 67 | .}......function.retrieveCoverag |
bb80 | 65 28 24 70 61 74 68 29 0a 20 20 20 20 7b 0a 20 20 20 20 20 20 20 20 24 69 64 20 3d 20 24 74 68 | e($path).....{.........$id.=.$th |
bba0 | 69 73 2d 3e 67 65 74 46 69 6c 65 49 64 28 24 70 61 74 68 29 3b 0a 20 20 20 20 20 20 20 20 24 71 | is->getFileId($path);.........$q |
bbc0 | 75 65 72 79 20 3d 20 27 53 45 4c 45 43 54 20 63 6f 76 65 72 61 67 65 2c 20 6c 69 6e 65 6e 75 6d | uery.=.'SELECT.coverage,.linenum |
bbe0 | 62 65 72 20 46 52 4f 4d 20 63 6f 76 65 72 61 67 65 5f 70 65 72 5f 66 69 6c 65 0a 20 20 20 20 20 | ber.FROM.coverage_per_file...... |
bc00 | 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 57 48 45 52 45 20 66 69 6c 65 73 5f 69 64 3d 27 20 | ...............WHERE.files_id='. |
bc20 | 2e 20 24 69 64 20 2e 20 27 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 4f 52 | ..$id...'.....................OR |
bc40 | 44 45 52 20 42 59 20 6c 69 6e 65 6e 75 6d 62 65 72 20 41 53 43 27 3b 0a 20 20 20 20 20 20 20 20 | DER.BY.linenumber.ASC';......... |
bc60 | 24 72 65 73 75 6c 74 20 3d 20 24 74 68 69 73 2d 3e 64 62 2d 3e 71 75 65 72 79 28 24 71 75 65 72 | $result.=.$this->db->query($quer |
bc80 | 79 29 3b 0a 20 20 20 20 20 20 20 20 69 66 20 28 21 24 72 65 73 75 6c 74 29 20 7b 0a 20 20 20 20 | y);.........if.(!$result).{..... |
bca0 | 20 20 20 20 20 20 20 20 24 65 72 72 6f 72 20 3d 20 24 74 68 69 73 2d 3e 64 62 2d 3e 6c 61 73 74 | ........$error.=.$this->db->last |
bcc0 | 45 72 72 6f 72 4d 73 67 28 29 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 74 68 72 6f 77 20 6e 65 | ErrorMsg();.............throw.ne |
bce0 | 77 20 45 78 63 65 70 74 69 6f 6e 28 27 43 61 6e 6e 6f 74 20 72 65 74 72 69 65 76 65 20 63 6f 76 | w.Exception('Cannot.retrieve.cov |
bd00 | 65 72 61 67 65 20 66 6f 72 20 27 20 2e 20 24 70 61 74 68 2e 20 20 27 3a 20 27 20 2e 20 24 65 72 | erage.for.'...$path...':.'...$er |
bd20 | 72 6f 72 29 3b 0a 20 20 20 20 20 20 20 20 7d 0a 0a 20 20 20 20 20 20 20 20 24 72 65 74 20 3d 20 | ror);.........}..........$ret.=. |
bd40 | 61 72 72 61 79 28 29 3b 0a 20 20 20 20 20 20 20 20 77 68 69 6c 65 20 28 24 72 65 73 20 3d 20 24 | array();.........while.($res.=.$ |
bd60 | 72 65 73 75 6c 74 2d 3e 66 65 74 63 68 41 72 72 61 79 28 53 51 4c 49 54 45 33 5f 41 53 53 4f 43 | result->fetchArray(SQLITE3_ASSOC |
bd80 | 29 29 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 24 72 65 74 5b 24 72 65 73 5b 27 6c 69 6e 65 | )).{.............$ret[$res['line |
bda0 | 6e 75 6d 62 65 72 27 5d 5d 20 3d 20 24 72 65 73 5b 27 63 6f 76 65 72 61 67 65 27 5d 3b 0a 20 20 | number']].=.$res['coverage'];... |
bdc0 | 20 20 20 20 20 20 7d 0a 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 24 72 65 74 3b 0a 20 20 20 | ......}.........return.$ret;.... |
bde0 | 20 7d 0a 0a 20 20 20 20 2f 2a 2a 0a 20 20 20 20 20 2a 20 54 68 69 73 20 69 73 20 75 73 65 64 20 | .}....../**......*.This.is.used. |
be00 | 74 6f 20 67 65 74 20 74 68 65 20 63 6f 76 65 72 61 67 65 20 77 68 69 63 68 20 69 73 20 74 68 65 | to.get.the.coverage.which.is.the |
be20 | 6e 20 69 6e 73 65 72 74 65 64 20 69 6e 74 6f 20 6f 75 72 0a 20 20 20 20 20 2a 20 69 6e 74 65 72 | n.inserted.into.our......*.inter |
be40 | 6d 65 64 69 61 74 65 20 63 6f 76 65 72 61 67 65 5f 70 65 72 5f 66 69 6c 65 20 74 61 62 6c 65 20 | mediate.coverage_per_file.table. |
be60 | 74 6f 20 73 70 65 65 64 20 74 68 69 6e 67 73 20 75 70 20 61 74 20 72 65 6e 64 65 72 69 6e 67 0a | to.speed.things.up.at.rendering. |
be80 | 20 20 20 20 20 2a 2f 0a 20 20 20 20 66 75 6e 63 74 69 6f 6e 20 72 65 74 72 69 65 76 65 53 6c 6f | .....*/.....function.retrieveSlo |
bea0 | 77 43 6f 76 65 72 61 67 65 28 24 69 64 29 0a 20 20 20 20 7b 0a 20 20 20 20 20 20 20 20 24 71 75 | wCoverage($id).....{.........$qu |
bec0 | 65 72 79 20 3d 20 27 53 45 4c 45 43 54 20 53 55 4d 28 69 73 63 6f 76 65 72 65 64 29 20 61 73 20 | ery.=.'SELECT.SUM(iscovered).as. |
bee0 | 63 6f 76 65 72 61 67 65 2c 20 6c 69 6e 65 6e 75 6d 62 65 72 20 46 52 4f 4d 20 63 6f 76 65 72 61 | coverage,.linenumber.FROM.covera |
bf00 | 67 65 20 57 48 45 52 45 20 66 69 6c 65 73 5f 69 64 3d 27 20 2e 20 24 69 64 20 2e 20 27 0a 20 20 | ge.WHERE.files_id='...$id...'... |
bf20 | 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 47 52 4f 55 50 20 42 59 20 6c 69 6e 65 6e | ..................GROUP.BY.linen |
bf40 | 75 6d 62 65 72 27 3b 0a 20 20 20 20 20 20 20 20 24 72 65 73 75 6c 74 20 3d 20 24 74 68 69 73 2d | umber';.........$result.=.$this- |
bf60 | 3e 64 62 2d 3e 71 75 65 72 79 28 24 71 75 65 72 79 29 3b 0a 20 20 20 20 20 20 20 20 69 66 20 28 | >db->query($query);.........if.( |
bf80 | 21 24 72 65 73 75 6c 74 29 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 24 65 72 72 6f 72 20 3d | !$result).{.............$error.= |
bfa0 | 20 24 74 68 69 73 2d 3e 64 62 2d 3e 6c 61 73 74 45 72 72 6f 72 4d 73 67 28 29 3b 0a 20 20 20 20 | .$this->db->lastErrorMsg();..... |
bfc0 | 20 20 20 20 20 20 20 20 74 68 72 6f 77 20 6e 65 77 20 45 78 63 65 70 74 69 6f 6e 28 27 43 61 6e | ........throw.new.Exception('Can |
bfe0 | 6e 6f 74 20 72 65 74 72 69 65 76 65 20 63 6f 76 65 72 61 67 65 20 66 6f 72 20 27 20 2e 20 24 70 | not.retrieve.coverage.for.'...$p |
c000 | 61 74 68 2e 20 20 27 3a 20 27 20 2e 20 24 65 72 72 6f 72 29 3b 0a 20 20 20 20 20 20 20 20 7d 0a | ath...':.'...$error);.........}. |
c020 | 0a 20 20 20 20 20 20 20 20 24 72 65 74 20 3d 20 61 72 72 61 79 28 29 3b 0a 20 20 20 20 20 20 20 | .........$ret.=.array();........ |
c040 | 20 77 68 69 6c 65 20 28 24 72 65 73 20 3d 20 24 72 65 73 75 6c 74 2d 3e 66 65 74 63 68 41 72 72 | .while.($res.=.$result->fetchArr |
c060 | 61 79 28 53 51 4c 49 54 45 33 5f 41 53 53 4f 43 29 29 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 | ay(SQLITE3_ASSOC)).{............ |
c080 | 20 24 72 65 74 5b 24 72 65 73 5b 27 6c 69 6e 65 6e 75 6d 62 65 72 27 5d 5d 20 3d 20 24 72 65 73 | .$ret[$res['linenumber']].=.$res |
c0a0 | 5b 27 63 6f 76 65 72 61 67 65 27 5d 3b 0a 20 20 20 20 20 20 20 20 7d 0a 20 20 20 20 20 20 20 20 | ['coverage'];.........}......... |
c0c0 | 72 65 74 75 72 6e 20 24 72 65 74 3b 0a 20 20 20 20 7d 0a 0a 20 20 20 20 66 75 6e 63 74 69 6f 6e | return.$ret;.....}......function |
c0e0 | 20 75 70 64 61 74 65 54 6f 74 61 6c 43 6f 76 65 72 61 67 65 28 29 0a 20 20 20 20 7b 0a 20 20 20 | .updateTotalCoverage().....{.... |
c100 | 20 20 20 20 20 24 71 75 65 72 79 20 3d 20 27 44 45 4c 45 54 45 20 46 52 4f 4d 20 63 6f 76 65 72 | .....$query.=.'DELETE.FROM.cover |
c120 | 61 67 65 5f 70 65 72 5f 66 69 6c 65 27 3b 0a 20 20 20 20 20 20 20 20 24 74 68 69 73 2d 3e 64 62 | age_per_file';.........$this->db |
c140 | 2d 3e 65 78 65 63 28 24 71 75 65 72 79 29 3b 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 55 70 | ->exec($query);.........echo."Up |
c160 | 64 61 74 69 6e 67 20 63 6f 76 65 72 61 67 65 20 70 65 72 2d 66 69 6c 65 20 69 6e 74 65 72 6d 65 | dating.coverage.per-file.interme |
c180 | 64 69 61 74 65 20 74 61 62 6c 65 5c 6e 22 3b 0a 20 20 20 20 20 20 20 20 66 6f 72 65 61 63 68 20 | diate.table\n";.........foreach. |
c1a0 | 28 24 74 68 69 73 2d 3e 72 65 74 72 69 65 76 65 50 61 74 68 73 28 29 20 61 73 20 24 70 61 74 68 | ($this->retrievePaths().as.$path |
c1c0 | 29 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 2e 22 3b 0a 20 20 20 20 20 20 | ).{.............echo.".";....... |
c1e0 | 20 20 20 20 20 20 24 69 64 20 3d 20 24 74 68 69 73 2d 3e 67 65 74 46 69 6c 65 49 64 28 24 70 61 | ......$id.=.$this->getFileId($pa |
c200 | 74 68 29 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 66 6f 72 65 61 63 68 20 28 24 74 68 69 73 2d | th);.............foreach.($this- |
c220 | 3e 72 65 74 72 69 65 76 65 53 6c 6f 77 43 6f 76 65 72 61 67 65 28 24 69 64 29 20 61 73 20 24 6c | >retrieveSlowCoverage($id).as.$l |
c240 | 69 6e 65 6e 75 6d 62 65 72 20 3d 3e 20 24 63 6f 76 65 72 61 67 65 29 20 7b 0a 20 20 20 20 20 20 | inenumber.=>.$coverage).{....... |
c260 | 20 20 20 20 20 20 20 20 20 20 24 71 75 65 72 79 20 3d 20 27 49 4e 53 45 52 54 20 49 4e 54 4f 20 | ..........$query.=.'INSERT.INTO. |
c280 | 63 6f 76 65 72 61 67 65 5f 70 65 72 5f 66 69 6c 65 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | coverage_per_file............... |
c2a0 | 20 20 20 20 20 20 28 66 69 6c 65 73 5f 69 64 2c 20 63 6f 76 65 72 61 67 65 2c 20 6c 69 6e 65 6e | ......(files_id,.coverage,.linen |
c2c0 | 75 6d 62 65 72 29 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 56 41 4c 55 45 | umber).....................VALUE |
c2e0 | 53 28 27 20 2e 20 24 69 64 20 2e 20 27 2c 27 20 2e 20 24 63 6f 76 65 72 61 67 65 20 2e 20 27 2c | S('...$id...','...$coverage...', |
c300 | 27 20 2e 20 24 6c 69 6e 65 6e 75 6d 62 65 72 20 2e 27 29 27 3b 0a 20 20 20 20 20 20 20 20 20 20 | '...$linenumber..')';........... |
c320 | 20 20 20 20 20 20 24 74 68 69 73 2d 3e 64 62 2d 3e 65 78 65 63 28 24 71 75 65 72 79 29 3b 0a 20 | ......$this->db->exec($query);.. |
c340 | 20 20 20 20 20 20 20 20 20 20 20 7d 0a 20 20 20 20 20 20 20 20 7d 0a 20 20 20 20 20 20 20 20 65 | ...........}.........}.........e |
c360 | 63 68 6f 20 22 64 6f 6e 65 5c 6e 22 3b 0a 20 20 20 20 7d 0a 0a 20 20 20 20 66 75 6e 63 74 69 6f | cho."done\n";.....}......functio |
c380 | 6e 20 61 64 64 43 6f 76 65 72 61 67 65 28 24 74 65 73 74 70 61 74 68 2c 20 24 74 65 73 74 69 64 | n.addCoverage($testpath,.$testid |
c3a0 | 2c 20 24 78 64 65 62 75 67 29 0a 20 20 20 20 7b 0a 20 20 20 20 20 20 20 20 66 6f 72 65 61 63 68 | ,.$xdebug).....{.........foreach |
c3c0 | 20 28 24 78 64 65 62 75 67 20 61 73 20 24 70 61 74 68 20 3d 3e 20 24 72 65 73 75 6c 74 73 29 20 | .($xdebug.as.$path.=>.$results). |
c3e0 | 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 21 66 69 6c 65 5f 65 78 69 73 74 73 28 24 | {.............if.(!file_exists($ |
c400 | 70 61 74 68 29 29 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 6f 6e 74 69 6e 75 | path)).{.................continu |
c420 | 65 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 | e;.............}.............if. |
c440 | 28 73 74 72 70 6f 73 28 24 70 61 74 68 2c 20 24 74 68 69 73 2d 3e 63 6f 64 65 70 61 74 68 29 20 | (strpos($path,.$this->codepath). |
c460 | 21 3d 3d 20 30 29 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 24 69 73 73 6f 75 72 | !==.0).{.................$issour |
c480 | 63 65 20 3d 20 30 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 20 65 6c 73 65 20 7b 0a 20 20 20 | ce.=.0;.............}.else.{.... |
c4a0 | 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 73 74 72 70 6f 73 28 24 70 61 74 68 2c 20 24 | .............if.(strpos($path,.$ |
c4c0 | 74 68 69 73 2d 3e 74 65 73 74 70 61 74 68 29 20 3d 3d 3d 20 30 29 20 7b 0a 20 20 20 20 20 20 20 | this->testpath).===.0).{........ |
c4e0 | 20 20 20 20 20 20 20 20 20 20 20 20 20 24 69 73 73 6f 75 72 63 65 20 3d 20 30 3b 0a 20 20 20 20 | .............$issource.=.0;..... |
c500 | 20 20 20 20 20 20 20 20 20 20 20 20 7d 20 65 6c 73 65 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 | ............}.else.{............ |
c520 | 20 20 20 20 20 20 20 20 20 24 69 73 73 6f 75 72 63 65 20 3d 20 31 3b 0a 20 20 20 20 20 20 20 20 | .........$issource.=.1;......... |
c540 | 20 20 20 20 20 20 20 20 7d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0a 20 20 20 20 20 20 20 20 | ........}.............}......... |
c560 | 20 20 20 20 65 63 68 6f 20 22 2e 22 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 24 69 64 20 3d 20 | ....echo.".";.............$id.=. |
c580 | 24 74 68 69 73 2d 3e 61 64 64 46 69 6c 65 28 24 70 61 74 68 2c 20 24 69 73 73 6f 75 72 63 65 29 | $this->addFile($path,.$issource) |
c5a0 | 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 66 6f 72 65 61 63 68 20 28 24 72 65 73 75 6c 74 73 20 | ;.............foreach.($results. |
c5c0 | 61 73 20 24 6c 69 6e 65 20 3d 3e 20 24 69 6e 66 6f 29 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 | as.$line.=>.$info).{............ |
c5e0 | 20 20 20 20 20 69 66 20 28 24 69 6e 66 6f 20 3e 20 30 29 20 7b 0a 20 20 20 20 20 20 20 20 20 20 | .....if.($info.>.0).{........... |
c600 | 20 20 20 20 20 20 20 20 20 20 24 72 65 73 20 3d 20 31 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 | ..........$res.=.1;............. |
c620 | 20 20 20 20 7d 20 65 6c 73 65 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | ....}.else.{.................... |
c640 | 20 24 72 65 73 20 3d 20 30 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7d 0a 20 20 20 | .$res.=.0;.................}.... |
c660 | 20 20 20 20 20 20 20 20 20 20 20 20 20 24 71 75 65 72 79 20 3d 20 27 49 4e 53 45 52 54 20 49 4e | .............$query.=.'INSERT.IN |
c680 | 54 4f 20 63 6f 76 65 72 61 67 65 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | TO.coverage..................... |
c6a0 | 28 66 69 6c 65 73 5f 69 64 2c 20 74 65 73 74 73 5f 69 64 2c 20 6c 69 6e 65 6e 75 6d 62 65 72 2c | (files_id,.tests_id,.linenumber, |
c6c0 | 20 69 73 63 6f 76 65 72 65 64 2c 20 69 73 73 6f 75 72 63 65 29 0a 20 20 20 20 20 20 20 20 20 20 | .iscovered,.issource)........... |
c6e0 | 20 20 20 20 20 20 20 20 20 20 56 41 4c 55 45 53 28 27 20 2e 20 24 69 64 20 2e 20 27 2c 20 27 20 | ..........VALUES('...$id...',.'. |
c700 | 2e 20 24 74 65 73 74 69 64 20 2e 20 27 2c 20 27 20 2e 20 24 6c 69 6e 65 20 2e 20 27 2c 20 27 20 | ..$testid...',.'...$line...',.'. |
c720 | 2e 20 24 72 65 73 20 2e 20 27 2c 27 20 2e 20 24 69 73 73 6f 75 72 63 65 20 2e 20 27 29 27 3b 0a | ..$res...','...$issource...')';. |
c740 | 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 24 77 6f 72 6b 65 64 20 3d 20 24 74 68 69 73 | .................$worked.=.$this |
c760 | 2d 3e 64 62 2d 3e 65 78 65 63 28 24 71 75 65 72 79 29 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 | ->db->exec($query);............. |
c780 | 20 20 20 20 69 66 20 28 21 24 77 6f 72 6b 65 64 29 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 | ....if.(!$worked).{............. |
c7a0 | 20 20 20 20 20 20 20 20 24 65 72 72 6f 72 20 3d 20 24 74 68 69 73 2d 3e 64 62 2d 3e 6c 61 73 74 | ........$error.=.$this->db->last |
c7c0 | 45 72 72 6f 72 4d 73 67 28 29 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | ErrorMsg();..................... |
c7e0 | 74 68 72 6f 77 20 6e 65 77 20 45 78 63 65 70 74 69 6f 6e 28 27 43 61 6e 6e 6f 74 20 61 64 64 20 | throw.new.Exception('Cannot.add. |
c800 | 63 6f 76 65 72 61 67 65 20 66 6f 72 20 74 65 73 74 20 27 20 2e 20 24 74 65 73 74 70 61 74 68 20 | coverage.for.test.'...$testpath. |
c820 | 2e 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | ................................ |
c840 | 20 20 20 20 20 20 20 20 20 20 27 2c 20 63 6f 76 65 72 65 64 20 66 69 6c 65 20 27 20 2e 20 24 70 | ..........',.covered.file.'...$p |
c860 | 61 74 68 20 2e 20 27 3a 20 27 20 2e 20 24 65 72 72 6f 72 29 3b 0a 20 20 20 20 20 20 20 20 20 20 | ath...':.'...$error);........... |
c880 | 20 20 20 20 20 20 7d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0a 20 20 20 20 20 20 20 20 7d 0a | ......}.............}.........}. |
c8a0 | 20 20 20 20 7d 0a 0a 20 20 20 20 66 75 6e 63 74 69 6f 6e 20 62 65 67 69 6e 28 29 0a 20 20 20 20 | ....}......function.begin()..... |
c8c0 | 7b 0a 20 20 20 20 20 20 20 20 24 74 68 69 73 2d 3e 64 62 2d 3e 65 78 65 63 28 27 42 45 47 49 4e | {.........$this->db->exec('BEGIN |
c8e0 | 27 29 3b 0a 20 20 20 20 7d 0a 0a 20 20 20 20 66 75 6e 63 74 69 6f 6e 20 63 6f 6d 6d 69 74 28 29 | ');.....}......function.commit() |
c900 | 0a 20 20 20 20 7b 0a 20 20 20 20 20 20 20 20 24 74 68 69 73 2d 3e 64 62 2d 3e 65 78 65 63 28 27 | .....{.........$this->db->exec(' |
c920 | 43 4f 4d 4d 49 54 27 29 3b 0a 20 20 20 20 7d 0a 0a 20 20 20 20 2f 2a 2a 0a 20 20 20 20 20 2a 20 | COMMIT');.....}....../**......*. |
c940 | 52 65 74 72 69 65 76 65 20 61 20 6c 69 73 74 20 6f 66 20 2e 70 68 70 74 20 74 65 73 74 73 20 74 | Retrieve.a.list.of..phpt.tests.t |
c960 | 68 61 74 20 65 69 74 68 65 72 20 68 61 76 65 20 62 65 65 6e 20 6d 6f 64 69 66 69 65 64 2c 0a 20 | hat.either.have.been.modified,.. |
c980 | 20 20 20 20 2a 20 6f 72 20 74 68 65 20 66 69 6c 65 73 20 74 68 65 79 20 61 63 63 65 73 73 20 68 | ....*.or.the.files.they.access.h |
c9a0 | 61 76 65 20 62 65 65 6e 20 6d 6f 64 69 66 69 65 64 0a 20 20 20 20 20 2a 20 40 72 65 74 75 72 6e | ave.been.modified......*.@return |
c9c0 | 20 61 72 72 61 79 0a 20 20 20 20 20 2a 2f 0a 20 20 20 20 66 75 6e 63 74 69 6f 6e 20 67 65 74 4d | .array......*/.....function.getM |
c9e0 | 6f 64 69 66 69 65 64 54 65 73 74 73 28 29 0a 20 20 20 20 7b 0a 20 20 20 20 20 20 20 20 24 6d 6f | odifiedTests().....{.........$mo |
ca00 | 64 69 66 69 65 64 50 61 74 68 73 20 3d 20 61 72 72 61 79 28 29 3b 0a 20 20 20 20 20 20 20 20 24 | difiedPaths.=.array();.........$ |
ca20 | 6d 6f 64 69 66 69 65 64 54 65 73 74 73 20 3d 20 61 72 72 61 79 28 29 3b 0a 20 20 20 20 20 20 20 | modifiedTests.=.array();........ |
ca40 | 20 24 70 61 74 68 73 20 3d 20 24 74 68 69 73 2d 3e 72 65 74 72 69 65 76 65 50 61 74 68 73 28 31 | .$paths.=.$this->retrievePaths(1 |
ca60 | 29 3b 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 53 63 61 6e 6e 69 6e 67 20 22 2c 20 63 6f 75 | );.........echo."Scanning.",.cou |
ca80 | 6e 74 28 24 70 61 74 68 73 29 2c 20 22 20 73 6f 75 72 63 65 20 66 69 6c 65 73 22 3b 0a 20 20 20 | nt($paths),.".source.files";.... |
caa0 | 20 20 20 20 20 66 6f 72 65 61 63 68 20 28 24 70 61 74 68 73 20 61 73 20 24 70 61 74 68 29 20 7b | .....foreach.($paths.as.$path).{ |
cac0 | 0a 20 20 20 20 20 20 20 20 20 20 20 20 65 63 68 6f 20 27 2e 27 3b 0a 20 20 20 20 20 20 20 20 20 | .............echo.'.';.......... |
cae0 | 20 20 20 24 71 75 65 72 79 20 3d 20 27 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 53 45 | ...$query.=.'.................SE |
cb00 | 4c 45 43 54 20 69 64 2c 20 66 69 6c 65 70 61 74 68 6d 64 35 20 46 52 4f 4d 20 66 69 6c 65 73 20 | LECT.id,.filepathmd5.FROM.files. |
cb20 | 77 68 65 72 65 20 66 69 6c 65 70 61 74 68 3d 22 27 20 2e 0a 20 20 20 20 20 20 20 20 20 20 20 20 | where.filepath="'............... |
cb40 | 20 20 20 20 24 74 68 69 73 2d 3e 64 62 2d 3e 65 73 63 61 70 65 53 74 72 69 6e 67 28 24 70 61 74 | ....$this->db->escapeString($pat |
cb60 | 68 29 20 2e 20 27 22 27 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 24 72 65 73 75 6c 74 20 3d 20 | h)...'"';.............$result.=. |
cb80 | 24 74 68 69 73 2d 3e 64 62 2d 3e 71 75 65 72 79 28 24 71 75 65 72 79 29 3b 0a 20 20 20 20 20 20 | $this->db->query($query);....... |
cba0 | 20 20 20 20 20 20 77 68 69 6c 65 20 28 24 72 65 73 20 3d 20 24 72 65 73 75 6c 74 2d 3e 66 65 74 | ......while.($res.=.$result->fet |
cbc0 | 63 68 41 72 72 61 79 28 53 51 4c 49 54 45 33 5f 41 53 53 4f 43 29 29 20 7b 0a 20 20 20 20 20 20 | chArray(SQLITE3_ASSOC)).{....... |
cbe0 | 20 20 20 20 20 20 20 20 20 20 69 66 20 28 6d 64 35 5f 66 69 6c 65 28 24 70 61 74 68 29 20 3d 3d | ..........if.(md5_file($path).== |
cc00 | 20 24 72 65 73 5b 27 66 69 6c 65 70 61 74 68 6d 64 35 27 5d 29 20 7b 0a 20 20 20 20 20 20 20 20 | .$res['filepathmd5']).{......... |
cc20 | 20 20 20 20 20 20 20 20 20 20 20 20 62 72 65 61 6b 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 | ............break;.............. |
cc40 | 20 20 20 7d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 24 6d 6f 64 69 66 69 65 64 50 61 | ...}.................$modifiedPa |
cc60 | 74 68 73 5b 5d 20 3d 20 24 70 61 74 68 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f | ths[].=.$path;................./ |
cc80 | 2f 20 66 69 6c 65 20 69 73 20 6d 6f 64 69 66 69 65 64 2c 20 67 65 74 20 61 20 6c 69 73 74 20 6f | /.file.is.modified,.get.a.list.o |
cca0 | 66 20 74 65 73 74 73 20 74 68 61 74 20 65 78 65 63 75 74 65 20 74 68 69 73 20 66 69 6c 65 0a 20 | f.tests.that.execute.this.file.. |
ccc0 | 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 24 71 75 65 72 79 20 3d 20 27 0a 20 20 20 20 20 20 | ...............$query.=.'....... |
cce0 | 20 20 20 20 20 20 20 20 20 20 20 20 20 20 53 45 4c 45 43 54 20 74 2e 74 65 73 74 70 61 74 68 0a | ..............SELECT.t.testpath. |
cd00 | 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 46 52 4f 4d 20 63 6f 76 65 72 61 67 | ....................FROM.coverag |
cd20 | 65 20 63 2c 20 74 65 73 74 73 20 74 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | e.c,.tests.t.................... |
cd40 | 20 57 48 45 52 45 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 | .WHERE.........................c |
cd60 | 2e 66 69 6c 65 73 5f 69 64 3d 27 20 2e 20 24 72 65 73 5b 27 69 64 27 5d 20 2e 20 27 0a 20 20 20 | .files_id='...$res['id']...'.... |
cd80 | 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 41 4e 44 20 74 2e 69 64 3d 63 2e | .....................AND.t.id=c. |
cda0 | 74 65 73 74 73 5f 69 64 27 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 24 72 65 73 75 | tests_id';.................$resu |
cdc0 | 6c 74 32 20 3d 20 24 74 68 69 73 2d 3e 64 62 2d 3e 71 75 65 72 79 28 24 71 75 65 72 79 29 3b 0a | lt2.=.$this->db->query($query);. |
cde0 | 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 77 68 69 6c 65 20 28 24 72 65 73 20 3d 20 24 72 | ................while.($res.=.$r |
ce00 | 65 73 75 6c 74 32 2d 3e 66 65 74 63 68 41 72 72 61 79 28 53 51 4c 49 54 45 33 5f 4e 55 4d 29 29 | esult2->fetchArray(SQLITE3_NUM)) |
ce20 | 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 24 6d 6f 64 69 66 69 65 64 | .{.....................$modified |
ce40 | 54 65 73 74 73 5b 24 72 65 73 5b 30 5d 5d 20 3d 20 74 72 75 65 3b 0a 20 20 20 20 20 20 20 20 20 | Tests[$res[0]].=.true;.......... |
ce60 | 20 20 20 20 20 20 20 7d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 62 72 65 61 6b 3b 0a | .......}.................break;. |
ce80 | 20 20 20 20 20 20 20 20 20 20 20 20 7d 0a 20 20 20 20 20 20 20 20 7d 0a 20 20 20 20 20 20 20 20 | ............}.........}......... |
cea0 | 65 63 68 6f 20 22 64 6f 6e 65 5c 6e 22 3b 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20 63 6f 75 6e | echo."done\n";.........echo.coun |
cec0 | 74 28 24 6d 6f 64 69 66 69 65 64 50 61 74 68 73 29 2c 20 27 20 6d 6f 64 69 66 69 65 64 20 66 69 | t($modifiedPaths),.'.modified.fi |
cee0 | 6c 65 73 20 72 65 73 75 6c 74 69 6e 67 20 69 6e 20 27 2c 0a 20 20 20 20 20 20 20 20 20 20 20 20 | les.resulting.in.',............. |
cf00 | 63 6f 75 6e 74 28 24 6d 6f 64 69 66 69 65 64 54 65 73 74 73 29 2c 20 22 20 6d 6f 64 69 66 69 65 | count($modifiedTests),.".modifie |
cf20 | 64 20 74 65 73 74 73 5c 6e 22 3b 0a 20 20 20 20 20 20 20 20 24 70 61 74 68 73 20 3d 20 24 74 68 | d.tests\n";.........$paths.=.$th |
cf40 | 69 73 2d 3e 72 65 74 72 69 65 76 65 54 65 73 74 50 61 74 68 73 28 29 3b 0a 20 20 20 20 20 20 20 | is->retrieveTestPaths();........ |
cf60 | 20 65 63 68 6f 20 22 53 63 61 6e 6e 69 6e 67 20 22 2c 20 63 6f 75 6e 74 28 24 70 61 74 68 73 29 | .echo."Scanning.",.count($paths) |
cf80 | 2c 20 22 20 74 65 73 74 20 70 61 74 68 73 22 3b 0a 20 20 20 20 20 20 20 20 66 6f 72 65 61 63 68 | ,.".test.paths";.........foreach |
cfa0 | 20 28 24 70 61 74 68 73 20 61 73 20 24 70 61 74 68 29 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 | .($paths.as.$path).{............ |
cfc0 | 20 65 63 68 6f 20 27 2e 27 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 24 71 75 65 72 79 20 3d 20 | .echo.'.';.............$query.=. |
cfe0 | 27 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 53 45 4c 45 43 54 20 69 64 2c 20 74 65 73 | '.................SELECT.id,.tes |
d000 | 74 70 61 74 68 6d 64 35 20 46 52 4f 4d 20 74 65 73 74 73 20 77 68 65 72 65 20 74 65 73 74 70 61 | tpathmd5.FROM.tests.where.testpa |
d020 | 74 68 3d 22 27 20 2e 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 24 74 68 69 73 2d 3e 64 | th="'...................$this->d |
d040 | 62 2d 3e 65 73 63 61 70 65 53 74 72 69 6e 67 28 24 70 61 74 68 29 20 2e 20 27 22 27 3b 0a 20 20 | b->escapeString($path)...'"';... |
d060 | 20 20 20 20 20 20 20 20 20 20 24 72 65 73 75 6c 74 20 3d 20 24 74 68 69 73 2d 3e 64 62 2d 3e 71 | ..........$result.=.$this->db->q |
d080 | 75 65 72 79 28 24 71 75 65 72 79 29 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 77 68 69 6c 65 20 | uery($query);.............while. |
d0a0 | 28 24 72 65 73 20 3d 20 24 72 65 73 75 6c 74 2d 3e 66 65 74 63 68 41 72 72 61 79 28 53 51 4c 49 | ($res.=.$result->fetchArray(SQLI |
d0c0 | 54 45 33 5f 41 53 53 4f 43 29 29 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 | TE3_ASSOC)).{.................if |
d0e0 | 20 28 6d 64 35 5f 66 69 6c 65 28 24 70 61 74 68 29 20 21 3d 20 24 72 65 73 5b 27 74 65 73 74 70 | .(md5_file($path).!=.$res['testp |
d100 | 61 74 68 6d 64 35 27 5d 29 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | athmd5']).{..................... |
d120 | 24 6d 6f 64 69 66 69 65 64 54 65 73 74 73 5b 24 70 61 74 68 5d 20 3d 20 74 72 75 65 3b 0a 20 20 | $modifiedTests[$path].=.true;... |
d140 | 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0a 20 20 | ..............}.............}... |
d160 | 20 20 20 20 20 20 7d 0a 20 20 20 20 20 20 20 20 65 63 68 6f 20 22 64 6f 6e 65 5c 6e 22 3b 0a 20 | ......}.........echo."done\n";.. |
d180 | 20 20 20 20 20 20 20 65 63 68 6f 20 63 6f 75 6e 74 28 24 6d 6f 64 69 66 69 65 64 54 65 73 74 73 | .......echo.count($modifiedTests |
d1a0 | 29 2c 20 22 20 74 65 73 74 73 20 73 68 6f 75 6c 64 20 62 65 20 72 65 2d 72 75 6e 5c 6e 22 3b 0a | ),.".tests.should.be.re-run\n";. |
d1c0 | 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 61 72 72 61 79 5f 6b 65 79 73 28 24 6d 6f 64 69 66 | ........return.array_keys($modif |
d1e0 | 69 65 64 54 65 73 74 73 29 3b 0a 20 20 20 20 7d 0a 7d 0a 7d 0a 3f 3e 3c 3f 70 68 70 0a 6e 61 6d | iedTests);.....}.}.}.?><?php.nam |
d200 | 65 73 70 61 63 65 20 50 45 41 52 32 5c 50 79 72 75 73 5c 44 65 76 65 6c 6f 70 65 72 5c 43 6f 76 | espace.PEAR2\Pyrus\Developer\Cov |
d220 | 65 72 61 67 65 41 6e 61 6c 79 7a 65 72 5c 53 6f 75 72 63 65 46 69 6c 65 20 7b 0a 75 73 65 20 50 | erageAnalyzer\SourceFile.{.use.P |
d240 | 45 41 52 32 5c 50 79 72 75 73 5c 44 65 76 65 6c 6f 70 65 72 5c 43 6f 76 65 72 61 67 65 41 6e 61 | EAR2\Pyrus\Developer\CoverageAna |
d260 | 6c 79 7a 65 72 5c 41 67 67 72 65 67 61 74 6f 72 2c 0a 20 20 20 20 50 45 41 52 32 5c 50 79 72 75 | lyzer\Aggregator,.....PEAR2\Pyru |
d280 | 73 5c 44 65 76 65 6c 6f 70 65 72 5c 43 6f 76 65 72 61 67 65 41 6e 61 6c 79 7a 65 72 5c 41 62 73 | s\Developer\CoverageAnalyzer\Abs |
d2a0 | 74 72 61 63 74 53 6f 75 72 63 65 44 65 63 6f 72 61 74 6f 72 3b 0a 63 6c 61 73 73 20 50 65 72 54 | tractSourceDecorator;.class.PerT |
d2c0 | 65 73 74 20 65 78 74 65 6e 64 73 20 5c 50 45 41 52 32 5c 50 79 72 75 73 5c 44 65 76 65 6c 6f 70 | est.extends.\PEAR2\Pyrus\Develop |
d2e0 | 65 72 5c 43 6f 76 65 72 61 67 65 41 6e 61 6c 79 7a 65 72 5c 53 6f 75 72 63 65 46 69 6c 65 0a 7b | er\CoverageAnalyzer\SourceFile.{ |
d300 | 0a 20 20 20 20 70 72 6f 74 65 63 74 65 64 20 24 74 65 73 74 6e 61 6d 65 3b 0a 0a 20 20 20 20 66 | .....protected.$testname;......f |
d320 | 75 6e 63 74 69 6f 6e 20 5f 5f 63 6f 6e 73 74 72 75 63 74 28 24 70 61 74 68 2c 20 41 67 67 72 65 | unction.__construct($path,.Aggre |
d340 | 67 61 74 6f 72 20 24 61 67 67 2c 20 24 74 65 73 74 70 61 74 68 2c 20 24 73 6f 75 72 63 65 70 61 | gator.$agg,.$testpath,.$sourcepa |
d360 | 74 68 2c 20 24 74 65 73 74 6e 61 6d 65 29 0a 20 20 20 20 7b 0a 20 20 20 20 20 20 20 20 24 74 68 | th,.$testname).....{.........$th |
d380 | 69 73 2d 3e 74 65 73 74 6e 61 6d 65 20 3d 20 24 74 65 73 74 6e 61 6d 65 3b 0a 20 20 20 20 20 20 | is->testname.=.$testname;....... |
d3a0 | 20 20 70 61 72 65 6e 74 3a 3a 5f 5f 63 6f 6e 73 74 72 75 63 74 28 24 70 61 74 68 2c 20 24 61 67 | ..parent::__construct($path,.$ag |
d3c0 | 67 2c 20 24 74 65 73 74 70 61 74 68 2c 20 24 73 6f 75 72 63 65 70 61 74 68 29 3b 0a 20 20 20 20 | g,.$testpath,.$sourcepath);..... |
d3e0 | 7d 0a 0a 20 20 20 20 66 75 6e 63 74 69 6f 6e 20 73 65 74 43 6f 76 65 72 61 67 65 28 29 0a 20 20 | }......function.setCoverage()... |
d400 | 20 20 7b 0a 20 20 20 20 20 20 20 20 24 74 68 69 73 2d 3e 63 6f 76 65 72 61 67 65 20 3d 20 24 74 | ..{.........$this->coverage.=.$t |
d420 | 68 69 73 2d 3e 61 67 67 72 65 67 61 74 6f 72 2d 3e 72 65 74 72 69 65 76 65 43 6f 76 65 72 61 67 | his->aggregator->retrieveCoverag |
d440 | 65 42 79 54 65 73 74 28 24 74 68 69 73 2d 3e 70 61 74 68 2c 20 24 74 68 69 73 2d 3e 74 65 73 74 | eByTest($this->path,.$this->test |
d460 | 6e 61 6d 65 29 3b 0a 20 20 20 20 7d 0a 0a 20 20 20 20 66 75 6e 63 74 69 6f 6e 20 63 6f 76 65 72 | name);.....}......function.cover |
d480 | 65 64 4c 69 6e 65 73 28 29 0a 20 20 20 20 7b 0a 20 20 20 20 20 20 20 20 24 69 6e 66 6f 20 3d 20 | edLines().....{.........$info.=. |
d4a0 | 24 74 68 69 73 2d 3e 61 67 67 72 65 67 61 74 6f 72 2d 3e 63 6f 76 65 72 61 67 65 49 6e 66 6f 42 | $this->aggregator->coverageInfoB |
d4c0 | 79 54 65 73 74 28 24 74 68 69 73 2d 3e 70 61 74 68 2c 20 24 74 68 69 73 2d 3e 74 65 73 74 6e 61 | yTest($this->path,.$this->testna |
d4e0 | 6d 65 29 3b 0a 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 24 69 6e 66 6f 5b 30 5d 3b 0a 20 20 | me);.........return.$info[0];... |
d500 | 20 20 7d 0a 0a 20 20 20 20 66 75 6e 63 74 69 6f 6e 20 72 65 6e 64 65 72 28 41 62 73 74 72 61 63 | ..}......function.render(Abstrac |
d520 | 74 53 6f 75 72 63 65 44 65 63 6f 72 61 74 6f 72 20 24 64 65 63 6f 72 61 74 6f 72 20 3d 20 6e 75 | tSourceDecorator.$decorator.=.nu |
d540 | 6c 6c 29 0a 20 20 20 20 7b 0a 20 20 20 20 20 20 20 20 69 66 20 28 24 64 65 63 6f 72 61 74 6f 72 | ll).....{.........if.($decorator |
d560 | 20 3d 3d 3d 20 6e 75 6c 6c 29 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 24 64 65 63 6f 72 61 | .===.null).{.............$decora |
d580 | 74 6f 72 20 3d 20 6e 65 77 20 44 65 66 61 75 6c 74 53 6f 75 72 63 65 44 65 63 6f 72 61 74 6f 72 | tor.=.new.DefaultSourceDecorator |
d5a0 | 28 27 2e 27 29 3b 0a 20 20 20 20 20 20 20 20 7d 0a 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 | ('.');.........}.........return. |
d5c0 | 24 64 65 63 6f 72 61 74 6f 72 2d 3e 72 65 6e 64 65 72 28 24 74 68 69 73 2c 20 24 74 68 69 73 2d | $decorator->render($this,.$this- |
d5e0 | 3e 74 65 73 74 6e 61 6d 65 29 3b 0a 20 20 20 20 7d 0a 0a 20 20 20 20 66 75 6e 63 74 69 6f 6e 20 | >testname);.....}......function. |
d600 | 63 6f 76 65 72 61 67 65 50 65 72 63 65 6e 74 61 67 65 28 29 0a 20 20 20 20 7b 0a 20 20 20 20 20 | coveragePercentage().....{...... |
d620 | 20 20 20 72 65 74 75 72 6e 20 24 74 68 69 73 2d 3e 61 67 67 72 65 67 61 74 6f 72 2d 3e 63 6f 76 | ...return.$this->aggregator->cov |
d640 | 65 72 61 67 65 50 65 72 63 65 6e 74 61 67 65 28 24 74 68 69 73 2d 3e 70 61 74 68 2c 20 24 74 68 | eragePercentage($this->path,.$th |
d660 | 69 73 2d 3e 74 65 73 74 6e 61 6d 65 29 3b 0a 20 20 20 20 7d 0a 7d 0a 7d 0a 3f 3e 0a 3c 3f 70 68 | is->testname);.....}.}.}.?>.<?ph |
d680 | 70 0a 6e 61 6d 65 73 70 61 63 65 20 50 45 41 52 32 5c 50 79 72 75 73 5c 44 65 76 65 6c 6f 70 65 | p.namespace.PEAR2\Pyrus\Develope |
d6a0 | 72 5c 43 6f 76 65 72 61 67 65 41 6e 61 6c 79 7a 65 72 20 7b 0a 24 63 6c 61 73 73 20 3d 20 22 50 | r\CoverageAnalyzer.{.$class.=."P |
d6c0 | 45 41 52 32 5c 50 79 72 75 73 5c 44 65 76 65 6c 6f 70 65 72 5c 43 6f 76 65 72 61 67 65 41 6e 61 | EAR2\Pyrus\Developer\CoverageAna |
d6e0 | 6c 79 7a 65 72 5c 57 65 62 5c 56 69 65 77 22 3b 0a 76 61 72 5f 64 75 6d 70 28 73 74 72 5f 72 65 | lyzer\Web\View";.var_dump(str_re |
d700 | 70 6c 61 63 65 28 22 50 45 41 52 32 5c 50 79 72 75 73 5c 44 65 76 65 6c 6f 70 65 72 5c 43 6f 76 | place("PEAR2\Pyrus\Developer\Cov |
d720 | 65 72 61 67 65 41 6e 61 6c 79 7a 65 72 22 2c 20 22 22 2c 20 24 63 6c 61 73 73 29 29 3b 0a 24 76 | erageAnalyzer",."",.$class));.$v |
d740 | 69 65 77 20 3d 20 6e 65 77 20 57 65 62 5c 56 69 65 77 3b 0a 24 72 6f 6f 74 75 72 6c 20 3d 20 24 | iew.=.new.Web\View;.$rooturl.=.$ |
d760 | 5f 53 45 52 56 45 52 5b 22 52 45 51 55 45 53 54 5f 55 52 49 22 5d 3b 0a 24 63 6f 6e 74 72 6f 6c | _SERVER["REQUEST_URI"];.$control |
d780 | 6c 65 72 20 3d 20 6e 65 77 20 57 65 62 5c 43 6f 6e 74 72 6f 6c 6c 65 72 28 24 76 69 65 77 2c 20 | ler.=.new.Web\Controller($view,. |
d7a0 | 24 72 6f 6f 74 75 72 6c 29 3b 0a 24 63 6f 6e 74 72 6f 6c 6c 65 72 2d 3e 72 6f 75 74 65 28 29 3b | $rooturl);.$controller->route(); |
d7c0 | 0a 7d d0 bd 18 6c 94 5d 64 e3 6e 5a e4 c9 cd f4 47 b3 1c 7c 85 88 02 00 00 00 47 42 4d 42 | .}...l.]d.nZ....G..|......GBMB |