You are here

function coder_upgrade_upgrade_call_function_exists_alter in Coder 7.2

Same name and namespace in other branches
  1. 7 coder_upgrade/conversions/call.inc \coder_upgrade_upgrade_call_function_exists_alter()

Implements hook_upgrade_call_function_exists_alter().

File

coder_upgrade/conversions/call.inc, line 1761
Provides conversion routines applied to function calls.

Code

function coder_upgrade_upgrade_call_function_exists_alter(&$node, &$reader) {

  // DONE
  // Create helper objects.
  $editor = PGPEditor::getInstance();

  // Get the function call object.
  $item =& $node->data;

  // Process function call.
  $name =& $item->name;

  // Change was reverted.
  //      $name['value'] = 'drupal_function_exists';
  // Change: db_is_active
  $p0 = trim($item
    ->getParameter()
    ->stripComments()
    ->toString(), "'\"");
  if ($p0 == 'db_is_active') {

    // Replace with "class_exists('Database', FALSE)".
    $item->name['value'] = 'class_exists';
    $editor
      ->setParameters($item, array(
      "'Database'",
      'FALSE',
    ));
  }
}