SQL username and passwords inside PHP file shouldn't be a problem, because the source is not uploaded. Only the output of the script. So, if the script doesn't print the username and password, there is no problem.
A text file inside the website directory containing passwords are dangerous. Never ever place those files inside the website root directory. Never! Banshee is designed to only have a single index.php and the images/javascripts/css inside the website root directory (the 'public' directory). The rest is safely stored below that directory.
Hiawatha can help you preventing access to those files. You can do that via the UrlToolkit:
UrlToolkit {
ToolkitID = protect_files
Match ^/path/to/file.txt DenyAccess
Match ^/path/to/directory/ DenyAccess
}
VirtualHost {
...
UseToolkit = protect_files
}
But this should only be seen as a work around for badly designed websites.