UrlMatchs.php 1.4KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <?php
  2. namespace Muzich\CoreBundle\Factory;
  3. use Muzich\CoreBundle\Entity\Element;
  4. class UrlMatchs
  5. {
  6. /*
  7. * Si il y a un Element::TYPE_NOTMATCH le placer en début de tableau !
  8. */
  9. public static $jamendo = array(
  10. Element::TYPE_TRACK => array(
  11. // http://www.jamendo.com/fr/track/894974
  12. "#^\/[a-zA-Z0-9_-]+\/track\/([0-9]+)#" => 1,
  13. // http://www.jamendo.com/fr/track/347602/come-come
  14. "#^\/[a-zA-Z0-9_-]+\/track\/([0-9]+)\/.#" => 1
  15. ),
  16. Element::TYPE_ALBUM => array(
  17. // http://www.jamendo.com/fr/album/3409
  18. "#^\/[a-zA-Z0-9_-]+\/album\/([0-9]+)#" => 1,
  19. // http://www.jamendo.com/fr/list/a45666/proceed-positron...
  20. "#^\/[a-zA-Z0-9_-]+\/list\/a([0-9]+)\/.#" => 1
  21. )
  22. );
  23. public static $soundcloud = array(
  24. Element::TYPE_NOTMATCH => array(
  25. "#\/search\?q#" => null
  26. ),
  27. Element::TYPE_OTHER => array(
  28. // http://soundcloud.com/matas/sets/library-project
  29. "#^\/[a-zA-Z0-9_-]+\/sets\/[a-zA-Z0-9_-]+#" => null,
  30. // http://soundcloud.com/noisia/black-sun-empire-noisia-feed
  31. // http://soundcloud.com/user4818423/mechanika-crew-andrew-dj-set
  32. "#^\/[a-zA-Z0-9_-]+\/[a-zA-Z0-9_-]+#" => null
  33. )
  34. );
  35. public static $dailymotion = array(
  36. Element::TYPE_OTHER => array(
  37. // http://dailymotion.com/video/xnqcwx_le-nazisme-dans-le-couple_fun#hp-v-v2
  38. "#\/(video\/)([a-zA-Z0-9]+)([a-zA-Z0-9_-]*)#" => 2
  39. )
  40. );
  41. }