author | MattD <mattd@symbian.org> |
Thu, 01 Apr 2010 12:25:43 +0100 | |
branch | v5backport |
changeset 46 | db99fd9fcd1c |
parent 43 | 690b4f151c12 |
permissions | -rw-r--r-- |
43
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
1 |
<?php |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
2 |
function add_file_to_list($n,$nn){ |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
3 |
global $names,$nNames,$i; |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
4 |
if(!in_array($n,$names)){ |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
5 |
$names[$i]=$n; |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
6 |
$nNames[$i]=$nn; |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
7 |
$i++; |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
8 |
} |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
9 |
} |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
10 |
function add_file_to_list2($n,$nn){ |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
11 |
global $tnames,$tnNames,$u; |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
12 |
if(!in_array($n,$tnames)){ |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
13 |
$tnames[$u]=$n; |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
14 |
$tnNames[$u]=$nn; |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
15 |
$u++; |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
16 |
} |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
17 |
} |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
18 |
function renameFiles($path,$prefix,array $ext){ |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
19 |
$dr = opendir($path); |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
20 |
$names = array(); |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
21 |
$nNames = array(); |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
22 |
while (($file = readdir($dr)) !== false) { |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
23 |
if($file != "." && $file != "..") { |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
24 |
if(is_dir($path.'/'.$file)){ |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
25 |
renameFiles($path.'/'.$file,$prefix,$ext); |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
26 |
}else{ |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
27 |
if(in_array(strtolower(substr($file,strpos($file,'.')+1)),$ext)){ |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
28 |
if(strpos($file,$prefix)===false){ |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
29 |
rename($path.'/'.$file,$path.'/'.$prefix.$file); |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
30 |
//print $file.'=>'.$prefix.$file.'<br />'; |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
31 |
if(strtolower(substr($file,strpos($file,'.')+1))=='rsc'){ |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
32 |
add_file_to_list2($file,$prefix.$file); |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
33 |
} |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
34 |
add_file_to_list($file,$prefix.$file); |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
35 |
} |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
36 |
} |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
37 |
} |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
38 |
} |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
39 |
} |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
40 |
closedir($dr); |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
41 |
//print_r($names); |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
42 |
//print_r($nNames); |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
43 |
} |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
44 |
|
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
45 |
function replaceFileNameIn($path,$name,$nName,$ext){ |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
46 |
$dh = opendir($path); |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
47 |
while (($file = readdir($dh)) !== false) { |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
48 |
if($file != "." && $file != "..") { |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
49 |
if(is_dir($path.'/'.$file)){ |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
50 |
replaceFileNameIn($path.'/'.$file,$name,$nName,$ext); |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
51 |
}else{ |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
52 |
if(!in_array(strtolower(substr($file,strpos($file,'.')+1)),$ext)){ |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
53 |
$c = file_get_contents($path.'/'.$file); |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
54 |
foreach($name as $k=>$v){ |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
55 |
$c = preg_replace('^("|<)('.$name[$k].')^','$1'.$nName[$k].'$3',$c);//("|>) |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
56 |
} |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
57 |
//print '<i>'.$file.'</i><br><pre>'.$c.'</pre>'; |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
58 |
file_put_contents($path.'/'.$file,$c); |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
59 |
} |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
60 |
} |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
61 |
} |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
62 |
} |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
63 |
closedir($dh); |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
64 |
} |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
65 |
|
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
66 |
function replaceFileNames2In($path,$name,$nName,$ext,$prefix){ |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
67 |
Global $prefix; |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
68 |
$dh = opendir($path); |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
69 |
while (($file = readdir($dh)) !== false) { |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
70 |
if($file != "." && $file != "..") { |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
71 |
if(is_dir($path.'/'.$file)){ |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
72 |
replaceFileNames2In($path.'/'.$file,$name,$nName,$ext,$prefix); |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
73 |
}else{ |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
74 |
if(in_array(strtolower(substr($file,strpos($file,'.')+1)),$ext)){ |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
75 |
$c = file_get_contents($path.'/'.$file); |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
76 |
|
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
77 |
$t = preg_match_all('^TARGET\x20+((.*))\x0A^',$c,$matches); |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
78 |
//$c = preg_replace('^(TARGET\x20+)^ ','$1'.$prefix,$c);//add prefix to target name |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
79 |
|
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
80 |
if($t>0){ |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
81 |
//$matches[0]=null; |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
82 |
foreach($matches[1] as $k=>$v){ |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
83 |
if(preg_match('^'.$prefix.'^',$v)==0){ |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
84 |
if(strtolower(substr($v,strpos($v,'.')+1))=='dll'){ |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
85 |
$a = str_replace('.dll','.lib',$v); |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
86 |
add_file_to_list2($a,$prefix.$a); |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
87 |
} |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
88 |
add_file_to_list2($v,$prefix.$v); |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
89 |
} |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
90 |
} |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
91 |
} |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
92 |
|
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
93 |
foreach($name as $k=>$v){ |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
94 |
$c = preg_replace('^(\x2F|\x28|\x20|\x09)('.$name[$k].')^','$1'.$nName[$k].'$3',$c);//(\x20|\x29|\x0A|\x09) |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
95 |
} |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
96 |
//print '<i>'.$file.'</i><br><pre>'.$c.'</pre>'; |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
97 |
file_put_contents($path.'/'.$file,$c); |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
98 |
} |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
99 |
} |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
100 |
} |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
101 |
} |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
102 |
closedir($dh); |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
103 |
} |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
104 |
function replaceFileNames3In($path,$name,$nName,$ext){ |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
105 |
$dh = opendir($path); |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
106 |
while (($file = readdir($dh)) !== false) { |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
107 |
if($file != "." && $file != "..") { |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
108 |
if(is_dir($path.'/'.$file)){ |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
109 |
replaceFileNames3In($path.'/'.$file,$name,$nName,$ext); |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
110 |
}else{ |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
111 |
//if(in_array(strtolower(substr($file,strpos($file,'.')+1)),$ext)){ |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
112 |
$c = file_get_contents($path.'/'.$file); |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
113 |
//foreach($name as $k=>$v){ |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
114 |
//$c = preg_replace('^(\x2F|\x28|\x20|\x09)('.$name.')^','$1'.$nName,$c); |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
115 |
$c = str_replace($name,$nName,$c); |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
116 |
//} |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
117 |
//print '<i>'.$file.'</i><br><pre>'.$c.'</pre>'; |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
118 |
file_put_contents($path.'/'.$file,$c); |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
119 |
//} |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
120 |
} |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
121 |
} |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
122 |
} |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
123 |
closedir($dh); |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
124 |
} |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
125 |
|
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
126 |
function display_files($path){ |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
127 |
$dh = opendir($path); |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
128 |
while (($file = readdir($dh)) !== false) { |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
129 |
if($file != "." && $file != "..") { |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
130 |
if(is_dir($path.'/'.$file)){ |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
131 |
display_files($path.'/'.$file); |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
132 |
}else{ |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
133 |
$c = file_get_contents($path.'/'.$file); |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
134 |
print '<i>'.$file.'</i><br><pre>'.$c.'</pre>'; |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
135 |
} |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
136 |
} |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
137 |
} |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
138 |
} |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
139 |
|
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
140 |
//***** Used for storing edited files data **************************** |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
141 |
$names= array(); //original names |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
142 |
$nNames=array(); //edited names |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
143 |
$i=0; //number of edited files |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
144 |
|
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
145 |
$tnames= array(); //original target names |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
146 |
$tnNames=array(); //edited target names |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
147 |
$u=0; //number of edited files |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
148 |
|
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
149 |
//********************************************************************* |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
150 |
$root = 'sfr'; //source root |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
151 |
chdir($root); //change current working directory |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
152 |
//********************************************************************* |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
153 |
$folder_to_check_for_renamed_files = 'homescreensrv/hs_app_idlefw'; |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
154 |
$folder_to_rename = 'homescreensrv/hs_app_idlefw/'; |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
155 |
$prefix = 'hs_app_'; |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
156 |
$ext = array('h','cpp','inl','rss','loc','def','rh','hrh','lib','iby'); //extensions of the files that needs to be renamed. |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
157 |
$ext2 = array('inf','mmp'); //extensions for which method 2 is used to search and replace filenames in certain file. |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
158 |
|
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
159 |
|
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
160 |
/*************************************************************************************** |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
161 |
Renames all the files in specified folder if the extension is found in array $ext. |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
162 |
Edited files original names are stored in $names array, modified names in $nNames array. |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
163 |
*******************************************/ |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
164 |
renameFiles($folder_to_rename,$prefix,$ext); |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
165 |
|
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
166 |
/*************************************************************************************************** |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
167 |
This opens every file (if its extension is found in $ext array) located in specified folder and |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
168 |
searches for each edited file's original name and replaces with edited vesrion. |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
169 |
***************************************************************************/ |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
170 |
replaceFileNameIn($folder_to_check_for_renamed_files,$names,$nNames,$ext2); |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
171 |
|
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
172 |
/*********************************************************************************************** |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
173 |
This opens every file (if its extension is found in $ext2 array) located in specified folder and |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
174 |
searches for each edited file's original name and replaces with edited vesrion. |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
175 |
It alsoe adds prefix for 'TARGET' name |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
176 |
************************************************************************************/ |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
177 |
replaceFileNames2In($folder_to_check_for_renamed_files,$names,$nNames,$ext2,$prefix); |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
178 |
|
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
179 |
/******************************************************************************************************************************* |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
180 |
This opens every file if its extension is found in $ext array. |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
181 |
It attempts to replace all renamed TARGET files(e.g. homescreen.exe,aifw.dll) with names with prefix(e.g. hs_app_homescreen.exe); |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
182 |
*************************************************************************************/ |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
183 |
replaceFileNames3In($folder_to_check_for_renamed_files,$tnames,$tnNames,$ext); |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
184 |
|
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
185 |
print '<b>************************************************************************************************************************</b><br/>'; |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
186 |
foreach($names as $k=>$v){ |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
187 |
print '<i>'.$v.'</i> <b>=></b> <i>'.$nNames[$k].'</i><br>'; |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
188 |
} |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
189 |
|
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
190 |
print '<b>************************************************************************************************************************</b><br/>'; |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
191 |
foreach($tnames as $k=>$v){ |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
192 |
print '<i>'.$v.'</i> <b>=></b> <i>'.$tnNames[$k].'</i><br>'; |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
193 |
} |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
194 |
display_files($folder_to_check_for_renamed_files); |
690b4f151c12
Added folder hs_app_idlefw, files there have 'hs_app' prefix(content edited).
fdim
parents:
diff
changeset
|
195 |
?> |