Welcome Guest, Not a member yet? Register   Sign In
Autoloading of configs in cascade
#3

(This post was last modified: 07-22-2019, 09:29 AM by JoellSVK.)

(07-21-2019, 07:09 PM)kilishan Wrote: There's no solution for that exact situation at the moment. The simplest thing to do would be to make an empty class for each config file in the main application. Since config files are classes now they can extend the config files in the Common folder. If you need to add or modify things in the application config file, you can overwrite in that class file and it should all work just fine.

The other option is to create your own version of the config() function that handles that for you.

Thank You for your quick answer. I had the same idea with empty extending classes but still, I was looking for a better way how to handle it. Is possible to bypass it without editing framework files? I would make my own function but now I am still learning how the framework works. I was checking the flow and it seems config function is defined in common.php (what is not class) and it is called from bootstrap.php that is the same, it is not class so extending these two is not an option. After that, we have "get" function in Config class, that class can be extended but the framework will recognise extending it or how it can be done?

Thank You

Edit:// I was researching all day this topic and it seems from my point very hard to make something to bypass loading classes since they are used across framework in many places and also like mentioned in bootstrap and common as well. Maybe I am wrong and I was trying to extend core files but IDE doesn't like extending class by itself like it is written in the guide. Maybe someone can bring idea how to do it? Smile i am quite out of ideas now....
Reply


Messages In This Thread
Autoloading of configs in cascade - by JoellSVK - 07-21-2019, 01:32 PM
RE: Autoloading of configs in cascade - by JoellSVK - 07-21-2019, 11:39 PM



Theme © iAndrew 2016 - Forum software by © MyBB