Take in example the following config:
array(
'key' => 'value',
'key2' => array(
'key' => '@@INJECT@@',
'key2' => 'value'
),
'key3' => '@@INJECT@@'
);
Then this array is converted to Zend_Config object
But I try to find a way to replace @@INJECT@@ with a specific value after converting Zend_Config object.
With a basic array, I use array_walk_recursive() to perform this task, but I do not find for Zend_Config object (and I don’t want to convert Zend_Config object to array).
You could roll your own recursive walker, something like this:
This iterates over the elements in the Zend_Config, recurses if it finds another Zend_Config, otherwise passes the current item to a callback function.
Then, for your callback you could do something like this to test the items and replace as necessary:
The output looks like this: