Skip to content

Commit c7782d0

Browse files
committed
Fix bug where some directories were skipped
1 parent 0a3b669 commit c7782d0

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

gen-phpweb-sqlite-db.php

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ function scan($dir, $lang)
8181
'control-structures.', 'language.',
8282
'about.', 'faq.', 'features.',
8383
);
84-
84+
8585
$count = 0;
8686
echo "Lang: $lang\n";
8787

@@ -115,7 +115,7 @@ function scan($dir, $lang)
115115
if ($x !== false) {
116116
$keyword = substr($keyword, 0, $x);
117117
}
118-
118+
119119
// Skip PHP 4 domxml (book.domxml). It uses function. syntax, unlike book.dom
120120
if (0 === strpos($keyword, 'function.dom') && false === strpos($keyword, 'simplexml')) {
121121
continue;
@@ -166,7 +166,7 @@ function scan($dir, $lang)
166166
}
167167
}
168168
closedir($d);
169-
169+
170170
echo "Added entries for $count files\n";
171171
echo "\n";
172172
}
@@ -179,14 +179,11 @@ function scan_langs($root)
179179
if (!$d) {
180180
return;
181181
}
182-
readdir($d); readdir($d);
183182
while (($f = readdir($d)) !== false) {
184-
if ($f === '.svn') {
185-
continue;
186-
}
187-
if ($f === '.git') {
183+
if (strpos($f, '.') !== false) {
188184
continue;
189185
}
186+
190187
$file = $root . DIRECTORY_SEPARATOR . $f;
191188

192189
if (is_dir($file)) {
@@ -195,4 +192,3 @@ function scan_langs($root)
195192
}
196193
closedir($d);
197194
}
198-

0 commit comments

Comments
 (0)