1 |
efrain |
1 |
Google APIs Client Library for PHP
|
|
|
2 |
==================================
|
|
|
3 |
|
|
|
4 |
Only the source, LICENSE, README and autoloader files have been kept in this directory:
|
|
|
5 |
|
|
|
6 |
- Copy /src/Google to /src/Google
|
|
|
7 |
- Copy /LICENSE to LICENSE
|
|
|
8 |
- Copy /README.md to README.md
|
|
|
9 |
- Copy /autoload.php to autoload.php
|
|
|
10 |
|
|
|
11 |
Here are the files that we have added.
|
|
|
12 |
|
|
|
13 |
/lib.php
|
|
|
14 |
|
|
|
15 |
Is a wrapper to get a Google_Client object with the default configuration
|
|
|
16 |
that should be used throughout Moodle. It also takes care of including the
|
|
|
17 |
required files and updating the include_path.
|
|
|
18 |
|
|
|
19 |
Every use of the Google PHP API should always start by requiring this file.
|
|
|
20 |
Apart from the wrapping of Google_Client above... it's also responsible for
|
|
|
21 |
enabling the autoload of all the API classes.
|
|
|
22 |
|
|
|
23 |
So, basically, every use of the Google Client API should be something like:
|
|
|
24 |
|
|
|
25 |
require_once($CFG->libdir . '/google/lib.php');
|
|
|
26 |
$client = get_google_client();
|
|
|
27 |
|
|
|
28 |
And, from there, use the Client API normally. Everything will be autoloaded.
|
|
|
29 |
|
|
|
30 |
/curlio.php
|
|
|
31 |
|
|
|
32 |
An override of the default Google_IO_Curl class to use our Curl class
|
|
|
33 |
rather then their implementation. When upgrading the library the default
|
|
|
34 |
Curl class should be checked to ensure that its functionalities are covered
|
|
|
35 |
in this file.
|
|
|
36 |
|
|
|
37 |
This should not ever be used directly. The wrapper above uses it automatically.
|
|
|
38 |
|
|
|
39 |
Local changes (to reapply until upstream upgrades contain them):
|
|
|
40 |
* MDL-67034 php74 compliance fixes
|
|
|
41 |
* MDL-67115 php74 implode() compliance fixes. This is fixed in upstream library v2.2.4
|
|
|
42 |
(verify that https://github.com/googleapis/google-api-php-client/pull/1683 is applied)
|
|
|
43 |
* MDL-73523 php80 compliance. openssl_xxx_free() methods deprecated. I've been unable to
|
|
|
44 |
find any issue upstream and the current library versions are way different from the ones
|
|
|
45 |
we are using here.
|
|
|
46 |
* MDL-76355 php81 compliance. Class methods require overriding methods to declare a
|
|
|
47 |
compatible return type.
|
|
|
48 |
* MDL-77374 PHP 8.2 compliance.
|
|
|
49 |
To temporarily prevent the PHP 8.2 warning about the deprecation of dynamic properties,
|
|
|
50 |
the #[AllowDynamicProperties] attribute was added on top of the classes.
|
|
|
51 |
Below is a handy command to add the attribute above the class line:
|
|
|
52 |
```
|
|
|
53 |
cd lib/google/src
|
|
|
54 |
for file in `find . -name '*.php' `; do sed -i '/^class /i #[AllowDynamicProperties]' $file; done
|
|
|
55 |
```
|
|
|
56 |
* MDL-46563 - PHP 8.3 compliance
|
|
|
57 |
- Converted use of `get_class()` to `static::class`
|
|
|
58 |
|
|
|
59 |
Information
|
|
|
60 |
-----------
|
|
|
61 |
|
|
|
62 |
Repository: https://github.com/googleapis/google-api-php-client
|
|
|
63 |
Documentation: https://developers.google.com/api-client-library/php/
|
|
|
64 |
Global documentation: https://developers.google.com
|
|
|
65 |
|
|
|
66 |
Downloaded version: 1.1.7
|