Part of the EllisLab Network
   
 
Loader, line 766 - case of library names
Posted: 07 December 2006 05:40 AM   [ Ignore ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1739
Joined  06-23-2006

The ChangeLog for CI v1.5.1 (actually listed as v1.5.0.2 in the log) states that the case of a loaded class is now respected:

Added support for naming custom library files in lower or uppercase.

However, line 766 of Loader.php is still forcing to lowercase:

$class = strtolower($class);

Removing that line breaks CI due to case-swapping during the loading of the library.

I really want the case to be respected, so when I do this:

$this->load->library('My_Favorite_Library');


this gets assigned:

$this->My_Favorite_Library


rather than this:

$this->my_favorite_library

This is an issue because of PHP’s inconsistent case sensitivity between variables and function/class names. I guess Code Igniter was attempting to address this issue by defining a certain convention for loading libraries.

This changelog entry either needs to be removed or the issue addressed to avoid confusing newcomers to the framework.

 Signature 

Mac OS X 10.4.10, Apache 1.3.3, PHP 5.2.3, CodeIgniter 1.5.x., baby!

Profile
 
 
Posted: 07 December 2006 07:55 AM   [ Ignore ]   [ # 1 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1739
Joined  06-23-2006

UPDATE

After sleeping on this, I realized it’s talking about library files, not the name of the variable assigned.

Libraries are still assigned in lowercase.

 Signature 

Mac OS X 10.4.10, Apache 1.3.3, PHP 5.2.3, CodeIgniter 1.5.x., baby!

Profile
 
 
Posted: 07 December 2006 11:18 AM   [ Ignore ]   [ # 2 ]  
Grad Student
Rank
Total Posts:  82
Joined  05-26-2006

yeah, if you read the line you quoted from changelog, it means that now you can give the library name as either uppercase or lowercase its not an issue & the class name can be any case, it’ll be accepted, its just that it doesn’t say that it’ll keep the class name as it is when creating its object! wink thats still a problem, which I hope will be taken care of in next release! smile

Profile
 
 
Posted: 07 December 2006 11:21 AM   [ Ignore ]   [ # 3 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1739
Joined  06-23-2006

I’m glad there’s others requesting that feature.

 Signature 

Mac OS X 10.4.10, Apache 1.3.3, PHP 5.2.3, CodeIgniter 1.5.x., baby!

Profile
 
 
Posted: 07 December 2006 04:51 PM   [ Ignore ]   [ # 4 ]  
Grad Student
Rank
Total Posts:  82
Joined  05-26-2006
coolfactor - 07 December 2006 11:21 AM

I’m glad there’s others requesting that feature.

well, I don’t consider that as a feature but an oversight on Rick’s point(unless he has some good reasons) which should be fixed. smile

Profile
 
 
   
 
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 719, on June 06, 2008 10:16 AM
Total Registered Members: 66409 Total Logged-in Users: 28
Total Topics: 84746 Total Anonymous Users: 0
Total Replies: 454803 Total Guests: 229
Total Posts: 539549    
Members ( View Memberlist )
Newest Members:  captainredmuffquinodligtharttechsivamDjordjesammozzazodman23mbsaarchaicharibok