Welcome Guest, Not a member yet? Register   Sign In
How to call a library from a library

I've got one library in my system/application/libraries directory, and right now I can call another library, but I am forced to put the library in the system/libraries directory. I'd like to be able to have it in my application/libraries directory, and wondering what I can change to accomplish that. Here's what I have now:

$this->CI = get_instance();

[eluser]Thorpe Obazee[/eluser]
[quote author="skunkbad" date="1245401652"]

$this->CI =& get_instance();

Hmm... I had something else screwed up, because now it is working with my code

Don't forget the ampersand in there, otherwise I don't think you'll actually have the CodeIgniter super Object by reference. Instead you'd probably end up with a copy.

[eluser]Phil Sturgeon[/eluser]
The "&" only matters if you are using PHP 4. PHP 5 does this automatically I believe.

I think you're right, cause I tried (out of curiosuty) to get_instance without the & several times, but it never increased my memory usage

In PHP5, all objects are passed by reference.

I knew of this difference, php5 and php4 with the &. I think the issue was that I was reading the error incorrectly. It's all good now.

Theme © iAndrew 2016 - Forum software by © MyBB