Solapas principales
Sep
20
2012

PROJECTO EN DRUPAL.ORG
https://drupal.org/project/drush
PÁGINA DE DRUSH
http://www.drush.org/resources
EJECUTABLE PARA SISTEMAS WINDOWS
http://drush.ws/drush_windows_installer
Pongo el texto original en inglés que viene con el paquete drush.
Código:
// $Id: README.txt,v 1.58 2010/12/24 19:04:35 weitzman Exp $ DESCRIPTION ----------- Drush is a command line shell and Unix scripting interface for Drupal. If you are unfamiliar with shell scripting, reviewing the documentation for your shell (e.g. man bash) or reading an online tutorial (e.g. search for "bash tutorial") will help you get the most out of Drush. Drush core ships with lots of useful commands for interacting with code 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. REQUIREMENTS ------------ * To use drush from the command line, you'll need a CLI-mode capable PHP binary. The minimum PHP version is 5.2. * Some drush commands run on Windows. We recommend you use a Unix-like OS (e.g Linux, OSX). If you must run Drush on Windows, you have to install Unix Tools 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 ------------ For Linux/Unix/Mac: 1. Untar the tarball into a folder outside of your web site (/path/to/drush) (e.g. if drush is in your home directory, ~/drush can be used for /path/to/drush) 2. Make the 'drush' command executable: $ chmod u+x /path/to/drush/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.: $ ln -s /path/to/drush/drush /usr/local/bin/drush OR - add the folder that contains drush to your PATH PATH=$PATH:/path/to/drush 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 configuration file to apply your changes to your current session: $ source .bashrc NOTE FOR ADVANCED USERS - If you want to run drush with a specific version of php, rather than the one found by the drush command, you can define an environment variable DRUSH_PHP that points to the php to execute: export DRUSH_PHP=/usr/bin/php5 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 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. (or, if you did not follow step 3, by running "/path/to/drush/drush" or navigating to /path/to/drush and running "./drush" ) If you have troubles, try using the -l and -r options when invoking drush. See below. For Windows: - Consider using on Linux/Unix/OSX using Virtualbox or other VM. Windows support is lacking. - Follow step 1. Use drush by navigating to /path/to/drush and running 'drush.bat'. - You have to install gzip, libarchive, tar, wget, ncurses, and less 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 'drush [option]
Ejecuta un comando de drush. Ejecute 'drush help [comando]' para visualizar ayuda especifica a dicho comando. Ejemplos: drush dl cck zen Descargar el módulo CCK y el tema Zen. drush --uri=http://example.com status Muestra el comando status para el sitio perteneciente a una instalación multisite example.com. drush help --pipe Genera la lista de comandos delimitada por espacios. Opciones: -r , --root= Directorio raiz de la instalación de Drupal que se va a utilizar (por defecto: directorio actual) -l , --uri= URI del sitio drupal que vamos a utilizar (necesaria solo en ambientes multisitios) -v, --verbose Muestra información extra durante la ejecución del comando. -d, --debug Muestra aún mas información, incluyendo mensajes internos. -q, --quiet Oculta toda salida (al ejecutar el comando en el shell). -y, --yes Asume "si' como respuesta a todas las preguntas. -s, --simulate Simula las acciones a realizar pero no ejecuta ninguna realmente. -i, --include Permite adicionar un listado de paths donde buscar comandos de drush. -c, --config Permite especificar que fichero de configuración vamos a utilizar. Consultar el ejemplo example.drushrc.php -u, --user Permite especificar el usuario con el que vamos a iniciar sesión. Puede ser un número o un nombre. -b, --backend Esconde la salida estandard y retorna solamente datos estructurados (solo se utiliza para uso interno). -p, --pipe Genera una representación compacta del comando para utilizarla en scripts. Comandos: help Imprime este mensaje de ayuda. Utilice --filter para especificar un comando en particular (e.g. --filter=pm) cron Ejecuta todos los hooks de cron. updatedb Ejecuta el proceso update.php desde la linea de comando. status Proporciona una vista general de la instalación actual de Drupal, si hubiera una (útil para confirmar si el sitio sobre el que se esta ejecutando los comandos de drush es el que nos interesa). script Ejecuta script(s) php. cache clear Borra todos los caches. watchdog show Muestra los mensajes de trazas (watchdog) recientes. Opcionalmente permite filtrar en base a un tipo determinado. watchdog delete Elimina todos los mensajes o solo aquellos de un tipo especifico. sync Sincroniza el árbol de Drupal desde o hacia otro servidor utilizando ssh y rsync. eval Evalua codigo php árbitrario después de iniciar (bootstrapping) Drupal. enable Habilita uno ó más módulos disable Deshabilita uno ó más módulos. unistall Desinstala uno ó más módulos. statusmodules Muestra el estado de los módulos (habilitados o deshabilitados). refresh Refresca la información sobre el status de actualización de los paquetes instalados. updatecode Actualiza el código del proyecto. update Actualiza el código del proyecto y aplica cualquier actualizacion requerida en la base de datos (update.php) info Muestra información sobre un proyecto. dl Descarga el core de Drupal y proyectos como CCK, Zen, etc. test mail Ejecuta todos los tests y envia los resultados por email al team. test clean Elimina las tablas y archivos remanentes de anteriores ejecuciones de test. sql conf Imprime los detalles de la conexión a la base de datos sql connect Imprime el comando mysql para conectarse a la base de datos sql dump Exporta la base de datos de drupal como un archivo SQL utilizando mysqldump sql query Ejecuta una cosulta contra la base de datos del sitio sql load Copia la base de datos hacia la base de datos del sitio.
En la nuevas versiones de drush he visto que habían bastantes problemas para instalar ..... Adjunto a este post un paquete comprimido con drush 6 & 7 comprobados en archlinux & debian funcionando perfecto.
Archivo:
- Inicie sesión para comentar
- 5607 lecturas