SearchDisabledException.class.php 849 B

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. /**
  3. * Custom exception when trying to perform a disabled search
  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_SearchDisabledException extends GitPHP_MessageException
  11. {
  12. /**
  13. * Whether this exception is for file searching
  14. *
  15. * @var boolean
  16. */
  17. public $FileSearch;
  18. /**
  19. * Constructor
  20. *
  21. * @param boolean $fileSearch true if filesearch
  22. * @param string $message message
  23. * @param int $code code
  24. */
  25. public function __construct($fileSearch = false, $message = '', $code = 0)
  26. {
  27. $this->FileSearch = $fileSearch;
  28. if (empty($message)) {
  29. if ($fileSearch)
  30. $message = 'File search has been disabled';
  31. else
  32. $message = 'Search has been disabled';
  33. }
  34. parent::__construct($message, true, 200, $code);
  35. }
  36. }