Just a thought, but if the require_once statements for each config file at the start of Ignition.php were replaced with:
then developers could add their own config files to the folder and they would be auto loaded with app wide scope. An example of another config file could be templates.php which has constants for both the admin and public templates.
Other constants can be added to config.php of course but the above sticks with the concept of separating framework and app code. Any thoughts?
Ignition Modification
3 years ago
3 years ago
#1
3 years ago
#2
Hello,
Not sure but my 2 cents are it could open up to security risks.
Someone with more knowledge might be better to help with this question.
Dan
Not sure but my 2 cents are it could open up to security risks.
Someone with more knowledge might be better to help with this question.
Dan
3 years ago
#3
Hi Neil,
I like your idea and could be useful not only for configs but also for custom utility PHP functions.
Suggest you make a pull request or chat with DC in the live streams or on Skype for this suggested change to ignition.php.
I'd maybe only make this change:
I like your idea and could be useful not only for configs but also for custom utility PHP functions.
Suggest you make a pull request or chat with DC in the live streams or on Skype for this suggested change to ignition.php.
I'd maybe only make this change:
3 years ago
#4
One minor concern is io performance when traversing a lot of potentially nested files.
Seeing as Trongate focuses on speed, I’d rather a bootstrap script where you can include your configs as needed :)
Seeing as Trongate focuses on speed, I’d rather a bootstrap script where you can include your configs as needed :)
3 years ago
#5
I just don't know if it solves a real and legitimate problem. If somebody is determined to have lots of include files of their own then there's nothing to stop them from adding an 'include' statement or a 'require(_once)' statement.
EDIT: To be clear, what is being asked for here is that every single Trongate request goes through a process that involves the scanning of a directory, checking for files and potentially reading them. Whilst there is a potential for that kind of code in some places (for example, the Trongate Pages modules) - making that an integral part of every single page load is a deal breaker.
We have a framework that is approximately twenty times faster than Laravel and Symfony. That didn't happen by accident. We have to fight for every thousandth of a second.
EDIT: To be clear, what is being asked for here is that every single Trongate request goes through a process that involves the scanning of a directory, checking for files and potentially reading them. Whilst there is a potential for that kind of code in some places (for example, the Trongate Pages modules) - making that an integral part of every single page load is a deal breaker.
We have a framework that is approximately twenty times faster than Laravel and Symfony. That didn't happen by accident. We have to fight for every thousandth of a second.