您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

GitDriver.php 1.0KB

1234567891011121314151617181920212223242526272829303132333435363738
  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\Vcs;
  11. use Composer\Cache;
  12. use Composer\Repository\Vcs\GitDriver as BaseGitDriver;
  13. /**
  14. * Git vcs driver.
  15. *
  16. * @author François Pluchino <francois.pluchino@gmail.com>
  17. */
  18. class GitDriver extends BaseGitDriver
  19. {
  20. /**
  21. * @var Cache
  22. */
  23. protected $cache;
  24. /**
  25. * {@inheritdoc}
  26. */
  27. public function getComposerInformation($identifier)
  28. {
  29. $resource = sprintf('%s:%s', escapeshellarg($identifier), $this->repoConfig['filename']);
  30. return ProcessUtil::getComposerInformation($this->cache, $this->infoCache, $this->repoConfig['asset-type'], $this->process, $identifier, $resource, sprintf('git show %s', $resource), sprintf('git log -1 --format=%%at %s', escapeshellarg($identifier)), $this->repoDir, '@');
  31. }
  32. }