Download the PHP package luketowers/oc-gdrivefilesystemdriver-plugin without Composer

On this page you can find all versions of the php package luketowers/oc-gdrivefilesystemdriver-plugin. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package oc-gdrivefilesystemdriver-plugin

Use https://github.com/wintercms/wn-drivergoogledrive-plugin instead.

About

October-fied implementation of the Google Drive Flysystem Driver.

Important Note:

Google Drive is an ID-based filesystem; it supports having multiple files with the same name within a given directory. This driver exposes the file and directory IDs when requesting filenames which means if you hooked it up the the Media manager to view your files you would see something like the picture below:

Google Drive IDs instead of filenames

Installation

To install from the Marketplace, click on the "Add to Project" button and then select the project you wish to add it to before updating the project to pull in the plugin.

To install from the backend, go to Settings -> Updates & Plugins -> Install Plugins and then search for LukeTowers.GDriveFileSystemDriver.

To install from the repository, clone it into plugins/luketowers/gdrivefilesystemdriver and then run composer update from your project root in order to pull in the dependencies.

To install it with Composer, run composer require luketowers/oc-gdrivefilesystemdriver-plugin from your project root.

Configuration

Example Storage disk configuration using the googledrive storage driver provided by this plugin:

'mygoogledrive' => [
    'driver' => 'googledrive',
    'clientId' => '',
    'clientSecret' => '',
    'refreshToken' => '',

    // Null for the route folder, otherwise a folder ID to base the driver off of
    'folderId' => null,
],

See the Configuration Guides at the bottom for how to get the values for clientId, clientSecret, refreshToken, & folderId.

Usage

For usage examples of interacting with this driver see the usage examples here: ivanvermeyen/laravel-google-drive-demo#available-routes

Configuration Guides

Getting your Client ID and Secret

Log in to your Google Account and go to this website:

https://console.developers.google.com/

Create a Project

Create a new project using the dropdown at the top.

Create a new project

After you enter a name, it takes a few seconds before the project is successfully created on the server.

Enable Drive API

Make sure you have the project selected at the top.

Then go to Library and click on "Drive API" under "G Suite APIs".

Add Drive API

And then Enable it.

Enable Google Drive API

Create Credentials

Go to "Credentials" and click on the tab "OAuth Consent Screen". Fill in a "Product name shown to users" and Save it. Don't worry about the other fields.

Consent Screen

Then go back to Credentials, click the button that says "Create Credentials" and select "OAuth Client ID".

Create Credentials

Choose "Web Application" and give it a name.

Add https://developers.google.com/oauthplayground in "Authorized redirect URIs". You will need to use this in the next step to get your refresh token. Once you have the token, you can remove the URI.

Credentials

Click Create and take note of your Client ID and Client Secret.

Getting your Refresh Token

Go to https://developers.google.com/oauthplayground.

Make sure you added this URL to your Authorized redirect URIs in the previous step.

In the top right corner, click the settings icon, check "Use your own OAuth credentials" and paste your Client ID and Client Secret.

Use your own OAuth credentials

In step 1 on the left, scroll to "Drive API v3", expand it and check the first drive scope.

Check Scopes

Click "Authorize APIs" and allow access to your account when prompted. There will be a few warning prompts, just proceed.

When you get to step 2, check "Auto-refresh the token before it expires" and click "Exchange authorization code for tokens".

Exchange authorization code for tokens

When you get to step 3, click on step 2 again and you should see your refresh token.

Refresh Token

Getting your Root Folder ID

If you want to store files in your Google Drive root directory, then the folder ID can be null. Else go into your Drive and create a folder.

Because Google Drive allows duplicate names, it identifies each file and folder with a unique ID. If you open your folder, you will see the Folder ID in the URL.

Folder ID

All versions of oc-gdrivefilesystemdriver-plugin with dependencies

PHP Build Version
Package Version
Requires composer/installers Version ~1.0
nao-pon/flysystem-google-drive Version ~1.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package luketowers/oc-gdrivefilesystemdriver-plugin contains the following files

Loading the files please wait ....