Drupal

drush install site

Download [Drush][1]

replace username, password, host and dbname:

$ cd /wwwroot
$ drush dl
$ mv drupl-7.x example
$ cd example
$ drush site-install standard --db-url=mysql://username:password@host/dbname
$ chmod 777 sites/default/files
$ drush st
        

Git the dev folder

join [github][2], create new repo

$ git config --global user.name "User" <br/>
$ git config --global user.email foo@bar.com <br/>
$ cd sites/default <br/>
$ git init <br/>
$ echo -e "settings.php\nfiles" > .gitignore <br/>
$ git add . <br/>
$ git commit -m "init"

Sample data

Use [feeds][3] and [UUID][4] module you can easily create a clean set of sample data for development.

$ drush dl feeds uuid
$ drush en feeds feeds_ui uuid

go to http://drupal/admin/build/feeds/create to create new importer for your content type:

  • Basic Settings: Attach to content type: Use standalone form (you will bind content type on node processor) Minimum refresh period: Never (do it manually)
  • Fetcher: File upload
  • Parser: CSV parser
  • Processor: Node processor Content type: set your target content type Update existing nodes: Replace existing nodes

Mapping
Make sure map your ID column (in csv file) to GUID target, and check Unique target box.

go to http://drupal/import to import your csv file

get absolute path of document root

example:

$path = realpath('./') . '/' . drupal_get_path('theme', 'my_theme'); 

single script access all module functions

add these lines

require 'includes/bootstrap.inc';
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);

[1]: http://drupal.org/project/drush [2]: http://github.com/ [3]: http://drupal.org/project/feeds [4]: http://drupal.org/project/uuid

Search Blog: