2017 © Pedro Peláez
 

library google-drive-client-php

image

soramugi/google-drive-client-php

  • Friday, August 1, 2014
  • by soramugi
  • Repository
  • 4 Watchers
  • 28 Stars
  • 9,494 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 9 Forks
  • 3 Open issues
  • 6 Versions
  • 0 % Grown

The README.md

Google Drive Client PHP

Build Status, (*1)

The php library to Google Drive API operate. The wrapper which uses the library based on the following library., (*2)

https://github.com/bitgandtter/google-api based on http://code.google.com/p/google-api-php-client/, (*3)

Installation

Using Composer

composer.json, (*4)

{
    "require": {
        "soramugi/google-drive-client-php": "*"
    }
}
curl -s http://getcomposer.org/installer | php
php composer.phar install

Usage

Attestation

<?php
require_once __DIR__ . '/vendor/autoload.php';

$client = new Soramugi\GoogleDrive\Client;

$client->setClientId('your client id');
$client->setClientSecret('your client secret');

$token = '{"access_token":"your_access_token","token_type":"Bearer","expires_in":3600,"refresh_token":"your_refresh_token","created":0000000000}';
$client->setAccessToken($token);

get client id or client secret., (*5)

https://code.google.com/apis/console/, (*6)

get json type string access_token., (*7)

https://gist.github.com/soramugi/6060776, (*8)

List display

<?php
$files = new Soramugi\GoogleDrive\Files($client);

foreach ($files->listFiles()->getItems() as $item) {
    if (!$item->getLabels()->getTrashed()) {
        echo "file : {$item->getTitle()}\n";
        echo "{$item->getId()}\n";
    }
}

Add Spreadsheet

$file = new Soramugi\GoogleDrive\Spreadsheet();
$file->setClient($client);
$file->setTitle('test file '. time());
$file->setDescription('test description');

$data = "foo,var\nhi";
$createdFile = $file->insert($data);
echo $createdFile->getTitle() . "\n";

When adding into folder, id of forder file is set up., (*9)

$file->setParentId($folderId);

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

License

Apache License, Version 2.0, (*10)

The Versions

01/08 2014

dev-master

9999999-dev

  Sources   Download

Apache

The Requires

 

The Development Requires

by Avatar soramugi

google spreadsheet drive

01/08 2014

0.1.2

0.1.2.0

  Sources   Download

Apache

The Requires

 

The Development Requires

by Avatar soramugi

google spreadsheet drive

27/07 2013

0.1.1

0.1.1.0

  Sources   Download

Apache

The Requires

 

The Development Requires

by Avatar soramugi

google spreadsheet drive

26/07 2013

0.1.0

0.1.0.0

  Sources   Download

Apache

The Requires

 

The Development Requires

by Avatar soramugi

google spreadsheet drive

25/07 2013

0.0.2

0.0.2.0

  Sources   Download

The Requires

 

The Development Requires

by Avatar soramugi

google spreadsheet drive

24/07 2013

0.0.1

0.0.1.0

  Sources   Download

The Requires

 

The Development Requires

by Avatar soramugi