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.

60 lines
1.6 KiB

3 years ago
  1. <?php
  2. /*
  3. * This file is part of the Symfony package.
  4. *
  5. * (c) Fabien Potencier <fabien@symfony.com>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Symfony\Component\HttpKernel\Profiler;
  11. /**
  12. * ProfilerStorageInterface.
  13. *
  14. * This interface exists for historical reasons. The only supported
  15. * implementation is FileProfilerStorage.
  16. *
  17. * As the profiler must only be used on non-production servers, the file storage
  18. * is more than enough and no other implementations will ever be supported.
  19. *
  20. * @internal
  21. *
  22. * @author Fabien Potencier <fabien@symfony.com>
  23. */
  24. interface ProfilerStorageInterface
  25. {
  26. /**
  27. * Finds profiler tokens for the given criteria.
  28. *
  29. * @param int|null $limit The maximum number of tokens to return
  30. * @param int|null $start The start date to search from
  31. * @param int|null $end The end date to search to
  32. *
  33. * @return array An array of tokens
  34. */
  35. public function find(?string $ip, ?string $url, ?int $limit, ?string $method, int $start = null, int $end = null): array;
  36. /**
  37. * Reads data associated with the given token.
  38. *
  39. * The method returns false if the token does not exist in the storage.
  40. *
  41. * @return Profile|null The profile associated with token
  42. */
  43. public function read(string $token): ?Profile;
  44. /**
  45. * Saves a Profile.
  46. *
  47. * @return bool Write operation successful
  48. */
  49. public function write(Profile $profile): bool;
  50. /**
  51. * Purges all data from the database.
  52. */
  53. public function purge();
  54. }