Skip to content
Snippets Groups Projects
Commit c0998d2f authored by Tim Steiner's avatar Tim Steiner
Browse files

Merging changes for ticket 620 into production

git-svn-id: file:///tmp/wdn_thm_drupal/branches/drupal-7.x/production@366 20a16fea-79d4-4915-8869-1ea9d5ebf173
parent 51993fae
Branches
Tags
No related merge requests found
Showing
with 896 additions and 198 deletions
<?php <?php
/**
* Enable the set up of multiple sites without making symbolics links.
* Instead, a few entries in .htaccess will be all that is needed.
*/
function unl_bootstrap() { function unl_bootstrap() {
$original_script_name = $_SERVER['SCRIPT_NAME']; $original_script_name = $_SERVER['SCRIPT_NAME'];
$php_file = basename($original_script_name); $php_file = basename($original_script_name);
...@@ -37,3 +41,28 @@ function unl_bootstrap() { ...@@ -37,3 +41,28 @@ function unl_bootstrap() {
conf_path(TRUE, TRUE); conf_path(TRUE, TRUE);
} }
/**
* This will be called during update.php's bootstrap to remove any
* shared table prefixes from the database config.
* This allows the same updates to be run on all sites, even if
* they would normally be applied to the same table.
*/
function unl_bootstrap_update() {
foreach ($GLOBALS['databases'] as $key1 => $databases) {
foreach ($databases as $key2 => $database) {
if ($key2 == 'slave') {
foreach ($database as $key3 => $slave) {
if (is_array($slave['prefix'])) {
$GLOBALS['databases'][$key1][$key2][$key3]['prefix'] = $slave['prefix']['default'];
}
}
}
else {
if (is_array($database['prefix'])) {
$GLOBALS['databases'][$key1][$key2]['prefix'] = $database['prefix']['default'];
}
}
}
}
}
...@@ -85,6 +85,8 @@ function update_prepare_d7_bootstrap() { ...@@ -85,6 +85,8 @@ function update_prepare_d7_bootstrap() {
// still being used. // still being used.
include_once DRUPAL_ROOT . '/includes/install.inc'; include_once DRUPAL_ROOT . '/includes/install.inc';
drupal_bootstrap(DRUPAL_BOOTSTRAP_CONFIGURATION); drupal_bootstrap(DRUPAL_BOOTSTRAP_CONFIGURATION);
require_once DRUPAL_ROOT . '/includes/unl_bootstrap.inc';
unl_bootstrap_update();
global $databases, $db_url, $db_prefix, $update_rewrite_settings; global $databases, $db_url, $db_prefix, $update_rewrite_settings;
if (empty($databases) && !empty($db_url)) { if (empty($databases) && !empty($db_url)) {
$databases = update_parse_db_url($db_url, $db_prefix); $databases = update_parse_db_url($db_url, $db_prefix);
......
// $Id: README.txt,v 1.46 2010/06/16 15:08:02 weitzman Exp $ // $Id: README.txt,v 1.52 2010/11/08 13:22:42 weitzman Exp $
DESCRIPTION DESCRIPTION
----------- -----------
...@@ -11,6 +11,21 @@ Drush core ships with lots of useful commands for interacting with code ...@@ -11,6 +11,21 @@ Drush core ships with lots of useful commands for interacting with code
like modules/themes/profiles/translations. Similarly, it runs update.php, executes sql like modules/themes/profiles/translations. Similarly, it runs update.php, executes sql
queries and DB migrations, and misc utilities like run cron or clear cache. queries and DB migrations, and misc utilities like run cron or clear cache.
REQUIREMENTS
------------
* To use drush from the command line, you'll need a CLI-mode capable PHP
binary. The minimum PHP version is 5.2.
* drush also runs on Windows; however, drush commands make use of
unix command line tools, so to use it effectively, you have to install
some of them, e.g. from GnuWin32 (http://gnuwin32.sourceforge.net/). More info
about Drush on Windows available at http://drupal.org/node/594744.
* Drush works with Drupal 5, Drupal 6 and Drupal 7. However, occasionally
recent changes to the most recent version of Drupal can introduce issues
with drush. On Drupal 5, drush requires update_status v5.x-2.5 or later
in order to use pm-updatecode. If you have an earlier version of update_status,
upgrade it via "drush dl update_status" before using pm-updatecode.
INSTALLATION INSTALLATION
------------ ------------
For Linux/Unix/Mac: For Linux/Unix/Mac:
...@@ -19,13 +34,12 @@ For Linux/Unix/Mac: ...@@ -19,13 +34,12 @@ For Linux/Unix/Mac:
2. Make the 'drush' command executable: 2. Make the 'drush' command executable:
$ chmod u+x /path/to/drush/drush $ chmod u+x /path/to/drush/drush
3. (Optional, but recommended:) To ease the use of drush, 3. (Optional, but recommended:) To ease the use of drush,
- create a link to drush in a directory that is in your $PATH, e.g.: - create a link to drush in a directory that is in your PATH, e.g.:
$ ln -s /path/to/drush/drush /usr/local/bin/drush $ ln -s /path/to/drush/drush /usr/local/bin/drush
OR OR
- create an alias to drush: - add the folder that contains drush to your PATH
$ alias drush='/path/to/drush/drush' PATH=$PATH:/path/to/drush
For example, if drush is in your home directory:
$ alias drush='~/drush/drush'
This goes into .profile, .bash_aliases or .bashrc in your home folder. This goes into .profile, .bash_aliases or .bashrc in your home folder.
NOTE: You must log out and then log back in again or re-load your bash NOTE: You must log out and then log back in again or re-load your bash
configuration file to apply your changes to your current session: configuration file to apply your changes to your current session:
...@@ -33,13 +47,39 @@ For Linux/Unix/Mac: ...@@ -33,13 +47,39 @@ For Linux/Unix/Mac:
NOTE FOR ADVANCED USERS NOTE FOR ADVANCED USERS
- If you want to run drush with a specific version of php, rather than the - If you want to run drush with a specific version of php, rather than the
one found by the drush command, you can instead create an alias that one found by the drush command, you can define an environment variable
executes the drush.php file directly: DRUSH_PHP that points to the php to execute:
$ alias drush='/path/to/php/php5 /path/to/drush/drush.php' export DRUSH_PHP=/usr/bin/php5
If you do this, to allow Drush to detect the number of available columns, OR
- If you want to exactly control how drush is called, you may define an alias
that executes the drush.php file directly and passes that path to drush:
$ alias drush='/path/to/php/php5 -d memory_limit=128M /path/to/drush/drush.php --php="/path/to/php/php5 -d memory_limit=128M"'
Note that it is necessary to pass the '--php' option to drush to define
how drush should call php if it needs to do so.
If you define an alias, to allow Drush to detect the number of available columns,
you need to add the line 'export COLUMNS' to the .profile file in your you need to add the line 'export COLUMNS' to the .profile file in your
home folder. home folder.
NOTE ON PHP.INI FILES
- Usually, php is configured to use separate php.ini files for the web server
and the command line. To see which php.ini file drush is using, run:
$ drush status
- Compare the php.ini that drush is using with the php.ini that the webserver is
using. Make sure that drush's php.ini is given as much memory to work with as
the web server is; otherwise, Drupal might run out of memory when drush
bootstraps it.
- Drush requires a fairly unrestricted php environment to run in. In particular,
you should insure that safe_mode, open_basedir, disable_functions and
disable_classes are empty.
- If drush is using the same php.ini file as the web server, you can create
a php.ini file exclusively for drush by copying your web server's php.ini
file to the folder $HOME/.drush or the folder /etc/drush. Then you may edit
this file and change the settings described above without affecting the
php enviornment of your web server. Alternately, if you only want to
override a few values, copy example.drush.ini from the "examples" folder
into $HOME/.drush or the folder /etc/drush and edit to suit. See comments
in example.drush.ini for more details.
4. Start using drush by running "drush" from your Drupal root directory. 4. Start using drush by running "drush" from your Drupal root directory.
(or, if you did not follow step 3, by running "/path/to/drush/drush" (or, if you did not follow step 3, by running "/path/to/drush/drush"
...@@ -50,6 +90,10 @@ For Linux/Unix/Mac: ...@@ -50,6 +90,10 @@ For Linux/Unix/Mac:
For Windows: For Windows:
- Follow step 1. Use drush by navigating to /path/to/drush - Follow step 1. Use drush by navigating to /path/to/drush
and running 'drush.bat'. and running 'drush.bat'.
- You have to install gzip, libarchive, tar and wget executables. Go to
http://gnuwin32.sourceforge.net/packages.html and install the packages.
Add the folder %ProgramFiles%\GnuWin32\bin to your PATH.
Documentation can be found at http://drupal.org/node/594744
- Whenever the documentation or the help text refers to - Whenever the documentation or the help text refers to
'drush [option] <command>' or something similar, 'drush' has to be replaced 'drush [option] <command>' or something similar, 'drush' has to be replaced
by 'drush.bat'. by 'drush.bat'.
...@@ -90,12 +134,19 @@ functions like cdd which whisks you to any directory in your drupal site. ...@@ -90,12 +134,19 @@ functions like cdd which whisks you to any directory in your drupal site.
Many commands support a --pipe option which returns machine readable output. See Many commands support a --pipe option which returns machine readable output. See
`drush pm-list --status=enabled --pipe` as an example `drush pm-list --status=enabled --pipe` as an example
Very intensive scripts can exhaust your available PHP memory. One remedy is to
just restart automatically using bash. For example:
while true; do drush search-index; sleep 5; done
EXAMPLES EXAMPLES
-------- --------
Inside the "examples" folder you will find some example files to help you Inside the "examples" folder you will find some example files to help you
get started with your drush configuration file (example.drushrc.php), get started with your drush configuration file (example.drushrc.php),
site alias definitions (example.aliases.drushrc.php) and drush commands site alias definitions (example.aliases.drushrc.php) and drush commands
(example.drush.inc). (sandwich.drush.inc). You will also see an example 'policy' file which
can be customized to block certain commands or arguments as your organization
needs.
DRUSHRC.PHP DRUSHRC.PHP
-------- --------
...@@ -115,7 +166,7 @@ your own. In fact, writing a drush command is no harder than writing simple ...@@ -115,7 +166,7 @@ your own. In fact, writing a drush command is no harder than writing simple
Drupal modules, since drush command files closely follow the structure of Drupal modules, since drush command files closely follow the structure of
ordinary Drupal modules. ordinary Drupal modules.
See example.drush.inc for light details on the internals of a drush command file. See sandwich.drush.inc for light details on the internals of a drush command file.
Otherwise, the core commands in drush are good models for your own commands. Otherwise, the core commands in drush are good models for your own commands.
You can put your drush command file in a number of places: You can put your drush command file in a number of places:
...@@ -130,20 +181,6 @@ You can put your drush command file in a number of places: ...@@ -130,20 +181,6 @@ You can put your drush command file in a number of places:
In any case, it is important that you end the filename with ".drush.inc", so In any case, it is important that you end the filename with ".drush.inc", so
that drush can find it. that drush can find it.
REQUIREMENTS
------------
* To use drush from the command line, you'll need a CLI-mode capable PHP
binary. The minimum PHP version is 5.2.
* drush also runs on Windows; however, drush commands make use of
unix command line tools, so to use it effectively, you have to install
some of them, e.g. from GnuWin32 (http://gnuwin32.sourceforge.net/). More info
about Drush on Windows available at http://drupal.org/node/594744.
* Drush works with Drupal 5, Drupal 6 and Drupal 7. However, occasionally
recent changes to the most recent version of Drupal can introduce issues
with drush. On Drupal 5, drush requires update_status v5.x-2.5 or later
in order to use pm-updatecode. If you have an earlier version of update_status,
upgrade it via "drush dl update_status" before using pm-updatecode.
FAQ FAQ
--- ---
Q: What does "drush" stand for? Q: What does "drush" stand for?
......
...@@ -21,8 +21,13 @@ ...@@ -21,8 +21,13 @@
case 7: case 7:
default: default:
$types = drush_cache_clear_types(); $types = drush_cache_clear_types();
// Check if the provided type ($type) is a valid cache type.
if ($type && !key_exists($type, $types)) {
return drush_set_error(dt("'!type' cache is not a valid cache type", array('!type' => $type)));
}
if ($type) { if ($type) {
drush_op('call_user_func', $types[$type]); drush_op($types[$type]);
drush_log(dt("'!name' cache was cleared", array('!name' => $type)), 'success'); drush_log(dt("'!name' cache was cleared", array('!name' => $type)), 'success');
} }
else { else {
...@@ -42,10 +47,21 @@ function drush_cache_clear_types() { ...@@ -42,10 +47,21 @@ function drush_cache_clear_types() {
'theme' => 'drush_cache_clear_theme_registry', 'theme' => 'drush_cache_clear_theme_registry',
'menu' => 'menu_rebuild', 'menu' => 'menu_rebuild',
'css+js' => 'drush_cache_clear_css_js', 'css+js' => 'drush_cache_clear_css_js',
'block' => 'drush_cache_clear_block',
); );
if (drush_drupal_major_version() >= 7) {
$types['registry'] = 'registry_update';
}
elseif (drush_drupal_major_version() == 6 && module_exists('autoload')) {
// TODO: move this to autoload module.
$types['registry'] = 'autoload_registry_update';
}
if (count(module_implements('node_grants'))) { if (count(module_implements('node_grants'))) {
$types['nodeaccess'] = 'node_access_rebuild'; $types['nodeaccess'] = 'node_access_rebuild';
} }
// Command files may customize $types as desired.
drush_command_invoke_all_ref('drush_cache_clear', $types);
return $types; return $types;
} }
...@@ -58,3 +74,11 @@ function drush_cache_clear_css_js() { ...@@ -58,3 +74,11 @@ function drush_cache_clear_css_js() {
drupal_clear_css_cache(); drupal_clear_css_cache();
drupal_clear_js_cache(); drupal_clear_js_cache();
} }
/**
* Clear the cache of the block output.
*/
function drush_cache_clear_block() {
cache_clear_all(NULL, 'cache_block');
}
This diff is collapsed.
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
* *
*/ */
function _drush_backend_batch_process($command = 'batch-process') { function _drush_backend_batch_process($command = 'batch-process') {
global $user;
$batch =& batch_get(); $batch =& batch_get();
if (isset($batch)) { if (isset($batch)) {
...@@ -34,9 +35,14 @@ function _drush_backend_batch_process($command = 'batch-process') { ...@@ -34,9 +35,14 @@ function _drush_backend_batch_process($command = 'batch-process') {
$finished = FALSE; $finished = FALSE;
while (!$finished) { while (!$finished) {
if ($user->uid) {
$data = drush_backend_invoke($command, array($batch['id'], '-u', $user->uid));
}
else {
$data = drush_backend_invoke($command, array($batch['id'])); $data = drush_backend_invoke($command, array($batch['id']));
}
$finished = drush_get_error() || !$data || ($data['context']['drush_batch_process_finished'] == TRUE); $finished = drush_get_error() || !$data || (isset($data['context']['drush_batch_process_finished']) && $data['context']['drush_batch_process_finished'] == TRUE);
} }
} }
} }
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
* *
*/ */
function _drush_backend_batch_process($command = 'batch-process') { function _drush_backend_batch_process($command = 'batch-process') {
global $user;
$batch =& batch_get(); $batch =& batch_get();
if (isset($batch)) { if (isset($batch)) {
...@@ -51,7 +52,12 @@ function _drush_backend_batch_process($command = 'batch-process') { ...@@ -51,7 +52,12 @@ function _drush_backend_batch_process($command = 'batch-process') {
$finished = FALSE; $finished = FALSE;
while (!$finished) { while (!$finished) {
if ($user->uid) {
$data = drush_backend_invoke($command, array($batch['id'], '-u', $user->uid));
}
else {
$data = drush_backend_invoke($command, array($batch['id'])); $data = drush_backend_invoke($command, array($batch['id']));
}
$finished = drush_get_error() || !$data || ($data['context']['drush_batch_process_finished'] == TRUE); $finished = drush_get_error() || !$data || ($data['context']['drush_batch_process_finished'] == TRUE);
} }
} }
......
<?php <?php
// $Id: environment_5.inc,v 1.10 2010/04/06 13:07:19 weitzman Exp $ // $Id: environment_5.inc,v 1.13 2010/11/10 02:55:41 weitzman Exp $
/** /**
* @file * @file
* Specific functions for a drupal 5 environment. * Specific functions for a drupal 5 environment.
...@@ -8,6 +8,15 @@ ...@@ -8,6 +8,15 @@
* is called from. * is called from.
*/ */
/**
* Return the list of modules required by drupal.
*
* We use that function name for onward compatibility with drupal 6 and 7.
*/
function drupal_required_modules() {
return array('block', 'filter', 'node', 'system', 'user', 'watchdog');
}
/** /**
* Get complete information for all available modules. * Get complete information for all available modules.
* *
...@@ -48,7 +57,7 @@ function drush_get_modules() { ...@@ -48,7 +57,7 @@ function drush_get_modules() {
function drush_check_module_dependencies($modules, $module_info) { function drush_check_module_dependencies($modules, $module_info) {
$status = array(); $status = array();
foreach ($modules as $key => $module) { foreach ($modules as $key => $module) {
$dependencies = $module_info[$module]->info['dependencies']; $dependencies = array_reverse($module_info[$module]->info['dependencies']);
$unmet_dependencies = array_diff($dependencies, array_keys($module_info)); $unmet_dependencies = array_diff($dependencies, array_keys($module_info));
if (!empty($unmet_dependencies)) { if (!empty($unmet_dependencies)) {
$status[$key]['error'] = array( $status[$key]['error'] = array(
...@@ -138,7 +147,7 @@ function drush_module_uninstall($modules) { ...@@ -138,7 +147,7 @@ function drush_module_uninstall($modules) {
* the form submit (such as admin_role) are completed. * the form submit (such as admin_role) are completed.
*/ */
function drush_system_modules_form_submit($active_modules) { function drush_system_modules_form_submit($active_modules) {
require_once('./'. drupal_get_path('module', 'system') .'/system.module'); require_once './'. drupal_get_path('module', 'system') .'/system.module';
$form_state = array('values' => array('status' => $active_modules)); $form_state = array('values' => array('status' => $active_modules));
drupal_execute('system_modules', $form_state); drupal_execute('system_modules', $form_state);
} }
......
<?php <?php
// $Id: environment_6.inc,v 1.9 2010/04/06 13:07:19 weitzman Exp $ // $Id: environment_6.inc,v 1.11 2010/09/10 19:58:06 weitzman Exp $
/** /**
* @file * @file
* Specific functions for a drupal 5 environment. * Specific functions for a drupal 6 environment.
* drush_include_engine() magically includes either this file * drush_include_engine() magically includes either this file
* or environment_X.inc depending on which version of drupal drush * or environment_X.inc depending on which version of drupal drush
* is called from. * is called from.
...@@ -41,7 +41,7 @@ function drush_get_modules() { ...@@ -41,7 +41,7 @@ function drush_get_modules() {
function drush_check_module_dependencies($modules, $module_info) { function drush_check_module_dependencies($modules, $module_info) {
$status = array(); $status = array();
foreach ($modules as $key => $module) { foreach ($modules as $key => $module) {
$dependencies = $module_info[$module]->info['dependencies']; $dependencies = array_reverse($module_info[$module]->info['dependencies']);
$unmet_dependencies = array_diff($dependencies, array_keys($module_info)); $unmet_dependencies = array_diff($dependencies, array_keys($module_info));
if (!empty($unmet_dependencies)) { if (!empty($unmet_dependencies)) {
$status[$key]['error'] = array( $status[$key]['error'] = array(
......
<?php <?php
// $Id: environment_7.inc,v 1.12 2010/03/17 20:33:25 weitzman Exp $ // $Id: environment_7.inc,v 1.16 2010/10/15 09:04:37 jonhattan Exp $
/** /**
* @file * @file
* Specific functions for a drupal 5 environment. * Specific functions for a drupal 7 environment.
* drush_include_engine() magically includes either this file * drush_include_engine() magically includes either this file
* or environment_X.inc depending on which version of drupal drush * or environment_X.inc depending on which version of drupal drush
* is called from. * is called from.
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
* Get complete information for all available modules. * Get complete information for all available modules.
* *
* @return * @return
* An array containing module info for all installed modules. * An array containing module info for all available modules.
*/ */
function drush_get_modules() { function drush_get_modules() {
return system_rebuild_module_data(); return system_rebuild_module_data();
...@@ -31,7 +31,7 @@ function drush_get_modules() { ...@@ -31,7 +31,7 @@ function drush_get_modules() {
function drush_check_module_dependencies($modules, $module_info) { function drush_check_module_dependencies($modules, $module_info) {
$status = array(); $status = array();
foreach ($modules as $key => $module) { foreach ($modules as $key => $module) {
$dependencies = $module_info[$module]->requires; $dependencies = array_reverse($module_info[$module]->requires);
$unmet_dependencies = array_diff(array_keys($dependencies), array_keys($module_info)); $unmet_dependencies = array_diff(array_keys($dependencies), array_keys($module_info));
if (!empty($unmet_dependencies)) { if (!empty($unmet_dependencies)) {
$status[$key]['error'] = array( $status[$key]['error'] = array(
...@@ -71,7 +71,7 @@ function drush_check_module_dependencies($modules, $module_info) { ...@@ -71,7 +71,7 @@ function drush_check_module_dependencies($modules, $module_info) {
function drush_module_dependents($modules, $module_info) { function drush_module_dependents($modules, $module_info) {
$dependents = array(); $dependents = array();
foreach ($modules as $module) { foreach ($modules as $module) {
$dependents = array_merge($dependents, array_keys($module_info[$module]->required_by)); $dependents = array_merge($dependents, drupal_map_assoc(array_keys($module_info[$module]->required_by)));
} }
return array_unique($dependents); return array_unique($dependents);
...@@ -119,6 +119,10 @@ function drush_system_modules_form_submit($active_modules) { ...@@ -119,6 +119,10 @@ function drush_system_modules_form_submit($active_modules) {
module_load_include('inc', 'system', 'system.admin'); module_load_include('inc', 'system', 'system.admin');
$form_state = array('values' => array('status' => $active_modules)); $form_state = array('values' => array('status' => $active_modules));
drupal_form_submit('system_modules', $form_state); drupal_form_submit('system_modules', $form_state);
// Because normally system_modules_submit would call this function if modules
// had been changed, in this case we are submitting the module form without
// any changes, so we need to clear caches manually.
drupal_flush_all_caches();
} }
/** /**
......
<?php
// $Id: site_install_6.inc,v 1.1 2010/11/28 14:45:04 weitzman Exp $
/**
* Install Drupal 6.x
*/
function drush_core_site_install_version($profile) {
if (is_null($profile)) {
$profile = 'default';
}
$drupal_root = drush_get_context('DRUSH_DRUPAL_ROOT');
$phpcode = _drush_site_install6_cookies($profile). ' include("'. $drupal_root .'/install.php");';
drush_shell_exec('php -r %s', $phpcode);
$cli_output = drush_shell_exec_output();
$cli_cookie = end($cli_output);
$phpcode = _drush_site_install6_cookies($profile, $cli_cookie). ' $_GET["op"]="start"; include("'. $drupal_root .'/install.php");';
drush_shell_exec('php -r %s', $phpcode);
$phpcode = _drush_site_install6_cookies($profile, $cli_cookie). ' $_GET["op"]="do_nojs"; include("'. $drupal_root .'/install.php");';
drush_shell_exec('php -r %s', $phpcode);
$phpcode = _drush_site_install6_cookies($profile, $cli_cookie). ' $_GET["op"]="finished"; include("'. $drupal_root .'/install.php");';
drush_shell_exec('php -r %s', $phpcode);
$account_pass = drush_get_option('account-pass', 'admin');
$phpcode = _drush_site_install6_cookies($profile, $cli_cookie);
$phpcode .= '
$_POST = array (
"site_name" => "'. drush_get_option('site-name', 'Site-Install') .'",
"site_mail" => "'. drush_get_option('site-mail', 'admin@example.com') .'",
"account" => array (
"name" => "'. drush_get_option('account-name', 'admin') .'",
"mail" => "'. drush_get_option('account-mail', 'admin@example.com') .'",
"pass" => array (
"pass1" => "'. $account_pass .'",
"pass2" => "'. $account_pass .'"
)
),
"date_default_timezone"=>"0",
"clean_url"=>'. drush_get_option('clean-url', TRUE) .',
"form_id"=>"install_configure_form",
"update_status_module" => array("1"=>"1")
);
include("'. $drupal_root .'/install.php");';
drush_shell_exec('php -r %s', $phpcode);
}
/**
* Utility function to grab/set current "cli cookie".
*
*/
function _drush_site_install6_cookies($profile, $cookie = NULL) {
$output = '$_GET=array("profile"=>"' . $profile . '", "locale"=>"' . drush_get_option('locale', 'en') . '", "id"=>"1"); $_REQUEST=&$_GET;';
$output .= 'define("DRUSH_SITE_INSTALL6", TRUE);$_SERVER["SERVER_SOFTWARE"] = NULL;';
if ($cookie) {
$output .= sprintf('$_COOKIE=unserialize("%s");', str_replace('"', '\"', $cookie));
}
else {
$output .= 'function _cli_cookie_print(){print(serialize(array(session_name()=>session_id())));}
register_shutdown_function("_cli_cookie_print");';
}
return $output;
}
\ No newline at end of file
<?php
// $Id: site_install_7.inc,v 1.2 2010/11/29 13:59:58 weitzman Exp $
/**
* Install Drupal 7+
*/
function drush_core_site_install_version($profile) {
if (is_null($profile)) {
$profile = 'standard';
}
define('MAINTENANCE_MODE', 'install');
require_once DRUPAL_ROOT . '/includes/install.core.inc';
$db_spec = drush_core_site_install_db_spec();
$account_pass = drush_get_option('account-pass', 'admin');
$settings = array(
'parameters' => array(
'profile' => $profile,
'locale' => drush_get_option('locale', 'en'),
),
'forms' => array(
'install_settings_form' => array(
$db_spec['driver'] => $db_spec,
),
'install_configure_form' => array(
'site_name' => drush_get_option('site-name', 'Site-Install'),
'site_mail' => drush_get_option('site-mail', 'admin@example.com'),
'account' => array(
'name' => drush_get_option('account-name', 'admin'),
'mail' => drush_get_option('account-mail', 'admin@example.com'),
'pass' => array(
'pass1' => $account_pass,
'pass2' => $account_pass,
),
),
'update_status_module' => array(
1 => TRUE,
2 => TRUE,
),
'clean_url' => drush_get_option('clean-url', TRUE),
),
),
);
drush_log(dt('Starting Drupal installation. This takes a few seconds ...'), 'ok');
install_drupal($settings);
}
\ No newline at end of file
<?php <?php
// $Id: update_5.inc,v 1.8 2009/12/06 12:53:38 weitzman Exp $ // $Id: update_5.inc,v 1.9 2010/11/10 02:55:41 weitzman Exp $
/** /**
* @file * @file
...@@ -80,7 +80,7 @@ function update_main() { ...@@ -80,7 +80,7 @@ function update_main() {
} }
} }
if (!drush_confirm(dt('Do you wish to run all pending updates?'))) { if (!drush_confirm(dt('Do you wish to run all pending updates?'))) {
drush_die('Aborting.'); drush_user_abort();
} }
$update_results = array(); $update_results = array();
......
<?php <?php
// $Id: update_6.inc,v 1.17 2010/04/12 14:37:10 weitzman Exp $ // $Id: update_6.inc,v 1.19 2010/12/01 15:53:15 jonhattan Exp $
/** /**
* @file * @file
* Update.php for provisioned sites. * Update.php for provisioned sites.
...@@ -335,7 +335,7 @@ function update_main_prepare() { ...@@ -335,7 +335,7 @@ function update_main_prepare() {
foreach ($themes as $theme) { foreach ($themes as $theme) {
unset($theme->status); unset($theme->status);
} }
drush_get_projects(); drush_get_extensions();
include_once './includes/batch.inc'; include_once './includes/batch.inc';
drupal_load_updates(); drupal_load_updates();
...@@ -403,7 +403,7 @@ function update_main() { ...@@ -403,7 +403,7 @@ function update_main() {
} }
} }
if (!drush_confirm(dt('Do you wish to run all pending updates?'))) { if (!drush_confirm(dt('Do you wish to run all pending updates?'))) {
drush_die('Aborting.'); drush_user_abort();
} }
// Proceed with running all pending updates. // Proceed with running all pending updates.
$operations = array(); $operations = array();
......
<?php <?php
// $Id: update_7.inc,v 1.26 2010/06/21 19:18:01 weitzman Exp $ // $Id: update_7.inc,v 1.29 2010/11/10 02:55:41 weitzman Exp $
/** /**
* @file * @file
* Update.php for provisioned sites. * Update.php for provisioned sites.
...@@ -187,10 +187,6 @@ function update_main_prepare() { ...@@ -187,10 +187,6 @@ function update_main_prepare() {
drush_errors_on(); drush_errors_on();
// Rescan and repopulate the system table to ensure we have a full picture
// of the platform.
drush_get_projects();
include_once DRUPAL_ROOT . '/includes/batch.inc'; include_once DRUPAL_ROOT . '/includes/batch.inc';
drupal_load_updates(); drupal_load_updates();
...@@ -238,7 +234,7 @@ function update_main() { ...@@ -238,7 +234,7 @@ function update_main() {
} }
if (!drush_confirm(dt('Do you wish to run all pending updates?'))) { if (!drush_confirm(dt('Do you wish to run all pending updates?'))) {
drush_die('Aborting.'); drush_user_abort();
} }
drush_update_batch($start); drush_update_batch($start);
...@@ -316,7 +312,6 @@ function drush_update_batch($start) { ...@@ -316,7 +312,6 @@ function drush_update_batch($start) {
function drush_update_finished($success, $results, $operations) { function drush_update_finished($success, $results, $operations) {
// Clear the caches in case the data has been updated. // Nothing to do here. All caches already cleared. Kept as documentation of 'finished' callback.
drupal_flush_all_caches();
} }
<?php
// $Id: field.drush.inc,v 1.7 2010/08/12 14:28:46 weitzman Exp $
/**
* @file
* Field API's drush integration
*/
/**
* Implementation of hook_drush_help().
*/
function field_drush_help($section) {
switch ($section) {
case 'drush:field-create':
return dt('Quickly create fields and instances for a given bundle.');
case 'drush:field-update':
return dt('Return URL for editing field.');
case 'drush:field-clone':
return dt('Clone a field and all of its instances.');
case 'drush:field-info':
return dt('View information about fields, field_types, widgets, etc.');
}
}
/**
* Implementation of hook_drush_command().
*/
function field_drush_command() {
$items['field-create'] = array(
'description' => 'Create fields and instances. Returns urls for field editing.',
'core' => array(7),
'drupal_dependencies' => array('field_ui'),
'arguments' => array(
'bundle' => 'Content type (for nodes). Name of bundle to attach fields to. Required.',
'field_spec' => 'Comma delimited triple in the form: field_name,field_type,widget_name. If widget_name is omitted, the default widget will be used. Separate multiple fields by space. If omitted, a wizard will prompt you.'
),
'options' => array(
'entity_type' => 'Type of entity (e.g. node, user, comment). Defaults to node.',
),
'examples' => array(
'drush field-create article' => 'Define new article fields via interactive prompts.',
'open `drush field-create article`' => 'Define new article fields and then open field edit form for refinement.',
'drush field-create article city,text,text_textfield subtitle,text,text_textfield' => 'Create two new fields.'
),
);
$items['field-update'] = array(
'description' => 'Return URL for field editing web page.',
'core' => array(7),
'drupal_dependencies' => array('field_ui'),
'arguments' => array(
'field_name' => 'Name of field that needs updating.',
),
'examples' => array(
'field-update comment_body' => 'Quickly navigate to a field edit web page.',
),
);
$items['field-delete'] = array(
'description' => 'Delete a field and its instances.',
'core' => array(7),
'arguments' => array(
'field_name' => 'Name of field to delete.',
),
'options' => array(
'bundle' => 'Only delete the instance attached to this bundle. If omitted, admin can choose to delete one instance or whole field.',
'entity_type' => 'Disambiguate a particular bundle from identically named bundles. Usually not needed.'
),
'examples' => array(
'field-delete city' => 'Delete the city field and any instances it might have.',
'field-delete city --bundle=article' => 'Delete the city instance on the article bundle',
),
);
$items['field-clone'] = array(
'description' => 'Clone a field and all its instances.',
'core' => array(7),
'arguments' => array(
'source_field_name' => 'Name of field that will be cloned',
'target_field_name' => 'Name of new, cloned field.',
),
'examples' => array(
'field-clone tags labels' => 'Copy \'tags\' field into a new field \'labels\' field which has same instances.',
'open `field-clone tags labels`' => 'Clone field and then open field edit forms for refinement.',
),
);
$items['field-info'] = array(
'description' => 'View information about fields, field_types, and widgets.',
'drupal_dependencies' => array('field_ui'),
'core' => array(7),
'arguments' => array(
'type' => 'Recognized values: fields, types. If omitted, a choice list appears.',
),
'examples' => array(
'field-info types' => 'Show a table which lists all field types and their available widgets',
),
);
return $items;
}
function drush_field_create($bundle) {
$entity_type = drush_get_option('entity_type', 'node');
$args = func_get_args();
array_shift($args);
if (empty($args)) {
// Just one item in this array for now.
$args[] = drush_field_create_wizard();
}
// Iterate over each field spec.
foreach ($args as $string) {
list($name, $type, $widget) = explode(',', $string);
$info = field_info_field($field_name);
if (empty($info)) {
// Field does not exist already. Create it.
$field = array(
'field_name' => $name,
'type' => $type,
);
drush_op('field_create_field', $field);
}
// Create the instance.
$instance = array(
'field_name' => $name,
'entity_type' => $entity_type,
'bundle' => $bundle,
);
if ($widget) {
$instance['widget'] = array('type' => $widget);
}
drush_op('field_create_instance', $instance);
$urls[] = url(_field_ui_bundle_admin_path($entity_type, $bundle) . '/fields/' . $name, array('absolute' => TRUE));
}
drush_print(implode(' ', $urls));
}
function drush_field_update($field_name) {
$info = field_info_field($field_name);
foreach ($info['bundles'] as $entity_type => $bundles) {
foreach ($bundles as $bundle) {
$urls[] = url(_field_ui_bundle_admin_path($entity_type, $bundle) . '/fields/' . $field_name, array('absolute' => TRUE));
}
}
drush_print(implode(' ', $urls));
}
function drush_field_delete($field_name) {
$info = field_info_field($field_name);
$confirm = TRUE;
if (!$bundle = drush_get_option('bundle')) {
foreach ($info['bundles'] as $entity_type => $bundles) {
foreach ($bundles as $bundle) {
$all_bundles[] = $bundle;
}
}
if (count($bundles) > 1) {
$options = array_merge(array('all' => dt('All bundles')), drupal_map_assoc($bundles));
$bundle = drush_choice($options, dt("Choose a particular bundle or 'All bundles'"));
$confirm = FALSE;
}
else {
if (!drush_confirm(dt('Do you want to delete the %field_name field?', array('%field_name' => $field_name)))) {
return drush_log(dt('Aborting.'));
}
}
}
if ($bundle == 'all') {
foreach ($info['bundles'] as $entity_type => $bundles) {
foreach ($bundles as $bundle) {
$instance = field_info_instance($entity_type, $field_name, $bundle);
drush_op('field_delete_instance', $instance);
}
}
}
else {
$entity_type = drush_field_get_entity_from_bundle($bundle);
$instance = field_info_instance($entity_type, $field_name, $bundle);
drush_op('field_delete_instance', $instance);
}
// If there are no more bundles, delete the field.
$info = field_info_field($field_name);
if (empty($info['bundles'])) {
drush_op('field_delete_field', $field_name);
}
}
function drush_field_clone($source_field_name, $target_field_name) {
if (!$info = field_info_field($source_field_name)) {
return drush_set_error(dt('%source not found in field list.', array('%source' => $source_field_name)));
}
unset($info['id']);
$info['field_name'] = $target_field_name;
$target = drush_op('field_create_field', $info);
foreach ($info['bundles'] as $entity_type => $bundles) {
foreach ($bundles as $bundle) {
$instance = field_info_instance($entity_type, $source_field_name, $bundle);
$instance['field_name'] = $target_field_name;
unset($instance['id']);
$instance['field_id'] = $target['id'];
drush_op('field_create_instance', $instance);
$urls[] = url(_field_ui_bundle_admin_path($entity_type, $bundle) . '/fields/' . $target_field_name, array('absolute' => TRUE));
}
}
drush_print(implode(' ', $urls));
}
function drush_field_info($type = NULL) {
if (is_null($type)) {
$type = drush_choice(drupal_map_assoc(array('types', 'fields')), dt('Which information do you wish to see?'));
}
switch ($type) {
case 'fields':
$rows[] = array(
dt('Field name'),
dt('Field type'),
dt('Bundles'),
);
$info = field_info_fields();
foreach ($info as $field_name => $field) {
$bundle_strs = array();
foreach ($field['bundles'] as $entity_type => $bundles) {
$bundle_strs[] = implode(',', $bundles);
}
$rows[] = array(
$field_name,
$field['type'],
implode(' ', $bundle_strs),
);
}
break;
case 'types':
$rows[] = array(
dt('Field type'),
dt('Default widget'),
dt('Widgets'),
);
$info = field_info_field_types();
module_load_include('inc', 'field_ui', 'field_ui.admin');
$widgets = field_info_widget_types();
foreach ($info as $type_name => $type) {
$widgets = field_ui_widget_type_options($type_name);
$rows[] = array(
$type_name,
$type['default_widget'],
implode(', ', array_keys($widgets)),
);
}
break;
}
drush_print_table($rows, TRUE);
}
/**
* Prompt user enough to create basic field and instance.
*
* @return array $field_spec
* An array of brief field specifications.
*/
function drush_field_create_wizard() {
$specs[] = drush_prompt(dt('Field name'));
module_load_include('inc', 'field_ui', 'field_ui.admin');
$types = field_ui_field_type_options();
$field_type = drush_choice($types, dt('Choose a field type'));
$specs[] = $field_type;
$widgets = field_ui_widget_type_options($field_type);
$specs[] = drush_choice($widgets, dt('Choose a widget'));
return implode(',', $specs);
}
function drush_field_get_entity_from_bundle($bundle) {
if (drush_get_option('entity_type')) {
return drush_get_option('entity_type');
}
else {
$info = field_info_bundles();
foreach ($info as $entity_type => $bundles) {
if (isset($bundles[$bundle])) {
return $entity_type;
}
}
}
}
\ No newline at end of file
<?php <?php
// $Id: rsync.core.inc,v 1.2 2010/06/11 19:17:42 greg1anderson Exp $ // $Id: rsync.core.inc,v 1.7 2010/11/21 15:10:56 greg1anderson Exp $
/** /**
* Entrypoint for drush rsync. * Entrypoint for drush rsync.
...@@ -47,7 +47,7 @@ function drush_core_rsync($source, $destination, $additional_options = array()) ...@@ -47,7 +47,7 @@ function drush_core_rsync($source, $destination, $additional_options = array())
drush_print(dt("You will destroy data from !target and replace with data from !source", array('!source' => $source_path, '!target' => $destination_path))); drush_print(dt("You will destroy data from !target and replace with data from !source", array('!source' => $source_path, '!target' => $destination_path)));
if (!drush_confirm(dt('Do you really want to continue?'))) { if (!drush_confirm(dt('Do you really want to continue?'))) {
// was: return drush_set_error('CORE_SYNC_ABORT', 'Aborting.'); // was: return drush_set_error('CORE_SYNC_ABORT', 'Aborting.');
drush_die('Aborting.'); drush_user_abort();
} }
} }
...@@ -93,7 +93,7 @@ function drush_core_call_rsync($source, $destination, $additional_options = arra ...@@ -93,7 +93,7 @@ function drush_core_call_rsync($source, $destination, $additional_options = arra
foreach (array('include', 'exclude') as $include_exclude) { foreach (array('include', 'exclude') as $include_exclude) {
// Get the option --include-path or --exclude path and explode to an array of paths // Get the option --include-path or --exclude path and explode to an array of paths
// that we will translate into an --include or --exclude option to pass to rsync // that we will translate into an --include or --exclude option to pass to rsync
$inc_ex_path = explode(',', drush_get_option($include_exclude . '-path', '')); $inc_ex_path = explode(PATH_SEPARATOR, drush_get_option(array($include_exclude . '-path', $include_exclude . '-paths'), ''));
foreach ($inc_ex_path as $one_path_to_inc_ex) { foreach ($inc_ex_path as $one_path_to_inc_ex) {
if (!empty($one_path_to_inc_ex)) { if (!empty($one_path_to_inc_ex)) {
$options .= ' --' . $include_exclude . '="' . $one_path_to_inc_ex . '"'; $options .= ' --' . $include_exclude . '="' . $one_path_to_inc_ex . '"';
...@@ -191,7 +191,10 @@ function drush_core_call_rsync($source, $destination, $additional_options = arra ...@@ -191,7 +191,10 @@ function drush_core_call_rsync($source, $destination, $additional_options = arra
'skip-compress', 'skip-compress',
'filter', 'filter',
'exclude', 'exclude',
'exclude-from',
'include', 'include',
'include-from',
'files-from',
'address', 'address',
'port', 'port',
'sockopts', 'sockopts',
...@@ -209,9 +212,22 @@ function drush_core_call_rsync($source, $destination, $additional_options = arra ...@@ -209,9 +212,22 @@ function drush_core_call_rsync($source, $destination, $additional_options = arra
'out-format', 'out-format',
'protocol', 'protocol',
); );
// Check if the user has set $options['rsync-version'] to enable rsync legacy version support.
// Drush was written for rsync 2.6.9 or later, so assume that version if nothing was explicitly set.
$rsync_version = drush_get_option(array('rsync-version','source-rsync-version','target-rsync-version'), '2.6.9');
foreach ($rsync_available_options as $test_option) { foreach ($rsync_available_options as $test_option) {
$value = drush_get_option_override($additional_options, $test_option); $value = drush_get_option_override($additional_options, $test_option);
if (isset($value)) { // Downgrade some options for older versions of rsync
if ($test_option == 'remove-source-files') {
if (version_compare($rsync_version, '2.6.4', '<')) {
$test_option = NULL;
drush_log('Rsync does not support --remove-sent-files prior to version 2.6.4; some temporary files may remain undeleted.', 'warning');
}
elseif (version_compare($rsync_version, '2.6.9', '<')) {
$test_option = 'remove-sent-files';
}
}
if ((isset($test_option)) && (isset($value))) {
if ($value === TRUE) { if ($value === TRUE) {
$options .= " --$test_option"; $options .= " --$test_option";
} }
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
* using `drush script scratch.php`. That command will bootstrap your drupal * using `drush script scratch.php`. That command will bootstrap your drupal
* site and then run the php below. * site and then run the php below.
* *
* The script command enables to store your script files wherever you wish and * The script command enables you to store your script files wherever you wish and
* will help you list all of them should you collection grow. See its help. * will help you list all of them should you collection grow. See its help.
* *
*/ */
......
<?php <?php
// $Id: site_install.drush.inc,v 1.4 2010/06/21 18:55:08 weitzman Exp $ // $Id: site_install.drush.inc,v 1.12 2010/11/28 14:45:04 weitzman Exp $
// Perform setup tasks for installation. // Perform setup tasks for installation.
function drush_core_pre_site_install() { function drush_core_pre_site_install() {
...@@ -9,8 +9,15 @@ function drush_core_pre_site_install() { ...@@ -9,8 +9,15 @@ function drush_core_pre_site_install() {
return; return;
} }
// TODO: not needed?
$sites_subdir = drush_get_option('sites-subdir', 'default'); if ($sites_subdir = drush_get_option('sites-subdir')) {
// Needed so that we later bootstrap into the right site.
drush_set_option('uri', $sites_subdir);
}
else {
$sites_subdir = 'default';
}
$conf_path = "sites/$sites_subdir"; $conf_path = "sites/$sites_subdir";
$files = "$conf_path/files"; $files = "$conf_path/files";
$settingsfile = "$conf_path/settings.php"; $settingsfile = "$conf_path/settings.php";
...@@ -41,8 +48,11 @@ function drush_core_pre_site_install() { ...@@ -41,8 +48,11 @@ function drush_core_pre_site_install() {
drush_set_error(dt('Failed to copy sites/default/default.settings.php to @settingsfile', array('@settingsfile' => $settingsfile))); drush_set_error(dt('Failed to copy sites/default/default.settings.php to @settingsfile', array('@settingsfile' => $settingsfile)));
return; return;
} }
elseif (drush_drupal_major_version() == 6) {
// On D6, we have to write $db_url ourselves. On D7+, the installer does it.
file_put_contents($settingsfile, "\n" . '$db_url = \'' . drush_get_option('db-url') . "';\n", FILE_APPEND);
}
} }
// Add a files dir if needed // Add a files dir if needed
if (!file_exists($files)) { if (!file_exists($files)) {
...@@ -58,61 +68,61 @@ function drush_core_pre_site_install() { ...@@ -58,61 +68,61 @@ function drush_core_pre_site_install() {
return; return;
// Drop and create DB if needed. // Drop and create DB if needed.
// TODO: support db-su like sql sync. // @TODO: support db-su like sql sync.
// Can't use drush_sql_query() since might not have a DB. // Can't use drush_sql_query() since might not have a DB.
$exec = 'mysql ' . _drush_sql_get_credentials($db_spec); // Get credentials to connect to the server, but not the database which we
// Strip DB name from credentials. Soon it won't exist anymore. We do // are about to DROP.
// need a DB name to connect to so use built-in mysql DB.
$replacement_db = 'information_schema'; // Save the database name before we unset() it.
// Make sure we are only replacing the database name, $db_name = $db_spec['database'];
// and not a username or password that is the same as the database name. $scheme = _drush_sql_get_scheme($db_spec);
$exec = str_replace(" {$db_spec['database']}", " {$replacement_db}", $exec) . ' -e '; $simulate = drush_get_context('DRUSH_SIMULATE');
if (drush_op('system', $exec . ' "DROP DATABASE IF EXISTS ' . $db_spec['database'] . '"') && !drush_get_context('DRUSH_SIMULATE')) {
drush_set_error(dt('Could not drop database: @name', array('@name' => $db_spec['database']))); if ($scheme === 'sqlite') {
// With SQLite, we don't DROP DATABASEs. Each database is in a single file,
// so we just remove the file. We also don't CREATE DATABASEs; it is created
// when SQLite attempts to open a database file which doesn't exist.
if (file_exists($db_spec['database']) && !$simulate) {
if (!unlink($db_spec['database'])) {
drush_set_error(dt('Could not drop database: @name', array('@name' => $db_name)));
}
}
// Nothing else to do for SQLite installations, so return.
return;
}
// _drush_sql_get_credentials() will set a default database according to
// the scheme if one is not set.
unset($db_spec['database']);
$credentials = _drush_sql_get_credentials($db_spec);
$scheme_command = $scheme;
switch ($scheme) {
case 'mysql':
$command_parameter_name = 'execute';
break;
case 'pgsql':
$scheme_command = 'psql';
$command_parameter_name = 'command';
break;
}
$execute = "$scheme_command $credentials --$command_parameter_name";
if (drush_op('system', "$execute='DROP DATABASE IF EXISTS `$db_name`'") && !$simulate) {
drush_set_error(dt('Could not drop database: @name', array('@name' => $db_name)));
return; return;
} }
if (drush_op('system', $exec . '"CREATE DATABASE ' . $db_spec['database'] . '"') && !drush_get_context('DRUSH_SIMULATE')) { if (drush_op('system', "$execute='CREATE DATABASE `$db_name`'") && !$simulate) {
drush_set_error(dt('Could not create new database: @name', array('@name' => $db_spec['database']))); drush_set_error(dt('Could not create new database: @name', array('@name' => $db_name)));
return; return;
} }
} }
function drush_core_site_install($profile = 'standard') { // Command callback.
define('MAINTENANCE_MODE', 'install'); function drush_core_site_install($profile = NULL) {
require_once DRUPAL_ROOT . '/includes/install.core.inc'; drush_include_engine('drupal', 'site_install', drush_drupal_major_version());
drush_core_site_install_version($profile);
$db_spec = drush_core_site_install_db_spec();
$account_pass = drush_get_option('account-pass', 'admin');
$settings = array(
'parameters' => array(
'profile' => $profile,
'locale' => drush_get_option('locale', 'en'),
),
'forms' => array(
'install_settings_form' => $db_spec,
'install_configure_form' => array(
'site_name' => drush_get_option('site-name', 'Site-Install'),
'site_mail' => drush_get_option('site-mail', 'admin@example.com'),
'account' => array(
'name' => drush_get_option('account-name', 'admin'),
'mail' => drush_get_option('account-mail', 'admin@example.com'),
'pass' => array(
'pass1' => $account_pass,
'pass2' => $account_pass,
),
),
'update_status_module' => array(
1 => TRUE,
2 => TRUE,
),
'clean_url' => drush_get_option('clean-url', TRUE),
),
),
);
drush_log(dt('Starting Drupal installation. This takes 30 seconds or so ...'), 'ok');
install_drupal($settings);
} }
// Return a db_spec based on supplied db_url/db_prefix options or // Return a db_spec based on supplied db_url/db_prefix options or
......
<?php <?php
// $Id: sitealias.drush.inc,v 1.22 2010/04/22 17:57:40 weitzman Exp $ // $Id: sitealias.drush.inc,v 1.23 2010/11/28 04:50:54 greg1anderson Exp $
/** /**
* @file * @file
...@@ -103,6 +103,13 @@ function _drush_sitealias_user_specified_list() { ...@@ -103,6 +103,13 @@ function _drush_sitealias_user_specified_list() {
// If the user provided no args, then we will return everything. // If the user provided no args, then we will return everything.
else { else {
$site_list = _drush_sitealias_all_list(); $site_list = _drush_sitealias_all_list();
// Filter out the hidden items
foreach ($site_list as $site_name => $one_site) {
if (array_key_exists('#hidden', $one_site)) {
unset($site_list[$site_name]);
}
}
} }
return $site_list; return $site_list;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment