You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

BowerRepository.php 1.3KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <?php
  2. /*
  3. * This file is part of the Fxp Composer Asset Plugin package.
  4. *
  5. * (c) François Pluchino <francois.pluchino@gmail.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 Fxp\Composer\AssetPlugin\Repository;
  11. /**
  12. * Bower repository.
  13. *
  14. * @author François Pluchino <francois.pluchino@gmail.com>
  15. */
  16. class BowerRepository extends AbstractAssetsRepository
  17. {
  18. /**
  19. * {@inheritdoc}
  20. */
  21. protected function getType()
  22. {
  23. return 'bower';
  24. }
  25. /**
  26. * {@inheritdoc}
  27. */
  28. protected function getUrl()
  29. {
  30. return 'https://bower.herokuapp.com/packages';
  31. }
  32. /**
  33. * {@inheritdoc}
  34. */
  35. protected function getPackageUrl()
  36. {
  37. return $this->canonicalizeUrl($this->baseUrl.'/%package%');
  38. }
  39. /**
  40. * {@inheritdoc}
  41. */
  42. protected function getSearchUrl()
  43. {
  44. return $this->canonicalizeUrl($this->baseUrl.'/search/%query%');
  45. }
  46. /**
  47. * {@inheritdoc}
  48. */
  49. protected function createVcsRepositoryConfig(array $data, $registryName = null)
  50. {
  51. return array(
  52. 'type' => $this->assetType->getName().'-vcs',
  53. 'url' => $data['url'],
  54. 'name' => $registryName,
  55. );
  56. }
  57. }