Skip to content

wenroo/drupal-theme-cookbook

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 

Repository files navigation

Drupal Theme Cookbook

Drupal 7

Quick Drupal

Quick install Drupal, Themes, Modules, libraries

Install

https://www.drupal.org/project/drupal

$ drush(#drush) dl drupal

$ mv drupal... siteName

$ cp siteName/sites/default/default.settings.php  siteName/sites/default/settings.php

$ mysql -udbuser -pdbpassword

$ mysql> create database sitedb

$ mkdir files
# Apache need write (chmod a+w files)

# Open in the browser

Multi-site Config

$ cp example.sites.php site.php

$ vim sites.php
# $sites['drupal7.wenroo.com'] = 'example.com';

$ cp siteName/sites/default siteName/sites/example.com

$ cp siteName/sites/example.com/defaule.settings.php siteName/sites/example.com/settings.php

Database Settings

#  Theme Database

$databases = array (
'default' =>
   array (
     'default' =>
     array (
       'database' => '',
       'username' => '',
       'password' => '',
       'host' => '',
       'port' => '',
       'driver' => 'mysql',
       'prefix' => '',
     ),
   ),
);


# Theme Debug (More suitable on drupal 8)
# $conf['theme_debug'] = TRUE;


# m.site.com use mobi theme

#  $http_host = explode('.', $_SERVER['HTTP_HOST']);
#  if ($http_host[0] == 'm') {
# 	   $conf['site_name'] = 'mobile site';
#    $conf['theme_default'] = 'mobile';
#  }

Tools

Use Editor, compiler tools, management tools, auxiliary tools to effectively handle the responsibilities

SSH Command Used

#Search
grep -r 'wenroo' modules/

Git Command Used

git clone
git pull
git status  #check
git add file
git commit -m  ''
git push

#add and commit
git commit -am ''

# merge self
git fetch origin branch
# merge auto
git pull origin branch

# merge one by one conflict
git rebase
# merge finsh conflict
git merge

# Cancel local changes
git checkout filename

# Graphical management 图形化管理工具
git gui  #https://git-scm.com/docs/git-gui

# Checkout new branch and don't need commint
git stash       #Save
git stash list  #view
git stash pop   #merge
git stash clear #remove

# change user info
git config --global user.name username
git config --global user.mail [email protected]

# ignore files
vi .gitignore    #Current
vim ~/.gitconfig #Global

# local sources #本地源
git remote -v #View
git remote set-url origin [email protected]:wenroo/drupal-theme-cookbook.git  #edit

# Svn to Git
git svn clone -s http://.....  #Clone
git svn rebase  #pull
git svn dcommit #Push

Drush Command Used

#Export database
drush sql-dump > ./db.sql

#Export gzip database
# mysqldump -p site > db.sql

drush sql-dump > db.sql —gzip —result=/backups/example.sql
# —destination=/backups/example.tar

# Import database From settings.php
drush sql‐cli < db.sql

# Clear datebase
drush sql-drop

# Clear cache
drush cc all

# Login Once
drush uli

# Change password
drush upwd root --password="****"

# 用户登录超过5次锁定解除
drush sqlq "DELETE FROM flood"

# Overall backup
drush ard
drush arr
--db-url=mysql://root:***@localhost/Site site.tar.gz

# Make Download
drush make --no-core file.make.yml ../../

# Revert Features
drush features-revert-all

About

Drupal Theme Cookbook

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published