\GDriveHandler
Synopsis
class GDriveHandler
{
- // members
- public static string $GDRIVE_BACKUP_FOLDER = 'Backuper';
- public static string $BACKUP_FILE_TYPE = 'tgz';
- public static string $GDRIVE_MIME_BACKUP = 'application/tgz';
- public static string $GDRIVE_MIME_FOLDER = 'application/vnd.google-apps.folder';
- private $client;
- private $service;
- // methods
- public void __construct()
- public static bool|Google_Client createGoogleClient()
- public void getGoogleClient()
- public bool isGDriveAuthenticated()
- public array|bool getGDriveBackups()
- public bool getGDriveBackupFolderId()
- public bool createGDriveBackupFolder()
- public static void getAccessTokenFileURI()
- public static void saveAccessToken()
- public bool|false|mixed uploadBackupGDrive()
- private string readChunk()
Members
private
- $client
- $service
public
- $BACKUP_FILE_TYPE
- $GDRIVE_BACKUP_FOLDER
- $GDRIVE_MIME_BACKUP
- $GDRIVE_MIME_FOLDER
Methods
private
- readChunk() — Helper function to read a file chunk
public
- __construct()
- createGDriveBackupFolder() — Create backup folder in GDrive
- createGoogleClient() — Gets a new Google_Client object initialized with our client credentials
- getAccessTokenFileURI()
- getGDriveBackupFolderId() — Get the folder id of the GDrive backup folder
- getGDriveBackups() — Get a list of backups that are stored in Backuper folder in GDrive
- getGoogleClient()
- isGDriveAuthenticated() — Checks if we are authenticated for GDrive service
- saveAccessToken() — Stores the Gdrive access token to a file in _config dir
- uploadBackupGDrive() — Uploads a file to GDrive