Closed (fixed)
Project:
Drush
Version:
7.x-5.0
Component:
Miscellaneous
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
28 Mar 2012 at 09:24 UTC
Updated:
12 Apr 2012 at 04:20 UTC
I want to make drush script for updating production site. (drush php-script)
In the script, i will do some drush commands and other functions with drupal api. (e.g. drush updb). How do i execute "updb" in script?
Comments
Comment #1
moshe weitzman commentedSee drush_invoke() to keep new actions in same process or drush_invoke_process() to shell out a new process.
Comment #2
greg.1.anderson commentedThere's a good article about this on Drupal Planet today: Drush rebuild utility: rebuilding Drupal development environments.
I also posted some hints in the Drush rebuild issue queue. c.f. #1507342: Take advantage of shell escaping when using drush_shell_exec, #1507322: Note that drush php-script runs your php script in a fully-bootstrapped environment & #1507310: Use drush_invoke_process instead of drush_shell_exec_interactive to call drush from drush..