Last updated February 21, 2013. Created by Orgun109uk on February 21, 2013.
Log in to edit this page.
Additional to the script files, theres a hook too allow a module to provide its own programatically generated restore script, using "hook_restore_scripts" and returning an array of restore scripts: Note that the properties of the operations required depends on the operation classes.
<?php
/**
* Implements hook_restore_scripts().
*/
function MY_MODULE_restore_scripts() {
$scripts = array();
$scripts['example_script_1'] = array(
// The title for the restore script.
'title' => 'MY MODULES SCRIPT #1',
// A description for the restore script.
'description' => 'The first restore script provided by MY MODULE.',
// An array of the operations, indexed by the operations classname.
'operations' => array(
// Some variables.
'RestoreVariableOperation' => array(
array(
'name' => 'some_random_variable_name',
'value' => 'a random value.',
),
array(
'name' => 'site_name',
'value' => 'The name of my site.',
),
array(
'name' => 'clean_urls',
'value' => TRUE,
),
),
),
);
$scripts['example_script_2'] = array(
);
return $scripts;
}
?>An example module is provided showing this usage, "restore_example_hook" in the module/examples folder.