You are here

function highcharttable_rename_dir in HighchartTable 7

Rename a directory.

Parameters

string $old_name: Relative the Drupal root.

string $new_name: Relative to the Drupal root.

Return value

boolean TRUE on success, FALSE otherwise

1 call to highcharttable_rename_dir()
highcharttable_drush_download_libraries in drush/highcharttable.drush.inc
Command to download the Highcharts and HighchartTable libraries.

File

drush/highcharttable.drush.inc, line 128
Drush integration for HighchartTable.

Code

function highcharttable_rename_dir($old_name, $new_name) {
  if (is_dir($new_name) && drush_delete_dir($new_name, TRUE)) {
    drush_log(dt('The existing library directory @new_name was deleted.', array(
      '@new_name' => $new_name,
    )), 'notice');
  }
  if (drush_move_dir($old_name, $new_name, TRUE)) {
    drush_log(dt('The library directory was renamed to @new_name', array(
      '@new_name' => $new_name,
    )), 'notice');
    return TRUE;
  }
  drush_log(dt('The temporary library directory could not be renamed from @old_name to @new_name', array(
    '@old_name' => $old_name,
    '@new_name' => $new_name,
  )), 'error');
  return FALSE;
}