Welcome Guest, Not a member yet? Register   Sign In
Library - class file was not found - How to track error
#1

[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
#2

[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
#3

[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.
#4

[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
#5

[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.
#6

[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.




Theme © iAndrew 2016 - Forum software by © MyBB