2017 © Pedro Peláez
 

library google-drive

simplified Google Drive API access

image

simirimia/google-drive

simplified Google Drive API access

  • Friday, January 1, 2016
  • by simirimia
  • Repository
  • 1 Watchers
  • 1 Stars
  • 1 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Simplified Google Drive API access

Simplified Google Drive API access based on google/apiclient, (*1)

How to run the examples

  • set up the Google client secret and download it as JSON file (see below id you need instructions for that)
  • move it to the examples/config folder
  • CLI version
    • rename it to app_secret_cli.json
    • open terminal, go to the examples/cli folder
      • run php index.php
      • open the URL
      • enter the verification code
      • now you should see a (partial) list of the content of your drive
      • run it again, now you should see the same list without the hassle of managing the verification code
  • HTTP version
    • rename it to app_secret_http.json
    • set up a web server with examples/http as doc root
    • open http://< your (local) web server url >
      • given you have a local system gd-test.app set up:
        • http://gd-test.app/index.php

How to get the client secret from google

  • go to https://console.developers.google.com
  • create new or open existing project
  • got to API Manager, enable Google Drive API
  • go to Credentials and create new OAuth Client ID
  • if it is the first time, you need to setup the consent screen
    • enter product name and an optional URL
  • CLI version
    • In the list with application types, choose other and give it a name
  • HTTP version
    • In the list with application types, choose Web Application and give it a name
    • In the field Authorized redirect URIs enter:
      • http://< your (local) web server url >/< OAuth2 callback handler >
        • to run the examples (given you have a local system gd-test.app set up):
        • http://gd-test.app/redirecttarget.php
  • Confirm the popup with client id and secret -> you don't need to remember those now
  • Instead, download the whole credentials as json from the list with all client IDs
  • move the file to any destination you like an make sure you give the correct path to the service

The Versions

01/01 2016

dev-master

9999999-dev https://github.com/simirimia/google-drive

simplified Google Drive API access

  Sources   Download

BSD v3

The Requires

 

by Avatar simirimia