Problem using own library.


I am getting the follow error when I try to use my own code library:

An Error Was Encountered

Unable to load the requested class: accountregistration

The Code I am using to call this Library is:

class register extends Controller {
     function register() {
         // Load Account Registration Library

The code in the library:

<?php if (!defined('BASEPATH')) exit("No direct script access allowed");
// User Registration, Activation, and Password Retrieval Library. This Library contains all the functions
// that are used in the previously mentioned areas.
// Last Updated: December 14th, 2007
class accountregistration {
    function accountregistration() {
        // Controller Class Load Shit HEre

The accountRegistration.php is located in: /system/application/libraries/accountRegistration.php

Any Ideas O.o?

Nevermind, I found my mistake lol..

What was it? Case of the class and the file?
Could you detail for the ones that had the same problem, thanks.

And welcome to this community!

hi, got same problem...

-class is within /application/libraries/Discogs.php (btw debugging on widnows machine so the case shouldn't be the problem)
- $this->load->library('Discogs');

class properly named inside (imo):
class Discogs

    private static function get_xml($id)

still getting "Unable to load the requested class: Discogs"

ok i found the thing...

i dont use default ci configuration my www folder looks like this:
|   +---config
|   +---controllers
|   +---css
|   +---errors
|   +---gfx
|   |   \---throbber
|   +---hooks
|   +---js
|   |   \---scriptaculous
|   +---language
|   +---libraries
|   +---models
|   \---views
|   \---drivers
|       +---mssql
|       +---mysql
|       +---mysqli
|       +---oci8
|       +---odbc
|       +---postgre
|       \---sqlite
|   +---czech
|   \---english

so i have $system_folder = "";

but ci fails to load any library within /application/libraries UNLESS i make blank php file with same name in /libraries - this is just ugly hack to pass the code in function _ci_load_class

been using $system_folder = ""; for a while with no problems so far..
so now... is it me or a bug?

[eluser]Michael Wales[/eluser]
I think it's just a result of your structure, like you mentioned.

I prefer to place the contents of the application directory at the webroot level as well as the index.php that CI places at it's root level. I then place the system directory one level above webroot and make the corresponding changes to index.php

This also allows me to run multiple sites off of the same CI codebase.

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.