CodeIgniter Forums
Library - class file was not found - How to track error - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Library - class file was not found - How to track error (/showthread.php?tid=53779)



Library - class file was not found - How to track error - El Forum - 08-08-2012

[eluser]sanguina[/eluser]
How do i go about tracking the message - "class file was not found"

For this particular case,

I am using PhPass library - pasted that in the libraries folder.
then I am calling it like this:

Code:
$this->load->library('phpass');
$password = $this->phpass->hash($password);

the library is definitely getting loaded (or else i would have a library not found error)

rather i am getting the error:

"class phpass not found."

I can clearly see the class defined in the aforesaid library but i still get this message.

Any suggestions, thanks Smile



Library - class file was not found - How to track error - El Forum - 08-08-2012

[eluser]sanguina[/eluser]
Sort of bumping this.. but I have taken all care for creating library

1) Used uppercase for file name & class name.
2) Created a file called Phpass.php in application/library
3) Phpass.php contains a class Phpass which has a method hash($password)

but these two lines:

Quote:$this->load->library('phpass');
$password = $this->phpass->hash($password);

still give the error:

Quote:The phpass class file was not found.


What am i doing wrong ?
stuck here for the last 4 hours - pls pls pls help


Library - class file was not found - How to track error - El Forum - 08-08-2012

[eluser]Aken[/eluser]
Not sure if you made a typo or not, but the library folder should be /application/libraries/ NOT library.

Check permissions to make sure the folder has read access.


Library - class file was not found - How to track error - El Forum - 08-09-2012

[eluser]sanguina[/eluser]
@Aken - thanks for replying - the actual folder is /application/libraries

I mentioned it wrong in this thread - my fault. But I am still stuck Sad

i am not onn my pc - but will do a class_exists check later and report. Anyother way ?

thanks once again


Library - class file was not found - How to track error - El Forum - 08-09-2012

[eluser]sanguina[/eluser]
Finally got it working: posting it here should some one get the same error.

You have to create a folder named vendor and add the library dependency there.
I had forgot to add this.



Library - class file was not found - How to track error - El Forum - 08-09-2012

[eluser]Aken[/eluser]
That's not required to create a simple library - must have something to do with the PHPass class, and any dependencies it needs. Just a clarification for those creating their own libraries.