function monolog_update_7100 in Monolog 7
Same name and namespace in other branches
- 6 monolog.install \monolog_update_7100()
Change the machine name of the "stream_handler" handler to "stream".
File
- ./
monolog.install, line 75 - Install, update, and uninstall functions for the Monolog module.
Code
function monolog_update_7100() {
$result = db_query('SELECT name, options FROM {monolog_profile}');
foreach ($result as $record) {
$options = unserialize($record->options);
foreach ($options['handlers'] as $handler_name => $handler_config) {
if ('stream_handler' == $handler_config['handler']) {
$options['handlers'][$handler_name]['handler'] = 'stream';
}
}
db_update('monolog_profile')
->fields(array(
'options' => serialize($options),
))
->condition('name', $record->name)
->execute();
}
}