Skip to content

Commit 3253653

Browse files
committed
Updated README file
1 parent 1ce3739 commit 3253653

File tree

1 file changed

+22
-28
lines changed

1 file changed

+22
-28
lines changed

README.markdown

Lines changed: 22 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,48 @@
1-
# PHP GitHub API
1+
# PHP GitHub API [WIP]
22

33
[![Build Status](https://secure.travis-ci.org/KnpLabs/php-github-api.png?branch=api_v3)](http://travis-ci.org/KnpLabs/php-github-api)
44

5+
[WARNING] We are converting that lib into "github api v3" so some stuff is not working yet...
6+
57
A simple Object Oriented wrapper for GitHub API, written with PHP5.
68

79
```php
8-
$github = new Github_Client();
10+
$github = new Github\Client();
911
$myRepos = $github->getRepoApi()->getUserRepos('ornicar');
1012
```
1113

12-
Uses [GitHub API v2](http://develop.github.com/). The object API is very similar to the RESTful API.
14+
Uses [GitHub API v3](http://developer.github.com/v3/). The object API is very similar to the RESTful API.
1315

1416
## Features
1517

16-
* Covers 100% of GitHub API with PHP methods
17-
* Supports 3 authentication methods
18-
* Follows PEAR conventions and coding standard: autoload friendly
18+
* Follows PSR-0 conventions and coding standard: autoload friendly
1919
* Light and fast thanks to lazy loading of API classes
2020
* Flexible and extensible thanks to dependency injection
2121
* Extensively tested and documented
2222

2323
## Requirements
2424

25-
* PHP 5.2 or 5.3.
26-
* [php curl](http://php.net/manual/en/book.curl.php), but it is possible to write another transport layer.
25+
* PHP >= 5.3
2726
* PHPUnit to run tests.
2827

2928
## Autoload
3029

31-
The first step to use php-github-api is to register its autoloader:
30+
The new version of php-github-api using [composer](http://getcomposer.org).
31+
The first step to use php-github-api is to download composer: `curl -s http://getcomposer.org/installer | php`
32+
Then we have to install our dependencies using `php composer.phar install`, now we can use autoloader from composer by:
3233

3334
```php
34-
require_once '/path/to/lib/Github/Autoloader.php';
35-
Github_Autoloader::register();
35+
require_once 'vendor/autoload.php';
3636
```
3737

38-
Replace the `/path/to/lib/` path with the path you used for php-github-api installation.
38+
TODO: More examples how to install with composer. Some example of composer.json files. Add to packagist
3939

40-
> php-github-api follows the PEAR convention names for its classes, which means you can easily integrate php-github-api classes loading in your own autoloader.
40+
> php-github-api follows the PSR-0 convention names for its classes, which means you can easily integrate php-github-api classes loading in your own autoloader.
4141
4242
## instantiate a new github client
4343

4444
```php
45-
$github = new Github_Client();
45+
$github = new Github\Client();
4646
```
4747

4848
From this object, you can access to all GitHub apis, listed below.
@@ -57,15 +57,9 @@ From this object, you can access to all GitHub apis, listed below.
5757
<a href='#nav' alt='Back to the navigation'>Go back to the Navigation</a>
5858

5959
Searching users, getting user information and managing authenticated user account information.
60-
Wrap [GitHub User API](http://develop.github.com/p/users.html).
61-
62-
### Search for users by username
63-
64-
```php
65-
$users = $github->getUserApi()->search('ornicar');
66-
```
60+
Wrap [GitHub User API](http://developer.github.com/v3/users).
6761

68-
Returns an array of users.
62+
### Search for users by username is depreciated cause of github api limitation.
6963

7064
### Get information about a user
7165

@@ -702,16 +696,16 @@ Wanna change, let's say, the http client User Agent?
702696
$github->getHttpClient()->setOption('user_agent', 'My new User Agent');
703697
```
704698

705-
See all available options in Github/HttpClient.php
699+
See all available options in Github/HttpClient/HttpClient.php
706700

707701
### Inject a new http client instance
708702

709703
php-github-api provides a curl-based implementation of a http client.
710-
If you want to use your own http client implementation, inject it to the Github_Client instance:
704+
If you want to use your own http client implementation, inject it to the Github\Client instance:
711705

712706
```php
713707
// create a custom http client
714-
class MyHttpClient extends Github_HttpClient
708+
class MyHttpClient extends Github\HttpClient\HttpClient
715709
{
716710
public function doRequest($url, array $parameters = array(), $httpMethod = 'GET', array $options = array())
717711
{
@@ -722,10 +716,10 @@ If you want to use your own http client implementation, inject it to the Github_
722716

723717
> Your http client implementation may not extend Github_HttpClient, but only implement Github_HttpClientInterface.
724718
725-
You can now inject your http client through Github_Client constructor:
719+
You can now inject your http client through Github\Client constructor:
726720

727721
```php
728-
$github = new Github_Client(new MyHttpClient());
722+
$github = new Github\Client(new MyHttpClient());
729723
```
730724

731725
Or to an existing Github_Client instance:
@@ -741,7 +735,7 @@ For example, to replace the user API:
741735

742736
```php
743737
// create a custom User API
744-
class MyGithubApiUser extends Github_Api_User
738+
class MyGithubApiUser extends Github\Api\User
745739
{
746740
// overwrite things
747741
}

0 commit comments

Comments
 (0)