Gitlab\Api\Projects::search PHP Method

    public function search($query, $page = 1, $per_page = self::PER_PAGE, $order_by = self::ORDER_BY, $sort = self::SORT)
    {
        return $this->get('projects/search/' . $this->encodePath($query), array('page' => $page, 'per_page' => $per_page, 'order_by' => $order_by, 'sort' => $sort));
    }

Usage Example

Esempio n. 1
0
 /**
  * Check if project with name ['gitlab']['project-name'] does exist in repository.
  * @return boolean
  */
 public function checkProjectName()
 {
     $this->checkUserName($this->config['gitlab']['username']);
     $project = new Projects($this->client);
     $arrProjects = $project->search($this->config['gitlab']['project-name'], 1, 1000, 'path');
     if ($this->idgroup) {
         return $this->arraySearchValues($this->config['gitlab']['group-name'] . "/" . $this->config['gitlab']['project-name'], $arrProjects, 'path_with_namespace', 'id', $this->idproject);
     }
     return $this->arraySearchValues($this->config['gitlab']['username'] . "/" . $this->config['gitlab']['project-name'], $arrProjects, 'path_with_namespace', 'id', $this->idproject);
 }