Skip to content

Some minor tweaks and additions. #7

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 25 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
826fb3f
Gists API integration: get list by username and
erivello Jun 27, 2012
c53e1ba
added gist api to client
erivello Jun 27, 2012
8de6339
gist create api
erivello Jun 27, 2012
5245ad5
create gist api refactor
erivello Jun 27, 2012
4baecb7
delete gist api
erivello Jun 27, 2012
5acc889
gist api functional test for getList method
erivello Jun 28, 2012
690a969
gist api refactor: renamed delete method in remove method
erivello Jun 28, 2012
1d3d647
unit tests for gist api
erivello Jun 28, 2012
58bc417
functional test for gist api: get by id
erivello Jun 28, 2012
b8c1502
comment fix for gist api
erivello Jun 28, 2012
36701a5
fix gist api documentation
erivello Jul 8, 2012
2adb045
added delete method to gist api
erivello Jul 8, 2012
2dc6c87
readme update
erivello Jul 8, 2012
a617177
readme update
erivello Jul 8, 2012
4812621
pull request fixes
erivello Jul 9, 2012
49bb59e
Gists API integration
erivello Jun 27, 2012
870ab57
Merge branch 'master' of https://github.com/erivello/php-github-api
erivello Jul 11, 2012
678b845
Added getRepoHooks to RepoApi
leevigraham Jul 15, 2012
e3c4747
Added repo hook methods:
leevigraham Jul 15, 2012
faca496
Merge branch 'master' of git://github.com/leevigraham/php-github-api
nickl- Jul 15, 2012
f873cec
slightly more elaborate gitignore
nickl- Jul 15, 2012
020d366
Every project needs a phpunit.xml
nickl- Jul 15, 2012
12b2124
A bootstrap.php which will not leave you wanting
nickl- Jul 15, 2012
560a2a2
Sing with me PSR PSR PSR-0
nickl- Jul 17, 2012
55fed80
In the left hand see I hold a coin.
nickl- Jul 17, 2012
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
composer.lock
composer.phar
vendor/*
#<? a Courtesy of Respect/Foundation
.foundation
*.tgz
*.phar
*.lock
*tmp
scratch/*
test/reports
vendor
96 changes: 93 additions & 3 deletions README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ From this object, you can access to all GitHub apis, listed below.
<a name='nav'></a>
## Navigation

[Users][] | [Issues][] | [Commits][] | [Objects][] | [Repos][] | [Pull Requests][] | [Request any Route][] | [Authentication & Security][] | [Customize php-github-api][] | [Run Test Suite][]
[Users][] | [Issues][] | [Commits][] | [Objects][] | [Repos][] | [Pull Requests][] | [Gists][] | [Request any Route][] | [Authentication & Security][] | [Customize php-github-api][] | [Run Test Suite][]

<a name='users'></a>
## Users
Expand Down Expand Up @@ -556,8 +556,6 @@ To include non GitHub users, add a third parameter to true:
```




<a name='pull_requests'></a>
## Pull Requests
<a href='#nav' alt='Back to the navigation'>Go back to the Navigation</a>
Expand Down Expand Up @@ -629,6 +627,97 @@ Requires authentication. The issue ID is provided instead of title and body.
This returns the details of the pull request.


<a name='gists'></a>
## Gists
<a href='#nav' alt='Back to the navigation'>Go back to the Navigation</a>

Creating, editing, deleting and listing gists. Wraps [GitHub Gists API](http://developer.github.com/v3/gists/).

#### List gists of a specific user

```php
$gists = $github->getGistApi()->getListByUser( 'ornicar' );
```

#### List all public gists.

```php
$gists = $github->getGistApi()->getPublicList();
```

#### List the authenticated user’s starred gists.

```php
$gists = $github->getGistApi()->getStarredList();
```

Requires authentication.

#### List the authenticated user’s gists or if called anonymously, this will return all public gists.

```php
$gists = $github->getGistApi()->getList();
```

#### Get a single gist

```php
$gist = $github->getGistApi()->getGist( 1 );
```

#### Create a gist

```php
$files = array( 'filename.txt' => array( 'content' => 'txt file content' ));
$gist = $github->getGistApi()->create( $files, true, 'This is an optional description' );
```

Creates and returns a public gist.

#### Update a gist

You can update ``description``.

```php
$files = array();
$gist = $github->getGistApi()->update( 1234, $files, 'This is a new description' );
```

You can update ``content`` of a previous file's version.

```php
$files = array( 'filename.txt' => array( 'content' => 'updated txt file content' ));
$gist = $github->getGistApi()->update( 1234, $files );
```

You can update the ``filename`` of a previous file's version.

```php
$files = array( 'filename.txt' => array( 'filename' => 'new-filename.txt' ));
$gist = $github->getGistApi()->update( 1234, $files );
```

You can add a new file to the gist.

```php
$files = array( 'new-filename.php' => array( 'content' => 'a new file content' ));
$gist = $github->getGistApi()->update( 1234, $files );
```

You can remove a file from the gist.

```php
$files = array( 'filename.txt' => null );
$gist = $github->getGistApi()->update( 1234, $files );
```

#### Delete a gist

```php
$gist = $github->getGistApi()->remove( 1234 );
```


<a name='request_any_route'></a>
## Request any Route
<a href='#nav' alt='Back to the navigation'>Go back to the Navigation</a>
Expand Down Expand Up @@ -770,6 +859,7 @@ Thanks to GitHub for the high quality API and documentation.
[Commits]: #commits
[Objects]: #objects
[Repos]: #repos
[Gists]: #gists
[Pull Requests]: #pull_requests
[Request any Route]: #request_any_route
[Authentication & Security]: #authentication_and_security
Expand Down
236 changes: 236 additions & 0 deletions doc/classes/Github.Api.Api.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,236 @@
<!DOCTYPE html><html xmlns:date="http://exslt.org/dates-and-times" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
<meta charset="utf-8">
<title>phpDocumentor » \Github\Api\Api</title>
<meta name="author" content="Mike van Riel">
<meta name="description" content="">
<link href="../css/template.css" rel="stylesheet" media="all">
<script src="../js/jquery-1.7.1.min.js" type="text/javascript"></script><script src="../js/jquery-ui-1.8.2.custom.min.js" type="text/javascript"></script><script src="../js/jquery.mousewheel.min.js" type="text/javascript"></script><script src="../js/bootstrap.js" type="text/javascript"></script><script src="../js/template.js" type="text/javascript"></script><script src="../js/prettify/prettify.min.js" type="text/javascript"></script><link rel="shortcut icon" href="../img/favicon.ico">
<link rel="apple-touch-icon" href="../img/apple-touch-icon.png">
<link rel="apple-touch-icon" sizes="72x72" href="../img/apple-touch-icon-72x72.png">
<link rel="apple-touch-icon" sizes="114x114" href="../img/apple-touch-icon-114x114.png">
</head>
<body>
<div class="navbar navbar-fixed-top">
<div class="navbar-inner"><div class="container">
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse"><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span></a><a class="brand" href="../index.html">phpDocumentor</a><div class="nav-collapse"><ul class="nav">
<li class="dropdown">
<a href="#api" class="dropdown-toggle" data-toggle="dropdown">
API Documentation <b class="caret"></b></a><ul class="dropdown-menu">
<li><a>Namespaces</a></li>
<li><a href="../namespaces/Github.html"><i class="icon-th"></i> Github</a></li>
</ul>
</li>
<li class="dropdown" id="charts-menu">
<a href="#charts" class="dropdown-toggle" data-toggle="dropdown">
Charts <b class="caret"></b></a><ul class="dropdown-menu"><li><a href="../graph_class.html"><i class="icon-list-alt"></i> Class hierarchy diagram</a></li></ul>
</li>
<li class="dropdown" id="reports-menu">
<a href="#reports" class="dropdown-toggle" data-toggle="dropdown">
Reports <b class="caret"></b></a><ul class="dropdown-menu">
<li><a href="../errors.html"><i class="icon-remove-sign"></i> Errors 
<span class="label label-info">68</span></a></li>
<li><a href="../markers.html"><i class="icon-map-marker"></i> Markers 
<ul></ul></a></li>
<li><a href="../deprecated.html"><i class="icon-stop"></i> Deprecated elements 
<span class="label label-info">0</span></a></li>
</ul>
</li>
</ul></div>
</div></div>
<div class="go_to_top"><a href="#___" style="color: inherit">Back to top  <i class="icon-upload icon-white"></i></a></div>
</div>
<div id="___" class="container">
<noscript><div class="alert alert-warning">
Javascript is disabled; several features are only available
if Javascript is enabled.
</div></noscript>
<div class="row">
<div class="span4">
<span class="btn-group visibility" data-toggle="buttons-checkbox"><button class="btn public active" title="Show public elements">Public</button><button class="btn protected" title="Show protected elements">Protected</button><button class="btn private" title="Show private elements">Private</button><button class="btn inherited active" title="Show inherited elements">Inherited</button></span><div class="btn-group view pull-right" data-toggle="buttons-radio">
<button class="btn details" title="Show descriptions and method names"><i class="icon-list"></i></button><button class="btn simple" title="Show only method names"><i class="icon-align-justify"></i></button>
</div>
<ul class="side-nav nav nav-list">
<li class="nav-header">
<i class="icon-custom icon-method"></i> Methods</li>
<li class="method public "><a href="#__construct" title="__construct :: "><span class="description">__construct()
</span><pre>__construct()</pre></a></li>
<li class="nav-header protected">» Protected</li>
<li class="method protected "><a href="#delete" title="delete :: {@inheritDoc}"><span class="description">{@inheritDoc}</span><pre>delete()</pre></a></li>
<li class="method protected "><a href="#get" title="get :: {@inheritDoc}"><span class="description">{@inheritDoc}</span><pre>get()</pre></a></li>
<li class="method protected "><a href="#patch" title="patch :: {@inheritDoc}"><span class="description">{@inheritDoc}</span><pre>patch()</pre></a></li>
<li class="method protected "><a href="#post" title="post :: {@inheritDoc}"><span class="description">{@inheritDoc}</span><pre>post()</pre></a></li>
<li class="method protected "><a href="#put" title="put :: {@inheritDoc}"><span class="description">{@inheritDoc}</span><pre>put()</pre></a></li>
<li class="nav-header">
<i class="icon-custom icon-property"></i> Properties</li>
<li class="nav-header protected">» Protected</li>
<li class="property protected "><a href="#%24client" title="$client :: The client"><span class="description">The client</span><pre>$client</pre></a></li>
</ul>
</div>
<div class="span8">
<a name="%5CGithub%5CApi%5CApi" id="\Github\Api\Api"></a><ul class="breadcrumb">
<li>
<a href="../index.html"><i class="icon-custom icon-class"></i></a><span class="divider">\</span>
</li>
<li><a href="../namespaces/Github.html">Github</a></li>
<span class="divider">\</span><li><a href="../namespaces/Github.Api.html">Api</a></li>
<li class="active">
<span class="divider">\</span><a href="../classes/Github.Api.Api.html">Api</a>
</li>
</ul>
<div href="../classes/Github.Api.Api.html" class="element class">
<p class="short_description">Abstract class for Api classes</p>
<div class="details">
<p class="long_description"></p>
<table class="table table-bordered">
<tr>
<th>author</th>
<td><a href="">Thibault Duplessis &lt;thibault.duplessis at gmail dot com&gt;</a></td>
</tr>
<tr>
<th>author</th>
<td><a href="mailto:stloyd@gmail.com">Joseph Bielawski</a></td>
</tr>
</table>
<h3>
<i class="icon-custom icon-method"></i> Methods</h3>
<a name="__construct" id="__construct"></a><div class="element clickable method public __construct" data-toggle="collapse" data-target=".__construct .collapse">
<h2>__construct()
</h2>
<pre>__construct(Github\Client $client) </pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description">
<p class="long_description"></p>
<h3>Parameters</h3>
<div class="subelement argument">
<h4>$client</h4>
<code>\Client</code>
</div>
</div></div>
</div>
<a name="delete" id="delete"></a><div class="element clickable method protected delete" data-toggle="collapse" data-target=".delete .collapse">
<h2>{@inheritDoc}</h2>
<pre>delete($path, array $parameters, $requestOptions) </pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description">
<p class="long_description"></p>
<h3>Parameters</h3>
<div class="subelement argument">
<h4>$path</h4>
<code></code>
</div>
<div class="subelement argument">
<h4>$parameters</h4>
<code></code>
</div>
<div class="subelement argument">
<h4>$requestOptions</h4>
<code></code>
</div>
</div></div>
</div>
<a name="get" id="get"></a><div class="element clickable method protected get" data-toggle="collapse" data-target=".get .collapse">
<h2>{@inheritDoc}</h2>
<pre>get($path, array $parameters, $requestOptions) </pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description">
<p class="long_description"></p>
<h3>Parameters</h3>
<div class="subelement argument">
<h4>$path</h4>
<code></code>
</div>
<div class="subelement argument">
<h4>$parameters</h4>
<code></code>
</div>
<div class="subelement argument">
<h4>$requestOptions</h4>
<code></code>
</div>
</div></div>
</div>
<a name="patch" id="patch"></a><div class="element clickable method protected patch" data-toggle="collapse" data-target=".patch .collapse">
<h2>{@inheritDoc}</h2>
<pre>patch($path, array $parameters, $requestOptions) </pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description">
<p class="long_description"></p>
<h3>Parameters</h3>
<div class="subelement argument">
<h4>$path</h4>
<code></code>
</div>
<div class="subelement argument">
<h4>$parameters</h4>
<code></code>
</div>
<div class="subelement argument">
<h4>$requestOptions</h4>
<code></code>
</div>
</div></div>
</div>
<a name="post" id="post"></a><div class="element clickable method protected post" data-toggle="collapse" data-target=".post .collapse">
<h2>{@inheritDoc}</h2>
<pre>post($path, array $parameters, $requestOptions) </pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description">
<p class="long_description"></p>
<h3>Parameters</h3>
<div class="subelement argument">
<h4>$path</h4>
<code></code>
</div>
<div class="subelement argument">
<h4>$parameters</h4>
<code></code>
</div>
<div class="subelement argument">
<h4>$requestOptions</h4>
<code></code>
</div>
</div></div>
</div>
<a name="put" id="put"></a><div class="element clickable method protected put" data-toggle="collapse" data-target=".put .collapse">
<h2>{@inheritDoc}</h2>
<pre>put($path, array $parameters, $requestOptions) </pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description">
<p class="long_description"></p>
<h3>Parameters</h3>
<div class="subelement argument">
<h4>$path</h4>
<code></code>
</div>
<div class="subelement argument">
<h4>$parameters</h4>
<code></code>
</div>
<div class="subelement argument">
<h4>$requestOptions</h4>
<code></code>
</div>
</div></div>
</div>
<h3>
<i class="icon-custom icon-property"></i> Properties</h3>
<a name="%24client" id="$client"> </a><div class="element clickable property protected $client" data-toggle="collapse" data-target=".$client .collapse">
<h2>The client</h2>
<pre>$client : \Client</pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description"><p class="long_description"></p></div></div>
</div>
</div>
</div>
</div>
</div>
<div class="row"><footer class="span12">
Template is built using <a href="http://twitter.github.com/bootstrap/">Twitter Bootstrap 2</a> and icons provided by <a href="http://glyphicons.com/">Glyphicons</a>.<br>
Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor 2.0.0a6</a> and<br>
generated on 2012-07-15T22:43:05+02:00.<br></footer></div>
</div>
</body>
</html>
Loading