All pastes #254301 Raw Edit

Something

public php v1 · immutable
#254301 ·published 2006-11-21 18:31 UTC
rendered paste body
<?php// $Id$/** * @file * Attempts to automate much of the tedium in updating modules between * Drupal versions. *//** * Implementation of hook_menu(). */function module_updater_menu($may_cache) {  $items = array();  if ($may_cache) {    $items[] = array(      'title' => t('Module updater'),      'path' => 'module_updater',      'callback' => 'drupal_get_form',      'callback arguments' => array('module_updater_form'),      'access' => user_access('use module updater'),    );  }  return $items;}/** * The module updater form. */function module_updater_form() {  $form['module_code'] = array(    '#type' => 'textarea',    '#rows' => 40,    '#cols' => 20,  );  return $form;}/** * Submit handler for module updater form. */function module_updater_form_submit($form_id, $form_values) {  $module_code = $form_values['module_code'];  $module_name = ''; // do some funky regex stuff to get the module name from the code.   // Run all of the private functions.  $module_code = _module_updater_make_info($name, $code) {  // Output results.  return $output;}/* * The rest of these are private throw-away functions that are * only valid when updating to the current version of Drupal, * and are not likely to be re-used in later versions of module * updater module. *//** * Create an .info file for the module. */function _module_updater_make_info($name, $code) {  return $code;}function _module_updater_hook_link($code) {  return $code;}function _module_updater_capitalize_titles($code) {  return $code;}