You are here

function _coder_review_drush_is_patch_arg in Coder 7.2

Same name and namespace in other branches
  1. 7 coder_review/coder_review.drush.inc \_coder_review_drush_is_patch_arg()

Handle patch reviews.

Parameters

??? $arg: ???, passed by reference.

??? $root: ???

Return value

??? ???

1 call to _coder_review_drush_is_patch_arg()
drush_coder_review in coder_review/coder_review.drush.inc
Performs the actual review for drush.

File

coder_review/coder_review.drush.inc, line 547
Command line utility support for Coder_review module.

Code

function _coder_review_drush_is_patch_arg(&$arg, $root) {
  if (_substr($arg, 0, 7) == 'http://') {
    return TRUE;
  }
  if (_drush() && preg_match('/\\.(patch|diff|tmp)$/', $arg)) {
    $path = preg_replace(",^{$root}/,", '', drush_cwd() . '/' . $arg);
    if (is_file($path)) {
      $arg = $path;
      return TRUE;
    }
  }
}