VcsDriverInterface.php 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. <?php
  2. namespace Composer\Repository\Vcs;
  3. /**
  4. * @author Jordi Boggiano <j.boggiano@seld.be>
  5. */
  6. interface VcsDriverInterface
  7. {
  8. /**
  9. * Initializes the driver (git clone, svn checkout, fetch info etc)
  10. */
  11. function initialize();
  12. /**
  13. * Return the composer.json file information
  14. *
  15. * @param string $identifier Any identifier to a specific branch/tag/commit
  16. * @return array containing all infos from the composer.json file
  17. */
  18. function getComposerInformation($identifier);
  19. /**
  20. * Return the root identifier (trunk, master, default/tip ..)
  21. *
  22. * @return string Identifier
  23. */
  24. function getRootIdentifier();
  25. /**
  26. * Return list of branches in the repository
  27. *
  28. * @return array Branch names as keys, identifiers as values
  29. */
  30. function getBranches();
  31. /**
  32. * Return list of tags in the repository
  33. *
  34. * @return array Tag names as keys, identifiers as values
  35. */
  36. function getTags();
  37. /**
  38. * @param string $identifier Any identifier to a specific branch/tag/commit
  39. * @return array With type, url reference and shasum keys.
  40. */
  41. function getDist($identifier);
  42. /**
  43. * @param string $identifier Any identifier to a specific branch/tag/commit
  44. * @return array With type, url and reference keys.
  45. */
  46. function getSource($identifier);
  47. /**
  48. * Return the URL of the repository
  49. *
  50. * @return string
  51. */
  52. function getUrl();
  53. /**
  54. * Return true if the repository has a composer file for a given identifier,
  55. * false otherwise.
  56. *
  57. * @param string $identifier Any identifier to a specific branch/tag/commit
  58. * @return boolean Whether the repository has a composer file for a given identifier.
  59. */
  60. function hasComposerFile($identifier);
  61. /**
  62. * Checks if this driver can handle a given url
  63. *
  64. * @param string $url
  65. * @param Boolean $shallow unless true, only shallow checks (url matching typically) should be done
  66. * @return Boolean
  67. */
  68. static function supports($url, $deep = false);
  69. }