getLog() public méthode

All those values can be null, meaning everything.
public getLog ( array $revisions = null, array $paths = null, integer $offset = null, integer $limit = null ) : Gitonomy\Git\Log
$revisions array An array of revisions to show logs from. Can be any text value type
$paths array Restrict log to modifications occurring on given paths.
$offset integer Start from a given offset in results.
$limit integer Limit number of total results.
Résultat Gitonomy\Git\Log
Exemple #1
0
 /**
  * {@inheritdoc}
  */
 public function getCommits()
 {
     /** @var \Gitonomy\Git\Log $log */
     $log = $this->repository->getLog($this->options['revision'], null, null, $this->options['limit']);
     if (!$log->countCommits()) {
         throw new \RuntimeException('No commits found');
     }
     $this->counters['total'] = $log->countCommits();
     $commits = $log->getIterator();
     foreach ($commits as $commitData) {
         /** @var \Gitonomy\Git\Commit $commitData */
         $commit = $this->createCommit($commitData);
         if ($this->skipCommit($commit)) {
             $this->counters['skipped']++;
             continue;
         }
         $this->counters['analyzed']++;
         (yield $commit);
     }
 }
Exemple #2
0
 /**
  * Generate version string
  *
  * @param int $forthNumber optional, for x.x.x.x version
  * @param string $tag      tag for version, x.x.x.x-rc1 etc.
  *
  * @return string
  */
 public function version($forthNumber = null, $tag = "")
 {
     $commits = $this->repo->getLog()->getCommits();
     $count = count($commits);
     /** @var Commit $firstCommit */
     $firstCommit = $commits[$count - 1];
     /** @var \DateTime $startDate */
     $startDate = $firstCommit->getAuthorDate();
     $fromStart = $startDate->diff(new \DateTime('now'), true);
     $version = [0, 0, 0];
     $version[0] = $fromStart->y;
     $version[1] = $fromStart->m;
     $version[2] = $fromStart->d;
     if (!is_null($forthNumber)) {
         $version[] = $forthNumber;
     }
     $versionString = implode('.', $version);
     if (!empty($tag)) {
         $versionString .= '-' . $tag;
     }
     return $versionString;
 }
Exemple #3
0
 public function getLog($revisions = null, $paths = null, $offset = null, $limit = null)
 {
     if (null !== $paths) {
         if (is_string($paths)) {
             $paths = $this->wikiDir . $paths;
         } elseif (is_array($paths)) {
             foreach ($paths as $i => $path) {
                 $paths[$i] = $this->wikiDir . $paths;
             }
         }
     }
     return parent::getLog($revisions, $paths, $offset, $limit);
 }
 /**
  * @return Log
  */
 public function getLog($paths = null, $offset = null, $limit = null)
 {
     return $this->repository->getLog($this, $paths, $offset, $limit);
 }
Exemple #5
0
 /**
  * @param $revision
  * @param int $page
  * @param int $perPage
  * @return array
  */
 public function paginate($revision = null, $page = 1, $perPage = 10)
 {
     $this->log = $this->repository->getLog($revision, null, ($page - 1) * $perPage, $perPage);
     return $this;
 }