Project

General

Profile

« Previous | Next » 

Revision dd35ba62

Added by Andreas Kohlbecker over 11 years ago

removing drush command mire - it is no longer needed in D7

View differences:

.gitattributes
846 846
7.x/modules/cdm_dataportal/classes/footnotekey.php -text
847 847
7.x/modules/cdm_dataportal/classes/footnotemanager.php -text
848 848
7.x/modules/cdm_dataportal/classes/renderhints.php -text
849
7.x/modules/cdm_dataportal/drush/README -text
850
7.x/modules/cdm_dataportal/drush/migrate.drush.inc -text
851 849
7.x/modules/cdm_dataportal/ext_links/ext_links.info -text
852 850
7.x/modules/cdm_dataportal/ext_links/ext_links.js -text
853 851
7.x/modules/cdm_dataportal/ext_links/ext_links.module -text
7.x/modules/cdm_dataportal/drush/README
1
This folder contains the drush command:
2

  
3
migrate-refresh
4

  
5
Refresh the drupal site by reloading all modules [ module_list(TRUE) ] and then all themes [ list_themes(TRUE); ] . This will
6
update the database with the server specific path to the themes and modules. Use this command after migrating to a different
7
server via sql dump, before opening any page.
8

  
9
Usage notes:
10

  
11
After restoring a dump from a remote server on a different machine the paths to the modules and themes in the drupal database are
12
pointing to locations invalid on the new server. Since this module is also affected by the messed up module paths the first step
13
always is to fix that path by re-enabling the cdm_dataportal module:
14

  
15
drush -r <path to the drupal root directory> -l <url of the dataportal site> pm-enable cdm_dataportal
16

  
17
e.g.:  drush -r /home/andreas/workspaces/www/Drupal5 -l http://127.0.0.1/cyprus/ pm-enable cdm_dataportal
18

  
19
Now drush can find the migrate command file and you can resfresh the installation:
20

  
21
drush -r <path to the drupal root directory> -l <url of the dataportal site> migrate-refresh
22

  
23
e.g.: drush -r /home/andreas/workspaces/www/Drupal5 -l http://127.0.0.1/cyprus/ migrate-refresh
7.x/modules/cdm_dataportal/drush/migrate.drush.inc
1
<?php
2
/**
3
 * @file
4
 *   Drush Migrate include file
5
 */
6

  
7
/**
8
 * @todo document this function.
9
 */
10
function migrate_drush_help($path, $arg) {
11
  switch ($path) {
12
    case 'drush:migrate-refresh':
13
      return dt('Refresh the drupal site by reloading all modules [ module_list(TRUE) ]'
14
        . ' and then all themes [ list_themes(TRUE); ] .'
15
        . ' This will update the database with the server specific path to the themes and modules.'
16
        . ' Use this command after migrating to a different server via sql dump,'
17
        . ' before opening any page.');
18
  }
19
}
20

  
21
/**
22
 * @todo document this function.
23
 */
24
function migrate_drush_command() {
25
  $items = array();
26

  
27
  $items['migrate-refresh'] = array(
28
    'description' => 'Refresh the drupal site by reloading all modules [ module_list(TRUE) ]'
29
       . ' and then all themes [ list_themes(TRUE); ] .'
30
       . ' This will update the database with the server specific path to the themes and modules.'
31
       . ' Use this command after migrating to a different server via sql dump,'
32
       . ' before opening any page.',
33
    'aliases' => array('mire'),
34
    'bootstrap' => DRUSH_BOOTSTRAP_DRUPAL_FULL,
35
  );
36

  
37
  return $items;
38
}
39

  
40
/**
41
 * @todo document this function.
42
 */
43
function drush_migrate_refresh() {
44
  drush_print("migrate-refresh");
45
  drush_invoke("cache-clear");
46
  $modules = module_implements($hook /* TODO Set this variable. */);
47
  drush_print(count($modules) . " modules loaded");
48
  $themes = list_themes(TRUE);
49
  drush_print(count($themes) . " available themes");
50
  drush_invoke("cache-clear");
51
}

Also available in: Unified diff