ProfilerStorageInterface.php 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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 since 4.2
  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 string $ip The IP
  30. * @param string $url The URL
  31. * @param string $limit The maximum number of tokens to return
  32. * @param string $method The request method
  33. * @param int|null $start The start date to search from
  34. * @param int|null $end The end date to search to
  35. *
  36. * @return array An array of tokens
  37. */
  38. public function find($ip, $url, $limit, $method, $start = null, $end = null);
  39. /**
  40. * Reads data associated with the given token.
  41. *
  42. * The method returns false if the token does not exist in the storage.
  43. *
  44. * @param string $token A token
  45. *
  46. * @return Profile The profile associated with token
  47. */
  48. public function read($token);
  49. /**
  50. * Saves a Profile.
  51. *
  52. * @return bool Write operation successful
  53. */
  54. public function write(Profile $profile);
  55. /**
  56. * Purges all data from the database.
  57. */
  58. public function purge();
  59. }