
Drush ဆိုတာ Drupal Web Administrator တွေ အတွက် အလွန်အသုံး၀င်တဲ့ CLI Tool တစ်ခု ဖြစ်ပါတယ်။ CLI (Command Line Interface) ဆိုတာ Linux နဲ့ ရင်းနှီးပြီးသား သူတွေ အတွက် အထူးအဆန်း မဟုတ်ပါဘူး။ အဲဒါကြောင့် သင့်ရဲ့ Drupal site ကို အလွယ်တကူ နဲ့ အမြန်ဆုံး ထိန်းချုပ်ချင်တယ် ဆိုရင်တော့ Drush ကို မြည်းစမ်း အသုံးပြုသင့်ပါတယ်။
Drush နဲ့ ဘာတွေလုပ်လို့ရလဲ ကြည့်ကြရအောင်။
Drupal site တစ်ခုတည်ဆောက်ဖို့အတွက် လိုအပ်တဲ့ Drupal Core, Modules, Themes, Installation Profiles, Translations စတဲ့ ဖိုင်များအားလုံးကို Download, Enable, Disablem Uninstall, Update စတဲ့ အလုပ်တွေအားလုံးကို CLI ကနေ လုပ်လို့ရစေပါတယ်။
ဥပမာ - drush dl drupal-7 လို့ ကျွန်တော်တို့ရဲ့ CLI မှာ ရိုက်လိုက်တာနဲ့ Hosting Server ဟာ ကျွန်တော်တို့ကိုယ်စား အခုလို အလုပ်လုပ်ပေးမှာ ဖြစ်ပါတယ်။
Drush မသုံးပဲ ပုံမှန်အတိုင်း FTP ကနေ သွားမယ်ဆိုရင် အခုလို အဆင့်ဆင့် လုပ်ရပါလိမ့်မယ်။
ဒီလို သမားရိုးကျနည်းနဲ့ဆိုရင် အင်တာနက် ကောင်းရင်တောင် အစအဆုံးပြီးဖို့ အနည်းဆုံး 5 မိနစ်လောက်တော့ ကြာမှာပါ။ ဒီထက်ကြာဖို့ပဲ ရှိပါတယ်။ Drush နဲ့ကတော့ 5 စက္ကန့်ဆိုတာ အများဆုံးပါ။ Drush ကြောင့် ကျွန်တော်တို့ဟာ Hosting Server ရဲ့ စွမ်းဆောင်ရည်နဲ့ Bandwidth ကို အပြည့်အ၀ အသုံးချခွင့် ရပြီး အချိန်တိုအတွင်းမှာ အလုပ်အများကြီး ပြီးစေနိုင်တာ ဖြစ်ပါတယ်။
ဥပမာ - Drupal Views module ကို Install လုပ်ချင်တယ်ဆိုရင် drush dl views command ကို သုံးပြီး Views module ကို ကိုယ့်ရဲ့ Web Hosting က Drupal Modules Directory ထဲကို ချက်ချင်း ဒေါင်းလုတ်ချနိုင်ပါတယ်။ ပြီးတာနဲ့ drush en views ကို သုံးပြီး Views module ကို Enable လုပ်လိုက်ရုံပါ။ ကျန်တဲ့ Modules နဲ့ Themes တွေကို Install လုပ်ရတာ၊ Enable/Disable လုပ်ရတာလည်း အလားတူပါပဲ။
Drush ရဲ့ နောက်ထပ် စွဲမက်စရာကောင်းတဲ့ Feature တစ်ခုကတော့ Update, feature ဖြစ်ပါတယ်။ Drupal Administrator တစ်ယောက်အနေနဲ့ Module တွေ အသစ်ထွက်လာတိုင်း Update လုပ်ရတာ သိပ်လွယ်လှတယ် မဟုတ်ပါဘူး။
အဆင့်တွေ မနည်းလှပါဘူး။ Drush နဲ့ ဆိုရင်တော့ drush pm-update ဆိုတဲ့ Command တစ်ခုတည်းနဲ့ အားလုံးကို Server က လုပ်ပေးသွားမှာ ဖြစ်ပါတယ်။ အင်တာနက် နှေးတဲ့ နေရာက သူတွေအတွက်၊ အလုပ်မြန်မြန်ပြီးချင်တဲ့ သူတွေအတွက် အလွန်အသုံး၀င်တဲ့ နည်းစနစ်ပါပဲ။
Drush Core မှာဆိုရင်လည်း drush cron, drush cache-clear စတဲ့ Drupal site administration အတွက် အတော် အသုံး၀င်တဲ့ Module တွေ ပါ ပါတယ်။ ပြီးတော့ Drush အတွက် သီးသန့် Customize လုပ်ထားတဲ့ bash shell လည်းရှိပါသေးတယ်။ drush cli ဆိုပြီး ရိုက်လိုက်တာနဲ့ သုံးနိုင်မှာ ဖြစ်ပါတယ်။
Drush SQL Command တွေကို အသုံးပြုပြီး ကိုယ့်ဆိုက်မှာသုံးထားတဲ့ Database တွေကို အမျိုးမျိုး Query လုပ်လို့ ရပါတယ်။ Database Migration လုပ်တဲ့ အလုပ်တွေ အတွက်လည်း Drush ကို အသုံးပြုနိုင်ပါတယ်။
Drush ကို Shared Hosting မှာ အသုံးပြုနိုင်ဖို့အတွက် အရေးအကြီးဆုံး လိုအပ်ချက်ကတော့ Shell Access ပေးတဲ့ Hosting ဖြစ်ဖို့ပါပဲ။ Shell Access မပေးရင်တော့ Shared Hosting မှာ Drush ကို သုံးလို့ ရမှာ မဟုတ်ပါဘူး။ Shared Hosting အတော်များများ ကလည်း Shell Access မပေးကြပါဘူး။ ဘာပဲဖြစ်ဖြစ် ကိုယ့် အိမ်သုံး၊ ရုံးသုံးကွန်ပျူတာတွေနဲ့ Localhost မှာတော့ စမ်းသပ် အသုံးပြုလို့ ရပါသေးတယ်။
Drush ကို Install လုပ်ပုံလုပ်နည်း ဗီဒီယိုပါ။ Windows7 မှာ WAMP, Drush နဲ့ Drupal ကို ဘယ်လို ထည့်သွင်း အသုံးပြုလို့ရတယ်ဆိုတာ ရှင်းပြထားပါတယ်။
Installing WAMP, Drush & Drupal on Windows 7 from Corey Pennycuff on Vimeo.
ဒီဗီဒီယိုမှာ ပါတဲ့ လုပ်ငန်း အစီအစဉ်တွေကို စာနဲ့ ရေးပြီး ရှင်းပြထားတဲ့ ရှင်းလင်းချက်ပါ။ https://gist.github.com/861733
Slide Source = http://www.slideshare.net/mediacurrent/drush-mc
Slide Source = http://www.slideshare.net/jdschroeder/commandline-drupal
Drush Project Page on Drupal http://drupal.org/project/drush
More Drush Commands and Detail Explanations at http://drush.ws
Add new comment