ProfilerStorageInterface.php 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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. * @author Fabien Potencier <fabien@symfony.com>
  15. */
  16. interface ProfilerStorageInterface
  17. {
  18. /**
  19. * Finds profiler tokens for the given criteria.
  20. *
  21. * @param string $ip The IP
  22. * @param string $url The URL
  23. * @param string $limit The maximum number of tokens to return
  24. * @param string $method The request method
  25. * @param int|null $start The start date to search from
  26. * @param int|null $end The end date to search to
  27. *
  28. * @return array An array of tokens
  29. */
  30. public function find($ip, $url, $limit, $method, $start = null, $end = null);
  31. /**
  32. * Reads data associated with the given token.
  33. *
  34. * The method returns false if the token does not exist in the storage.
  35. *
  36. * @param string $token A token
  37. *
  38. * @return Profile The profile associated with token
  39. */
  40. public function read($token);
  41. /**
  42. * Saves a Profile.
  43. *
  44. * @param Profile $profile A Profile instance
  45. *
  46. * @return Boolean Write operation successful
  47. */
  48. public function write(Profile $profile);
  49. /**
  50. * Purges all data from the database.
  51. */
  52. public function purge();
  53. }