diff --git a/gen-phpweb-sqlite-db.php b/gen-phpweb-sqlite-db.php index 0ef04b6..8005a8c 100644 --- a/gen-phpweb-sqlite-db.php +++ b/gen-phpweb-sqlite-db.php @@ -81,7 +81,7 @@ function scan($dir, $lang) 'control-structures.', 'language.', 'about.', 'faq.', 'features.', ); - + $count = 0; echo "Lang: $lang\n"; @@ -115,7 +115,7 @@ function scan($dir, $lang) if ($x !== false) { $keyword = substr($keyword, 0, $x); } - + // Skip PHP 4 domxml (book.domxml). It uses function. syntax, unlike book.dom if (0 === strpos($keyword, 'function.dom') && false === strpos($keyword, 'simplexml')) { continue; @@ -166,7 +166,7 @@ function scan($dir, $lang) } } closedir($d); - + echo "Added entries for $count files\n"; echo "\n"; } @@ -179,14 +179,11 @@ function scan_langs($root) if (!$d) { return; } - readdir($d); readdir($d); while (($f = readdir($d)) !== false) { - if ($f === '.svn') { - continue; - } - if ($f === '.git') { + if (strpos($f, '.') !== false) { continue; } + $file = $root . DIRECTORY_SEPARATOR . $f; if (is_dir($file)) { @@ -195,4 +192,3 @@ function scan_langs($root) } closedir($d); } -