ShapeFileImport.php 692 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. /**
  3. * This class extends ShapeFile class to cater the following phpMyAdmin
  4. * specific requirements.
  5. */
  6. declare(strict_types=1);
  7. namespace PhpMyAdmin\Plugins\Import;
  8. use PhpMyAdmin\ShapeFile\ShapeFile;
  9. /**
  10. * ShapeFileImport class
  11. */
  12. class ShapeFileImport extends ShapeFile
  13. {
  14. /**
  15. * Reads given number of bytes from SHP file
  16. *
  17. * @param int $bytes number of bytes
  18. *
  19. * @return string|false
  20. */
  21. public function readSHP(int $bytes)
  22. {
  23. return ImportShp::readFromBuffer($bytes);
  24. }
  25. /**
  26. * Checks whether file is at EOF
  27. */
  28. public function eofSHP(): bool
  29. {
  30. global $eof;
  31. return (bool) $eof;
  32. }
  33. }