Aller au contenu

omnidrive/gdrive Référence de l’API

Étage
Fournisseur · Omnidrive
Version
1.x
Suite de conformité
branchée, CI verte
Vérifié en réel
Vérifié en partie
Licence
MIT
composer require omnidrive/gdrive:1.x-dev

Lue dans les fichiers PHP du paquet au commit 9f9ec59efea8 : ses espaces de noms, classes, interfaces et énumérations, leurs constantes, propriétés et méthodes publiques avec leur PHPDoc, et les options que prennent ses fabriques. Rien n’en est exécuté.

Omnidrive\Gdrive

  • GdriveDriveFactory class

    A folder of Google Drive - My Drive, a shared drive or a folder shared with the account - through masbug/flysystem-google-drive-ext (google/apiclient), paths by name as the Drive's web page shows them:

    2 options · 1 method

Omnidrive\Gdrive

GdriveDriveFactory class

final class GdriveDriveFactory extends FlysystemDriveFactory GdriveDriveFactory.php:39

A folder of Google Drive - My Drive, a shared drive or a folder shared with the account - through masbug/flysystem-google-drive-ext (google/apiclient), paths by name as the Drive's web page shows them:

(new GdriveDriveFactory())->create(['client_id' => '...', 'client_secret' => '...', 'refresh_token' => '...', 'root' => 'Site/uploads']); (new GdriveDriveFactory())->create(['service_account' => '/run/secrets/drive.json', 'shared_drive_id' => '0ABC...']);

Options: an OAuth client's client_id, client_secret and refresh_token (an account's own Drive: the access token renewed on its own), or service_account (the JSON key of a service account, a path or the JSON itself) with subject (a Workspace user it acts as, by domain-wide delegation); root (the folder behind the drive's paths, as a path of names - or its ID with display_paths false); shared_drive_id (a shared drive), shared_folder_id (a folder shared with the account); display_paths (true: paths are names, as Drive shows them; false: paths are file IDs); permanent_delete (false: a deleted file goes to the bin); public_url (Drive serves no address of its own).

A file "public" is shared with anyone who has the link (reader), "private" not. With root as a path of names, the folder is looked up when the drive is built (the adapter's way); otherwise nothing is sent until the first operation.

Options

OptionDefault
display_pathstrue
permanent_deletefalse

GdriveDriveFactory::__construct()

public function __construct(readonly ?ClientInterface $http = null)