Coder Social home page Coder Social logo

cakephp-googledrive's Introduction

CakePHP Component for using Google Drive API

This was developed for a university library webapp which needed to publish lots of PDF content (like, >30gb) and had no server space to upload so much data!

So, as it had three main careers and Google Drive free acount storage limit is 15gb, three Google Accounts were created, one for each career's library.

Using this component, each file "metadata" was stored in the database, holding the Google Drive file ID and folder ID, and the files were uploaded to GDrive.

I developed this more than 2 years ago and I don't think it'd be useful for anyone. Anyway I'd like to keep it and share it 'cause it's fun to see how one evolves as professional.

Caution: Look at the code with one eye! ;)

Contents

  • Vendor/google-api-php-client holds Google API PHP client provided by Google, with some minor tweaks
  • Controller/Component/GoogleApiComponent.php contains the abstraction component...
  • Controller/sample-BibliotecaController.php contians the controller which uses the Component, to use as example
  • Console/Command/DriveShell.php contains a Cake CLI utility used to batch upload lots of files

Config

The following array must be set somehow to CakeConfig

$config['Google'] = array(
	'keysPath' => dirname(APP) . DS .  'service_keys',
	'ServiceAccountCredentials' => array(
		'career 1' => array(
				'application' => 'Career 1',
				'client_id' => 'google api client id',
				'service_account_email' => 'google service account email',
				'key_filename' => 'something-privatekey.p12' // stored in service_keys dir!
		),
        // ... the other careers
	)
);

LICENSE

Code written by me is MIT Licensed

Code included in Vendor has its own license, not sure which but I'm sure its open source

cakephp-googledrive's People

Contributors

tincho avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

tuantai0304

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.