Settings.php 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <?php
  2. namespace Sabre\VObject;
  3. /**
  4. * This class provides a list of global defaults for vobject.
  5. *
  6. * Some of these started to appear in various classes, so it made a bit more
  7. * sense to centralize them, so it's easier for user to find and change these.
  8. *
  9. * The global nature of them does mean that changing the settings for one
  10. * instance has a global influence.
  11. *
  12. * @copyright Copyright (C) fruux GmbH (https://fruux.com/)
  13. * @author Evert Pot (http://evertpot.com/)
  14. * @license http://sabre.io/license/ Modified BSD License
  15. */
  16. class Settings
  17. {
  18. /**
  19. * The minimum date we accept for various calculations with dates, such as
  20. * recurrences.
  21. *
  22. * The choice of 1900 is pretty arbitrary, but it covers most common
  23. * use-cases. In particular, it covers birthdates for virtually everyone
  24. * alive on earth, which is less than 5 people at the time of writing.
  25. */
  26. public static $minDate = '1900-01-01';
  27. /**
  28. * The maximum date we accept for various calculations with dates, such as
  29. * recurrences.
  30. *
  31. * The choice of 2100 is pretty arbitrary, but should cover most
  32. * appointments made for many years to come.
  33. */
  34. public static $maxDate = '2100-01-01';
  35. /**
  36. * The maximum number of recurrences that will be generated.
  37. *
  38. * This setting limits the maximum of recurring events that this library
  39. * generates in its recurrence iterators.
  40. *
  41. * This is a security measure. Without this, it would be possible to craft
  42. * specific events that recur many, many times, potentially DDOSing the
  43. * server.
  44. *
  45. * The default (3500) allows creation of a daily event that goes on for 10
  46. * years, which is hopefully long enough for most.
  47. *
  48. * Set this value to -1 to disable this control altogether.
  49. */
  50. public static $maxRecurrences = 3500;
  51. }