Skip to content

Fix bug where some directories were skipped #18

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 5 additions & 9 deletions gen-phpweb-sqlite-db.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ function scan($dir, $lang)
'control-structures.', 'language.',
'about.', 'faq.', 'features.',
);

$count = 0;
echo "Lang: $lang\n";

Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -166,7 +166,7 @@ function scan($dir, $lang)
}
}
closedir($d);

echo "Added entries for $count files\n";
echo "\n";
}
Expand All @@ -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) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be simply if ($f[0] === '.'), a . could exist in the reset of the filename.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could do this, however a dot is not a valid character in a language code.

continue;
}

$file = $root . DIRECTORY_SEPARATOR . $f;

if (is_dir($file)) {
Expand All @@ -195,4 +192,3 @@ function scan_langs($root)
}
closedir($d);
}