Problem using own library.

#1
[eluser]Unknown[/eluser]
Hello,

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

Code:
An Error Was Encountered

Unable to load the requested class: accountregistration

The Code I am using to call this Library is:

Code:
class register extends Controller {
    
     function register() {
        
         parent::Controller();
        
         // Load Account Registration Library
         $this->load->library('accountregistration');
        
     }
}

The code in the library:

Code:
<?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?

#2
[eluser]Unknown[/eluser]
Nevermind, I found my mistake lol..

#3
[eluser]Grahack[/eluser]
And...?
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!

#4
[eluser]starenka[/eluser]
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):
Code:
class Discogs
{

    private static function get_xml($id)
    {

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

#5
[eluser]starenka[/eluser]
ok i found the thing...

i dont use default ci configuration my www folder looks like this:
Code:
+---application
|   +---config
|   +---controllers
|   +---css
|   +---errors
|   +---gfx
|   |   \---throbber
|   +---hooks
|   +---js
|   |   \---scriptaculous
|   +---language
|   +---libraries
|   +---models
|   \---views
+---cache
+---codeigniter
+---database
|   \---drivers
|       +---mssql
|       +---mysql
|       +---mysqli
|       +---oci8
|       +---odbc
|       +---postgre
|       \---sqlite
+---fonts
+---helpers
+---language
|   +---czech
|   \---english
+---libraries
+---logs
+---plugins
\---scaffolding
    +---images
    \---views

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?

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