[eluser]TheFuzzy0ne[/eluser]
[quote author="Natebot" date="1243128293"]Could the validator load the CI config file to get the setting for subclass_prefix and use it to validate the class names and file names found in the libraries directory? In that way the validator is agnostic as to the case of the prefix but it just makes sure the class uses the same case. Maybe this validation behavior can be overridden by a config setting that tells the validator require the subclass_prefix to be capitialized, etc.[/quote]
Initially, I don't consider that a priority, but I have thought about it to some extent. I'm planning on having the validator running as a Web site primarily, just to help people new to CodeIgniter, or people who are interested in changing their code to fulfil the suggestions laid out in the PHP style guide. There will probably be a lot more tests that will be added over time, but when it's fully tested, I plan to create a PHP command line version, which will be able to run locally and traverse the directory structure, giving you a detailed report.
I've also been thinking about releasing a version based on [url="http://wapache.sourceforge.net/"]Wapache[/url], which will essentially allow you to run the Web site locally. I will add support for uploading and extracting a zip file, where the config file can be used to set the prefix, or it can be specified via a Web-based GUI inside Wapache. I have created a really simple Wapache app to test it, but I've yet to fully explore it and discover it's full potential.
Hopefully this all makes sense. It's been a very long day...
[quote author="Natebot" date="1243128293"]Maybe it can even issue a warning if there appears to be a prefix mismatch such as when a class is "FB_Controller extends Controller" and $config['subclass_prefix'] = "My_";[/quote]
At the moment, I plan for the system to make an educated guess at whether or not the class is prefixed. This only applies to libraries in this case, (as helpers don't have a class name, of course), so by checking to see if the class extends known existing core library should be enough to work out if there's a prefix. I assumed it was the de facto to make you're prefixes in uppercase, but maybe that's not such a smart assumption. In any case, as PHP is case insensitive, it certainly won't cause any problems.
[quote author="Colin Williams" date="1243129015"]The class name shouldn't be the issue (PHP is case insensitive). The file name is what's important, and it should be MY_Controller.php. The "MY_" is the prefix. Everything thereafter should follow the naming conventions.[/quote]
So, should class case be enforced by the validator, or simply ignored? The main idea is to help fix really obvious errors that can cause the loader problems - incorrect file case, class names not matching the file name, wrongly named constructors, and so on - but I thought I may as well incorporate the PHP style guide into that to, to hopefully promote consistency.