PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » Database » MDB2 » Bug #3467

loadModule should use more flexible naming convention

Details

Request #3467loadModule should use more flexible naming convention
Submitted2005-02-14 17:16 UTC
Fromceefour at gauldong dot net
StatusClosed
PackageMDB2
PHP Version5.0.3
OSLinux, Apache 1.3.33
Roadmaps(Not assigned)

Comments

[2005-02-14 17:16 UTC] ceefour at gauldong dot net

Description:
------------
I noticed (again) that loadModule uses a (IMHO) weird way of "naming"
modules. First, it lowercases the module name. Then, it ucfirst()s the
name to load the file. And it "saves" the module instance using the
lowercased name. While I'm not against the lowercasing, the ucfirst-ing is
something that I'm not very proud of. It basically means it's impossible
to have a module named "DataType". It also violates the "standards", since
there's not such thing as "first-letter-capital-only" convention. What you
intended might be CamelCase, but ucfirst is not the solution. I think you
should change this behavior, and let the user correctly specifies the name
of the module, i.e.:

// module name must be specified exactly, case-sensitive
$mdb->loadModule('Extended');
// the "output" is lowercased
$mdb->extended->getAll(...);

This means $mdb->loadModule('extended') will produce a "cannot find module
'extended'" error. But I think the error is correct, since the module name
is "Extended".

[2005-02-22 09:53 UTC] smith at backendmedia dot com

This bug has been fixed in CVS.

In case this was a documentation problem, the fix will show up at the
end of next Sunday (CET) on pear.php.net.

In case this was a pear.php.net website problem, the change will show
up on the website in short time.

Thank you for the report, and for helping us make PEAR better.