Skip to content

Commit

Permalink
Merge pull request #695 from bshaffer/v2-rcb-1
Browse files Browse the repository at this point in the history
v2.0 RCB-1
  • Loading branch information
bshaffer committed Oct 26, 2015
2 parents a25dc9d + f15f268 commit d73e675
Show file tree
Hide file tree
Showing 120 changed files with 3,881 additions and 10,760 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ composer.lock
vendor
examples/testfile-small.txt
examples/testfile.txt
tests/.accessToken
tests/.apiKey
3 changes: 0 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ cache:
matrix:
fast_finish: true
include:
# Can't test against 5.2; openssl is not available:
# http://docs.travis-ci.com/user/languages/php/#PHP-installation
- php: 5.3
- php: 5.4
- php: 5.5
- php: 5.6
Expand Down
56 changes: 30 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![Build Status](https://travis-ci.org/google/google-api-php-client.svg)](https://travis-ci.org/google/google-api-php-client)
[![Build Status](https://travis-ci.org/google/google-api-php-client.svg)](https://travis-ci.org/google/google-api-php-client.svg?branch=master)

# Google APIs Client Library for PHP #

Expand All @@ -9,10 +9,7 @@ The Google API Client Library enables you to work with Google APIs such as Googl
This library is in Beta. We're comfortable enough with the stability and features of the library that we want you to build real production applications on it. We will make an effort to support the public and protected surface of the library and maintain backwards compatibility in the future. While we are still in Beta, we reserve the right to make incompatible changes. If we do remove some functionality (typically because better functionality exists or if the feature proved infeasible), our intention is to deprecate and provide ample time for developers to update their code.

## Requirements ##
* [PHP 5.2.1 or higher](http://www.php.net/)
* [PHP JSON extension](http://php.net/manual/en/book.json.php)

*Note*: some features (service accounts and id token verification) require PHP 5.3.0 and above due to cryptographic algorithm requirements.
* [PHP 5.4.0 or higher](http://www.php.net/)

## Developer Documentation ##
http://developers.google.com/api-client-library/php
Expand All @@ -22,24 +19,31 @@ http://developers.google.com/api-client-library/php
For the latest installation and setup instructions, see [the documentation](https://developers.google.com/api-client-library/php/start/installation).

## Basic Example ##
See the examples/ directory for examples of the key client features.
See the examples/ directory for examples of the key client features. You can
view them in your browser by running the php built-in web server.

```
$ php -S localhost:8000 -t examples/
```

And then browsing to the host and port you specified
(in the above example, `http://localhost:8000`).

```PHP
<?php

require_once 'google-api-php-client/src/Google/autoload.php'; // or wherever autoload.php is located

$client = new Google_Client();
$client->setApplicationName("Client_Library_Examples");
$client->setDeveloperKey("YOUR_APP_KEY");

$service = new Google_Service_Books($client);
$optParams = array('filter' => 'free-ebooks');
$results = $service->volumes->listVolumes('Henry David Thoreau', $optParams);

foreach ($results as $item) {
echo $item['volumeInfo']['title'], "<br /> \n";
}

// include your composer dependencies
require_once 'vendor/autoload.php';

$client = new Google_Client();
$client->setApplicationName("Client_Library_Examples");
$client->setDeveloperKey("YOUR_APP_KEY");

$service = new Google_Service_Books($client);
$optParams = array('filter' => 'free-ebooks');
$results = $service->volumes->listVolumes('Henry David Thoreau', $optParams);

foreach ($results as $item) {
echo $item['volumeInfo']['title'], "<br /> \n";
}
```

### Service Specific Examples ###
Expand All @@ -58,7 +62,7 @@ If there is a specific bug with the library, please file a issue in the Github i

We accept contributions via Github Pull Requests, but all contributors need to be covered by the standard Google Contributor License Agreement. You can find links, and more instructions, in the documentation: https://developers.google.com/api-client-library/php/contribute

### I want an example of X! ###
### I want an example of X! ###

If X is a feature of the library, file away! If X is an example of using a specific service, the best place to go is to the teams for those specific APIs - our preference is to link to their examples rather than add them to the library, as they can then pin to specific versions of the library. If you have any examples for other APIs, let us know and we will happily add a link to the README above!

Expand All @@ -68,7 +72,7 @@ When we started working on the 1.0.0 branch we knew there were several fundament

### Why does Google_..._Service have weird names? ###

The _Service classes are generally automatically generated from the API discovery documents: https://developers.google.com/discovery/. Sometimes new features are added to APIs with unusual names, which can cause some unexpected or non-standard style naming in the PHP classes.
The _Service classes are generally automatically generated from the API discovery documents: https://developers.google.com/discovery/. Sometimes new features are added to APIs with unusual names, which can cause some unexpected or non-standard style naming in the PHP classes.

### How do I deal with non-JSON response types? ###

Expand All @@ -95,10 +99,10 @@ Run the PHPUnit tests with PHPUnit. You can configure an API key and token in Ba
To check for coding style violations, run

```
vendor/bin/phpcs src --standard=style/ruleset.xml -np
vendor/bin/phpcs src --standard=style/ruleset.xml -np
```

To automatically fix (fixable) coding style violations, run
To automatically fix (fixable) coding style violations, run

```
vendor/bin/phpcbf src --standard=style/ruleset.xml
Expand Down
Loading

0 comments on commit d73e675

Please sign in to comment.