InvalidGitExecutableException.class.php 790 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. /**
  3. * Custom exception when the git executable is invalid
  4. *
  5. * @author Christopher Han <xiphux@gmail.com>
  6. * @copyright Copyright (c) 2012 Christopher Han
  7. * @package GitPHP
  8. * @subpackage Exception
  9. */
  10. class GitPHP_InvalidGitExecutableException extends GitPHP_MessageException
  11. {
  12. /**
  13. * Executable
  14. *
  15. * @var string
  16. */
  17. public $Executable;
  18. /**
  19. * Constructor
  20. *
  21. * @param string $exe executable
  22. * @param string $message message
  23. * @param int $code exception code
  24. */
  25. public function __construct($exe, $message = '', $code = 0)
  26. {
  27. $this->Executable = $exe;
  28. if (empty($message))
  29. $message = sprintf('Could not run the git executable "%1$s". You may need to set the "%2$s" config value.', $exe, 'gitbin');
  30. parent::__construct($message, true, 500, $code);
  31. }
  32. }