function _drush_is_drush_shebang_script

8.0.x drush.inc _drush_is_drush_shebang_script($script_filename)
6.x drush.inc _drush_is_drush_shebang_script($script_filename)
7.x drush.inc _drush_is_drush_shebang_script($script_filename)
4.x drush.inc _drush_is_drush_shebang_script($script_filename)
5.x drush.inc _drush_is_drush_shebang_script($script_filename)
master drush.inc _drush_is_drush_shebang_script($script_filename)

Check to see if the provided script file is a "#!/usr/bin/env drush" "shebang" script line.

1 call to _drush_is_drush_shebang_script()
drush_adjust_args_if_shebang_script in includes/command.inc
Special checking for "shebang" script handling.

File

includes/drush.inc, line 363
The drush API implementation and helpers.

Code

function _drush_is_drush_shebang_script($script_filename) {
  $result = FALSE;

  if (file_exists($script_filename)) {
    $fp = fopen($script_filename, "r");
    if ($fp !== FALSE) {
      $line = fgets($fp);
      $result = _drush_is_drush_shebang_line($line);
      fclose($fp);
    }
  }

  return $result;
}