function package_handler_validate

8.0.x wget.inc package_handler_validate()
8.0.x git_drupalorg.inc package_handler_validate()
6.x wget.inc package_handler_validate()
6.x git_drupalorg.inc package_handler_validate()
7.x wget.inc package_handler_validate()
7.x git_drupalorg.inc package_handler_validate()
4.x wget.inc package_handler_validate()
4.x git_drupalorg.inc package_handler_validate()
4.x cvs.inc package_handler_validate()
5.x wget.inc package_handler_validate()
5.x git_drupalorg.inc package_handler_validate()
master wget.inc package_handler_validate()
master git_drupalorg.inc package_handler_validate()

Validate this package handler can run.

File

commands/pm/package_handler/wget.inc, line 10
Drush PM Wget extension

Code

function package_handler_validate() {
  // Check wget or curl command exists. Disable possible output.
  $debug = drush_get_context('DRUSH_DEBUG');
  drush_set_context('DRUSH_DEBUG', FALSE);
  $success = drush_shell_exec('wget --version');
  if (!$success) {
    $success = drush_shell_exec('curl --version');
    // Old version of curl shipped in darwin returns error status for --version
    // and --help. Give the chance to use it.
    if (!$success) {
      $success = drush_shell_exec('which curl');
    }
  }
  drush_set_context('DRUSH_DEBUG', $debug);
  if (!$success) {
    return drush_set_error('DRUSH_SHELL_COMMAND_NOT_FOUND', dt('wget nor curl executables found.'));
  }

  return TRUE;
}