Creating Drush Feature to "delete all the activity logs" rather than going to the admin page "/structure/heartbeat/cache-clear" for 7.x-1.x-dev

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ramsunvtech’s picture

Status: Active » Needs review
Issue tags: +drush
FileSize
742 bytes

I have updated the drush.inc as a patch for Clear Activity logs.

Stalski’s picture

Status: Needs review » Needs work
	$items = array();

Convention is to use 2 spaces (instead of a tab). Eclipse has settings for this. Please check the complete patch for this.

}

Convention is to have an empty line between functions.

    drush_log(dt('All activity has been removed from the database.'), 'ok');
}

Convention is new empty endline.

ramsunvtech’s picture

Status: Needs work » Needs review
FileSize
879 bytes

I used coder module for the convention, below is the command and their changes in the code.
drush coder-format sites/all/modules/contrib/heartbeat/heartbeat.drush.inc

  1. Tabs become a two spaces - done
  2. No Empty line between functions - I checked out the "cache.drush.inc" and "ctools.drush.inc" codes does not have empty line between drush_log and dt functions.
  3. Two empty endline.

I have updated and attached the patch.

Stalski’s picture

    'aliases' => array('cal'),

Maybe best to namespace the alias to something heartbeat prefixed.

  }
  // Delete all the rows in the table 'heartbeat_activity'
  heartbeat_activity_delete(array(), TRUE);
  drush_log(dt('All activity has been removed from the database.'), 'ok');
}

Dot at the end of each comment.

ramsunvtech’s picture

FileSize
882 bytes

I have did code review and attached the patch again except the "namespace for the alias"

ramsunvtech’s picture

Updated the Patch File name as per Drupal Patch File Convention

Yorgg’s picture

Hey guys.

I have successfully applied many patches before, but these ones are returning " **** Only garbage was found in the patch input."
I am looking into https://drupal.org/patch/apply and nothing is mentioning this.