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);
+    }
+
 }
 ?>



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to