cvs: phpruntests /src rtUtil.php

From: Date: Mon, 22 Jun 2009 07:56:12 +0000
Subject: cvs: phpruntests /src rtUtil.php
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-58881@lists.php.net to get a copy of this message
zoe Mon Jun 22 07:56:12 2009 UTC Modified files: /phpruntests/src rtUtil.php Log: replacing old versions for debug purposes http://cvs.php.net/viewvc.cgi/phpruntests/src/rtUtil.php?r1=1.5&r2=1.6&diff_format=u Index: phpruntests/src/rtUtil.php diff -u phpruntests/src/rtUtil.php:1.5 phpruntests/src/rtUtil.php:1.6 --- phpruntests/src/rtUtil.php:1.5 Mon Jun 22 02:17:17 2009 +++ phpruntests/src/rtUtil.php Mon Jun 22 07:56:12 2009 @@ -17,7 +17,7 @@ public static function getTestList($aDirectory) { $result = array(); - $result = glob($aDirectory. "/*.phpt"); + $result = glob($aDirectory. "/*.phpt"); return $result; } @@ -35,48 +35,77 @@ foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator($aDirectory)) as $directory) { $subDirectories[] = $directory->getPath() . "/"; } - + $subDirectoriesUnique = array_unique($subDirectories); - + $phptDirectories = array(); - + foreach ($subDirectoriesUnique as $subDir) { if(count(self::getTestList($subDir)) > 0) { $phptDirectories[] = $subDir; } } - + return $phptDirectories; } - - - /** - * just a test - * + + + /** + * just a test + * * @param $path * @return array - */ - public static function parseDir($path) { - - $list = array(); - - if (sizeof(glob($path."/*.phpt")) > 0) { - - $list[] = $path.'/'; - } - - foreach (scandir($path) as $file) { - - if (substr($file, 0, 1) != '.' && $file != 'CVS') { - - if (is_dir($path.'/'.$file)) { - - $list = array_merge($list, rtUtil::parseDir($path.'/'.$file)); - } - } - } - - return $list; - } + */ + public static function parseDir($path) { + + $list = array(); + + if (sizeof(glob($path."/*.phpt")) > 0) { + + $list[] = $path.'/'; + } + + foreach (scandir($path) as $file) { + + if (substr($file, 0, 1) != '.' && $file != 'CVS') { + + if (is_dir($path.'/'.$file)) { + + $list = array_merge($list, rtUtil::parseDir($path.'/'.$file)); + } + } + } + + return $list; + } + + /** + * This is the original version of getDirectoryList which uses PhptFilterIterator + */ + public static function getTestListOld($aDirectory) + { + $result = array(); + + foreach (new rtPhptFilterIterator(new RecursiveIteratorIterator(new RecursiveDirectoryIterator($aDirectory))) as $item) { + $result[] = $item->getPathname(); + } + + return $result; + } + + /** + * This is the original version of getDirectoryList which uses PhptFilterIterator + */ + public static function getDirectoryListOld($aDirectory) + { + $result = array(); + + foreach (new rtPhptFilterIterator(new RecursiveIteratorIterator(new RecursiveDirectoryIterator($aDirectory))) as $directory) { + $result[] = $directory->getPath() . "/"; + } + + return array_unique($result); + } + } ?>

« previous php.cvs (#58881) next »