Extend Core Config

edited March 2011 in Installation
Hey,

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,

webcam

Comments

  • 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 11:42PM
    ok.. i've found it.

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

    class MX_Config extends CI_Config

    to:

    class MX_Config extends MY_Config.

    --

    when i create a controller in application->controller-> eg. welcome.php
    and i want to call it (http://www.site.com/welcome), 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:

    "fuel/application/config/fuel.php"

    why is that?
  • edited 11:42PM
    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 11:42PM
    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 11:42PM
    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:

    require_once(APPPATH.'third_party/MX/Config.php');
    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 site.com/myPage), fuel try to load the fuel config file the common way (application/config/fuel.php) - do you have any clue about that?
  • edited 11:42PM
    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 11:42PM
    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.