IOException.php 898 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. namespace CFPropertyList;
  3. class IOException extends \Exception
  4. {
  5. const NOT_FOUND = 1;
  6. const NOT_READABLE = 2;
  7. const NOT_WRITABLE = 3;
  8. const READ_ERROR = 4;
  9. const WRITE_ERROR = 5;
  10. public function __construct($path, $type = null)
  11. {
  12. parent::__construct($path, $type);
  13. }
  14. public static function notFound($path)
  15. {
  16. return new IOException($path, self::NOT_FOUND);
  17. }
  18. public static function notReadable($path)
  19. {
  20. return new IOException($path, self::NOT_READABLE);
  21. }
  22. public static function notWritable($path)
  23. {
  24. return new IOException($path, self::NOT_WRITABLE);
  25. }
  26. public static function readError($path)
  27. {
  28. return new IOException($path, self::READ_ERROR);
  29. }
  30. public static function writeError($path)
  31. {
  32. return new IOException($path, self::WRITE_ERROR);
  33. }
  34. }
  35. ?>