예제 #1
0
 /**
  * (non-PHPdoc)
  * @see \MB\DashboardBundle\Model\Connector\BaseConnector::importAllCommits()
  */
 public function importAllCommits(SourceProjectInterface $project)
 {
     $result = json_decode($this->execute('/repos/' . $project->getSourceGroup()->getPath() . '/' . $project->getSourcePath() . '/commits'));
     if (isset($result->message)) {
         return array();
     } else {
         return $result;
     }
 }
예제 #2
0
 /**
  * (non-PHPdoc)
  * @see \MB\DashboardBundle\Model\Connector\ConnectorInterface::importAllCommits()
  */
 public function importAllCommits(SourceProjectInterface $project)
 {
     $commits = array();
     // Get all commits
     $startIndex = 0;
     do {
         $this->paramsGet['start'] = $startIndex;
         $result = json_decode($this->execute('/rest/api/1.0/projects/' . $project->getSourceGroup()->getPath() . '/repos/' . $project->getSourcePath() . '/commits'));
         if (isset($result->errors)) {
             return array();
         } else {
             $commits = array_merge($commits, $result->values);
             if (!$result->isLastPage) {
                 $startIndex = $result->nextPageStart;
             } else {
                 $startIndex = 0;
             }
         }
     } while ($startIndex > 0);
     return $commits;
 }