From: <bug...@kr...> - 2010-01-06 21:13:56
|
http://bugzilla.krangcms.com/show_bug.cgi?id=44 Summary: Extend Krang::Conf with new directives in an addon Product: Krang Version: trunk Platform: PC OS/Version: Windows Status: NEW Severity: normal Priority: P3 Component: Code AssignedTo: Laz...@kr... ReportedBy: dka...@er... QAContact: kra...@li... This is a proposed enhancement to Krang::Conf that allows it to be subclassed in an addon to define new directives and block names that can be added to krang.conf, and accessible via pkg('Conf') object, alongside the like core krang conf directives. The changes to Krang.conf which were needed to allow this were minimal and not disruptive, consisting just of making the lexical package arrays, @VALID_DIRECTIVES and friends, into subs instead, and moving the two bare function calls in the file (_load() and _check()) into the import() method where they can in turn call subclass's methods. The challenging part of making this work was finding *all* the command-line scripts that have the "stock krang BEGIN block" that includes the line: # load Krang::Conf (don't need to load Krang here because we won't # be slinging elements) eval { require Krang::Conf }; } (note the hard-coded Krang::Conf package name -- d'oh!) and fixing those so they load the Conf pakage via Krang::ClassLoader instead, allowing the Addon system to get a crack at it: eval q{ use ClassLoader 'Conf' }; I'm still doing some final testing, but I wanted to make this patch available for anyone who's interested in reviewing it, and welcome feedback! -- Configure bugmail: http://bugzilla.krangcms.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA contact for the bug, or are watching the QA contact. |