deploy.inc 716 Bytes
Newer Older
1
2
3
<?php
// $Id$

4
$new_url = drush_get_option('site_url');
5
$old_url = drush_get_option('site_url', 'site');
6
7
8
9
10
11
12
13

/**
 * @file
 *   Handle site migration tasks for redeployed sites.
 *   This is primarily to handle the rename of the sites
 *   directories.
 */

14
drush_log(
15
  dt('Changed paths from sites/@old_url to sites/@new_url',
16
17
18
19
  array('@old_url' => $old_url, '@new_url' => $new_url)));

db_query("UPDATE {files} SET filepath=replace(filepath, 'sites/%', 'sites/%')", $old_url, $new_url);
db_query("UPDATE {users} SET picture = replace(picture, 'sites/%s', 'sites/%s')", $old_url, $new_url);
20
21
variable_set('file_directory_path', "sites/$new_url/files");
variable_set('file_directory_temp', "sites/$new_url/files/tmp");
22