2009/2/23 The Editor <[email protected]>: > > This is how BOLTconfig is designed to work: local config.php files > first (config.php, 1 hierarchical, like config.forum.php, then > skin.php in skin folder), site.config second, default value third. > > To set in config.php: > > $BOLTconfig['field'] = 'value'; > $BOLTconfig['test']['one'] = 'value2'; > > Which will override In site.config > > field: value > test:one: value2 > > And you call in a function like tis > > $field = BOLTconfig('BOLTfield', 'default'); > $test['one'] = BOLTconfig('BOLTtest:one', 'default2'); > > By "backward", I only meant you had the purpose of BOLTconfig and > BOLTdefault reversed. If my suggested fix does not work well enough > we can try other approaches, but I would prefer to avoid anything that > disrupts existing functionality. That is, it's easier to add on to > BOLTconfig than to rework all the lines of code (and plugins) that use > BOLTconfig to use something different (BOLTdefault). > > Your suggestions are very much appreciated and respected. Happy to > continue working on this till we have something acceptable.
I did not think to utilise $BOLTconfig. This is actually quite nice! I implemented this solution for the ShowHide plugin: The function has a $defaults array for showhide defaults. Then it checks for $BOLTconfig['showhide'], then it merges the arrays $args (supplied parameters), $BOLTconfig['showhide'] and $defaults: $config = (is_array($BOLTconfig['showhide'])) ? $BOLTconfig['showhide'] : array(); $args = array_merge($defaults, $config, $args); That's all. No need to call BOLTconfig(), or the function I proposed. And the BOLTFshowhide() function $defaults do not need to be global. I think this si a good blueprint. What do you think? BTW: in engine.php lines 16-33 you don't need to call BOLTdefault(), as nothing has been set yet in any case, the script is just starting. BUT (different question this) I would like a different permanent error_reporing level. I need to see the normal php errors, and not have the screen just white! AND I have problems editing engine.php with my favourite text editor, as it screws it up!!! This has something to do with the utf code characters lines 1900... they look all weird in my editor... ~Hans --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "BoltWire" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/boltwire?hl=en -~----------~----~----~----~------~----~------~--~---
