Welcome Guest, Not a member yet? Register   Sign In
Placing libraries on subfolders
#1

[eluser]jiffier[/eluser]
Hi, I want to use jaxax library, and I've copied it under system/application/libraries/xajax_core.

If, from the controller, I do a

Code:
$this->load->library('xajax');

It won't work as it looks only inside system/application/libraries, and not under system/application/libraries/xajax_core, where xajax.php is located.
If I copy xajax.php in the main libraries folder, it won't find its required files, so I somehow need to set system/application/libraries/xajax_core in the include_path.
How can I do it? Or which is the most correct way of doing it?

Thanks a lot,
#2

[eluser]Michael Wales[/eluser]
This doesn't work?
Code:
$this->load->library('xajax_core/xajax');
#3

[eluser]jiffier[/eluser]
No, it then says:


Fatal error: Class 'xajax_core/xajax' not found in...

I've tried to create an empty class like this:

xajax_core/xajax.php:
Code:
<?php


class xajax{
    
}
?>

The only way to make it visible seems to be copying xajax.php into the main Libaries folder, and include it with:

Code:
$this->load->library('xajax');
#4

[eluser]Yorick Peterse[/eluser]
Did you check to see if the library name you are loading is exactly the same as the filename (without the .php) extension ?
#5

[eluser]jiffier[/eluser]
Yes, I doublechecked that. And if I move the file to the main Libraries directory, then it gets loaded.

Is there any way I can manually set the list of paths where C.I will look for classes?
#6

[eluser]TheFuzzy0ne[/eluser]
Could be an issue with your directory permissions. I'd suggest checking that the subdirectory permissions match those of the parent directory.
#7

[eluser]xwero[/eluser]
[quote author="jiffier" date="1242134477"]Is there any way I can manually set the list of paths where C.I will look for classes?[/quote]
No not at the moment. CI will look for libraries in the application/libraries and system/libraries directories.

But it's not a code problem. If a forward slash is found in the first parameter of the library the path will be separated from the filename.
#8

[eluser]jiffier[/eluser]
I have upgraded to 1.7.1 and it seems to work fine now, I was using 1.6.3. So, problem solved, great Smile

I have left jaxax in system/application/libraries/jaxax/

and I use

Code:
$this->load->library('jaxax/jaxax.php');

Thanks for the help!

--
Dani




Theme © iAndrew 2016 - Forum software by © MyBB