Anonymous 3D Imageboard http://cyberia.digital/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

56 lines
1.2KB

  1. <?php
  2. namespace Lazer\Classes\Helpers;
  3. use Lazer\Classes\LazerException;
  4. interface FileInterface {
  5. /**
  6. * Setting name of table
  7. * @param string $name
  8. * @return File
  9. */
  10. public static function table($name);
  11. /**
  12. * Set the file type
  13. * @param string $type File type (data|config)
  14. */
  15. public function setType($type);
  16. /**
  17. * Returning path to file
  18. * @return string Path to file
  19. * @throws LazerException You must specify the type of file
  20. */
  21. public function getPath();
  22. /**
  23. * Return decoded JSON
  24. * @param boolean $assoc Returns object if false; array if true
  25. * @return mixed (object|array)
  26. */
  27. public function get($assoc = false);
  28. /**
  29. * Saving encoded JSON to file
  30. * @param object|array $data
  31. * @return boolean
  32. */
  33. public function put($data);
  34. /**
  35. * Checking that file exists
  36. * @return boolean
  37. */
  38. public function exists();
  39. /**
  40. * Removing file
  41. * @return boolean
  42. * @throws LazerException If file doesn't exists or there's problems with deleting files
  43. */
  44. public function remove();
  45. }