Welcome Guest, Not a member yet? Register   Sign In
Codeigniter not extending Image_lib [SOLVED]
#1

[eluser]Unknown[/eluser]
I have extended the core Image_lib with 2 methods, one new, one overriding a core method.

So, in my application/libraries folder, I have a file "My_Image_lib.php", which extends the library as follows:

Code:
class My_Image_lib extends CI_Image_lib
{    
    function resize_and_crop()
    {
        // Some code here
    }
    
    function image_reproportion()
    {
        // Some other code here
    }
}

This works beautifully locally (running on WAMP 2.1), but when I upload it to my server (I'm using siteground), I get the following error:

Fatal error: Call to undefined method CI_Image_lib::resize_and_crop() in /..whatever../application/models/process_image_model.php on line 26

It seems that Codeigniter is simply not loading my class that's extending the main one.
To verify, I tried:
Code:
get_class_methods($this->image_lib)
and it did not list my resize_and_crop method.

I thought I might have uploaded it wrong, but I've now gone ahead and deleted everything from the remote server, and re-uploaded it all.
To no avail.

Any help would be greatly appreciated.


SOLVED: Sorry for this. It was simply because I started my class/file names with "My" instead of "MY".
Although I have no idea why it worked locally.
#2

[eluser]danmontgomery[/eluser]
It worked locally because windows is case-insensitive, linux is not.




Theme © iAndrew 2016 - Forum software by © MyBB