[eluser]Aken[/eluser]
To the original poster: Your problem is you are renaming a library you are trying to extend. If you want to extend the Session library, name your new file and class MY_Session, and load it with $this->load->library('session'); It is not a PHP version issue (though you will likely run into PHP version-related issues in other parts of CI, so you should still definitely upgrade).
There are recommended naming conventions you should use in CodeIgniter.
First, do not use the MY_ prefix unless you are extending a core or library class. It's just simpler that way (dig through the Loader library if you want to know why).
Second, the problems Frank has experimented with are related to case sensitivity in file names. When CI attempts to find a library file name, it searches for both
ucfirst($class) then
strtolower($class) versions. In his test, the first two working attempts resulted in a correct filename of My_Test.php, where the rest all had differences in case at some point.
What I do, and what I recommend:
- File names should consist of the MY_ prefix when extending a class, then a single capital letter and all lowercase / underscores.
Code:
MY_Session.php
MY_Form_validation.php
Users.php
Smarty_parser.php
- Class names should match the file name (for consistency). PHP is less anal about case sensitivity when it comes to loading class names, but it's still better.
- Load classes either fully lowercase or exactly matching the file name, without the MY_ prefix.
Code:
$this->library->load('session');
$this->library->load('Form_validation');
$this->library->load('Users');
$this->library->load('smarty_parser');