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

 

3000+ JavaScript Source Codes

Welcome to JavaScript Source Code 3000. With almost 800 ready-to-use Java Scripts that you can cut & paste into...

Android, Sony Ericsson Xperia Arc

Sony Ericsson Xperia Arc Review

If you’re looking for a power-packed, stylish Android phone, Sony Ericsson Xperia Arc has it all. It is one of the thinnest smartphones available these days. Not only that, but it’s also among the easiest to handle Android phones out there.

Sending a Drupal Site using HTTrack and GitHub Pages.

Sending a Drupal Site using HTTrack and GitHub Pages.

Ideas for how to gracefully retire (or semi-retire) a Drupal site using HTTrack and GitHub Pages.

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

 

Diet con trung