You are here

function _coder_review_modified in Coder 7.2

Same name and namespace in other branches
  1. 7 coder_review/coder_review.module \_coder_review_modified()

Determines most recent modification timestamp of key coder_review code files.

Return value

int A Unix timestamp that represents the latest time that any of the key code files that are part of the coder_review module was modified.

1 call to _coder_review_modified()
do_coder_reviews in coder_review/coder_review.common.inc
Performs coder reviews for multiple code review definition files.

File

coder_review/coder_review.common.inc, line 137
Common functions used by both the drush and form interfaces.

Code

function _coder_review_modified() {
  static $cached_mtime = 0;
  if (!$cached_mtime) {

    // Create a list of all files whose timestamps are worth checking.
    $files[] = _coder_review_file_path() . '/coder_review.module';
    $files[] = _coder_review_file_path() . '/coder_review.common.inc';
    foreach (coder_review_reviews() as $review) {
      $files[] = $review['#file'];
    }

    // Find the newest filetime.
    foreach ($files as $file) {
      $mtime = filemtime($file);
      if ($mtime > $cached_mtime) {
        $cached_mtime = $mtime;
      }
    }
  }
  return $cached_mtime;
}