Code Monkey home page Code Monkey logo

client's People

Contributors

alfredbez avatar artistan avatar cdaguerre avatar donkidd avatar drumm avatar fbourigault avatar gaooulong avatar gilmiriam avatar glaubinix avatar glensc avatar grahamcampbell avatar jdecool avatar jimmy4o4 avatar jubianchi avatar laurenzgamper avatar m1guelpf avatar m4tthumphrey avatar mirko-jtl avatar moufmouf avatar mujibazizi avatar omarlopesino avatar peterjaap avatar pkolmann avatar radutopala avatar seretos avatar sidneymarieanne avatar sirflip avatar tobiasetter avatar vinkla avatar violuke avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

client's Issues

Tagged version

Could you please release tags to make it more stable/predictable for users to deploy.

function encodePath problem

I think there is something wrong with function encodePath in AbstractApi.php line 122
As Gitlab documentation says "make sure that the NAMESPACE/PROJECT_NAME is URL-encoded, eg. /api/v3/projects/diaspora%2Fdiaspora (where / is represented by %2F)."

line: rawurlencode($path); encodes path as documentation describes and
line: return str_replace(array('%2F', '.'), array('/', '%2E'), $path)
changes it back

result is 404 error
[07/May/2015:20:29:31 +0200] "GET /api/v3/projects/dd/dd?private_token=

I use earlier version of php-gitlab-api in one of my projects and it works fine

ErrorListener does not support message array

The Gitlab\HttpClient\Listener\ErrorListener will produce a Fatal error (Wrong parameters for ErrorException) when the Gitlab API returns a error message that contains an array instead of a string message. Offending line: 46

{"message":{"path":["has already been taken"]}}

This will mostly happen when an data validation error occurs. See Data validation and error reporting for possible response formats.

A simple solution could be to json encode the message when it's not a string.

Used versions: GitLab 7.4.0; GitLab API v3

PSR-4

http://www.php-fig.org/psr/psr-4/

This enables us to have a VendorName\PackageName namespace. I would suggest "php-gitlab-api\php-gitlab-api" as the vendor\package names. this may be better suited then in a GitHub organisation.
It would also allow the code structure to be a little bit neater.

It would also make the suggested adapter packages a little neater and easier to find.

Thoughts?

tag 6.10

could you please tag a new stable release? to be able to use e.g. MergeRequest::opened and rely on stable versions

Look into making models persistent

use Gitlab\Client;
use Gitlab\Model\Project;
use Gitlab\Model\Issue;

$client = new Client('http://git.yourdomain.com/api/v3/'); // change here
$client->authenticate('your_gitlab_token_here', Client::AUTH_URL_TOKEN); // change here

$project = new Project($client);
$project->name = 'A project';
$project->description = 'This is a project';
$project->save();

The following block

$issue = new Issue($client);
$issue->title = 'This is an issue';
$issue->addLabel('bug');
$issue->save();

$project->addIssue($issue);
// or
$issue->project = $project;

would be the same as

$project->createIssue('This is an issue', array(
    'labels' => array('bug')
));

Cant create a user

Hi,

I run this command

$client->api('users')->create('[email protected]','test',array('name'=>'name','username'=>'username'));

I get an error like follows:
PHP Fatal error: Uncaught exception 'Gitlab\Exception\ErrorException' with message '400 (Bad request) "email" not given' in /home/damian/public_html/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/HttpClient/Listener/ErrorListener.php:47

Not sure if this is a bug or something wrong with my setup?

Cheers

Updating users

Is there a reason that there is no functions in Gitlab\Api\Users for updating/deleting a user in gitlab?

I'd be happy to add the functionality and make a pull request just wanted to ask why first or Is it just that you didn't the functionality personally (like you said in the readme)?

Or could we just make the functions delete and put in Gitlab\Api\AbstractApi public rather than protected so they can be called on an instance of Gitlab\Api\Users (again happy to do it just wanted to ask)?

projects/search

Hi,

I think it could be nice to search projects using per_page & page parameters

Parameters:

  • query (required) - A string contained in the project name
  • per_page (optional) - number of projects to return per page
  • page (optional) - the page to retrieve

Best,
G.

GitLab.com API issue

I tried to create a new project using the example but it seems I get this error every time:
PHP Fatal error: Uncaught exception 'Gitlab\Exception\ErrorException' with message '400 (Bad request) "name" not given'

I use the hosted GitLab at gitlab.com.

Implement hook tag_push_events

The tag push events have been added to Gitlab API v7.4.0.rc1 (gitlabhq/gitlabhq@b4963e9)

What would be required to implement such feature? I was about to propose a merge request but I guess it's a bit more complicated and would require to implement all changes from Gitlab 6.9.1, according to the versionning policy.

Thanks you

Gush is integrating this library

I have heard complaints that this library does not use guzzle3 or 4.
It seems like is the only library around for gitlab that is more downloaded so far in packagist.

This ticket is to reference https://github.com/gushphp/gush-gitlab-adapter/blob/master/src/Adapter/GitLabAdapter.php#L86 and also asking for help integrating your library in.

We will first make it work then proceed to rewrite so it will use guzzle4 maybe.

Encouragements and thanks, feel welcome to contribute to Gush and join the core team ๐Ÿ‘ถ

Tree function path argument for subfolders

There's an issue with the tree function to access subfolders. It doesn't append the 'path' argument value to the url.

Example:

/repository/branches/[branchname]/[project id]/repository/tree/[path]

PHP Version support

What should be the minimum supported version of PHP? Considering 5.3 was released over 5 years ago and that 5.6 was recently released, I would suggest the library targets no less that 5.5.

Issue creating snippet

I can't work out what I'm doing wrong. I've got the following code:

<?php

require 'vendor/autoload.php';

$client = new \Gitlab\Client('https://gitlab.example.com/api/v3/'); // change here
$client->authenticate('not_actually_real', \Gitlab\Client::AUTH_URL_TOKEN); // change here

$project = new \Gitlab\Model\Project(17, $client);
$snippet = $project->createSnippet('title', 'someting.txt', 'code_is_cool');

?>

But I'm getting the following error:

Fatal error: Uncaught exception 'Gitlab\Exception\InvalidArgumentException' in /gitlab/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/Client.php:115
Stack trace:
#0 /gitlab/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/Model/AbstractModel.php(31): Gitlab\Client->api('snippets')
#1 /gitlab/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/Model/Project.php(464): Gitlab\Model\AbstractModel->api('snippets')
#2 /gitlab/test.php(24): Gitlab\Model\Project->createSnippet('title', 'someting.txt', 'code_is_cool')
#3 {main}
  thrown in /gitlab/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/Client.php on line 115

What am I doing wrong?

BREAKING CHANGE: Project hooks

The latest commit to master introduces a breaking change when managing project hooks.

Before the method signature for Api\Projects::addHook() was as follows:

public function addHook($project_id, $url, $push_events = true, $issues_events = false, $merge_requests_events = false, $tag_push_events = false)

It is now

public function addHook($project_id, $url, array $params = array('push_events' => true))

This allows the user to specify a URL (required field) and then pass an optional list of event types. As you can see, push_events are enabled by default.

Before the method signature for Api\Projects::updateHook() was as follows:

public function updateHook($project_id, $url, $push_events = true, $issues_events = false, $merge_requests_events = false, $tag_push_events = false)

It is now

public function addHook($project_id, array $params = array())

This allows the user to only update the fields they required.

This also affects the corresponding methods in Model\Project

  • public function addHook($url, array $events = array())
  • public function updateHook($hook_id, array $params)

This will be released (tagged) in the 7.9 release next month.

improve library move to guzzle 4 out of buzz

previous: #32

The library uses buzz introducing yet another dep in gush. We can move it to guzzle 4 which is suit. In addition we should start semver also bugfixes so we can change https://github.com/gushphp/gush-gitlab-adapter/blob/master/composer.json#L5 which is a mistake on the version this should require.

Gitlab support works more or less, I have tried it before. Not sure if there were things that worked differently or need more support. So if we have request please let us open tickets on gush-gitlab-adapter /cc @matthiasnoback

How to use with gitlab.com

I was wondering if i can use it with gitlab.com repos . I was unable to decide what the host param will be if using with gitlab.com

$client = new \Gitlab\Client('https://git.yourdomain.com/api/v3/'); // change here

Swap model constructor parameters around

IE

$project = new Project($client, 1);

instead of

$project = new Project(1, $client);

This would make $client mandatory but it is always passed anyway so do not see any disadvantages to this.

The `getFile()` method does not appear to return the full file content.

First thanks for this API, it works well and looks to save myself and others a ton of time.

I'm currently looking to retrieve a file contents from a given repo. I'm using the following:
$project = $client->api('repositories')->getFile( $project_id, $file_path, $ref ); which does work, but the content appears to be truncated. I know that GitHub API limits file sizes, and I haven't been able to determine if GitLabs is doing the same, my file is 4KB.

I've also tried using the blob() method.

Where do i get gitlab access_token

I have install gitlab CE in my local server and i also wanted to develop an php based application for using gitlab as Oauth2service provider . so im wondering how it will be achieved. I got up with this package and read all the documentation in read me file but one question remains me to start nothing that is where do i get a token. i have created a application in my gitlab and i have now app-id , secrete and callback url.. please help me.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.