Moodle APIs 3.9
Moodle 3.9.13+ (Build: 20220325)
Public Member Functions | Public Attributes | List of all members
google_docs Class Reference

Class for manipulating google documents through the google data api. More...

Public Member Functions

 __construct (google_oauth $googleoauth)
 Constructor. More...
 
 download_file ($url, $path, $timeout=0)
 Downloads a file using authentication. More...
 
 get_file_list ($search='')
 Returns a list of files the user has formated for files api. More...
 
 send_file ($file)
 Sends a file object to google documents. More...
 

Public Attributes

string const DOCUMENTFEED_URL = 'https://docs.google.com/feeds/default/private/full'
 Document list url.
 
string const REALM = 'https://docs.google.com/feeds/ https://spreadsheets.google.com/feeds/ https://docs.googleusercontent.com/'
 Realm for authentication, need both docs and spreadsheet realm.
 
string const UPLOAD_URL = 'https://docs.google.com/feeds/upload/create-session/default/private/full?convert=false'
 Upload url.
 

Detailed Description

Class for manipulating google documents through the google data api.

Docs for this can be found here:

@subpackage lib

License
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

Constructor & Destructor Documentation

◆ __construct()

google_docs::__construct ( google_oauth  $googleoauth)

Constructor.

Parameters
google_oauth$googleoauthoauth curl class for making authenticated requests

Member Function Documentation

◆ download_file()

google_docs::download_file (   $url,
  $path,
  $timeout = 0 
)

Downloads a file using authentication.

Parameters
string$urlurl of file
string$pathpath to save file to
int$timeoutrequest timeout, default 0 which means no timeout
Return values
arraystucture for repository download_file

◆ get_file_list()

google_docs::get_file_list (   $search = '')

Returns a list of files the user has formated for files api.

Parameters
string$searchA search string to do full text search on the documents
Return values
mixedArray of files formated for fileapoi

◆ send_file()

google_docs::send_file (   $file)

Sends a file object to google documents.

Parameters
object$fileFile object
Return values
booleanTrue on success

The documentation for this class was generated from the following file: