SlideShare a Scribd company logo
25 -27 April, 2014 http://camp2014.drupal.dn.ua
Drush - use full power
Alexander Schedrov
You can do it in CLI
Most helpful commands
Most helpful commands: Core
• cc - clear-
cache
• dl, en, dis,
pm-uninstall
• upwd
• uli
• make
• updb
• up
• upc
• image-flush
• vget, vset
• sql-dump
• sql-cli
• sql-sync
Most helpful commands: Contrib
Apache Solr
• solr-index
• solr-mark-all
• solr-delete-index
Registry Rebuild
• registry-
rebuild(rr)
Localization
Update
• l10n-update
• l10n-update-
refresh
• l10n-update-
status
Most helpful commands: Contrib
Features
• features-list(fl)
• features-diff(fd)
• features-revert(fr)
• features-revert-all(fr)
• features-update(fu)
• features-update-
all(fua)
Devel
• devel-reinstall (dre)
• fn-view(fnv)
• fn-hook(fnh, hook)
drush hook HOOK_NAME
allows to discover order of hooks
DRUPAL SHELL
Installation on Windows
• download drush. Using c:drush as location in this example
• install gzip, tar, wget command line binaries
• set PATH environment variables
c:drush;d:xamppphp;d:xamppmysqlbin;C:Program FilesGnuWin32bin
• MsysGit
https://drupal.org/node/594744
Installation on *nix
• download drush. Using home folder as location in this
example
• create symlink
!
https://drupal.org/node/1791676
sudo ln -s ~/drush/drush /usr/local/bin/drush
Configuration, code sync, sql
sync.
aliases.drushrc.php
$aliases['dev'] = array(
'root' => '~/Sites/drupal.dev',
);
!
!
drush @dev status
drush -r ~/Sites/drupal.dev/ status
!
drush ~/Sites/drupal.dev/#default status
aliases.drush.php:
$aliases['dev'] = array(
'root' => '~/Sites/blog',
'uri' => 'blog.dev',
);
$aliases['live'] = array(
'root' => '~/Sites/blog-live',
'uri' => 'blog-live.dev',
);
blog.aliases.drushrc.php:
drush @blog status
drush @blog.dev status
drush @blog.live status
$aliases['blog'] = array(
'site-list' => array('@dev', '@live'),
);
drush site-alias(sa)
SSH
$aliases['live'] = array(
'remote-host' => 'bitbucket.org',
'remote-user' => 'sanchiz',
'root' => '/var/www',
'uri' => 'default',
);
Important: remote server must have Drush
ssh-keygen
ssh-copy-id -i ~/.ssh/id_rsa.pub sanchiz@bitbucket.org
equals
drush dl drush_extras
drush pushkey @live
Remote host with special
configuration
$aliases['live'] = array(
'remote-host' => 'dev.project.de',
'remote-user' => 'dev_alex_sh',
'root' => '/home/dev_alex_sh/www',
'php' => '/usr/bin/php',
'path-aliases' => array(
'%drush-script' => '/home/dev_alex_sh/drush/
drush.php',
),
);
Code and database sync
If you do not use Git, this section for you =)
Code sync
$aliases['live'] = array(
'command-specific' => array(
'core-rsync' => array(
'exclude' => '*.sql',
'exclude' => '.svn',
'exclude' => '.git',
'exclude' => "sites/default/files/",
),
),
);
drush rsync(core-rsync) @live @dev --include-conf
!
drush rsync @live:sites/default/files @dev:sites/
default/files
Sql-sync
$aliases['live'] = array(
'path-aliases' => array(
'%dump-dir' => ‘/home/dev_alex_sh/dump’,
),
);
drush sql-sync @live @dev
!
drush sql-sync @live @dev --create-db
Selective sync
emails => user+%uid@localhost
passwords => password
drush sql-sync @live @dev --structure-tables-key=common
drushrc.php:
$options['structure-tables']['custom'] = array(
'cache',
'cache_*',
'search_*',
'watchdog'
);
drush sql-sync @live @dev --structure-tables-key=custom --no-cache=true
!
drush sql-sync @live @dev --sanitize
Sql-sync without Drush on
server
$aliases['live'] = array(
'databases' => array(
'default' =>
array(
'default' =>
array(
'driver' => 'mysql',
'username' => 'username',
'password' => 'password',
'port' => '',
'host' => '127.0.0.1',
'database' => 'live_database',
),
),
),
);
drush @live sql-conf --all --show=passwords
$aliases['live'] = array(
'remote-host' => 'dev.project.de',
'remote-user' => 'default_alex_sh',
'root' => '/home/default_alex_sh/www',
'php' => '/usr/bin/php',
'php-options' => '-d error_reporting="E_ALL^E_DEPRECATED"',
'variables' => array('mail_system' => array('default-system' => 'DevelMailLog')),
'databases' => array(
'default' =>
array(
'default' =>
array(
'driver' => 'mysql',
'username' => 'username',
'password' => 'password',
'port' => '',
'host' => '127.0.0.1',
'database' => 'live_database',
),
),
),
'path-aliases' => array(
'%drush-script' => '/home/default_alex_sh/drush/drush.php',
'%files' => '/home/default_alex_sh/www/sites/default/files',
'%drush' => '/home/default_alex_sh/drush',
'%dump-dir' => '/home/default_alex_sh/www/dump',
),
!
'command-specific' => array(
'core-rsync' => array(
'exclude' => '*.sql',
'exclude' => '.svn',
'exclude' => '.git',
'exclude' => "sites/default/files/",
),
),
!
'ssh-options' => '-p 2222',
);
Development
DRUSH make
What can drush make do?
• Download modules
• Clone modules from git
• Apply patches
• Download libraries
• Download core
core = 7.x
api = 2
!
; core
projects[drupal][version] = 7.23
!
; modules
projects[views][version] = 3.7
projects[views][subdir] = "contrib"
!
projects[views][version] = 3.7
projects[views][subdir] = "contrib"
projects[views][patch][] = "https://drupal.org/files/
views_join_condition_increment_5.patch"
!
projects[views][type] = module
projects[views][download][type] = git
projects[views][download][revision] = 6920ff71c0bf3a75fc769658ba0dabb42ffcd357
projects[views][download][branch] = 7.x-3.x
projects[views][subdir] = "contrib"
!
; libraries
libraries[ckeditor][download][type] = get
libraries[ckeditor][download][url] = "http://download.cksource.com/CKEditor/CKEditor/
CKEditor 4.3/ckeditor_4.3_full.zip"
!
libraries[colorbox][download][type] = get
libraries[colorbox][download][url] = "https://github.com/jackmoore/colorbox/archive/
master.zip"
drush make make_file.make --no-core
http://drushmake.me
Extensions Drush
• A .drush folder in your HOME folder.
• Anywhere in module
• Drupal's /drush or /sites/all/drush folders.
function usertools_drush_command() {
$items = array();
!
$items['last-registration'] = array(
'description' => 'Show last registration.',
'arguments' => array(
'role' => 'Specific role.',
),
'options' => array(
'count' => array(
'description' => 'Count rows.',
'example-value' => '5',
),
),
'examples' => array(
'drush utl admin --count=5' => 'Show the last 5 registrations of admin.',
),
'aliases' => array('utl'),
'bootstrap' => DRUSH_BOOTSTRAP_DRUPAL_FULL,
);
!
return $items;
}
!
function usertools_drush_help($section) {
switch ($section) {
case 'drush:last-registration':
return dt('This command will show you last registrations.');
}
}
function drush_usertools_last_registration_validate($role = 'all') {
$count = drush_get_option('count');
if (!empty($count) && !is_numeric($count)) {
return drush_set_error('Count should be numeric.');
}
}
!
function drush_usertools_last_registration($role = 'all') {
$count = drush_get_option('count');
if (empty($count)) {
$count = 10;
}
!
$query = db_select('users', 'u');
!
// Condition by role.
if ($role != 'all') {
$rid = drush_usertools_get_role_by_name($role);
$query->innerJoin('users_roles', 'ur', 'u.uid = ur.uid');
$query->condition('ur.rid', $rid);
}
!
$query->fields('u', array('uid', 'name', 'mail', 'access', 'created'));
$query->condition('u.uid', 0, '<>');
$query->range(0, $count);
$query->orderBy('u.created', 'DESC');
$result = $query->execute();
!
$items[] = array('uid', dt('Name'), dt('email'), dt('Last login'));
foreach ($result as $user) {
$items[] = array(
$user->uid,
$user->name,
$user->mail,
$user->access == 0 ? dt('Never') : format_interval(time() - $user->access) . ' ago',
);
}
drush_print_table($items, TRUE);
}
Usage
drush utl --count=5
drush utl administrator --count=10
function usertools_drush_command() {
$items = array();
$items['wipe-users'] = array(
'description' => 'Wipe user tables.',
'examples' => array(
'drush utw' => 'Wipe users.'
),
'aliases' => array('utw'),
'bootstrap' => DRUSH_BOOTSTRAP_DRUPAL_ROOT,
);
return $items;
}
!
function drush_usertools_wipe_users() {
if (drush_confirm(dt('You want to delete all users? Are you sure?'))) {
$query = db_select('users', 'u');
$query->fields('u', array('uid', 'name'));
$query->condition('u.uid', 1, '>');
$result = $query->execute();
foreach ($result as $user) {
drush_log(dt('Deleting user') . ' ' . $user->name . '...', 'warning');
user_delete($user->uid);
drush_log(dt('Succes deleting') . ' ' . $user->name, 'success');
}
}
else {
drush_user_abort();
}
}
Usage
drush utw
function drush_usertools_disable_role() {
$query = db_select('role', 'r');
$query->fields('r', array('rid', ‘name'));
$query->condition('r.rid', 1, '<>');
$query->orderBy('r.rid');
$result = $query->execute();
!
$options = array();
foreach ($result as $role) {
$options[$role->rid] = array($role->name);
}
!
$rid = drush_choice($options, dt('Select role:'));
!
// SQL queries.
!
drush_log('All users of role ' . $options[$rid][0] . ' disabled.', 'success');
}
Links
• https://drupal.org/node/594744 - Drush on Windows
• https://drupal.org/node/1791676 - Drush on *nix
• http://drushmake.me - Drush make
• http://drush.ws
• https://gist.github.com/Sanchiz/7627657
THANK YOU!
!
Email: alexander.schedrov@gmail.com
Twitter: @alexschedrov
FB: schedrov
http://sanchiz.net

More Related Content

What's hot

Nubilus Perl
Nubilus PerlNubilus Perl
Nubilus Perl
Flavio Poletti
 
Things I Believe Now That I'm Old
Things I Believe Now That I'm OldThings I Believe Now That I'm Old
Things I Believe Now That I'm Old
Ross Tuck
 
Efficient DBA: Gain Time by Reducing Command-Line Keystrokes
Efficient DBA: Gain Time by Reducing Command-Line KeystrokesEfficient DBA: Gain Time by Reducing Command-Line Keystrokes
Efficient DBA: Gain Time by Reducing Command-Line Keystrokes
Seth Miller
 
Introducing Assetic (NYPHP)
Introducing Assetic (NYPHP)Introducing Assetic (NYPHP)
Introducing Assetic (NYPHP)Kris Wallsmith
 
Perl Web Client
Perl Web ClientPerl Web Client
Perl Web Client
Flavio Poletti
 
An Elephant of a Different Colour: Hack
An Elephant of a Different Colour: HackAn Elephant of a Different Colour: Hack
An Elephant of a Different Colour: Hack
Vic Metcalfe
 
Deep Dive: AWS Command Line Interface
Deep Dive: AWS Command Line InterfaceDeep Dive: AWS Command Line Interface
Deep Dive: AWS Command Line Interface
Amazon Web Services
 
Redis for the Everyday Developer
Redis for the Everyday DeveloperRedis for the Everyday Developer
Redis for the Everyday Developer
Ross Tuck
 
Teaching Your Machine To Find Fraudsters
Teaching Your Machine To Find FraudstersTeaching Your Machine To Find Fraudsters
Teaching Your Machine To Find Fraudsters
Ian Barber
 
Debugging: Rules And Tools - PHPTek 11 Version
Debugging: Rules And Tools - PHPTek 11 VersionDebugging: Rules And Tools - PHPTek 11 Version
Debugging: Rules And Tools - PHPTek 11 Version
Ian Barber
 
Advanced Querying with CakePHP 3
Advanced Querying with CakePHP 3Advanced Querying with CakePHP 3
Advanced Querying with CakePHP 3
José Lorenzo Rodríguez Urdaneta
 
Using web2py's DAL in other projects or frameworks
Using web2py's DAL in other projects or frameworksUsing web2py's DAL in other projects or frameworks
Using web2py's DAL in other projects or frameworks
Bruno Rocha
 
New in cakephp3
New in cakephp3New in cakephp3
New in cakephp3
markstory
 

What's hot (18)

Nubilus Perl
Nubilus PerlNubilus Perl
Nubilus Perl
 
Things I Believe Now That I'm Old
Things I Believe Now That I'm OldThings I Believe Now That I'm Old
Things I Believe Now That I'm Old
 
Efficient DBA: Gain Time by Reducing Command-Line Keystrokes
Efficient DBA: Gain Time by Reducing Command-Line KeystrokesEfficient DBA: Gain Time by Reducing Command-Line Keystrokes
Efficient DBA: Gain Time by Reducing Command-Line Keystrokes
 
Introducing Assetic (NYPHP)
Introducing Assetic (NYPHP)Introducing Assetic (NYPHP)
Introducing Assetic (NYPHP)
 
C99
C99C99
C99
 
Cod
CodCod
Cod
 
Perl Web Client
Perl Web ClientPerl Web Client
Perl Web Client
 
An Elephant of a Different Colour: Hack
An Elephant of a Different Colour: HackAn Elephant of a Different Colour: Hack
An Elephant of a Different Colour: Hack
 
Deep Dive: AWS Command Line Interface
Deep Dive: AWS Command Line InterfaceDeep Dive: AWS Command Line Interface
Deep Dive: AWS Command Line Interface
 
Redis for the Everyday Developer
Redis for the Everyday DeveloperRedis for the Everyday Developer
Redis for the Everyday Developer
 
Teaching Your Machine To Find Fraudsters
Teaching Your Machine To Find FraudstersTeaching Your Machine To Find Fraudsters
Teaching Your Machine To Find Fraudsters
 
Php 101: PDO
Php 101: PDOPhp 101: PDO
Php 101: PDO
 
Debugging: Rules And Tools - PHPTek 11 Version
Debugging: Rules And Tools - PHPTek 11 VersionDebugging: Rules And Tools - PHPTek 11 Version
Debugging: Rules And Tools - PHPTek 11 Version
 
Advanced Querying with CakePHP 3
Advanced Querying with CakePHP 3Advanced Querying with CakePHP 3
Advanced Querying with CakePHP 3
 
Agile database access with CakePHP 3
Agile database access with CakePHP 3Agile database access with CakePHP 3
Agile database access with CakePHP 3
 
Using web2py's DAL in other projects or frameworks
Using web2py's DAL in other projects or frameworksUsing web2py's DAL in other projects or frameworks
Using web2py's DAL in other projects or frameworks
 
New in cakephp3
New in cakephp3New in cakephp3
New in cakephp3
 
zinno
zinnozinno
zinno
 

Viewers also liked

Blocks & Layouts in D7 - Josef Dabernig
Blocks & Layouts in D7 - Josef DabernigBlocks & Layouts in D7 - Josef Dabernig
Blocks & Layouts in D7 - Josef Dabernig
DrupalCampDN
 
Это Drupal, %username%! - Андрей Черноус
Это Drupal, %username%! - Андрей ЧерноусЭто Drupal, %username%! - Андрей Черноус
Это Drupal, %username%! - Андрей Черноус
DrupalCampDN
 
Dependency Injection in Drupal 8 - Стадник АндрейQweqwe
Dependency Injection in Drupal 8 - Стадник АндрейQweqweDependency Injection in Drupal 8 - Стадник АндрейQweqwe
Dependency Injection in Drupal 8 - Стадник АндрейQweqwe
DrupalCampDN
 
CKEditor в Drupal: тонкая настройка и кастомизация - Osman Seferov
CKEditor в Drupal: тонкая настройка и кастомизация - Osman SeferovCKEditor в Drupal: тонкая настройка и кастомизация - Osman Seferov
CKEditor в Drupal: тонкая настройка и кастомизация - Osman Seferov
DrupalCampDN
 
Drupal - Changing the Web by Connecting Open Minds - Josef Dabernig
Drupal - Changing the Web by Connecting Open Minds - Josef DabernigDrupal - Changing the Web by Connecting Open Minds - Josef Dabernig
Drupal - Changing the Web by Connecting Open Minds - Josef DabernigDrupalCampDN
 
Cоздание темы с нуля. Артём Шимко.
Cоздание темы с нуля. Артём Шимко.Cоздание темы с нуля. Артём Шимко.
Cоздание темы с нуля. Артём Шимко.DrupalCampDN
 
Guzzle in Drupal 8 and as a REST client - Артем Мирошник
Guzzle in Drupal 8 and as a REST client - Артем МирошникGuzzle in Drupal 8 and as a REST client - Артем Мирошник
Guzzle in Drupal 8 and as a REST client - Артем Мирошник
DrupalCampDN
 
Our AWS Cloud Journey - Andrew Boag
Our AWS Cloud Journey - Andrew BoagOur AWS Cloud Journey - Andrew Boag
Our AWS Cloud Journey - Andrew Boag
DrupalCampDN
 

Viewers also liked (8)

Blocks & Layouts in D7 - Josef Dabernig
Blocks & Layouts in D7 - Josef DabernigBlocks & Layouts in D7 - Josef Dabernig
Blocks & Layouts in D7 - Josef Dabernig
 
Это Drupal, %username%! - Андрей Черноус
Это Drupal, %username%! - Андрей ЧерноусЭто Drupal, %username%! - Андрей Черноус
Это Drupal, %username%! - Андрей Черноус
 
Dependency Injection in Drupal 8 - Стадник АндрейQweqwe
Dependency Injection in Drupal 8 - Стадник АндрейQweqweDependency Injection in Drupal 8 - Стадник АндрейQweqwe
Dependency Injection in Drupal 8 - Стадник АндрейQweqwe
 
CKEditor в Drupal: тонкая настройка и кастомизация - Osman Seferov
CKEditor в Drupal: тонкая настройка и кастомизация - Osman SeferovCKEditor в Drupal: тонкая настройка и кастомизация - Osman Seferov
CKEditor в Drupal: тонкая настройка и кастомизация - Osman Seferov
 
Drupal - Changing the Web by Connecting Open Minds - Josef Dabernig
Drupal - Changing the Web by Connecting Open Minds - Josef DabernigDrupal - Changing the Web by Connecting Open Minds - Josef Dabernig
Drupal - Changing the Web by Connecting Open Minds - Josef Dabernig
 
Cоздание темы с нуля. Артём Шимко.
Cоздание темы с нуля. Артём Шимко.Cоздание темы с нуля. Артём Шимко.
Cоздание темы с нуля. Артём Шимко.
 
Guzzle in Drupal 8 and as a REST client - Артем Мирошник
Guzzle in Drupal 8 and as a REST client - Артем МирошникGuzzle in Drupal 8 and as a REST client - Артем Мирошник
Guzzle in Drupal 8 and as a REST client - Артем Мирошник
 
Our AWS Cloud Journey - Andrew Boag
Our AWS Cloud Journey - Andrew BoagOur AWS Cloud Journey - Andrew Boag
Our AWS Cloud Journey - Andrew Boag
 

Similar to Drush - use full power - Alexander Schedrov

What's new in the Drupal 7 API?
What's new in the Drupal 7 API?What's new in the Drupal 7 API?
What's new in the Drupal 7 API?
Alexandru Badiu
 
Debugging in drupal 8
Debugging in drupal 8Debugging in drupal 8
Debugging in drupal 8
Allie Jones
 
jQuery UI Widgets, Drag and Drop, Drupal 7 Javascript
jQuery UI Widgets, Drag and Drop, Drupal 7 JavascriptjQuery UI Widgets, Drag and Drop, Drupal 7 Javascript
jQuery UI Widgets, Drag and Drop, Drupal 7 Javascript
Darren Mothersele
 
Advanced symfony Techniques
Advanced symfony TechniquesAdvanced symfony Techniques
Advanced symfony Techniques
Kris Wallsmith
 
Advanced jQuery
Advanced jQueryAdvanced jQuery
Advanced jQuery
sergioafp
 
Fatc
FatcFatc
The State of Lithium
The State of LithiumThe State of Lithium
The State of Lithium
Nate Abele
 
Laravel 5 In Depth
Laravel 5 In DepthLaravel 5 In Depth
Laravel 5 In Depth
Kirk Bushell
 
Php update and delet operation
Php update and delet operationPhp update and delet operation
Php update and delet operation
syeda zoya mehdi
 
Kamailio - Surfing Big Waves Of SIP With Style
Kamailio - Surfing Big Waves Of SIP With StyleKamailio - Surfing Big Waves Of SIP With Style
Kamailio - Surfing Big Waves Of SIP With Style
Daniel-Constantin Mierla
 
Play vs Rails
Play vs RailsPlay vs Rails
Play vs Rails
Daniel Cukier
 
Virtual Madness @ Etsy
Virtual Madness @ EtsyVirtual Madness @ Etsy
Virtual Madness @ Etsy
Nishan Subedi
 
The History of PHPersistence
The History of PHPersistenceThe History of PHPersistence
The History of PHPersistence
Hugo Hamon
 
Doctrine For Beginners
Doctrine For BeginnersDoctrine For Beginners
Doctrine For Beginners
Jonathan Wage
 
Can't Miss Features of PHP 5.3 and 5.4
Can't Miss Features of PHP 5.3 and 5.4Can't Miss Features of PHP 5.3 and 5.4
Can't Miss Features of PHP 5.3 and 5.4
Jeff Carouth
 
Bag Of Tricks From Iusethis
Bag Of Tricks From IusethisBag Of Tricks From Iusethis
Bag Of Tricks From Iusethis
Marcus Ramberg
 
PHP and Rich Internet Applications
PHP and Rich Internet ApplicationsPHP and Rich Internet Applications
PHP and Rich Internet Applicationselliando dias
 
Lithium: The Framework for People Who Hate Frameworks
Lithium: The Framework for People Who Hate FrameworksLithium: The Framework for People Who Hate Frameworks
Lithium: The Framework for People Who Hate Frameworks
Nate Abele
 
関西PHP勉強会 php5.4つまみぐい
関西PHP勉強会 php5.4つまみぐい関西PHP勉強会 php5.4つまみぐい
関西PHP勉強会 php5.4つまみぐい
Hisateru Tanaka
 
Ruby is Awesome
Ruby is AwesomeRuby is Awesome
Ruby is Awesome
Astrails
 

Similar to Drush - use full power - Alexander Schedrov (20)

What's new in the Drupal 7 API?
What's new in the Drupal 7 API?What's new in the Drupal 7 API?
What's new in the Drupal 7 API?
 
Debugging in drupal 8
Debugging in drupal 8Debugging in drupal 8
Debugging in drupal 8
 
jQuery UI Widgets, Drag and Drop, Drupal 7 Javascript
jQuery UI Widgets, Drag and Drop, Drupal 7 JavascriptjQuery UI Widgets, Drag and Drop, Drupal 7 Javascript
jQuery UI Widgets, Drag and Drop, Drupal 7 Javascript
 
Advanced symfony Techniques
Advanced symfony TechniquesAdvanced symfony Techniques
Advanced symfony Techniques
 
Advanced jQuery
Advanced jQueryAdvanced jQuery
Advanced jQuery
 
Fatc
FatcFatc
Fatc
 
The State of Lithium
The State of LithiumThe State of Lithium
The State of Lithium
 
Laravel 5 In Depth
Laravel 5 In DepthLaravel 5 In Depth
Laravel 5 In Depth
 
Php update and delet operation
Php update and delet operationPhp update and delet operation
Php update and delet operation
 
Kamailio - Surfing Big Waves Of SIP With Style
Kamailio - Surfing Big Waves Of SIP With StyleKamailio - Surfing Big Waves Of SIP With Style
Kamailio - Surfing Big Waves Of SIP With Style
 
Play vs Rails
Play vs RailsPlay vs Rails
Play vs Rails
 
Virtual Madness @ Etsy
Virtual Madness @ EtsyVirtual Madness @ Etsy
Virtual Madness @ Etsy
 
The History of PHPersistence
The History of PHPersistenceThe History of PHPersistence
The History of PHPersistence
 
Doctrine For Beginners
Doctrine For BeginnersDoctrine For Beginners
Doctrine For Beginners
 
Can't Miss Features of PHP 5.3 and 5.4
Can't Miss Features of PHP 5.3 and 5.4Can't Miss Features of PHP 5.3 and 5.4
Can't Miss Features of PHP 5.3 and 5.4
 
Bag Of Tricks From Iusethis
Bag Of Tricks From IusethisBag Of Tricks From Iusethis
Bag Of Tricks From Iusethis
 
PHP and Rich Internet Applications
PHP and Rich Internet ApplicationsPHP and Rich Internet Applications
PHP and Rich Internet Applications
 
Lithium: The Framework for People Who Hate Frameworks
Lithium: The Framework for People Who Hate FrameworksLithium: The Framework for People Who Hate Frameworks
Lithium: The Framework for People Who Hate Frameworks
 
関西PHP勉強会 php5.4つまみぐい
関西PHP勉強会 php5.4つまみぐい関西PHP勉強会 php5.4つまみぐい
関西PHP勉強会 php5.4つまみぐい
 
Ruby is Awesome
Ruby is AwesomeRuby is Awesome
Ruby is Awesome
 

More from DrupalCampDN

Migrate - new way site upgrade
Migrate - new way site upgradeMigrate - new way site upgrade
Migrate - new way site upgrade
DrupalCampDN
 
Caching on highload Drupal site - Alexander Shumenko
Caching on highload Drupal site - Alexander ShumenkoCaching on highload Drupal site - Alexander Shumenko
Caching on highload Drupal site - Alexander Shumenko
DrupalCampDN
 
Rich Text in Drupal - Вадим Валуев
Rich Text in Drupal - Вадим ВалуевRich Text in Drupal - Вадим Валуев
Rich Text in Drupal - Вадим Валуев
DrupalCampDN
 
May the parallelity be with you! Distributed computing using Erlang language ...
May the parallelity be with you! Distributed computing using Erlang language ...May the parallelity be with you! Distributed computing using Erlang language ...
May the parallelity be with you! Distributed computing using Erlang language ...
DrupalCampDN
 
Panels как философия - Alexander Danilenko
Panels как философия - Alexander DanilenkoPanels как философия - Alexander Danilenko
Panels как философия - Alexander Danilenko
DrupalCampDN
 
DrupalGap. How to create native application for mobile devices based on Drupa...
DrupalGap. How to create native application for mobile devices based on Drupa...DrupalGap. How to create native application for mobile devices based on Drupa...
DrupalGap. How to create native application for mobile devices based on Drupa...
DrupalCampDN
 
Twig internals - Maksym MoskvychevTwig internals maksym moskvychev
Twig internals - Maksym MoskvychevTwig internals   maksym moskvychevTwig internals - Maksym MoskvychevTwig internals   maksym moskvychev
Twig internals - Maksym MoskvychevTwig internals maksym moskvychev
DrupalCampDN
 
Презентация модуля YandexMoney - Yury Glushkov
Презентация модуля YandexMoney - Yury GlushkovПрезентация модуля YandexMoney - Yury Glushkov
Презентация модуля YandexMoney - Yury GlushkovDrupalCampDN
 
Drupal and Outer space - Martin Mayer
Drupal and Outer space - Martin MayerDrupal and Outer space - Martin Mayer
Drupal and Outer space - Martin Mayer
DrupalCampDN
 
Boost your theming skills - Artem Shymko
Boost your theming skills - Artem ShymkoBoost your theming skills - Artem Shymko
Boost your theming skills - Artem Shymko
DrupalCampDN
 
Continious integration - Иван Лещёв
Continious integration - Иван ЛещёвContinious integration - Иван Лещёв
Continious integration - Иван ЛещёвDrupalCampDN
 
Rules - Yaroslav Doroshuk
Rules - Yaroslav DoroshukRules - Yaroslav Doroshuk
Rules - Yaroslav DoroshukDrupalCampDN
 
Системы управления взаимоотношениями с клиентами. Drupal CRM Core. - Вадим Ми...
Системы управления взаимоотношениями с клиентами. Drupal CRM Core. - Вадим Ми...Системы управления взаимоотношениями с клиентами. Drupal CRM Core. - Вадим Ми...
Системы управления взаимоотношениями с клиентами. Drupal CRM Core. - Вадим Ми...DrupalCampDN
 
Render API - Pavel Makhrinsky
Render API - Pavel MakhrinskyRender API - Pavel Makhrinsky
Render API - Pavel MakhrinskyDrupalCampDN
 
Темизация Drupal7. Omega theme. Александр Даниленко.
Темизация Drupal7. Omega theme. Александр Даниленко.Темизация Drupal7. Omega theme. Александр Даниленко.
Темизация Drupal7. Omega theme. Александр Даниленко.DrupalCampDN
 
How to? Drupal developer toolkit. Dennis Povshedny.
How to? Drupal developer toolkit. Dennis Povshedny.How to? Drupal developer toolkit. Dennis Povshedny.
How to? Drupal developer toolkit. Dennis Povshedny.DrupalCampDN
 
Управление отображением материалов с помощью Display Suite. Илья Станкевич.
Управление отображением материалов с помощью Display Suite. Илья Станкевич.Управление отображением материалов с помощью Display Suite. Илья Станкевич.
Управление отображением материалов с помощью Display Suite. Илья Станкевич.DrupalCampDN
 
Фичи н-н-нада? Или почему стоит использовать модуль Features. Евгений Фиделин.
Фичи н-н-нада? Или почему стоит использовать модуль Features. Евгений Фиделин.Фичи н-н-нада? Или почему стоит использовать модуль Features. Евгений Фиделин.
Фичи н-н-нада? Или почему стоит использовать модуль Features. Евгений Фиделин.DrupalCampDN
 
Импорт данных с фреймворком Migrate. Владислав Богатырев.
Импорт данных с фреймворком Migrate. Владислав Богатырев.Импорт данных с фреймворком Migrate. Владислав Богатырев.
Импорт данных с фреймворком Migrate. Владислав Богатырев.DrupalCampDN
 
Drupal 7 Deployment Using Apache Ant. Dmitriy Svetlichniy.
Drupal 7 Deployment Using Apache Ant. Dmitriy Svetlichniy.Drupal 7 Deployment Using Apache Ant. Dmitriy Svetlichniy.
Drupal 7 Deployment Using Apache Ant. Dmitriy Svetlichniy.DrupalCampDN
 

More from DrupalCampDN (20)

Migrate - new way site upgrade
Migrate - new way site upgradeMigrate - new way site upgrade
Migrate - new way site upgrade
 
Caching on highload Drupal site - Alexander Shumenko
Caching on highload Drupal site - Alexander ShumenkoCaching on highload Drupal site - Alexander Shumenko
Caching on highload Drupal site - Alexander Shumenko
 
Rich Text in Drupal - Вадим Валуев
Rich Text in Drupal - Вадим ВалуевRich Text in Drupal - Вадим Валуев
Rich Text in Drupal - Вадим Валуев
 
May the parallelity be with you! Distributed computing using Erlang language ...
May the parallelity be with you! Distributed computing using Erlang language ...May the parallelity be with you! Distributed computing using Erlang language ...
May the parallelity be with you! Distributed computing using Erlang language ...
 
Panels как философия - Alexander Danilenko
Panels как философия - Alexander DanilenkoPanels как философия - Alexander Danilenko
Panels как философия - Alexander Danilenko
 
DrupalGap. How to create native application for mobile devices based on Drupa...
DrupalGap. How to create native application for mobile devices based on Drupa...DrupalGap. How to create native application for mobile devices based on Drupa...
DrupalGap. How to create native application for mobile devices based on Drupa...
 
Twig internals - Maksym MoskvychevTwig internals maksym moskvychev
Twig internals - Maksym MoskvychevTwig internals   maksym moskvychevTwig internals - Maksym MoskvychevTwig internals   maksym moskvychev
Twig internals - Maksym MoskvychevTwig internals maksym moskvychev
 
Презентация модуля YandexMoney - Yury Glushkov
Презентация модуля YandexMoney - Yury GlushkovПрезентация модуля YandexMoney - Yury Glushkov
Презентация модуля YandexMoney - Yury Glushkov
 
Drupal and Outer space - Martin Mayer
Drupal and Outer space - Martin MayerDrupal and Outer space - Martin Mayer
Drupal and Outer space - Martin Mayer
 
Boost your theming skills - Artem Shymko
Boost your theming skills - Artem ShymkoBoost your theming skills - Artem Shymko
Boost your theming skills - Artem Shymko
 
Continious integration - Иван Лещёв
Continious integration - Иван ЛещёвContinious integration - Иван Лещёв
Continious integration - Иван Лещёв
 
Rules - Yaroslav Doroshuk
Rules - Yaroslav DoroshukRules - Yaroslav Doroshuk
Rules - Yaroslav Doroshuk
 
Системы управления взаимоотношениями с клиентами. Drupal CRM Core. - Вадим Ми...
Системы управления взаимоотношениями с клиентами. Drupal CRM Core. - Вадим Ми...Системы управления взаимоотношениями с клиентами. Drupal CRM Core. - Вадим Ми...
Системы управления взаимоотношениями с клиентами. Drupal CRM Core. - Вадим Ми...
 
Render API - Pavel Makhrinsky
Render API - Pavel MakhrinskyRender API - Pavel Makhrinsky
Render API - Pavel Makhrinsky
 
Темизация Drupal7. Omega theme. Александр Даниленко.
Темизация Drupal7. Omega theme. Александр Даниленко.Темизация Drupal7. Omega theme. Александр Даниленко.
Темизация Drupal7. Omega theme. Александр Даниленко.
 
How to? Drupal developer toolkit. Dennis Povshedny.
How to? Drupal developer toolkit. Dennis Povshedny.How to? Drupal developer toolkit. Dennis Povshedny.
How to? Drupal developer toolkit. Dennis Povshedny.
 
Управление отображением материалов с помощью Display Suite. Илья Станкевич.
Управление отображением материалов с помощью Display Suite. Илья Станкевич.Управление отображением материалов с помощью Display Suite. Илья Станкевич.
Управление отображением материалов с помощью Display Suite. Илья Станкевич.
 
Фичи н-н-нада? Или почему стоит использовать модуль Features. Евгений Фиделин.
Фичи н-н-нада? Или почему стоит использовать модуль Features. Евгений Фиделин.Фичи н-н-нада? Или почему стоит использовать модуль Features. Евгений Фиделин.
Фичи н-н-нада? Или почему стоит использовать модуль Features. Евгений Фиделин.
 
Импорт данных с фреймворком Migrate. Владислав Богатырев.
Импорт данных с фреймворком Migrate. Владислав Богатырев.Импорт данных с фреймворком Migrate. Владислав Богатырев.
Импорт данных с фреймворком Migrate. Владислав Богатырев.
 
Drupal 7 Deployment Using Apache Ant. Dmitriy Svetlichniy.
Drupal 7 Deployment Using Apache Ant. Dmitriy Svetlichniy.Drupal 7 Deployment Using Apache Ant. Dmitriy Svetlichniy.
Drupal 7 Deployment Using Apache Ant. Dmitriy Svetlichniy.
 

Recently uploaded

成绩单ps(UST毕业证)圣托马斯大学毕业证成绩单快速办理
成绩单ps(UST毕业证)圣托马斯大学毕业证成绩单快速办理成绩单ps(UST毕业证)圣托马斯大学毕业证成绩单快速办理
成绩单ps(UST毕业证)圣托马斯大学毕业证成绩单快速办理
ysasp1
 
Explore-Insanony: Watch Instagram Stories Secretly
Explore-Insanony: Watch Instagram Stories SecretlyExplore-Insanony: Watch Instagram Stories Secretly
Explore-Insanony: Watch Instagram Stories Secretly
Trending Blogers
 
Search Result Showing My Post is Now Buried
Search Result Showing My Post is Now BuriedSearch Result Showing My Post is Now Buried
Search Result Showing My Post is Now Buried
Trish Parr
 
1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样
1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样
1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样
3ipehhoa
 
一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理
一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理
一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理
ufdana
 
国外证书(Lincoln毕业证)新西兰林肯大学毕业证成绩单不能毕业办理
国外证书(Lincoln毕业证)新西兰林肯大学毕业证成绩单不能毕业办理国外证书(Lincoln毕业证)新西兰林肯大学毕业证成绩单不能毕业办理
国外证书(Lincoln毕业证)新西兰林肯大学毕业证成绩单不能毕业办理
zoowe
 
test test test test testtest test testtest test testtest test testtest test ...
test test  test test testtest test testtest test testtest test testtest test ...test test  test test testtest test testtest test testtest test testtest test ...
test test test test testtest test testtest test testtest test testtest test ...
Arif0071
 
制作毕业证书(ANU毕业证)莫纳什大学毕业证成绩单官方原版办理
制作毕业证书(ANU毕业证)莫纳什大学毕业证成绩单官方原版办理制作毕业证书(ANU毕业证)莫纳什大学毕业证成绩单官方原版办理
制作毕业证书(ANU毕业证)莫纳什大学毕业证成绩单官方原版办理
cuobya
 
[HUN][hackersuli] Red Teaming alapok 2024
[HUN][hackersuli] Red Teaming alapok 2024[HUN][hackersuli] Red Teaming alapok 2024
[HUN][hackersuli] Red Teaming alapok 2024
hackersuli
 
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024
APNIC
 
Bài tập unit 1 English in the world.docx
Bài tập unit 1 English in the world.docxBài tập unit 1 English in the world.docx
Bài tập unit 1 English in the world.docx
nhiyenphan2005
 
guildmasters guide to ravnica Dungeons & Dragons 5...
guildmasters guide to ravnica Dungeons & Dragons 5...guildmasters guide to ravnica Dungeons & Dragons 5...
guildmasters guide to ravnica Dungeons & Dragons 5...
Rogerio Filho
 
假文凭国外(Adelaide毕业证)澳大利亚国立大学毕业证成绩单办理
假文凭国外(Adelaide毕业证)澳大利亚国立大学毕业证成绩单办理假文凭国外(Adelaide毕业证)澳大利亚国立大学毕业证成绩单办理
假文凭国外(Adelaide毕业证)澳大利亚国立大学毕业证成绩单办理
cuobya
 
一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理
一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理
一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理
eutxy
 
Meet up Milano 14 _ Axpo Italia_ Migration from Mule3 (On-prem) to.pdf
Meet up Milano 14 _ Axpo Italia_ Migration from Mule3 (On-prem) to.pdfMeet up Milano 14 _ Axpo Italia_ Migration from Mule3 (On-prem) to.pdf
Meet up Milano 14 _ Axpo Italia_ Migration from Mule3 (On-prem) to.pdf
Florence Consulting
 
Bridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptx
Bridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptxBridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptx
Bridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptx
Brad Spiegel Macon GA
 
Italy Agriculture Equipment Market Outlook to 2027
Italy Agriculture Equipment Market Outlook to 2027Italy Agriculture Equipment Market Outlook to 2027
Italy Agriculture Equipment Market Outlook to 2027
harveenkaur52
 
存档可查的(USC毕业证)南加利福尼亚大学毕业证成绩单制做办理
存档可查的(USC毕业证)南加利福尼亚大学毕业证成绩单制做办理存档可查的(USC毕业证)南加利福尼亚大学毕业证成绩单制做办理
存档可查的(USC毕业证)南加利福尼亚大学毕业证成绩单制做办理
fovkoyb
 
JAVIER LASA-EXPERIENCIA digital 1986-2024.pdf
JAVIER LASA-EXPERIENCIA digital 1986-2024.pdfJAVIER LASA-EXPERIENCIA digital 1986-2024.pdf
JAVIER LASA-EXPERIENCIA digital 1986-2024.pdf
Javier Lasa
 
一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理
一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理
一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理
keoku
 

Recently uploaded (20)

成绩单ps(UST毕业证)圣托马斯大学毕业证成绩单快速办理
成绩单ps(UST毕业证)圣托马斯大学毕业证成绩单快速办理成绩单ps(UST毕业证)圣托马斯大学毕业证成绩单快速办理
成绩单ps(UST毕业证)圣托马斯大学毕业证成绩单快速办理
 
Explore-Insanony: Watch Instagram Stories Secretly
Explore-Insanony: Watch Instagram Stories SecretlyExplore-Insanony: Watch Instagram Stories Secretly
Explore-Insanony: Watch Instagram Stories Secretly
 
Search Result Showing My Post is Now Buried
Search Result Showing My Post is Now BuriedSearch Result Showing My Post is Now Buried
Search Result Showing My Post is Now Buried
 
1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样
1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样
1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样
 
一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理
一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理
一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理
 
国外证书(Lincoln毕业证)新西兰林肯大学毕业证成绩单不能毕业办理
国外证书(Lincoln毕业证)新西兰林肯大学毕业证成绩单不能毕业办理国外证书(Lincoln毕业证)新西兰林肯大学毕业证成绩单不能毕业办理
国外证书(Lincoln毕业证)新西兰林肯大学毕业证成绩单不能毕业办理
 
test test test test testtest test testtest test testtest test testtest test ...
test test  test test testtest test testtest test testtest test testtest test ...test test  test test testtest test testtest test testtest test testtest test ...
test test test test testtest test testtest test testtest test testtest test ...
 
制作毕业证书(ANU毕业证)莫纳什大学毕业证成绩单官方原版办理
制作毕业证书(ANU毕业证)莫纳什大学毕业证成绩单官方原版办理制作毕业证书(ANU毕业证)莫纳什大学毕业证成绩单官方原版办理
制作毕业证书(ANU毕业证)莫纳什大学毕业证成绩单官方原版办理
 
[HUN][hackersuli] Red Teaming alapok 2024
[HUN][hackersuli] Red Teaming alapok 2024[HUN][hackersuli] Red Teaming alapok 2024
[HUN][hackersuli] Red Teaming alapok 2024
 
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024
 
Bài tập unit 1 English in the world.docx
Bài tập unit 1 English in the world.docxBài tập unit 1 English in the world.docx
Bài tập unit 1 English in the world.docx
 
guildmasters guide to ravnica Dungeons & Dragons 5...
guildmasters guide to ravnica Dungeons & Dragons 5...guildmasters guide to ravnica Dungeons & Dragons 5...
guildmasters guide to ravnica Dungeons & Dragons 5...
 
假文凭国外(Adelaide毕业证)澳大利亚国立大学毕业证成绩单办理
假文凭国外(Adelaide毕业证)澳大利亚国立大学毕业证成绩单办理假文凭国外(Adelaide毕业证)澳大利亚国立大学毕业证成绩单办理
假文凭国外(Adelaide毕业证)澳大利亚国立大学毕业证成绩单办理
 
一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理
一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理
一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理
 
Meet up Milano 14 _ Axpo Italia_ Migration from Mule3 (On-prem) to.pdf
Meet up Milano 14 _ Axpo Italia_ Migration from Mule3 (On-prem) to.pdfMeet up Milano 14 _ Axpo Italia_ Migration from Mule3 (On-prem) to.pdf
Meet up Milano 14 _ Axpo Italia_ Migration from Mule3 (On-prem) to.pdf
 
Bridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptx
Bridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptxBridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptx
Bridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptx
 
Italy Agriculture Equipment Market Outlook to 2027
Italy Agriculture Equipment Market Outlook to 2027Italy Agriculture Equipment Market Outlook to 2027
Italy Agriculture Equipment Market Outlook to 2027
 
存档可查的(USC毕业证)南加利福尼亚大学毕业证成绩单制做办理
存档可查的(USC毕业证)南加利福尼亚大学毕业证成绩单制做办理存档可查的(USC毕业证)南加利福尼亚大学毕业证成绩单制做办理
存档可查的(USC毕业证)南加利福尼亚大学毕业证成绩单制做办理
 
JAVIER LASA-EXPERIENCIA digital 1986-2024.pdf
JAVIER LASA-EXPERIENCIA digital 1986-2024.pdfJAVIER LASA-EXPERIENCIA digital 1986-2024.pdf
JAVIER LASA-EXPERIENCIA digital 1986-2024.pdf
 
一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理
一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理
一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理
 

Drush - use full power - Alexander Schedrov

  • 1. 25 -27 April, 2014 http://camp2014.drupal.dn.ua Drush - use full power Alexander Schedrov
  • 2. You can do it in CLI
  • 4. Most helpful commands: Core • cc - clear- cache • dl, en, dis, pm-uninstall • upwd • uli • make • updb • up • upc • image-flush • vget, vset • sql-dump • sql-cli • sql-sync
  • 5. Most helpful commands: Contrib Apache Solr • solr-index • solr-mark-all • solr-delete-index Registry Rebuild • registry- rebuild(rr) Localization Update • l10n-update • l10n-update- refresh • l10n-update- status
  • 6. Most helpful commands: Contrib Features • features-list(fl) • features-diff(fd) • features-revert(fr) • features-revert-all(fr) • features-update(fu) • features-update- all(fua) Devel • devel-reinstall (dre) • fn-view(fnv) • fn-hook(fnh, hook) drush hook HOOK_NAME allows to discover order of hooks
  • 8. Installation on Windows • download drush. Using c:drush as location in this example • install gzip, tar, wget command line binaries • set PATH environment variables c:drush;d:xamppphp;d:xamppmysqlbin;C:Program FilesGnuWin32bin • MsysGit https://drupal.org/node/594744
  • 9. Installation on *nix • download drush. Using home folder as location in this example • create symlink ! https://drupal.org/node/1791676 sudo ln -s ~/drush/drush /usr/local/bin/drush
  • 11. aliases.drushrc.php $aliases['dev'] = array( 'root' => '~/Sites/drupal.dev', ); ! ! drush @dev status drush -r ~/Sites/drupal.dev/ status ! drush ~/Sites/drupal.dev/#default status aliases.drush.php:
  • 12. $aliases['dev'] = array( 'root' => '~/Sites/blog', 'uri' => 'blog.dev', ); $aliases['live'] = array( 'root' => '~/Sites/blog-live', 'uri' => 'blog-live.dev', ); blog.aliases.drushrc.php: drush @blog status drush @blog.dev status drush @blog.live status $aliases['blog'] = array( 'site-list' => array('@dev', '@live'), ); drush site-alias(sa)
  • 13. SSH $aliases['live'] = array( 'remote-host' => 'bitbucket.org', 'remote-user' => 'sanchiz', 'root' => '/var/www', 'uri' => 'default', ); Important: remote server must have Drush ssh-keygen ssh-copy-id -i ~/.ssh/id_rsa.pub sanchiz@bitbucket.org equals drush dl drush_extras drush pushkey @live
  • 14. Remote host with special configuration $aliases['live'] = array( 'remote-host' => 'dev.project.de', 'remote-user' => 'dev_alex_sh', 'root' => '/home/dev_alex_sh/www', 'php' => '/usr/bin/php', 'path-aliases' => array( '%drush-script' => '/home/dev_alex_sh/drush/ drush.php', ), );
  • 15. Code and database sync If you do not use Git, this section for you =)
  • 16. Code sync $aliases['live'] = array( 'command-specific' => array( 'core-rsync' => array( 'exclude' => '*.sql', 'exclude' => '.svn', 'exclude' => '.git', 'exclude' => "sites/default/files/", ), ), ); drush rsync(core-rsync) @live @dev --include-conf ! drush rsync @live:sites/default/files @dev:sites/ default/files
  • 17. Sql-sync $aliases['live'] = array( 'path-aliases' => array( '%dump-dir' => ‘/home/dev_alex_sh/dump’, ), ); drush sql-sync @live @dev ! drush sql-sync @live @dev --create-db
  • 18. Selective sync emails => user+%uid@localhost passwords => password drush sql-sync @live @dev --structure-tables-key=common drushrc.php: $options['structure-tables']['custom'] = array( 'cache', 'cache_*', 'search_*', 'watchdog' ); drush sql-sync @live @dev --structure-tables-key=custom --no-cache=true ! drush sql-sync @live @dev --sanitize
  • 19. Sql-sync without Drush on server $aliases['live'] = array( 'databases' => array( 'default' => array( 'default' => array( 'driver' => 'mysql', 'username' => 'username', 'password' => 'password', 'port' => '', 'host' => '127.0.0.1', 'database' => 'live_database', ), ), ), ); drush @live sql-conf --all --show=passwords
  • 20. $aliases['live'] = array( 'remote-host' => 'dev.project.de', 'remote-user' => 'default_alex_sh', 'root' => '/home/default_alex_sh/www', 'php' => '/usr/bin/php', 'php-options' => '-d error_reporting="E_ALL^E_DEPRECATED"', 'variables' => array('mail_system' => array('default-system' => 'DevelMailLog')), 'databases' => array( 'default' => array( 'default' => array( 'driver' => 'mysql', 'username' => 'username', 'password' => 'password', 'port' => '', 'host' => '127.0.0.1', 'database' => 'live_database', ), ), ), 'path-aliases' => array( '%drush-script' => '/home/default_alex_sh/drush/drush.php', '%files' => '/home/default_alex_sh/www/sites/default/files', '%drush' => '/home/default_alex_sh/drush', '%dump-dir' => '/home/default_alex_sh/www/dump', ), ! 'command-specific' => array( 'core-rsync' => array( 'exclude' => '*.sql', 'exclude' => '.svn', 'exclude' => '.git', 'exclude' => "sites/default/files/", ), ), ! 'ssh-options' => '-p 2222', );
  • 22. DRUSH make What can drush make do? • Download modules • Clone modules from git • Apply patches • Download libraries • Download core
  • 23. core = 7.x api = 2 ! ; core projects[drupal][version] = 7.23 ! ; modules projects[views][version] = 3.7 projects[views][subdir] = "contrib" ! projects[views][version] = 3.7 projects[views][subdir] = "contrib" projects[views][patch][] = "https://drupal.org/files/ views_join_condition_increment_5.patch" ! projects[views][type] = module projects[views][download][type] = git projects[views][download][revision] = 6920ff71c0bf3a75fc769658ba0dabb42ffcd357 projects[views][download][branch] = 7.x-3.x projects[views][subdir] = "contrib" ! ; libraries libraries[ckeditor][download][type] = get libraries[ckeditor][download][url] = "http://download.cksource.com/CKEditor/CKEditor/ CKEditor 4.3/ckeditor_4.3_full.zip" ! libraries[colorbox][download][type] = get libraries[colorbox][download][url] = "https://github.com/jackmoore/colorbox/archive/ master.zip" drush make make_file.make --no-core
  • 25. Extensions Drush • A .drush folder in your HOME folder. • Anywhere in module • Drupal's /drush or /sites/all/drush folders.
  • 26. function usertools_drush_command() { $items = array(); ! $items['last-registration'] = array( 'description' => 'Show last registration.', 'arguments' => array( 'role' => 'Specific role.', ), 'options' => array( 'count' => array( 'description' => 'Count rows.', 'example-value' => '5', ), ), 'examples' => array( 'drush utl admin --count=5' => 'Show the last 5 registrations of admin.', ), 'aliases' => array('utl'), 'bootstrap' => DRUSH_BOOTSTRAP_DRUPAL_FULL, ); ! return $items; } ! function usertools_drush_help($section) { switch ($section) { case 'drush:last-registration': return dt('This command will show you last registrations.'); } }
  • 27. function drush_usertools_last_registration_validate($role = 'all') { $count = drush_get_option('count'); if (!empty($count) && !is_numeric($count)) { return drush_set_error('Count should be numeric.'); } } ! function drush_usertools_last_registration($role = 'all') { $count = drush_get_option('count'); if (empty($count)) { $count = 10; } ! $query = db_select('users', 'u'); ! // Condition by role. if ($role != 'all') { $rid = drush_usertools_get_role_by_name($role); $query->innerJoin('users_roles', 'ur', 'u.uid = ur.uid'); $query->condition('ur.rid', $rid); } ! $query->fields('u', array('uid', 'name', 'mail', 'access', 'created')); $query->condition('u.uid', 0, '<>'); $query->range(0, $count); $query->orderBy('u.created', 'DESC'); $result = $query->execute(); ! $items[] = array('uid', dt('Name'), dt('email'), dt('Last login')); foreach ($result as $user) { $items[] = array( $user->uid, $user->name, $user->mail, $user->access == 0 ? dt('Never') : format_interval(time() - $user->access) . ' ago', ); } drush_print_table($items, TRUE); }
  • 28. Usage drush utl --count=5 drush utl administrator --count=10
  • 29. function usertools_drush_command() { $items = array(); $items['wipe-users'] = array( 'description' => 'Wipe user tables.', 'examples' => array( 'drush utw' => 'Wipe users.' ), 'aliases' => array('utw'), 'bootstrap' => DRUSH_BOOTSTRAP_DRUPAL_ROOT, ); return $items; } ! function drush_usertools_wipe_users() { if (drush_confirm(dt('You want to delete all users? Are you sure?'))) { $query = db_select('users', 'u'); $query->fields('u', array('uid', 'name')); $query->condition('u.uid', 1, '>'); $result = $query->execute(); foreach ($result as $user) { drush_log(dt('Deleting user') . ' ' . $user->name . '...', 'warning'); user_delete($user->uid); drush_log(dt('Succes deleting') . ' ' . $user->name, 'success'); } } else { drush_user_abort(); } }
  • 31. function drush_usertools_disable_role() { $query = db_select('role', 'r'); $query->fields('r', array('rid', ‘name')); $query->condition('r.rid', 1, '<>'); $query->orderBy('r.rid'); $result = $query->execute(); ! $options = array(); foreach ($result as $role) { $options[$role->rid] = array($role->name); } ! $rid = drush_choice($options, dt('Select role:')); ! // SQL queries. ! drush_log('All users of role ' . $options[$rid][0] . ' disabled.', 'success'); }
  • 32. Links • https://drupal.org/node/594744 - Drush on Windows • https://drupal.org/node/1791676 - Drush on *nix • http://drushmake.me - Drush make • http://drush.ws • https://gist.github.com/Sanchiz/7627657
  • 33. THANK YOU! ! Email: alexander.schedrov@gmail.com Twitter: @alexschedrov FB: schedrov http://sanchiz.net