root/keywords.php

Revision 2599, 1.0 kB (checked in by pmjones, 1 year ago)

converted tabs to 4-spaces

  • Property svn:executable set to *
Line 
1 <?php
2 /**
3 * Gets a list of files from a base directory.
4 * Recursively descends into subdirectories.
5 */
6 function getFileList($base, $dir = null)
7 {
8     if ($dir === null) {
9         $dir = $base;
10     }
11     
12     $list = array();
13     foreach (scandir($dir) as $name) {
14     
15         if (substr($name, 0, 1) == '.') {
16             // skip these files
17             continue;
18         }
19         
20         $result = "$dir/$name";
21         
22         if (is_dir($result)) {
23             // recurse into the subdirectory
24             $sub = getFileList($base, $result);
25             $list = array_merge($list, $sub);
26         } else {
27             // strip off the starting base point and slash
28             $pos = strlen($base) + 1;
29             $list[] = substr($result, $pos);
30         }
31     }
32     
33     asort($list);
34     return $list;
35 }
36
37 $cmd = 'svn propset svn:keywords "Id"';
38
39 passthru("$cmd ./trunk/Solar.php");
40
41 $base = './trunk/Solar/';
42 foreach (getFileList($base) as $name) {
43     $file = $base . $name;
44     passthru("$cmd $file");
45 }
46
47
Note: See TracBrowser for help on using the browser.