CodeIgniter Forums

Full Version: autoload.php is not loaded in development config directory [solved]
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2

El Forum

[eluser]Zaher Ghaibeh[/eluser]
hi:
am using the new version 2.0.1
i have created a 'development' directory under the 'config' directory, i have included the following files :
1- config.php
2- database.php
3- autoload.php

the first two files loaded as normal but the third file (autoload) is not loaded at all ..

i have searched the user_guide but i didn't find which files can be loaded from subdirectory and which not ..
so is this a bug ?
or am doing something wrong ?
-------------------
for all of you check this link : http://alakkad.me/blog/codeigniter-environment/
and my second comment ..

thanks

El Forum

[eluser]Zaher Ghaibeh[/eluser]
according to one of the comment on this http://codeigniter.uservoice.com/forums/...f=comments .
the autoload.php
"Matthew Johnston
This doesn't work with the autoload config files. Not a huge problem but I would like all the config files to be loaded specific for the environment."
this is not a bug ...

but dont you think that autoload must work the same ??

El Forum

[eluser]Zaher Ghaibeh[/eluser]
i have just solve it Big Grin
edit your 'Loader.php' file and replace this line 976:
function _ci_autoloader()
{
include_once(APPPATH.'config/autoload'.EXT);
with this :
function _ci_autoloader()
{
if(file_exists(APPPATH.'config/'.ENVIRONMENT.'/autoload'.EXT)){
include_once(APPPATH.'config/'.ENVIRONMENT.'/autoload'.EXT);
}else{
include_once(APPPATH.'config/autoload'.EXT);
}

El Forum

[eluser]InsiteFX[/eluser]
You should not be editing any core files!

If you need to make changes you have to extend the CI core files!

Ask yourself this, what will happen to your modified loader.php file when you upgrade CodeIgniter?

Code:
class MY_Loader extends CI_Loader {

}
Place in application/core

InsiteFX

El Forum

[eluser]Zaher Ghaibeh[/eluser]
will your solution is far more better than mine, but dont you think they have to add it to the core ?
since 2.0.2 has added the ability to load constants.php from a development/production directory.

any way i will digg more to see how can i do it without editing the core ..

El Forum

[eluser]InsiteFX[/eluser]
Did you report it to the Reactor Team on Bitbucket?

If it's a BUG then it needs to be Report, I just Reported one.

I showed you how to do it above.

InsiteFX

El Forum

[eluser]Zaher Ghaibeh[/eluser]
my friend add it there as an enhancement i dont think its a bug since the feature is new ..

El Forum

[eluser]InsiteFX[/eluser]
This is the Enhancement I reported!

If you look at the CodeIgniter User Guide on the Config Class the whole document is backwards!

Code:
// this is wrong!
$this->config->load('filename');

// it should be like this!
$this->load->config('filename');

InsiteFX

El Forum

[eluser]Zaher Ghaibeh[/eluser]
thats good ..
nice catch ..

El Forum

[eluser]Zaher Ghaibeh[/eluser]
[quote author="InsiteFX" date="1302087834"]Did you report it to the Reactor Team on Bitbucket?

If it's a BUG then it needs to be Report, I just Reported one.

I showed you how to do it above.

InsiteFX[/quote]

i found this : https://bitbucket.org/ellislab/codeignit...59b4fe50d6 its look like they still need many code in the core
Pages: 1 2