Ticket #1713 (new New feature)
Config class refactoring
| Reported by: | vipsoft | Owned by: | vipsoft |
|---|---|---|---|
| Priority: | critical | Milestone: | 1.7.2 - Piwik 1.7.2 |
| Component: | Core | Keywords: | |
| Cc: | Sensitive: | no |
Description (last modified by vipsoft) (diff)
Increase abstraction and reduce runtime dependence on Zend Framework. This provides a more uniform interface for core and plugin developers.
That is:
- use Piwik_Config::getInstance() instead of Zend_Registry::get('config')
- use Piwik_Config::getInstance() instead of Piwik_Tracker_Config::getInstance()
Read individual setting or entire section:
$value = Piwik_Config::getInstance()->section['option']; $section = Piwik_Config::getInstance()->section;
Change individual setting or entire section:
Piwik_Config_Writer::getInstance()->section = $newSection; Piwik_Config_Writer::getInstance()->section['option'] = $value;
Split/move core/Config.ini.php into:
- Config/Abstract.php - base class
- Config.php - config reader; can set but does not save
- Config/Writer.php - config reader/writer; will save changes
Remove core/Config/Ini.php and core/Tracker/Config.php.
Impact:
- not backwards compatible because Zend_Config isn't used to represent array options
- 3rd party plugins affected: TBD
Must prevent recurrence of #1945. (Ideally, repair config.ini.php, perhaps by comparing against global.ini.auto-backup-before-update.php to isolate which General settings were actually custom.)
Change History
Note: See
TracTickets for help on using
tickets.
