summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStella Power2011-03-07 16:32:26 (GMT)
committer Stella Power2011-03-07 16:32:26 (GMT)
commitd3c4a8e5db836a91155bbe9ed8932fe732434d82 (patch)
tree6bac66003508fdc3fd5339d1b7c85b79e6683be2
parentc6b7f2946afce64fb6080c1ce1fe86126eebb5eb (diff)
allow modules to alter the coder args and implement a hook to run before results are displayed
-rw-r--r--coder_review/coder_review.module8
1 files changed, 6 insertions, 2 deletions
diff --git a/coder_review/coder_review.module b/coder_review/coder_review.module
index 4ad8393..8d179e2 100644
--- a/coder_review/coder_review.module
+++ b/coder_review/coder_review.module
@@ -874,11 +874,15 @@ function coder_review_page_form($form, &$form_state, $arg = '') {
'#php_extensions' => $php_extensions,
'#include_extensions' => $include_extensions,
'#ignore_lines' => (isset($ignores[$filename]) && is_array($ignores[$filename])) ? $ignores[$filename] : array(),
+ '#cache' => TRUE,
);
+ drupal_alter('coder_review_args', $coder_args);
$results = do_coder_reviews($coder_args);
$stats[$filename] = $results['#stats'];
unset($results['#stats']);
+ module_invoke_all('coder_review_results_view', $results);
+
// Output the results in a collapsible fieldset.
$form[$name] = array(
'#type' => 'fieldset',
@@ -1099,7 +1103,7 @@ function _coder_review_modified() {
*/
function do_coder_reviews($coder_args) {
// Load the cached results if they exist, but not for patches.
- if (empty($coder_args['#patch']) && empty($coder_args['#test'])) {
+ if (empty($coder_args['#patch']) && empty($coder_args['#test']) && !$coder_args['#cache']) {
$cache_key = 'coder:' . md5(implode(':', array_keys($coder_args['#reviews']))) . $coder_args['#severity'] . ':' . $coder_args['#filename'];
if (file_exists($filepath = realpath($coder_args['#filename']))) {
$cache_mtime = filemtime($filepath);
@@ -1153,7 +1157,7 @@ function do_coder_reviews($coder_args) {
}
// Save the results in the cache if we're not reviewing a patch.
- if (empty($coder_args['#patch']) && empty($coder_args['#test']) && isset($cache_mtime)) {
+ if (empty($coder_args['#patch']) && empty($coder_args['#test']) && !$coder_args['#cache'] && isset($cache_mtime)) {
$cache_results = array(
'mtime' => $cache_mtime,
'results' => $results,