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

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

Graph Query Language do Facebook tạo ra từ năm 2012

Average: 9.5 (13 votes)

Làm thế nào để tương tác với hệ sinh thái của React JS hiệu quả

Average: 9.4 (13 votes)

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

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

 
Resizing Fields in Drupal 8 Without Losing Data
Hướng dẫn Resizing Fields trong Drupal 8 để không bị Losing Data

Drupal's field system is awesome and it is one of the reasons why I started using Drupal in the first place. However, there are some small limitations in it which surface from time to time.

9 lý do “ép” iPad 3 phải xuất hiện vào đầu năm 2012
9 lý do “ép” iPad 3 phải xuất hiện vào đầu năm 2012

Theo một số nhà phân tích, Apple sẽ phải cho iPad 3 ra mắt vào quý 1 năm 2012 để có thể tiếp tục chiếm lĩnh thị trường máy tính bảng.

Hướng dẫn tạo Drupal Views Relationships và Entity References phức tạp
Hướng dẫn tạo Drupal Views Relationships và Entity References phức tạp

Drupal has some powerful tools for creating and managing complex content relationships. Views relationships using Entity References across more than one content type