Create intermediate class to access /system/config.php file

5 views
Skip to first unread message

Alexander Obuhovich

unread,
Sep 16, 2012, 6:55:49 AM9/16/12
to Development In-Portal
File /system/config.php is created during In-Portal installation and contains all core settings that are needed to be able to run In-Portal.
For example it contains database connection information. Then once connected to database In-Portal can get other settings from there.

This file very powerful, however code that uses it is scattered across the system. For example there is:
  • kUtil::parseVars method, that returns contents of that file as array (used each time)
  • some pieces of code in /core/kernel/startup.php file, that ensures default values for some settings, that might be missing (used each time)
  • some pieces of code in /core/install.php file, that ensures default values for some other settings, that might be missing (used during install)

I'm proposing to create kSystemConfig class, that can be accessed from everywhere (due his static nature) and will ensure that all settings have their default values and can be accessed properly.

P.S.
Constants, that are defined based on /system/config.php file contents, like SQL_DB, ADMIN_DIRECTORY can stay of course.


--
Best Regards,

http://www.in-portal.com
http://www.alex-time.com

Dmitry A.

unread,
Sep 16, 2012, 1:46:39 PM9/16/12
to in-por...@googlegroups.com
Sounds good Alex.

Please prepare the task for this in In-Portal 5.3.x

DA

Alexander Obuhovich

unread,
Sep 16, 2012, 2:03:32 PM9/16/12
to in-por...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages