Chỉnh sửa Magic Drush làm Bash Shell

Chỉnh sửa Magic Drush làm Bash Shell

Drush can do a lot of amazing things that escapes most people’s notice.  For example, did you know that you can change your working directory to a local site by using a site alias?

>> Chúng ta cùng thử tìm hiểu, cài đặt Drupal 8 ngay hôm nay

>> Hướng dẫn mua vé dự DrupalCon Los Angeles tháng 5 năm 2015

Just type:

    cdd @mysite

Intriguing? You can make your Drush do this trick with just a little bit of setup.  Drush has always offered a wide range of configuration options, but many Drush users never get deep enough into the documentation to take advantage of these capabilities.  Now, though, it is really easy to get started. In Drush 8.0.0-rc3, there is a new command, core-init (aliased to simply init) to help you get started with a new setup.  To run it, just type:

    drush init

This will print out a list of all of the things that Drush does to set up your configuration for you; one of the things that it does is update your Bash configuration file. It is important to remember, though, that the Bash shell only reads its configuration file when it first starts up. Therefore, after you run drush init, you should also reload your Bash configuration:

    source ~/.bashrc

You have to do this in every open terminal window, but it is only necessary to do this once; if you have too many terminal windows open, you might find it simpler to just restart. Either way, once your Bash configuration has been sourced, you will have a wide range of new shortcuts at your disposal.  For example:

Alias Action
ev ‘return node_load(3);’ Run node_load(3) and print the result.
cc Clear the cache on a Drupal 7 site.
cr Rebuild the cache on a Drupal 8 site.
q 'show tables;' Run an SQL query and print the result.
lsa List all local site aliases.

You can also customize the shortcuts to meet your liking.  Just open up the file ~/.drush/drush.bashrc, and follow the pattern of the aliases that already exist there. Additionally, there is even more customization options available in the file ~/.drush/drushrc.php. Take a look, and see what Drush can do for you!

Bạn thấy bài viết này như thế nào?: 
No votes yet
Ảnh của Tommy Tran

Tommy owner Express Magazine

Drupal Developer having 9+ year experience, implementation and having strong knowledge of technical specifications, workflow development. Ability to perform effectively and efficiently in team and individually. Always enthusiastic and interseted to study new technologies

  • Skype ID: tthanhthuy

Tìm kiếm bất động sản

 

Advertisement

 

jobsora

Dich vu khu trung tphcm

Dich vu diet chuot tphcm

Dich vu diet con trung

Quảng Cáo Bài Viết

 
Phễu traffic - Phễu bán hàng trở thành một xu thế tất yếu trong Marketing Online

Phễu traffic - Phễu bán hàng trở thành một xu thế tất yếu trong Marketing Online

Phễu bán hàng đang trở thành một xu thế tất yếu trong Marketing Online, bạn cần hiểu vào áp dụng ngay vào doanh nghiệp của bạn

Giải pháp theme_hook_suggestions và custom view modes cho templates trong Drupal 7

Giải pháp theme hook suggestions và custom view modes cho templates trong Drupal 7

 Entity view modes is a lighter-weight approach to supplying additional view modes, but I found that even it was cumbersome when it came to managing my view mode configuration in an easily-deployable way.

Lịch sử phát triển tối ưu hoá công cụ tìm kiếm - SEO

Lịch sử phát triển tối ưu hoá công cụ tìm kiếm - SEO

SEO - Google Yahoo MSN Search Engine Lịch sử phát triển tối ưu hoá công cụ tìm kiếm

Công ty diệt chuột T&C

 

Diet con trung