i am using coder_upgrade via drush through this mechanism.
created code_upgrade.drush.inc
<?php
function coder_upgrade_drush_command() {
return array(
'coder-upgrade' => array(),
);
}
function drush_coder_upgrade($name) {
$form_state = array();
$form_state['values']['extensions']['list']['module'] = 'module';
$form_state['values']['extensions']['list']['inc'] = 'inc';
$form_state['values']['extensions']['list']['info'] = 'info';
$form_state['values']['extensions']['list']['install'] = 'install';
$form_state['values']['upgrades']['list']['coder_upgrade'] = 'coder_upgrade';
$form_state['values']['directories']['list'][$name] = $name;
drupal_form_submit('coder_upgrade_conversions_form', $form_state);
}
I also added calls to drush_log in the parser and upgrade logging functions.
if (function_exists('drush_log')) {
drush_log($text);
}
this works for me (tm) , and is enough to get going.
very little polish could finish it off.
I am actually puzzled as to why coder_upgrade depends on drupal at all. It only uses drupal_alter, and even that can be worked around. It's reliance on forms is also annoying.
Comments
Comment #1
btopro commentedneeds to be in coder_upgrade.drush.inc
Comment #2
btopro commentedrolling a proper patch with tweaks to allow for multiple files to be upgraded at the same time; shortcut command is cup
Comment #3
djdevinPatch and go, works for me...timesaver.
Comment #4
aendra commentedThis is great -- I was actually able to figure out why coder_upgrade was giving me a WSOD when upgrading Highslide.
Comment #5
klausiThis should go into Coder 7.x-2.x.
my-command? Copy and paste error?
Please start all comments upper case and end with a dot.
Trailing whitespace, "arugments" typo.
missing newline.
Comment #6
klausiCoder 7.x is frozen now and will not receive updates. Coder 8.x-2.x can be used to check code for any Drupal version, Coder 8.x-2.x also supports the phpcbf command to automatically fix conding standard errors. Please check if this issue is still relevant and reopen against that version if necessary.