function esi_block_install in ESI: Edge Side Includes 7.3
Implements hook_install().
File
- modules/
esi_block/ esi_block.install, line 35 - Install/Uninstall/Schema hooks for ESI Block.
Code
function esi_block_install() {
$schema = esi_block_schema_alter();
foreach ($schema['block']['fields'] as $field_name => $spec) {
db_add_field('block', $field_name, $spec);
}
// @TODO: iterate through the variable "esi_block_config" and push to the
// block table.
if ($old_configuration = variable_get('esi_block_config', array())) {
foreach ($old_configuration as $key => $config) {
// The key is $module_$delta...which unfortunately makes things slightly
// trickier...Is "esi_block_foo_bar" "esi":"block_foo_bar" or
// "esi_block":"foo_bar"? Hard to say!
// Remove the old variable once it's migrated.
variable_del('esi_block_config');
}
}
}