用drush安裝ubercart筆記

Drupal 7.x + Ubercart 3.x

有一個更懶惰的方式可以安裝Drupal,實測沒問題唷~

# 先安裝把缺的套件補齊
sudo apt-get install drush

# 更新成最新版
sudo pear channel-discover pear.drush.org

sudo pear install drush/drush

# 昇級用指令
sudo pear upgrade drush/drush

安裝drush改用此法
http://docs.drush.org/en/master/install/

# Download latest stable release using the code below or browse to github.com/drush-ops/drush/releases.
wget http://files.drush.org/drush.phar
# Or use our upcoming release: wget http://files.drush.org/drush-unstable.phar

# Test your install.
php drush.phar core-status

# Rename to `drush` instead of `php drush.phar`. Destination can be anywhere on $PATH.
chmod +x drush.phar
sudo mv drush.phar /usr/local/bin/drush

# Optional. Enrich the bash startup file with completion and aliases.
drush init

# 安裝drupal
drush dl drupal

cd drupal-7.26/

drush status

# 建立資料庫
mysqladmin -u root create drupal_test

# 安裝指令
drush si standard --db-url=mysql://root@localhost/drupal_test

chmod -R 777 sites/default/files/

# 設置語系 PS.由於翻譯檔沒更新,所以就手動裝
wget http://ftp.drupal.org/files/translations/7.x/drupal/drupal-7.23.zh-hant.po

drush en locale

drush dl drush_language

drush language-add zh-hant

drush language-default zh-hant

drush language-enable zh-hant

drush language-import zh-hant drupal-7.23.zh-hant.po

drush vset site_default_country 'TW' -y

drush vset date_default_timezone 'Asia/Taipei' -y

# 安裝ubercart所需求的套件
drush dl module_filter colorbox pathauto uc_discounts_alt ctools rules date token uc_extra_fields_pane ds transliteration uc_optional_checkout_review email_registration ubercart uc_out_of_stock entity uc_addresses uc_product_power_tools uc_bank_transfer views google_analytics uc_coupon libraries uc_csv

# 啟用套件
drush en module_filter ctools date_api date_popup date ds ds_ui email_registration entity entity_token libraries pathauto token transliteration rules googleanalytics uc_cart uc_order uc_product uc_store uc_catalog uc_discounts uc_payment uc_reports uc_quote uc_shipping uc_cart_links uc_csv uc_extra_fields_pane uc_optional_checkout_review uc_out_of_stock uc_product_power_tools uc_stock uc_addresses uc_ajax_admin uc_flatrate uc_bank_transfer uc_coupon uc_payment_pack colorbox

drush colorbox-plugin

# 將模組中文化
drush dl drush_language

drush dl l10n_update && drush en $_

drush en l10n_update -y

drush l10n-update-refresh

drush l10n-update

# 改密碼
drush upwd --password="admin" admin

# 改裝admin_menu PS.下拉選單比預設的toolbar好用

drush dl admin_menu

drush en admin_menu admin_menu_toolbar -y

drush pm-disable toolbar

drush pm-uninstall toolbar

# 其他,有些模組因為版本的關係,需手動裝
wget http://ftp.drupal.org/files/translations/7.x/admin_menu/admin_menu-7.x-3.0-rc4.zh-hant.po

wget http://ftp.drupal.org/files/translations/7.x/colorbox/colorbox-7.x-2.4.zh-hant.po

wget http://ftp.drupal.org/files/translations/7.x/date/date-7.x-2.6.zh-hant.po

wget http://ftp.drupal.org/files/translations/7.x/entity/entity-7.x-1.2.zh-hant.po

wget http://ftp.drupal.org/files/translations/7.x/module_filter/module_filter-7.x-1.8.zh-hant.po

wget http://ftp.drupal.org/files/translations/7.x/ubercart/ubercart-7.x-3.5.zh-hant.po

wget http://ftp.drupal.org/files/translations/7.x/uc_extra_fields_pane/uc_extra_fields_pane-7.x-1.0-alpha2.zh-hant.po

drush language-import zh-hant admin_menu-7.x-3.0-rc4.zh-hant.po

更新core及modules的方法
drush pm-update projects drupal-7.xx