Note the upgraded forum! If you are experiencing issues logging in, you may need to reset your password which should send an email. If the email doesn't arrive, be sure to check your spam folder just in case.

Extend Core Config

edited March 2011 in Installation

i'm new with fuel and i'm hit:

i tried to improve the error handling and extended the system->core->config.php.
I created a new MY_Config.php which will be loaded perfectly.

BUT: Your page_router is one of the top-level loadings. The Constructor of the Page Router is requesting the sytem/core->config BEFORE My_config is loaded to overwrite some features.

Am i wrong? Can you show me a way out?

Thank you,



  • edited March 2011
    actually i think i'm wrong. :)

    Also i think this is not a fuel question. I tried to to extend the core->config.php file to overwrite the load(); function. But it wont recognize it.
  • edited 7:33PM
    ok.. i've found it.

    i changed the third_party->mX->config.php from:

    class MX_Config extends CI_Config


    class MX_Config extends MY_Config.


    when i create a controller in application->controller-> eg. welcome.php
    and i want to call it (, an error will thrown:

    "The configuration file fuel.php does not exist."

    after a little bit playing around with my error handler, i realized, fuel cms is searching the fuel.php in:


    why is that?
  • edited 7:33PM
    ok. next step. :)

    now it works, i needed to set $config['enable_hooks'] to FALSE;

    if i enable hooks, i cant create a own controller. is this possible?
  • edited 7:33PM
    What happens if you try extending it similar to how fuel/application/core/MY_Loader.php where you require your third party config or you could try adding it to the application/core directory but have your class extend MX_Config (not MX_Config extend your class). The MX_Config has modular separation code in it and is needed by FUEL, so make sure that is not altered.

    Also, FUEL needs the hooks set to TRUE because it uses a couple of them.
  • edited 7:33PM
    hey admin, ;)

    thank you for your response.
    i can't extend my_config in application/core to mx_config.

    but i can create - like you said - a config.php in third_party/fuel:

    class Fuel_Config extends MX_Config{}


    and then in application/core:

    require APPPATH."third_party/fuel/Config.php";
    class MY_Config extends Fuel_Config{

    // in this class i overwrite the load function()

    but with that i'll overwrite the load function from mx ->actually very bad :)


    If i enable the hooks and create a controller (like, fuel try to load the fuel config file the common way (application/config/fuel.php) - do you have any clue about that?
  • edited 7:33PM
    Could it be due to the configs load method being overwritten? You may need to merge your changes on top of what the MX_Config has. I had to do a similar thing with the MX classes to include some additional changes (e.g. the Loader class example above).
  • edited 7:33PM
    okay. i guess that's not possible. i only can extend the mx_config itself (Like your module_load) function (instead of parent::load i could do $this->loadCoreConfig).

    anyway. my real problem - missing fuel.php config file, when i try to create a page with a controller - is still present.

    if i remove the pre_controller() hook, my controller page will be loaded perfectly.
    still searching...
Sign In or Register to comment.