Welcome Guest, Not a member yet? Register   Sign In
COREPATH not used for core-classes
#4

[eluser]DIY_Peter[/eluser]
Sorry, you're correct.

We used Phil Sturgeon’s autoload code

Code:
/*
| -------------------------------------------------------------------
|  Native Auto-load
| -------------------------------------------------------------------
|
| Nothing to do with config/autoload.php, this allows PHP autoload to work
| for base controllers and some third-party libraries.
|
*/
function __autoload($class)
{
    if (strpos($class, 'CI_') !== 0):
        @include_once( APPPATH . 'core/'. $class . EXT );
    endif;
}

But we defined a constant COREPATH so we can put the core files in a central location on the server.

Code:
function __autoload($class)
{
if(strpos($class, 'CI_') !== 0)
{
@include_once( COREPATH . 'core/'. $class . EXT );
}
}

This does not seem to work for the core classes that are loaded automaticaly.

Is there a way to use a central location for the core,library and helper files?
I want to be able to use the same classes from all my applications, without having to copy them each time I start a new application. This makes updating these files difficult because they are scattered all over my site.

For the libraries en helpers I now use a symbolic link so that the folder points to the central location, but i've got a feeling that's not the correct way to do it.
Can't find anything about this on the codeigniter site. Strange, because it seems like a common problem.


Messages In This Thread
COREPATH not used for core-classes - by El Forum - 09-11-2012, 04:43 AM
COREPATH not used for core-classes - by El Forum - 09-11-2012, 04:56 AM
COREPATH not used for core-classes - by El Forum - 09-11-2012, 06:15 AM
COREPATH not used for core-classes - by El Forum - 09-11-2012, 07:00 AM
COREPATH not used for core-classes - by El Forum - 09-11-2012, 07:08 AM
COREPATH not used for core-classes - by El Forum - 09-11-2012, 07:11 AM
COREPATH not used for core-classes - by El Forum - 09-11-2012, 07:52 AM



Theme © iAndrew 2016 - Forum software by © MyBB