You are here

function _hacked_restore_project in Hacked! 7.3

Restore core, module or theme.

1 string reference to '_hacked_restore_project'
_hacked_report_batch in ./hacked.helpers.inc
Compute the report data for hacked.

File

./hacked.helpers.inc, line 148
Contain list of helpers for the module.

Code

function _hacked_restore_project($project) {

  // TODO: restore core is unsupported now
  if ($project['name'] == 'drupal') {
    watchdog('hacked', 'Restore core is unsupported now');
    return TRUE;
  }
  _hacked_check_project($project);
  $project_dir = drupal_get_path($project['project_type'], $project['name']);
  if ($project_dir) {
    $tmp_project_dir = _hacked_get_temp_dir() . '/' . $project['name'];
    if (!_hacked_remove_directory($project_dir)) {
      watchdog('hacked', 'Can not remove project directory');
      return FALSE;
    }
    _hacked_copy_directory($tmp_project_dir, $project_dir);
    return TRUE;
  }
  else {
    watchdog('hacked', 'Can not get project directory: ' . $project['name']);
    return FALSE;
  }
}