Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unable to load class error #2210

Closed
hakimihamdan88 opened this issue Jan 29, 2013 · 11 comments
Closed

unable to load class error #2210

hakimihamdan88 opened this issue Jan 29, 2013 · 11 comments

Comments

@hakimihamdan88
Copy link

error php 5.2, no error on 5.3

i use $this->load->libraries('mark_zuckerburg'); in my controller

named as mark_zuckerburg.php in libraries contain
php <?php class Mark_Zuckerbug {}

@AkenRoberts
Copy link
Contributor

The class name needs to be in ucfirst() format, meaning only the first letter of the class is capitalized. CI's Loader class doesn't know to capitalize the Z.

class Mark_zuckerburg {}

@hakimihamdan88
Copy link
Author

since when? no problem 2 weeks ago

@AkenRoberts
Copy link
Contributor

Regarding the actual class name (not the filename), that's been the standard for a long time.

Recently, the file name itself has also been standardized to ucfirst() as well, which means the filename should match the class name. See related #1805 for some more info.

@hakimihamdan88
Copy link
Author

i see. thanks man

@narfbg
Copy link
Contributor

narfbg commented Jan 30, 2013

The filename requirement isn't set yet. However, I don't see how the class name could be a problem - writing stdclass and stdClass for example has never been a problem, so I'm pretty sure it's case-insensitive, just like the rest of PHP.

@hakimihamdan88
Copy link
Author

isn't set yet? so the problem is?

@narfbg
Copy link
Contributor

narfbg commented Jan 30, 2013

Ignore me, I thought you were talking about controllers, which probably will change to Ucfirst as well. So far this is only enforced for libraries.

@narfbg narfbg closed this as completed Jan 30, 2013
@hakimihamdan88
Copy link
Author

i wonder why the error only on php 5.2 ?

@AkenRoberts
Copy link
Contributor

I don't think it's related to PHP, because the Unable to load the requested class error happens when it can't find the file, not when instantiating the class. So it's probably a file system preference on your server.

@narfbg
Copy link
Contributor

narfbg commented Jan 30, 2013

Most likely - your webhost has 5.2 running on Linux (which is almost always is setup with a case-sensitive file system) and PHP 5.3 on your local machine running Windows (where both FAT* and NTFS are case-insensitive).

@hakimihamdan88
Copy link
Author

thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants