Skip to content

Commit

Permalink
Merge branch 'MDL-49519_eloy_addenda' of https://github.com/stronk7/m…
Browse files Browse the repository at this point in the history
  • Loading branch information
danpoltawski committed Apr 8, 2015
2 parents 17017ce + c790542 commit c11960e
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 598 deletions.
454 changes: 0 additions & 454 deletions lib/google/Google_Client.php

This file was deleted.

81 changes: 0 additions & 81 deletions lib/google/config.php

This file was deleted.

3 changes: 1 addition & 2 deletions lib/google/curlio.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,8 @@
*/

defined('MOODLE_INTERNAL') || die();

require_once($CFG->libdir . '/filelib.php');
require_once($CFG->libdir . '/google/src/Google/IO/Curl.php');
require_once($CFG->libdir . '/google/src/Google/IO/Exception.php');

/**
* Class moodle_google_curlio.
Expand Down
8 changes: 3 additions & 5 deletions lib/google/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,9 @@

defined('MOODLE_INTERNAL') || die();

require_once($CFG->libdir . '/weblib.php');

// Update the include_path so that the library can use require_once in its own files.
set_include_path(get_include_path() . PATH_SEPARATOR . $CFG->libdir . '/google');
require_once($CFG->libdir . '/google/src/Google/Client.php');
// All Google API classes support autoload with this.
require_once($CFG->libdir . '/google/autoload.php');
// To be able to use our custom IO class.
require_once($CFG->libdir . '/google/curlio.php');

/**
Expand Down
52 changes: 0 additions & 52 deletions lib/google/local_config.php

This file was deleted.

17 changes: 15 additions & 2 deletions lib/google/readme_moodle.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
Google APIs Client Library for PHP
==================================

Only the source, README and autoloader files have been kept in this directory:
Only the source, LICENSE, README and autoloader files have been kept in this directory:

- Copy /src/Google to /src/Google
- Copy /src/Google to /src/Google
- Copy /LICENSE to LICENSE
- Copy /README.md to README.md
- Copy /autoload.php to autoload.php
Expand All @@ -16,13 +16,26 @@ Here are the files that we have added.
that should be used throughout Moodle. It also takes care of including the
required files and updating the include_path.

Every use of the Google PHP API should always start by requiring this file.
Apart from the wrapping of Google_Client above... it's also responsible for
enabling the autoload of all the API classes.

So, basically, every use of the Google Client API should be something like:

require_once($CFG->libdir . '/google/lib.php');
$client = get_google_client();

And, from there, use the Client API normally. Everything will be autoloaded.

/curlio.php

An override of the default Google_IO_Curl class to use our Curl class
rather then their implementation. When upgrading the library the default
Curl class should be checked to ensure that its functionalities are covered
in this file.

This should not ever be used directly. The wrapper above uses it automatically.


Information
-----------
Expand Down
2 changes: 2 additions & 0 deletions lib/upgrade.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ information provided here is intended especially for developers.
* Use standard PHP date time classes and methods - see new core_date class for timezone normalisation methods.
* Moved lib/google/Google/ to lib/google/src/Google. This is to address autoloader issues with Google's provided autoloader
for the library. See MDL-49519 for details.
* The outdated lib/google/Google_Client.php and related files have been completely removed. To use
the new client, read lib/google/readme_moodle.txt, please.

=== 2.8 ===

Expand Down
1 change: 0 additions & 1 deletion portfolio/googledocs/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
*/
require_once($CFG->libdir.'/portfolio/plugin.php');
require_once($CFG->libdir . '/google/lib.php');
require_once($CFG->libdir . '/google/src/Google/Service/Drive.php');

class portfolio_plugin_googledocs extends portfolio_plugin_push_base {
/**
Expand Down
1 change: 0 additions & 1 deletion repository/googledocs/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@

require_once($CFG->dirroot . '/repository/lib.php');
require_once($CFG->libdir . '/google/lib.php');
require_once($CFG->libdir . '/google/src/Google/Service/Drive.php');

/**
* Google Docs Plugin
Expand Down

0 comments on commit c11960e

Please sign in to comment.