Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: 1.5.1
-
Fix Version/s: None
-
Component/s: Zend_Db
-
Labels:None
Description
Lines 239 and 240 of Zend_DB are:
$adapterName = strtolower($adapterNamespace . '_' . $adapter);
$adapterName = str_replace(' ', '', ucwords(str_replace('', ' ', $adapterName)));
This means that any database adapter that isn't in a camel case path structure cannot be loaded by the system. In most cases this isn't a problem however recently I worked on a project when there company initials where used as all upper case as their framework name.
As this is perfectly valid within PHP I think that the fact everything is strtolowered then ucworded is a bug or at the very least an annoyance that should be altered.
The workaround I'm currently using (and why this is only minor) is to symlink with the required case version. The autoloader is happy to load the class despite the case differences to the classname as function names, and so classnames, are case insensitive.
At current, this is not necessarily a bug. In fact, it is inline with the current coding standard on class & method nameing conventions. While this will be discussed within the next few months, it is important to know that the current coding standard states that Classes and Methods should NOT maintain their acronyms as all caps. Instead, acronyms should simply be treated as "Words" and proper care should be taken to only Cap "words" within a name to indicate word-separation.
So something like SomeXmlNode is correct, where SomeXMLNode is incorrect. If you were to translate this to a different word-separation scheme (like dashed lower), then you would be the correct version of "some-xml-node". The incorrect version would read as: "some-x-m-l-node".
We will discuss in the near future our stance on acronyms and camelCasing rules. But in the mean time, this is correct behavior for the current naming standard.
-ralph