Version Description
= 2.3 = This is a major upgrade that switches to using a custom table for storing data about offloaded Media Library items. Once upgraded you will not be able to downgrade without restoring data from a backup.
= 2.0 = This is a major upgrade that introduces support for DigitalOcean Spaces, renames the plugin to WP Offload Media Lite, and coincidentally upgrades some of its database settings. You may not be able to downgrade to WP Offload S3 Lite 1.x after upgrading to WP Offload Media Lite 2.0+.
= 1.1 = This is a major change, which ensures S3 URLs are no longer saved in post content. Instead, local URLs are filtered on page generation and replaced with the S3 version. If you depend on the S3 URLs being stored in post content you will need to make modifications to support this version.
= 0.6 = This version requires PHP 5.3.3+ and the Amazon Web Services plugin
Release Info
Developer | deliciousbrains |
Plugin | WP Offload S3 Lite |
Version | 2.3.2 |
Comparing to | |
See all releases |
Code changes from version 2.3.1 to 2.3.2
- README.md +8 -2
- classes/amazon-s3-and-cloudfront.php +1 -1
- classes/items/item.php +180 -8
- languages/amazon-s3-and-cloudfront-en.pot +1 -1
- readme.txt +8 -2
- vendor/Gcp/autoload.php +1 -1
- vendor/Gcp/composer/autoload_classmap.php +1 -1
- vendor/Gcp/composer/autoload_files.php +1 -1
- vendor/Gcp/composer/autoload_psr4.php +1 -1
- vendor/Gcp/composer/autoload_real.php +7 -7
- vendor/Gcp/composer/autoload_static.php +9 -9
- vendor/Gcp/composer/installed.json +119 -64
- vendor/Gcp/google/auth/CHANGELOG.md +31 -0
- vendor/Gcp/google/auth/CONTRIBUTING.md +0 -73
- vendor/Gcp/google/auth/README.md +2 -2
- vendor/Gcp/google/auth/composer.json +5 -1
- vendor/Gcp/google/auth/phpunit.xml.dist +0 -19
- vendor/Gcp/google/auth/src/AccessToken.php +253 -0
- vendor/Gcp/google/auth/src/ApplicationDefaultCredentials.php +11 -1
- vendor/Gcp/google/auth/src/Cache/Item.php +8 -4
- vendor/Gcp/google/auth/src/Cache/SysVCacheItemPool.php +45 -35
- vendor/Gcp/google/auth/src/Credentials/AppIdentityCredentials.php +51 -15
- vendor/Gcp/google/auth/src/Credentials/GCECredentials.php +118 -14
- vendor/Gcp/google/auth/src/Credentials/InsecureCredentials.php +3 -1
- vendor/Gcp/google/auth/src/Credentials/ServiceAccountCredentials.php +21 -2
- vendor/Gcp/google/auth/src/Credentials/ServiceAccountJwtAccessCredentials.php +19 -2
- vendor/Gcp/google/auth/src/Credentials/UserRefreshCredentials.php +7 -1
- vendor/Gcp/google/auth/src/FetchAuthTokenCache.php +29 -1
- vendor/Gcp/google/auth/src/HttpHandler/HttpClientCache.php +51 -0
- vendor/Gcp/google/auth/src/HttpHandler/HttpHandlerFactory.php +0 -2
- vendor/Gcp/google/auth/src/Iam.php +78 -0
- vendor/Gcp/google/auth/src/OAuth2.php +15 -1
- vendor/Gcp/google/auth/src/ServiceAccountSignerTrait.php +53 -0
- vendor/Gcp/google/auth/src/SignBlobInterface.php +43 -0
- vendor/Gcp/google/cloud-core/VERSION +1 -1
- vendor/Gcp/google/cloud-core/composer.json +5 -4
- vendor/Gcp/google/cloud-core/src/ArrayTrait.php +2 -2
- vendor/Gcp/google/cloud-core/src/Batch/BatchRunner.php +2 -2
- vendor/Gcp/google/cloud-core/src/Batch/BatchTrait.php +8 -7
- vendor/Gcp/google/cloud-core/src/Batch/HandleFailureTrait.php +2 -4
- vendor/Gcp/google/cloud-core/src/Batch/InterruptTrait.php +1 -1
- vendor/Gcp/google/cloud-core/src/Batch/JobTrait.php +1 -1
- vendor/Gcp/google/cloud-core/src/Batch/SimpleJob.php +0 -1
- vendor/Gcp/google/cloud-core/src/ClientTrait.php +9 -9
- vendor/Gcp/google/cloud-core/src/Compute/Metadata.php +7 -8
- vendor/Gcp/google/cloud-core/src/Compute/Metadata/Readers/HttpHandlerReader.php +55 -0
- vendor/Gcp/google/cloud-core/src/Compute/Metadata/Readers/StreamReader.php +34 -4
- vendor/Gcp/google/cloud-core/src/DebugInfoTrait.php +2 -0
- vendor/Gcp/google/cloud-core/src/EmulatorTrait.php +16 -3
- vendor/Gcp/google/cloud-core/src/ExponentialBackoff.php +21 -3
- vendor/Gcp/google/cloud-core/src/GrpcRequestWrapper.php +8 -21
- vendor/Gcp/google/cloud-core/src/GrpcTrait.php +11 -4
- vendor/Gcp/google/cloud-core/src/Iterator/ItemIteratorTrait.php +1 -1
- vendor/Gcp/google/cloud-core/src/JsonTrait.php +2 -2
- vendor/Gcp/google/cloud-core/src/Logger/AppEngineFlexFormatter.php +6 -13
- vendor/Gcp/google/cloud-core/src/Logger/AppEngineFlexFormatterV2.php +49 -0
- vendor/Gcp/google/cloud-core/src/Logger/AppEngineFlexHandler.php +4 -2
- vendor/Gcp/google/cloud-core/src/Logger/AppEngineFlexHandlerFactory.php +56 -0
- vendor/Gcp/google/cloud-core/src/Logger/AppEngineFlexHandlerV2.php +53 -0
- vendor/Gcp/google/cloud-core/src/Logger/FormatterTrait.php +37 -0
- vendor/Gcp/google/cloud-core/src/PhpArray.php +1 -0
- vendor/Gcp/google/cloud-core/src/RequestBuilder.php +12 -1
- vendor/Gcp/google/cloud-core/src/RequestWrapper.php +45 -42
- vendor/Gcp/google/cloud-core/src/RequestWrapperTrait.php +10 -1
- vendor/Gcp/google/cloud-core/src/RestTrait.php +18 -0
- vendor/Gcp/google/cloud-core/src/Retry.php +4 -4
- vendor/Gcp/google/cloud-core/src/RetryDeciderTrait.php +8 -1
- vendor/Gcp/google/cloud-core/src/ServiceBuilder.php +2 -0
- vendor/Gcp/google/cloud-core/src/TimeTrait.php +37 -11
- vendor/Gcp/google/cloud-core/src/Upload/MultipartUploader.php +5 -1
- vendor/Gcp/google/cloud-core/src/Upload/ResumableUploader.php +8 -3
- vendor/Gcp/google/cloud-core/src/Upload/SignedUrlUploader.php +1 -1
- vendor/Gcp/google/cloud-storage/VERSION +1 -1
- vendor/Gcp/google/cloud-storage/composer.json +2 -1
- vendor/Gcp/google/cloud-storage/src/Bucket.php +104 -7
- vendor/Gcp/google/cloud-storage/src/Connection/ConnectionInterface.php +20 -0
- vendor/Gcp/google/cloud-storage/src/Connection/Rest.php +119 -7
- vendor/Gcp/google/cloud-storage/src/Connection/ServiceDefinition/storage-v1.json +4301 -3687
- vendor/Gcp/google/cloud-storage/src/CreatedHmacKey.php +82 -0
- vendor/Gcp/google/cloud-storage/src/EncryptionTrait.php +4 -1
- vendor/Gcp/google/cloud-storage/src/HmacKey.php +170 -0
- vendor/Gcp/google/cloud-storage/src/Notification.php +1 -1
- vendor/Gcp/google/cloud-storage/src/ObjectIterator.php +1 -1
- vendor/Gcp/google/cloud-storage/src/SigningHelper.php +452 -0
- vendor/Gcp/google/cloud-storage/src/StorageClient.php +124 -8
- vendor/Gcp/google/cloud-storage/src/StorageObject.php +187 -151
- vendor/Gcp/google/cloud-storage/src/StreamWrapper.php +3 -3
- vendor/Gcp/google/crc32/CONTRIBUTING.md +28 -0
- vendor/Gcp/google/crc32/LICENSE +201 -0
- vendor/Gcp/google/crc32/Makefile +71 -0
- vendor/Gcp/google/crc32/README.md +136 -0
- vendor/Gcp/google/crc32/composer.json +26 -0
- vendor/Gcp/google/crc32/crc32_benchmark.php +96 -0
- vendor/Gcp/google/crc32/ext/config.m4 +63 -0
- vendor/Gcp/google/crc32/ext/hash_crc32c.c +63 -0
- vendor/Gcp/google/crc32/ext/install_crc32c.sh +34 -0
- vendor/Gcp/google/crc32/ext/php_crc32c.c +174 -0
- vendor/Gcp/google/crc32/ext/php_crc32c.h +53 -0
- vendor/Gcp/google/crc32/src/Builtin.php +74 -0
- vendor/Gcp/google/crc32/src/CRC32.php +97 -0
- vendor/Gcp/google/crc32/src/CRCInterface.php +56 -0
- vendor/Gcp/google/crc32/src/CRCTrait.php +53 -0
- vendor/Gcp/google/crc32/src/Google.php +60 -0
- vendor/Gcp/google/crc32/src/PHP.php +69 -0
- vendor/Gcp/google/crc32/src/PHPSlicedBy4.php +87 -0
- vendor/Gcp/google/crc32/src/Table.php +104 -0
- vendor/Gcp/guzzlehttp/guzzle/CHANGELOG.md +17 -0
- vendor/Gcp/guzzlehttp/guzzle/Dockerfile +18 -0
- vendor/Gcp/guzzlehttp/guzzle/README.md +11 -12
- vendor/Gcp/guzzlehttp/guzzle/composer.json +19 -15
- vendor/Gcp/guzzlehttp/guzzle/phpstan.neon.dist +9 -0
- vendor/Gcp/guzzlehttp/guzzle/src/Client.php +1 -1
- vendor/Gcp/guzzlehttp/guzzle/src/ClientInterface.php +1 -1
- vendor/Gcp/guzzlehttp/guzzle/src/Cookie/CookieJar.php +1 -1
- vendor/Gcp/guzzlehttp/guzzle/src/Cookie/FileCookieJar.php +2 -1
- vendor/Gcp/guzzlehttp/guzzle/src/Cookie/SessionCookieJar.php +1 -0
- vendor/Gcp/guzzlehttp/guzzle/src/Cookie/SetCookie.php +2 -2
- vendor/Gcp/guzzlehttp/guzzle/src/Exception/GuzzleException.php +18 -11
- vendor/Gcp/guzzlehttp/guzzle/src/Exception/InvalidArgumentException.php +7 -0
- vendor/Gcp/guzzlehttp/guzzle/src/Exception/RequestException.php +1 -1
- vendor/Gcp/guzzlehttp/guzzle/src/Handler/CurlFactory.php +10 -2
- vendor/Gcp/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php +10 -4
- vendor/Gcp/guzzlehttp/guzzle/src/Handler/MockHandler.php +2 -1
- vendor/Gcp/guzzlehttp/guzzle/src/Handler/StreamHandler.php +3 -3
- vendor/Gcp/guzzlehttp/guzzle/src/HandlerStack.php +4 -4
- vendor/Gcp/guzzlehttp/guzzle/src/Middleware.php +2 -3
- vendor/Gcp/guzzlehttp/guzzle/src/Pool.php +1 -1
- vendor/Gcp/guzzlehttp/guzzle/src/RedirectMiddleware.php +1 -1
- vendor/Gcp/guzzlehttp/guzzle/src/RequestOptions.php +1 -1
- vendor/Gcp/guzzlehttp/guzzle/src/RetryMiddleware.php +3 -1
- vendor/Gcp/guzzlehttp/guzzle/src/TransferStats.php +1 -1
- vendor/Gcp/guzzlehttp/guzzle/src/functions.php +15 -4
- vendor/Gcp/guzzlehttp/psr7/CHANGELOG.md +22 -1
- vendor/Gcp/guzzlehttp/psr7/composer.json +7 -3
- vendor/Gcp/guzzlehttp/psr7/src/LimitStream.php +1 -1
- vendor/Gcp/guzzlehttp/psr7/src/MessageTrait.php +33 -12
- vendor/Gcp/guzzlehttp/psr7/src/Request.php +8 -0
- vendor/Gcp/guzzlehttp/psr7/src/Response.php +20 -5
- vendor/Gcp/guzzlehttp/psr7/src/ServerRequest.php +1 -1
- vendor/Gcp/guzzlehttp/psr7/src/Stream.php +13 -4
- vendor/Gcp/guzzlehttp/psr7/src/Uri.php +21 -7
- vendor/Gcp/guzzlehttp/psr7/src/functions.php +1 -1
- vendor/Gcp/monolog/monolog/CHANGELOG.md +27 -0
- vendor/Gcp/monolog/monolog/README.md +1 -1
- vendor/Gcp/monolog/monolog/composer.json +1 -1
- vendor/Gcp/monolog/monolog/doc/01-usage.md +0 -231
- vendor/Gcp/monolog/monolog/doc/02-handlers-formatters-processors.md +0 -158
- vendor/Gcp/monolog/monolog/doc/03-utilities.md +0 -15
- vendor/Gcp/monolog/monolog/doc/04-extending.md +0 -76
- vendor/Gcp/monolog/monolog/doc/sockets.md +0 -39
- vendor/Gcp/monolog/monolog/phpunit.xml.dist +0 -19
- vendor/Gcp/monolog/monolog/src/Monolog/Formatter/FluentdFormatter.php +2 -1
- vendor/Gcp/monolog/monolog/src/Monolog/Formatter/HtmlFormatter.php +3 -2
- vendor/Gcp/monolog/monolog/src/Monolog/Formatter/JsonFormatter.php +2 -8
- vendor/Gcp/monolog/monolog/src/Monolog/Formatter/LineFormatter.php +1 -1
- vendor/Gcp/monolog/monolog/src/Monolog/Formatter/MongoDBFormatter.php +1 -1
- vendor/Gcp/monolog/monolog/src/Monolog/Formatter/NormalizerFormatter.php +4 -122
- vendor/Gcp/monolog/monolog/src/Monolog/Handler/BrowserConsoleHandler.php +5 -4
- vendor/Gcp/monolog/monolog/src/Monolog/Handler/BufferHandler.php +16 -0
- vendor/Gcp/monolog/monolog/src/Monolog/Handler/ChromePHPHandler.php +5 -4
- vendor/Gcp/monolog/monolog/src/Monolog/Handler/CubeHandler.php +3 -2
- vendor/Gcp/monolog/monolog/src/Monolog/Handler/FilterHandler.php +36 -10
- vendor/Gcp/monolog/monolog/src/Monolog/Handler/FingersCrossedHandler.php +39 -13
- vendor/Gcp/monolog/monolog/src/Monolog/Handler/FlowdockHandler.php +2 -1
- vendor/Gcp/monolog/monolog/src/Monolog/Handler/FormattableHandlerInterface.php +37 -0
- vendor/Gcp/monolog/monolog/src/Monolog/Handler/FormattableHandlerTrait.php +57 -0
- vendor/Gcp/monolog/monolog/src/Monolog/Handler/GroupHandler.php +2 -1
- vendor/Gcp/monolog/monolog/src/Monolog/Handler/HipChatHandler.php +1 -0
- vendor/Gcp/monolog/monolog/src/Monolog/Handler/IFTTTHandler.php +2 -1
- vendor/Gcp/monolog/monolog/src/Monolog/Handler/InsightOpsHandler.php +1 -1
- vendor/Gcp/monolog/monolog/src/Monolog/Handler/NewRelicHandler.php +2 -1
- vendor/Gcp/monolog/monolog/src/Monolog/Handler/PHPConsoleHandler.php +2 -1
- vendor/Gcp/monolog/monolog/src/Monolog/Handler/ProcessableHandlerInterface.php +38 -0
- vendor/Gcp/monolog/monolog/src/Monolog/Handler/ProcessableHandlerTrait.php +65 -0
- vendor/Gcp/monolog/monolog/src/Monolog/Handler/RavenHandler.php +1 -0
- vendor/Gcp/monolog/monolog/src/Monolog/Handler/SamplingHandler.php +36 -10
- vendor/Gcp/monolog/monolog/src/Monolog/Handler/Slack/SlackRecord.php +6 -1
- vendor/Gcp/monolog/monolog/src/Monolog/Handler/SlackHandler.php +2 -1
- vendor/Gcp/monolog/monolog/src/Monolog/Handler/SlackWebhookHandler.php +2 -1
- vendor/Gcp/monolog/monolog/src/Monolog/Handler/SlackbotHandler.php +6 -2
- vendor/Gcp/monolog/monolog/src/Monolog/Handler/StreamHandler.php +1 -0
- vendor/Gcp/monolog/monolog/src/Monolog/Handler/SyslogUdpHandler.php +16 -4
- vendor/Gcp/monolog/monolog/src/Monolog/Handler/TestHandler.php +11 -0
- vendor/Gcp/monolog/monolog/src/Monolog/Handler/WhatFailureGroupHandler.php +2 -1
- vendor/Gcp/monolog/monolog/src/Monolog/Handler/ZendMonitorHandler.php +13 -10
- vendor/Gcp/monolog/monolog/src/Monolog/SignalHandler.php +1 -1
- vendor/Gcp/monolog/monolog/src/Monolog/Utils.php +114 -0
- vendor/Gcp/psr/log/Psr/Log/LoggerInterface.php +2 -0
- vendor/Gcp/psr/log/Psr/Log/LoggerTrait.php +2 -0
- vendor/Gcp/psr/log/Psr/Log/NullLogger.php +2 -0
- vendor/Gcp/psr/log/README.md +6 -0
- vendor/Gcp/psr/log/composer.json +1 -1
- vendor/Gcp/ralouphie/getallheaders/README.md +8 -0
- vendor/Gcp/ralouphie/getallheaders/composer.json +8 -3
- vendor/Gcp/ralouphie/getallheaders/phpunit.xml +0 -22
- wordpress-s3.php +2 -2
@@ -2,9 +2,9 @@
|
|
2 |
**Contributors:** bradt, deliciousbrains, ianmjones
|
3 |
**Tags:** uploads, amazon, s3, amazon s3, digitalocean, digitalocean spaces, google cloud storage, gcs, mirror, admin, media, cdn, cloudfront
|
4 |
**Requires at least:** 4.9
|
5 |
-
**Tested up to:** 5.
|
6 |
**Requires PHP:** 5.5
|
7 |
-
**Stable tag:** 2.3.
|
8 |
**License:** GPLv3
|
9 |
|
10 |
Copies files to Amazon S3, DigitalOcean Spaces or Google Cloud Storage as they are uploaded to the Media Library. Optionally configure Amazon CloudFront or another CDN for faster delivery.
|
@@ -89,6 +89,12 @@ This version requires PHP 5.3.3+ and the Amazon Web Services plugin
|
|
89 |
|
90 |
## Changelog ##
|
91 |
|
|
|
|
|
|
|
|
|
|
|
|
|
92 |
### WP Offload Media Lite 2.3.1 - 2019-11-19 ###
|
93 |
* Bug fix: Uncaught Error: Cannot use object of type Media_Library_Item as array in wp-includes/media.php:217
|
94 |
* Bug fix: Image not automatically offloaded if subsizes not expected
|
2 |
**Contributors:** bradt, deliciousbrains, ianmjones
|
3 |
**Tags:** uploads, amazon, s3, amazon s3, digitalocean, digitalocean spaces, google cloud storage, gcs, mirror, admin, media, cdn, cloudfront
|
4 |
**Requires at least:** 4.9
|
5 |
+
**Tested up to:** 5.4
|
6 |
**Requires PHP:** 5.5
|
7 |
+
**Stable tag:** 2.3.2
|
8 |
**License:** GPLv3
|
9 |
|
10 |
Copies files to Amazon S3, DigitalOcean Spaces or Google Cloud Storage as they are uploaded to the Media Library. Optionally configure Amazon CloudFront or another CDN for faster delivery.
|
89 |
|
90 |
## Changelog ##
|
91 |
|
92 |
+
### WP Offload Media Lite 2.3.2 - 2019-12-09 ###
|
93 |
+
* Improvement: Reduced database queries when external object cache available
|
94 |
+
* Bug fix: Uncaught Error: Call to undefined function DeliciousBrains\WP_Offload_Media\Gcp\GuzzleHttp\choose_handler()
|
95 |
+
* Bug fix: SVG files not automatically offloaded
|
96 |
+
* Tested: PHP 7.4
|
97 |
+
|
98 |
### WP Offload Media Lite 2.3.1 - 2019-11-19 ###
|
99 |
* Bug fix: Uncaught Error: Cannot use object of type Media_Library_Item as array in wp-includes/media.php:217
|
100 |
* Bug fix: Image not automatically offloaded if subsizes not expected
|
@@ -1064,7 +1064,7 @@ class Amazon_S3_And_CloudFront extends AS3CF_Plugin_Base {
|
|
1064 |
// Protect against updates of partially formed metadata since WordPress 5.3.
|
1065 |
// Checks whether new upload currently has no subsizes recorded but is expected to have subsizes during upload,
|
1066 |
// and if so, are any of its currently missing sizes part of the set.
|
1067 |
-
if ( function_exists( 'wp_get_registered_image_subsizes' ) && function_exists( 'wp_get_missing_image_subsizes' ) ) {
|
1068 |
if ( empty( $data['sizes'] ) && wp_attachment_is_image( $post_id ) ) {
|
1069 |
|
1070 |
// There is no unified way of checking whether subsizes are expected, so we have to duplicate WordPress code here.
|
1064 |
// Protect against updates of partially formed metadata since WordPress 5.3.
|
1065 |
// Checks whether new upload currently has no subsizes recorded but is expected to have subsizes during upload,
|
1066 |
// and if so, are any of its currently missing sizes part of the set.
|
1067 |
+
if ( ! empty( $data ) && function_exists( 'wp_get_registered_image_subsizes' ) && function_exists( 'wp_get_missing_image_subsizes' ) ) {
|
1068 |
if ( empty( $data['sizes'] ) && wp_attachment_is_image( $post_id ) ) {
|
1069 |
|
1070 |
// There is no unified way of checking whether subsizes are expected, so we have to duplicate WordPress code here.
|
@@ -20,6 +20,16 @@ abstract class Item {
|
|
20 |
protected static $items_cache_by_path = array();
|
21 |
protected static $items_cache_by_source_path = array();
|
22 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
23 |
private $id;
|
24 |
private $provider;
|
25 |
private $region;
|
@@ -71,6 +81,136 @@ abstract class Item {
|
|
71 |
static::add_to_items_cache( $this );
|
72 |
}
|
73 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
74 |
/**
|
75 |
* (Re)initialize the static cache used for speeding up queries.
|
76 |
*/
|
@@ -111,7 +251,7 @@ abstract class Item {
|
|
111 |
}
|
112 |
|
113 |
/**
|
114 |
-
*
|
115 |
*
|
116 |
* @param Item $item
|
117 |
*/
|
@@ -151,6 +291,14 @@ abstract class Item {
|
|
151 |
return static::$items_cache_by_id[ $blog_id ][ $id ];
|
152 |
}
|
153 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
154 |
return false;
|
155 |
}
|
156 |
|
@@ -168,6 +316,14 @@ abstract class Item {
|
|
168 |
return static::$items_cache_by_source_id[ $blog_id ][ static::$source_type ][ $source_id ];
|
169 |
}
|
170 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
171 |
return false;
|
172 |
}
|
173 |
|
@@ -372,14 +528,22 @@ abstract class Item {
|
|
372 |
$this->id = $wpdb->insert_id;
|
373 |
|
374 |
// Now that the item has an ID it should be (re)cached.
|
375 |
-
|
376 |
}
|
377 |
} else {
|
|
|
|
|
|
|
|
|
|
|
378 |
$result = $wpdb->update( static::items_table(), $this->key_values(), array( 'id' => $this->id ), $this->formats(), array( '%d' ) );
|
379 |
}
|
380 |
|
381 |
-
if (
|
382 |
-
|
|
|
|
|
|
|
383 |
|
384 |
return new WP_Error( 'item_save', 'Error saving item:- ' . $wpdb->last_error );
|
385 |
}
|
@@ -396,6 +560,7 @@ abstract class Item {
|
|
396 |
global $wpdb;
|
397 |
|
398 |
static::remove_from_items_cache( $this );
|
|
|
399 |
|
400 |
if ( empty( $this->id ) ) {
|
401 |
return new WP_Error( 'item_delete', 'Error trying to delete item with no id.' );
|
@@ -414,17 +579,18 @@ abstract class Item {
|
|
414 |
* Creates an item based on object from database.
|
415 |
*
|
416 |
* @param object $object
|
|
|
417 |
*
|
418 |
* @return Item
|
419 |
*/
|
420 |
-
protected static function create( $object ) {
|
421 |
$extra_info = array();
|
422 |
|
423 |
if ( ! empty( $object->extra_info ) ) {
|
424 |
$extra_info = unserialize( $object->extra_info );
|
425 |
}
|
426 |
|
427 |
-
|
428 |
$object->provider,
|
429 |
$object->region,
|
430 |
$object->bucket,
|
@@ -436,6 +602,12 @@ abstract class Item {
|
|
436 |
$extra_info,
|
437 |
$object->id
|
438 |
);
|
|
|
|
|
|
|
|
|
|
|
|
|
439 |
}
|
440 |
|
441 |
/**
|
@@ -466,7 +638,7 @@ abstract class Item {
|
|
466 |
return false;
|
467 |
}
|
468 |
|
469 |
-
return static::create( $object );
|
470 |
}
|
471 |
|
472 |
/**
|
@@ -505,7 +677,7 @@ abstract class Item {
|
|
505 |
return false;
|
506 |
}
|
507 |
|
508 |
-
return static::create( $object );
|
509 |
}
|
510 |
|
511 |
/**
|
20 |
protected static $items_cache_by_path = array();
|
21 |
protected static $items_cache_by_source_path = array();
|
22 |
|
23 |
+
/**
|
24 |
+
* @var array Keys with array of fields that can be used for cache lookups.
|
25 |
+
*/
|
26 |
+
protected static $cache_keys = array(
|
27 |
+
'id' => array( 'id' ),
|
28 |
+
'source_id' => array( 'source_id' ),
|
29 |
+
'path' => array( 'path', 'original_path' ),
|
30 |
+
'source_path' => array( 'source_path', 'original_source_path' ),
|
31 |
+
);
|
32 |
+
|
33 |
private $id;
|
34 |
private $provider;
|
35 |
private $region;
|
81 |
static::add_to_items_cache( $this );
|
82 |
}
|
83 |
|
84 |
+
/**
|
85 |
+
* Returns the string used to group all keys in the object cache by.
|
86 |
+
*
|
87 |
+
* @return string
|
88 |
+
*/
|
89 |
+
protected static function get_object_cache_group() {
|
90 |
+
static $group;
|
91 |
+
|
92 |
+
if ( empty( $group ) ) {
|
93 |
+
/** @var Amazon_S3_And_CloudFront $as3cf */
|
94 |
+
global $as3cf;
|
95 |
+
$group = trim( '' . apply_filters( 'as3cf_object_cache_group', $as3cf->get_plugin_prefix() ) );
|
96 |
+
}
|
97 |
+
|
98 |
+
return $group;
|
99 |
+
}
|
100 |
+
|
101 |
+
/**
|
102 |
+
* Get base string for all of current blog's object cache keys.
|
103 |
+
*
|
104 |
+
* @return string
|
105 |
+
*/
|
106 |
+
protected static function get_object_cache_base_key() {
|
107 |
+
$blog_id = get_current_blog_id();
|
108 |
+
|
109 |
+
return static::items_table() . '-' . $blog_id . '-' . static::$source_type;
|
110 |
+
}
|
111 |
+
|
112 |
+
/**
|
113 |
+
* Get full object cache key.
|
114 |
+
*
|
115 |
+
* @param string $base_key
|
116 |
+
* @param string $key
|
117 |
+
* @param string $field
|
118 |
+
*
|
119 |
+
* @return string
|
120 |
+
*/
|
121 |
+
protected static function get_object_cache_full_key( $base_key, $key, $field ) {
|
122 |
+
return sanitize_text_field( $base_key . '-' . $key . '-' . $field );
|
123 |
+
}
|
124 |
+
|
125 |
+
/**
|
126 |
+
* Add the given item to the object cache.
|
127 |
+
*
|
128 |
+
* @param Item $item
|
129 |
+
*/
|
130 |
+
protected static function add_to_object_cache( $item ) {
|
131 |
+
if ( empty( $item ) || empty( static::$cache_keys ) ) {
|
132 |
+
return;
|
133 |
+
}
|
134 |
+
|
135 |
+
$base_key = static::get_object_cache_base_key();
|
136 |
+
$group = static::get_object_cache_group();
|
137 |
+
|
138 |
+
$keys = array();
|
139 |
+
|
140 |
+
foreach ( static::$cache_keys as $key => $fields ) {
|
141 |
+
foreach ( $fields as $field ) {
|
142 |
+
$full_key = static::get_object_cache_full_key( $base_key, $key, $item->{$field}() );
|
143 |
+
|
144 |
+
if ( in_array( $full_key, $keys ) ) {
|
145 |
+
continue;
|
146 |
+
}
|
147 |
+
|
148 |
+
wp_cache_set( $full_key, $item, $group );
|
149 |
+
|
150 |
+
$keys[] = $full_key;
|
151 |
+
}
|
152 |
+
}
|
153 |
+
}
|
154 |
+
|
155 |
+
/**
|
156 |
+
* Delete the given item from the object cache.
|
157 |
+
*
|
158 |
+
* @param Item $item
|
159 |
+
*/
|
160 |
+
protected static function remove_from_object_cache( $item ) {
|
161 |
+
if ( empty( $item ) || empty( static::$cache_keys ) ) {
|
162 |
+
return;
|
163 |
+
}
|
164 |
+
|
165 |
+
$base_key = static::get_object_cache_base_key();
|
166 |
+
$group = static::get_object_cache_group();
|
167 |
+
|
168 |
+
$keys = array();
|
169 |
+
|
170 |
+
foreach ( static::$cache_keys as $key => $fields ) {
|
171 |
+
foreach ( $fields as $field ) {
|
172 |
+
$full_key = static::get_object_cache_full_key( $base_key, $key, $item->{$field}() );
|
173 |
+
|
174 |
+
if ( in_array( $full_key, $keys ) ) {
|
175 |
+
continue;
|
176 |
+
}
|
177 |
+
|
178 |
+
wp_cache_delete( $full_key, $group );
|
179 |
+
|
180 |
+
$keys[] = $full_key;
|
181 |
+
}
|
182 |
+
}
|
183 |
+
}
|
184 |
+
|
185 |
+
/**
|
186 |
+
* Try and get Item from object cache by known key and value.
|
187 |
+
*
|
188 |
+
* Note: Actual lookup is scoped by blog and item's source_type, so example key may be 'source_id'.
|
189 |
+
*
|
190 |
+
* @param string $key The base of the key that makes up the lookup, e.g. field for given value.
|
191 |
+
* @param mixed $value Will be coerced to string for lookup.
|
192 |
+
*
|
193 |
+
* @return bool|Item
|
194 |
+
*/
|
195 |
+
protected static function get_from_object_cache( $key, $value ) {
|
196 |
+
if ( ! array_key_exists( $key, static::$cache_keys ) ) {
|
197 |
+
return false;
|
198 |
+
}
|
199 |
+
|
200 |
+
$base_key = static::get_object_cache_base_key();
|
201 |
+
$full_key = static::get_object_cache_full_key( $base_key, $key, $value );
|
202 |
+
$group = static::get_object_cache_group();
|
203 |
+
$force = false;
|
204 |
+
$found = false;
|
205 |
+
$result = wp_cache_get( $full_key, $group, $force, $found );
|
206 |
+
|
207 |
+
if ( $found ) {
|
208 |
+
return $result;
|
209 |
+
}
|
210 |
+
|
211 |
+
return false;
|
212 |
+
}
|
213 |
+
|
214 |
/**
|
215 |
* (Re)initialize the static cache used for speeding up queries.
|
216 |
*/
|
251 |
}
|
252 |
|
253 |
/**
|
254 |
+
* Remove an item from the static cache that allows fast retrieval via get_from_items_cache_by_* functions.
|
255 |
*
|
256 |
* @param Item $item
|
257 |
*/
|
291 |
return static::$items_cache_by_id[ $blog_id ][ $id ];
|
292 |
}
|
293 |
|
294 |
+
$item = static::get_from_object_cache( 'id', $id );
|
295 |
+
|
296 |
+
if ( $item ) {
|
297 |
+
static::add_to_items_cache( $item );
|
298 |
+
|
299 |
+
return $item;
|
300 |
+
}
|
301 |
+
|
302 |
return false;
|
303 |
}
|
304 |
|
316 |
return static::$items_cache_by_source_id[ $blog_id ][ static::$source_type ][ $source_id ];
|
317 |
}
|
318 |
|
319 |
+
$item = static::get_from_object_cache( 'source_id', $source_id );
|
320 |
+
|
321 |
+
if ( $item ) {
|
322 |
+
static::add_to_items_cache( $item );
|
323 |
+
|
324 |
+
return $item;
|
325 |
+
}
|
326 |
+
|
327 |
return false;
|
328 |
}
|
329 |
|
528 |
$this->id = $wpdb->insert_id;
|
529 |
|
530 |
// Now that the item has an ID it should be (re)cached.
|
531 |
+
static::add_to_items_cache( $this );
|
532 |
}
|
533 |
} else {
|
534 |
+
// Make sure object cache does not have stale items.
|
535 |
+
$old_item = static::get_from_object_cache( 'id', $this->id() );
|
536 |
+
static::remove_from_object_cache( $old_item );
|
537 |
+
unset( $old_item );
|
538 |
+
|
539 |
$result = $wpdb->update( static::items_table(), $this->key_values(), array( 'id' => $this->id ), $this->formats(), array( '%d' ) );
|
540 |
}
|
541 |
|
542 |
+
if ( $result ) {
|
543 |
+
// Now that the item has an ID it should be (re)cached.
|
544 |
+
static::add_to_object_cache( $this );
|
545 |
+
} else {
|
546 |
+
static::remove_from_items_cache( $this );
|
547 |
|
548 |
return new WP_Error( 'item_save', 'Error saving item:- ' . $wpdb->last_error );
|
549 |
}
|
560 |
global $wpdb;
|
561 |
|
562 |
static::remove_from_items_cache( $this );
|
563 |
+
static::remove_from_object_cache( $this );
|
564 |
|
565 |
if ( empty( $this->id ) ) {
|
566 |
return new WP_Error( 'item_delete', 'Error trying to delete item with no id.' );
|
579 |
* Creates an item based on object from database.
|
580 |
*
|
581 |
* @param object $object
|
582 |
+
* @param bool $add_to_object_cache Should this object be added to the object cache too?
|
583 |
*
|
584 |
* @return Item
|
585 |
*/
|
586 |
+
protected static function create( $object, $add_to_object_cache = false ) {
|
587 |
$extra_info = array();
|
588 |
|
589 |
if ( ! empty( $object->extra_info ) ) {
|
590 |
$extra_info = unserialize( $object->extra_info );
|
591 |
}
|
592 |
|
593 |
+
$item = new static(
|
594 |
$object->provider,
|
595 |
$object->region,
|
596 |
$object->bucket,
|
602 |
$extra_info,
|
603 |
$object->id
|
604 |
);
|
605 |
+
|
606 |
+
if ( $add_to_object_cache ) {
|
607 |
+
static::add_to_object_cache( $item );
|
608 |
+
}
|
609 |
+
|
610 |
+
return $item;
|
611 |
}
|
612 |
|
613 |
/**
|
638 |
return false;
|
639 |
}
|
640 |
|
641 |
+
return static::create( $object, true );
|
642 |
}
|
643 |
|
644 |
/**
|
677 |
return false;
|
678 |
}
|
679 |
|
680 |
+
return static::create( $object, true );
|
681 |
}
|
682 |
|
683 |
/**
|
@@ -8,7 +8,7 @@ msgid ""
|
|
8 |
msgstr ""
|
9 |
"Project-Id-Version: amazon-s3-and-cloudfront\n"
|
10 |
"Report-Msgid-Bugs-To: nom@deliciousbrains.com\n"
|
11 |
-
"POT-Creation-Date: 2019-
|
12 |
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
13 |
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
14 |
"Language-Team: LANGUAGE <LL@li.org>\n"
|
8 |
msgstr ""
|
9 |
"Project-Id-Version: amazon-s3-and-cloudfront\n"
|
10 |
"Report-Msgid-Bugs-To: nom@deliciousbrains.com\n"
|
11 |
+
"POT-Creation-Date: 2019-12-09 11:47+0000\n"
|
12 |
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
13 |
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
14 |
"Language-Team: LANGUAGE <LL@li.org>\n"
|
@@ -2,9 +2,9 @@
|
|
2 |
Contributors: bradt, deliciousbrains, ianmjones
|
3 |
Tags: uploads, amazon, s3, amazon s3, digitalocean, digitalocean spaces, google cloud storage, gcs, mirror, admin, media, cdn, cloudfront
|
4 |
Requires at least: 4.9
|
5 |
-
Tested up to: 5.
|
6 |
Requires PHP: 5.5
|
7 |
-
Stable tag: 2.3.
|
8 |
License: GPLv3
|
9 |
|
10 |
Copies files to Amazon S3, DigitalOcean Spaces or Google Cloud Storage as they are uploaded to the Media Library. Optionally configure Amazon CloudFront or another CDN for faster delivery.
|
@@ -81,6 +81,12 @@ This version requires PHP 5.3.3+ and the Amazon Web Services plugin
|
|
81 |
|
82 |
== Changelog ==
|
83 |
|
|
|
|
|
|
|
|
|
|
|
|
|
84 |
= WP Offload Media Lite 2.3.1 - 2019-11-19 =
|
85 |
* Bug fix: Uncaught Error: Cannot use object of type Media_Library_Item as array in wp-includes/media.php:217
|
86 |
* Bug fix: Image not automatically offloaded if subsizes not expected
|
2 |
Contributors: bradt, deliciousbrains, ianmjones
|
3 |
Tags: uploads, amazon, s3, amazon s3, digitalocean, digitalocean spaces, google cloud storage, gcs, mirror, admin, media, cdn, cloudfront
|
4 |
Requires at least: 4.9
|
5 |
+
Tested up to: 5.4
|
6 |
Requires PHP: 5.5
|
7 |
+
Stable tag: 2.3.2
|
8 |
License: GPLv3
|
9 |
|
10 |
Copies files to Amazon S3, DigitalOcean Spaces or Google Cloud Storage as they are uploaded to the Media Library. Optionally configure Amazon CloudFront or another CDN for faster delivery.
|
81 |
|
82 |
== Changelog ==
|
83 |
|
84 |
+
= WP Offload Media Lite 2.3.2 - 2019-12-09 =
|
85 |
+
* Improvement: Reduced database queries when external object cache available
|
86 |
+
* Bug fix: Uncaught Error: Call to undefined function DeliciousBrains\WP_Offload_Media\Gcp\GuzzleHttp\choose_handler()
|
87 |
+
* Bug fix: SVG files not automatically offloaded
|
88 |
+
* Tested: PHP 7.4
|
89 |
+
|
90 |
= WP Offload Media Lite 2.3.1 - 2019-11-19 =
|
91 |
* Bug fix: Uncaught Error: Cannot use object of type Media_Library_Item as array in wp-includes/media.php:217
|
92 |
* Bug fix: Image not automatically offloaded if subsizes not expected
|
@@ -2,4 +2,4 @@
|
|
2 |
|
3 |
// autoload.php @generated by Composer
|
4 |
require_once __DIR__ . '/composer/autoload_real.php';
|
5 |
-
return \
|
2 |
|
3 |
// autoload.php @generated by Composer
|
4 |
require_once __DIR__ . '/composer/autoload_real.php';
|
5 |
+
return \ComposerAutoloaderInitad2bbf672104326f33ebff61e2e8e9b8::getLoader();
|
@@ -3,4 +3,4 @@
|
|
3 |
// autoload_classmap.php @generated by Composer
|
4 |
$vendorDir = \dirname(\dirname(__FILE__));
|
5 |
$baseDir = \dirname($vendorDir);
|
6 |
-
return array('DeliciousBrains\\WP_Offload_Media\\Gcp\\Firebase\\JWT\\BeforeValidException' => $vendorDir . '/firebase/php-jwt/src/BeforeValidException.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Firebase\\JWT\\ExpiredException' => $vendorDir . '/firebase/php-jwt/src/ExpiredException.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Firebase\\JWT\\JWT' => $vendorDir . '/firebase/php-jwt/src/JWT.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Firebase\\JWT\\SignatureInvalidException' => $vendorDir . '/firebase/php-jwt/src/SignatureInvalidException.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Auth\\ApplicationDefaultCredentials' => $vendorDir . '/google/auth/src/ApplicationDefaultCredentials.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Auth\\CacheTrait' => $vendorDir . '/google/auth/src/CacheTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Auth\\Cache\\InvalidArgumentException' => $vendorDir . '/google/auth/src/Cache/InvalidArgumentException.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Auth\\Cache\\Item' => $vendorDir . '/google/auth/src/Cache/Item.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Auth\\Cache\\MemoryCacheItemPool' => $vendorDir . '/google/auth/src/Cache/MemoryCacheItemPool.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Auth\\Cache\\SysVCacheItemPool' => $vendorDir . '/google/auth/src/Cache/SysVCacheItemPool.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Auth\\CredentialsLoader' => $vendorDir . '/google/auth/src/CredentialsLoader.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Auth\\Credentials\\AppIdentityCredentials' => $vendorDir . '/google/auth/src/Credentials/AppIdentityCredentials.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Auth\\Credentials\\GCECredentials' => $vendorDir . '/google/auth/src/Credentials/GCECredentials.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Auth\\Credentials\\IAMCredentials' => $vendorDir . '/google/auth/src/Credentials/IAMCredentials.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Auth\\Credentials\\InsecureCredentials' => $vendorDir . '/google/auth/src/Credentials/InsecureCredentials.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Auth\\Credentials\\ServiceAccountCredentials' => $vendorDir . '/google/auth/src/Credentials/ServiceAccountCredentials.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Auth\\Credentials\\ServiceAccountJwtAccessCredentials' => $vendorDir . '/google/auth/src/Credentials/ServiceAccountJwtAccessCredentials.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Auth\\Credentials\\UserRefreshCredentials' => $vendorDir . '/google/auth/src/Credentials/UserRefreshCredentials.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Auth\\FetchAuthTokenCache' => $vendorDir . '/google/auth/src/FetchAuthTokenCache.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Auth\\FetchAuthTokenInterface' => $vendorDir . '/google/auth/src/FetchAuthTokenInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Auth\\HttpHandler\\Guzzle5HttpHandler' => $vendorDir . '/google/auth/src/HttpHandler/Guzzle5HttpHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Auth\\HttpHandler\\Guzzle6HttpHandler' => $vendorDir . '/google/auth/src/HttpHandler/Guzzle6HttpHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Auth\\HttpHandler\\HttpHandlerFactory' => $vendorDir . '/google/auth/src/HttpHandler/HttpHandlerFactory.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Auth\\Middleware\\AuthTokenMiddleware' => $vendorDir . '/google/auth/src/Middleware/AuthTokenMiddleware.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Auth\\Middleware\\ScopedAccessTokenMiddleware' => $vendorDir . '/google/auth/src/Middleware/ScopedAccessTokenMiddleware.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Auth\\Middleware\\SimpleMiddleware' => $vendorDir . '/google/auth/src/Middleware/SimpleMiddleware.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Auth\\OAuth2' => $vendorDir . '/google/auth/src/OAuth2.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Auth\\Subscriber\\AuthTokenSubscriber' => $vendorDir . '/google/auth/src/Subscriber/AuthTokenSubscriber.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Auth\\Subscriber\\ScopedAccessTokenSubscriber' => $vendorDir . '/google/auth/src/Subscriber/ScopedAccessTokenSubscriber.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Auth\\Subscriber\\SimpleSubscriber' => $vendorDir . '/google/auth/src/Subscriber/SimpleSubscriber.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\AnonymousCredentials' => $vendorDir . '/google/cloud-core/src/AnonymousCredentials.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\ArrayTrait' => $vendorDir . '/google/cloud-core/src/ArrayTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Batch\\BatchDaemon' => $vendorDir . '/google/cloud-core/src/Batch/BatchDaemon.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Batch\\BatchDaemonTrait' => $vendorDir . '/google/cloud-core/src/Batch/BatchDaemonTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Batch\\BatchJob' => $vendorDir . '/google/cloud-core/src/Batch/BatchJob.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Batch\\BatchRunner' => $vendorDir . '/google/cloud-core/src/Batch/BatchRunner.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Batch\\BatchTrait' => $vendorDir . '/google/cloud-core/src/Batch/BatchTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Batch\\ClosureSerializerInterface' => $vendorDir . '/google/cloud-core/src/Batch/ClosureSerializerInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Batch\\ConfigStorageInterface' => $vendorDir . '/google/cloud-core/src/Batch/ConfigStorageInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Batch\\HandleFailureTrait' => $vendorDir . '/google/cloud-core/src/Batch/HandleFailureTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Batch\\InMemoryConfigStorage' => $vendorDir . '/google/cloud-core/src/Batch/InMemoryConfigStorage.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Batch\\InterruptTrait' => $vendorDir . '/google/cloud-core/src/Batch/InterruptTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Batch\\JobConfig' => $vendorDir . '/google/cloud-core/src/Batch/JobConfig.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Batch\\JobInterface' => $vendorDir . '/google/cloud-core/src/Batch/JobInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Batch\\JobTrait' => $vendorDir . '/google/cloud-core/src/Batch/JobTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Batch\\OpisClosureSerializer' => $vendorDir . '/google/cloud-core/src/Batch/OpisClosureSerializer.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Batch\\ProcessItemInterface' => $vendorDir . '/google/cloud-core/src/Batch/ProcessItemInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Batch\\Retry' => $vendorDir . '/google/cloud-core/src/Batch/Retry.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Batch\\SerializableClientTrait' => $vendorDir . '/google/cloud-core/src/Batch/SerializableClientTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Batch\\SimpleJob' => $vendorDir . '/google/cloud-core/src/Batch/SimpleJob.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Batch\\SimpleJobTrait' => $vendorDir . '/google/cloud-core/src/Batch/SimpleJobTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Batch\\SysvConfigStorage' => $vendorDir . '/google/cloud-core/src/Batch/SysvConfigStorage.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Batch\\SysvProcessor' => $vendorDir . '/google/cloud-core/src/Batch/SysvProcessor.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Blob' => $vendorDir . '/google/cloud-core/src/Blob.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\CallTrait' => $vendorDir . '/google/cloud-core/src/CallTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\ClientTrait' => $vendorDir . '/google/cloud-core/src/ClientTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Compute\\Metadata' => $vendorDir . '/google/cloud-core/src/Compute/Metadata.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Compute\\Metadata\\Readers\\ReaderInterface' => $vendorDir . '/google/cloud-core/src/Compute/Metadata/Readers/ReaderInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Compute\\Metadata\\Readers\\StreamReader' => $vendorDir . '/google/cloud-core/src/Compute/Metadata/Readers/StreamReader.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\ConcurrencyControlTrait' => $vendorDir . '/google/cloud-core/src/ConcurrencyControlTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\DebugInfoTrait' => $vendorDir . '/google/cloud-core/src/DebugInfoTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Duration' => $vendorDir . '/google/cloud-core/src/Duration.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\EmulatorTrait' => $vendorDir . '/google/cloud-core/src/EmulatorTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Exception\\AbortedException' => $vendorDir . '/google/cloud-core/src/Exception/AbortedException.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Exception\\BadRequestException' => $vendorDir . '/google/cloud-core/src/Exception/BadRequestException.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Exception\\ConflictException' => $vendorDir . '/google/cloud-core/src/Exception/ConflictException.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Exception\\DeadlineExceededException' => $vendorDir . '/google/cloud-core/src/Exception/DeadlineExceededException.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Exception\\FailedPreconditionException' => $vendorDir . '/google/cloud-core/src/Exception/FailedPreconditionException.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Exception\\GoogleException' => $vendorDir . '/google/cloud-core/src/Exception/GoogleException.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Exception\\NotFoundException' => $vendorDir . '/google/cloud-core/src/Exception/NotFoundException.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Exception\\ServerException' => $vendorDir . '/google/cloud-core/src/Exception/ServerException.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Exception\\ServiceException' => $vendorDir . '/google/cloud-core/src/Exception/ServiceException.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\ExponentialBackoff' => $vendorDir . '/google/cloud-core/src/ExponentialBackoff.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\GeoPoint' => $vendorDir . '/google/cloud-core/src/GeoPoint.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\GrpcRequestWrapper' => $vendorDir . '/google/cloud-core/src/GrpcRequestWrapper.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\GrpcTrait' => $vendorDir . '/google/cloud-core/src/GrpcTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Iam\\Iam' => $vendorDir . '/google/cloud-core/src/Iam/Iam.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Iam\\IamConnectionInterface' => $vendorDir . '/google/cloud-core/src/Iam/IamConnectionInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Iam\\PolicyBuilder' => $vendorDir . '/google/cloud-core/src/Iam/PolicyBuilder.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Int64' => $vendorDir . '/google/cloud-core/src/Int64.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Iterator\\ItemIterator' => $vendorDir . '/google/cloud-core/src/Iterator/ItemIterator.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Iterator\\ItemIteratorTrait' => $vendorDir . '/google/cloud-core/src/Iterator/ItemIteratorTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Iterator\\PageIterator' => $vendorDir . '/google/cloud-core/src/Iterator/PageIterator.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Iterator\\PageIteratorTrait' => $vendorDir . '/google/cloud-core/src/Iterator/PageIteratorTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\JsonTrait' => $vendorDir . '/google/cloud-core/src/JsonTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Lock\\FlockLock' => $vendorDir . '/google/cloud-core/src/Lock/FlockLock.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Lock\\LockInterface' => $vendorDir . '/google/cloud-core/src/Lock/LockInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Lock\\LockTrait' => $vendorDir . '/google/cloud-core/src/Lock/LockTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Lock\\SemaphoreLock' => $vendorDir . '/google/cloud-core/src/Lock/SemaphoreLock.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Lock\\SymfonyLockAdapter' => $vendorDir . '/google/cloud-core/src/Lock/SymfonyLockAdapter.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Logger\\AppEngineFlexFormatter' => $vendorDir . '/google/cloud-core/src/Logger/AppEngineFlexFormatter.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Logger\\AppEngineFlexHandler' => $vendorDir . '/google/cloud-core/src/Logger/AppEngineFlexHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\LongRunning\\LROTrait' => $vendorDir . '/google/cloud-core/src/LongRunning/LROTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\LongRunning\\LongRunningConnectionInterface' => $vendorDir . '/google/cloud-core/src/LongRunning/LongRunningConnectionInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\LongRunning\\LongRunningOperation' => $vendorDir . '/google/cloud-core/src/LongRunning/LongRunningOperation.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\LongRunning\\OperationResponseTrait' => $vendorDir . '/google/cloud-core/src/LongRunning/OperationResponseTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\PhpArray' => $vendorDir . '/google/cloud-core/src/PhpArray.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Report\\EmptyMetadataProvider' => $vendorDir . '/google/cloud-core/src/Report/EmptyMetadataProvider.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Report\\GAEFlexMetadataProvider' => $vendorDir . '/google/cloud-core/src/Report/GAEFlexMetadataProvider.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Report\\GAEMetadataProvider' => $vendorDir . '/google/cloud-core/src/Report/GAEMetadataProvider.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Report\\GAEStandardMetadataProvider' => $vendorDir . '/google/cloud-core/src/Report/GAEStandardMetadataProvider.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Report\\MetadataProviderInterface' => $vendorDir . '/google/cloud-core/src/Report/MetadataProviderInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Report\\MetadataProviderUtils' => $vendorDir . '/google/cloud-core/src/Report/MetadataProviderUtils.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Report\\SimpleMetadataProvider' => $vendorDir . '/google/cloud-core/src/Report/SimpleMetadataProvider.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\RequestBuilder' => $vendorDir . '/google/cloud-core/src/RequestBuilder.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\RequestWrapper' => $vendorDir . '/google/cloud-core/src/RequestWrapper.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\RequestWrapperTrait' => $vendorDir . '/google/cloud-core/src/RequestWrapperTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\RestTrait' => $vendorDir . '/google/cloud-core/src/RestTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Retry' => $vendorDir . '/google/cloud-core/src/Retry.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\RetryDeciderTrait' => $vendorDir . '/google/cloud-core/src/RetryDeciderTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\ServiceBuilder' => $vendorDir . '/google/cloud-core/src/ServiceBuilder.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\SysvTrait' => $vendorDir . '/google/cloud-core/src/SysvTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Testing\\ArrayHasSameValuesToken' => $vendorDir . '/google/cloud-core/src/Testing/ArrayHasSameValuesToken.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Testing\\CheckForClassTrait' => $vendorDir . '/google/cloud-core/src/Testing/CheckForClassTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Testing\\DatastoreOperationRefreshTrait' => $vendorDir . '/google/cloud-core/src/Testing/DatastoreOperationRefreshTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Testing\\DocBlockStripSpaces' => $vendorDir . '/google/cloud-core/src/Testing/DocBlockStripSpaces.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Testing\\FileListFilterIterator' => $vendorDir . '/google/cloud-core/src/Testing/FileListFilterIterator.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Testing\\GrpcTestTrait' => $vendorDir . '/google/cloud-core/src/Testing/GrpcTestTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Testing\\KeyPairGenerateTrait' => $vendorDir . '/google/cloud-core/src/Testing/KeyPairGenerateTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Testing\\Lock\\MockValues' => $vendorDir . '/google/cloud-core/src/Testing/Lock/MockValues.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Testing\\RegexFileFilter' => $vendorDir . '/google/cloud-core/src/Testing/RegexFileFilter.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Testing\\Snippet\\Container' => $vendorDir . '/google/cloud-core/src/Testing/Snippet/Container.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Testing\\Snippet\\Coverage\\Coverage' => $vendorDir . '/google/cloud-core/src/Testing/Snippet/Coverage/Coverage.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Testing\\Snippet\\Coverage\\ExcludeFilter' => $vendorDir . '/google/cloud-core/src/Testing/Snippet/Coverage/ExcludeFilter.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Testing\\Snippet\\Coverage\\ResultPrinter' => $vendorDir . '/google/cloud-core/src/Testing/Snippet/Coverage/ResultPrinter.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Testing\\Snippet\\Coverage\\Scanner' => $vendorDir . '/google/cloud-core/src/Testing/Snippet/Coverage/Scanner.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Testing\\Snippet\\Coverage\\ScannerInterface' => $vendorDir . '/google/cloud-core/src/Testing/Snippet/Coverage/ScannerInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Testing\\Snippet\\Fixtures' => $vendorDir . '/google/cloud-core/src/Testing/Snippet/Fixtures.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Testing\\Snippet\\Parser\\InvokeResult' => $vendorDir . '/google/cloud-core/src/Testing/Snippet/Parser/InvokeResult.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Testing\\Snippet\\Parser\\Parser' => $vendorDir . '/google/cloud-core/src/Testing/Snippet/Parser/Parser.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Testing\\Snippet\\Parser\\Snippet' => $vendorDir . '/google/cloud-core/src/Testing/Snippet/Parser/Snippet.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Testing\\Snippet\\SnippetTestCase' => $vendorDir . '/google/cloud-core/src/Testing/Snippet/SnippetTestCase.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Testing\\StubTrait' => $vendorDir . '/google/cloud-core/src/Testing/StubTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Testing\\System\\DeletionQueue' => $vendorDir . '/google/cloud-core/src/Testing/System/DeletionQueue.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Testing\\System\\SystemTestCase' => $vendorDir . '/google/cloud-core/src/Testing/System/SystemTestCase.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Testing\\TestHelpers' => $vendorDir . '/google/cloud-core/src/Testing/TestHelpers.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\TimeTrait' => $vendorDir . '/google/cloud-core/src/TimeTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Timestamp' => $vendorDir . '/google/cloud-core/src/Timestamp.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Upload\\AbstractUploader' => $vendorDir . '/google/cloud-core/src/Upload/AbstractUploader.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Upload\\MultipartUploader' => $vendorDir . '/google/cloud-core/src/Upload/MultipartUploader.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Upload\\ResumableUploader' => $vendorDir . '/google/cloud-core/src/Upload/ResumableUploader.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Upload\\SignedUrlUploader' => $vendorDir . '/google/cloud-core/src/Upload/SignedUrlUploader.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Upload\\StreamableUploader' => $vendorDir . '/google/cloud-core/src/Upload/StreamableUploader.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\UriTrait' => $vendorDir . '/google/cloud-core/src/UriTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\ValidateTrait' => $vendorDir . '/google/cloud-core/src/ValidateTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\ValueMapperTrait' => $vendorDir . '/google/cloud-core/src/ValueMapperTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\WhitelistTrait' => $vendorDir . '/google/cloud-core/src/WhitelistTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Storage\\Acl' => $vendorDir . '/google/cloud-storage/src/Acl.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Storage\\Bucket' => $vendorDir . '/google/cloud-storage/src/Bucket.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Storage\\Connection\\ConnectionInterface' => $vendorDir . '/google/cloud-storage/src/Connection/ConnectionInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Storage\\Connection\\IamBucket' => $vendorDir . '/google/cloud-storage/src/Connection/IamBucket.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Storage\\Connection\\Rest' => $vendorDir . '/google/cloud-storage/src/Connection/Rest.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Storage\\EncryptionTrait' => $vendorDir . '/google/cloud-storage/src/EncryptionTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Storage\\Lifecycle' => $vendorDir . '/google/cloud-storage/src/Lifecycle.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Storage\\Notification' => $vendorDir . '/google/cloud-storage/src/Notification.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Storage\\ObjectIterator' => $vendorDir . '/google/cloud-storage/src/ObjectIterator.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Storage\\ObjectPageIterator' => $vendorDir . '/google/cloud-storage/src/ObjectPageIterator.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Storage\\ReadStream' => $vendorDir . '/google/cloud-storage/src/ReadStream.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Storage\\StorageClient' => $vendorDir . '/google/cloud-storage/src/StorageClient.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Storage\\StorageObject' => $vendorDir . '/google/cloud-storage/src/StorageObject.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Storage\\StreamWrapper' => $vendorDir . '/google/cloud-storage/src/StreamWrapper.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Storage\\WriteStream' => $vendorDir . '/google/cloud-storage/src/WriteStream.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Client' => $vendorDir . '/guzzlehttp/guzzle/src/Client.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\ClientInterface' => $vendorDir . '/guzzlehttp/guzzle/src/ClientInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Cookie\\CookieJar' => $vendorDir . '/guzzlehttp/guzzle/src/Cookie/CookieJar.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Cookie\\CookieJarInterface' => $vendorDir . '/guzzlehttp/guzzle/src/Cookie/CookieJarInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Cookie\\FileCookieJar' => $vendorDir . '/guzzlehttp/guzzle/src/Cookie/FileCookieJar.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Cookie\\SessionCookieJar' => $vendorDir . '/guzzlehttp/guzzle/src/Cookie/SessionCookieJar.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Cookie\\SetCookie' => $vendorDir . '/guzzlehttp/guzzle/src/Cookie/SetCookie.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Exception\\BadResponseException' => $vendorDir . '/guzzlehttp/guzzle/src/Exception/BadResponseException.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Exception\\ClientException' => $vendorDir . '/guzzlehttp/guzzle/src/Exception/ClientException.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Exception\\ConnectException' => $vendorDir . '/guzzlehttp/guzzle/src/Exception/ConnectException.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Exception\\GuzzleException' => $vendorDir . '/guzzlehttp/guzzle/src/Exception/GuzzleException.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Exception\\RequestException' => $vendorDir . '/guzzlehttp/guzzle/src/Exception/RequestException.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Exception\\SeekException' => $vendorDir . '/guzzlehttp/guzzle/src/Exception/SeekException.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Exception\\ServerException' => $vendorDir . '/guzzlehttp/guzzle/src/Exception/ServerException.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Exception\\TooManyRedirectsException' => $vendorDir . '/guzzlehttp/guzzle/src/Exception/TooManyRedirectsException.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Exception\\TransferException' => $vendorDir . '/guzzlehttp/guzzle/src/Exception/TransferException.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\HandlerStack' => $vendorDir . '/guzzlehttp/guzzle/src/HandlerStack.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Handler\\CurlFactory' => $vendorDir . '/guzzlehttp/guzzle/src/Handler/CurlFactory.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Handler\\CurlFactoryInterface' => $vendorDir . '/guzzlehttp/guzzle/src/Handler/CurlFactoryInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Handler\\CurlHandler' => $vendorDir . '/guzzlehttp/guzzle/src/Handler/CurlHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Handler\\CurlMultiHandler' => $vendorDir . '/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Handler\\EasyHandle' => $vendorDir . '/guzzlehttp/guzzle/src/Handler/EasyHandle.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Handler\\MockHandler' => $vendorDir . '/guzzlehttp/guzzle/src/Handler/MockHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Handler\\Proxy' => $vendorDir . '/guzzlehttp/guzzle/src/Handler/Proxy.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Handler\\StreamHandler' => $vendorDir . '/guzzlehttp/guzzle/src/Handler/StreamHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\MessageFormatter' => $vendorDir . '/guzzlehttp/guzzle/src/MessageFormatter.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Middleware' => $vendorDir . '/guzzlehttp/guzzle/src/Middleware.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Pool' => $vendorDir . '/guzzlehttp/guzzle/src/Pool.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\PrepareBodyMiddleware' => $vendorDir . '/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Promise\\AggregateException' => $vendorDir . '/guzzlehttp/promises/src/AggregateException.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Promise\\CancellationException' => $vendorDir . '/guzzlehttp/promises/src/CancellationException.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Promise\\Coroutine' => $vendorDir . '/guzzlehttp/promises/src/Coroutine.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Promise\\EachPromise' => $vendorDir . '/guzzlehttp/promises/src/EachPromise.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Promise\\FulfilledPromise' => $vendorDir . '/guzzlehttp/promises/src/FulfilledPromise.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Promise\\Promise' => $vendorDir . '/guzzlehttp/promises/src/Promise.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Promise\\PromiseInterface' => $vendorDir . '/guzzlehttp/promises/src/PromiseInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Promise\\PromisorInterface' => $vendorDir . '/guzzlehttp/promises/src/PromisorInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Promise\\RejectedPromise' => $vendorDir . '/guzzlehttp/promises/src/RejectedPromise.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Promise\\RejectionException' => $vendorDir . '/guzzlehttp/promises/src/RejectionException.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Promise\\TaskQueue' => $vendorDir . '/guzzlehttp/promises/src/TaskQueue.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Promise\\TaskQueueInterface' => $vendorDir . '/guzzlehttp/promises/src/TaskQueueInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Psr7\\AppendStream' => $vendorDir . '/guzzlehttp/psr7/src/AppendStream.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Psr7\\BufferStream' => $vendorDir . '/guzzlehttp/psr7/src/BufferStream.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Psr7\\CachingStream' => $vendorDir . '/guzzlehttp/psr7/src/CachingStream.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Psr7\\DroppingStream' => $vendorDir . '/guzzlehttp/psr7/src/DroppingStream.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Psr7\\FnStream' => $vendorDir . '/guzzlehttp/psr7/src/FnStream.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Psr7\\InflateStream' => $vendorDir . '/guzzlehttp/psr7/src/InflateStream.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Psr7\\LazyOpenStream' => $vendorDir . '/guzzlehttp/psr7/src/LazyOpenStream.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Psr7\\LimitStream' => $vendorDir . '/guzzlehttp/psr7/src/LimitStream.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Psr7\\MessageTrait' => $vendorDir . '/guzzlehttp/psr7/src/MessageTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Psr7\\MultipartStream' => $vendorDir . '/guzzlehttp/psr7/src/MultipartStream.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Psr7\\NoSeekStream' => $vendorDir . '/guzzlehttp/psr7/src/NoSeekStream.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Psr7\\PumpStream' => $vendorDir . '/guzzlehttp/psr7/src/PumpStream.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Psr7\\Request' => $vendorDir . '/guzzlehttp/psr7/src/Request.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Psr7\\Response' => $vendorDir . '/guzzlehttp/psr7/src/Response.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Psr7\\Rfc7230' => $vendorDir . '/guzzlehttp/psr7/src/Rfc7230.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Psr7\\ServerRequest' => $vendorDir . '/guzzlehttp/psr7/src/ServerRequest.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Psr7\\Stream' => $vendorDir . '/guzzlehttp/psr7/src/Stream.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Psr7\\StreamDecoratorTrait' => $vendorDir . '/guzzlehttp/psr7/src/StreamDecoratorTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Psr7\\StreamWrapper' => $vendorDir . '/guzzlehttp/psr7/src/StreamWrapper.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Psr7\\UploadedFile' => $vendorDir . '/guzzlehttp/psr7/src/UploadedFile.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Psr7\\Uri' => $vendorDir . '/guzzlehttp/psr7/src/Uri.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Psr7\\UriNormalizer' => $vendorDir . '/guzzlehttp/psr7/src/UriNormalizer.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Psr7\\UriResolver' => $vendorDir . '/guzzlehttp/psr7/src/UriResolver.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\RedirectMiddleware' => $vendorDir . '/guzzlehttp/guzzle/src/RedirectMiddleware.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\RequestOptions' => $vendorDir . '/guzzlehttp/guzzle/src/RequestOptions.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\RetryMiddleware' => $vendorDir . '/guzzlehttp/guzzle/src/RetryMiddleware.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\TransferStats' => $vendorDir . '/guzzlehttp/guzzle/src/TransferStats.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\UriTemplate' => $vendorDir . '/guzzlehttp/guzzle/src/UriTemplate.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\ErrorHandler' => $vendorDir . '/monolog/monolog/src/Monolog/ErrorHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Formatter\\ChromePHPFormatter' => $vendorDir . '/monolog/monolog/src/Monolog/Formatter/ChromePHPFormatter.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Formatter\\ElasticaFormatter' => $vendorDir . '/monolog/monolog/src/Monolog/Formatter/ElasticaFormatter.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Formatter\\FlowdockFormatter' => $vendorDir . '/monolog/monolog/src/Monolog/Formatter/FlowdockFormatter.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Formatter\\FluentdFormatter' => $vendorDir . '/monolog/monolog/src/Monolog/Formatter/FluentdFormatter.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Formatter\\FormatterInterface' => $vendorDir . '/monolog/monolog/src/Monolog/Formatter/FormatterInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Formatter\\GelfMessageFormatter' => $vendorDir . '/monolog/monolog/src/Monolog/Formatter/GelfMessageFormatter.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Formatter\\HtmlFormatter' => $vendorDir . '/monolog/monolog/src/Monolog/Formatter/HtmlFormatter.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Formatter\\JsonFormatter' => $vendorDir . '/monolog/monolog/src/Monolog/Formatter/JsonFormatter.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Formatter\\LineFormatter' => $vendorDir . '/monolog/monolog/src/Monolog/Formatter/LineFormatter.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Formatter\\LogglyFormatter' => $vendorDir . '/monolog/monolog/src/Monolog/Formatter/LogglyFormatter.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Formatter\\LogstashFormatter' => $vendorDir . '/monolog/monolog/src/Monolog/Formatter/LogstashFormatter.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Formatter\\MongoDBFormatter' => $vendorDir . '/monolog/monolog/src/Monolog/Formatter/MongoDBFormatter.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Formatter\\NormalizerFormatter' => $vendorDir . '/monolog/monolog/src/Monolog/Formatter/NormalizerFormatter.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Formatter\\ScalarFormatter' => $vendorDir . '/monolog/monolog/src/Monolog/Formatter/ScalarFormatter.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Formatter\\WildfireFormatter' => $vendorDir . '/monolog/monolog/src/Monolog/Formatter/WildfireFormatter.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\AbstractHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/AbstractHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\AbstractProcessingHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/AbstractProcessingHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\AbstractSyslogHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/AbstractSyslogHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\AmqpHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/AmqpHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\BrowserConsoleHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/BrowserConsoleHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\BufferHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/BufferHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\ChromePHPHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/ChromePHPHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\CouchDBHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/CouchDBHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\CubeHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/CubeHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\Curl\\Util' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/Curl/Util.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\DeduplicationHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/DeduplicationHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\DoctrineCouchDBHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/DoctrineCouchDBHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\DynamoDbHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/DynamoDbHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\ElasticSearchHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/ElasticSearchHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\ErrorLogHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/ErrorLogHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\FilterHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/FilterHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\FingersCrossedHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/FingersCrossedHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\FingersCrossed\\ActivationStrategyInterface' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/FingersCrossed/ActivationStrategyInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\FingersCrossed\\ChannelLevelActivationStrategy' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/FingersCrossed/ChannelLevelActivationStrategy.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\FingersCrossed\\ErrorLevelActivationStrategy' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/FingersCrossed/ErrorLevelActivationStrategy.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\FirePHPHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/FirePHPHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\FleepHookHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/FleepHookHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\FlowdockHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/FlowdockHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\GelfHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/GelfHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\GroupHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/GroupHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\HandlerInterface' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/HandlerInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\HandlerWrapper' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/HandlerWrapper.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\HipChatHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/HipChatHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\IFTTTHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/IFTTTHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\InsightOpsHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/InsightOpsHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\LogEntriesHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/LogEntriesHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\LogglyHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/LogglyHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\MailHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/MailHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\MandrillHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/MandrillHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\MissingExtensionException' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/MissingExtensionException.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\MongoDBHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/MongoDBHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\NativeMailerHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/NativeMailerHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\NewRelicHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/NewRelicHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\NullHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/NullHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\PHPConsoleHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/PHPConsoleHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\PsrHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/PsrHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\PushoverHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/PushoverHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\RavenHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/RavenHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\RedisHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/RedisHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\RollbarHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/RollbarHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\RotatingFileHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/RotatingFileHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\SamplingHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/SamplingHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\SlackHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/SlackHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\SlackWebhookHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/SlackWebhookHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\Slack\\SlackRecord' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/Slack/SlackRecord.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\SlackbotHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/SlackbotHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\SocketHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/SocketHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\StreamHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/StreamHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\SwiftMailerHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/SwiftMailerHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\SyslogHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/SyslogHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\SyslogUdpHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/SyslogUdpHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\SyslogUdp\\UdpSocket' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/SyslogUdp/UdpSocket.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\TestHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/TestHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\WhatFailureGroupHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/WhatFailureGroupHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\ZendMonitorHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/ZendMonitorHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Logger' => $vendorDir . '/monolog/monolog/src/Monolog/Logger.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Processor\\GitProcessor' => $vendorDir . '/monolog/monolog/src/Monolog/Processor/GitProcessor.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Processor\\IntrospectionProcessor' => $vendorDir . '/monolog/monolog/src/Monolog/Processor/IntrospectionProcessor.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Processor\\MemoryPeakUsageProcessor' => $vendorDir . '/monolog/monolog/src/Monolog/Processor/MemoryPeakUsageProcessor.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Processor\\MemoryProcessor' => $vendorDir . '/monolog/monolog/src/Monolog/Processor/MemoryProcessor.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Processor\\MemoryUsageProcessor' => $vendorDir . '/monolog/monolog/src/Monolog/Processor/MemoryUsageProcessor.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Processor\\MercurialProcessor' => $vendorDir . '/monolog/monolog/src/Monolog/Processor/MercurialProcessor.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Processor\\ProcessIdProcessor' => $vendorDir . '/monolog/monolog/src/Monolog/Processor/ProcessIdProcessor.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Processor\\ProcessorInterface' => $vendorDir . '/monolog/monolog/src/Monolog/Processor/ProcessorInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Processor\\PsrLogMessageProcessor' => $vendorDir . '/monolog/monolog/src/Monolog/Processor/PsrLogMessageProcessor.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Processor\\TagProcessor' => $vendorDir . '/monolog/monolog/src/Monolog/Processor/TagProcessor.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Processor\\UidProcessor' => $vendorDir . '/monolog/monolog/src/Monolog/Processor/UidProcessor.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Processor\\WebProcessor' => $vendorDir . '/monolog/monolog/src/Monolog/Processor/WebProcessor.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Registry' => $vendorDir . '/monolog/monolog/src/Monolog/Registry.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\ResettableInterface' => $vendorDir . '/monolog/monolog/src/Monolog/ResettableInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\SignalHandler' => $vendorDir . '/monolog/monolog/src/Monolog/SignalHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Utils' => $vendorDir . '/monolog/monolog/src/Monolog/Utils.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Psr\\Cache\\CacheException' => $vendorDir . '/psr/cache/src/CacheException.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Psr\\Cache\\CacheItemInterface' => $vendorDir . '/psr/cache/src/CacheItemInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Psr\\Cache\\CacheItemPoolInterface' => $vendorDir . '/psr/cache/src/CacheItemPoolInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Psr\\Cache\\InvalidArgumentException' => $vendorDir . '/psr/cache/src/InvalidArgumentException.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Psr\\Http\\Message\\MessageInterface' => $vendorDir . '/psr/http-message/src/MessageInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Psr\\Http\\Message\\RequestInterface' => $vendorDir . '/psr/http-message/src/RequestInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Psr\\Http\\Message\\ResponseInterface' => $vendorDir . '/psr/http-message/src/ResponseInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Psr\\Http\\Message\\ServerRequestInterface' => $vendorDir . '/psr/http-message/src/ServerRequestInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Psr\\Http\\Message\\StreamInterface' => $vendorDir . '/psr/http-message/src/StreamInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Psr\\Http\\Message\\UploadedFileInterface' => $vendorDir . '/psr/http-message/src/UploadedFileInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Psr\\Http\\Message\\UriInterface' => $vendorDir . '/psr/http-message/src/UriInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Psr\\Log\\AbstractLogger' => $vendorDir . '/psr/log/Psr/Log/AbstractLogger.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Psr\\Log\\InvalidArgumentException' => $vendorDir . '/psr/log/Psr/Log/InvalidArgumentException.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Psr\\Log\\LogLevel' => $vendorDir . '/psr/log/Psr/Log/LogLevel.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Psr\\Log\\LoggerAwareInterface' => $vendorDir . '/psr/log/Psr/Log/LoggerAwareInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Psr\\Log\\LoggerAwareTrait' => $vendorDir . '/psr/log/Psr/Log/LoggerAwareTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Psr\\Log\\LoggerInterface' => $vendorDir . '/psr/log/Psr/Log/LoggerInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Psr\\Log\\LoggerTrait' => $vendorDir . '/psr/log/Psr/Log/LoggerTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Psr\\Log\\NullLogger' => $vendorDir . '/psr/log/Psr/Log/NullLogger.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Psr\\Log\\Test\\DummyTest' => $vendorDir . '/psr/log/Psr/Log/Test/LoggerInterfaceTest.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Psr\\Log\\Test\\LoggerInterfaceTest' => $vendorDir . '/psr/log/Psr/Log/Test/LoggerInterfaceTest.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Psr\\Log\\Test\\TestLogger' => $vendorDir . '/psr/log/Psr/Log/Test/TestLogger.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Rize\\UriTemplate' => $vendorDir . '/rize/uri-template/src/Rize/UriTemplate.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Rize\\UriTemplate\\Node\\Abstraction' => $vendorDir . '/rize/uri-template/src/Rize/UriTemplate/Node/Abstraction.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Rize\\UriTemplate\\Node\\Expression' => $vendorDir . '/rize/uri-template/src/Rize/UriTemplate/Node/Expression.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Rize\\UriTemplate\\Node\\Literal' => $vendorDir . '/rize/uri-template/src/Rize/UriTemplate/Node/Literal.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Rize\\UriTemplate\\Node\\Variable' => $vendorDir . '/rize/uri-template/src/Rize/UriTemplate/Node/Variable.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Rize\\UriTemplate\\Operator\\Abstraction' => $vendorDir . '/rize/uri-template/src/Rize/UriTemplate/Operator/Abstraction.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Rize\\UriTemplate\\Operator\\Named' => $vendorDir . '/rize/uri-template/src/Rize/UriTemplate/Operator/Named.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Rize\\UriTemplate\\Operator\\UnNamed' => $vendorDir . '/rize/uri-template/src/Rize/UriTemplate/Operator/UnNamed.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Rize\\UriTemplate\\Parser' => $vendorDir . '/rize/uri-template/src/Rize/UriTemplate/Parser.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Rize\\UriTemplate\\UriTemplate' => $vendorDir . '/rize/uri-template/src/Rize/UriTemplate/UriTemplate.php');
|
3 |
// autoload_classmap.php @generated by Composer
|
4 |
$vendorDir = \dirname(\dirname(__FILE__));
|
5 |
$baseDir = \dirname($vendorDir);
|
6 |
+
return array('DeliciousBrains\\WP_Offload_Media\\Gcp\\Firebase\\JWT\\BeforeValidException' => $vendorDir . '/firebase/php-jwt/src/BeforeValidException.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Firebase\\JWT\\ExpiredException' => $vendorDir . '/firebase/php-jwt/src/ExpiredException.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Firebase\\JWT\\JWT' => $vendorDir . '/firebase/php-jwt/src/JWT.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Firebase\\JWT\\SignatureInvalidException' => $vendorDir . '/firebase/php-jwt/src/SignatureInvalidException.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Auth\\AccessToken' => $vendorDir . '/google/auth/src/AccessToken.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Auth\\ApplicationDefaultCredentials' => $vendorDir . '/google/auth/src/ApplicationDefaultCredentials.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Auth\\CacheTrait' => $vendorDir . '/google/auth/src/CacheTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Auth\\Cache\\InvalidArgumentException' => $vendorDir . '/google/auth/src/Cache/InvalidArgumentException.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Auth\\Cache\\Item' => $vendorDir . '/google/auth/src/Cache/Item.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Auth\\Cache\\MemoryCacheItemPool' => $vendorDir . '/google/auth/src/Cache/MemoryCacheItemPool.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Auth\\Cache\\SysVCacheItemPool' => $vendorDir . '/google/auth/src/Cache/SysVCacheItemPool.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Auth\\CredentialsLoader' => $vendorDir . '/google/auth/src/CredentialsLoader.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Auth\\Credentials\\AppIdentityCredentials' => $vendorDir . '/google/auth/src/Credentials/AppIdentityCredentials.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Auth\\Credentials\\GCECredentials' => $vendorDir . '/google/auth/src/Credentials/GCECredentials.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Auth\\Credentials\\IAMCredentials' => $vendorDir . '/google/auth/src/Credentials/IAMCredentials.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Auth\\Credentials\\InsecureCredentials' => $vendorDir . '/google/auth/src/Credentials/InsecureCredentials.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Auth\\Credentials\\ServiceAccountCredentials' => $vendorDir . '/google/auth/src/Credentials/ServiceAccountCredentials.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Auth\\Credentials\\ServiceAccountJwtAccessCredentials' => $vendorDir . '/google/auth/src/Credentials/ServiceAccountJwtAccessCredentials.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Auth\\Credentials\\UserRefreshCredentials' => $vendorDir . '/google/auth/src/Credentials/UserRefreshCredentials.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Auth\\FetchAuthTokenCache' => $vendorDir . '/google/auth/src/FetchAuthTokenCache.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Auth\\FetchAuthTokenInterface' => $vendorDir . '/google/auth/src/FetchAuthTokenInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Auth\\HttpHandler\\Guzzle5HttpHandler' => $vendorDir . '/google/auth/src/HttpHandler/Guzzle5HttpHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Auth\\HttpHandler\\Guzzle6HttpHandler' => $vendorDir . '/google/auth/src/HttpHandler/Guzzle6HttpHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Auth\\HttpHandler\\HttpClientCache' => $vendorDir . '/google/auth/src/HttpHandler/HttpClientCache.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Auth\\HttpHandler\\HttpHandlerFactory' => $vendorDir . '/google/auth/src/HttpHandler/HttpHandlerFactory.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Auth\\Iam' => $vendorDir . '/google/auth/src/Iam.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Auth\\Middleware\\AuthTokenMiddleware' => $vendorDir . '/google/auth/src/Middleware/AuthTokenMiddleware.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Auth\\Middleware\\ScopedAccessTokenMiddleware' => $vendorDir . '/google/auth/src/Middleware/ScopedAccessTokenMiddleware.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Auth\\Middleware\\SimpleMiddleware' => $vendorDir . '/google/auth/src/Middleware/SimpleMiddleware.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Auth\\OAuth2' => $vendorDir . '/google/auth/src/OAuth2.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Auth\\ServiceAccountSignerTrait' => $vendorDir . '/google/auth/src/ServiceAccountSignerTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Auth\\SignBlobInterface' => $vendorDir . '/google/auth/src/SignBlobInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Auth\\Subscriber\\AuthTokenSubscriber' => $vendorDir . '/google/auth/src/Subscriber/AuthTokenSubscriber.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Auth\\Subscriber\\ScopedAccessTokenSubscriber' => $vendorDir . '/google/auth/src/Subscriber/ScopedAccessTokenSubscriber.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Auth\\Subscriber\\SimpleSubscriber' => $vendorDir . '/google/auth/src/Subscriber/SimpleSubscriber.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\CRC32\\Builtin' => $vendorDir . '/google/crc32/src/Builtin.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\CRC32\\CRC32' => $vendorDir . '/google/crc32/src/CRC32.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\CRC32\\CRCInterface' => $vendorDir . '/google/crc32/src/CRCInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\CRC32\\CRCTrait' => $vendorDir . '/google/crc32/src/CRCTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\CRC32\\Google' => $vendorDir . '/google/crc32/src/Google.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\CRC32\\PHP' => $vendorDir . '/google/crc32/src/PHP.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\CRC32\\PHPSlicedBy4' => $vendorDir . '/google/crc32/src/PHPSlicedBy4.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\CRC32\\Table' => $vendorDir . '/google/crc32/src/Table.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\AnonymousCredentials' => $vendorDir . '/google/cloud-core/src/AnonymousCredentials.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\ArrayTrait' => $vendorDir . '/google/cloud-core/src/ArrayTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Batch\\BatchDaemon' => $vendorDir . '/google/cloud-core/src/Batch/BatchDaemon.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Batch\\BatchDaemonTrait' => $vendorDir . '/google/cloud-core/src/Batch/BatchDaemonTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Batch\\BatchJob' => $vendorDir . '/google/cloud-core/src/Batch/BatchJob.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Batch\\BatchRunner' => $vendorDir . '/google/cloud-core/src/Batch/BatchRunner.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Batch\\BatchTrait' => $vendorDir . '/google/cloud-core/src/Batch/BatchTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Batch\\ClosureSerializerInterface' => $vendorDir . '/google/cloud-core/src/Batch/ClosureSerializerInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Batch\\ConfigStorageInterface' => $vendorDir . '/google/cloud-core/src/Batch/ConfigStorageInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Batch\\HandleFailureTrait' => $vendorDir . '/google/cloud-core/src/Batch/HandleFailureTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Batch\\InMemoryConfigStorage' => $vendorDir . '/google/cloud-core/src/Batch/InMemoryConfigStorage.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Batch\\InterruptTrait' => $vendorDir . '/google/cloud-core/src/Batch/InterruptTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Batch\\JobConfig' => $vendorDir . '/google/cloud-core/src/Batch/JobConfig.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Batch\\JobInterface' => $vendorDir . '/google/cloud-core/src/Batch/JobInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Batch\\JobTrait' => $vendorDir . '/google/cloud-core/src/Batch/JobTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Batch\\OpisClosureSerializer' => $vendorDir . '/google/cloud-core/src/Batch/OpisClosureSerializer.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Batch\\ProcessItemInterface' => $vendorDir . '/google/cloud-core/src/Batch/ProcessItemInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Batch\\Retry' => $vendorDir . '/google/cloud-core/src/Batch/Retry.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Batch\\SerializableClientTrait' => $vendorDir . '/google/cloud-core/src/Batch/SerializableClientTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Batch\\SimpleJob' => $vendorDir . '/google/cloud-core/src/Batch/SimpleJob.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Batch\\SimpleJobTrait' => $vendorDir . '/google/cloud-core/src/Batch/SimpleJobTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Batch\\SysvConfigStorage' => $vendorDir . '/google/cloud-core/src/Batch/SysvConfigStorage.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Batch\\SysvProcessor' => $vendorDir . '/google/cloud-core/src/Batch/SysvProcessor.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Blob' => $vendorDir . '/google/cloud-core/src/Blob.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\CallTrait' => $vendorDir . '/google/cloud-core/src/CallTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\ClientTrait' => $vendorDir . '/google/cloud-core/src/ClientTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Compute\\Metadata' => $vendorDir . '/google/cloud-core/src/Compute/Metadata.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Compute\\Metadata\\Readers\\HttpHandlerReader' => $vendorDir . '/google/cloud-core/src/Compute/Metadata/Readers/HttpHandlerReader.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Compute\\Metadata\\Readers\\ReaderInterface' => $vendorDir . '/google/cloud-core/src/Compute/Metadata/Readers/ReaderInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Compute\\Metadata\\Readers\\StreamReader' => $vendorDir . '/google/cloud-core/src/Compute/Metadata/Readers/StreamReader.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\ConcurrencyControlTrait' => $vendorDir . '/google/cloud-core/src/ConcurrencyControlTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\DebugInfoTrait' => $vendorDir . '/google/cloud-core/src/DebugInfoTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Duration' => $vendorDir . '/google/cloud-core/src/Duration.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\EmulatorTrait' => $vendorDir . '/google/cloud-core/src/EmulatorTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Exception\\AbortedException' => $vendorDir . '/google/cloud-core/src/Exception/AbortedException.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Exception\\BadRequestException' => $vendorDir . '/google/cloud-core/src/Exception/BadRequestException.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Exception\\ConflictException' => $vendorDir . '/google/cloud-core/src/Exception/ConflictException.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Exception\\DeadlineExceededException' => $vendorDir . '/google/cloud-core/src/Exception/DeadlineExceededException.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Exception\\FailedPreconditionException' => $vendorDir . '/google/cloud-core/src/Exception/FailedPreconditionException.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Exception\\GoogleException' => $vendorDir . '/google/cloud-core/src/Exception/GoogleException.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Exception\\NotFoundException' => $vendorDir . '/google/cloud-core/src/Exception/NotFoundException.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Exception\\ServerException' => $vendorDir . '/google/cloud-core/src/Exception/ServerException.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Exception\\ServiceException' => $vendorDir . '/google/cloud-core/src/Exception/ServiceException.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\ExponentialBackoff' => $vendorDir . '/google/cloud-core/src/ExponentialBackoff.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\GeoPoint' => $vendorDir . '/google/cloud-core/src/GeoPoint.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\GrpcRequestWrapper' => $vendorDir . '/google/cloud-core/src/GrpcRequestWrapper.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\GrpcTrait' => $vendorDir . '/google/cloud-core/src/GrpcTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Iam\\Iam' => $vendorDir . '/google/cloud-core/src/Iam/Iam.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Iam\\IamConnectionInterface' => $vendorDir . '/google/cloud-core/src/Iam/IamConnectionInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Iam\\PolicyBuilder' => $vendorDir . '/google/cloud-core/src/Iam/PolicyBuilder.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Int64' => $vendorDir . '/google/cloud-core/src/Int64.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Iterator\\ItemIterator' => $vendorDir . '/google/cloud-core/src/Iterator/ItemIterator.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Iterator\\ItemIteratorTrait' => $vendorDir . '/google/cloud-core/src/Iterator/ItemIteratorTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Iterator\\PageIterator' => $vendorDir . '/google/cloud-core/src/Iterator/PageIterator.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Iterator\\PageIteratorTrait' => $vendorDir . '/google/cloud-core/src/Iterator/PageIteratorTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\JsonTrait' => $vendorDir . '/google/cloud-core/src/JsonTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Lock\\FlockLock' => $vendorDir . '/google/cloud-core/src/Lock/FlockLock.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Lock\\LockInterface' => $vendorDir . '/google/cloud-core/src/Lock/LockInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Lock\\LockTrait' => $vendorDir . '/google/cloud-core/src/Lock/LockTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Lock\\SemaphoreLock' => $vendorDir . '/google/cloud-core/src/Lock/SemaphoreLock.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Lock\\SymfonyLockAdapter' => $vendorDir . '/google/cloud-core/src/Lock/SymfonyLockAdapter.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Logger\\AppEngineFlexFormatter' => $vendorDir . '/google/cloud-core/src/Logger/AppEngineFlexFormatter.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Logger\\AppEngineFlexFormatterV2' => $vendorDir . '/google/cloud-core/src/Logger/AppEngineFlexFormatterV2.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Logger\\AppEngineFlexHandler' => $vendorDir . '/google/cloud-core/src/Logger/AppEngineFlexHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Logger\\AppEngineFlexHandlerFactory' => $vendorDir . '/google/cloud-core/src/Logger/AppEngineFlexHandlerFactory.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Logger\\AppEngineFlexHandlerV2' => $vendorDir . '/google/cloud-core/src/Logger/AppEngineFlexHandlerV2.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Logger\\FormatterTrait' => $vendorDir . '/google/cloud-core/src/Logger/FormatterTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\LongRunning\\LROTrait' => $vendorDir . '/google/cloud-core/src/LongRunning/LROTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\LongRunning\\LongRunningConnectionInterface' => $vendorDir . '/google/cloud-core/src/LongRunning/LongRunningConnectionInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\LongRunning\\LongRunningOperation' => $vendorDir . '/google/cloud-core/src/LongRunning/LongRunningOperation.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\LongRunning\\OperationResponseTrait' => $vendorDir . '/google/cloud-core/src/LongRunning/OperationResponseTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\PhpArray' => $vendorDir . '/google/cloud-core/src/PhpArray.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Report\\EmptyMetadataProvider' => $vendorDir . '/google/cloud-core/src/Report/EmptyMetadataProvider.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Report\\GAEFlexMetadataProvider' => $vendorDir . '/google/cloud-core/src/Report/GAEFlexMetadataProvider.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Report\\GAEMetadataProvider' => $vendorDir . '/google/cloud-core/src/Report/GAEMetadataProvider.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Report\\GAEStandardMetadataProvider' => $vendorDir . '/google/cloud-core/src/Report/GAEStandardMetadataProvider.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Report\\MetadataProviderInterface' => $vendorDir . '/google/cloud-core/src/Report/MetadataProviderInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Report\\MetadataProviderUtils' => $vendorDir . '/google/cloud-core/src/Report/MetadataProviderUtils.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Report\\SimpleMetadataProvider' => $vendorDir . '/google/cloud-core/src/Report/SimpleMetadataProvider.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\RequestBuilder' => $vendorDir . '/google/cloud-core/src/RequestBuilder.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\RequestWrapper' => $vendorDir . '/google/cloud-core/src/RequestWrapper.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\RequestWrapperTrait' => $vendorDir . '/google/cloud-core/src/RequestWrapperTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\RestTrait' => $vendorDir . '/google/cloud-core/src/RestTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Retry' => $vendorDir . '/google/cloud-core/src/Retry.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\RetryDeciderTrait' => $vendorDir . '/google/cloud-core/src/RetryDeciderTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\ServiceBuilder' => $vendorDir . '/google/cloud-core/src/ServiceBuilder.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\SysvTrait' => $vendorDir . '/google/cloud-core/src/SysvTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Testing\\ArrayHasSameValuesToken' => $vendorDir . '/google/cloud-core/src/Testing/ArrayHasSameValuesToken.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Testing\\CheckForClassTrait' => $vendorDir . '/google/cloud-core/src/Testing/CheckForClassTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Testing\\DatastoreOperationRefreshTrait' => $vendorDir . '/google/cloud-core/src/Testing/DatastoreOperationRefreshTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Testing\\DocBlockStripSpaces' => $vendorDir . '/google/cloud-core/src/Testing/DocBlockStripSpaces.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Testing\\FileListFilterIterator' => $vendorDir . '/google/cloud-core/src/Testing/FileListFilterIterator.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Testing\\GrpcTestTrait' => $vendorDir . '/google/cloud-core/src/Testing/GrpcTestTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Testing\\KeyPairGenerateTrait' => $vendorDir . '/google/cloud-core/src/Testing/KeyPairGenerateTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Testing\\Lock\\MockValues' => $vendorDir . '/google/cloud-core/src/Testing/Lock/MockValues.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Testing\\RegexFileFilter' => $vendorDir . '/google/cloud-core/src/Testing/RegexFileFilter.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Testing\\Snippet\\Container' => $vendorDir . '/google/cloud-core/src/Testing/Snippet/Container.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Testing\\Snippet\\Coverage\\Coverage' => $vendorDir . '/google/cloud-core/src/Testing/Snippet/Coverage/Coverage.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Testing\\Snippet\\Coverage\\ExcludeFilter' => $vendorDir . '/google/cloud-core/src/Testing/Snippet/Coverage/ExcludeFilter.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Testing\\Snippet\\Coverage\\ResultPrinter' => $vendorDir . '/google/cloud-core/src/Testing/Snippet/Coverage/ResultPrinter.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Testing\\Snippet\\Coverage\\Scanner' => $vendorDir . '/google/cloud-core/src/Testing/Snippet/Coverage/Scanner.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Testing\\Snippet\\Coverage\\ScannerInterface' => $vendorDir . '/google/cloud-core/src/Testing/Snippet/Coverage/ScannerInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Testing\\Snippet\\Fixtures' => $vendorDir . '/google/cloud-core/src/Testing/Snippet/Fixtures.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Testing\\Snippet\\Parser\\InvokeResult' => $vendorDir . '/google/cloud-core/src/Testing/Snippet/Parser/InvokeResult.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Testing\\Snippet\\Parser\\Parser' => $vendorDir . '/google/cloud-core/src/Testing/Snippet/Parser/Parser.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Testing\\Snippet\\Parser\\Snippet' => $vendorDir . '/google/cloud-core/src/Testing/Snippet/Parser/Snippet.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Testing\\Snippet\\SnippetTestCase' => $vendorDir . '/google/cloud-core/src/Testing/Snippet/SnippetTestCase.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Testing\\StubTrait' => $vendorDir . '/google/cloud-core/src/Testing/StubTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Testing\\System\\DeletionQueue' => $vendorDir . '/google/cloud-core/src/Testing/System/DeletionQueue.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Testing\\System\\KeyManager' => $vendorDir . '/google/cloud-core/src/Testing/System/KeyManager.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Testing\\System\\SystemTestCase' => $vendorDir . '/google/cloud-core/src/Testing/System/SystemTestCase.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Testing\\TestHelpers' => $vendorDir . '/google/cloud-core/src/Testing/TestHelpers.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\TimeTrait' => $vendorDir . '/google/cloud-core/src/TimeTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Timestamp' => $vendorDir . '/google/cloud-core/src/Timestamp.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Upload\\AbstractUploader' => $vendorDir . '/google/cloud-core/src/Upload/AbstractUploader.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Upload\\MultipartUploader' => $vendorDir . '/google/cloud-core/src/Upload/MultipartUploader.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Upload\\ResumableUploader' => $vendorDir . '/google/cloud-core/src/Upload/ResumableUploader.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Upload\\SignedUrlUploader' => $vendorDir . '/google/cloud-core/src/Upload/SignedUrlUploader.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Upload\\StreamableUploader' => $vendorDir . '/google/cloud-core/src/Upload/StreamableUploader.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\UriTrait' => $vendorDir . '/google/cloud-core/src/UriTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\ValidateTrait' => $vendorDir . '/google/cloud-core/src/ValidateTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\ValueMapperTrait' => $vendorDir . '/google/cloud-core/src/ValueMapperTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\WhitelistTrait' => $vendorDir . '/google/cloud-core/src/WhitelistTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Storage\\Acl' => $vendorDir . '/google/cloud-storage/src/Acl.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Storage\\Bucket' => $vendorDir . '/google/cloud-storage/src/Bucket.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Storage\\Connection\\ConnectionInterface' => $vendorDir . '/google/cloud-storage/src/Connection/ConnectionInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Storage\\Connection\\IamBucket' => $vendorDir . '/google/cloud-storage/src/Connection/IamBucket.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Storage\\Connection\\Rest' => $vendorDir . '/google/cloud-storage/src/Connection/Rest.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Storage\\CreatedHmacKey' => $vendorDir . '/google/cloud-storage/src/CreatedHmacKey.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Storage\\EncryptionTrait' => $vendorDir . '/google/cloud-storage/src/EncryptionTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Storage\\HmacKey' => $vendorDir . '/google/cloud-storage/src/HmacKey.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Storage\\Lifecycle' => $vendorDir . '/google/cloud-storage/src/Lifecycle.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Storage\\Notification' => $vendorDir . '/google/cloud-storage/src/Notification.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Storage\\ObjectIterator' => $vendorDir . '/google/cloud-storage/src/ObjectIterator.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Storage\\ObjectPageIterator' => $vendorDir . '/google/cloud-storage/src/ObjectPageIterator.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Storage\\ReadStream' => $vendorDir . '/google/cloud-storage/src/ReadStream.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Storage\\SigningHelper' => $vendorDir . '/google/cloud-storage/src/SigningHelper.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Storage\\StorageClient' => $vendorDir . '/google/cloud-storage/src/StorageClient.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Storage\\StorageObject' => $vendorDir . '/google/cloud-storage/src/StorageObject.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Storage\\StreamWrapper' => $vendorDir . '/google/cloud-storage/src/StreamWrapper.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Storage\\WriteStream' => $vendorDir . '/google/cloud-storage/src/WriteStream.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Client' => $vendorDir . '/guzzlehttp/guzzle/src/Client.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\ClientInterface' => $vendorDir . '/guzzlehttp/guzzle/src/ClientInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Cookie\\CookieJar' => $vendorDir . '/guzzlehttp/guzzle/src/Cookie/CookieJar.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Cookie\\CookieJarInterface' => $vendorDir . '/guzzlehttp/guzzle/src/Cookie/CookieJarInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Cookie\\FileCookieJar' => $vendorDir . '/guzzlehttp/guzzle/src/Cookie/FileCookieJar.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Cookie\\SessionCookieJar' => $vendorDir . '/guzzlehttp/guzzle/src/Cookie/SessionCookieJar.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Cookie\\SetCookie' => $vendorDir . '/guzzlehttp/guzzle/src/Cookie/SetCookie.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Exception\\BadResponseException' => $vendorDir . '/guzzlehttp/guzzle/src/Exception/BadResponseException.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Exception\\ClientException' => $vendorDir . '/guzzlehttp/guzzle/src/Exception/ClientException.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Exception\\ConnectException' => $vendorDir . '/guzzlehttp/guzzle/src/Exception/ConnectException.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Exception\\GuzzleException' => $vendorDir . '/guzzlehttp/guzzle/src/Exception/GuzzleException.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Exception\\InvalidArgumentException' => $vendorDir . '/guzzlehttp/guzzle/src/Exception/InvalidArgumentException.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Exception\\RequestException' => $vendorDir . '/guzzlehttp/guzzle/src/Exception/RequestException.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Exception\\SeekException' => $vendorDir . '/guzzlehttp/guzzle/src/Exception/SeekException.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Exception\\ServerException' => $vendorDir . '/guzzlehttp/guzzle/src/Exception/ServerException.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Exception\\TooManyRedirectsException' => $vendorDir . '/guzzlehttp/guzzle/src/Exception/TooManyRedirectsException.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Exception\\TransferException' => $vendorDir . '/guzzlehttp/guzzle/src/Exception/TransferException.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\HandlerStack' => $vendorDir . '/guzzlehttp/guzzle/src/HandlerStack.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Handler\\CurlFactory' => $vendorDir . '/guzzlehttp/guzzle/src/Handler/CurlFactory.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Handler\\CurlFactoryInterface' => $vendorDir . '/guzzlehttp/guzzle/src/Handler/CurlFactoryInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Handler\\CurlHandler' => $vendorDir . '/guzzlehttp/guzzle/src/Handler/CurlHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Handler\\CurlMultiHandler' => $vendorDir . '/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Handler\\EasyHandle' => $vendorDir . '/guzzlehttp/guzzle/src/Handler/EasyHandle.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Handler\\MockHandler' => $vendorDir . '/guzzlehttp/guzzle/src/Handler/MockHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Handler\\Proxy' => $vendorDir . '/guzzlehttp/guzzle/src/Handler/Proxy.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Handler\\StreamHandler' => $vendorDir . '/guzzlehttp/guzzle/src/Handler/StreamHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\MessageFormatter' => $vendorDir . '/guzzlehttp/guzzle/src/MessageFormatter.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Middleware' => $vendorDir . '/guzzlehttp/guzzle/src/Middleware.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Pool' => $vendorDir . '/guzzlehttp/guzzle/src/Pool.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\PrepareBodyMiddleware' => $vendorDir . '/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Promise\\AggregateException' => $vendorDir . '/guzzlehttp/promises/src/AggregateException.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Promise\\CancellationException' => $vendorDir . '/guzzlehttp/promises/src/CancellationException.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Promise\\Coroutine' => $vendorDir . '/guzzlehttp/promises/src/Coroutine.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Promise\\EachPromise' => $vendorDir . '/guzzlehttp/promises/src/EachPromise.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Promise\\FulfilledPromise' => $vendorDir . '/guzzlehttp/promises/src/FulfilledPromise.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Promise\\Promise' => $vendorDir . '/guzzlehttp/promises/src/Promise.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Promise\\PromiseInterface' => $vendorDir . '/guzzlehttp/promises/src/PromiseInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Promise\\PromisorInterface' => $vendorDir . '/guzzlehttp/promises/src/PromisorInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Promise\\RejectedPromise' => $vendorDir . '/guzzlehttp/promises/src/RejectedPromise.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Promise\\RejectionException' => $vendorDir . '/guzzlehttp/promises/src/RejectionException.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Promise\\TaskQueue' => $vendorDir . '/guzzlehttp/promises/src/TaskQueue.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Promise\\TaskQueueInterface' => $vendorDir . '/guzzlehttp/promises/src/TaskQueueInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Psr7\\AppendStream' => $vendorDir . '/guzzlehttp/psr7/src/AppendStream.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Psr7\\BufferStream' => $vendorDir . '/guzzlehttp/psr7/src/BufferStream.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Psr7\\CachingStream' => $vendorDir . '/guzzlehttp/psr7/src/CachingStream.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Psr7\\DroppingStream' => $vendorDir . '/guzzlehttp/psr7/src/DroppingStream.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Psr7\\FnStream' => $vendorDir . '/guzzlehttp/psr7/src/FnStream.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Psr7\\InflateStream' => $vendorDir . '/guzzlehttp/psr7/src/InflateStream.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Psr7\\LazyOpenStream' => $vendorDir . '/guzzlehttp/psr7/src/LazyOpenStream.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Psr7\\LimitStream' => $vendorDir . '/guzzlehttp/psr7/src/LimitStream.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Psr7\\MessageTrait' => $vendorDir . '/guzzlehttp/psr7/src/MessageTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Psr7\\MultipartStream' => $vendorDir . '/guzzlehttp/psr7/src/MultipartStream.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Psr7\\NoSeekStream' => $vendorDir . '/guzzlehttp/psr7/src/NoSeekStream.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Psr7\\PumpStream' => $vendorDir . '/guzzlehttp/psr7/src/PumpStream.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Psr7\\Request' => $vendorDir . '/guzzlehttp/psr7/src/Request.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Psr7\\Response' => $vendorDir . '/guzzlehttp/psr7/src/Response.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Psr7\\Rfc7230' => $vendorDir . '/guzzlehttp/psr7/src/Rfc7230.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Psr7\\ServerRequest' => $vendorDir . '/guzzlehttp/psr7/src/ServerRequest.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Psr7\\Stream' => $vendorDir . '/guzzlehttp/psr7/src/Stream.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Psr7\\StreamDecoratorTrait' => $vendorDir . '/guzzlehttp/psr7/src/StreamDecoratorTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Psr7\\StreamWrapper' => $vendorDir . '/guzzlehttp/psr7/src/StreamWrapper.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Psr7\\UploadedFile' => $vendorDir . '/guzzlehttp/psr7/src/UploadedFile.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Psr7\\Uri' => $vendorDir . '/guzzlehttp/psr7/src/Uri.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Psr7\\UriNormalizer' => $vendorDir . '/guzzlehttp/psr7/src/UriNormalizer.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Psr7\\UriResolver' => $vendorDir . '/guzzlehttp/psr7/src/UriResolver.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\RedirectMiddleware' => $vendorDir . '/guzzlehttp/guzzle/src/RedirectMiddleware.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\RequestOptions' => $vendorDir . '/guzzlehttp/guzzle/src/RequestOptions.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\RetryMiddleware' => $vendorDir . '/guzzlehttp/guzzle/src/RetryMiddleware.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\TransferStats' => $vendorDir . '/guzzlehttp/guzzle/src/TransferStats.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\UriTemplate' => $vendorDir . '/guzzlehttp/guzzle/src/UriTemplate.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\ErrorHandler' => $vendorDir . '/monolog/monolog/src/Monolog/ErrorHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Formatter\\ChromePHPFormatter' => $vendorDir . '/monolog/monolog/src/Monolog/Formatter/ChromePHPFormatter.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Formatter\\ElasticaFormatter' => $vendorDir . '/monolog/monolog/src/Monolog/Formatter/ElasticaFormatter.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Formatter\\FlowdockFormatter' => $vendorDir . '/monolog/monolog/src/Monolog/Formatter/FlowdockFormatter.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Formatter\\FluentdFormatter' => $vendorDir . '/monolog/monolog/src/Monolog/Formatter/FluentdFormatter.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Formatter\\FormatterInterface' => $vendorDir . '/monolog/monolog/src/Monolog/Formatter/FormatterInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Formatter\\GelfMessageFormatter' => $vendorDir . '/monolog/monolog/src/Monolog/Formatter/GelfMessageFormatter.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Formatter\\HtmlFormatter' => $vendorDir . '/monolog/monolog/src/Monolog/Formatter/HtmlFormatter.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Formatter\\JsonFormatter' => $vendorDir . '/monolog/monolog/src/Monolog/Formatter/JsonFormatter.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Formatter\\LineFormatter' => $vendorDir . '/monolog/monolog/src/Monolog/Formatter/LineFormatter.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Formatter\\LogglyFormatter' => $vendorDir . '/monolog/monolog/src/Monolog/Formatter/LogglyFormatter.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Formatter\\LogstashFormatter' => $vendorDir . '/monolog/monolog/src/Monolog/Formatter/LogstashFormatter.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Formatter\\MongoDBFormatter' => $vendorDir . '/monolog/monolog/src/Monolog/Formatter/MongoDBFormatter.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Formatter\\NormalizerFormatter' => $vendorDir . '/monolog/monolog/src/Monolog/Formatter/NormalizerFormatter.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Formatter\\ScalarFormatter' => $vendorDir . '/monolog/monolog/src/Monolog/Formatter/ScalarFormatter.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Formatter\\WildfireFormatter' => $vendorDir . '/monolog/monolog/src/Monolog/Formatter/WildfireFormatter.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\AbstractHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/AbstractHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\AbstractProcessingHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/AbstractProcessingHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\AbstractSyslogHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/AbstractSyslogHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\AmqpHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/AmqpHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\BrowserConsoleHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/BrowserConsoleHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\BufferHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/BufferHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\ChromePHPHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/ChromePHPHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\CouchDBHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/CouchDBHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\CubeHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/CubeHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\Curl\\Util' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/Curl/Util.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\DeduplicationHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/DeduplicationHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\DoctrineCouchDBHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/DoctrineCouchDBHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\DynamoDbHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/DynamoDbHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\ElasticSearchHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/ElasticSearchHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\ErrorLogHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/ErrorLogHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\FilterHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/FilterHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\FingersCrossedHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/FingersCrossedHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\FingersCrossed\\ActivationStrategyInterface' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/FingersCrossed/ActivationStrategyInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\FingersCrossed\\ChannelLevelActivationStrategy' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/FingersCrossed/ChannelLevelActivationStrategy.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\FingersCrossed\\ErrorLevelActivationStrategy' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/FingersCrossed/ErrorLevelActivationStrategy.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\FirePHPHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/FirePHPHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\FleepHookHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/FleepHookHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\FlowdockHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/FlowdockHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\FormattableHandlerInterface' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/FormattableHandlerInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\FormattableHandlerTrait' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/FormattableHandlerTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\GelfHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/GelfHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\GroupHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/GroupHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\HandlerInterface' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/HandlerInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\HandlerWrapper' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/HandlerWrapper.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\HipChatHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/HipChatHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\IFTTTHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/IFTTTHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\InsightOpsHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/InsightOpsHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\LogEntriesHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/LogEntriesHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\LogglyHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/LogglyHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\MailHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/MailHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\MandrillHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/MandrillHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\MissingExtensionException' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/MissingExtensionException.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\MongoDBHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/MongoDBHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\NativeMailerHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/NativeMailerHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\NewRelicHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/NewRelicHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\NullHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/NullHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\PHPConsoleHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/PHPConsoleHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\ProcessableHandlerInterface' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/ProcessableHandlerInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\ProcessableHandlerTrait' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/ProcessableHandlerTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\PsrHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/PsrHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\PushoverHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/PushoverHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\RavenHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/RavenHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\RedisHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/RedisHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\RollbarHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/RollbarHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\RotatingFileHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/RotatingFileHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\SamplingHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/SamplingHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\SlackHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/SlackHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\SlackWebhookHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/SlackWebhookHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\Slack\\SlackRecord' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/Slack/SlackRecord.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\SlackbotHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/SlackbotHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\SocketHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/SocketHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\StreamHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/StreamHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\SwiftMailerHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/SwiftMailerHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\SyslogHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/SyslogHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\SyslogUdpHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/SyslogUdpHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\SyslogUdp\\UdpSocket' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/SyslogUdp/UdpSocket.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\TestHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/TestHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\WhatFailureGroupHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/WhatFailureGroupHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\ZendMonitorHandler' => $vendorDir . '/monolog/monolog/src/Monolog/Handler/ZendMonitorHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Logger' => $vendorDir . '/monolog/monolog/src/Monolog/Logger.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Processor\\GitProcessor' => $vendorDir . '/monolog/monolog/src/Monolog/Processor/GitProcessor.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Processor\\IntrospectionProcessor' => $vendorDir . '/monolog/monolog/src/Monolog/Processor/IntrospectionProcessor.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Processor\\MemoryPeakUsageProcessor' => $vendorDir . '/monolog/monolog/src/Monolog/Processor/MemoryPeakUsageProcessor.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Processor\\MemoryProcessor' => $vendorDir . '/monolog/monolog/src/Monolog/Processor/MemoryProcessor.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Processor\\MemoryUsageProcessor' => $vendorDir . '/monolog/monolog/src/Monolog/Processor/MemoryUsageProcessor.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Processor\\MercurialProcessor' => $vendorDir . '/monolog/monolog/src/Monolog/Processor/MercurialProcessor.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Processor\\ProcessIdProcessor' => $vendorDir . '/monolog/monolog/src/Monolog/Processor/ProcessIdProcessor.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Processor\\ProcessorInterface' => $vendorDir . '/monolog/monolog/src/Monolog/Processor/ProcessorInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Processor\\PsrLogMessageProcessor' => $vendorDir . '/monolog/monolog/src/Monolog/Processor/PsrLogMessageProcessor.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Processor\\TagProcessor' => $vendorDir . '/monolog/monolog/src/Monolog/Processor/TagProcessor.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Processor\\UidProcessor' => $vendorDir . '/monolog/monolog/src/Monolog/Processor/UidProcessor.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Processor\\WebProcessor' => $vendorDir . '/monolog/monolog/src/Monolog/Processor/WebProcessor.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Registry' => $vendorDir . '/monolog/monolog/src/Monolog/Registry.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\ResettableInterface' => $vendorDir . '/monolog/monolog/src/Monolog/ResettableInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\SignalHandler' => $vendorDir . '/monolog/monolog/src/Monolog/SignalHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Utils' => $vendorDir . '/monolog/monolog/src/Monolog/Utils.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Psr\\Cache\\CacheException' => $vendorDir . '/psr/cache/src/CacheException.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Psr\\Cache\\CacheItemInterface' => $vendorDir . '/psr/cache/src/CacheItemInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Psr\\Cache\\CacheItemPoolInterface' => $vendorDir . '/psr/cache/src/CacheItemPoolInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Psr\\Cache\\InvalidArgumentException' => $vendorDir . '/psr/cache/src/InvalidArgumentException.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Psr\\Http\\Message\\MessageInterface' => $vendorDir . '/psr/http-message/src/MessageInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Psr\\Http\\Message\\RequestInterface' => $vendorDir . '/psr/http-message/src/RequestInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Psr\\Http\\Message\\ResponseInterface' => $vendorDir . '/psr/http-message/src/ResponseInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Psr\\Http\\Message\\ServerRequestInterface' => $vendorDir . '/psr/http-message/src/ServerRequestInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Psr\\Http\\Message\\StreamInterface' => $vendorDir . '/psr/http-message/src/StreamInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Psr\\Http\\Message\\UploadedFileInterface' => $vendorDir . '/psr/http-message/src/UploadedFileInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Psr\\Http\\Message\\UriInterface' => $vendorDir . '/psr/http-message/src/UriInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Psr\\Log\\AbstractLogger' => $vendorDir . '/psr/log/Psr/Log/AbstractLogger.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Psr\\Log\\InvalidArgumentException' => $vendorDir . '/psr/log/Psr/Log/InvalidArgumentException.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Psr\\Log\\LogLevel' => $vendorDir . '/psr/log/Psr/Log/LogLevel.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Psr\\Log\\LoggerAwareInterface' => $vendorDir . '/psr/log/Psr/Log/LoggerAwareInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Psr\\Log\\LoggerAwareTrait' => $vendorDir . '/psr/log/Psr/Log/LoggerAwareTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Psr\\Log\\LoggerInterface' => $vendorDir . '/psr/log/Psr/Log/LoggerInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Psr\\Log\\LoggerTrait' => $vendorDir . '/psr/log/Psr/Log/LoggerTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Psr\\Log\\NullLogger' => $vendorDir . '/psr/log/Psr/Log/NullLogger.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Psr\\Log\\Test\\DummyTest' => $vendorDir . '/psr/log/Psr/Log/Test/LoggerInterfaceTest.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Psr\\Log\\Test\\LoggerInterfaceTest' => $vendorDir . '/psr/log/Psr/Log/Test/LoggerInterfaceTest.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Psr\\Log\\Test\\TestLogger' => $vendorDir . '/psr/log/Psr/Log/Test/TestLogger.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Rize\\UriTemplate' => $vendorDir . '/rize/uri-template/src/Rize/UriTemplate.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Rize\\UriTemplate\\Node\\Abstraction' => $vendorDir . '/rize/uri-template/src/Rize/UriTemplate/Node/Abstraction.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Rize\\UriTemplate\\Node\\Expression' => $vendorDir . '/rize/uri-template/src/Rize/UriTemplate/Node/Expression.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Rize\\UriTemplate\\Node\\Literal' => $vendorDir . '/rize/uri-template/src/Rize/UriTemplate/Node/Literal.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Rize\\UriTemplate\\Node\\Variable' => $vendorDir . '/rize/uri-template/src/Rize/UriTemplate/Node/Variable.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Rize\\UriTemplate\\Operator\\Abstraction' => $vendorDir . '/rize/uri-template/src/Rize/UriTemplate/Operator/Abstraction.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Rize\\UriTemplate\\Operator\\Named' => $vendorDir . '/rize/uri-template/src/Rize/UriTemplate/Operator/Named.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Rize\\UriTemplate\\Operator\\UnNamed' => $vendorDir . '/rize/uri-template/src/Rize/UriTemplate/Operator/UnNamed.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Rize\\UriTemplate\\Parser' => $vendorDir . '/rize/uri-template/src/Rize/UriTemplate/Parser.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Rize\\UriTemplate\\UriTemplate' => $vendorDir . '/rize/uri-template/src/Rize/UriTemplate/UriTemplate.php');
|
@@ -3,4 +3,4 @@
|
|
3 |
// autoload_files.php @generated by Composer
|
4 |
$vendorDir = \dirname(\dirname(__FILE__));
|
5 |
$baseDir = \dirname($vendorDir);
|
6 |
-
return array('
|
3 |
// autoload_files.php @generated by Composer
|
4 |
$vendorDir = \dirname(\dirname(__FILE__));
|
5 |
$baseDir = \dirname($vendorDir);
|
6 |
+
return array('dbi_as3cf_gcp_7b11c4dc42b3b3023073cb14e519683c' => $vendorDir . '/ralouphie/getallheaders/src/getallheaders.php', 'dbi_as3cf_gcp_c964ee0ededf28c96ebd9db5099ef910' => $vendorDir . '/guzzlehttp/promises/src/functions_include.php', 'dbi_as3cf_gcp_a0edc8309cc5e1d60e3047b5df6b7052' => $vendorDir . '/guzzlehttp/psr7/src/functions_include.php', 'dbi_as3cf_gcp_37a3dc5111fe8f707ab4c132ef1dbc62' => $vendorDir . '/guzzlehttp/guzzle/src/functions_include.php');
|
@@ -3,4 +3,4 @@
|
|
3 |
// autoload_psr4.php @generated by Composer
|
4 |
$vendorDir = \dirname(\dirname(__FILE__));
|
5 |
$baseDir = \dirname($vendorDir);
|
6 |
-
return array('DeliciousBrains\\WP_Offload_Media\\Gcp\\Psr\\Log\\' => array($vendorDir . '/psr/log/Psr/Log'), 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Psr\\Http\\Message\\' => array($vendorDir . '/psr/http-message/src'), 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Psr\\Cache\\' => array($vendorDir . '/psr/cache/src'), 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\' => array($vendorDir . '/monolog/monolog/src/Monolog'), 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Psr7\\' => array($vendorDir . '/guzzlehttp/psr7/src'), 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Promise\\' => array($vendorDir . '/guzzlehttp/promises/src'), 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\' => array($vendorDir . '/guzzlehttp/guzzle/src'), 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Storage\\' => array($vendorDir . '/google/cloud-storage/src'), 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\' => array($vendorDir . '/google/cloud-core/src'), 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Auth\\' => array($vendorDir . '/google/auth/src'), 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Firebase\\JWT\\' => array($vendorDir . '/firebase/php-jwt/src'));
|
3 |
// autoload_psr4.php @generated by Composer
|
4 |
$vendorDir = \dirname(\dirname(__FILE__));
|
5 |
$baseDir = \dirname($vendorDir);
|
6 |
+
return array('DeliciousBrains\\WP_Offload_Media\\Gcp\\Psr\\Log\\' => array($vendorDir . '/psr/log/Psr/Log'), 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Psr\\Http\\Message\\' => array($vendorDir . '/psr/http-message/src'), 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Psr\\Cache\\' => array($vendorDir . '/psr/cache/src'), 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\' => array($vendorDir . '/monolog/monolog/src/Monolog'), 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Psr7\\' => array($vendorDir . '/guzzlehttp/psr7/src'), 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Promise\\' => array($vendorDir . '/guzzlehttp/promises/src'), 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\' => array($vendorDir . '/guzzlehttp/guzzle/src'), 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Storage\\' => array($vendorDir . '/google/cloud-storage/src'), 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\' => array($vendorDir . '/google/cloud-core/src'), 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\CRC32\\' => array($vendorDir . '/google/crc32/src'), 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Auth\\' => array($vendorDir . '/google/auth/src'), 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Firebase\\JWT\\' => array($vendorDir . '/firebase/php-jwt/src'));
|
@@ -1,7 +1,7 @@
|
|
1 |
<?php
|
2 |
|
3 |
// autoload_real.php @generated by Composer
|
4 |
-
class
|
5 |
{
|
6 |
private static $loader;
|
7 |
public static function loadClassLoader($class)
|
@@ -15,13 +15,13 @@ class ComposerAutoloaderInit9fd2c411275a48d2ebf11f5a1bd6ca20
|
|
15 |
if (\null !== self::$loader) {
|
16 |
return self::$loader;
|
17 |
}
|
18 |
-
\spl_autoload_register(array('
|
19 |
self::$loader = $loader = new \DeliciousBrains\WP_Offload_Media\Gcp\Composer\Autoload\ClassLoader();
|
20 |
-
\spl_autoload_unregister(array('
|
21 |
$useStaticLoader = \PHP_VERSION_ID >= 50600 && !\defined('HHVM_VERSION') && (!\function_exists('zend_loader_file_encoded') || !\zend_loader_file_encoded());
|
22 |
if ($useStaticLoader) {
|
23 |
require_once __DIR__ . '/autoload_static.php';
|
24 |
-
\call_user_func(\DeliciousBrains\WP_Offload_Media\Gcp\Composer\Autoload\
|
25 |
} else {
|
26 |
$classMap = (require __DIR__ . '/autoload_classmap.php');
|
27 |
if ($classMap) {
|
@@ -31,17 +31,17 @@ class ComposerAutoloaderInit9fd2c411275a48d2ebf11f5a1bd6ca20
|
|
31 |
$loader->setClassMapAuthoritative(\true);
|
32 |
$loader->register(\true);
|
33 |
if ($useStaticLoader) {
|
34 |
-
$includeFiles =DeliciousBrains\WP_Offload_Media\Gcp\Composer\Autoload\
|
35 |
} else {
|
36 |
$includeFiles = (require __DIR__ . '/autoload_files.php');
|
37 |
}
|
38 |
foreach ($includeFiles as $fileIdentifier => $file) {
|
39 |
-
\
|
40 |
}
|
41 |
return $loader;
|
42 |
}
|
43 |
}
|
44 |
-
function
|
45 |
{
|
46 |
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
|
47 |
require $file;
|
1 |
<?php
|
2 |
|
3 |
// autoload_real.php @generated by Composer
|
4 |
+
class ComposerAutoloaderInitad2bbf672104326f33ebff61e2e8e9b8
|
5 |
{
|
6 |
private static $loader;
|
7 |
public static function loadClassLoader($class)
|
15 |
if (\null !== self::$loader) {
|
16 |
return self::$loader;
|
17 |
}
|
18 |
+
\spl_autoload_register(array('ComposerAutoloaderInitad2bbf672104326f33ebff61e2e8e9b8', 'loadClassLoader'), \true, \true);
|
19 |
self::$loader = $loader = new \DeliciousBrains\WP_Offload_Media\Gcp\Composer\Autoload\ClassLoader();
|
20 |
+
\spl_autoload_unregister(array('ComposerAutoloaderInitad2bbf672104326f33ebff61e2e8e9b8', 'loadClassLoader'));
|
21 |
$useStaticLoader = \PHP_VERSION_ID >= 50600 && !\defined('HHVM_VERSION') && (!\function_exists('zend_loader_file_encoded') || !\zend_loader_file_encoded());
|
22 |
if ($useStaticLoader) {
|
23 |
require_once __DIR__ . '/autoload_static.php';
|
24 |
+
\call_user_func(\DeliciousBrains\WP_Offload_Media\Gcp\Composer\Autoload\ComposerStaticInitad2bbf672104326f33ebff61e2e8e9b8::getInitializer($loader));
|
25 |
} else {
|
26 |
$classMap = (require __DIR__ . '/autoload_classmap.php');
|
27 |
if ($classMap) {
|
31 |
$loader->setClassMapAuthoritative(\true);
|
32 |
$loader->register(\true);
|
33 |
if ($useStaticLoader) {
|
34 |
+
$includeFiles =DeliciousBrains\WP_Offload_Media\Gcp\Composer\Autoload\ComposerStaticInitad2bbf672104326f33ebff61e2e8e9b8::$files;
|
35 |
} else {
|
36 |
$includeFiles = (require __DIR__ . '/autoload_files.php');
|
37 |
}
|
38 |
foreach ($includeFiles as $fileIdentifier => $file) {
|
39 |
+
\composerRequiread2bbf672104326f33ebff61e2e8e9b8($fileIdentifier, $file);
|
40 |
}
|
41 |
return $loader;
|
42 |
}
|
43 |
}
|
44 |
+
function composerRequiread2bbf672104326f33ebff61e2e8e9b8($fileIdentifier, $file)
|
45 |
{
|
46 |
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
|
47 |
require $file;
|
@@ -3,20 +3,20 @@
|
|
3 |
// autoload_static.php @generated by Composer
|
4 |
namespace DeliciousBrains\WP_Offload_Media\Gcp\Composer\Autoload;
|
5 |
|
6 |
-
class
|
7 |
{
|
8 |
-
public static $files = array('
|
9 |
-
public static $prefixLengthsPsr4 = array('P' => array('DeliciousBrains\\WP_Offload_Media\\Gcp\\Psr\\Log\\' => 8, 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Psr\\Http\\Message\\' => 17, 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Psr\\Cache\\' => 10), 'M' => array('DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\' => 8), 'G' => array('DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Psr7\\' => 16, 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Promise\\' => 19, 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\' => 11, 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Storage\\' => 21, 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\' => 18, 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Auth\\' => 12), 'F' => array('DeliciousBrains\\WP_Offload_Media\\Gcp\\Firebase\\JWT\\' => 13));
|
10 |
-
public static $prefixDirsPsr4 = array('DeliciousBrains\\WP_Offload_Media\\Gcp\\Psr\\Log\\' => array(0 => __DIR__ . '/..' . '/psr/log/Psr/Log'), 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Psr\\Http\\Message\\' => array(0 => __DIR__ . '/..' . '/psr/http-message/src'), 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Psr\\Cache\\' => array(0 => __DIR__ . '/..' . '/psr/cache/src'), 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\' => array(0 => __DIR__ . '/..' . '/monolog/monolog/src/Monolog'), 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Psr7\\' => array(0 => __DIR__ . '/..' . '/guzzlehttp/psr7/src'), 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Promise\\' => array(0 => __DIR__ . '/..' . '/guzzlehttp/promises/src'), 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\' => array(0 => __DIR__ . '/..' . '/guzzlehttp/guzzle/src'), 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Storage\\' => array(0 => __DIR__ . '/..' . '/google/cloud-storage/src'), 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\' => array(0 => __DIR__ . '/..' . '/google/cloud-core/src'), 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Auth\\' => array(0 => __DIR__ . '/..' . '/google/auth/src'), 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Firebase\\JWT\\' => array(0 => __DIR__ . '/..' . '/firebase/php-jwt/src'));
|
11 |
public static $prefixesPsr0 = array('R' => array('DeliciousBrains\\WP_Offload_Media\\Gcp\\Rize\\UriTemplate' => array(0 => __DIR__ . '/..' . '/rize/uri-template/src')));
|
12 |
-
public static $classMap = array('DeliciousBrains\\WP_Offload_Media\\Gcp\\Firebase\\JWT\\BeforeValidException' => __DIR__ . '/..' . '/firebase/php-jwt/src/BeforeValidException.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Firebase\\JWT\\ExpiredException' => __DIR__ . '/..' . '/firebase/php-jwt/src/ExpiredException.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Firebase\\JWT\\JWT' => __DIR__ . '/..' . '/firebase/php-jwt/src/JWT.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Firebase\\JWT\\SignatureInvalidException' => __DIR__ . '/..' . '/firebase/php-jwt/src/SignatureInvalidException.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Auth\\ApplicationDefaultCredentials' => __DIR__ . '/..' . '/google/auth/src/ApplicationDefaultCredentials.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Auth\\CacheTrait' => __DIR__ . '/..' . '/google/auth/src/CacheTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Auth\\Cache\\InvalidArgumentException' => __DIR__ . '/..' . '/google/auth/src/Cache/InvalidArgumentException.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Auth\\Cache\\Item' => __DIR__ . '/..' . '/google/auth/src/Cache/Item.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Auth\\Cache\\MemoryCacheItemPool' => __DIR__ . '/..' . '/google/auth/src/Cache/MemoryCacheItemPool.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Auth\\Cache\\SysVCacheItemPool' => __DIR__ . '/..' . '/google/auth/src/Cache/SysVCacheItemPool.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Auth\\CredentialsLoader' => __DIR__ . '/..' . '/google/auth/src/CredentialsLoader.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Auth\\Credentials\\AppIdentityCredentials' => __DIR__ . '/..' . '/google/auth/src/Credentials/AppIdentityCredentials.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Auth\\Credentials\\GCECredentials' => __DIR__ . '/..' . '/google/auth/src/Credentials/GCECredentials.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Auth\\Credentials\\IAMCredentials' => __DIR__ . '/..' . '/google/auth/src/Credentials/IAMCredentials.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Auth\\Credentials\\InsecureCredentials' => __DIR__ . '/..' . '/google/auth/src/Credentials/InsecureCredentials.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Auth\\Credentials\\ServiceAccountCredentials' => __DIR__ . '/..' . '/google/auth/src/Credentials/ServiceAccountCredentials.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Auth\\Credentials\\ServiceAccountJwtAccessCredentials' => __DIR__ . '/..' . '/google/auth/src/Credentials/ServiceAccountJwtAccessCredentials.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Auth\\Credentials\\UserRefreshCredentials' => __DIR__ . '/..' . '/google/auth/src/Credentials/UserRefreshCredentials.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Auth\\FetchAuthTokenCache' => __DIR__ . '/..' . '/google/auth/src/FetchAuthTokenCache.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Auth\\FetchAuthTokenInterface' => __DIR__ . '/..' . '/google/auth/src/FetchAuthTokenInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Auth\\HttpHandler\\Guzzle5HttpHandler' => __DIR__ . '/..' . '/google/auth/src/HttpHandler/Guzzle5HttpHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Auth\\HttpHandler\\Guzzle6HttpHandler' => __DIR__ . '/..' . '/google/auth/src/HttpHandler/Guzzle6HttpHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Auth\\HttpHandler\\HttpHandlerFactory' => __DIR__ . '/..' . '/google/auth/src/HttpHandler/HttpHandlerFactory.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Auth\\Middleware\\AuthTokenMiddleware' => __DIR__ . '/..' . '/google/auth/src/Middleware/AuthTokenMiddleware.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Auth\\Middleware\\ScopedAccessTokenMiddleware' => __DIR__ . '/..' . '/google/auth/src/Middleware/ScopedAccessTokenMiddleware.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Auth\\Middleware\\SimpleMiddleware' => __DIR__ . '/..' . '/google/auth/src/Middleware/SimpleMiddleware.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Auth\\OAuth2' => __DIR__ . '/..' . '/google/auth/src/OAuth2.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Auth\\Subscriber\\AuthTokenSubscriber' => __DIR__ . '/..' . '/google/auth/src/Subscriber/AuthTokenSubscriber.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Auth\\Subscriber\\ScopedAccessTokenSubscriber' => __DIR__ . '/..' . '/google/auth/src/Subscriber/ScopedAccessTokenSubscriber.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Auth\\Subscriber\\SimpleSubscriber' => __DIR__ . '/..' . '/google/auth/src/Subscriber/SimpleSubscriber.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\AnonymousCredentials' => __DIR__ . '/..' . '/google/cloud-core/src/AnonymousCredentials.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\ArrayTrait' => __DIR__ . '/..' . '/google/cloud-core/src/ArrayTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Batch\\BatchDaemon' => __DIR__ . '/..' . '/google/cloud-core/src/Batch/BatchDaemon.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Batch\\BatchDaemonTrait' => __DIR__ . '/..' . '/google/cloud-core/src/Batch/BatchDaemonTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Batch\\BatchJob' => __DIR__ . '/..' . '/google/cloud-core/src/Batch/BatchJob.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Batch\\BatchRunner' => __DIR__ . '/..' . '/google/cloud-core/src/Batch/BatchRunner.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Batch\\BatchTrait' => __DIR__ . '/..' . '/google/cloud-core/src/Batch/BatchTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Batch\\ClosureSerializerInterface' => __DIR__ . '/..' . '/google/cloud-core/src/Batch/ClosureSerializerInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Batch\\ConfigStorageInterface' => __DIR__ . '/..' . '/google/cloud-core/src/Batch/ConfigStorageInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Batch\\HandleFailureTrait' => __DIR__ . '/..' . '/google/cloud-core/src/Batch/HandleFailureTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Batch\\InMemoryConfigStorage' => __DIR__ . '/..' . '/google/cloud-core/src/Batch/InMemoryConfigStorage.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Batch\\InterruptTrait' => __DIR__ . '/..' . '/google/cloud-core/src/Batch/InterruptTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Batch\\JobConfig' => __DIR__ . '/..' . '/google/cloud-core/src/Batch/JobConfig.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Batch\\JobInterface' => __DIR__ . '/..' . '/google/cloud-core/src/Batch/JobInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Batch\\JobTrait' => __DIR__ . '/..' . '/google/cloud-core/src/Batch/JobTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Batch\\OpisClosureSerializer' => __DIR__ . '/..' . '/google/cloud-core/src/Batch/OpisClosureSerializer.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Batch\\ProcessItemInterface' => __DIR__ . '/..' . '/google/cloud-core/src/Batch/ProcessItemInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Batch\\Retry' => __DIR__ . '/..' . '/google/cloud-core/src/Batch/Retry.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Batch\\SerializableClientTrait' => __DIR__ . '/..' . '/google/cloud-core/src/Batch/SerializableClientTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Batch\\SimpleJob' => __DIR__ . '/..' . '/google/cloud-core/src/Batch/SimpleJob.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Batch\\SimpleJobTrait' => __DIR__ . '/..' . '/google/cloud-core/src/Batch/SimpleJobTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Batch\\SysvConfigStorage' => __DIR__ . '/..' . '/google/cloud-core/src/Batch/SysvConfigStorage.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Batch\\SysvProcessor' => __DIR__ . '/..' . '/google/cloud-core/src/Batch/SysvProcessor.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Blob' => __DIR__ . '/..' . '/google/cloud-core/src/Blob.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\CallTrait' => __DIR__ . '/..' . '/google/cloud-core/src/CallTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\ClientTrait' => __DIR__ . '/..' . '/google/cloud-core/src/ClientTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Compute\\Metadata' => __DIR__ . '/..' . '/google/cloud-core/src/Compute/Metadata.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Compute\\Metadata\\Readers\\ReaderInterface' => __DIR__ . '/..' . '/google/cloud-core/src/Compute/Metadata/Readers/ReaderInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Compute\\Metadata\\Readers\\StreamReader' => __DIR__ . '/..' . '/google/cloud-core/src/Compute/Metadata/Readers/StreamReader.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\ConcurrencyControlTrait' => __DIR__ . '/..' . '/google/cloud-core/src/ConcurrencyControlTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\DebugInfoTrait' => __DIR__ . '/..' . '/google/cloud-core/src/DebugInfoTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Duration' => __DIR__ . '/..' . '/google/cloud-core/src/Duration.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\EmulatorTrait' => __DIR__ . '/..' . '/google/cloud-core/src/EmulatorTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Exception\\AbortedException' => __DIR__ . '/..' . '/google/cloud-core/src/Exception/AbortedException.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Exception\\BadRequestException' => __DIR__ . '/..' . '/google/cloud-core/src/Exception/BadRequestException.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Exception\\ConflictException' => __DIR__ . '/..' . '/google/cloud-core/src/Exception/ConflictException.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Exception\\DeadlineExceededException' => __DIR__ . '/..' . '/google/cloud-core/src/Exception/DeadlineExceededException.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Exception\\FailedPreconditionException' => __DIR__ . '/..' . '/google/cloud-core/src/Exception/FailedPreconditionException.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Exception\\GoogleException' => __DIR__ . '/..' . '/google/cloud-core/src/Exception/GoogleException.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Exception\\NotFoundException' => __DIR__ . '/..' . '/google/cloud-core/src/Exception/NotFoundException.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Exception\\ServerException' => __DIR__ . '/..' . '/google/cloud-core/src/Exception/ServerException.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Exception\\ServiceException' => __DIR__ . '/..' . '/google/cloud-core/src/Exception/ServiceException.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\ExponentialBackoff' => __DIR__ . '/..' . '/google/cloud-core/src/ExponentialBackoff.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\GeoPoint' => __DIR__ . '/..' . '/google/cloud-core/src/GeoPoint.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\GrpcRequestWrapper' => __DIR__ . '/..' . '/google/cloud-core/src/GrpcRequestWrapper.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\GrpcTrait' => __DIR__ . '/..' . '/google/cloud-core/src/GrpcTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Iam\\Iam' => __DIR__ . '/..' . '/google/cloud-core/src/Iam/Iam.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Iam\\IamConnectionInterface' => __DIR__ . '/..' . '/google/cloud-core/src/Iam/IamConnectionInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Iam\\PolicyBuilder' => __DIR__ . '/..' . '/google/cloud-core/src/Iam/PolicyBuilder.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Int64' => __DIR__ . '/..' . '/google/cloud-core/src/Int64.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Iterator\\ItemIterator' => __DIR__ . '/..' . '/google/cloud-core/src/Iterator/ItemIterator.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Iterator\\ItemIteratorTrait' => __DIR__ . '/..' . '/google/cloud-core/src/Iterator/ItemIteratorTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Iterator\\PageIterator' => __DIR__ . '/..' . '/google/cloud-core/src/Iterator/PageIterator.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Iterator\\PageIteratorTrait' => __DIR__ . '/..' . '/google/cloud-core/src/Iterator/PageIteratorTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\JsonTrait' => __DIR__ . '/..' . '/google/cloud-core/src/JsonTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Lock\\FlockLock' => __DIR__ . '/..' . '/google/cloud-core/src/Lock/FlockLock.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Lock\\LockInterface' => __DIR__ . '/..' . '/google/cloud-core/src/Lock/LockInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Lock\\LockTrait' => __DIR__ . '/..' . '/google/cloud-core/src/Lock/LockTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Lock\\SemaphoreLock' => __DIR__ . '/..' . '/google/cloud-core/src/Lock/SemaphoreLock.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Lock\\SymfonyLockAdapter' => __DIR__ . '/..' . '/google/cloud-core/src/Lock/SymfonyLockAdapter.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Logger\\AppEngineFlexFormatter' => __DIR__ . '/..' . '/google/cloud-core/src/Logger/AppEngineFlexFormatter.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Logger\\AppEngineFlexHandler' => __DIR__ . '/..' . '/google/cloud-core/src/Logger/AppEngineFlexHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\LongRunning\\LROTrait' => __DIR__ . '/..' . '/google/cloud-core/src/LongRunning/LROTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\LongRunning\\LongRunningConnectionInterface' => __DIR__ . '/..' . '/google/cloud-core/src/LongRunning/LongRunningConnectionInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\LongRunning\\LongRunningOperation' => __DIR__ . '/..' . '/google/cloud-core/src/LongRunning/LongRunningOperation.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\LongRunning\\OperationResponseTrait' => __DIR__ . '/..' . '/google/cloud-core/src/LongRunning/OperationResponseTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\PhpArray' => __DIR__ . '/..' . '/google/cloud-core/src/PhpArray.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Report\\EmptyMetadataProvider' => __DIR__ . '/..' . '/google/cloud-core/src/Report/EmptyMetadataProvider.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Report\\GAEFlexMetadataProvider' => __DIR__ . '/..' . '/google/cloud-core/src/Report/GAEFlexMetadataProvider.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Report\\GAEMetadataProvider' => __DIR__ . '/..' . '/google/cloud-core/src/Report/GAEMetadataProvider.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Report\\GAEStandardMetadataProvider' => __DIR__ . '/..' . '/google/cloud-core/src/Report/GAEStandardMetadataProvider.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Report\\MetadataProviderInterface' => __DIR__ . '/..' . '/google/cloud-core/src/Report/MetadataProviderInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Report\\MetadataProviderUtils' => __DIR__ . '/..' . '/google/cloud-core/src/Report/MetadataProviderUtils.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Report\\SimpleMetadataProvider' => __DIR__ . '/..' . '/google/cloud-core/src/Report/SimpleMetadataProvider.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\RequestBuilder' => __DIR__ . '/..' . '/google/cloud-core/src/RequestBuilder.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\RequestWrapper' => __DIR__ . '/..' . '/google/cloud-core/src/RequestWrapper.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\RequestWrapperTrait' => __DIR__ . '/..' . '/google/cloud-core/src/RequestWrapperTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\RestTrait' => __DIR__ . '/..' . '/google/cloud-core/src/RestTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Retry' => __DIR__ . '/..' . '/google/cloud-core/src/Retry.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\RetryDeciderTrait' => __DIR__ . '/..' . '/google/cloud-core/src/RetryDeciderTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\ServiceBuilder' => __DIR__ . '/..' . '/google/cloud-core/src/ServiceBuilder.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\SysvTrait' => __DIR__ . '/..' . '/google/cloud-core/src/SysvTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Testing\\ArrayHasSameValuesToken' => __DIR__ . '/..' . '/google/cloud-core/src/Testing/ArrayHasSameValuesToken.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Testing\\CheckForClassTrait' => __DIR__ . '/..' . '/google/cloud-core/src/Testing/CheckForClassTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Testing\\DatastoreOperationRefreshTrait' => __DIR__ . '/..' . '/google/cloud-core/src/Testing/DatastoreOperationRefreshTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Testing\\DocBlockStripSpaces' => __DIR__ . '/..' . '/google/cloud-core/src/Testing/DocBlockStripSpaces.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Testing\\FileListFilterIterator' => __DIR__ . '/..' . '/google/cloud-core/src/Testing/FileListFilterIterator.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Testing\\GrpcTestTrait' => __DIR__ . '/..' . '/google/cloud-core/src/Testing/GrpcTestTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Testing\\KeyPairGenerateTrait' => __DIR__ . '/..' . '/google/cloud-core/src/Testing/KeyPairGenerateTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Testing\\Lock\\MockValues' => __DIR__ . '/..' . '/google/cloud-core/src/Testing/Lock/MockValues.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Testing\\RegexFileFilter' => __DIR__ . '/..' . '/google/cloud-core/src/Testing/RegexFileFilter.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Testing\\Snippet\\Container' => __DIR__ . '/..' . '/google/cloud-core/src/Testing/Snippet/Container.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Testing\\Snippet\\Coverage\\Coverage' => __DIR__ . '/..' . '/google/cloud-core/src/Testing/Snippet/Coverage/Coverage.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Testing\\Snippet\\Coverage\\ExcludeFilter' => __DIR__ . '/..' . '/google/cloud-core/src/Testing/Snippet/Coverage/ExcludeFilter.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Testing\\Snippet\\Coverage\\ResultPrinter' => __DIR__ . '/..' . '/google/cloud-core/src/Testing/Snippet/Coverage/ResultPrinter.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Testing\\Snippet\\Coverage\\Scanner' => __DIR__ . '/..' . '/google/cloud-core/src/Testing/Snippet/Coverage/Scanner.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Testing\\Snippet\\Coverage\\ScannerInterface' => __DIR__ . '/..' . '/google/cloud-core/src/Testing/Snippet/Coverage/ScannerInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Testing\\Snippet\\Fixtures' => __DIR__ . '/..' . '/google/cloud-core/src/Testing/Snippet/Fixtures.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Testing\\Snippet\\Parser\\InvokeResult' => __DIR__ . '/..' . '/google/cloud-core/src/Testing/Snippet/Parser/InvokeResult.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Testing\\Snippet\\Parser\\Parser' => __DIR__ . '/..' . '/google/cloud-core/src/Testing/Snippet/Parser/Parser.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Testing\\Snippet\\Parser\\Snippet' => __DIR__ . '/..' . '/google/cloud-core/src/Testing/Snippet/Parser/Snippet.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Testing\\Snippet\\SnippetTestCase' => __DIR__ . '/..' . '/google/cloud-core/src/Testing/Snippet/SnippetTestCase.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Testing\\StubTrait' => __DIR__ . '/..' . '/google/cloud-core/src/Testing/StubTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Testing\\System\\DeletionQueue' => __DIR__ . '/..' . '/google/cloud-core/src/Testing/System/DeletionQueue.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Testing\\System\\SystemTestCase' => __DIR__ . '/..' . '/google/cloud-core/src/Testing/System/SystemTestCase.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Testing\\TestHelpers' => __DIR__ . '/..' . '/google/cloud-core/src/Testing/TestHelpers.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\TimeTrait' => __DIR__ . '/..' . '/google/cloud-core/src/TimeTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Timestamp' => __DIR__ . '/..' . '/google/cloud-core/src/Timestamp.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Upload\\AbstractUploader' => __DIR__ . '/..' . '/google/cloud-core/src/Upload/AbstractUploader.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Upload\\MultipartUploader' => __DIR__ . '/..' . '/google/cloud-core/src/Upload/MultipartUploader.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Upload\\ResumableUploader' => __DIR__ . '/..' . '/google/cloud-core/src/Upload/ResumableUploader.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Upload\\SignedUrlUploader' => __DIR__ . '/..' . '/google/cloud-core/src/Upload/SignedUrlUploader.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Upload\\StreamableUploader' => __DIR__ . '/..' . '/google/cloud-core/src/Upload/StreamableUploader.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\UriTrait' => __DIR__ . '/..' . '/google/cloud-core/src/UriTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\ValidateTrait' => __DIR__ . '/..' . '/google/cloud-core/src/ValidateTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\ValueMapperTrait' => __DIR__ . '/..' . '/google/cloud-core/src/ValueMapperTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\WhitelistTrait' => __DIR__ . '/..' . '/google/cloud-core/src/WhitelistTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Storage\\Acl' => __DIR__ . '/..' . '/google/cloud-storage/src/Acl.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Storage\\Bucket' => __DIR__ . '/..' . '/google/cloud-storage/src/Bucket.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Storage\\Connection\\ConnectionInterface' => __DIR__ . '/..' . '/google/cloud-storage/src/Connection/ConnectionInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Storage\\Connection\\IamBucket' => __DIR__ . '/..' . '/google/cloud-storage/src/Connection/IamBucket.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Storage\\Connection\\Rest' => __DIR__ . '/..' . '/google/cloud-storage/src/Connection/Rest.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Storage\\EncryptionTrait' => __DIR__ . '/..' . '/google/cloud-storage/src/EncryptionTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Storage\\Lifecycle' => __DIR__ . '/..' . '/google/cloud-storage/src/Lifecycle.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Storage\\Notification' => __DIR__ . '/..' . '/google/cloud-storage/src/Notification.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Storage\\ObjectIterator' => __DIR__ . '/..' . '/google/cloud-storage/src/ObjectIterator.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Storage\\ObjectPageIterator' => __DIR__ . '/..' . '/google/cloud-storage/src/ObjectPageIterator.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Storage\\ReadStream' => __DIR__ . '/..' . '/google/cloud-storage/src/ReadStream.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Storage\\StorageClient' => __DIR__ . '/..' . '/google/cloud-storage/src/StorageClient.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Storage\\StorageObject' => __DIR__ . '/..' . '/google/cloud-storage/src/StorageObject.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Storage\\StreamWrapper' => __DIR__ . '/..' . '/google/cloud-storage/src/StreamWrapper.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Storage\\WriteStream' => __DIR__ . '/..' . '/google/cloud-storage/src/WriteStream.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Client' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/Client.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\ClientInterface' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/ClientInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Cookie\\CookieJar' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/Cookie/CookieJar.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Cookie\\CookieJarInterface' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/Cookie/CookieJarInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Cookie\\FileCookieJar' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/Cookie/FileCookieJar.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Cookie\\SessionCookieJar' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/Cookie/SessionCookieJar.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Cookie\\SetCookie' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/Cookie/SetCookie.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Exception\\BadResponseException' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/Exception/BadResponseException.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Exception\\ClientException' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/Exception/ClientException.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Exception\\ConnectException' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/Exception/ConnectException.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Exception\\GuzzleException' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/Exception/GuzzleException.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Exception\\RequestException' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/Exception/RequestException.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Exception\\SeekException' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/Exception/SeekException.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Exception\\ServerException' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/Exception/ServerException.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Exception\\TooManyRedirectsException' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/Exception/TooManyRedirectsException.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Exception\\TransferException' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/Exception/TransferException.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\HandlerStack' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/HandlerStack.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Handler\\CurlFactory' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/Handler/CurlFactory.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Handler\\CurlFactoryInterface' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/Handler/CurlFactoryInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Handler\\CurlHandler' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/Handler/CurlHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Handler\\CurlMultiHandler' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Handler\\EasyHandle' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/Handler/EasyHandle.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Handler\\MockHandler' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/Handler/MockHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Handler\\Proxy' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/Handler/Proxy.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Handler\\StreamHandler' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/Handler/StreamHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\MessageFormatter' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/MessageFormatter.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Middleware' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/Middleware.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Pool' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/Pool.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\PrepareBodyMiddleware' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Promise\\AggregateException' => __DIR__ . '/..' . '/guzzlehttp/promises/src/AggregateException.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Promise\\CancellationException' => __DIR__ . '/..' . '/guzzlehttp/promises/src/CancellationException.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Promise\\Coroutine' => __DIR__ . '/..' . '/guzzlehttp/promises/src/Coroutine.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Promise\\EachPromise' => __DIR__ . '/..' . '/guzzlehttp/promises/src/EachPromise.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Promise\\FulfilledPromise' => __DIR__ . '/..' . '/guzzlehttp/promises/src/FulfilledPromise.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Promise\\Promise' => __DIR__ . '/..' . '/guzzlehttp/promises/src/Promise.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Promise\\PromiseInterface' => __DIR__ . '/..' . '/guzzlehttp/promises/src/PromiseInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Promise\\PromisorInterface' => __DIR__ . '/..' . '/guzzlehttp/promises/src/PromisorInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Promise\\RejectedPromise' => __DIR__ . '/..' . '/guzzlehttp/promises/src/RejectedPromise.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Promise\\RejectionException' => __DIR__ . '/..' . '/guzzlehttp/promises/src/RejectionException.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Promise\\TaskQueue' => __DIR__ . '/..' . '/guzzlehttp/promises/src/TaskQueue.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Promise\\TaskQueueInterface' => __DIR__ . '/..' . '/guzzlehttp/promises/src/TaskQueueInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Psr7\\AppendStream' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/AppendStream.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Psr7\\BufferStream' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/BufferStream.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Psr7\\CachingStream' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/CachingStream.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Psr7\\DroppingStream' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/DroppingStream.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Psr7\\FnStream' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/FnStream.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Psr7\\InflateStream' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/InflateStream.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Psr7\\LazyOpenStream' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/LazyOpenStream.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Psr7\\LimitStream' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/LimitStream.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Psr7\\MessageTrait' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/MessageTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Psr7\\MultipartStream' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/MultipartStream.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Psr7\\NoSeekStream' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/NoSeekStream.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Psr7\\PumpStream' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/PumpStream.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Psr7\\Request' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/Request.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Psr7\\Response' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/Response.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Psr7\\Rfc7230' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/Rfc7230.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Psr7\\ServerRequest' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/ServerRequest.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Psr7\\Stream' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/Stream.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Psr7\\StreamDecoratorTrait' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/StreamDecoratorTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Psr7\\StreamWrapper' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/StreamWrapper.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Psr7\\UploadedFile' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/UploadedFile.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Psr7\\Uri' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/Uri.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Psr7\\UriNormalizer' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/UriNormalizer.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Psr7\\UriResolver' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/UriResolver.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\RedirectMiddleware' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/RedirectMiddleware.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\RequestOptions' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/RequestOptions.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\RetryMiddleware' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/RetryMiddleware.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\TransferStats' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/TransferStats.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\UriTemplate' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/UriTemplate.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\ErrorHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/ErrorHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Formatter\\ChromePHPFormatter' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Formatter/ChromePHPFormatter.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Formatter\\ElasticaFormatter' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Formatter/ElasticaFormatter.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Formatter\\FlowdockFormatter' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Formatter/FlowdockFormatter.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Formatter\\FluentdFormatter' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Formatter/FluentdFormatter.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Formatter\\FormatterInterface' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Formatter/FormatterInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Formatter\\GelfMessageFormatter' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Formatter/GelfMessageFormatter.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Formatter\\HtmlFormatter' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Formatter/HtmlFormatter.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Formatter\\JsonFormatter' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Formatter/JsonFormatter.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Formatter\\LineFormatter' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Formatter/LineFormatter.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Formatter\\LogglyFormatter' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Formatter/LogglyFormatter.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Formatter\\LogstashFormatter' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Formatter/LogstashFormatter.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Formatter\\MongoDBFormatter' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Formatter/MongoDBFormatter.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Formatter\\NormalizerFormatter' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Formatter/NormalizerFormatter.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Formatter\\ScalarFormatter' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Formatter/ScalarFormatter.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Formatter\\WildfireFormatter' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Formatter/WildfireFormatter.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\AbstractHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/AbstractHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\AbstractProcessingHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/AbstractProcessingHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\AbstractSyslogHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/AbstractSyslogHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\AmqpHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/AmqpHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\BrowserConsoleHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/BrowserConsoleHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\BufferHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/BufferHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\ChromePHPHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/ChromePHPHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\CouchDBHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/CouchDBHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\CubeHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/CubeHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\Curl\\Util' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/Curl/Util.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\DeduplicationHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/DeduplicationHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\DoctrineCouchDBHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/DoctrineCouchDBHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\DynamoDbHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/DynamoDbHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\ElasticSearchHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/ElasticSearchHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\ErrorLogHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/ErrorLogHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\FilterHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/FilterHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\FingersCrossedHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/FingersCrossedHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\FingersCrossed\\ActivationStrategyInterface' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/FingersCrossed/ActivationStrategyInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\FingersCrossed\\ChannelLevelActivationStrategy' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/FingersCrossed/ChannelLevelActivationStrategy.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\FingersCrossed\\ErrorLevelActivationStrategy' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/FingersCrossed/ErrorLevelActivationStrategy.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\FirePHPHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/FirePHPHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\FleepHookHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/FleepHookHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\FlowdockHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/FlowdockHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\GelfHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/GelfHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\GroupHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/GroupHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\HandlerInterface' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/HandlerInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\HandlerWrapper' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/HandlerWrapper.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\HipChatHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/HipChatHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\IFTTTHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/IFTTTHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\InsightOpsHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/InsightOpsHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\LogEntriesHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/LogEntriesHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\LogglyHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/LogglyHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\MailHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/MailHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\MandrillHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/MandrillHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\MissingExtensionException' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/MissingExtensionException.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\MongoDBHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/MongoDBHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\NativeMailerHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/NativeMailerHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\NewRelicHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/NewRelicHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\NullHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/NullHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\PHPConsoleHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/PHPConsoleHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\PsrHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/PsrHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\PushoverHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/PushoverHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\RavenHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/RavenHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\RedisHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/RedisHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\RollbarHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/RollbarHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\RotatingFileHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/RotatingFileHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\SamplingHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/SamplingHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\SlackHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/SlackHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\SlackWebhookHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/SlackWebhookHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\Slack\\SlackRecord' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/Slack/SlackRecord.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\SlackbotHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/SlackbotHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\SocketHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/SocketHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\StreamHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/StreamHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\SwiftMailerHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/SwiftMailerHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\SyslogHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/SyslogHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\SyslogUdpHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/SyslogUdpHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\SyslogUdp\\UdpSocket' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/SyslogUdp/UdpSocket.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\TestHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/TestHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\WhatFailureGroupHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/WhatFailureGroupHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\ZendMonitorHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/ZendMonitorHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Logger' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Logger.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Processor\\GitProcessor' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Processor/GitProcessor.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Processor\\IntrospectionProcessor' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Processor/IntrospectionProcessor.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Processor\\MemoryPeakUsageProcessor' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Processor/MemoryPeakUsageProcessor.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Processor\\MemoryProcessor' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Processor/MemoryProcessor.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Processor\\MemoryUsageProcessor' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Processor/MemoryUsageProcessor.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Processor\\MercurialProcessor' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Processor/MercurialProcessor.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Processor\\ProcessIdProcessor' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Processor/ProcessIdProcessor.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Processor\\ProcessorInterface' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Processor/ProcessorInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Processor\\PsrLogMessageProcessor' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Processor/PsrLogMessageProcessor.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Processor\\TagProcessor' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Processor/TagProcessor.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Processor\\UidProcessor' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Processor/UidProcessor.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Processor\\WebProcessor' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Processor/WebProcessor.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Registry' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Registry.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\ResettableInterface' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/ResettableInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\SignalHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/SignalHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Utils' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Utils.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Psr\\Cache\\CacheException' => __DIR__ . '/..' . '/psr/cache/src/CacheException.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Psr\\Cache\\CacheItemInterface' => __DIR__ . '/..' . '/psr/cache/src/CacheItemInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Psr\\Cache\\CacheItemPoolInterface' => __DIR__ . '/..' . '/psr/cache/src/CacheItemPoolInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Psr\\Cache\\InvalidArgumentException' => __DIR__ . '/..' . '/psr/cache/src/InvalidArgumentException.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Psr\\Http\\Message\\MessageInterface' => __DIR__ . '/..' . '/psr/http-message/src/MessageInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Psr\\Http\\Message\\RequestInterface' => __DIR__ . '/..' . '/psr/http-message/src/RequestInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Psr\\Http\\Message\\ResponseInterface' => __DIR__ . '/..' . '/psr/http-message/src/ResponseInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Psr\\Http\\Message\\ServerRequestInterface' => __DIR__ . '/..' . '/psr/http-message/src/ServerRequestInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Psr\\Http\\Message\\StreamInterface' => __DIR__ . '/..' . '/psr/http-message/src/StreamInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Psr\\Http\\Message\\UploadedFileInterface' => __DIR__ . '/..' . '/psr/http-message/src/UploadedFileInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Psr\\Http\\Message\\UriInterface' => __DIR__ . '/..' . '/psr/http-message/src/UriInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Psr\\Log\\AbstractLogger' => __DIR__ . '/..' . '/psr/log/Psr/Log/AbstractLogger.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Psr\\Log\\InvalidArgumentException' => __DIR__ . '/..' . '/psr/log/Psr/Log/InvalidArgumentException.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Psr\\Log\\LogLevel' => __DIR__ . '/..' . '/psr/log/Psr/Log/LogLevel.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Psr\\Log\\LoggerAwareInterface' => __DIR__ . '/..' . '/psr/log/Psr/Log/LoggerAwareInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Psr\\Log\\LoggerAwareTrait' => __DIR__ . '/..' . '/psr/log/Psr/Log/LoggerAwareTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Psr\\Log\\LoggerInterface' => __DIR__ . '/..' . '/psr/log/Psr/Log/LoggerInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Psr\\Log\\LoggerTrait' => __DIR__ . '/..' . '/psr/log/Psr/Log/LoggerTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Psr\\Log\\NullLogger' => __DIR__ . '/..' . '/psr/log/Psr/Log/NullLogger.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Psr\\Log\\Test\\DummyTest' => __DIR__ . '/..' . '/psr/log/Psr/Log/Test/LoggerInterfaceTest.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Psr\\Log\\Test\\LoggerInterfaceTest' => __DIR__ . '/..' . '/psr/log/Psr/Log/Test/LoggerInterfaceTest.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Psr\\Log\\Test\\TestLogger' => __DIR__ . '/..' . '/psr/log/Psr/Log/Test/TestLogger.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Rize\\UriTemplate' => __DIR__ . '/..' . '/rize/uri-template/src/Rize/UriTemplate.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Rize\\UriTemplate\\Node\\Abstraction' => __DIR__ . '/..' . '/rize/uri-template/src/Rize/UriTemplate/Node/Abstraction.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Rize\\UriTemplate\\Node\\Expression' => __DIR__ . '/..' . '/rize/uri-template/src/Rize/UriTemplate/Node/Expression.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Rize\\UriTemplate\\Node\\Literal' => __DIR__ . '/..' . '/rize/uri-template/src/Rize/UriTemplate/Node/Literal.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Rize\\UriTemplate\\Node\\Variable' => __DIR__ . '/..' . '/rize/uri-template/src/Rize/UriTemplate/Node/Variable.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Rize\\UriTemplate\\Operator\\Abstraction' => __DIR__ . '/..' . '/rize/uri-template/src/Rize/UriTemplate/Operator/Abstraction.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Rize\\UriTemplate\\Operator\\Named' => __DIR__ . '/..' . '/rize/uri-template/src/Rize/UriTemplate/Operator/Named.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Rize\\UriTemplate\\Operator\\UnNamed' => __DIR__ . '/..' . '/rize/uri-template/src/Rize/UriTemplate/Operator/UnNamed.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Rize\\UriTemplate\\Parser' => __DIR__ . '/..' . '/rize/uri-template/src/Rize/UriTemplate/Parser.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Rize\\UriTemplate\\UriTemplate' => __DIR__ . '/..' . '/rize/uri-template/src/Rize/UriTemplate/UriTemplate.php');
|
13 |
public static function getInitializer(\DeliciousBrains\WP_Offload_Media\Gcp\Composer\Autoload\ClassLoader $loader)
|
14 |
{
|
15 |
return \Closure::bind(function () use($loader) {
|
16 |
-
$loader->prefixLengthsPsr4 =
|
17 |
-
$loader->prefixDirsPsr4 =
|
18 |
-
$loader->prefixesPsr0 =
|
19 |
-
$loader->classMap =
|
20 |
}, null, \DeliciousBrains\WP_Offload_Media\Gcp\Composer\Autoload\ClassLoader::class);
|
21 |
}
|
22 |
}
|
3 |
// autoload_static.php @generated by Composer
|
4 |
namespace DeliciousBrains\WP_Offload_Media\Gcp\Composer\Autoload;
|
5 |
|
6 |
+
class ComposerStaticInitad2bbf672104326f33ebff61e2e8e9b8
|
7 |
{
|
8 |
+
public static $files = array('dbi_as3cf_gcp_7b11c4dc42b3b3023073cb14e519683c' => __DIR__ . '/..' . '/ralouphie/getallheaders/src/getallheaders.php', 'dbi_as3cf_gcp_c964ee0ededf28c96ebd9db5099ef910' => __DIR__ . '/..' . '/guzzlehttp/promises/src/functions_include.php', 'dbi_as3cf_gcp_a0edc8309cc5e1d60e3047b5df6b7052' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/functions_include.php', 'dbi_as3cf_gcp_37a3dc5111fe8f707ab4c132ef1dbc62' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/functions_include.php');
|
9 |
+
public static $prefixLengthsPsr4 = array('P' => array('DeliciousBrains\\WP_Offload_Media\\Gcp\\Psr\\Log\\' => 8, 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Psr\\Http\\Message\\' => 17, 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Psr\\Cache\\' => 10), 'M' => array('DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\' => 8), 'G' => array('DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Psr7\\' => 16, 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Promise\\' => 19, 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\' => 11, 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Storage\\' => 21, 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\' => 18, 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\CRC32\\' => 13, 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Auth\\' => 12), 'F' => array('DeliciousBrains\\WP_Offload_Media\\Gcp\\Firebase\\JWT\\' => 13));
|
10 |
+
public static $prefixDirsPsr4 = array('DeliciousBrains\\WP_Offload_Media\\Gcp\\Psr\\Log\\' => array(0 => __DIR__ . '/..' . '/psr/log/Psr/Log'), 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Psr\\Http\\Message\\' => array(0 => __DIR__ . '/..' . '/psr/http-message/src'), 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Psr\\Cache\\' => array(0 => __DIR__ . '/..' . '/psr/cache/src'), 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\' => array(0 => __DIR__ . '/..' . '/monolog/monolog/src/Monolog'), 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Psr7\\' => array(0 => __DIR__ . '/..' . '/guzzlehttp/psr7/src'), 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Promise\\' => array(0 => __DIR__ . '/..' . '/guzzlehttp/promises/src'), 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\' => array(0 => __DIR__ . '/..' . '/guzzlehttp/guzzle/src'), 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Storage\\' => array(0 => __DIR__ . '/..' . '/google/cloud-storage/src'), 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\' => array(0 => __DIR__ . '/..' . '/google/cloud-core/src'), 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\CRC32\\' => array(0 => __DIR__ . '/..' . '/google/crc32/src'), 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Auth\\' => array(0 => __DIR__ . '/..' . '/google/auth/src'), 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Firebase\\JWT\\' => array(0 => __DIR__ . '/..' . '/firebase/php-jwt/src'));
|
11 |
public static $prefixesPsr0 = array('R' => array('DeliciousBrains\\WP_Offload_Media\\Gcp\\Rize\\UriTemplate' => array(0 => __DIR__ . '/..' . '/rize/uri-template/src')));
|
12 |
+
public static $classMap = array('DeliciousBrains\\WP_Offload_Media\\Gcp\\Firebase\\JWT\\BeforeValidException' => __DIR__ . '/..' . '/firebase/php-jwt/src/BeforeValidException.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Firebase\\JWT\\ExpiredException' => __DIR__ . '/..' . '/firebase/php-jwt/src/ExpiredException.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Firebase\\JWT\\JWT' => __DIR__ . '/..' . '/firebase/php-jwt/src/JWT.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Firebase\\JWT\\SignatureInvalidException' => __DIR__ . '/..' . '/firebase/php-jwt/src/SignatureInvalidException.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Auth\\AccessToken' => __DIR__ . '/..' . '/google/auth/src/AccessToken.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Auth\\ApplicationDefaultCredentials' => __DIR__ . '/..' . '/google/auth/src/ApplicationDefaultCredentials.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Auth\\CacheTrait' => __DIR__ . '/..' . '/google/auth/src/CacheTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Auth\\Cache\\InvalidArgumentException' => __DIR__ . '/..' . '/google/auth/src/Cache/InvalidArgumentException.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Auth\\Cache\\Item' => __DIR__ . '/..' . '/google/auth/src/Cache/Item.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Auth\\Cache\\MemoryCacheItemPool' => __DIR__ . '/..' . '/google/auth/src/Cache/MemoryCacheItemPool.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Auth\\Cache\\SysVCacheItemPool' => __DIR__ . '/..' . '/google/auth/src/Cache/SysVCacheItemPool.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Auth\\CredentialsLoader' => __DIR__ . '/..' . '/google/auth/src/CredentialsLoader.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Auth\\Credentials\\AppIdentityCredentials' => __DIR__ . '/..' . '/google/auth/src/Credentials/AppIdentityCredentials.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Auth\\Credentials\\GCECredentials' => __DIR__ . '/..' . '/google/auth/src/Credentials/GCECredentials.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Auth\\Credentials\\IAMCredentials' => __DIR__ . '/..' . '/google/auth/src/Credentials/IAMCredentials.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Auth\\Credentials\\InsecureCredentials' => __DIR__ . '/..' . '/google/auth/src/Credentials/InsecureCredentials.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Auth\\Credentials\\ServiceAccountCredentials' => __DIR__ . '/..' . '/google/auth/src/Credentials/ServiceAccountCredentials.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Auth\\Credentials\\ServiceAccountJwtAccessCredentials' => __DIR__ . '/..' . '/google/auth/src/Credentials/ServiceAccountJwtAccessCredentials.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Auth\\Credentials\\UserRefreshCredentials' => __DIR__ . '/..' . '/google/auth/src/Credentials/UserRefreshCredentials.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Auth\\FetchAuthTokenCache' => __DIR__ . '/..' . '/google/auth/src/FetchAuthTokenCache.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Auth\\FetchAuthTokenInterface' => __DIR__ . '/..' . '/google/auth/src/FetchAuthTokenInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Auth\\HttpHandler\\Guzzle5HttpHandler' => __DIR__ . '/..' . '/google/auth/src/HttpHandler/Guzzle5HttpHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Auth\\HttpHandler\\Guzzle6HttpHandler' => __DIR__ . '/..' . '/google/auth/src/HttpHandler/Guzzle6HttpHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Auth\\HttpHandler\\HttpClientCache' => __DIR__ . '/..' . '/google/auth/src/HttpHandler/HttpClientCache.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Auth\\HttpHandler\\HttpHandlerFactory' => __DIR__ . '/..' . '/google/auth/src/HttpHandler/HttpHandlerFactory.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Auth\\Iam' => __DIR__ . '/..' . '/google/auth/src/Iam.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Auth\\Middleware\\AuthTokenMiddleware' => __DIR__ . '/..' . '/google/auth/src/Middleware/AuthTokenMiddleware.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Auth\\Middleware\\ScopedAccessTokenMiddleware' => __DIR__ . '/..' . '/google/auth/src/Middleware/ScopedAccessTokenMiddleware.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Auth\\Middleware\\SimpleMiddleware' => __DIR__ . '/..' . '/google/auth/src/Middleware/SimpleMiddleware.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Auth\\OAuth2' => __DIR__ . '/..' . '/google/auth/src/OAuth2.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Auth\\ServiceAccountSignerTrait' => __DIR__ . '/..' . '/google/auth/src/ServiceAccountSignerTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Auth\\SignBlobInterface' => __DIR__ . '/..' . '/google/auth/src/SignBlobInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Auth\\Subscriber\\AuthTokenSubscriber' => __DIR__ . '/..' . '/google/auth/src/Subscriber/AuthTokenSubscriber.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Auth\\Subscriber\\ScopedAccessTokenSubscriber' => __DIR__ . '/..' . '/google/auth/src/Subscriber/ScopedAccessTokenSubscriber.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Auth\\Subscriber\\SimpleSubscriber' => __DIR__ . '/..' . '/google/auth/src/Subscriber/SimpleSubscriber.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\CRC32\\Builtin' => __DIR__ . '/..' . '/google/crc32/src/Builtin.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\CRC32\\CRC32' => __DIR__ . '/..' . '/google/crc32/src/CRC32.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\CRC32\\CRCInterface' => __DIR__ . '/..' . '/google/crc32/src/CRCInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\CRC32\\CRCTrait' => __DIR__ . '/..' . '/google/crc32/src/CRCTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\CRC32\\Google' => __DIR__ . '/..' . '/google/crc32/src/Google.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\CRC32\\PHP' => __DIR__ . '/..' . '/google/crc32/src/PHP.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\CRC32\\PHPSlicedBy4' => __DIR__ . '/..' . '/google/crc32/src/PHPSlicedBy4.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\CRC32\\Table' => __DIR__ . '/..' . '/google/crc32/src/Table.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\AnonymousCredentials' => __DIR__ . '/..' . '/google/cloud-core/src/AnonymousCredentials.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\ArrayTrait' => __DIR__ . '/..' . '/google/cloud-core/src/ArrayTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Batch\\BatchDaemon' => __DIR__ . '/..' . '/google/cloud-core/src/Batch/BatchDaemon.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Batch\\BatchDaemonTrait' => __DIR__ . '/..' . '/google/cloud-core/src/Batch/BatchDaemonTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Batch\\BatchJob' => __DIR__ . '/..' . '/google/cloud-core/src/Batch/BatchJob.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Batch\\BatchRunner' => __DIR__ . '/..' . '/google/cloud-core/src/Batch/BatchRunner.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Batch\\BatchTrait' => __DIR__ . '/..' . '/google/cloud-core/src/Batch/BatchTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Batch\\ClosureSerializerInterface' => __DIR__ . '/..' . '/google/cloud-core/src/Batch/ClosureSerializerInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Batch\\ConfigStorageInterface' => __DIR__ . '/..' . '/google/cloud-core/src/Batch/ConfigStorageInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Batch\\HandleFailureTrait' => __DIR__ . '/..' . '/google/cloud-core/src/Batch/HandleFailureTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Batch\\InMemoryConfigStorage' => __DIR__ . '/..' . '/google/cloud-core/src/Batch/InMemoryConfigStorage.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Batch\\InterruptTrait' => __DIR__ . '/..' . '/google/cloud-core/src/Batch/InterruptTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Batch\\JobConfig' => __DIR__ . '/..' . '/google/cloud-core/src/Batch/JobConfig.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Batch\\JobInterface' => __DIR__ . '/..' . '/google/cloud-core/src/Batch/JobInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Batch\\JobTrait' => __DIR__ . '/..' . '/google/cloud-core/src/Batch/JobTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Batch\\OpisClosureSerializer' => __DIR__ . '/..' . '/google/cloud-core/src/Batch/OpisClosureSerializer.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Batch\\ProcessItemInterface' => __DIR__ . '/..' . '/google/cloud-core/src/Batch/ProcessItemInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Batch\\Retry' => __DIR__ . '/..' . '/google/cloud-core/src/Batch/Retry.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Batch\\SerializableClientTrait' => __DIR__ . '/..' . '/google/cloud-core/src/Batch/SerializableClientTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Batch\\SimpleJob' => __DIR__ . '/..' . '/google/cloud-core/src/Batch/SimpleJob.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Batch\\SimpleJobTrait' => __DIR__ . '/..' . '/google/cloud-core/src/Batch/SimpleJobTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Batch\\SysvConfigStorage' => __DIR__ . '/..' . '/google/cloud-core/src/Batch/SysvConfigStorage.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Batch\\SysvProcessor' => __DIR__ . '/..' . '/google/cloud-core/src/Batch/SysvProcessor.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Blob' => __DIR__ . '/..' . '/google/cloud-core/src/Blob.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\CallTrait' => __DIR__ . '/..' . '/google/cloud-core/src/CallTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\ClientTrait' => __DIR__ . '/..' . '/google/cloud-core/src/ClientTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Compute\\Metadata' => __DIR__ . '/..' . '/google/cloud-core/src/Compute/Metadata.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Compute\\Metadata\\Readers\\HttpHandlerReader' => __DIR__ . '/..' . '/google/cloud-core/src/Compute/Metadata/Readers/HttpHandlerReader.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Compute\\Metadata\\Readers\\ReaderInterface' => __DIR__ . '/..' . '/google/cloud-core/src/Compute/Metadata/Readers/ReaderInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Compute\\Metadata\\Readers\\StreamReader' => __DIR__ . '/..' . '/google/cloud-core/src/Compute/Metadata/Readers/StreamReader.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\ConcurrencyControlTrait' => __DIR__ . '/..' . '/google/cloud-core/src/ConcurrencyControlTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\DebugInfoTrait' => __DIR__ . '/..' . '/google/cloud-core/src/DebugInfoTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Duration' => __DIR__ . '/..' . '/google/cloud-core/src/Duration.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\EmulatorTrait' => __DIR__ . '/..' . '/google/cloud-core/src/EmulatorTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Exception\\AbortedException' => __DIR__ . '/..' . '/google/cloud-core/src/Exception/AbortedException.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Exception\\BadRequestException' => __DIR__ . '/..' . '/google/cloud-core/src/Exception/BadRequestException.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Exception\\ConflictException' => __DIR__ . '/..' . '/google/cloud-core/src/Exception/ConflictException.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Exception\\DeadlineExceededException' => __DIR__ . '/..' . '/google/cloud-core/src/Exception/DeadlineExceededException.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Exception\\FailedPreconditionException' => __DIR__ . '/..' . '/google/cloud-core/src/Exception/FailedPreconditionException.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Exception\\GoogleException' => __DIR__ . '/..' . '/google/cloud-core/src/Exception/GoogleException.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Exception\\NotFoundException' => __DIR__ . '/..' . '/google/cloud-core/src/Exception/NotFoundException.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Exception\\ServerException' => __DIR__ . '/..' . '/google/cloud-core/src/Exception/ServerException.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Exception\\ServiceException' => __DIR__ . '/..' . '/google/cloud-core/src/Exception/ServiceException.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\ExponentialBackoff' => __DIR__ . '/..' . '/google/cloud-core/src/ExponentialBackoff.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\GeoPoint' => __DIR__ . '/..' . '/google/cloud-core/src/GeoPoint.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\GrpcRequestWrapper' => __DIR__ . '/..' . '/google/cloud-core/src/GrpcRequestWrapper.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\GrpcTrait' => __DIR__ . '/..' . '/google/cloud-core/src/GrpcTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Iam\\Iam' => __DIR__ . '/..' . '/google/cloud-core/src/Iam/Iam.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Iam\\IamConnectionInterface' => __DIR__ . '/..' . '/google/cloud-core/src/Iam/IamConnectionInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Iam\\PolicyBuilder' => __DIR__ . '/..' . '/google/cloud-core/src/Iam/PolicyBuilder.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Int64' => __DIR__ . '/..' . '/google/cloud-core/src/Int64.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Iterator\\ItemIterator' => __DIR__ . '/..' . '/google/cloud-core/src/Iterator/ItemIterator.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Iterator\\ItemIteratorTrait' => __DIR__ . '/..' . '/google/cloud-core/src/Iterator/ItemIteratorTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Iterator\\PageIterator' => __DIR__ . '/..' . '/google/cloud-core/src/Iterator/PageIterator.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Iterator\\PageIteratorTrait' => __DIR__ . '/..' . '/google/cloud-core/src/Iterator/PageIteratorTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\JsonTrait' => __DIR__ . '/..' . '/google/cloud-core/src/JsonTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Lock\\FlockLock' => __DIR__ . '/..' . '/google/cloud-core/src/Lock/FlockLock.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Lock\\LockInterface' => __DIR__ . '/..' . '/google/cloud-core/src/Lock/LockInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Lock\\LockTrait' => __DIR__ . '/..' . '/google/cloud-core/src/Lock/LockTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Lock\\SemaphoreLock' => __DIR__ . '/..' . '/google/cloud-core/src/Lock/SemaphoreLock.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Lock\\SymfonyLockAdapter' => __DIR__ . '/..' . '/google/cloud-core/src/Lock/SymfonyLockAdapter.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Logger\\AppEngineFlexFormatter' => __DIR__ . '/..' . '/google/cloud-core/src/Logger/AppEngineFlexFormatter.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Logger\\AppEngineFlexFormatterV2' => __DIR__ . '/..' . '/google/cloud-core/src/Logger/AppEngineFlexFormatterV2.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Logger\\AppEngineFlexHandler' => __DIR__ . '/..' . '/google/cloud-core/src/Logger/AppEngineFlexHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Logger\\AppEngineFlexHandlerFactory' => __DIR__ . '/..' . '/google/cloud-core/src/Logger/AppEngineFlexHandlerFactory.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Logger\\AppEngineFlexHandlerV2' => __DIR__ . '/..' . '/google/cloud-core/src/Logger/AppEngineFlexHandlerV2.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Logger\\FormatterTrait' => __DIR__ . '/..' . '/google/cloud-core/src/Logger/FormatterTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\LongRunning\\LROTrait' => __DIR__ . '/..' . '/google/cloud-core/src/LongRunning/LROTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\LongRunning\\LongRunningConnectionInterface' => __DIR__ . '/..' . '/google/cloud-core/src/LongRunning/LongRunningConnectionInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\LongRunning\\LongRunningOperation' => __DIR__ . '/..' . '/google/cloud-core/src/LongRunning/LongRunningOperation.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\LongRunning\\OperationResponseTrait' => __DIR__ . '/..' . '/google/cloud-core/src/LongRunning/OperationResponseTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\PhpArray' => __DIR__ . '/..' . '/google/cloud-core/src/PhpArray.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Report\\EmptyMetadataProvider' => __DIR__ . '/..' . '/google/cloud-core/src/Report/EmptyMetadataProvider.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Report\\GAEFlexMetadataProvider' => __DIR__ . '/..' . '/google/cloud-core/src/Report/GAEFlexMetadataProvider.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Report\\GAEMetadataProvider' => __DIR__ . '/..' . '/google/cloud-core/src/Report/GAEMetadataProvider.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Report\\GAEStandardMetadataProvider' => __DIR__ . '/..' . '/google/cloud-core/src/Report/GAEStandardMetadataProvider.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Report\\MetadataProviderInterface' => __DIR__ . '/..' . '/google/cloud-core/src/Report/MetadataProviderInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Report\\MetadataProviderUtils' => __DIR__ . '/..' . '/google/cloud-core/src/Report/MetadataProviderUtils.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Report\\SimpleMetadataProvider' => __DIR__ . '/..' . '/google/cloud-core/src/Report/SimpleMetadataProvider.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\RequestBuilder' => __DIR__ . '/..' . '/google/cloud-core/src/RequestBuilder.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\RequestWrapper' => __DIR__ . '/..' . '/google/cloud-core/src/RequestWrapper.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\RequestWrapperTrait' => __DIR__ . '/..' . '/google/cloud-core/src/RequestWrapperTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\RestTrait' => __DIR__ . '/..' . '/google/cloud-core/src/RestTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Retry' => __DIR__ . '/..' . '/google/cloud-core/src/Retry.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\RetryDeciderTrait' => __DIR__ . '/..' . '/google/cloud-core/src/RetryDeciderTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\ServiceBuilder' => __DIR__ . '/..' . '/google/cloud-core/src/ServiceBuilder.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\SysvTrait' => __DIR__ . '/..' . '/google/cloud-core/src/SysvTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Testing\\ArrayHasSameValuesToken' => __DIR__ . '/..' . '/google/cloud-core/src/Testing/ArrayHasSameValuesToken.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Testing\\CheckForClassTrait' => __DIR__ . '/..' . '/google/cloud-core/src/Testing/CheckForClassTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Testing\\DatastoreOperationRefreshTrait' => __DIR__ . '/..' . '/google/cloud-core/src/Testing/DatastoreOperationRefreshTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Testing\\DocBlockStripSpaces' => __DIR__ . '/..' . '/google/cloud-core/src/Testing/DocBlockStripSpaces.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Testing\\FileListFilterIterator' => __DIR__ . '/..' . '/google/cloud-core/src/Testing/FileListFilterIterator.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Testing\\GrpcTestTrait' => __DIR__ . '/..' . '/google/cloud-core/src/Testing/GrpcTestTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Testing\\KeyPairGenerateTrait' => __DIR__ . '/..' . '/google/cloud-core/src/Testing/KeyPairGenerateTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Testing\\Lock\\MockValues' => __DIR__ . '/..' . '/google/cloud-core/src/Testing/Lock/MockValues.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Testing\\RegexFileFilter' => __DIR__ . '/..' . '/google/cloud-core/src/Testing/RegexFileFilter.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Testing\\Snippet\\Container' => __DIR__ . '/..' . '/google/cloud-core/src/Testing/Snippet/Container.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Testing\\Snippet\\Coverage\\Coverage' => __DIR__ . '/..' . '/google/cloud-core/src/Testing/Snippet/Coverage/Coverage.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Testing\\Snippet\\Coverage\\ExcludeFilter' => __DIR__ . '/..' . '/google/cloud-core/src/Testing/Snippet/Coverage/ExcludeFilter.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Testing\\Snippet\\Coverage\\ResultPrinter' => __DIR__ . '/..' . '/google/cloud-core/src/Testing/Snippet/Coverage/ResultPrinter.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Testing\\Snippet\\Coverage\\Scanner' => __DIR__ . '/..' . '/google/cloud-core/src/Testing/Snippet/Coverage/Scanner.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Testing\\Snippet\\Coverage\\ScannerInterface' => __DIR__ . '/..' . '/google/cloud-core/src/Testing/Snippet/Coverage/ScannerInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Testing\\Snippet\\Fixtures' => __DIR__ . '/..' . '/google/cloud-core/src/Testing/Snippet/Fixtures.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Testing\\Snippet\\Parser\\InvokeResult' => __DIR__ . '/..' . '/google/cloud-core/src/Testing/Snippet/Parser/InvokeResult.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Testing\\Snippet\\Parser\\Parser' => __DIR__ . '/..' . '/google/cloud-core/src/Testing/Snippet/Parser/Parser.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Testing\\Snippet\\Parser\\Snippet' => __DIR__ . '/..' . '/google/cloud-core/src/Testing/Snippet/Parser/Snippet.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Testing\\Snippet\\SnippetTestCase' => __DIR__ . '/..' . '/google/cloud-core/src/Testing/Snippet/SnippetTestCase.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Testing\\StubTrait' => __DIR__ . '/..' . '/google/cloud-core/src/Testing/StubTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Testing\\System\\DeletionQueue' => __DIR__ . '/..' . '/google/cloud-core/src/Testing/System/DeletionQueue.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Testing\\System\\KeyManager' => __DIR__ . '/..' . '/google/cloud-core/src/Testing/System/KeyManager.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Testing\\System\\SystemTestCase' => __DIR__ . '/..' . '/google/cloud-core/src/Testing/System/SystemTestCase.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Testing\\TestHelpers' => __DIR__ . '/..' . '/google/cloud-core/src/Testing/TestHelpers.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\TimeTrait' => __DIR__ . '/..' . '/google/cloud-core/src/TimeTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Timestamp' => __DIR__ . '/..' . '/google/cloud-core/src/Timestamp.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Upload\\AbstractUploader' => __DIR__ . '/..' . '/google/cloud-core/src/Upload/AbstractUploader.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Upload\\MultipartUploader' => __DIR__ . '/..' . '/google/cloud-core/src/Upload/MultipartUploader.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Upload\\ResumableUploader' => __DIR__ . '/..' . '/google/cloud-core/src/Upload/ResumableUploader.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Upload\\SignedUrlUploader' => __DIR__ . '/..' . '/google/cloud-core/src/Upload/SignedUrlUploader.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\Upload\\StreamableUploader' => __DIR__ . '/..' . '/google/cloud-core/src/Upload/StreamableUploader.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\UriTrait' => __DIR__ . '/..' . '/google/cloud-core/src/UriTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\ValidateTrait' => __DIR__ . '/..' . '/google/cloud-core/src/ValidateTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\ValueMapperTrait' => __DIR__ . '/..' . '/google/cloud-core/src/ValueMapperTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Core\\WhitelistTrait' => __DIR__ . '/..' . '/google/cloud-core/src/WhitelistTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Storage\\Acl' => __DIR__ . '/..' . '/google/cloud-storage/src/Acl.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Storage\\Bucket' => __DIR__ . '/..' . '/google/cloud-storage/src/Bucket.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Storage\\Connection\\ConnectionInterface' => __DIR__ . '/..' . '/google/cloud-storage/src/Connection/ConnectionInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Storage\\Connection\\IamBucket' => __DIR__ . '/..' . '/google/cloud-storage/src/Connection/IamBucket.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Storage\\Connection\\Rest' => __DIR__ . '/..' . '/google/cloud-storage/src/Connection/Rest.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Storage\\CreatedHmacKey' => __DIR__ . '/..' . '/google/cloud-storage/src/CreatedHmacKey.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Storage\\EncryptionTrait' => __DIR__ . '/..' . '/google/cloud-storage/src/EncryptionTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Storage\\HmacKey' => __DIR__ . '/..' . '/google/cloud-storage/src/HmacKey.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Storage\\Lifecycle' => __DIR__ . '/..' . '/google/cloud-storage/src/Lifecycle.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Storage\\Notification' => __DIR__ . '/..' . '/google/cloud-storage/src/Notification.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Storage\\ObjectIterator' => __DIR__ . '/..' . '/google/cloud-storage/src/ObjectIterator.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Storage\\ObjectPageIterator' => __DIR__ . '/..' . '/google/cloud-storage/src/ObjectPageIterator.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Storage\\ReadStream' => __DIR__ . '/..' . '/google/cloud-storage/src/ReadStream.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Storage\\SigningHelper' => __DIR__ . '/..' . '/google/cloud-storage/src/SigningHelper.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Storage\\StorageClient' => __DIR__ . '/..' . '/google/cloud-storage/src/StorageClient.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Storage\\StorageObject' => __DIR__ . '/..' . '/google/cloud-storage/src/StorageObject.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Storage\\StreamWrapper' => __DIR__ . '/..' . '/google/cloud-storage/src/StreamWrapper.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Cloud\\Storage\\WriteStream' => __DIR__ . '/..' . '/google/cloud-storage/src/WriteStream.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Client' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/Client.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\ClientInterface' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/ClientInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Cookie\\CookieJar' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/Cookie/CookieJar.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Cookie\\CookieJarInterface' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/Cookie/CookieJarInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Cookie\\FileCookieJar' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/Cookie/FileCookieJar.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Cookie\\SessionCookieJar' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/Cookie/SessionCookieJar.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Cookie\\SetCookie' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/Cookie/SetCookie.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Exception\\BadResponseException' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/Exception/BadResponseException.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Exception\\ClientException' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/Exception/ClientException.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Exception\\ConnectException' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/Exception/ConnectException.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Exception\\GuzzleException' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/Exception/GuzzleException.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Exception\\InvalidArgumentException' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/Exception/InvalidArgumentException.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Exception\\RequestException' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/Exception/RequestException.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Exception\\SeekException' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/Exception/SeekException.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Exception\\ServerException' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/Exception/ServerException.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Exception\\TooManyRedirectsException' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/Exception/TooManyRedirectsException.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Exception\\TransferException' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/Exception/TransferException.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\HandlerStack' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/HandlerStack.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Handler\\CurlFactory' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/Handler/CurlFactory.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Handler\\CurlFactoryInterface' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/Handler/CurlFactoryInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Handler\\CurlHandler' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/Handler/CurlHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Handler\\CurlMultiHandler' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Handler\\EasyHandle' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/Handler/EasyHandle.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Handler\\MockHandler' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/Handler/MockHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Handler\\Proxy' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/Handler/Proxy.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Handler\\StreamHandler' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/Handler/StreamHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\MessageFormatter' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/MessageFormatter.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Middleware' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/Middleware.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Pool' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/Pool.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\PrepareBodyMiddleware' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Promise\\AggregateException' => __DIR__ . '/..' . '/guzzlehttp/promises/src/AggregateException.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Promise\\CancellationException' => __DIR__ . '/..' . '/guzzlehttp/promises/src/CancellationException.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Promise\\Coroutine' => __DIR__ . '/..' . '/guzzlehttp/promises/src/Coroutine.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Promise\\EachPromise' => __DIR__ . '/..' . '/guzzlehttp/promises/src/EachPromise.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Promise\\FulfilledPromise' => __DIR__ . '/..' . '/guzzlehttp/promises/src/FulfilledPromise.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Promise\\Promise' => __DIR__ . '/..' . '/guzzlehttp/promises/src/Promise.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Promise\\PromiseInterface' => __DIR__ . '/..' . '/guzzlehttp/promises/src/PromiseInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Promise\\PromisorInterface' => __DIR__ . '/..' . '/guzzlehttp/promises/src/PromisorInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Promise\\RejectedPromise' => __DIR__ . '/..' . '/guzzlehttp/promises/src/RejectedPromise.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Promise\\RejectionException' => __DIR__ . '/..' . '/guzzlehttp/promises/src/RejectionException.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Promise\\TaskQueue' => __DIR__ . '/..' . '/guzzlehttp/promises/src/TaskQueue.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Promise\\TaskQueueInterface' => __DIR__ . '/..' . '/guzzlehttp/promises/src/TaskQueueInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Psr7\\AppendStream' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/AppendStream.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Psr7\\BufferStream' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/BufferStream.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Psr7\\CachingStream' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/CachingStream.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Psr7\\DroppingStream' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/DroppingStream.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Psr7\\FnStream' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/FnStream.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Psr7\\InflateStream' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/InflateStream.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Psr7\\LazyOpenStream' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/LazyOpenStream.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Psr7\\LimitStream' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/LimitStream.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Psr7\\MessageTrait' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/MessageTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Psr7\\MultipartStream' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/MultipartStream.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Psr7\\NoSeekStream' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/NoSeekStream.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Psr7\\PumpStream' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/PumpStream.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Psr7\\Request' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/Request.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Psr7\\Response' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/Response.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Psr7\\Rfc7230' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/Rfc7230.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Psr7\\ServerRequest' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/ServerRequest.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Psr7\\Stream' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/Stream.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Psr7\\StreamDecoratorTrait' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/StreamDecoratorTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Psr7\\StreamWrapper' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/StreamWrapper.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Psr7\\UploadedFile' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/UploadedFile.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Psr7\\Uri' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/Uri.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Psr7\\UriNormalizer' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/UriNormalizer.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Psr7\\UriResolver' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/UriResolver.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\RedirectMiddleware' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/RedirectMiddleware.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\RequestOptions' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/RequestOptions.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\RetryMiddleware' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/RetryMiddleware.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\TransferStats' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/TransferStats.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\UriTemplate' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/UriTemplate.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\ErrorHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/ErrorHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Formatter\\ChromePHPFormatter' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Formatter/ChromePHPFormatter.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Formatter\\ElasticaFormatter' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Formatter/ElasticaFormatter.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Formatter\\FlowdockFormatter' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Formatter/FlowdockFormatter.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Formatter\\FluentdFormatter' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Formatter/FluentdFormatter.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Formatter\\FormatterInterface' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Formatter/FormatterInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Formatter\\GelfMessageFormatter' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Formatter/GelfMessageFormatter.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Formatter\\HtmlFormatter' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Formatter/HtmlFormatter.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Formatter\\JsonFormatter' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Formatter/JsonFormatter.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Formatter\\LineFormatter' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Formatter/LineFormatter.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Formatter\\LogglyFormatter' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Formatter/LogglyFormatter.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Formatter\\LogstashFormatter' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Formatter/LogstashFormatter.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Formatter\\MongoDBFormatter' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Formatter/MongoDBFormatter.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Formatter\\NormalizerFormatter' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Formatter/NormalizerFormatter.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Formatter\\ScalarFormatter' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Formatter/ScalarFormatter.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Formatter\\WildfireFormatter' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Formatter/WildfireFormatter.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\AbstractHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/AbstractHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\AbstractProcessingHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/AbstractProcessingHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\AbstractSyslogHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/AbstractSyslogHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\AmqpHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/AmqpHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\BrowserConsoleHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/BrowserConsoleHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\BufferHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/BufferHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\ChromePHPHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/ChromePHPHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\CouchDBHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/CouchDBHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\CubeHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/CubeHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\Curl\\Util' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/Curl/Util.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\DeduplicationHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/DeduplicationHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\DoctrineCouchDBHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/DoctrineCouchDBHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\DynamoDbHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/DynamoDbHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\ElasticSearchHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/ElasticSearchHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\ErrorLogHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/ErrorLogHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\FilterHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/FilterHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\FingersCrossedHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/FingersCrossedHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\FingersCrossed\\ActivationStrategyInterface' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/FingersCrossed/ActivationStrategyInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\FingersCrossed\\ChannelLevelActivationStrategy' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/FingersCrossed/ChannelLevelActivationStrategy.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\FingersCrossed\\ErrorLevelActivationStrategy' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/FingersCrossed/ErrorLevelActivationStrategy.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\FirePHPHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/FirePHPHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\FleepHookHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/FleepHookHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\FlowdockHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/FlowdockHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\FormattableHandlerInterface' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/FormattableHandlerInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\FormattableHandlerTrait' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/FormattableHandlerTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\GelfHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/GelfHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\GroupHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/GroupHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\HandlerInterface' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/HandlerInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\HandlerWrapper' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/HandlerWrapper.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\HipChatHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/HipChatHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\IFTTTHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/IFTTTHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\InsightOpsHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/InsightOpsHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\LogEntriesHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/LogEntriesHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\LogglyHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/LogglyHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\MailHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/MailHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\MandrillHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/MandrillHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\MissingExtensionException' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/MissingExtensionException.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\MongoDBHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/MongoDBHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\NativeMailerHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/NativeMailerHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\NewRelicHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/NewRelicHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\NullHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/NullHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\PHPConsoleHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/PHPConsoleHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\ProcessableHandlerInterface' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/ProcessableHandlerInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\ProcessableHandlerTrait' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/ProcessableHandlerTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\PsrHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/PsrHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\PushoverHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/PushoverHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\RavenHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/RavenHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\RedisHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/RedisHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\RollbarHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/RollbarHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\RotatingFileHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/RotatingFileHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\SamplingHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/SamplingHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\SlackHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/SlackHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\SlackWebhookHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/SlackWebhookHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\Slack\\SlackRecord' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/Slack/SlackRecord.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\SlackbotHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/SlackbotHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\SocketHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/SocketHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\StreamHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/StreamHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\SwiftMailerHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/SwiftMailerHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\SyslogHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/SyslogHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\SyslogUdpHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/SyslogUdpHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\SyslogUdp\\UdpSocket' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/SyslogUdp/UdpSocket.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\TestHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/TestHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\WhatFailureGroupHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/WhatFailureGroupHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Handler\\ZendMonitorHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Handler/ZendMonitorHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Logger' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Logger.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Processor\\GitProcessor' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Processor/GitProcessor.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Processor\\IntrospectionProcessor' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Processor/IntrospectionProcessor.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Processor\\MemoryPeakUsageProcessor' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Processor/MemoryPeakUsageProcessor.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Processor\\MemoryProcessor' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Processor/MemoryProcessor.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Processor\\MemoryUsageProcessor' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Processor/MemoryUsageProcessor.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Processor\\MercurialProcessor' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Processor/MercurialProcessor.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Processor\\ProcessIdProcessor' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Processor/ProcessIdProcessor.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Processor\\ProcessorInterface' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Processor/ProcessorInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Processor\\PsrLogMessageProcessor' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Processor/PsrLogMessageProcessor.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Processor\\TagProcessor' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Processor/TagProcessor.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Processor\\UidProcessor' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Processor/UidProcessor.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Processor\\WebProcessor' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Processor/WebProcessor.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Registry' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Registry.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\ResettableInterface' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/ResettableInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\SignalHandler' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/SignalHandler.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Utils' => __DIR__ . '/..' . '/monolog/monolog/src/Monolog/Utils.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Psr\\Cache\\CacheException' => __DIR__ . '/..' . '/psr/cache/src/CacheException.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Psr\\Cache\\CacheItemInterface' => __DIR__ . '/..' . '/psr/cache/src/CacheItemInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Psr\\Cache\\CacheItemPoolInterface' => __DIR__ . '/..' . '/psr/cache/src/CacheItemPoolInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Psr\\Cache\\InvalidArgumentException' => __DIR__ . '/..' . '/psr/cache/src/InvalidArgumentException.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Psr\\Http\\Message\\MessageInterface' => __DIR__ . '/..' . '/psr/http-message/src/MessageInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Psr\\Http\\Message\\RequestInterface' => __DIR__ . '/..' . '/psr/http-message/src/RequestInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Psr\\Http\\Message\\ResponseInterface' => __DIR__ . '/..' . '/psr/http-message/src/ResponseInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Psr\\Http\\Message\\ServerRequestInterface' => __DIR__ . '/..' . '/psr/http-message/src/ServerRequestInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Psr\\Http\\Message\\StreamInterface' => __DIR__ . '/..' . '/psr/http-message/src/StreamInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Psr\\Http\\Message\\UploadedFileInterface' => __DIR__ . '/..' . '/psr/http-message/src/UploadedFileInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Psr\\Http\\Message\\UriInterface' => __DIR__ . '/..' . '/psr/http-message/src/UriInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Psr\\Log\\AbstractLogger' => __DIR__ . '/..' . '/psr/log/Psr/Log/AbstractLogger.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Psr\\Log\\InvalidArgumentException' => __DIR__ . '/..' . '/psr/log/Psr/Log/InvalidArgumentException.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Psr\\Log\\LogLevel' => __DIR__ . '/..' . '/psr/log/Psr/Log/LogLevel.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Psr\\Log\\LoggerAwareInterface' => __DIR__ . '/..' . '/psr/log/Psr/Log/LoggerAwareInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Psr\\Log\\LoggerAwareTrait' => __DIR__ . '/..' . '/psr/log/Psr/Log/LoggerAwareTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Psr\\Log\\LoggerInterface' => __DIR__ . '/..' . '/psr/log/Psr/Log/LoggerInterface.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Psr\\Log\\LoggerTrait' => __DIR__ . '/..' . '/psr/log/Psr/Log/LoggerTrait.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Psr\\Log\\NullLogger' => __DIR__ . '/..' . '/psr/log/Psr/Log/NullLogger.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Psr\\Log\\Test\\DummyTest' => __DIR__ . '/..' . '/psr/log/Psr/Log/Test/LoggerInterfaceTest.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Psr\\Log\\Test\\LoggerInterfaceTest' => __DIR__ . '/..' . '/psr/log/Psr/Log/Test/LoggerInterfaceTest.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Psr\\Log\\Test\\TestLogger' => __DIR__ . '/..' . '/psr/log/Psr/Log/Test/TestLogger.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Rize\\UriTemplate' => __DIR__ . '/..' . '/rize/uri-template/src/Rize/UriTemplate.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Rize\\UriTemplate\\Node\\Abstraction' => __DIR__ . '/..' . '/rize/uri-template/src/Rize/UriTemplate/Node/Abstraction.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Rize\\UriTemplate\\Node\\Expression' => __DIR__ . '/..' . '/rize/uri-template/src/Rize/UriTemplate/Node/Expression.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Rize\\UriTemplate\\Node\\Literal' => __DIR__ . '/..' . '/rize/uri-template/src/Rize/UriTemplate/Node/Literal.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Rize\\UriTemplate\\Node\\Variable' => __DIR__ . '/..' . '/rize/uri-template/src/Rize/UriTemplate/Node/Variable.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Rize\\UriTemplate\\Operator\\Abstraction' => __DIR__ . '/..' . '/rize/uri-template/src/Rize/UriTemplate/Operator/Abstraction.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Rize\\UriTemplate\\Operator\\Named' => __DIR__ . '/..' . '/rize/uri-template/src/Rize/UriTemplate/Operator/Named.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Rize\\UriTemplate\\Operator\\UnNamed' => __DIR__ . '/..' . '/rize/uri-template/src/Rize/UriTemplate/Operator/UnNamed.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Rize\\UriTemplate\\Parser' => __DIR__ . '/..' . '/rize/uri-template/src/Rize/UriTemplate/Parser.php', 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Rize\\UriTemplate\\UriTemplate' => __DIR__ . '/..' . '/rize/uri-template/src/Rize/UriTemplate/UriTemplate.php');
|
13 |
public static function getInitializer(\DeliciousBrains\WP_Offload_Media\Gcp\Composer\Autoload\ClassLoader $loader)
|
14 |
{
|
15 |
return \Closure::bind(function () use($loader) {
|
16 |
+
$loader->prefixLengthsPsr4 = ComposerStaticInitad2bbf672104326f33ebff61e2e8e9b8::$prefixLengthsPsr4;
|
17 |
+
$loader->prefixDirsPsr4 = ComposerStaticInitad2bbf672104326f33ebff61e2e8e9b8::$prefixDirsPsr4;
|
18 |
+
$loader->prefixesPsr0 = ComposerStaticInitad2bbf672104326f33ebff61e2e8e9b8::$prefixesPsr0;
|
19 |
+
$loader->classMap = ComposerStaticInitad2bbf672104326f33ebff61e2e8e9b8::$classMap;
|
20 |
}, null, \DeliciousBrains\WP_Offload_Media\Gcp\Composer\Autoload\ClassLoader::class);
|
21 |
}
|
22 |
}
|
@@ -49,17 +49,17 @@
|
|
49 |
},
|
50 |
{
|
51 |
"name": "google\/auth",
|
52 |
-
"version": "v1.
|
53 |
-
"version_normalized": "1.
|
54 |
"source": {
|
55 |
"type": "git",
|
56 |
"url": "https:\/\/github.com\/googleapis\/google-auth-library-php.git",
|
57 |
-
"reference": "
|
58 |
},
|
59 |
"dist": {
|
60 |
"type": "zip",
|
61 |
-
"url": "https:\/\/api.github.com\/repos\/googleapis\/google-auth-library-php\/zipball\/
|
62 |
-
"reference": "
|
63 |
"shasum": ""
|
64 |
},
|
65 |
"require": {
|
@@ -73,10 +73,14 @@
|
|
73 |
"require-dev": {
|
74 |
"friendsofphp\/php-cs-fixer": "^1.11",
|
75 |
"guzzlehttp\/promises": "0.1.1|^1.3",
|
|
|
76 |
"phpunit\/phpunit": "^4.8.36|^5.7",
|
77 |
"sebastian\/comparator": ">=1.2.3"
|
78 |
},
|
79 |
-
"
|
|
|
|
|
|
|
80 |
"type": "library",
|
81 |
"installation-source": "dist",
|
82 |
"autoload": {
|
@@ -98,32 +102,33 @@
|
|
98 |
},
|
99 |
{
|
100 |
"name": "google\/cloud-core",
|
101 |
-
"version": "v1.
|
102 |
-
"version_normalized": "1.
|
103 |
"source": {
|
104 |
"type": "git",
|
105 |
"url": "https:\/\/github.com\/googleapis\/google-cloud-php-core.git",
|
106 |
-
"reference": "
|
107 |
},
|
108 |
"dist": {
|
109 |
"type": "zip",
|
110 |
-
"url": "https:\/\/api.github.com\/repos\/googleapis\/google-cloud-php-core\/zipball\/
|
111 |
-
"reference": "
|
112 |
"shasum": ""
|
113 |
},
|
114 |
"require": {
|
115 |
-
"google\/auth": "^1.
|
116 |
"guzzlehttp\/guzzle": "^5.3|^6.0",
|
117 |
"guzzlehttp\/promises": "^1.3",
|
118 |
"guzzlehttp\/psr7": "^1.2",
|
119 |
-
"monolog\/monolog": "
|
120 |
"php": ">=5.5",
|
121 |
"psr\/http-message": "1.0.*",
|
122 |
"rize\/uri-template": "~0.3"
|
123 |
},
|
124 |
"require-dev": {
|
125 |
"erusev\/parsedown": "^1.6",
|
126 |
-
"google\/
|
|
|
127 |
"opis\/closure": "^3",
|
128 |
"phpdocumentor\/reflection": "^3.0",
|
129 |
"phpunit\/phpunit": "^4.8|^5.0",
|
@@ -133,7 +138,7 @@
|
|
133 |
"opis\/closure": "May be used to serialize closures to process jobs in the batch daemon. Please require version ^3.",
|
134 |
"symfony\/lock": "Required for the Spanner cached based session pool. Please require the following commit: 3.3.x-dev#1ba6ac9"
|
135 |
},
|
136 |
-
"time": "
|
137 |
"bin": [
|
138 |
"bin\/google-cloud-batch"
|
139 |
],
|
@@ -160,21 +165,22 @@
|
|
160 |
},
|
161 |
{
|
162 |
"name": "google\/cloud-storage",
|
163 |
-
"version": "v1.
|
164 |
-
"version_normalized": "1.
|
165 |
"source": {
|
166 |
"type": "git",
|
167 |
"url": "https:\/\/github.com\/googleapis\/google-cloud-php-storage.git",
|
168 |
-
"reference": "
|
169 |
},
|
170 |
"dist": {
|
171 |
"type": "zip",
|
172 |
-
"url": "https:\/\/api.github.com\/repos\/googleapis\/google-cloud-php-storage\/zipball\/
|
173 |
-
"reference": "
|
174 |
"shasum": ""
|
175 |
},
|
176 |
"require": {
|
177 |
-
"google\/cloud-core": "^1.
|
|
|
178 |
},
|
179 |
"require-dev": {
|
180 |
"erusev\/parsedown": "^1.6",
|
@@ -188,7 +194,7 @@
|
|
188 |
"google\/cloud-pubsub": "May be used to register a topic to receive bucket notifications.",
|
189 |
"phpseclib\/phpseclib": "May be used in place of OpenSSL for creating signed Cloud Storage URLs. Please require version ^2."
|
190 |
},
|
191 |
-
"time": "
|
192 |
"type": "library",
|
193 |
"extra": {
|
194 |
"component": {
|
@@ -210,35 +216,80 @@
|
|
210 |
],
|
211 |
"description": "Cloud Storage Client for PHP"
|
212 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
213 |
{
|
214 |
"name": "guzzlehttp\/guzzle",
|
215 |
-
"version": "6.
|
216 |
-
"version_normalized": "6.
|
217 |
"source": {
|
218 |
"type": "git",
|
219 |
"url": "https:\/\/github.com\/guzzle\/guzzle.git",
|
220 |
-
"reference": "
|
221 |
},
|
222 |
"dist": {
|
223 |
"type": "zip",
|
224 |
-
"url": "https:\/\/api.github.com\/repos\/guzzle\/guzzle\/zipball\/
|
225 |
-
"reference": "
|
226 |
"shasum": ""
|
227 |
},
|
228 |
"require": {
|
|
|
229 |
"guzzlehttp\/promises": "^1.0",
|
230 |
-
"guzzlehttp\/psr7": "^1.
|
231 |
"php": ">=5.5"
|
232 |
},
|
233 |
"require-dev": {
|
234 |
"ext-curl": "*",
|
235 |
"phpunit\/phpunit": "^4.8.35 || ^5.7 || ^6.4 || ^7.0",
|
236 |
-
"psr\/log": "^1.
|
237 |
},
|
238 |
"suggest": {
|
239 |
"psr\/log": "Required for using the Log middleware"
|
240 |
},
|
241 |
-
"time": "
|
242 |
"type": "library",
|
243 |
"extra": {
|
244 |
"branch-alias": {
|
@@ -247,12 +298,12 @@
|
|
247 |
},
|
248 |
"installation-source": "dist",
|
249 |
"autoload": {
|
250 |
-
"files": [
|
251 |
-
"src\/functions_include.php"
|
252 |
-
],
|
253 |
"psr-4": {
|
254 |
"DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\": "src\/"
|
255 |
-
}
|
|
|
|
|
|
|
256 |
},
|
257 |
"notification-url": "https:\/\/packagist.org\/downloads\/",
|
258 |
"license": [
|
@@ -332,35 +383,39 @@
|
|
332 |
},
|
333 |
{
|
334 |
"name": "guzzlehttp\/psr7",
|
335 |
-
"version": "1.
|
336 |
-
"version_normalized": "1.
|
337 |
"source": {
|
338 |
"type": "git",
|
339 |
"url": "https:\/\/github.com\/guzzle\/psr7.git",
|
340 |
-
"reference": "
|
341 |
},
|
342 |
"dist": {
|
343 |
"type": "zip",
|
344 |
-
"url": "https:\/\/api.github.com\/repos\/guzzle\/psr7\/zipball\/
|
345 |
-
"reference": "
|
346 |
"shasum": ""
|
347 |
},
|
348 |
"require": {
|
349 |
"php": ">=5.4.0",
|
350 |
"psr\/http-message": "~1.0",
|
351 |
-
"ralouphie\/getallheaders": "^2.0.5"
|
352 |
},
|
353 |
"provide": {
|
354 |
"psr\/http-message-implementation": "1.0"
|
355 |
},
|
356 |
"require-dev": {
|
|
|
357 |
"phpunit\/phpunit": "~4.8.36 || ^5.7.27 || ^6.5.8"
|
358 |
},
|
359 |
-
"
|
|
|
|
|
|
|
360 |
"type": "library",
|
361 |
"extra": {
|
362 |
"branch-alias": {
|
363 |
-
"dev-master": "1.
|
364 |
}
|
365 |
},
|
366 |
"installation-source": "dist",
|
@@ -401,17 +456,17 @@
|
|
401 |
},
|
402 |
{
|
403 |
"name": "monolog\/monolog",
|
404 |
-
"version": "1.
|
405 |
-
"version_normalized": "1.
|
406 |
"source": {
|
407 |
"type": "git",
|
408 |
"url": "https:\/\/github.com\/Seldaek\/monolog.git",
|
409 |
-
"reference": "
|
410 |
},
|
411 |
"dist": {
|
412 |
"type": "zip",
|
413 |
-
"url": "https:\/\/api.github.com\/repos\/Seldaek\/monolog\/zipball\/
|
414 |
-
"reference": "
|
415 |
"shasum": ""
|
416 |
},
|
417 |
"require": {
|
@@ -447,7 +502,7 @@
|
|
447 |
"ruflin\/elastica": "Allow sending log messages to an Elastic Search server",
|
448 |
"sentry\/sentry": "Allow sending log messages to a Sentry server"
|
449 |
},
|
450 |
-
"time": "
|
451 |
"type": "library",
|
452 |
"extra": {
|
453 |
"branch-alias": {
|
@@ -581,27 +636,27 @@
|
|
581 |
},
|
582 |
{
|
583 |
"name": "psr\/log",
|
584 |
-
"version": "1.1.
|
585 |
-
"version_normalized": "1.1.
|
586 |
"source": {
|
587 |
"type": "git",
|
588 |
"url": "https:\/\/github.com\/php-fig\/log.git",
|
589 |
-
"reference": "
|
590 |
},
|
591 |
"dist": {
|
592 |
"type": "zip",
|
593 |
-
"url": "https:\/\/api.github.com\/repos\/php-fig\/log\/zipball\/
|
594 |
-
"reference": "
|
595 |
"shasum": ""
|
596 |
},
|
597 |
"require": {
|
598 |
"php": ">=5.3.0"
|
599 |
},
|
600 |
-
"time": "
|
601 |
"type": "library",
|
602 |
"extra": {
|
603 |
"branch-alias": {
|
604 |
-
"dev-master": "1.
|
605 |
}
|
606 |
},
|
607 |
"installation-source": "dist",
|
@@ -630,27 +685,27 @@
|
|
630 |
},
|
631 |
{
|
632 |
"name": "ralouphie\/getallheaders",
|
633 |
-
"version": "
|
634 |
-
"version_normalized": "
|
635 |
"source": {
|
636 |
"type": "git",
|
637 |
"url": "https:\/\/github.com\/ralouphie\/getallheaders.git",
|
638 |
-
"reference": "
|
639 |
},
|
640 |
"dist": {
|
641 |
"type": "zip",
|
642 |
-
"url": "https:\/\/api.github.com\/repos\/ralouphie\/getallheaders\/zipball\/
|
643 |
-
"reference": "
|
644 |
"shasum": ""
|
645 |
},
|
646 |
"require": {
|
647 |
-
"php": ">=5.
|
648 |
},
|
649 |
"require-dev": {
|
650 |
-
"
|
651 |
-
"
|
652 |
},
|
653 |
-
"time": "
|
654 |
"type": "library",
|
655 |
"installation-source": "dist",
|
656 |
"autoload": {
|
49 |
},
|
50 |
{
|
51 |
"name": "google\/auth",
|
52 |
+
"version": "v1.6.1",
|
53 |
+
"version_normalized": "1.6.1.0",
|
54 |
"source": {
|
55 |
"type": "git",
|
56 |
"url": "https:\/\/github.com\/googleapis\/google-auth-library-php.git",
|
57 |
+
"reference": "45635ac69d0b95f38885531d4ebcdfcb2ebb6f36"
|
58 |
},
|
59 |
"dist": {
|
60 |
"type": "zip",
|
61 |
+
"url": "https:\/\/api.github.com\/repos\/googleapis\/google-auth-library-php\/zipball\/45635ac69d0b95f38885531d4ebcdfcb2ebb6f36",
|
62 |
+
"reference": "45635ac69d0b95f38885531d4ebcdfcb2ebb6f36",
|
63 |
"shasum": ""
|
64 |
},
|
65 |
"require": {
|
73 |
"require-dev": {
|
74 |
"friendsofphp\/php-cs-fixer": "^1.11",
|
75 |
"guzzlehttp\/promises": "0.1.1|^1.3",
|
76 |
+
"phpseclib\/phpseclib": "^2",
|
77 |
"phpunit\/phpunit": "^4.8.36|^5.7",
|
78 |
"sebastian\/comparator": ">=1.2.3"
|
79 |
},
|
80 |
+
"suggest": {
|
81 |
+
"phpseclib\/phpseclib": "May be used in place of OpenSSL for signing strings or for token management. Please require version ^2."
|
82 |
+
},
|
83 |
+
"time": "2019-10-29T20:13:04+00:00",
|
84 |
"type": "library",
|
85 |
"installation-source": "dist",
|
86 |
"autoload": {
|
102 |
},
|
103 |
{
|
104 |
"name": "google\/cloud-core",
|
105 |
+
"version": "v1.34.0",
|
106 |
+
"version_normalized": "1.34.0.0",
|
107 |
"source": {
|
108 |
"type": "git",
|
109 |
"url": "https:\/\/github.com\/googleapis\/google-cloud-php-core.git",
|
110 |
+
"reference": "52db21acb2da25d2d79e493842de58da7836c97f"
|
111 |
},
|
112 |
"dist": {
|
113 |
"type": "zip",
|
114 |
+
"url": "https:\/\/api.github.com\/repos\/googleapis\/google-cloud-php-core\/zipball\/52db21acb2da25d2d79e493842de58da7836c97f",
|
115 |
+
"reference": "52db21acb2da25d2d79e493842de58da7836c97f",
|
116 |
"shasum": ""
|
117 |
},
|
118 |
"require": {
|
119 |
+
"google\/auth": "^1.6",
|
120 |
"guzzlehttp\/guzzle": "^5.3|^6.0",
|
121 |
"guzzlehttp\/promises": "^1.3",
|
122 |
"guzzlehttp\/psr7": "^1.2",
|
123 |
+
"monolog\/monolog": "^1.1|^2.0",
|
124 |
"php": ">=5.5",
|
125 |
"psr\/http-message": "1.0.*",
|
126 |
"rize\/uri-template": "~0.3"
|
127 |
},
|
128 |
"require-dev": {
|
129 |
"erusev\/parsedown": "^1.6",
|
130 |
+
"google\/common-protos": "^1.0",
|
131 |
+
"google\/gax": "^1.1",
|
132 |
"opis\/closure": "^3",
|
133 |
"phpdocumentor\/reflection": "^3.0",
|
134 |
"phpunit\/phpunit": "^4.8|^5.0",
|
138 |
"opis\/closure": "May be used to serialize closures to process jobs in the batch daemon. Please require version ^3.",
|
139 |
"symfony\/lock": "Required for the Spanner cached based session pool. Please require the following commit: 3.3.x-dev#1ba6ac9"
|
140 |
},
|
141 |
+
"time": "2019-10-28T19:05:44+00:00",
|
142 |
"bin": [
|
143 |
"bin\/google-cloud-batch"
|
144 |
],
|
165 |
},
|
166 |
{
|
167 |
"name": "google\/cloud-storage",
|
168 |
+
"version": "v1.16.0",
|
169 |
+
"version_normalized": "1.16.0.0",
|
170 |
"source": {
|
171 |
"type": "git",
|
172 |
"url": "https:\/\/github.com\/googleapis\/google-cloud-php-storage.git",
|
173 |
+
"reference": "308ad790b257286e02777e3bf1a2c0473a4651a7"
|
174 |
},
|
175 |
"dist": {
|
176 |
"type": "zip",
|
177 |
+
"url": "https:\/\/api.github.com\/repos\/googleapis\/google-cloud-php-storage\/zipball\/308ad790b257286e02777e3bf1a2c0473a4651a7",
|
178 |
+
"reference": "308ad790b257286e02777e3bf1a2c0473a4651a7",
|
179 |
"shasum": ""
|
180 |
},
|
181 |
"require": {
|
182 |
+
"google\/cloud-core": "^1.31",
|
183 |
+
"google\/crc32": "^0.1.0"
|
184 |
},
|
185 |
"require-dev": {
|
186 |
"erusev\/parsedown": "^1.6",
|
194 |
"google\/cloud-pubsub": "May be used to register a topic to receive bucket notifications.",
|
195 |
"phpseclib\/phpseclib": "May be used in place of OpenSSL for creating signed Cloud Storage URLs. Please require version ^2."
|
196 |
},
|
197 |
+
"time": "2019-11-12T23:35:42+00:00",
|
198 |
"type": "library",
|
199 |
"extra": {
|
200 |
"component": {
|
216 |
],
|
217 |
"description": "Cloud Storage Client for PHP"
|
218 |
},
|
219 |
+
{
|
220 |
+
"name": "google\/crc32",
|
221 |
+
"version": "v0.1.0",
|
222 |
+
"version_normalized": "0.1.0.0",
|
223 |
+
"source": {
|
224 |
+
"type": "git",
|
225 |
+
"url": "https:\/\/github.com\/google\/php-crc32.git",
|
226 |
+
"reference": "a8525f0dea6fca1893e1bae2f6e804c5f7d007fb"
|
227 |
+
},
|
228 |
+
"dist": {
|
229 |
+
"type": "zip",
|
230 |
+
"url": "https:\/\/api.github.com\/repos\/google\/php-crc32\/zipball\/a8525f0dea6fca1893e1bae2f6e804c5f7d007fb",
|
231 |
+
"reference": "a8525f0dea6fca1893e1bae2f6e804c5f7d007fb",
|
232 |
+
"shasum": ""
|
233 |
+
},
|
234 |
+
"require": {
|
235 |
+
"php": ">=5.4"
|
236 |
+
},
|
237 |
+
"require-dev": {
|
238 |
+
"friendsofphp\/php-cs-fixer": "^1.13 || v2.14.2",
|
239 |
+
"paragonie\/random_compat": ">=2",
|
240 |
+
"phpunit\/phpunit": "^4"
|
241 |
+
},
|
242 |
+
"time": "2019-05-09T06:24:58+00:00",
|
243 |
+
"type": "library",
|
244 |
+
"installation-source": "dist",
|
245 |
+
"autoload": {
|
246 |
+
"psr-4": {
|
247 |
+
"DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\CRC32\\": "src"
|
248 |
+
}
|
249 |
+
},
|
250 |
+
"notification-url": "https:\/\/packagist.org\/downloads\/",
|
251 |
+
"license": [
|
252 |
+
"Apache-2.0"
|
253 |
+
],
|
254 |
+
"authors": [
|
255 |
+
{
|
256 |
+
"name": "Andrew Brampton",
|
257 |
+
"email": "bramp@google.com"
|
258 |
+
}
|
259 |
+
],
|
260 |
+
"description": "Various CRC32 implementations",
|
261 |
+
"homepage": "https:\/\/github.com\/google\/php-crc32"
|
262 |
+
},
|
263 |
{
|
264 |
"name": "guzzlehttp\/guzzle",
|
265 |
+
"version": "6.4.1",
|
266 |
+
"version_normalized": "6.4.1.0",
|
267 |
"source": {
|
268 |
"type": "git",
|
269 |
"url": "https:\/\/github.com\/guzzle\/guzzle.git",
|
270 |
+
"reference": "0895c932405407fd3a7368b6910c09a24d26db11"
|
271 |
},
|
272 |
"dist": {
|
273 |
"type": "zip",
|
274 |
+
"url": "https:\/\/api.github.com\/repos\/guzzle\/guzzle\/zipball\/0895c932405407fd3a7368b6910c09a24d26db11",
|
275 |
+
"reference": "0895c932405407fd3a7368b6910c09a24d26db11",
|
276 |
"shasum": ""
|
277 |
},
|
278 |
"require": {
|
279 |
+
"ext-json": "*",
|
280 |
"guzzlehttp\/promises": "^1.0",
|
281 |
+
"guzzlehttp\/psr7": "^1.6.1",
|
282 |
"php": ">=5.5"
|
283 |
},
|
284 |
"require-dev": {
|
285 |
"ext-curl": "*",
|
286 |
"phpunit\/phpunit": "^4.8.35 || ^5.7 || ^6.4 || ^7.0",
|
287 |
+
"psr\/log": "^1.1"
|
288 |
},
|
289 |
"suggest": {
|
290 |
"psr\/log": "Required for using the Log middleware"
|
291 |
},
|
292 |
+
"time": "2019-10-23T15:58:00+00:00",
|
293 |
"type": "library",
|
294 |
"extra": {
|
295 |
"branch-alias": {
|
298 |
},
|
299 |
"installation-source": "dist",
|
300 |
"autoload": {
|
|
|
|
|
|
|
301 |
"psr-4": {
|
302 |
"DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\": "src\/"
|
303 |
+
},
|
304 |
+
"files": [
|
305 |
+
"src\/functions_include.php"
|
306 |
+
]
|
307 |
},
|
308 |
"notification-url": "https:\/\/packagist.org\/downloads\/",
|
309 |
"license": [
|
383 |
},
|
384 |
{
|
385 |
"name": "guzzlehttp\/psr7",
|
386 |
+
"version": "1.6.1",
|
387 |
+
"version_normalized": "1.6.1.0",
|
388 |
"source": {
|
389 |
"type": "git",
|
390 |
"url": "https:\/\/github.com\/guzzle\/psr7.git",
|
391 |
+
"reference": "239400de7a173fe9901b9ac7c06497751f00727a"
|
392 |
},
|
393 |
"dist": {
|
394 |
"type": "zip",
|
395 |
+
"url": "https:\/\/api.github.com\/repos\/guzzle\/psr7\/zipball\/239400de7a173fe9901b9ac7c06497751f00727a",
|
396 |
+
"reference": "239400de7a173fe9901b9ac7c06497751f00727a",
|
397 |
"shasum": ""
|
398 |
},
|
399 |
"require": {
|
400 |
"php": ">=5.4.0",
|
401 |
"psr\/http-message": "~1.0",
|
402 |
+
"ralouphie\/getallheaders": "^2.0.5 || ^3.0.0"
|
403 |
},
|
404 |
"provide": {
|
405 |
"psr\/http-message-implementation": "1.0"
|
406 |
},
|
407 |
"require-dev": {
|
408 |
+
"ext-zlib": "*",
|
409 |
"phpunit\/phpunit": "~4.8.36 || ^5.7.27 || ^6.5.8"
|
410 |
},
|
411 |
+
"suggest": {
|
412 |
+
"zendframework\/zend-httphandlerrunner": "Emit PSR-7 responses"
|
413 |
+
},
|
414 |
+
"time": "2019-07-01T23:21:34+00:00",
|
415 |
"type": "library",
|
416 |
"extra": {
|
417 |
"branch-alias": {
|
418 |
+
"dev-master": "1.6-dev"
|
419 |
}
|
420 |
},
|
421 |
"installation-source": "dist",
|
456 |
},
|
457 |
{
|
458 |
"name": "monolog\/monolog",
|
459 |
+
"version": "1.25.2",
|
460 |
+
"version_normalized": "1.25.2.0",
|
461 |
"source": {
|
462 |
"type": "git",
|
463 |
"url": "https:\/\/github.com\/Seldaek\/monolog.git",
|
464 |
+
"reference": "d5e2fb341cb44f7e2ab639d12a1e5901091ec287"
|
465 |
},
|
466 |
"dist": {
|
467 |
"type": "zip",
|
468 |
+
"url": "https:\/\/api.github.com\/repos\/Seldaek\/monolog\/zipball\/d5e2fb341cb44f7e2ab639d12a1e5901091ec287",
|
469 |
+
"reference": "d5e2fb341cb44f7e2ab639d12a1e5901091ec287",
|
470 |
"shasum": ""
|
471 |
},
|
472 |
"require": {
|
502 |
"ruflin\/elastica": "Allow sending log messages to an Elastic Search server",
|
503 |
"sentry\/sentry": "Allow sending log messages to a Sentry server"
|
504 |
},
|
505 |
+
"time": "2019-11-13T10:00:05+00:00",
|
506 |
"type": "library",
|
507 |
"extra": {
|
508 |
"branch-alias": {
|
636 |
},
|
637 |
{
|
638 |
"name": "psr\/log",
|
639 |
+
"version": "1.1.2",
|
640 |
+
"version_normalized": "1.1.2.0",
|
641 |
"source": {
|
642 |
"type": "git",
|
643 |
"url": "https:\/\/github.com\/php-fig\/log.git",
|
644 |
+
"reference": "446d54b4cb6bf489fc9d75f55843658e6f25d801"
|
645 |
},
|
646 |
"dist": {
|
647 |
"type": "zip",
|
648 |
+
"url": "https:\/\/api.github.com\/repos\/php-fig\/log\/zipball\/446d54b4cb6bf489fc9d75f55843658e6f25d801",
|
649 |
+
"reference": "446d54b4cb6bf489fc9d75f55843658e6f25d801",
|
650 |
"shasum": ""
|
651 |
},
|
652 |
"require": {
|
653 |
"php": ">=5.3.0"
|
654 |
},
|
655 |
+
"time": "2019-11-01T11:05:21+00:00",
|
656 |
"type": "library",
|
657 |
"extra": {
|
658 |
"branch-alias": {
|
659 |
+
"dev-master": "1.1.x-dev"
|
660 |
}
|
661 |
},
|
662 |
"installation-source": "dist",
|
685 |
},
|
686 |
{
|
687 |
"name": "ralouphie\/getallheaders",
|
688 |
+
"version": "3.0.3",
|
689 |
+
"version_normalized": "3.0.3.0",
|
690 |
"source": {
|
691 |
"type": "git",
|
692 |
"url": "https:\/\/github.com\/ralouphie\/getallheaders.git",
|
693 |
+
"reference": "120b605dfeb996808c31b6477290a714d356e822"
|
694 |
},
|
695 |
"dist": {
|
696 |
"type": "zip",
|
697 |
+
"url": "https:\/\/api.github.com\/repos\/ralouphie\/getallheaders\/zipball\/120b605dfeb996808c31b6477290a714d356e822",
|
698 |
+
"reference": "120b605dfeb996808c31b6477290a714d356e822",
|
699 |
"shasum": ""
|
700 |
},
|
701 |
"require": {
|
702 |
+
"php": ">=5.6"
|
703 |
},
|
704 |
"require-dev": {
|
705 |
+
"php-coveralls\/php-coveralls": "^2.1",
|
706 |
+
"phpunit\/phpunit": "^5 || ^6.5"
|
707 |
},
|
708 |
+
"time": "2019-03-08T08:55:37+00:00",
|
709 |
"type": "library",
|
710 |
"installation-source": "dist",
|
711 |
"autoload": {
|
@@ -1,3 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
## 1.4.0 (09/17/2018)
|
2 |
|
3 |
### Changes
|
1 |
+
## 1.6.1 (10/29/2019)
|
2 |
+
|
3 |
+
* [fix] Handle DST correctly for cache item expirations. (#246)
|
4 |
+
|
5 |
+
## 1.6.0 (10/01/2019)
|
6 |
+
|
7 |
+
* [feat] Add utility for verifying and revoking access tokens. (#243)
|
8 |
+
* [docs] Fix README console terminology. (#242)
|
9 |
+
* [feat] Support custom scopes with GCECredentials. (#239)
|
10 |
+
* [fix] Fix phpseclib existence check. (#237)
|
11 |
+
|
12 |
+
## 1.5.2 (07/22/2019)
|
13 |
+
|
14 |
+
* [fix] Move loadItems call out of `SysVCacheItemPool` constructor. (#229)
|
15 |
+
* [fix] Add `Metadata-Flavor` header to initial GCE metadata call. (#232)
|
16 |
+
|
17 |
+
## 1.5.1 (04/16/2019)
|
18 |
+
|
19 |
+
* [fix] Moved `getClientName()` from `Google\Auth\FetchAuthTokenInterface`
|
20 |
+
to `Google\Auth\SignBlobInterface`, and removed `getClientName()` from
|
21 |
+
`InsecureCredentials` and `UserRefreshCredentials`. (#223)
|
22 |
+
|
23 |
+
## 1.5.0 (04/15/2019)
|
24 |
+
|
25 |
+
### Changes
|
26 |
+
|
27 |
+
* Add support for signing strings with a Credentials instance. (#221)
|
28 |
+
* [Docs] Describe the arrays returned by fetchAuthToken. (#216)
|
29 |
+
* [Testing] Fix failing tests (#217)
|
30 |
+
* Update GitHub issue templates (#214, #213)
|
31 |
+
|
32 |
## 1.4.0 (09/17/2018)
|
33 |
|
34 |
### Changes
|
@@ -1,73 +0,0 @@
|
|
1 |
-
# How to become a contributor and submit your own code
|
2 |
-
|
3 |
-
## Contributor License Agreements
|
4 |
-
|
5 |
-
We'd love to accept your sample apps and patches! Before we can take them, we
|
6 |
-
have to jump a couple of legal hurdles.
|
7 |
-
|
8 |
-
Please fill out either the individual or corporate Contributor License Agreement
|
9 |
-
(CLA).
|
10 |
-
|
11 |
-
* If you are an individual writing original source code and you're sure you
|
12 |
-
own the intellectual property, then you'll need to sign an [individual CLA]
|
13 |
-
(http://code.google.com/legal/individual-cla-v1.0.html).
|
14 |
-
* If you work for a company that wants to allow you to contribute your work,
|
15 |
-
then you'll need to sign a [corporate CLA]
|
16 |
-
(http://code.google.com/legal/corporate-cla-v1.0.html).
|
17 |
-
|
18 |
-
Follow either of the two links above to access the appropriate CLA and
|
19 |
-
instructions for how to sign and return it. Once we receive it, we'll be able to
|
20 |
-
accept your pull requests.
|
21 |
-
|
22 |
-
## Issue reporting
|
23 |
-
|
24 |
-
* Check that the issue has not already been reported.
|
25 |
-
* Check that the issue has not already been fixed in the latest code
|
26 |
-
(a.k.a. `master`).
|
27 |
-
* Be clear, concise and precise in your description of the problem.
|
28 |
-
* Open an issue with a descriptive title and a summary in grammatically correct,
|
29 |
-
complete sentences.
|
30 |
-
* Include any relevant code to the issue summary.
|
31 |
-
|
32 |
-
## Pull requests
|
33 |
-
|
34 |
-
* Read [how to properly contribute to open source projects on Github][2].
|
35 |
-
* Fork the project.
|
36 |
-
* Use a topic/feature branch to easily amend a pull request later, if necessary.
|
37 |
-
* Write [good commit messages][3].
|
38 |
-
* Use the same coding conventions as the rest of the project.
|
39 |
-
* Commit and push until you are happy with your contribution.
|
40 |
-
* Make sure to add tests for it. This is important so I don't break it
|
41 |
-
in a future version unintentionally.
|
42 |
-
* Add an entry to the [Changelog](CHANGELOG.md) accordingly. See [changelog entry format](#changelog-entry-format).
|
43 |
-
* Please try not to mess with the Rakefile, version, or history. If you want to
|
44 |
-
have your own version, or is otherwise necessary, that is fine, but please
|
45 |
-
isolate to its own commit so I can cherry-pick around it.
|
46 |
-
* Make sure the test suite is passing and the code you wrote doesn't produce
|
47 |
-
phpunit or phplint offenses.
|
48 |
-
* [Squash related commits together][5].
|
49 |
-
* Open a [pull request][4] that relates to *only* one subject with a clear title
|
50 |
-
and description in grammatically correct, complete sentences.
|
51 |
-
|
52 |
-
### Changelog entry format
|
53 |
-
|
54 |
-
Here are a few examples:
|
55 |
-
|
56 |
-
```
|
57 |
-
* ADC Support for User Refresh Tokens (@tbetbetbe[])
|
58 |
-
* [#16](https://github.com/google/google-auth-library-php/issues/16): ADC Support for User Refresh Tokens ([@tbetbetbe][])
|
59 |
-
```
|
60 |
-
|
61 |
-
* Mark it up in [Markdown syntax][6].
|
62 |
-
* The entry line should start with `* ` (an asterisk and a space).
|
63 |
-
* If the change has a related GitHub issue (e.g. a bug fix for a reported issue), put a link to the issue as `[#16](https://github.com/google/google-auth-library-php/issues/16): `.
|
64 |
-
* Describe the brief of the change. The sentence should end with a punctuation.
|
65 |
-
* At the end of the entry, add an implicit link to your GitHub user page as `([@username][])`.
|
66 |
-
* If this is your first contribution to google-auth-library-php project, add a link definition for the implicit link to the bottom of the changelog as `[@username]: https://github.com/username`.
|
67 |
-
|
68 |
-
[1]: https://github.com/google/google-auth-php-library/issues
|
69 |
-
[2]: http://gun.io/blog/how-to-github-fork-branch-and-pull-request
|
70 |
-
[3]: http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html
|
71 |
-
[4]: https://help.github.com/articles/using-pull-requests
|
72 |
-
[5]: http://gitready.com/advanced/2009/02/10/squashing-commits-with-rebase.html
|
73 |
-
[6]: http://daringfireball.net/projects/markdown/syntax
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -47,7 +47,7 @@ you're building an application that uses Google Compute Engine.
|
|
47 |
#### Download your Service Account Credentials JSON file
|
48 |
|
49 |
To use `Application Default Credentials`, You first need to download a set of
|
50 |
-
JSON credentials for your project. Go to **APIs &
|
51 |
the [Google Developers Console][developer console] and select
|
52 |
**Service account** from the **Add credentials** dropdown.
|
53 |
|
@@ -143,7 +143,7 @@ about the client or APIs on [StackOverflow](http://stackoverflow.com).
|
|
143 |
|
144 |
[google-apis-php-client]: https://github.com/google/google-api-php-client
|
145 |
[application default credentials]: https://developers.google.com/accounts/docs/application-default-credentials
|
146 |
-
[contributing]: https://github.com/google/google-auth-library-php/tree/master/CONTRIBUTING.md
|
147 |
[copying]: https://github.com/google/google-auth-library-php/tree/master/COPYING
|
148 |
[Guzzle]: https://github.com/guzzle/guzzle
|
149 |
[Guzzle 5]: http://docs.guzzlephp.org/en/5.3
|
47 |
#### Download your Service Account Credentials JSON file
|
48 |
|
49 |
To use `Application Default Credentials`, You first need to download a set of
|
50 |
+
JSON credentials for your project. Go to **APIs & Services** > **Credentials** in
|
51 |
the [Google Developers Console][developer console] and select
|
52 |
**Service account** from the **Add credentials** dropdown.
|
53 |
|
143 |
|
144 |
[google-apis-php-client]: https://github.com/google/google-api-php-client
|
145 |
[application default credentials]: https://developers.google.com/accounts/docs/application-default-credentials
|
146 |
+
[contributing]: https://github.com/google/google-auth-library-php/tree/master/.github/CONTRIBUTING.md
|
147 |
[copying]: https://github.com/google/google-auth-library-php/tree/master/COPYING
|
148 |
[Guzzle]: https://github.com/guzzle/guzzle
|
149 |
[Guzzle 5]: http://docs.guzzlephp.org/en/5.3
|
@@ -21,7 +21,11 @@
|
|
21 |
"guzzlehttp\/promises": "0.1.1|^1.3",
|
22 |
"friendsofphp\/php-cs-fixer": "^1.11",
|
23 |
"phpunit\/phpunit": "^4.8.36|^5.7",
|
24 |
-
"sebastian\/comparator": ">=1.2.3"
|
|
|
|
|
|
|
|
|
25 |
},
|
26 |
"autoload": {
|
27 |
"psr-4": {
|
21 |
"guzzlehttp\/promises": "0.1.1|^1.3",
|
22 |
"friendsofphp\/php-cs-fixer": "^1.11",
|
23 |
"phpunit\/phpunit": "^4.8.36|^5.7",
|
24 |
+
"sebastian\/comparator": ">=1.2.3",
|
25 |
+
"phpseclib\/phpseclib": "^2"
|
26 |
+
},
|
27 |
+
"suggest": {
|
28 |
+
"phpseclib\/phpseclib": "May be used in place of OpenSSL for signing strings or for token management. Please require version ^2."
|
29 |
},
|
30 |
"autoload": {
|
31 |
"psr-4": {
|
@@ -1,19 +0,0 @@
|
|
1 |
-
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
-
<phpunit bootstrap="tests/bootstrap.php" colors="true">
|
3 |
-
<php>
|
4 |
-
<env name="SUPPRESS_GCLOUD_CREDS_WARNING" value="true" force="true"/>
|
5 |
-
</php>
|
6 |
-
<testsuites>
|
7 |
-
<testsuite name="google-auth-tests">
|
8 |
-
<directory suffix="Test.php">tests</directory>
|
9 |
-
</testsuite>
|
10 |
-
</testsuites>
|
11 |
-
<filter>
|
12 |
-
<whitelist>
|
13 |
-
<directory suffix=".php">src</directory>
|
14 |
-
<exclude>
|
15 |
-
<directory suffix="Interface.php">src/</directory>
|
16 |
-
</exclude>
|
17 |
-
</whitelist>
|
18 |
-
</filter>
|
19 |
-
</phpunit>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -0,0 +1,253 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* Copyright 2019 Google LLC
|
5 |
+
*
|
6 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
7 |
+
* you may not use this file except in compliance with the License.
|
8 |
+
* You may obtain a copy of the License at
|
9 |
+
*
|
10 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
11 |
+
*
|
12 |
+
* Unless required by applicable law or agreed to in writing, software
|
13 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
14 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
15 |
+
* See the License for the specific language governing permissions and
|
16 |
+
* limitations under the License.
|
17 |
+
*/
|
18 |
+
namespace DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth;
|
19 |
+
|
20 |
+
use DeliciousBrains\WP_Offload_Media\Gcp\Firebase\JWT\ExpiredException;
|
21 |
+
use DeliciousBrains\WP_Offload_Media\Gcp\Firebase\JWT\JWT;
|
22 |
+
use DeliciousBrains\WP_Offload_Media\Gcp\Firebase\JWT\SignatureInvalidException;
|
23 |
+
use DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth\Cache\MemoryCacheItemPool;
|
24 |
+
use DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth\HttpHandler\HttpClientCache;
|
25 |
+
use DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth\HttpHandler\HttpHandlerFactory;
|
26 |
+
use DeliciousBrains\WP_Offload_Media\Gcp\GuzzleHttp\Psr7;
|
27 |
+
use DeliciousBrains\WP_Offload_Media\Gcp\GuzzleHttp\Psr7\Request;
|
28 |
+
use DeliciousBrains\WP_Offload_Media\Gcp\phpseclib\Crypt\RSA;
|
29 |
+
use DeliciousBrains\WP_Offload_Media\Gcp\phpseclib\Math\BigInteger;
|
30 |
+
use DeliciousBrains\WP_Offload_Media\Gcp\Psr\Cache\CacheItemPoolInterface;
|
31 |
+
/**
|
32 |
+
* Wrapper around Google Access Tokens which provides convenience functions.
|
33 |
+
*
|
34 |
+
* @experimental
|
35 |
+
*/
|
36 |
+
class AccessToken
|
37 |
+
{
|
38 |
+
const FEDERATED_SIGNON_CERT_URL = 'https://www.googleapis.com/oauth2/v3/certs';
|
39 |
+
const OAUTH2_ISSUER = 'accounts.google.com';
|
40 |
+
const OAUTH2_ISSUER_HTTPS = 'https://accounts.google.com';
|
41 |
+
const OAUTH2_REVOKE_URI = 'https://oauth2.googleapis.com/revoke';
|
42 |
+
/**
|
43 |
+
* @var callable
|
44 |
+
*/
|
45 |
+
private $httpHandler;
|
46 |
+
/**
|
47 |
+
* @var CacheItemPoolInterface
|
48 |
+
*/
|
49 |
+
private $cache;
|
50 |
+
/**
|
51 |
+
* @param callable $httpHandler [optional] An HTTP Handler to deliver PSR-7 requests.
|
52 |
+
* @param CacheItemPoolInterface $cache [optional] A PSR-6 compatible cache implementation.
|
53 |
+
*/
|
54 |
+
public function __construct(callable $httpHandler = null, \DeliciousBrains\WP_Offload_Media\Gcp\Psr\Cache\CacheItemPoolInterface $cache = null)
|
55 |
+
{
|
56 |
+
// @codeCoverageIgnoreStart
|
57 |
+
if (!class_exists('DeliciousBrains\\WP_Offload_Media\\Gcp\\phpseclib\\Crypt\\RSA')) {
|
58 |
+
throw new \RuntimeException('Please require phpseclib/phpseclib v2 to use this utility.');
|
59 |
+
}
|
60 |
+
// @codeCoverageIgnoreEnd
|
61 |
+
$this->httpHandler = $httpHandler ?: \DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth\HttpHandler\HttpHandlerFactory::build(\DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth\HttpHandler\HttpClientCache::getHttpClient());
|
62 |
+
$this->cache = $cache ?: new \DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth\Cache\MemoryCacheItemPool();
|
63 |
+
$this->configureJwtService();
|
64 |
+
// set phpseclib constants if applicable
|
65 |
+
$this->setPhpsecConstants();
|
66 |
+
}
|
67 |
+
/**
|
68 |
+
* Verifies an id token and returns the authenticated apiLoginTicket.
|
69 |
+
* Throws an exception if the id token is not valid.
|
70 |
+
* The audience parameter can be used to control which id tokens are
|
71 |
+
* accepted. By default, the id token must have been issued to this OAuth2 client.
|
72 |
+
*
|
73 |
+
* @param string $token The JSON Web Token to be verified.
|
74 |
+
* @param array $options [optional] {
|
75 |
+
* Configuration options.
|
76 |
+
*
|
77 |
+
* @type string $audience The indended recipient of the token.
|
78 |
+
* @type string $certsLocation The location (remote or local) from which
|
79 |
+
* to retrieve certificates, if not cached. This value should only be
|
80 |
+
* provided in limited circumstances in which you are sure of the
|
81 |
+
* behavior.
|
82 |
+
* }
|
83 |
+
* @return array|bool the token payload, if successful, or false if not.
|
84 |
+
* @throws \InvalidArgumentException If certs could not be retrieved from a local file.
|
85 |
+
* @throws \InvalidArgumentException If received certs are in an invalid format.
|
86 |
+
* @throws \RuntimeException If certs could not be retrieved from a remote location.
|
87 |
+
*/
|
88 |
+
public function verify($token, array $options = [])
|
89 |
+
{
|
90 |
+
$audience = isset($options['audience']) ? $options['audience'] : null;
|
91 |
+
$certsLocation = isset($options['certsLocation']) ? $options['certsLocation'] : self::FEDERATED_SIGNON_CERT_URL;
|
92 |
+
unset($options['audience'], $options['certsLocation']);
|
93 |
+
// Check signature against each available cert.
|
94 |
+
// allow the loop to complete unless a known bad result is encountered.
|
95 |
+
$certs = $this->getFederatedSignOnCerts($certsLocation, $options);
|
96 |
+
foreach ($certs as $cert) {
|
97 |
+
$rsa = new \DeliciousBrains\WP_Offload_Media\Gcp\phpseclib\Crypt\RSA();
|
98 |
+
$rsa->loadKey(['n' => new \DeliciousBrains\WP_Offload_Media\Gcp\phpseclib\Math\BigInteger($this->callJwtStatic('urlsafeB64Decode', [$cert['n']]), 256), 'e' => new \DeliciousBrains\WP_Offload_Media\Gcp\phpseclib\Math\BigInteger($this->callJwtStatic('urlsafeB64Decode', [$cert['e']]), 256)]);
|
99 |
+
try {
|
100 |
+
$pubkey = $rsa->getPublicKey();
|
101 |
+
$payload = $this->callJwtStatic('decode', [$token, $pubkey, ['RS256']]);
|
102 |
+
if (property_exists($payload, 'aud')) {
|
103 |
+
if ($audience && $payload->aud != $audience) {
|
104 |
+
return false;
|
105 |
+
}
|
106 |
+
}
|
107 |
+
// support HTTP and HTTPS issuers
|
108 |
+
// @see https://developers.google.com/identity/sign-in/web/backend-auth
|
109 |
+
$issuers = [self::OAUTH2_ISSUER, self::OAUTH2_ISSUER_HTTPS];
|
110 |
+
if (!isset($payload->iss) || !in_array($payload->iss, $issuers)) {
|
111 |
+
return false;
|
112 |
+
}
|
113 |
+
return (array) $payload;
|
114 |
+
} catch (ExpiredException $e) {
|
115 |
+
return false;
|
116 |
+
} catch (\ExpiredException $e) {
|
117 |
+
// (firebase/php-jwt 2)
|
118 |
+
return false;
|
119 |
+
} catch (SignatureInvalidException $e) {
|
120 |
+
// continue
|
121 |
+
} catch (\SignatureInvalidException $e) {
|
122 |
+
// continue (firebase/php-jwt 2)
|
123 |
+
} catch (\DomainException $e) {
|
124 |
+
// continue
|
125 |
+
}
|
126 |
+
}
|
127 |
+
return false;
|
128 |
+
}
|
129 |
+
/**
|
130 |
+
* Revoke an OAuth2 access token or refresh token. This method will revoke the current access
|
131 |
+
* token, if a token isn't provided.
|
132 |
+
*
|
133 |
+
* @param string|array $token The token (access token or a refresh token) that should be revoked.
|
134 |
+
* @param array $options [optional] Configuration options.
|
135 |
+
* @return boolean Returns True if the revocation was successful, otherwise False.
|
136 |
+
*/
|
137 |
+
public function revoke($token, array $options = [])
|
138 |
+
{
|
139 |
+
if (is_array($token)) {
|
140 |
+
if (isset($token['refresh_token'])) {
|
141 |
+
$token = $token['refresh_token'];
|
142 |
+
} else {
|
143 |
+
$token = $token['access_token'];
|
144 |
+
}
|
145 |
+
}
|
146 |
+
$body = \DeliciousBrains\WP_Offload_Media\Gcp\GuzzleHttp\Psr7\stream_for(http_build_query(['token' => $token]));
|
147 |
+
$request = new \DeliciousBrains\WP_Offload_Media\Gcp\GuzzleHttp\Psr7\Request('POST', self::OAUTH2_REVOKE_URI, ['Cache-Control' => 'no-store', 'Content-Type' => 'application/x-www-form-urlencoded'], $body);
|
148 |
+
$httpHandler = $this->httpHandler;
|
149 |
+
$response = $httpHandler($request, $options);
|
150 |
+
return $response->getStatusCode() == 200;
|
151 |
+
}
|
152 |
+
/**
|
153 |
+
* Gets federated sign-on certificates to use for verifying identity tokens.
|
154 |
+
* Returns certs as array structure, where keys are key ids, and values
|
155 |
+
* are PEM encoded certificates.
|
156 |
+
*
|
157 |
+
* @param string $location The location from which to retrieve certs.
|
158 |
+
* @param array $options [optional] Configuration options.
|
159 |
+
* @return array
|
160 |
+
* @throws \InvalidArgumentException If received certs are in an invalid format.
|
161 |
+
*/
|
162 |
+
private function getFederatedSignOnCerts($location, array $options = [])
|
163 |
+
{
|
164 |
+
$cacheItem = $this->cache->getItem('federated_signon_certs_v3');
|
165 |
+
$certs = $cacheItem ? $cacheItem->get() : null;
|
166 |
+
$gotNewCerts = false;
|
167 |
+
if (!$certs) {
|
168 |
+
$certs = $this->retrieveCertsFromLocation($location, $options);
|
169 |
+
$gotNewCerts = true;
|
170 |
+
}
|
171 |
+
if (!isset($certs['keys'])) {
|
172 |
+
throw new \InvalidArgumentException('federated sign-on certs expects "keys" to be set');
|
173 |
+
}
|
174 |
+
// Push caching off until after verifying certs are in a valid format.
|
175 |
+
// Don't want to cache bad data.
|
176 |
+
if ($gotNewCerts) {
|
177 |
+
$cacheItem->expiresAt(new \DateTime('+1 hour'));
|
178 |
+
$cacheItem->set($certs);
|
179 |
+
$this->cache->save($cacheItem);
|
180 |
+
}
|
181 |
+
return $certs['keys'];
|
182 |
+
}
|
183 |
+
/**
|
184 |
+
* Retrieve and cache a certificates file.
|
185 |
+
*
|
186 |
+
* @param $url string location
|
187 |
+
* @param array $options [optional] Configuration options.
|
188 |
+
* @throws \RuntimeException
|
189 |
+
* @return array certificates
|
190 |
+
* @throws \InvalidArgumentException If certs could not be retrieved from a local file.
|
191 |
+
* @throws \RuntimeException If certs could not be retrieved from a remote location.
|
192 |
+
*/
|
193 |
+
private function retrieveCertsFromLocation($url, array $options = [])
|
194 |
+
{
|
195 |
+
// If we're retrieving a local file, just grab it.
|
196 |
+
if (strpos($url, 'http') !== 0) {
|
197 |
+
if (!file_exists($url)) {
|
198 |
+
throw new \InvalidArgumentException(sprintf('Failed to retrieve verification certificates from path: %s.', $url));
|
199 |
+
}
|
200 |
+
return json_decode(file_get_contents($url), true);
|
201 |
+
}
|
202 |
+
$httpHandler = $this->httpHandler;
|
203 |
+
$response = $httpHandler(new \DeliciousBrains\WP_Offload_Media\Gcp\GuzzleHttp\Psr7\Request('GET', $url), $options);
|
204 |
+
if ($response->getStatusCode() == 200) {
|
205 |
+
return json_decode((string) $response->getBody(), true);
|
206 |
+
}
|
207 |
+
throw new \RuntimeException(sprintf('Failed to retrieve verification certificates: "%s".', $response->getBody()->getContents()), $response->getStatusCode());
|
208 |
+
}
|
209 |
+
/**
|
210 |
+
* Set required defaults for JWT.
|
211 |
+
*/
|
212 |
+
private function configureJwtService()
|
213 |
+
{
|
214 |
+
$class = class_exists('DeliciousBrains\\WP_Offload_Media\\Gcp\\Firebase\\JWT\\JWT') ? 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Firebase\\JWT\\JWT' : '\\JWT';
|
215 |
+
if (property_exists($class, 'leeway') && $class::$leeway < 1) {
|
216 |
+
// Ensures JWT leeway is at least 1
|
217 |
+
// @see https://github.com/google/google-api-php-client/issues/827
|
218 |
+
$class::$leeway = 1;
|
219 |
+
}
|
220 |
+
}
|
221 |
+
/**
|
222 |
+
* phpseclib calls "phpinfo" by default, which requires special
|
223 |
+
* whitelisting in the AppEngine VM environment. This function
|
224 |
+
* sets constants to bypass the need for phpseclib to check phpinfo
|
225 |
+
*
|
226 |
+
* @see phpseclib/Math/BigInteger
|
227 |
+
* @see https://github.com/GoogleCloudPlatform/getting-started-php/issues/85
|
228 |
+
* @codeCoverageIgnore
|
229 |
+
*/
|
230 |
+
private function setPhpsecConstants()
|
231 |
+
{
|
232 |
+
if (filter_var(getenv('GAE_VM'), FILTER_VALIDATE_BOOLEAN)) {
|
233 |
+
if (!defined('MATH_BIGINTEGER_OPENSSL_ENABLED')) {
|
234 |
+
define('MATH_BIGINTEGER_OPENSSL_ENABLED', true);
|
235 |
+
}
|
236 |
+
if (!defined('CRYPT_RSA_MODE')) {
|
237 |
+
define('CRYPT_RSA_MODE', \DeliciousBrains\WP_Offload_Media\Gcp\phpseclib\Crypt\RSA::MODE_OPENSSL);
|
238 |
+
}
|
239 |
+
}
|
240 |
+
}
|
241 |
+
/**
|
242 |
+
* Provide a hook to mock calls to the JWT static methods.
|
243 |
+
*
|
244 |
+
* @param string $method
|
245 |
+
* @param array $args
|
246 |
+
* @return mixed
|
247 |
+
*/
|
248 |
+
protected function callJwtStatic($method, array $args = [])
|
249 |
+
{
|
250 |
+
$class = class_exists('DeliciousBrains\\WP_Offload_Media\\Gcp\\Firebase\\JWT\\JWT') ? 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Firebase\\JWT\\JWT' : 'JWT';
|
251 |
+
return call_user_func_array([$class, $method], $args);
|
252 |
+
}
|
253 |
+
}
|
@@ -20,8 +20,11 @@ namespace DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth;
|
|
20 |
use DomainException;
|
21 |
use DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth\Credentials\AppIdentityCredentials;
|
22 |
use DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth\Credentials\GCECredentials;
|
|
|
|
|
23 |
use DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth\Middleware\AuthTokenMiddleware;
|
24 |
use DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth\Subscriber\AuthTokenSubscriber;
|
|
|
25 |
use DeliciousBrains\WP_Offload_Media\Gcp\Psr\Cache\CacheItemPoolInterface;
|
26 |
/**
|
27 |
* ApplicationDefaultCredentials obtains the default credentials for
|
@@ -125,12 +128,19 @@ class ApplicationDefaultCredentials
|
|
125 |
{
|
126 |
$creds = null;
|
127 |
$jsonKey = \DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth\CredentialsLoader::fromEnv() ?: \DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth\CredentialsLoader::fromWellKnownFile();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
128 |
if (!is_null($jsonKey)) {
|
129 |
$creds = \DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth\CredentialsLoader::makeCredentials($scope, $jsonKey);
|
130 |
} elseif (\DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth\Credentials\AppIdentityCredentials::onAppEngine() && !\DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth\Credentials\GCECredentials::onAppEngineFlexible()) {
|
131 |
$creds = new \DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth\Credentials\AppIdentityCredentials($scope);
|
132 |
} elseif (\DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth\Credentials\GCECredentials::onGce($httpHandler)) {
|
133 |
-
$creds = new \DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth\Credentials\GCECredentials();
|
134 |
}
|
135 |
if (is_null($creds)) {
|
136 |
throw new \DomainException(self::notFound());
|
20 |
use DomainException;
|
21 |
use DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth\Credentials\AppIdentityCredentials;
|
22 |
use DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth\Credentials\GCECredentials;
|
23 |
+
use DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth\HttpHandler\HttpClientCache;
|
24 |
+
use DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth\HttpHandler\HttpHandlerFactory;
|
25 |
use DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth\Middleware\AuthTokenMiddleware;
|
26 |
use DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth\Subscriber\AuthTokenSubscriber;
|
27 |
+
use DeliciousBrains\WP_Offload_Media\Gcp\GuzzleHttp\Client;
|
28 |
use DeliciousBrains\WP_Offload_Media\Gcp\Psr\Cache\CacheItemPoolInterface;
|
29 |
/**
|
30 |
* ApplicationDefaultCredentials obtains the default credentials for
|
128 |
{
|
129 |
$creds = null;
|
130 |
$jsonKey = \DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth\CredentialsLoader::fromEnv() ?: \DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth\CredentialsLoader::fromWellKnownFile();
|
131 |
+
if (!$httpHandler) {
|
132 |
+
if (!($client = \DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth\HttpHandler\HttpClientCache::getHttpClient())) {
|
133 |
+
$client = new \DeliciousBrains\WP_Offload_Media\Gcp\GuzzleHttp\Client();
|
134 |
+
\DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth\HttpHandler\HttpClientCache::setHttpClient($client);
|
135 |
+
}
|
136 |
+
$httpHandler = \DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth\HttpHandler\HttpHandlerFactory::build($client);
|
137 |
+
}
|
138 |
if (!is_null($jsonKey)) {
|
139 |
$creds = \DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth\CredentialsLoader::makeCredentials($scope, $jsonKey);
|
140 |
} elseif (\DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth\Credentials\AppIdentityCredentials::onAppEngine() && !\DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth\Credentials\GCECredentials::onAppEngineFlexible()) {
|
141 |
$creds = new \DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth\Credentials\AppIdentityCredentials($scope);
|
142 |
} elseif (\DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth\Credentials\GCECredentials::onGce($httpHandler)) {
|
143 |
+
$creds = new \DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth\Credentials\GCECredentials(null, $scope);
|
144 |
}
|
145 |
if (is_null($creds)) {
|
146 |
throw new \DomainException(self::notFound());
|
@@ -32,7 +32,7 @@ final class Item implements \DeliciousBrains\WP_Offload_Media\Gcp\Psr\Cache\Cach
|
|
32 |
*/
|
33 |
private $value;
|
34 |
/**
|
35 |
-
* @var \DateTime
|
36 |
*/
|
37 |
private $expiration;
|
38 |
/**
|
@@ -71,7 +71,7 @@ final class Item implements \DeliciousBrains\WP_Offload_Media\Gcp\Psr\Cache\Cach
|
|
71 |
if ($this->expiration === null) {
|
72 |
return true;
|
73 |
}
|
74 |
-
return
|
75 |
}
|
76 |
/**
|
77 |
* {@inheritdoc}
|
@@ -101,9 +101,9 @@ final class Item implements \DeliciousBrains\WP_Offload_Media\Gcp\Psr\Cache\Cach
|
|
101 |
public function expiresAfter($time)
|
102 |
{
|
103 |
if (is_int($time)) {
|
104 |
-
$this->expiration = new \
|
105 |
} elseif ($time instanceof \DateInterval) {
|
106 |
-
$this->expiration = (
|
107 |
} elseif ($time === null) {
|
108 |
$this->expiration = $time;
|
109 |
} else {
|
@@ -148,4 +148,8 @@ final class Item implements \DeliciousBrains\WP_Offload_Media\Gcp\Psr\Cache\Cach
|
|
148 |
}
|
149 |
return false;
|
150 |
}
|
|
|
|
|
|
|
|
|
151 |
}
|
32 |
*/
|
33 |
private $value;
|
34 |
/**
|
35 |
+
* @var \DateTime|null
|
36 |
*/
|
37 |
private $expiration;
|
38 |
/**
|
71 |
if ($this->expiration === null) {
|
72 |
return true;
|
73 |
}
|
74 |
+
return $this->currentTime()->getTimestamp() < $this->expiration->getTimestamp();
|
75 |
}
|
76 |
/**
|
77 |
* {@inheritdoc}
|
101 |
public function expiresAfter($time)
|
102 |
{
|
103 |
if (is_int($time)) {
|
104 |
+
$this->expiration = $this->currentTime()->add(new \DateInterval("PT{$time}S"));
|
105 |
} elseif ($time instanceof \DateInterval) {
|
106 |
+
$this->expiration = $this->currentTime()->add($time);
|
107 |
} elseif ($time === null) {
|
108 |
$this->expiration = $time;
|
109 |
} else {
|
148 |
}
|
149 |
return false;
|
150 |
}
|
151 |
+
protected function currentTime()
|
152 |
+
{
|
153 |
+
return new \DateTime('now', new \DateTimeZone('UTC'));
|
154 |
+
}
|
155 |
}
|
@@ -46,41 +46,10 @@ class SysVCacheItemPool implements \DeliciousBrains\WP_Offload_Media\Gcp\Psr\Cac
|
|
46 |
* @var array
|
47 |
*/
|
48 |
private $options;
|
49 |
-
|
50 |
-
*
|
51 |
-
*
|
52 |
-
* @return bool true when success, false upon failure
|
53 |
-
*/
|
54 |
-
private function saveCurrentItems()
|
55 |
-
{
|
56 |
-
$shmid = shm_attach($this->sysvKey, $this->options['memsize'], $this->options['perm']);
|
57 |
-
if ($shmid !== false) {
|
58 |
-
$ret = shm_put_var($shmid, $this->options['variableKey'], $this->items);
|
59 |
-
shm_detach($shmid);
|
60 |
-
return $ret;
|
61 |
-
}
|
62 |
-
return false;
|
63 |
-
}
|
64 |
-
/**
|
65 |
-
* Load the items from the shared memory.
|
66 |
-
*
|
67 |
-
* @return bool true when success, false upon failure
|
68 |
*/
|
69 |
-
private
|
70 |
-
{
|
71 |
-
$shmid = shm_attach($this->sysvKey, $this->options['memsize'], $this->options['perm']);
|
72 |
-
if ($shmid !== false) {
|
73 |
-
$data = @shm_get_var($shmid, $this->options['variableKey']);
|
74 |
-
if (!empty($data)) {
|
75 |
-
$this->items = $data;
|
76 |
-
} else {
|
77 |
-
$this->items = [];
|
78 |
-
}
|
79 |
-
shm_detach($shmid);
|
80 |
-
return true;
|
81 |
-
}
|
82 |
-
return false;
|
83 |
-
}
|
84 |
/**
|
85 |
* Create a SystemV shared memory based CacheItemPool.
|
86 |
*
|
@@ -104,7 +73,6 @@ class SysVCacheItemPool implements \DeliciousBrains\WP_Offload_Media\Gcp\Psr\Cac
|
|
104 |
$this->items = [];
|
105 |
$this->deferredItems = [];
|
106 |
$this->sysvKey = ftok(__FILE__, $this->options['proj']);
|
107 |
-
$this->loadItems();
|
108 |
}
|
109 |
/**
|
110 |
* {@inheritdoc}
|
@@ -155,6 +123,9 @@ class SysVCacheItemPool implements \DeliciousBrains\WP_Offload_Media\Gcp\Psr\Cac
|
|
155 |
*/
|
156 |
public function deleteItems(array $keys)
|
157 |
{
|
|
|
|
|
|
|
158 |
foreach ($keys as $key) {
|
159 |
unset($this->items[$key]);
|
160 |
}
|
@@ -165,6 +136,9 @@ class SysVCacheItemPool implements \DeliciousBrains\WP_Offload_Media\Gcp\Psr\Cac
|
|
165 |
*/
|
166 |
public function save(\DeliciousBrains\WP_Offload_Media\Gcp\Psr\Cache\CacheItemInterface $item)
|
167 |
{
|
|
|
|
|
|
|
168 |
$this->items[$item->getKey()] = $item;
|
169 |
return $this->saveCurrentItems();
|
170 |
}
|
@@ -189,4 +163,40 @@ class SysVCacheItemPool implements \DeliciousBrains\WP_Offload_Media\Gcp\Psr\Cac
|
|
189 |
$this->deferredItems = [];
|
190 |
return true;
|
191 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
192 |
}
|
46 |
* @var array
|
47 |
*/
|
48 |
private $options;
|
49 |
+
/*
|
50 |
+
* @var bool
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
51 |
*/
|
52 |
+
private $hasLoadedItems = false;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
53 |
/**
|
54 |
* Create a SystemV shared memory based CacheItemPool.
|
55 |
*
|
73 |
$this->items = [];
|
74 |
$this->deferredItems = [];
|
75 |
$this->sysvKey = ftok(__FILE__, $this->options['proj']);
|
|
|
76 |
}
|
77 |
/**
|
78 |
* {@inheritdoc}
|
123 |
*/
|
124 |
public function deleteItems(array $keys)
|
125 |
{
|
126 |
+
if (!$this->hasLoadedItems) {
|
127 |
+
$this->loadItems();
|
128 |
+
}
|
129 |
foreach ($keys as $key) {
|
130 |
unset($this->items[$key]);
|
131 |
}
|
136 |
*/
|
137 |
public function save(\DeliciousBrains\WP_Offload_Media\Gcp\Psr\Cache\CacheItemInterface $item)
|
138 |
{
|
139 |
+
if (!$this->hasLoadedItems) {
|
140 |
+
$this->loadItems();
|
141 |
+
}
|
142 |
$this->items[$item->getKey()] = $item;
|
143 |
return $this->saveCurrentItems();
|
144 |
}
|
163 |
$this->deferredItems = [];
|
164 |
return true;
|
165 |
}
|
166 |
+
/**
|
167 |
+
* Save the current items.
|
168 |
+
*
|
169 |
+
* @return bool true when success, false upon failure
|
170 |
+
*/
|
171 |
+
private function saveCurrentItems()
|
172 |
+
{
|
173 |
+
$shmid = shm_attach($this->sysvKey, $this->options['memsize'], $this->options['perm']);
|
174 |
+
if ($shmid !== false) {
|
175 |
+
$ret = shm_put_var($shmid, $this->options['variableKey'], $this->items);
|
176 |
+
shm_detach($shmid);
|
177 |
+
return $ret;
|
178 |
+
}
|
179 |
+
return false;
|
180 |
+
}
|
181 |
+
/**
|
182 |
+
* Load the items from the shared memory.
|
183 |
+
*
|
184 |
+
* @return bool true when success, false upon failure
|
185 |
+
*/
|
186 |
+
private function loadItems()
|
187 |
+
{
|
188 |
+
$shmid = shm_attach($this->sysvKey, $this->options['memsize'], $this->options['perm']);
|
189 |
+
if ($shmid !== false) {
|
190 |
+
$data = @shm_get_var($shmid, $this->options['variableKey']);
|
191 |
+
if (!empty($data)) {
|
192 |
+
$this->items = $data;
|
193 |
+
} else {
|
194 |
+
$this->items = [];
|
195 |
+
}
|
196 |
+
shm_detach($shmid);
|
197 |
+
$this->hasLoadedItems = true;
|
198 |
+
return true;
|
199 |
+
}
|
200 |
+
return false;
|
201 |
+
}
|
202 |
}
|
@@ -24,6 +24,7 @@ namespace DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth\Credentials;
|
|
24 |
*/
|
25 |
use DeliciousBrains\WP_Offload_Media\Gcp\google\appengine\api\app_identity\AppIdentityService;
|
26 |
use DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth\CredentialsLoader;
|
|
|
27 |
/**
|
28 |
* AppIdentityCredentials supports authorization on Google App Engine.
|
29 |
*
|
@@ -48,7 +49,7 @@ use DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth\CredentialsLoader;
|
|
48 |
*
|
49 |
* $res = $client->get('volumes?q=Henry+David+Thoreau&country=US');
|
50 |
*/
|
51 |
-
class AppIdentityCredentials extends \DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth\CredentialsLoader
|
52 |
{
|
53 |
/**
|
54 |
* Result of fetchAuthToken.
|
@@ -60,6 +61,10 @@ class AppIdentityCredentials extends \DeliciousBrains\WP_Offload_Media\Gcp\Googl
|
|
60 |
* Array of OAuth2 scopes to be requested.
|
61 |
*/
|
62 |
private $scope;
|
|
|
|
|
|
|
|
|
63 |
public function __construct($scope = array())
|
64 |
{
|
65 |
$this->scope = $scope;
|
@@ -92,23 +97,17 @@ class AppIdentityCredentials extends \DeliciousBrains\WP_Offload_Media\Gcp\Googl
|
|
92 |
*
|
93 |
* @param callable $httpHandler callback which delivers psr7 request
|
94 |
*
|
95 |
-
* @return array
|
96 |
-
*
|
97 |
-
*
|
98 |
-
*
|
99 |
-
* ["expiration_time"]=>
|
100 |
-
* string(10) "1444339905"
|
101 |
-
* }
|
102 |
-
*
|
103 |
-
* @throws \Exception
|
104 |
*/
|
105 |
public function fetchAuthToken(callable $httpHandler = null)
|
106 |
{
|
107 |
-
|
108 |
-
|
109 |
-
}
|
110 |
-
|
111 |
-
throw new \Exception('This class must be run in App Engine, or you must include the AppIdentityService ' . 'mock class defined in tests/mocks/AppIdentityService.php');
|
112 |
}
|
113 |
// AppIdentityService expects an array when multiple scopes are supplied
|
114 |
$scope = is_array($this->scope) ? $this->scope : explode(' ', $this->scope);
|
@@ -116,6 +115,37 @@ class AppIdentityCredentials extends \DeliciousBrains\WP_Offload_Media\Gcp\Googl
|
|
116 |
$this->lastReceivedToken = $token;
|
117 |
return $token;
|
118 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
119 |
/**
|
120 |
* @return array|null
|
121 |
*/
|
@@ -136,4 +166,10 @@ class AppIdentityCredentials extends \DeliciousBrains\WP_Offload_Media\Gcp\Googl
|
|
136 |
{
|
137 |
return '';
|
138 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
139 |
}
|
24 |
*/
|
25 |
use DeliciousBrains\WP_Offload_Media\Gcp\google\appengine\api\app_identity\AppIdentityService;
|
26 |
use DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth\CredentialsLoader;
|
27 |
+
use DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth\SignBlobInterface;
|
28 |
/**
|
29 |
* AppIdentityCredentials supports authorization on Google App Engine.
|
30 |
*
|
49 |
*
|
50 |
* $res = $client->get('volumes?q=Henry+David+Thoreau&country=US');
|
51 |
*/
|
52 |
+
class AppIdentityCredentials extends \DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth\CredentialsLoader implements \DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth\SignBlobInterface
|
53 |
{
|
54 |
/**
|
55 |
* Result of fetchAuthToken.
|
61 |
* Array of OAuth2 scopes to be requested.
|
62 |
*/
|
63 |
private $scope;
|
64 |
+
/**
|
65 |
+
* @var string
|
66 |
+
*/
|
67 |
+
private $clientName;
|
68 |
public function __construct($scope = array())
|
69 |
{
|
70 |
$this->scope = $scope;
|
97 |
*
|
98 |
* @param callable $httpHandler callback which delivers psr7 request
|
99 |
*
|
100 |
+
* @return array A set of auth related metadata, containing the following
|
101 |
+
* keys:
|
102 |
+
* - access_token (string)
|
103 |
+
* - expiration_time (string)
|
|
|
|
|
|
|
|
|
|
|
104 |
*/
|
105 |
public function fetchAuthToken(callable $httpHandler = null)
|
106 |
{
|
107 |
+
try {
|
108 |
+
$this->checkAppEngineContext();
|
109 |
+
} catch (\Exception $e) {
|
110 |
+
return [];
|
|
|
111 |
}
|
112 |
// AppIdentityService expects an array when multiple scopes are supplied
|
113 |
$scope = is_array($this->scope) ? $this->scope : explode(' ', $this->scope);
|
115 |
$this->lastReceivedToken = $token;
|
116 |
return $token;
|
117 |
}
|
118 |
+
/**
|
119 |
+
* Sign a string using AppIdentityService.
|
120 |
+
*
|
121 |
+
* @param string $stringToSign The string to sign.
|
122 |
+
* @param bool $forceOpenSsl [optional] Does not apply to this credentials
|
123 |
+
* type.
|
124 |
+
* @return string The signature, base64-encoded.
|
125 |
+
* @throws \Exception If AppEngine SDK or mock is not available.
|
126 |
+
*/
|
127 |
+
public function signBlob($stringToSign, $forceOpenSsl = false)
|
128 |
+
{
|
129 |
+
$this->checkAppEngineContext();
|
130 |
+
return base64_encode(\DeliciousBrains\WP_Offload_Media\Gcp\google\appengine\api\app_identity\AppIdentityService::signForApp($stringToSign)['signature']);
|
131 |
+
}
|
132 |
+
/**
|
133 |
+
* Get the client name from AppIdentityService.
|
134 |
+
*
|
135 |
+
* Subsequent calls to this method will return a cached value.
|
136 |
+
*
|
137 |
+
* @param callable $httpHandler Not used in this implementation.
|
138 |
+
* @return string
|
139 |
+
* @throws \Exception If AppEngine SDK or mock is not available.
|
140 |
+
*/
|
141 |
+
public function getClientName(callable $httpHandler = null)
|
142 |
+
{
|
143 |
+
$this->checkAppEngineContext();
|
144 |
+
if (!$this->clientName) {
|
145 |
+
$this->clientName = \DeliciousBrains\WP_Offload_Media\Gcp\google\appengine\api\app_identity\AppIdentityService::getServiceAccountName();
|
146 |
+
}
|
147 |
+
return $this->clientName;
|
148 |
+
}
|
149 |
/**
|
150 |
* @return array|null
|
151 |
*/
|
166 |
{
|
167 |
return '';
|
168 |
}
|
169 |
+
private function checkAppEngineContext()
|
170 |
+
{
|
171 |
+
if (!self::onAppEngine() || !class_exists('DeliciousBrains\\WP_Offload_Media\\Gcp\\google\\appengine\\api\\app_identity\\AppIdentityService')) {
|
172 |
+
throw new \Exception('This class must be run in App Engine, or you must include the AppIdentityService ' . 'mock class defined in tests/mocks/AppIdentityService.php');
|
173 |
+
}
|
174 |
+
}
|
175 |
}
|
@@ -18,7 +18,10 @@
|
|
18 |
namespace DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth\Credentials;
|
19 |
|
20 |
use DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth\CredentialsLoader;
|
|
|
21 |
use DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth\HttpHandler\HttpHandlerFactory;
|
|
|
|
|
22 |
use DeliciousBrains\WP_Offload_Media\Gcp\GuzzleHttp\Exception\ClientException;
|
23 |
use DeliciousBrains\WP_Offload_Media\Gcp\GuzzleHttp\Exception\RequestException;
|
24 |
use DeliciousBrains\WP_Offload_Media\Gcp\GuzzleHttp\Exception\ServerException;
|
@@ -47,7 +50,7 @@ use DeliciousBrains\WP_Offload_Media\Gcp\GuzzleHttp\Psr7\Request;
|
|
47 |
*
|
48 |
* $res = $client->get('myproject/taskqueues/myqueue');
|
49 |
*/
|
50 |
-
class GCECredentials extends \DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth\CredentialsLoader
|
51 |
{
|
52 |
const cacheKey = 'GOOGLE_AUTH_PHP_GCE';
|
53 |
/**
|
@@ -61,6 +64,10 @@ class GCECredentials extends \DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth\C
|
|
61 |
* The metadata path of the default token.
|
62 |
*/
|
63 |
const TOKEN_URI_PATH = 'v1/instance/service-accounts/default/token';
|
|
|
|
|
|
|
|
|
64 |
/**
|
65 |
* The header whose presence indicates GCE presence.
|
66 |
*/
|
@@ -93,6 +100,36 @@ class GCECredentials extends \DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth\C
|
|
93 |
* Result of fetchAuthToken.
|
94 |
*/
|
95 |
protected $lastReceivedToken;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
96 |
/**
|
97 |
* The full uri for accessing the default token.
|
98 |
*
|
@@ -103,6 +140,16 @@ class GCECredentials extends \DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth\C
|
|
103 |
$base = 'http://' . self::METADATA_IP . '/computeMetadata/';
|
104 |
return $base . self::TOKEN_URI_PATH;
|
105 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
106 |
/**
|
107 |
* Determines if this an App Engine Flexible instance, by accessing the
|
108 |
* GAE_INSTANCE environment variable.
|
@@ -124,9 +171,7 @@ class GCECredentials extends \DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth\C
|
|
124 |
*/
|
125 |
public static function onGce(callable $httpHandler = null)
|
126 |
{
|
127 |
-
|
128 |
-
$httpHandler = \DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth\HttpHandler\HttpHandlerFactory::build();
|
129 |
-
}
|
130 |
$checkUri = 'http://' . self::METADATA_IP;
|
131 |
for ($i = 1; $i <= self::MAX_COMPUTE_PING_TRIES; $i++) {
|
132 |
try {
|
@@ -138,13 +183,12 @@ class GCECredentials extends \DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth\C
|
|
138 |
// could lead to false negatives in the event that we are on GCE, but
|
139 |
// the metadata resolution was particularly slow. The latter case is
|
140 |
// "unlikely".
|
141 |
-
$resp = $httpHandler(new \DeliciousBrains\WP_Offload_Media\Gcp\GuzzleHttp\Psr7\Request('GET', $checkUri), ['timeout' => self::COMPUTE_PING_CONNECTION_TIMEOUT_S]);
|
142 |
return $resp->getHeaderLine(self::FLAVOR_HEADER) == 'Google';
|
143 |
} catch (ClientException $e) {
|
144 |
} catch (ServerException $e) {
|
145 |
} catch (RequestException $e) {
|
146 |
}
|
147 |
-
$httpHandler = \DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth\HttpHandler\HttpHandlerFactory::build();
|
148 |
}
|
149 |
return false;
|
150 |
}
|
@@ -156,26 +200,27 @@ class GCECredentials extends \DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth\C
|
|
156 |
*
|
157 |
* @param callable $httpHandler callback which delivers psr7 request
|
158 |
*
|
159 |
-
* @return array the
|
|
|
|
|
|
|
|
|
160 |
*
|
161 |
* @throws \Exception
|
162 |
*/
|
163 |
public function fetchAuthToken(callable $httpHandler = null)
|
164 |
{
|
165 |
-
|
166 |
-
$httpHandler = \DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth\HttpHandler\HttpHandlerFactory::build();
|
167 |
-
}
|
168 |
if (!$this->hasCheckedOnGce) {
|
169 |
$this->isOnGce = self::onGce($httpHandler);
|
|
|
170 |
}
|
171 |
if (!$this->isOnGce) {
|
172 |
return array();
|
173 |
// return an empty array with no access token
|
174 |
}
|
175 |
-
$
|
176 |
-
$
|
177 |
-
// Assume it's JSON; if it's not throw an exception
|
178 |
-
if (null === ($json = json_decode($body, true))) {
|
179 |
throw new \Exception('Invalid JSON response');
|
180 |
}
|
181 |
// store this so we can retrieve it later
|
@@ -200,4 +245,63 @@ class GCECredentials extends \DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth\C
|
|
200 |
}
|
201 |
return null;
|
202 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
203 |
}
|
18 |
namespace DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth\Credentials;
|
19 |
|
20 |
use DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth\CredentialsLoader;
|
21 |
+
use DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth\HttpHandler\HttpClientCache;
|
22 |
use DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth\HttpHandler\HttpHandlerFactory;
|
23 |
+
use DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth\Iam;
|
24 |
+
use DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth\SignBlobInterface;
|
25 |
use DeliciousBrains\WP_Offload_Media\Gcp\GuzzleHttp\Exception\ClientException;
|
26 |
use DeliciousBrains\WP_Offload_Media\Gcp\GuzzleHttp\Exception\RequestException;
|
27 |
use DeliciousBrains\WP_Offload_Media\Gcp\GuzzleHttp\Exception\ServerException;
|
50 |
*
|
51 |
* $res = $client->get('myproject/taskqueues/myqueue');
|
52 |
*/
|
53 |
+
class GCECredentials extends \DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth\CredentialsLoader implements \DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth\SignBlobInterface
|
54 |
{
|
55 |
const cacheKey = 'GOOGLE_AUTH_PHP_GCE';
|
56 |
/**
|
64 |
* The metadata path of the default token.
|
65 |
*/
|
66 |
const TOKEN_URI_PATH = 'v1/instance/service-accounts/default/token';
|
67 |
+
/**
|
68 |
+
* The metadata path of the client ID.
|
69 |
+
*/
|
70 |
+
const CLIENT_ID_URI_PATH = 'v1/instance/service-accounts/default/email';
|
71 |
/**
|
72 |
* The header whose presence indicates GCE presence.
|
73 |
*/
|
100 |
* Result of fetchAuthToken.
|
101 |
*/
|
102 |
protected $lastReceivedToken;
|
103 |
+
/**
|
104 |
+
* @var string
|
105 |
+
*/
|
106 |
+
private $clientName;
|
107 |
+
/**
|
108 |
+
* @var Iam|null
|
109 |
+
*/
|
110 |
+
private $iam;
|
111 |
+
/**
|
112 |
+
* @var string
|
113 |
+
*/
|
114 |
+
private $tokenUri;
|
115 |
+
/**
|
116 |
+
* @param Iam $iam [optional] An IAM instance.
|
117 |
+
* @param string|array $scope [optional] the scope of the access request,
|
118 |
+
* expressed either as an array or as a space-delimited string.
|
119 |
+
*/
|
120 |
+
public function __construct(\DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth\Iam $iam = null, $scope = null)
|
121 |
+
{
|
122 |
+
$this->iam = $iam;
|
123 |
+
$tokenUri = self::getTokenUri();
|
124 |
+
if ($scope) {
|
125 |
+
if (is_string($scope)) {
|
126 |
+
$scope = explode(' ', $scope);
|
127 |
+
}
|
128 |
+
$scope = implode(',', $scope);
|
129 |
+
$tokenUri = $tokenUri . '?scopes=' . $scope;
|
130 |
+
}
|
131 |
+
$this->tokenUri = $tokenUri;
|
132 |
+
}
|
133 |
/**
|
134 |
* The full uri for accessing the default token.
|
135 |
*
|
140 |
$base = 'http://' . self::METADATA_IP . '/computeMetadata/';
|
141 |
return $base . self::TOKEN_URI_PATH;
|
142 |
}
|
143 |
+
/**
|
144 |
+
* The full uri for accessing the default service account.
|
145 |
+
*
|
146 |
+
* @return string
|
147 |
+
*/
|
148 |
+
public static function getClientNameUri()
|
149 |
+
{
|
150 |
+
$base = 'http://' . self::METADATA_IP . '/computeMetadata/';
|
151 |
+
return $base . self::CLIENT_ID_URI_PATH;
|
152 |
+
}
|
153 |
/**
|
154 |
* Determines if this an App Engine Flexible instance, by accessing the
|
155 |
* GAE_INSTANCE environment variable.
|
171 |
*/
|
172 |
public static function onGce(callable $httpHandler = null)
|
173 |
{
|
174 |
+
$httpHandler = $httpHandler ?: \DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth\HttpHandler\HttpHandlerFactory::build(\DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth\HttpHandler\HttpClientCache::getHttpClient());
|
|
|
|
|
175 |
$checkUri = 'http://' . self::METADATA_IP;
|
176 |
for ($i = 1; $i <= self::MAX_COMPUTE_PING_TRIES; $i++) {
|
177 |
try {
|
183 |
// could lead to false negatives in the event that we are on GCE, but
|
184 |
// the metadata resolution was particularly slow. The latter case is
|
185 |
// "unlikely".
|
186 |
+
$resp = $httpHandler(new \DeliciousBrains\WP_Offload_Media\Gcp\GuzzleHttp\Psr7\Request('GET', $checkUri, [self::FLAVOR_HEADER => 'Google']), ['timeout' => self::COMPUTE_PING_CONNECTION_TIMEOUT_S]);
|
187 |
return $resp->getHeaderLine(self::FLAVOR_HEADER) == 'Google';
|
188 |
} catch (ClientException $e) {
|
189 |
} catch (ServerException $e) {
|
190 |
} catch (RequestException $e) {
|
191 |
}
|
|
|
192 |
}
|
193 |
return false;
|
194 |
}
|
200 |
*
|
201 |
* @param callable $httpHandler callback which delivers psr7 request
|
202 |
*
|
203 |
+
* @return array A set of auth related metadata, containing the following
|
204 |
+
* keys:
|
205 |
+
* - access_token (string)
|
206 |
+
* - expires_in (int)
|
207 |
+
* - token_type (string)
|
208 |
*
|
209 |
* @throws \Exception
|
210 |
*/
|
211 |
public function fetchAuthToken(callable $httpHandler = null)
|
212 |
{
|
213 |
+
$httpHandler = $httpHandler ?: \DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth\HttpHandler\HttpHandlerFactory::build(\DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth\HttpHandler\HttpClientCache::getHttpClient());
|
|
|
|
|
214 |
if (!$this->hasCheckedOnGce) {
|
215 |
$this->isOnGce = self::onGce($httpHandler);
|
216 |
+
$this->hasCheckedOnGce = true;
|
217 |
}
|
218 |
if (!$this->isOnGce) {
|
219 |
return array();
|
220 |
// return an empty array with no access token
|
221 |
}
|
222 |
+
$json = $this->getFromMetadata($httpHandler, $this->tokenUri);
|
223 |
+
if (null === ($json = json_decode($json, true))) {
|
|
|
|
|
224 |
throw new \Exception('Invalid JSON response');
|
225 |
}
|
226 |
// store this so we can retrieve it later
|
245 |
}
|
246 |
return null;
|
247 |
}
|
248 |
+
/**
|
249 |
+
* Get the client name from GCE metadata.
|
250 |
+
*
|
251 |
+
* Subsequent calls will return a cached value.
|
252 |
+
*
|
253 |
+
* @param callable $httpHandler callback which delivers psr7 request
|
254 |
+
* @return string
|
255 |
+
*/
|
256 |
+
public function getClientName(callable $httpHandler = null)
|
257 |
+
{
|
258 |
+
if ($this->clientName) {
|
259 |
+
return $this->clientName;
|
260 |
+
}
|
261 |
+
$httpHandler = $httpHandler ?: \DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth\HttpHandler\HttpHandlerFactory::build(\DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth\HttpHandler\HttpClientCache::getHttpClient());
|
262 |
+
if (!$this->hasCheckedOnGce) {
|
263 |
+
$this->isOnGce = self::onGce($httpHandler);
|
264 |
+
$this->hasCheckedOnGce = true;
|
265 |
+
}
|
266 |
+
if (!$this->isOnGce) {
|
267 |
+
return '';
|
268 |
+
}
|
269 |
+
$this->clientName = $this->getFromMetadata($httpHandler, self::getClientNameUri());
|
270 |
+
return $this->clientName;
|
271 |
+
}
|
272 |
+
/**
|
273 |
+
* Sign a string using the default service account private key.
|
274 |
+
*
|
275 |
+
* This implementation uses IAM's signBlob API.
|
276 |
+
*
|
277 |
+
* @see https://cloud.google.com/iam/credentials/reference/rest/v1/projects.serviceAccounts/signBlob SignBlob
|
278 |
+
*
|
279 |
+
* @param string $stringToSign The string to sign.
|
280 |
+
* @param bool $forceOpenSsl [optional] Does not apply to this credentials
|
281 |
+
* type.
|
282 |
+
* @return string
|
283 |
+
*/
|
284 |
+
public function signBlob($stringToSign, $forceOpenSsl = false)
|
285 |
+
{
|
286 |
+
$httpHandler = \DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth\HttpHandler\HttpHandlerFactory::build(\DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth\HttpHandler\HttpClientCache::getHttpClient());
|
287 |
+
// Providing a signer is useful for testing, but it's undocumented
|
288 |
+
// because it's not something a user would generally need to do.
|
289 |
+
$signer = $this->iam ?: new \DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth\Iam($httpHandler);
|
290 |
+
$email = $this->getClientName($httpHandler);
|
291 |
+
$previousToken = $this->getLastReceivedToken();
|
292 |
+
$accessToken = $previousToken ? $previousToken['access_token'] : $this->fetchAuthToken($httpHandler)['access_token'];
|
293 |
+
return $signer->signBlob($email, $accessToken, $stringToSign);
|
294 |
+
}
|
295 |
+
/**
|
296 |
+
* Fetch the value of a GCE metadata server URI.
|
297 |
+
*
|
298 |
+
* @param callable $httpHandler An HTTP Handler to deliver PSR7 requests.
|
299 |
+
* @param string $uri The metadata URI.
|
300 |
+
* @return string
|
301 |
+
*/
|
302 |
+
private function getFromMetadata(callable $httpHandler, $uri)
|
303 |
+
{
|
304 |
+
$resp = $httpHandler(new \DeliciousBrains\WP_Offload_Media\Gcp\GuzzleHttp\Psr7\Request('GET', $uri, [self::FLAVOR_HEADER => 'Google']));
|
305 |
+
return (string) $resp->getBody();
|
306 |
+
}
|
307 |
}
|
@@ -33,7 +33,9 @@ class InsecureCredentials implements \DeliciousBrains\WP_Offload_Media\Gcp\Googl
|
|
33 |
* Fetches the auth token. In this case it returns an empty string.
|
34 |
*
|
35 |
* @param callable $httpHandler
|
36 |
-
* @return array
|
|
|
|
|
37 |
*/
|
38 |
public function fetchAuthToken(callable $httpHandler = null)
|
39 |
{
|
33 |
* Fetches the auth token. In this case it returns an empty string.
|
34 |
*
|
35 |
* @param callable $httpHandler
|
36 |
+
* @return array A set of auth related metadata, containing the following
|
37 |
+
* keys:
|
38 |
+
* - access_token (string)
|
39 |
*/
|
40 |
public function fetchAuthToken(callable $httpHandler = null)
|
41 |
{
|
@@ -19,6 +19,8 @@ namespace DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth\Credentials;
|
|
19 |
|
20 |
use DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth\CredentialsLoader;
|
21 |
use DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth\OAuth2;
|
|
|
|
|
22 |
/**
|
23 |
* ServiceAccountCredentials supports authorization using a Google service
|
24 |
* account.
|
@@ -52,8 +54,9 @@ use DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth\OAuth2;
|
|
52 |
*
|
53 |
* $res = $client->get('myproject/taskqueues/myqueue');
|
54 |
*/
|
55 |
-
class ServiceAccountCredentials extends \DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth\CredentialsLoader
|
56 |
{
|
|
|
57 |
/**
|
58 |
* The OAuth2 instance used to conduct authorization.
|
59 |
*
|
@@ -92,7 +95,11 @@ class ServiceAccountCredentials extends \DeliciousBrains\WP_Offload_Media\Gcp\Go
|
|
92 |
/**
|
93 |
* @param callable $httpHandler
|
94 |
*
|
95 |
-
* @return array
|
|
|
|
|
|
|
|
|
96 |
*/
|
97 |
public function fetchAuthToken(callable $httpHandler = null)
|
98 |
{
|
@@ -145,4 +152,16 @@ class ServiceAccountCredentials extends \DeliciousBrains\WP_Offload_Media\Gcp\Go
|
|
145 |
{
|
146 |
$this->auth->setSub($sub);
|
147 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
148 |
}
|
19 |
|
20 |
use DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth\CredentialsLoader;
|
21 |
use DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth\OAuth2;
|
22 |
+
use DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth\ServiceAccountSignerTrait;
|
23 |
+
use DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth\SignBlobInterface;
|
24 |
/**
|
25 |
* ServiceAccountCredentials supports authorization using a Google service
|
26 |
* account.
|
54 |
*
|
55 |
* $res = $client->get('myproject/taskqueues/myqueue');
|
56 |
*/
|
57 |
+
class ServiceAccountCredentials extends \DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth\CredentialsLoader implements \DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth\SignBlobInterface
|
58 |
{
|
59 |
+
use ServiceAccountSignerTrait;
|
60 |
/**
|
61 |
* The OAuth2 instance used to conduct authorization.
|
62 |
*
|
95 |
/**
|
96 |
* @param callable $httpHandler
|
97 |
*
|
98 |
+
* @return array A set of auth related metadata, containing the following
|
99 |
+
* keys:
|
100 |
+
* - access_token (string)
|
101 |
+
* - expires_in (int)
|
102 |
+
* - token_type (string)
|
103 |
*/
|
104 |
public function fetchAuthToken(callable $httpHandler = null)
|
105 |
{
|
152 |
{
|
153 |
$this->auth->setSub($sub);
|
154 |
}
|
155 |
+
/**
|
156 |
+
* Get the client name from the keyfile.
|
157 |
+
*
|
158 |
+
* In this case, it returns the keyfile's client_email key.
|
159 |
+
*
|
160 |
+
* @param callable $httpHandler Not used by this credentials type.
|
161 |
+
* @return string
|
162 |
+
*/
|
163 |
+
public function getClientName(callable $httpHandler = null)
|
164 |
+
{
|
165 |
+
return $this->auth->getIssuer();
|
166 |
+
}
|
167 |
}
|
@@ -19,6 +19,8 @@ namespace DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth\Credentials;
|
|
19 |
|
20 |
use DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth\CredentialsLoader;
|
21 |
use DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth\OAuth2;
|
|
|
|
|
22 |
/**
|
23 |
* Authenticates requests using Google's Service Account credentials via
|
24 |
* JWT Access.
|
@@ -28,8 +30,9 @@ use DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth\OAuth2;
|
|
28 |
* console (via 'Generate new Json Key'). It is not part of any OAuth2
|
29 |
* flow, rather it creates a JWT and sends that as a credential.
|
30 |
*/
|
31 |
-
class ServiceAccountJwtAccessCredentials extends \DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth\CredentialsLoader
|
32 |
{
|
|
|
33 |
/**
|
34 |
* The OAuth2 instance used to conduct authorization.
|
35 |
*
|
@@ -83,7 +86,9 @@ class ServiceAccountJwtAccessCredentials extends \DeliciousBrains\WP_Offload_Med
|
|
83 |
*
|
84 |
* @param callable $httpHandler
|
85 |
*
|
86 |
-
* @return array|void
|
|
|
|
|
87 |
*/
|
88 |
public function fetchAuthToken(callable $httpHandler = null)
|
89 |
{
|
@@ -108,4 +113,16 @@ class ServiceAccountJwtAccessCredentials extends \DeliciousBrains\WP_Offload_Med
|
|
108 |
{
|
109 |
return $this->auth->getLastReceivedToken();
|
110 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
111 |
}
|
19 |
|
20 |
use DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth\CredentialsLoader;
|
21 |
use DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth\OAuth2;
|
22 |
+
use DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth\ServiceAccountSignerTrait;
|
23 |
+
use DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth\SignBlobInterface;
|
24 |
/**
|
25 |
* Authenticates requests using Google's Service Account credentials via
|
26 |
* JWT Access.
|
30 |
* console (via 'Generate new Json Key'). It is not part of any OAuth2
|
31 |
* flow, rather it creates a JWT and sends that as a credential.
|
32 |
*/
|
33 |
+
class ServiceAccountJwtAccessCredentials extends \DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth\CredentialsLoader implements \DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth\SignBlobInterface
|
34 |
{
|
35 |
+
use ServiceAccountSignerTrait;
|
36 |
/**
|
37 |
* The OAuth2 instance used to conduct authorization.
|
38 |
*
|
86 |
*
|
87 |
* @param callable $httpHandler
|
88 |
*
|
89 |
+
* @return array|void A set of auth related metadata, containing the
|
90 |
+
* following keys:
|
91 |
+
* - access_token (string)
|
92 |
*/
|
93 |
public function fetchAuthToken(callable $httpHandler = null)
|
94 |
{
|
113 |
{
|
114 |
return $this->auth->getLastReceivedToken();
|
115 |
}
|
116 |
+
/**
|
117 |
+
* Get the client name from the keyfile.
|
118 |
+
*
|
119 |
+
* In this case, it returns the keyfile's client_email key.
|
120 |
+
*
|
121 |
+
* @param callable $httpHandler Not used by this credentials type.
|
122 |
+
* @return string
|
123 |
+
*/
|
124 |
+
public function getClientName(callable $httpHandler = null)
|
125 |
+
{
|
126 |
+
return $this->auth->getIssuer();
|
127 |
+
}
|
128 |
}
|
@@ -76,7 +76,13 @@ class UserRefreshCredentials extends \DeliciousBrains\WP_Offload_Media\Gcp\Googl
|
|
76 |
/**
|
77 |
* @param callable $httpHandler
|
78 |
*
|
79 |
-
* @return array
|
|
|
|
|
|
|
|
|
|
|
|
|
80 |
*/
|
81 |
public function fetchAuthToken(callable $httpHandler = null)
|
82 |
{
|
76 |
/**
|
77 |
* @param callable $httpHandler
|
78 |
*
|
79 |
+
* @return array A set of auth related metadata, containing the following
|
80 |
+
* keys:
|
81 |
+
* - access_token (string)
|
82 |
+
* - expires_in (int)
|
83 |
+
* - scope (string)
|
84 |
+
* - token_type (string)
|
85 |
+
* - id_token (string)
|
86 |
*/
|
87 |
public function fetchAuthToken(callable $httpHandler = null)
|
88 |
{
|
@@ -22,7 +22,7 @@ use DeliciousBrains\WP_Offload_Media\Gcp\Psr\Cache\CacheItemPoolInterface;
|
|
22 |
* A class to implement caching for any object implementing
|
23 |
* FetchAuthTokenInterface
|
24 |
*/
|
25 |
-
class FetchAuthTokenCache implements \DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth\FetchAuthTokenInterface
|
26 |
{
|
27 |
use CacheTrait;
|
28 |
/**
|
@@ -88,4 +88,32 @@ class FetchAuthTokenCache implements \DeliciousBrains\WP_Offload_Media\Gcp\Googl
|
|
88 |
{
|
89 |
return $this->fetcher->getLastReceivedToken();
|
90 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
91 |
}
|
22 |
* A class to implement caching for any object implementing
|
23 |
* FetchAuthTokenInterface
|
24 |
*/
|
25 |
+
class FetchAuthTokenCache implements \DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth\FetchAuthTokenInterface, \DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth\SignBlobInterface
|
26 |
{
|
27 |
use CacheTrait;
|
28 |
/**
|
88 |
{
|
89 |
return $this->fetcher->getLastReceivedToken();
|
90 |
}
|
91 |
+
/**
|
92 |
+
* Get the client name from the fetcher.
|
93 |
+
*
|
94 |
+
* @param callable $httpHandler An HTTP handler to deliver PSR7 requests.
|
95 |
+
* @return string
|
96 |
+
*/
|
97 |
+
public function getClientName(callable $httpHandler = null)
|
98 |
+
{
|
99 |
+
return $this->fetcher->getClientName($httpHandler);
|
100 |
+
}
|
101 |
+
/**
|
102 |
+
* Sign a blob using the fetcher.
|
103 |
+
*
|
104 |
+
* @param string $stringToSign The string to sign.
|
105 |
+
* @param bool $forceOpenssl Require use of OpenSSL for local signing. Does
|
106 |
+
* not apply to signing done using external services. **Defaults to**
|
107 |
+
* `false`.
|
108 |
+
* @return string The resulting signature.
|
109 |
+
* @throws \RuntimeException If the fetcher does not implement
|
110 |
+
* `Google\Auth\SignBlobInterface`.
|
111 |
+
*/
|
112 |
+
public function signBlob($stringToSign, $forceOpenSsl = false)
|
113 |
+
{
|
114 |
+
if (!$this->fetcher instanceof SignBlobInterface) {
|
115 |
+
throw new \RuntimeException('Credentials fetcher does not implement ' . 'DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\Auth\\SignBlobInterface');
|
116 |
+
}
|
117 |
+
return $this->fetcher->signBlob($stringToSign, $forceOpenSsl);
|
118 |
+
}
|
119 |
}
|
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* Copyright 2019 Google LLC
|
5 |
+
*
|
6 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
7 |
+
* you may not use this file except in compliance with the License.
|
8 |
+
* You may obtain a copy of the License at
|
9 |
+
*
|
10 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
11 |
+
*
|
12 |
+
* Unless required by applicable law or agreed to in writing, software
|
13 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
14 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
15 |
+
* See the License for the specific language governing permissions and
|
16 |
+
* limitations under the License.
|
17 |
+
*/
|
18 |
+
namespace DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth\HttpHandler;
|
19 |
+
|
20 |
+
use DeliciousBrains\WP_Offload_Media\Gcp\GuzzleHttp\ClientInterface;
|
21 |
+
/**
|
22 |
+
* Stores an HTTP Client in order to prevent multiple instantiations.
|
23 |
+
*/
|
24 |
+
class HttpClientCache
|
25 |
+
{
|
26 |
+
/**
|
27 |
+
* @var ClientInterface|null
|
28 |
+
*/
|
29 |
+
private static $httpClient;
|
30 |
+
/**
|
31 |
+
* Cache an HTTP Client for later calls.
|
32 |
+
*
|
33 |
+
* Passing null will unset the cached client.
|
34 |
+
*
|
35 |
+
* @param ClientInterface|null $client
|
36 |
+
* @return void
|
37 |
+
*/
|
38 |
+
public static function setHttpClient(\DeliciousBrains\WP_Offload_Media\Gcp\GuzzleHttp\ClientInterface $client = null)
|
39 |
+
{
|
40 |
+
self::$httpClient = $client;
|
41 |
+
}
|
42 |
+
/**
|
43 |
+
* Get the stored HTTP Client, or null.
|
44 |
+
*
|
45 |
+
* @return ClientInterface|null
|
46 |
+
*/
|
47 |
+
public static function getHttpClient()
|
48 |
+
{
|
49 |
+
return self::$httpClient;
|
50 |
+
}
|
51 |
+
}
|
@@ -25,9 +25,7 @@ class HttpHandlerFactory
|
|
25 |
* Builds out a default http handler for the installed version of guzzle.
|
26 |
*
|
27 |
* @param ClientInterface $client
|
28 |
-
*
|
29 |
* @return Guzzle5HttpHandler|Guzzle6HttpHandler
|
30 |
-
*
|
31 |
* @throws \Exception
|
32 |
*/
|
33 |
public static function build(\DeliciousBrains\WP_Offload_Media\Gcp\GuzzleHttp\ClientInterface $client = null)
|
25 |
* Builds out a default http handler for the installed version of guzzle.
|
26 |
*
|
27 |
* @param ClientInterface $client
|
|
|
28 |
* @return Guzzle5HttpHandler|Guzzle6HttpHandler
|
|
|
29 |
* @throws \Exception
|
30 |
*/
|
31 |
public static function build(\DeliciousBrains\WP_Offload_Media\Gcp\GuzzleHttp\ClientInterface $client = null)
|
@@ -0,0 +1,78 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* Copyright 2019 Google LLC
|
5 |
+
*
|
6 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
7 |
+
* you may not use this file except in compliance with the License.
|
8 |
+
* You may obtain a copy of the License at
|
9 |
+
*
|
10 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
11 |
+
*
|
12 |
+
* Unless required by applicable law or agreed to in writing, software
|
13 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
14 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
15 |
+
* See the License for the specific language governing permissions and
|
16 |
+
* limitations under the License.
|
17 |
+
*/
|
18 |
+
namespace DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth;
|
19 |
+
|
20 |
+
use DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth\HttpHandler\HttpClientCache;
|
21 |
+
use DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth\HttpHandler\HttpHandlerFactory;
|
22 |
+
use DeliciousBrains\WP_Offload_Media\Gcp\GuzzleHttp\Psr7;
|
23 |
+
/**
|
24 |
+
* Tools for using the IAM API.
|
25 |
+
*
|
26 |
+
* @see https://cloud.google.com/iam/docs IAM Documentation
|
27 |
+
*/
|
28 |
+
class Iam
|
29 |
+
{
|
30 |
+
const IAM_API_ROOT = 'https://iamcredentials.googleapis.com/v1';
|
31 |
+
const SIGN_BLOB_PATH = '%s:signBlob?alt=json';
|
32 |
+
const SERVICE_ACCOUNT_NAME = 'projects/-/serviceAccounts/%s';
|
33 |
+
/**
|
34 |
+
* @var callable
|
35 |
+
*/
|
36 |
+
private $httpHandler;
|
37 |
+
/**
|
38 |
+
* @param callable $httpHandler [optional] The HTTP Handler to send requests.
|
39 |
+
*/
|
40 |
+
public function __construct(callable $httpHandler = null)
|
41 |
+
{
|
42 |
+
$this->httpHandler = $httpHandler ?: \DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth\HttpHandler\HttpHandlerFactory::build(\DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth\HttpHandler\HttpClientCache::getHttpClient());
|
43 |
+
}
|
44 |
+
/**
|
45 |
+
* Sign a string using the IAM signBlob API.
|
46 |
+
*
|
47 |
+
* Note that signing using IAM requires your service account to have the
|
48 |
+
* `iam.serviceAccounts.signBlob` permission, part of the "Service Account
|
49 |
+
* Token Creator" IAM role.
|
50 |
+
*
|
51 |
+
* @param string $email The service account email.
|
52 |
+
* @param string $accessToken An access token from the service account.
|
53 |
+
* @param string $stringToSign The string to be signed.
|
54 |
+
* @param array $delegates [optional] A list of service account emails to
|
55 |
+
* add to the delegate chain. If omitted, the value of `$email` will
|
56 |
+
* be used.
|
57 |
+
* @return string The signed string, base64-encoded.
|
58 |
+
*/
|
59 |
+
public function signBlob($email, $accessToken, $stringToSign, array $delegates = [])
|
60 |
+
{
|
61 |
+
$httpHandler = $this->httpHandler;
|
62 |
+
$name = sprintf(self::SERVICE_ACCOUNT_NAME, $email);
|
63 |
+
$uri = self::IAM_API_ROOT . '/' . sprintf(self::SIGN_BLOB_PATH, $name);
|
64 |
+
if ($delegates) {
|
65 |
+
foreach ($delegates as &$delegate) {
|
66 |
+
$delegate = sprintf(self::SERVICE_ACCOUNT_NAME, $delegate);
|
67 |
+
}
|
68 |
+
} else {
|
69 |
+
$delegates = [$name];
|
70 |
+
}
|
71 |
+
$body = ['delegates' => $delegates, 'payload' => base64_encode($stringToSign)];
|
72 |
+
$headers = ['Authorization' => 'Bearer ' . $accessToken];
|
73 |
+
$request = new \DeliciousBrains\WP_Offload_Media\Gcp\GuzzleHttp\Psr7\Request('POST', $uri, $headers, \DeliciousBrains\WP_Offload_Media\Gcp\GuzzleHttp\Psr7\stream_for(json_encode($body)));
|
74 |
+
$res = $httpHandler($request);
|
75 |
+
$body = json_decode((string) $res->getBody(), true);
|
76 |
+
return $body['signedBlob'];
|
77 |
+
}
|
78 |
+
}
|
@@ -17,6 +17,7 @@
|
|
17 |
*/
|
18 |
namespace DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth;
|
19 |
|
|
|
20 |
use DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth\HttpHandler\HttpHandlerFactory;
|
21 |
use DeliciousBrains\WP_Offload_Media\Gcp\GuzzleHttp\Psr7;
|
22 |
use DeliciousBrains\WP_Offload_Media\Gcp\GuzzleHttp\Psr7\Request;
|
@@ -411,7 +412,7 @@ class OAuth2 implements \DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth\FetchA
|
|
411 |
public function fetchAuthToken(callable $httpHandler = null)
|
412 |
{
|
413 |
if (is_null($httpHandler)) {
|
414 |
-
$httpHandler = \DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth\HttpHandler\HttpHandlerFactory::build();
|
415 |
}
|
416 |
$response = $httpHandler($this->generateCredentialsRequest());
|
417 |
$credentials = $this->parseTokenResponse($response);
|
@@ -1072,6 +1073,19 @@ class OAuth2 implements \DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth\FetchA
|
|
1072 |
}
|
1073 |
return null;
|
1074 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1075 |
/**
|
1076 |
* @todo handle uri as array
|
1077 |
*
|
17 |
*/
|
18 |
namespace DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth;
|
19 |
|
20 |
+
use DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth\HttpHandler\HttpClientCache;
|
21 |
use DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth\HttpHandler\HttpHandlerFactory;
|
22 |
use DeliciousBrains\WP_Offload_Media\Gcp\GuzzleHttp\Psr7;
|
23 |
use DeliciousBrains\WP_Offload_Media\Gcp\GuzzleHttp\Psr7\Request;
|
412 |
public function fetchAuthToken(callable $httpHandler = null)
|
413 |
{
|
414 |
if (is_null($httpHandler)) {
|
415 |
+
$httpHandler = \DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth\HttpHandler\HttpHandlerFactory::build(\DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth\HttpHandler\HttpClientCache::getHttpClient());
|
416 |
}
|
417 |
$response = $httpHandler($this->generateCredentialsRequest());
|
418 |
$credentials = $this->parseTokenResponse($response);
|
1073 |
}
|
1074 |
return null;
|
1075 |
}
|
1076 |
+
/**
|
1077 |
+
* Get the client ID.
|
1078 |
+
*
|
1079 |
+
* Alias of {@see Google\Auth\OAuth2::getClientId()}.
|
1080 |
+
*
|
1081 |
+
* @param callable $httpHandler
|
1082 |
+
* @return string
|
1083 |
+
* @access private
|
1084 |
+
*/
|
1085 |
+
public function getClientName(callable $httpHandler = null)
|
1086 |
+
{
|
1087 |
+
return $this->getClientId();
|
1088 |
+
}
|
1089 |
/**
|
1090 |
* @todo handle uri as array
|
1091 |
*
|
@@ -0,0 +1,53 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* Copyright 2019 Google LLC
|
5 |
+
*
|
6 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
7 |
+
* you may not use this file except in compliance with the License.
|
8 |
+
* You may obtain a copy of the License at
|
9 |
+
*
|
10 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
11 |
+
*
|
12 |
+
* Unless required by applicable law or agreed to in writing, software
|
13 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
14 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
15 |
+
* See the License for the specific language governing permissions and
|
16 |
+
* limitations under the License.
|
17 |
+
*/
|
18 |
+
namespace DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth;
|
19 |
+
|
20 |
+
use DeliciousBrains\WP_Offload_Media\Gcp\phpseclib\Crypt\RSA;
|
21 |
+
/**
|
22 |
+
* Sign a string using a Service Account private key.
|
23 |
+
*/
|
24 |
+
trait ServiceAccountSignerTrait
|
25 |
+
{
|
26 |
+
/**
|
27 |
+
* Sign a string using the service account private key.
|
28 |
+
*
|
29 |
+
* @param string $stringToSign
|
30 |
+
* @param bool $forceOpenssl Whether to use OpenSSL regardless of
|
31 |
+
* whether phpseclib is installed. **Defaults to** `false`.
|
32 |
+
* @return string
|
33 |
+
*/
|
34 |
+
public function signBlob($stringToSign, $forceOpenssl = false)
|
35 |
+
{
|
36 |
+
$privateKey = $this->auth->getSigningKey();
|
37 |
+
$signedString = '';
|
38 |
+
if (class_exists('DeliciousBrains\\WP_Offload_Media\\Gcp\\phpseclib\\Crypt\\RSA') && !$forceOpenssl) {
|
39 |
+
$rsa = new \DeliciousBrains\WP_Offload_Media\Gcp\phpseclib\Crypt\RSA();
|
40 |
+
$rsa->loadKey($privateKey);
|
41 |
+
$rsa->setSignatureMode(\DeliciousBrains\WP_Offload_Media\Gcp\phpseclib\Crypt\RSA::SIGNATURE_PKCS1);
|
42 |
+
$rsa->setHash('sha256');
|
43 |
+
$signedString = $rsa->sign($stringToSign);
|
44 |
+
} elseif (extension_loaded('openssl')) {
|
45 |
+
openssl_sign($stringToSign, $signedString, $privateKey, 'sha256WithRSAEncryption');
|
46 |
+
} else {
|
47 |
+
// @codeCoverageIgnoreStart
|
48 |
+
throw new \RuntimeException('OpenSSL is not installed.');
|
49 |
+
}
|
50 |
+
// @codeCoverageIgnoreEnd
|
51 |
+
return base64_encode($signedString);
|
52 |
+
}
|
53 |
+
}
|
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* Copyright 2019 Google LLC
|
5 |
+
*
|
6 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
7 |
+
* you may not use this file except in compliance with the License.
|
8 |
+
* You may obtain a copy of the License at
|
9 |
+
*
|
10 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
11 |
+
*
|
12 |
+
* Unless required by applicable law or agreed to in writing, software
|
13 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
14 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
15 |
+
* See the License for the specific language governing permissions and
|
16 |
+
* limitations under the License.
|
17 |
+
*/
|
18 |
+
namespace DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth;
|
19 |
+
|
20 |
+
/**
|
21 |
+
* Describes a class which supports signing arbitrary strings.
|
22 |
+
*/
|
23 |
+
interface SignBlobInterface extends FetchAuthTokenInterface
|
24 |
+
{
|
25 |
+
/**
|
26 |
+
* Sign a string using the method which is best for a given credentials type.
|
27 |
+
*
|
28 |
+
* @param string $stringToSign The string to sign.
|
29 |
+
* @param bool $forceOpenssl Require use of OpenSSL for local signing. Does
|
30 |
+
* not apply to signing done using external services. **Defaults to**
|
31 |
+
* `false`.
|
32 |
+
* @return string The resulting signature. Value should be base64-encoded.
|
33 |
+
*/
|
34 |
+
public function signBlob($stringToSign, $forceOpenssl = false);
|
35 |
+
/**
|
36 |
+
* Returns the current Client Name.
|
37 |
+
*
|
38 |
+
* @param callable $httpHandler callback which delivers psr7 request, if
|
39 |
+
* one is required to obtain a client name.
|
40 |
+
* @return string
|
41 |
+
*/
|
42 |
+
public function getClientName(callable $httpHandler = null);
|
43 |
+
}
|
@@ -1 +1 @@
|
|
1 |
-
1.
|
1 |
+
1.34.0
|
@@ -6,11 +6,11 @@
|
|
6 |
"require": {
|
7 |
"php": ">=5.5",
|
8 |
"rize\/uri-template": "~0.3",
|
9 |
-
"google\/auth": "^1.
|
10 |
"guzzlehttp\/guzzle": "^5.3|^6.0",
|
11 |
"guzzlehttp\/promises": "^1.3",
|
12 |
"guzzlehttp\/psr7": "^1.2",
|
13 |
-
"monolog\/monolog": "
|
14 |
"psr\/http-message": "1.0.*"
|
15 |
},
|
16 |
"require-dev": {
|
@@ -18,8 +18,9 @@
|
|
18 |
"squizlabs\/php_codesniffer": "2.*",
|
19 |
"phpdocumentor\/reflection": "^3.0",
|
20 |
"erusev\/parsedown": "^1.6",
|
21 |
-
"google\/gax": "^
|
22 |
-
"opis\/closure": "^3"
|
|
|
23 |
},
|
24 |
"suggest": {
|
25 |
"opis\/closure": "May be used to serialize closures to process jobs in the batch daemon. Please require version ^3.",
|
6 |
"require": {
|
7 |
"php": ">=5.5",
|
8 |
"rize\/uri-template": "~0.3",
|
9 |
+
"google\/auth": "^1.6",
|
10 |
"guzzlehttp\/guzzle": "^5.3|^6.0",
|
11 |
"guzzlehttp\/promises": "^1.3",
|
12 |
"guzzlehttp\/psr7": "^1.2",
|
13 |
+
"monolog\/monolog": "^1.1|^2.0",
|
14 |
"psr\/http-message": "1.0.*"
|
15 |
},
|
16 |
"require-dev": {
|
18 |
"squizlabs\/php_codesniffer": "2.*",
|
19 |
"phpdocumentor\/reflection": "^3.0",
|
20 |
"erusev\/parsedown": "^1.6",
|
21 |
+
"google\/gax": "^1.1",
|
22 |
+
"opis\/closure": "^3",
|
23 |
+
"google\/common-protos": "^1.0"
|
24 |
},
|
25 |
"suggest": {
|
26 |
"opis\/closure": "May be used to serialize closures to process jobs in the batch daemon. Please require version ^3.",
|
@@ -28,7 +28,7 @@ trait ArrayTrait
|
|
28 |
* @param string $key
|
29 |
* @param array $arr
|
30 |
* @param bool $isRequired
|
31 |
-
* @return
|
32 |
* @throws \InvalidArgumentException
|
33 |
*/
|
34 |
private function pluck($key, array &$arr, $isRequired = true)
|
@@ -46,7 +46,7 @@ trait ArrayTrait
|
|
46 |
/**
|
47 |
* Pluck a subset of an array.
|
48 |
*
|
49 |
-
* @param string $keys
|
50 |
* @param array $arr
|
51 |
* @return array
|
52 |
*/
|
28 |
* @param string $key
|
29 |
* @param array $arr
|
30 |
* @param bool $isRequired
|
31 |
+
* @return mixed
|
32 |
* @throws \InvalidArgumentException
|
33 |
*/
|
34 |
private function pluck($key, array &$arr, $isRequired = true)
|
46 |
/**
|
47 |
* Pluck a subset of an array.
|
48 |
*
|
49 |
+
* @param string[] $keys
|
50 |
* @param array $arr
|
51 |
* @return array
|
52 |
*/
|
@@ -113,7 +113,7 @@ class BatchRunner
|
|
113 |
* @param string $identifier Unique identifier of the job.
|
114 |
* @param mixed $item It needs to be serializable.
|
115 |
*
|
116 |
-
* @return
|
117 |
* @throws \RuntimeException
|
118 |
*/
|
119 |
public function submitItem($identifier, $item)
|
@@ -123,7 +123,7 @@ class BatchRunner
|
|
123 |
throw new \RuntimeException("The identifier does not exist: {$identifier}");
|
124 |
}
|
125 |
$idNum = $job->id();
|
126 |
-
|
127 |
}
|
128 |
/**
|
129 |
* Get the job with the given identifier.
|
113 |
* @param string $identifier Unique identifier of the job.
|
114 |
* @param mixed $item It needs to be serializable.
|
115 |
*
|
116 |
+
* @return void
|
117 |
* @throws \RuntimeException
|
118 |
*/
|
119 |
public function submitItem($identifier, $item)
|
123 |
throw new \RuntimeException("The identifier does not exist: {$identifier}");
|
124 |
}
|
125 |
$idNum = $job->id();
|
126 |
+
$this->processor->submit($item, $idNum);
|
127 |
}
|
128 |
/**
|
129 |
* Get the job with the given identifier.
|
@@ -78,14 +78,14 @@ trait BatchTrait
|
|
78 |
call_user_func_array($this->getCallback(), [$items]);
|
79 |
} catch (\Exception $e) {
|
80 |
if ($this->debugOutput) {
|
81 |
-
fwrite($this->debugOutputResource
|
82 |
}
|
83 |
return false;
|
84 |
}
|
85 |
$end = microtime(true);
|
86 |
if ($this->debugOutput) {
|
87 |
-
fwrite($this->debugOutputResource
|
88 |
-
fwrite($this->debugOutputResource
|
89 |
}
|
90 |
return true;
|
91 |
}
|
@@ -101,10 +101,11 @@ trait BatchTrait
|
|
101 |
* Configuration options.
|
102 |
*
|
103 |
* @type resource $debugOutputResource A resource to output debug output
|
104 |
-
* to.
|
105 |
* @type bool $debugOutput Whether or not to output debug information.
|
106 |
-
* Please note
|
107 |
-
*
|
|
|
108 |
* @type array $batchOptions A set of options for a BatchJob.
|
109 |
* {@see \Google\Cloud\Core\Batch\BatchJob::__construct()} for
|
110 |
* more details.
|
@@ -140,7 +141,7 @@ trait BatchTrait
|
|
140 |
$this->setSerializableClientOptions($options);
|
141 |
$this->batchMethod = $options['batchMethod'];
|
142 |
$this->identifier = $options['identifier'];
|
143 |
-
$this->debugOutputResource = isset($options['debugOutputResource']) ? $options['debugOutputResource'] :
|
144 |
$this->debugOutput = isset($options['debugOutput']) ? $options['debugOutput'] : false;
|
145 |
$batchOptions = isset($options['batchOptions']) ? $options['batchOptions'] : [];
|
146 |
$this->batchOptions = $batchOptions + ['batchSize' => 1000, 'callPeriod' => 2.0, 'numWorkers' => 2];
|
78 |
call_user_func_array($this->getCallback(), [$items]);
|
79 |
} catch (\Exception $e) {
|
80 |
if ($this->debugOutput) {
|
81 |
+
fwrite($this->debugOutputResource, $e->getMessage() . PHP_EOL . PHP_EOL . $e->getTraceAsString() . PHP_EOL);
|
82 |
}
|
83 |
return false;
|
84 |
}
|
85 |
$end = microtime(true);
|
86 |
if ($this->debugOutput) {
|
87 |
+
fwrite($this->debugOutputResource, sprintf('%f seconds for %s: %d items' . PHP_EOL, $end - $start, $this->batchMethod, count($items)));
|
88 |
+
fwrite($this->debugOutputResource, sprintf('memory used: %d' . PHP_EOL, memory_get_usage()));
|
89 |
}
|
90 |
return true;
|
91 |
}
|
101 |
* Configuration options.
|
102 |
*
|
103 |
* @type resource $debugOutputResource A resource to output debug output
|
104 |
+
* to. **Defaults to** `php://stderr`.
|
105 |
* @type bool $debugOutput Whether or not to output debug information.
|
106 |
+
* Please note that unless a debug output resource is configured
|
107 |
+
* this setting will only apply to CLI based applications.
|
108 |
+
* **Defaults to** `false`.
|
109 |
* @type array $batchOptions A set of options for a BatchJob.
|
110 |
* {@see \Google\Cloud\Core\Batch\BatchJob::__construct()} for
|
111 |
* more details.
|
141 |
$this->setSerializableClientOptions($options);
|
142 |
$this->batchMethod = $options['batchMethod'];
|
143 |
$this->identifier = $options['identifier'];
|
144 |
+
$this->debugOutputResource = isset($options['debugOutputResource']) ? $options['debugOutputResource'] : fopen('php://stderr', 'w');
|
145 |
$this->debugOutput = isset($options['debugOutput']) ? $options['debugOutput'] : false;
|
146 |
$batchOptions = isset($options['batchOptions']) ? $options['batchOptions'] : [];
|
147 |
$this->batchOptions = $batchOptions + ['batchSize' => 1000, 'callPeriod' => 2.0, 'numWorkers' => 2];
|
@@ -44,10 +44,8 @@ trait HandleFailureTrait
|
|
44 |
if ($this->baseDir === false) {
|
45 |
$this->baseDir = sprintf('%s/batch-daemon-failure', sys_get_temp_dir());
|
46 |
}
|
47 |
-
if (!is_dir($this->baseDir)) {
|
48 |
-
|
49 |
-
throw new \RuntimeException(sprintf('Couuld not create a directory: %s', $this->baseDir));
|
50 |
-
}
|
51 |
}
|
52 |
// Use getmypid for simplicity.
|
53 |
$this->failureFile = sprintf('%s/failed-items-%d', $this->baseDir, getmypid());
|
44 |
if ($this->baseDir === false) {
|
45 |
$this->baseDir = sprintf('%s/batch-daemon-failure', sys_get_temp_dir());
|
46 |
}
|
47 |
+
if (!is_dir($this->baseDir) && !@mkdir($this->baseDir, 0700, true) && !is_dir($this->baseDir)) {
|
48 |
+
throw new \RuntimeException(sprintf('Could not create a directory: %s', $this->baseDir));
|
|
|
|
|
49 |
}
|
50 |
// Use getmypid for simplicity.
|
51 |
$this->failureFile = sprintf('%s/failed-items-%d', $this->baseDir, getmypid());
|
@@ -46,7 +46,7 @@ trait InterruptTrait
|
|
46 |
*
|
47 |
* @return void
|
48 |
*/
|
49 |
-
public function sigHandler($signo, $
|
50 |
{
|
51 |
switch ($signo) {
|
52 |
case SIGINT:
|
46 |
*
|
47 |
* @return void
|
48 |
*/
|
49 |
+
public function sigHandler($signo, $siginfo = null)
|
50 |
{
|
51 |
switch ($signo) {
|
52 |
case SIGINT:
|
@@ -40,7 +40,7 @@ trait JobTrait
|
|
40 |
*/
|
41 |
private $numWorkers;
|
42 |
/**
|
43 |
-
* @var string An optional file that is required to run this job.
|
44 |
*/
|
45 |
private $bootstrapFile;
|
46 |
/**
|
40 |
*/
|
41 |
private $numWorkers;
|
42 |
/**
|
43 |
+
* @var string|null An optional file that is required to run this job.
|
44 |
*/
|
45 |
private $bootstrapFile;
|
46 |
/**
|
@@ -17,7 +17,6 @@
|
|
17 |
*/
|
18 |
namespace DeliciousBrains\WP_Offload_Media\Gcp\Google\Cloud\Core\Batch;
|
19 |
|
20 |
-
use DeliciousBrains\WP_Offload_Media\Gcp\Google\Cloud\Core\SysvTrait;
|
21 |
/**
|
22 |
* Represents a simple job that runs a single method that loops forever.
|
23 |
*
|
17 |
*/
|
18 |
namespace DeliciousBrains\WP_Offload_Media\Gcp\Google\Cloud\Core\Batch;
|
19 |
|
|
|
20 |
/**
|
21 |
* Represents a simple job that runs a single method that loops forever.
|
22 |
*
|
@@ -122,14 +122,14 @@ trait ClientTrait
|
|
122 |
*
|
123 |
* Process:
|
124 |
* 1. If $config['projectId'] is set, use that.
|
125 |
-
* 2. If
|
|
|
126 |
* that.
|
127 |
-
*
|
128 |
-
*
|
129 |
-
*
|
130 |
* the metadata store.
|
131 |
-
*
|
132 |
-
* 4. Throw exception.
|
133 |
*
|
134 |
* @param array $config
|
135 |
* @return string
|
@@ -141,6 +141,9 @@ trait ClientTrait
|
|
141 |
if ($config['projectId']) {
|
142 |
return $config['projectId'];
|
143 |
}
|
|
|
|
|
|
|
144 |
if (isset($config['keyFile'])) {
|
145 |
if (isset($config['keyFile']['project_id'])) {
|
146 |
return $config['keyFile']['project_id'];
|
@@ -163,9 +166,6 @@ trait ClientTrait
|
|
163 |
return $projectId;
|
164 |
}
|
165 |
}
|
166 |
-
if ($config['hasEmulator']) {
|
167 |
-
return 'emulator-project';
|
168 |
-
}
|
169 |
if ($config['projectIdRequired']) {
|
170 |
throw new \DeliciousBrains\WP_Offload_Media\Gcp\Google\Cloud\Core\Exception\GoogleException('No project ID was provided, ' . 'and we were unable to detect a default project ID.');
|
171 |
}
|
122 |
*
|
123 |
* Process:
|
124 |
* 1. If $config['projectId'] is set, use that.
|
125 |
+
* 2. If an emulator is enabled, return a dummy value.
|
126 |
+
* 3. If $config['keyFile'] is set, attempt to retrieve a project ID from
|
127 |
* that.
|
128 |
+
* 4. Check `GOOGLE_CLOUD_PROJECT` environment variable.
|
129 |
+
* 5. Check `GCLOUD_PROJECT` environment variable.
|
130 |
+
* 6. If code is running on compute engine, try to get the project ID from
|
131 |
* the metadata store.
|
132 |
+
* 7. Throw exception.
|
|
|
133 |
*
|
134 |
* @param array $config
|
135 |
* @return string
|
141 |
if ($config['projectId']) {
|
142 |
return $config['projectId'];
|
143 |
}
|
144 |
+
if ($config['hasEmulator']) {
|
145 |
+
return 'emulator-project';
|
146 |
+
}
|
147 |
if (isset($config['keyFile'])) {
|
148 |
if (isset($config['keyFile']['project_id'])) {
|
149 |
return $config['keyFile']['project_id'];
|
166 |
return $projectId;
|
167 |
}
|
168 |
}
|
|
|
|
|
|
|
169 |
if ($config['projectIdRequired']) {
|
170 |
throw new \DeliciousBrains\WP_Offload_Media\Gcp\Google\Cloud\Core\Exception\GoogleException('No project ID was provided, ' . 'and we were unable to detect a default project ID.');
|
171 |
}
|
@@ -17,7 +17,7 @@
|
|
17 |
*/
|
18 |
namespace DeliciousBrains\WP_Offload_Media\Gcp\Google\Cloud\Core\Compute;
|
19 |
|
20 |
-
use DeliciousBrains\WP_Offload_Media\Gcp\Google\Cloud\Core\Compute\Metadata\Readers\
|
21 |
use DeliciousBrains\WP_Offload_Media\Gcp\Google\Cloud\Core\Compute\Metadata\Readers\ReaderInterface;
|
22 |
/**
|
23 |
* A library for accessing the Google Compute Engine (GCE) metadata.
|
@@ -25,9 +25,6 @@ use DeliciousBrains\WP_Offload_Media\Gcp\Google\Cloud\Core\Compute\Metadata\Read
|
|
25 |
* The metadata is available from Google Compute Engine instances and
|
26 |
* App Engine Managed VMs instances.
|
27 |
*
|
28 |
-
* You can get the GCE metadata values very easily like:
|
29 |
-
*
|
30 |
-
*
|
31 |
* Example:
|
32 |
* ```
|
33 |
* use Google\Cloud\Core\Compute\Metadata;
|
@@ -44,7 +41,7 @@ use DeliciousBrains\WP_Offload_Media\Gcp\Google\Cloud\Core\Compute\Metadata\Read
|
|
44 |
class Metadata
|
45 |
{
|
46 |
/**
|
47 |
-
* @var
|
48 |
*/
|
49 |
private $reader;
|
50 |
/**
|
@@ -56,15 +53,17 @@ class Metadata
|
|
56 |
*/
|
57 |
private $numericProjectId;
|
58 |
/**
|
59 |
-
*
|
60 |
*/
|
61 |
-
public function __construct()
|
62 |
{
|
63 |
-
$this->reader = new \DeliciousBrains\WP_Offload_Media\Gcp\Google\Cloud\Core\Compute\Metadata\Readers\
|
64 |
}
|
65 |
/**
|
66 |
* Replace the default reader implementation
|
67 |
*
|
|
|
|
|
68 |
* @param ReaderInterface $reader The reader implementation
|
69 |
*/
|
70 |
public function setReader(\DeliciousBrains\WP_Offload_Media\Gcp\Google\Cloud\Core\Compute\Metadata\Readers\ReaderInterface $reader)
|
17 |
*/
|
18 |
namespace DeliciousBrains\WP_Offload_Media\Gcp\Google\Cloud\Core\Compute;
|
19 |
|
20 |
+
use DeliciousBrains\WP_Offload_Media\Gcp\Google\Cloud\Core\Compute\Metadata\Readers\HttpHandlerReader;
|
21 |
use DeliciousBrains\WP_Offload_Media\Gcp\Google\Cloud\Core\Compute\Metadata\Readers\ReaderInterface;
|
22 |
/**
|
23 |
* A library for accessing the Google Compute Engine (GCE) metadata.
|
25 |
* The metadata is available from Google Compute Engine instances and
|
26 |
* App Engine Managed VMs instances.
|
27 |
*
|
|
|
|
|
|
|
28 |
* Example:
|
29 |
* ```
|
30 |
* use Google\Cloud\Core\Compute\Metadata;
|
41 |
class Metadata
|
42 |
{
|
43 |
/**
|
44 |
+
* @var ReaderInterface The metadata reader.
|
45 |
*/
|
46 |
private $reader;
|
47 |
/**
|
53 |
*/
|
54 |
private $numericProjectId;
|
55 |
/**
|
56 |
+
* @param ReaderInterface $reader [optional] A metadata reader implementation.
|
57 |
*/
|
58 |
+
public function __construct(\DeliciousBrains\WP_Offload_Media\Gcp\Google\Cloud\Core\Compute\Metadata\Readers\ReaderInterface $reader = null)
|
59 |
{
|
60 |
+
$this->reader = $reader ?: new \DeliciousBrains\WP_Offload_Media\Gcp\Google\Cloud\Core\Compute\Metadata\Readers\HttpHandlerReader();
|
61 |
}
|
62 |
/**
|
63 |
* Replace the default reader implementation
|
64 |
*
|
65 |
+
* @deprecated If a custom reader implementation is desired, provide it at
|
66 |
+
* construction.
|
67 |
* @param ReaderInterface $reader The reader implementation
|
68 |
*/
|
69 |
public function setReader(\DeliciousBrains\WP_Offload_Media\Gcp\Google\Cloud\Core\Compute\Metadata\Readers\ReaderInterface $reader)
|
@@ -0,0 +1,55 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Copyright 2019 Google LLC
|
5 |
+
*
|
6 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
7 |
+
* you may not use this file except in compliance with the License.
|
8 |
+
* You may obtain a copy of the License at
|
9 |
+
*
|
10 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
11 |
+
*
|
12 |
+
* Unless required by applicable law or agreed to in writing, software
|
13 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
14 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
15 |
+
* See the License for the specific language governing permissions and
|
16 |
+
* limitations under the License.
|
17 |
+
*/
|
18 |
+
namespace DeliciousBrains\WP_Offload_Media\Gcp\Google\Cloud\Core\Compute\Metadata\Readers;
|
19 |
+
|
20 |
+
use DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth\Credentials\GCECredentials;
|
21 |
+
use DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth\HttpHandler\HttpClientCache;
|
22 |
+
use DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth\HttpHandler\HttpHandlerFactory;
|
23 |
+
use DeliciousBrains\WP_Offload_Media\Gcp\GuzzleHttp\Psr7\Request;
|
24 |
+
/**
|
25 |
+
* Read Compute Metadata using the HTTP Handler utility.
|
26 |
+
*/
|
27 |
+
class HttpHandlerReader implements \DeliciousBrains\WP_Offload_Media\Gcp\Google\Cloud\Core\Compute\Metadata\Readers\ReaderInterface
|
28 |
+
{
|
29 |
+
/**
|
30 |
+
* @var callable
|
31 |
+
*/
|
32 |
+
private $httpHandler;
|
33 |
+
/**
|
34 |
+
* @param callable $httpHandler [optional] An HTTP Handler capable of
|
35 |
+
* accepting PSR7 requests and returning PSR7 responses.
|
36 |
+
*/
|
37 |
+
public function __construct(callable $httpHandler = null)
|
38 |
+
{
|
39 |
+
$this->httpHandler = $httpHandler ?: \DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth\HttpHandler\HttpHandlerFactory::build(\DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth\HttpHandler\HttpClientCache::getHttpClient());
|
40 |
+
}
|
41 |
+
/**
|
42 |
+
* Read the metadata for a given path.
|
43 |
+
*
|
44 |
+
* @param string $path The metadata path, relative to `/computeMetadata/v1/`.
|
45 |
+
* @return string
|
46 |
+
*/
|
47 |
+
public function read($path)
|
48 |
+
{
|
49 |
+
$url = sprintf('http://%s/computeMetadata/v1/%s', \DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth\Credentials\GCECredentials::METADATA_IP, $path);
|
50 |
+
$request = new \DeliciousBrains\WP_Offload_Media\Gcp\GuzzleHttp\Psr7\Request('GET', $url, [\DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth\Credentials\GCECredentials::FLAVOR_HEADER => 'Google']);
|
51 |
+
$handler = $this->httpHandler;
|
52 |
+
$res = $handler($request);
|
53 |
+
return (string) $res->getBody();
|
54 |
+
}
|
55 |
+
}
|
@@ -17,6 +17,7 @@
|
|
17 |
*/
|
18 |
namespace DeliciousBrains\WP_Offload_Media\Gcp\Google\Cloud\Core\Compute\Metadata\Readers;
|
19 |
|
|
|
20 |
/**
|
21 |
* A class only reading the metadata URL with an appropriate header.
|
22 |
*
|
@@ -26,10 +27,14 @@ class StreamReader implements \DeliciousBrains\WP_Offload_Media\Gcp\Google\Cloud
|
|
26 |
{
|
27 |
/**
|
28 |
* The base PATH for the metadata.
|
|
|
|
|
29 |
*/
|
30 |
const BASE_URL = 'http://169.254.169.254/computeMetadata/v1/';
|
31 |
/**
|
32 |
* The header whose presence indicates GCE presence.
|
|
|
|
|
33 |
*/
|
34 |
const FLAVOR_HEADER = 'Metadata-Flavor: Google';
|
35 |
/**
|
@@ -41,15 +46,40 @@ class StreamReader implements \DeliciousBrains\WP_Offload_Media\Gcp\Google\Cloud
|
|
41 |
*/
|
42 |
public function __construct()
|
43 |
{
|
44 |
-
$options =
|
45 |
-
$this->context =
|
46 |
}
|
47 |
/**
|
48 |
-
*
|
|
|
|
|
|
|
49 |
*/
|
50 |
public function read($path)
|
51 |
{
|
52 |
-
$url =
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
53 |
return file_get_contents($url, false, $this->context);
|
54 |
}
|
55 |
}
|
17 |
*/
|
18 |
namespace DeliciousBrains\WP_Offload_Media\Gcp\Google\Cloud\Core\Compute\Metadata\Readers;
|
19 |
|
20 |
+
use DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth\Credentials\GCECredentials;
|
21 |
/**
|
22 |
* A class only reading the metadata URL with an appropriate header.
|
23 |
*
|
27 |
{
|
28 |
/**
|
29 |
* The base PATH for the metadata.
|
30 |
+
*
|
31 |
+
* @deprecated
|
32 |
*/
|
33 |
const BASE_URL = 'http://169.254.169.254/computeMetadata/v1/';
|
34 |
/**
|
35 |
* The header whose presence indicates GCE presence.
|
36 |
+
*
|
37 |
+
* @deprecated
|
38 |
*/
|
39 |
const FLAVOR_HEADER = 'Metadata-Flavor: Google';
|
40 |
/**
|
46 |
*/
|
47 |
public function __construct()
|
48 |
{
|
49 |
+
$options = ['http' => ['method' => 'GET', 'header' => \DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth\Credentials\GCECredentials::FLAVOR_HEADER . ': Google']];
|
50 |
+
$this->context = $this->createStreamContext($options);
|
51 |
}
|
52 |
/**
|
53 |
+
* Read the metadata for a given path.
|
54 |
+
*
|
55 |
+
* @param string $path The metadata path, relative to `/computeMetadata/v1/`.
|
56 |
+
* @return string
|
57 |
*/
|
58 |
public function read($path)
|
59 |
{
|
60 |
+
$url = sprintf('http://%s/computeMetadata/v1/%s', \DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth\Credentials\GCECredentials::METADATA_IP, $path);
|
61 |
+
return $this->getMetadata($url);
|
62 |
+
}
|
63 |
+
/**
|
64 |
+
* Abstracted for testing.
|
65 |
+
*
|
66 |
+
* @param array $options
|
67 |
+
* @return resource
|
68 |
+
* @codeCoverageIgnore
|
69 |
+
*/
|
70 |
+
protected function createStreamContext(array $options)
|
71 |
+
{
|
72 |
+
return stream_context_create($options);
|
73 |
+
}
|
74 |
+
/**
|
75 |
+
* Abstracted for testing.
|
76 |
+
*
|
77 |
+
* @param string $url
|
78 |
+
* @return string
|
79 |
+
* @codeCoverageIgnore
|
80 |
+
*/
|
81 |
+
protected function getMetadata($url)
|
82 |
+
{
|
83 |
return file_get_contents($url, false, $this->context);
|
84 |
}
|
85 |
}
|
@@ -19,6 +19,8 @@ namespace DeliciousBrains\WP_Offload_Media\Gcp\Google\Cloud\Core;
|
|
19 |
|
20 |
/**
|
21 |
* Provides easier to read debug information when dumping a class to stdout.
|
|
|
|
|
22 |
*/
|
23 |
trait DebugInfoTrait
|
24 |
{
|
19 |
|
20 |
/**
|
21 |
* Provides easier to read debug information when dumping a class to stdout.
|
22 |
+
*
|
23 |
+
* @codeCoverageIgnore
|
24 |
*/
|
25 |
trait DebugInfoTrait
|
26 |
{
|
@@ -17,13 +17,26 @@
|
|
17 |
*/
|
18 |
namespace DeliciousBrains\WP_Offload_Media\Gcp\Google\Cloud\Core;
|
19 |
|
20 |
-
use DeliciousBrains\WP_Offload_Media\Gcp\Google\Cloud\Core\RequestBuilder;
|
21 |
-
use DeliciousBrains\WP_Offload_Media\Gcp\Google\Cloud\Core\RequestWrapper;
|
22 |
/**
|
23 |
-
* Provides common logic for configuring the usage of an
|
24 |
*/
|
25 |
trait EmulatorTrait
|
26 |
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
27 |
/**
|
28 |
* Retrieve a valid base uri for a service emulator.
|
29 |
*
|
17 |
*/
|
18 |
namespace DeliciousBrains\WP_Offload_Media\Gcp\Google\Cloud\Core;
|
19 |
|
|
|
|
|
20 |
/**
|
21 |
+
* Provides common logic for configuring the usage of an emulator.
|
22 |
*/
|
23 |
trait EmulatorTrait
|
24 |
{
|
25 |
+
/**
|
26 |
+
* Configure the gapic configuration to use a service emulator.
|
27 |
+
*
|
28 |
+
* @param string $emulatorHost
|
29 |
+
* @return array
|
30 |
+
*/
|
31 |
+
private function emulatorGapicConfig($emulatorHost)
|
32 |
+
{
|
33 |
+
// Strip the URL scheme from the input, if it was provided.
|
34 |
+
if ($scheme = parse_url($emulatorHost, PHP_URL_SCHEME)) {
|
35 |
+
$search = $scheme . '://';
|
36 |
+
$emulatorHost = str_replace($search, '', $emulatorHost);
|
37 |
+
}
|
38 |
+
return ['apiEndpoint' => $emulatorHost, 'transportConfig' => ['grpc' => ['stubOpts' => ['credentials' => \DeliciousBrains\WP_Offload_Media\Gcp\Grpc\ChannelCredentials::createInsecure()]]]];
|
39 |
+
}
|
40 |
/**
|
41 |
* Retrieve a valid base uri for a service emulator.
|
42 |
*
|
@@ -28,13 +28,17 @@ class ExponentialBackoff
|
|
28 |
*/
|
29 |
private $retries;
|
30 |
/**
|
31 |
-
* @var callable
|
32 |
*/
|
33 |
private $retryFunction;
|
34 |
/**
|
35 |
* @var callable
|
36 |
*/
|
37 |
private $delayFunction;
|
|
|
|
|
|
|
|
|
38 |
/**
|
39 |
* @param int $retries [optional] Number of retries for a failed request.
|
40 |
* @param callable $retryFunction [optional] returns bool for whether or not to retry
|
@@ -45,7 +49,7 @@ class ExponentialBackoff
|
|
45 |
$this->retryFunction = $retryFunction;
|
46 |
// @todo revisit this approach
|
47 |
// @codeCoverageIgnoreStart
|
48 |
-
$this->delayFunction = function ($delay) {
|
49 |
usleep($delay);
|
50 |
};
|
51 |
// @codeCoverageIgnoreEnd
|
@@ -61,6 +65,7 @@ class ExponentialBackoff
|
|
61 |
public function execute(callable $function, array $arguments = [])
|
62 |
{
|
63 |
$delayFunction = $this->delayFunction;
|
|
|
64 |
$retryAttempt = 0;
|
65 |
$exception = null;
|
66 |
while (true) {
|
@@ -75,13 +80,15 @@ class ExponentialBackoff
|
|
75 |
if ($retryAttempt >= $this->retries) {
|
76 |
break;
|
77 |
}
|
78 |
-
$delayFunction($
|
79 |
$retryAttempt++;
|
80 |
}
|
81 |
}
|
82 |
throw $exception;
|
83 |
}
|
84 |
/**
|
|
|
|
|
85 |
* @param callable $delayFunction
|
86 |
* @return void
|
87 |
*/
|
@@ -89,6 +96,17 @@ class ExponentialBackoff
|
|
89 |
{
|
90 |
$this->delayFunction = $delayFunction;
|
91 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
92 |
/**
|
93 |
* Calculates exponential delay.
|
94 |
*
|
28 |
*/
|
29 |
private $retries;
|
30 |
/**
|
31 |
+
* @var callable|null
|
32 |
*/
|
33 |
private $retryFunction;
|
34 |
/**
|
35 |
* @var callable
|
36 |
*/
|
37 |
private $delayFunction;
|
38 |
+
/**
|
39 |
+
* @var callable|null
|
40 |
+
*/
|
41 |
+
private $calcDelayFunction;
|
42 |
/**
|
43 |
* @param int $retries [optional] Number of retries for a failed request.
|
44 |
* @param callable $retryFunction [optional] returns bool for whether or not to retry
|
49 |
$this->retryFunction = $retryFunction;
|
50 |
// @todo revisit this approach
|
51 |
// @codeCoverageIgnoreStart
|
52 |
+
$this->delayFunction = static function ($delay) {
|
53 |
usleep($delay);
|
54 |
};
|
55 |
// @codeCoverageIgnoreEnd
|
65 |
public function execute(callable $function, array $arguments = [])
|
66 |
{
|
67 |
$delayFunction = $this->delayFunction;
|
68 |
+
$calcDelayFunction = $this->calcDelayFunction ?: [$this, 'calculateDelay'];
|
69 |
$retryAttempt = 0;
|
70 |
$exception = null;
|
71 |
while (true) {
|
80 |
if ($retryAttempt >= $this->retries) {
|
81 |
break;
|
82 |
}
|
83 |
+
$delayFunction($calcDelayFunction($retryAttempt));
|
84 |
$retryAttempt++;
|
85 |
}
|
86 |
}
|
87 |
throw $exception;
|
88 |
}
|
89 |
/**
|
90 |
+
* If not set, defaults to using `usleep`.
|
91 |
+
*
|
92 |
* @param callable $delayFunction
|
93 |
* @return void
|
94 |
*/
|
96 |
{
|
97 |
$this->delayFunction = $delayFunction;
|
98 |
}
|
99 |
+
/**
|
100 |
+
* If not set, defaults to using
|
101 |
+
* {@see Google\Cloud\Core\ExponentialBackoff::calculateDelay()}.
|
102 |
+
*
|
103 |
+
* @param callable $calcDelayFunction
|
104 |
+
* @return void
|
105 |
+
*/
|
106 |
+
public function setCalcDelayFunction(callable $calcDelayFunction)
|
107 |
+
{
|
108 |
+
$this->calcDelayFunction = $calcDelayFunction;
|
109 |
+
}
|
110 |
/**
|
111 |
* Calculates exponential delay.
|
112 |
*
|
@@ -24,16 +24,10 @@ use DeliciousBrains\WP_Offload_Media\Gcp\Google\ApiCore\OperationResponse;
|
|
24 |
use DeliciousBrains\WP_Offload_Media\Gcp\Google\ApiCore\PagedListResponse;
|
25 |
use DeliciousBrains\WP_Offload_Media\Gcp\Google\ApiCore\Serializer;
|
26 |
use DeliciousBrains\WP_Offload_Media\Gcp\Google\ApiCore\ServerStream;
|
27 |
-
use DeliciousBrains\WP_Offload_Media\Gcp\Google\GAX\ApiException as GaxApiException;
|
28 |
-
use DeliciousBrains\WP_Offload_Media\Gcp\Google\GAX\OperationResponse as GaxOperationResponse;
|
29 |
-
use DeliciousBrains\WP_Offload_Media\Gcp\Google\GAX\PagedListResponse as GaxPagedListResponse;
|
30 |
-
use DeliciousBrains\WP_Offload_Media\Gcp\Google\GAX\Serializer as GaxSerializer;
|
31 |
-
use DeliciousBrains\WP_Offload_Media\Gcp\Google\GAX\ServerStream as GaxServerStream;
|
32 |
use DeliciousBrains\WP_Offload_Media\Gcp\Google\Protobuf\Internal\Message;
|
33 |
use DeliciousBrains\WP_Offload_Media\Gcp\Google\Rpc\BadRequest;
|
34 |
use DeliciousBrains\WP_Offload_Media\Gcp\Google\Rpc\Code;
|
35 |
use DeliciousBrains\WP_Offload_Media\Gcp\Google\Rpc\RetryInfo;
|
36 |
-
use Grpc;
|
37 |
/**
|
38 |
* The GrpcRequestWrapper is responsible for delivering gRPC requests.
|
39 |
*/
|
@@ -78,7 +72,7 @@ class GrpcRequestWrapper
|
|
78 |
public function __construct(array $config = [])
|
79 |
{
|
80 |
$this->setCommonDefaults($config);
|
81 |
-
$config += ['authHttpHandler' => null, 'serializer' =>
|
82 |
$this->authHttpHandler = $config['authHttpHandler'] ?: \DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth\HttpHandler\HttpHandlerFactory::build();
|
83 |
$this->serializer = $config['serializer'];
|
84 |
$this->grpcOptions = $config['grpcOptions'];
|
@@ -120,7 +114,7 @@ class GrpcRequestWrapper
|
|
120 |
try {
|
121 |
return $this->handleResponse($backoff->execute($request, $args));
|
122 |
} catch (\Exception $ex) {
|
123 |
-
if ($ex instanceof ApiException
|
124 |
throw $this->convertToGoogleException($ex);
|
125 |
}
|
126 |
throw $ex;
|
@@ -130,20 +124,20 @@ class GrpcRequestWrapper
|
|
130 |
* Serializes a gRPC response.
|
131 |
*
|
132 |
* @param mixed $response
|
133 |
-
* @return \Generator|array|null
|
134 |
*/
|
135 |
private function handleResponse($response)
|
136 |
{
|
137 |
-
if ($response instanceof PagedListResponse
|
138 |
$response = $response->getPage()->getResponseObject();
|
139 |
}
|
140 |
if ($response instanceof Message) {
|
141 |
return $this->serializer->encodeMessage($response);
|
142 |
}
|
143 |
-
if ($response instanceof OperationResponse
|
144 |
return $response;
|
145 |
}
|
146 |
-
if ($response instanceof ServerStream
|
147 |
return $this->handleStream($response);
|
148 |
}
|
149 |
return null;
|
@@ -151,7 +145,7 @@ class GrpcRequestWrapper
|
|
151 |
/**
|
152 |
* Handles a streaming response.
|
153 |
*
|
154 |
-
* @param ServerStream
|
155 |
* @return \Generator|array|null
|
156 |
*/
|
157 |
private function handleStream($response)
|
@@ -168,7 +162,7 @@ class GrpcRequestWrapper
|
|
168 |
/**
|
169 |
* Convert a ApiCore exception to a Google Exception.
|
170 |
*
|
171 |
-
* @param
|
172 |
* @return Exception\ServiceException
|
173 |
*/
|
174 |
private function convertToGoogleException($ex)
|
@@ -216,11 +210,4 @@ class GrpcRequestWrapper
|
|
216 |
}
|
217 |
return new $exception($ex->getMessage(), $ex->getCode(), $ex, $metadata);
|
218 |
}
|
219 |
-
/**
|
220 |
-
* @return Serializer|GaxSerializer
|
221 |
-
*/
|
222 |
-
private function buildSerializer()
|
223 |
-
{
|
224 |
-
return class_exists(\DeliciousBrains\WP_Offload_Media\Gcp\Google\ApiCore\Serializer::class) ? new \DeliciousBrains\WP_Offload_Media\Gcp\Google\ApiCore\Serializer() : new \DeliciousBrains\WP_Offload_Media\Gcp\Google\GAX\Serializer();
|
225 |
-
}
|
226 |
}
|
24 |
use DeliciousBrains\WP_Offload_Media\Gcp\Google\ApiCore\PagedListResponse;
|
25 |
use DeliciousBrains\WP_Offload_Media\Gcp\Google\ApiCore\Serializer;
|
26 |
use DeliciousBrains\WP_Offload_Media\Gcp\Google\ApiCore\ServerStream;
|
|
|
|
|
|
|
|
|
|
|
27 |
use DeliciousBrains\WP_Offload_Media\Gcp\Google\Protobuf\Internal\Message;
|
28 |
use DeliciousBrains\WP_Offload_Media\Gcp\Google\Rpc\BadRequest;
|
29 |
use DeliciousBrains\WP_Offload_Media\Gcp\Google\Rpc\Code;
|
30 |
use DeliciousBrains\WP_Offload_Media\Gcp\Google\Rpc\RetryInfo;
|
|
|
31 |
/**
|
32 |
* The GrpcRequestWrapper is responsible for delivering gRPC requests.
|
33 |
*/
|
72 |
public function __construct(array $config = [])
|
73 |
{
|
74 |
$this->setCommonDefaults($config);
|
75 |
+
$config += ['authHttpHandler' => null, 'serializer' => new \DeliciousBrains\WP_Offload_Media\Gcp\Google\ApiCore\Serializer(), 'grpcOptions' => []];
|
76 |
$this->authHttpHandler = $config['authHttpHandler'] ?: \DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth\HttpHandler\HttpHandlerFactory::build();
|
77 |
$this->serializer = $config['serializer'];
|
78 |
$this->grpcOptions = $config['grpcOptions'];
|
114 |
try {
|
115 |
return $this->handleResponse($backoff->execute($request, $args));
|
116 |
} catch (\Exception $ex) {
|
117 |
+
if ($ex instanceof ApiException) {
|
118 |
throw $this->convertToGoogleException($ex);
|
119 |
}
|
120 |
throw $ex;
|
124 |
* Serializes a gRPC response.
|
125 |
*
|
126 |
* @param mixed $response
|
127 |
+
* @return \Generator|OperationResponse|array|null
|
128 |
*/
|
129 |
private function handleResponse($response)
|
130 |
{
|
131 |
+
if ($response instanceof PagedListResponse) {
|
132 |
$response = $response->getPage()->getResponseObject();
|
133 |
}
|
134 |
if ($response instanceof Message) {
|
135 |
return $this->serializer->encodeMessage($response);
|
136 |
}
|
137 |
+
if ($response instanceof OperationResponse) {
|
138 |
return $response;
|
139 |
}
|
140 |
+
if ($response instanceof ServerStream) {
|
141 |
return $this->handleStream($response);
|
142 |
}
|
143 |
return null;
|
145 |
/**
|
146 |
* Handles a streaming response.
|
147 |
*
|
148 |
+
* @param ServerStream $response
|
149 |
* @return \Generator|array|null
|
150 |
*/
|
151 |
private function handleStream($response)
|
162 |
/**
|
163 |
* Convert a ApiCore exception to a Google Exception.
|
164 |
*
|
165 |
+
* @param \Exception $ex
|
166 |
* @return Exception\ServiceException
|
167 |
*/
|
168 |
private function convertToGoogleException($ex)
|
210 |
}
|
211 |
return new $exception($ex->getMessage(), $ex->getCode(), $ex, $metadata);
|
212 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
213 |
}
|
@@ -17,11 +17,7 @@
|
|
17 |
*/
|
18 |
namespace DeliciousBrains\WP_Offload_Media\Gcp\Google\Cloud\Core;
|
19 |
|
20 |
-
use DateTime;
|
21 |
-
use DateTimeZone;
|
22 |
use DeliciousBrains\WP_Offload_Media\Gcp\Google\ApiCore\CredentialsWrapper;
|
23 |
-
use DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth\Cache\MemoryCacheItemPool;
|
24 |
-
use DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth\FetchAuthTokenCache;
|
25 |
use DeliciousBrains\WP_Offload_Media\Gcp\Google\Cloud\Core\ArrayTrait;
|
26 |
use DeliciousBrains\WP_Offload_Media\Gcp\Google\Cloud\Core\Exception\NotFoundException;
|
27 |
use DeliciousBrains\WP_Offload_Media\Gcp\Google\Cloud\Core\GrpcRequestWrapper;
|
@@ -220,4 +216,15 @@ trait GrpcTrait
|
|
220 |
list($dt, $nanos) = $this->parseTimeString($value);
|
221 |
return ['seconds' => (int) $dt->format('U'), 'nanos' => (int) $nanos];
|
222 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
223 |
}
|
17 |
*/
|
18 |
namespace DeliciousBrains\WP_Offload_Media\Gcp\Google\Cloud\Core;
|
19 |
|
|
|
|
|
20 |
use DeliciousBrains\WP_Offload_Media\Gcp\Google\ApiCore\CredentialsWrapper;
|
|
|
|
|
21 |
use DeliciousBrains\WP_Offload_Media\Gcp\Google\Cloud\Core\ArrayTrait;
|
22 |
use DeliciousBrains\WP_Offload_Media\Gcp\Google\Cloud\Core\Exception\NotFoundException;
|
23 |
use DeliciousBrains\WP_Offload_Media\Gcp\Google\Cloud\Core\GrpcRequestWrapper;
|
216 |
list($dt, $nanos) = $this->parseTimeString($value);
|
217 |
return ['seconds' => (int) $dt->format('U'), 'nanos' => (int) $nanos];
|
218 |
}
|
219 |
+
/**
|
220 |
+
* Construct a gapic client. Allows for tests to intercept.
|
221 |
+
*
|
222 |
+
* @param string $gapicName
|
223 |
+
* @param array $config
|
224 |
+
* @return mixed
|
225 |
+
*/
|
226 |
+
protected function constructGapic($gapicName, array $config)
|
227 |
+
{
|
228 |
+
return new $gapicName($config);
|
229 |
+
}
|
230 |
}
|
@@ -50,7 +50,7 @@ trait ItemIteratorTrait
|
|
50 |
*/
|
51 |
public function nextResultToken()
|
52 |
{
|
53 |
-
return $this->pageIterator->nextResultToken();
|
54 |
}
|
55 |
/**
|
56 |
* Iterate over the results on a per page basis.
|
50 |
*/
|
51 |
public function nextResultToken()
|
52 |
{
|
53 |
+
return method_exists($this->pageIterator, 'nextResultToken') ? $this->pageIterator->nextResultToken() : null;
|
54 |
}
|
55 |
/**
|
56 |
* Iterate over the results on a per page basis.
|
@@ -32,7 +32,7 @@ trait JsonTrait
|
|
32 |
* @return mixed
|
33 |
* @throws \InvalidArgumentException
|
34 |
*/
|
35 |
-
private function jsonDecode($json, $assoc = false, $depth = 512, $options = 0)
|
36 |
{
|
37 |
$data = json_decode($json, $assoc, $depth, $options);
|
38 |
if (JSON_ERROR_NONE !== json_last_error()) {
|
@@ -48,7 +48,7 @@ trait JsonTrait
|
|
48 |
* @return string
|
49 |
* @throws \InvalidArgumentException
|
50 |
*/
|
51 |
-
private function jsonEncode($value, $options = 0, $depth = 512)
|
52 |
{
|
53 |
$json = json_encode($value, $options, $depth);
|
54 |
if (JSON_ERROR_NONE !== json_last_error()) {
|
32 |
* @return mixed
|
33 |
* @throws \InvalidArgumentException
|
34 |
*/
|
35 |
+
private static function jsonDecode($json, $assoc = false, $depth = 512, $options = 0)
|
36 |
{
|
37 |
$data = json_decode($json, $assoc, $depth, $options);
|
38 |
if (JSON_ERROR_NONE !== json_last_error()) {
|
48 |
* @return string
|
49 |
* @throws \InvalidArgumentException
|
50 |
*/
|
51 |
+
private static function jsonEncode($value, $options = 0, $depth = 512)
|
52 |
{
|
53 |
$json = json_encode($value, $options, $depth);
|
54 |
if (JSON_ERROR_NONE !== json_last_error()) {
|
@@ -17,14 +17,15 @@
|
|
17 |
*/
|
18 |
namespace DeliciousBrains\WP_Offload_Media\Gcp\Google\Cloud\Core\Logger;
|
19 |
|
20 |
-
use DeliciousBrains\WP_Offload_Media\Gcp\Google\Cloud\Core\JsonTrait;
|
21 |
use DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Formatter\LineFormatter;
|
22 |
/**
|
23 |
-
*
|
|
|
|
|
24 |
*/
|
25 |
class AppEngineFlexFormatter extends \DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Formatter\LineFormatter
|
26 |
{
|
27 |
-
use
|
28 |
/**
|
29 |
* @param string $format [optional] The format of the message
|
30 |
* @param string $dateFormat [optional] The format of the timestamp
|
@@ -39,18 +40,10 @@ class AppEngineFlexFormatter extends \DeliciousBrains\WP_Offload_Media\Gcp\Monol
|
|
39 |
* metadata including the trace id then return the json string.
|
40 |
*
|
41 |
* @param array $record A record to format
|
42 |
-
* @return
|
43 |
*/
|
44 |
public function format(array $record)
|
45 |
{
|
46 |
-
$
|
47 |
-
list($usec, $sec) = explode(" ", microtime());
|
48 |
-
$usec = (int) ((double) $usec * 1000000000);
|
49 |
-
$sec = (int) $sec;
|
50 |
-
$payload = ['message' => $message, 'timestamp' => ['seconds' => $sec, 'nanos' => $usec], 'thread' => '', 'severity' => $record['level_name']];
|
51 |
-
if (isset($_SERVER['HTTP_X_CLOUD_TRACE_CONTEXT'])) {
|
52 |
-
$payload['traceId'] = explode("/", $_SERVER['HTTP_X_CLOUD_TRACE_CONTEXT'])[0];
|
53 |
-
}
|
54 |
-
return "\n" . $this->jsonEncode($payload);
|
55 |
}
|
56 |
}
|
17 |
*/
|
18 |
namespace DeliciousBrains\WP_Offload_Media\Gcp\Google\Cloud\Core\Logger;
|
19 |
|
|
|
20 |
use DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Formatter\LineFormatter;
|
21 |
/**
|
22 |
+
* Monolog 1.x formatter for formatting logs on App Engine flexible environment.
|
23 |
+
*
|
24 |
+
* If you are using Monolog 2.x, use {@see \Google\Cloud\Core\Logger\AppEngineFlexFormatterV2} instead.
|
25 |
*/
|
26 |
class AppEngineFlexFormatter extends \DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Formatter\LineFormatter
|
27 |
{
|
28 |
+
use FormatterTrait;
|
29 |
/**
|
30 |
* @param string $format [optional] The format of the message
|
31 |
* @param string $dateFormat [optional] The format of the timestamp
|
40 |
* metadata including the trace id then return the json string.
|
41 |
*
|
42 |
* @param array $record A record to format
|
43 |
+
* @return string The formatted record
|
44 |
*/
|
45 |
public function format(array $record)
|
46 |
{
|
47 |
+
return $this->formatPayload($record, parent::format($record));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
48 |
}
|
49 |
}
|
@@ -0,0 +1,49 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* Copyright 2019 Google LLC
|
5 |
+
*
|
6 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
7 |
+
* you may not use this file except in compliance with the License.
|
8 |
+
* You may obtain a copy of the License at
|
9 |
+
*
|
10 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
11 |
+
*
|
12 |
+
* Unless required by applicable law or agreed to in writing, software
|
13 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
14 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
15 |
+
* See the License for the specific language governing permissions and
|
16 |
+
* limitations under the License.
|
17 |
+
*/
|
18 |
+
namespace DeliciousBrains\WP_Offload_Media\Gcp\Google\Cloud\Core\Logger;
|
19 |
+
|
20 |
+
use DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Formatter\LineFormatter;
|
21 |
+
/**
|
22 |
+
* Monolog 2.x formatter for formatting logs on App Engine flexible environment.
|
23 |
+
*
|
24 |
+
* If you are using Monolog 1.x, use {@see \Google\Cloud\Core\Logger\AppEngineFlexFormatter} instead.
|
25 |
+
*/
|
26 |
+
class AppEngineFlexFormatterV2 extends \DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Formatter\LineFormatter
|
27 |
+
{
|
28 |
+
use FormatterTrait;
|
29 |
+
/**
|
30 |
+
* @param string $format [optional] The format of the message
|
31 |
+
* @param string $dateFormat [optional] The format of the timestamp
|
32 |
+
* @param bool $ignoreEmptyContextAndExtra [optional]
|
33 |
+
*/
|
34 |
+
public function __construct($format = null, $dateFormat = null, $ignoreEmptyContextAndExtra = false)
|
35 |
+
{
|
36 |
+
parent::__construct($format, $dateFormat, true, $ignoreEmptyContextAndExtra);
|
37 |
+
}
|
38 |
+
/**
|
39 |
+
* Get the plain text message with LineFormatter's format method and add
|
40 |
+
* metadata including the trace id then return the json string.
|
41 |
+
*
|
42 |
+
* @param array $record A record to format
|
43 |
+
* @return string The formatted record
|
44 |
+
*/
|
45 |
+
public function format(array $record) : string
|
46 |
+
{
|
47 |
+
return $this->formatPayload($record, parent::format($record));
|
48 |
+
}
|
49 |
+
}
|
@@ -21,7 +21,9 @@ use DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Formatter\FormatterInterface;
|
|
21 |
use DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Handler\StreamHandler;
|
22 |
use DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Logger;
|
23 |
/**
|
24 |
-
*
|
|
|
|
|
25 |
*/
|
26 |
class AppEngineFlexHandler extends \DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Handler\StreamHandler
|
27 |
{
|
@@ -39,7 +41,7 @@ class AppEngineFlexHandler extends \DeliciousBrains\WP_Offload_Media\Gcp\Monolog
|
|
39 |
public function __construct($level = \DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Logger::INFO, $bubble = true, $filePermission = 0640, $useLocking = false, $stream = null)
|
40 |
{
|
41 |
if ($stream === null) {
|
42 |
-
$pid =
|
43 |
$stream = "file:///var/log/app_engine/app.{$pid}.json";
|
44 |
}
|
45 |
parent::__construct($stream, $level, $bubble, $filePermission, $useLocking);
|
21 |
use DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Handler\StreamHandler;
|
22 |
use DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Logger;
|
23 |
/**
|
24 |
+
* Monolog 1.x handler for logging on App Engine flexible environment.
|
25 |
+
*
|
26 |
+
* If you are using Monolog 2.x, use {@see \Google\Cloud\Core\Logger\AppEngineFlexHandlerV2} instead.
|
27 |
*/
|
28 |
class AppEngineFlexHandler extends \DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Handler\StreamHandler
|
29 |
{
|
41 |
public function __construct($level = \DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Logger::INFO, $bubble = true, $filePermission = 0640, $useLocking = false, $stream = null)
|
42 |
{
|
43 |
if ($stream === null) {
|
44 |
+
$pid = getmypid();
|
45 |
$stream = "file:///var/log/app_engine/app.{$pid}.json";
|
46 |
}
|
47 |
parent::__construct($stream, $level, $bubble, $filePermission, $useLocking);
|
@@ -0,0 +1,56 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* Copyright 2019 Google LLC
|
5 |
+
*
|
6 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
7 |
+
* you may not use this file except in compliance with the License.
|
8 |
+
* You may obtain a copy of the License at
|
9 |
+
*
|
10 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
11 |
+
*
|
12 |
+
* Unless required by applicable law or agreed to in writing, software
|
13 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
14 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
15 |
+
* See the License for the specific language governing permissions and
|
16 |
+
* limitations under the License.
|
17 |
+
*/
|
18 |
+
namespace DeliciousBrains\WP_Offload_Media\Gcp\Google\Cloud\Core\Logger;
|
19 |
+
|
20 |
+
use Exception;
|
21 |
+
use DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Logger;
|
22 |
+
/**
|
23 |
+
* Factory to build out an AppEngineFlexHandler for the installed version of Monolog.
|
24 |
+
*/
|
25 |
+
class AppEngineFlexHandlerFactory
|
26 |
+
{
|
27 |
+
/**
|
28 |
+
* Builds out an AppEngineFlexHandler for the installed version of Monolog.
|
29 |
+
*
|
30 |
+
* @param int $level [optional] The minimum logging level at which this
|
31 |
+
* handler will be triggered.
|
32 |
+
* @param Boolean $bubble [optional] Whether the messages that are handled
|
33 |
+
* can bubble up the stack or not.
|
34 |
+
* @param int|null $filePermission [optional] Optional file permissions
|
35 |
+
* (default (0640) are only for owner read/write).
|
36 |
+
* @param Boolean $useLocking [optional] Try to lock log file before doing
|
37 |
+
* any writes.
|
38 |
+
* @param resource|string|null $stream [optional]
|
39 |
+
*
|
40 |
+
* @throws Exception
|
41 |
+
*
|
42 |
+
* @return AppEngineFlexHandler|AppEngineFlexHandlerV2
|
43 |
+
*/
|
44 |
+
public static function build($level = \DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Logger::INFO, $bubble = true, $filePermission = 0640, $useLocking = false, $stream = null)
|
45 |
+
{
|
46 |
+
$version = defined('DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Logger::API') ? \DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Logger::API : 1;
|
47 |
+
switch ($version) {
|
48 |
+
case 1:
|
49 |
+
return new \DeliciousBrains\WP_Offload_Media\Gcp\Google\Cloud\Core\Logger\AppEngineFlexHandler($level, $bubble, $filePermission, $useLocking, $stream);
|
50 |
+
case 2:
|
51 |
+
return new \DeliciousBrains\WP_Offload_Media\Gcp\Google\Cloud\Core\Logger\AppEngineFlexHandlerV2($level, $bubble, $filePermission, $useLocking, $stream);
|
52 |
+
default:
|
53 |
+
throw new \Exception('Version not supported');
|
54 |
+
}
|
55 |
+
}
|
56 |
+
}
|
@@ -0,0 +1,53 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* Copyright 2019 Google LLC
|
5 |
+
*
|
6 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
7 |
+
* you may not use this file except in compliance with the License.
|
8 |
+
* You may obtain a copy of the License at
|
9 |
+
*
|
10 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
11 |
+
*
|
12 |
+
* Unless required by applicable law or agreed to in writing, software
|
13 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
14 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
15 |
+
* See the License for the specific language governing permissions and
|
16 |
+
* limitations under the License.
|
17 |
+
*/
|
18 |
+
namespace DeliciousBrains\WP_Offload_Media\Gcp\Google\Cloud\Core\Logger;
|
19 |
+
|
20 |
+
use DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Formatter\FormatterInterface;
|
21 |
+
use DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Handler\StreamHandler;
|
22 |
+
use DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Logger;
|
23 |
+
/**
|
24 |
+
* Monolog 2.x handler for logging on App Engine flexible environment.
|
25 |
+
*
|
26 |
+
* If you are using Monolog 1.x, use {@see \Google\Cloud\Core\Logger\AppEngineFlexHandler} instead.
|
27 |
+
*/
|
28 |
+
class AppEngineFlexHandlerV2 extends \DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Handler\StreamHandler
|
29 |
+
{
|
30 |
+
/**
|
31 |
+
* @param int $level [optional] The minimum logging level at which this
|
32 |
+
* handler will be triggered.
|
33 |
+
* @param Boolean $bubble [optional] Whether the messages that are handled
|
34 |
+
* can bubble up the stack or not.
|
35 |
+
* @param int|null $filePermission [optional] Optional file permissions
|
36 |
+
* (default (0640) are only for owner read/write).
|
37 |
+
* @param Boolean $useLocking [optional] Try to lock log file before doing
|
38 |
+
* any writes.
|
39 |
+
* @param resource|string|null $stream [optional]
|
40 |
+
*/
|
41 |
+
public function __construct($level = \DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Logger::INFO, $bubble = true, $filePermission = 0640, $useLocking = false, $stream = null)
|
42 |
+
{
|
43 |
+
if ($stream === null) {
|
44 |
+
$pid = getmypid();
|
45 |
+
$stream = "file:///var/log/app_engine/app.{$pid}.json";
|
46 |
+
}
|
47 |
+
parent::__construct($stream, $level, $bubble, $filePermission, $useLocking);
|
48 |
+
}
|
49 |
+
protected function getDefaultFormatter() : FormatterInterface
|
50 |
+
{
|
51 |
+
return new \DeliciousBrains\WP_Offload_Media\Gcp\Google\Cloud\Core\Logger\AppEngineFlexFormatterV2();
|
52 |
+
}
|
53 |
+
}
|
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* Copyright 2019 Google LLC
|
5 |
+
*
|
6 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
7 |
+
* you may not use this file except in compliance with the License.
|
8 |
+
* You may obtain a copy of the License at
|
9 |
+
*
|
10 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
11 |
+
*
|
12 |
+
* Unless required by applicable law or agreed to in writing, software
|
13 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
14 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
15 |
+
* See the License for the specific language governing permissions and
|
16 |
+
* limitations under the License.
|
17 |
+
*/
|
18 |
+
namespace DeliciousBrains\WP_Offload_Media\Gcp\Google\Cloud\Core\Logger;
|
19 |
+
|
20 |
+
/**
|
21 |
+
* Shared trait to enrich and format a record with
|
22 |
+
* App Engine Flex specific information.
|
23 |
+
*/
|
24 |
+
trait FormatterTrait
|
25 |
+
{
|
26 |
+
protected function formatPayload(array $record, $message)
|
27 |
+
{
|
28 |
+
list($usec, $sec) = explode(' ', microtime());
|
29 |
+
$usec = (int) ((double) $usec * 1000000000);
|
30 |
+
$sec = (int) $sec;
|
31 |
+
$payload = ['message' => $message, 'timestamp' => ['seconds' => $sec, 'nanos' => $usec], 'thread' => '', 'severity' => $record['level_name']];
|
32 |
+
if (isset($_SERVER['HTTP_X_CLOUD_TRACE_CONTEXT'])) {
|
33 |
+
$payload['traceId'] = explode('/', $_SERVER['HTTP_X_CLOUD_TRACE_CONTEXT'])[0];
|
34 |
+
}
|
35 |
+
return "\n" . json_encode($payload);
|
36 |
+
}
|
37 |
+
}
|
@@ -26,6 +26,7 @@ use DeliciousBrains\WP_Offload_Media\Gcp\google\protobuf\Struct;
|
|
26 |
* Extend the Protobuf-PHP array codec to allow messages to match the format
|
27 |
* used for REST.
|
28 |
* @deprecated
|
|
|
29 |
*/
|
30 |
class PhpArray extends \DeliciousBrains\WP_Offload_Media\Gcp\DrSlump\Protobuf\Codec\PhpArray
|
31 |
{
|
26 |
* Extend the Protobuf-PHP array codec to allow messages to match the format
|
27 |
* used for REST.
|
28 |
* @deprecated
|
29 |
+
* @codeCoverageIgnore
|
30 |
*/
|
31 |
class PhpArray extends \DeliciousBrains\WP_Offload_Media\Gcp\DrSlump\Protobuf\Codec\PhpArray
|
32 |
{
|
@@ -19,6 +19,7 @@ namespace DeliciousBrains\WP_Offload_Media\Gcp\Google\Cloud\Core;
|
|
19 |
|
20 |
use DeliciousBrains\WP_Offload_Media\Gcp\GuzzleHttp\Psr7;
|
21 |
use DeliciousBrains\WP_Offload_Media\Gcp\GuzzleHttp\Psr7\Request;
|
|
|
22 |
use DeliciousBrains\WP_Offload_Media\Gcp\Psr\Http\Message\RequestInterface;
|
23 |
/**
|
24 |
* Builds a PSR7 request from a service definition.
|
@@ -51,8 +52,18 @@ class RequestBuilder
|
|
51 |
public function __construct($servicePath, $baseUri, array $resourceRoot = [])
|
52 |
{
|
53 |
$this->service = $this->loadServiceDefinition($servicePath);
|
54 |
-
$this->baseUri = $baseUri;
|
55 |
$this->resourceRoot = $resourceRoot;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
56 |
}
|
57 |
/**
|
58 |
* Build the request.
|
19 |
|
20 |
use DeliciousBrains\WP_Offload_Media\Gcp\GuzzleHttp\Psr7;
|
21 |
use DeliciousBrains\WP_Offload_Media\Gcp\GuzzleHttp\Psr7\Request;
|
22 |
+
use DeliciousBrains\WP_Offload_Media\Gcp\GuzzleHttp\Psr7\Uri;
|
23 |
use DeliciousBrains\WP_Offload_Media\Gcp\Psr\Http\Message\RequestInterface;
|
24 |
/**
|
25 |
* Builds a PSR7 request from a service definition.
|
52 |
public function __construct($servicePath, $baseUri, array $resourceRoot = [])
|
53 |
{
|
54 |
$this->service = $this->loadServiceDefinition($servicePath);
|
|
|
55 |
$this->resourceRoot = $resourceRoot;
|
56 |
+
// Append service definition base path if bare apiEndpoint domain is given.
|
57 |
+
if (isset($this->service['basePath'])) {
|
58 |
+
$uriParts = parse_url($baseUri) + ['path' => null];
|
59 |
+
if (!$uriParts['path'] || $uriParts['path'] === '/') {
|
60 |
+
$uriParts['path'] = $this->service['basePath'];
|
61 |
+
// Recreate the URI from its modified parts and ensure it ends in a single slash.
|
62 |
+
$this->baseUri = rtrim((string) \DeliciousBrains\WP_Offload_Media\Gcp\GuzzleHttp\Psr7\Uri::fromParts($uriParts), '/') . '/';
|
63 |
+
return;
|
64 |
+
}
|
65 |
+
}
|
66 |
+
$this->baseUri = rtrim($baseUri, '/') . '/';
|
67 |
}
|
68 |
/**
|
69 |
* Build the request.
|
@@ -33,7 +33,6 @@ use DeliciousBrains\WP_Offload_Media\Gcp\Psr\Http\Message\StreamInterface;
|
|
33 |
*/
|
34 |
class RequestWrapper
|
35 |
{
|
36 |
-
use JsonTrait;
|
37 |
use RequestWrapperTrait;
|
38 |
use RetryDeciderTrait;
|
39 |
/**
|
@@ -72,15 +71,14 @@ class RequestWrapper
|
|
72 |
*/
|
73 |
private $retryFunction;
|
74 |
/**
|
75 |
-
* @var callable
|
76 |
-
* between attempts to retry.
|
77 |
*/
|
78 |
-
private $
|
79 |
/**
|
80 |
-
* @var callable Sets the conditions for determining how long to wait
|
81 |
* between attempts to retry.
|
82 |
*/
|
83 |
-
private $
|
84 |
/**
|
85 |
* @param array $config [optional] {
|
86 |
* Configuration options. Please see
|
@@ -103,15 +101,20 @@ class RequestWrapper
|
|
103 |
* @type array $restOptions HTTP client specific configuration options.
|
104 |
* @type bool $shouldSignRequest Whether to enable request signing.
|
105 |
* @type callable $restRetryFunction Sets the conditions for whether or
|
106 |
-
* not a request should attempt to retry.
|
107 |
-
*
|
108 |
-
*
|
|
|
|
|
|
|
|
|
|
|
109 |
* }
|
110 |
*/
|
111 |
public function __construct(array $config = [])
|
112 |
{
|
113 |
$this->setCommonDefaults($config);
|
114 |
-
$config += ['accessToken' => null, 'asyncHttpHandler' => null, 'authHttpHandler' => null, 'httpHandler' => null, 'restOptions' => [], 'shouldSignRequest' => true, 'componentVersion' => null, 'restRetryFunction' => null, 'restDelayFunction' => null];
|
115 |
$this->componentVersion = $config['componentVersion'];
|
116 |
$this->accessToken = $config['accessToken'];
|
117 |
$this->restOptions = $config['restOptions'];
|
@@ -120,6 +123,7 @@ class RequestWrapper
|
|
120 |
$this->delayFunction = $config['restDelayFunction'] ?: function ($delay) {
|
121 |
usleep($delay);
|
122 |
};
|
|
|
123 |
$this->httpHandler = $config['httpHandler'] ?: \DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth\HttpHandler\HttpHandlerFactory::build();
|
124 |
$this->authHttpHandler = $config['authHttpHandler'] ?: $this->httpHandler;
|
125 |
$this->asyncHttpHandler = $config['asyncHttpHandler'] ?: $this->buildDefaultAsyncHandler();
|
@@ -139,9 +143,14 @@ class RequestWrapper
|
|
139 |
* @type int $retries Number of retries for a failed request.
|
140 |
* **Defaults to** `3`.
|
141 |
* @type callable $restRetryFunction Sets the conditions for whether or
|
142 |
-
* not a request should attempt to retry.
|
143 |
-
*
|
144 |
-
*
|
|
|
|
|
|
|
|
|
|
|
145 |
* @type array $restOptions HTTP client specific configuration options.
|
146 |
* }
|
147 |
* @return ResponseInterface
|
@@ -149,7 +158,13 @@ class RequestWrapper
|
|
149 |
public function send(\DeliciousBrains\WP_Offload_Media\Gcp\Psr\Http\Message\RequestInterface $request, array $options = [])
|
150 |
{
|
151 |
$retryOptions = $this->getRetryOptions($options);
|
152 |
-
$backoff =
|
|
|
|
|
|
|
|
|
|
|
|
|
153 |
try {
|
154 |
return $backoff->execute($this->httpHandler, [$this->applyHeaders($request), $this->getRequestOptions($options)]);
|
155 |
} catch (\Exception $ex) {
|
@@ -168,9 +183,14 @@ class RequestWrapper
|
|
168 |
* @type int $retries Number of retries for a failed request.
|
169 |
* **Defaults to** `3`.
|
170 |
* @type callable $restRetryFunction Sets the conditions for whether or
|
171 |
-
* not a request should attempt to retry.
|
172 |
-
*
|
173 |
-
*
|
|
|
|
|
|
|
|
|
|
|
174 |
* @type array $restOptions HTTP client specific configuration options.
|
175 |
* }
|
176 |
* @return PromiseInterface<ResponseInterface>
|
@@ -187,12 +207,16 @@ class RequestWrapper
|
|
187 |
$fn = function ($retryAttempt) use(&$fn, $request, $options) {
|
188 |
$asyncHttpHandler = $this->asyncHttpHandler;
|
189 |
$retryOptions = $this->getRetryOptions($options);
|
|
|
|
|
|
|
190 |
return $asyncHttpHandler($this->applyHeaders($request), $this->getRequestOptions($options))->then(null, function (\Exception $ex) use($fn, $retryAttempt, $retryOptions) {
|
191 |
$shouldRetry = $retryOptions['retryFunction']($ex);
|
192 |
if ($shouldRetry === false || $retryAttempt >= $retryOptions['retries']) {
|
193 |
throw $this->convertToGoogleException($ex);
|
194 |
}
|
195 |
-
$retryOptions['
|
|
|
196 |
$retryAttempt++;
|
197 |
return $fn($retryAttempt);
|
198 |
});
|
@@ -275,38 +299,17 @@ class RequestWrapper
|
|
275 |
/**
|
276 |
* Gets the exception message.
|
277 |
*
|
|
|
278 |
* @param \Exception $ex
|
279 |
* @return string
|
280 |
*/
|
281 |
private function getExceptionMessage(\Exception $ex)
|
282 |
{
|
283 |
if ($ex instanceof RequestException && $ex->hasResponse()) {
|
284 |
-
|
285 |
-
try {
|
286 |
-
$this->jsonDecode($res);
|
287 |
-
return $res;
|
288 |
-
} catch (\InvalidArgumentException $e) {
|
289 |
-
// no-op
|
290 |
-
}
|
291 |
}
|
292 |
return $ex->getMessage();
|
293 |
}
|
294 |
-
/**
|
295 |
-
* Configures an exponential backoff implementation.
|
296 |
-
*
|
297 |
-
* @param int $retries
|
298 |
-
* @param callable $retryFunction
|
299 |
-
* @param callable $delayFunction
|
300 |
-
* @return ExponentialBackoff
|
301 |
-
*/
|
302 |
-
private function configureBackoff($retries, callable $retryFunction, callable $delayFunction)
|
303 |
-
{
|
304 |
-
$backoff = new \DeliciousBrains\WP_Offload_Media\Gcp\Google\Cloud\Core\ExponentialBackoff($retries, $retryFunction);
|
305 |
-
if ($delayFunction) {
|
306 |
-
$backoff->setDelayFunction($delayFunction);
|
307 |
-
}
|
308 |
-
return $backoff;
|
309 |
-
}
|
310 |
/**
|
311 |
* Gets a set of request options.
|
312 |
*
|
@@ -330,7 +333,7 @@ class RequestWrapper
|
|
330 |
*/
|
331 |
private function getRetryOptions(array $options)
|
332 |
{
|
333 |
-
return ['retries' => isset($options['retries']) ? $options['retries'] : $this->retries, 'retryFunction' => isset($options['restRetryFunction']) ? $options['restRetryFunction'] : $this->retryFunction, 'delayFunction' => isset($options['restDelayFunction']) ? $options['restDelayFunction'] : $this->delayFunction];
|
334 |
}
|
335 |
/**
|
336 |
* Builds the default async HTTP handler.
|
33 |
*/
|
34 |
class RequestWrapper
|
35 |
{
|
|
|
36 |
use RequestWrapperTrait;
|
37 |
use RetryDeciderTrait;
|
38 |
/**
|
71 |
*/
|
72 |
private $retryFunction;
|
73 |
/**
|
74 |
+
* @var callable Executes a delay.
|
|
|
75 |
*/
|
76 |
+
private $delayFunction;
|
77 |
/**
|
78 |
+
* @var callable|null Sets the conditions for determining how long to wait
|
79 |
* between attempts to retry.
|
80 |
*/
|
81 |
+
private $calcDelayFunction;
|
82 |
/**
|
83 |
* @param array $config [optional] {
|
84 |
* Configuration options. Please see
|
101 |
* @type array $restOptions HTTP client specific configuration options.
|
102 |
* @type bool $shouldSignRequest Whether to enable request signing.
|
103 |
* @type callable $restRetryFunction Sets the conditions for whether or
|
104 |
+
* not a request should attempt to retry. Function signature should
|
105 |
+
* match: `function (\Exception $ex) : bool`.
|
106 |
+
* @type callable $restDelayFunction Executes a delay, defaults to
|
107 |
+
* utilizing `usleep`. Function signature should match:
|
108 |
+
* `function (int $delay) : void`.
|
109 |
+
* @type callable $restCalcDelayFunction Sets the conditions for
|
110 |
+
* determining how long to wait between attempts to retry. Function
|
111 |
+
* signature should match: `function (int $attempt) : int`.
|
112 |
* }
|
113 |
*/
|
114 |
public function __construct(array $config = [])
|
115 |
{
|
116 |
$this->setCommonDefaults($config);
|
117 |
+
$config += ['accessToken' => null, 'asyncHttpHandler' => null, 'authHttpHandler' => null, 'httpHandler' => null, 'restOptions' => [], 'shouldSignRequest' => true, 'componentVersion' => null, 'restRetryFunction' => null, 'restDelayFunction' => null, 'restCalcDelayFunction' => null];
|
118 |
$this->componentVersion = $config['componentVersion'];
|
119 |
$this->accessToken = $config['accessToken'];
|
120 |
$this->restOptions = $config['restOptions'];
|
123 |
$this->delayFunction = $config['restDelayFunction'] ?: function ($delay) {
|
124 |
usleep($delay);
|
125 |
};
|
126 |
+
$this->calcDelayFunction = $config['restCalcDelayFunction'];
|
127 |
$this->httpHandler = $config['httpHandler'] ?: \DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth\HttpHandler\HttpHandlerFactory::build();
|
128 |
$this->authHttpHandler = $config['authHttpHandler'] ?: $this->httpHandler;
|
129 |
$this->asyncHttpHandler = $config['asyncHttpHandler'] ?: $this->buildDefaultAsyncHandler();
|
143 |
* @type int $retries Number of retries for a failed request.
|
144 |
* **Defaults to** `3`.
|
145 |
* @type callable $restRetryFunction Sets the conditions for whether or
|
146 |
+
* not a request should attempt to retry. Function signature should
|
147 |
+
* match: `function (\Exception $ex) : bool`.
|
148 |
+
* @type callable $restDelayFunction Executes a delay, defaults to
|
149 |
+
* utilizing `usleep`. Function signature should match:
|
150 |
+
* `function (int $delay) : void`.
|
151 |
+
* @type callable $restCalcDelayFunction Sets the conditions for
|
152 |
+
* determining how long to wait between attempts to retry. Function
|
153 |
+
* signature should match: `function (int $attempt) : int`.
|
154 |
* @type array $restOptions HTTP client specific configuration options.
|
155 |
* }
|
156 |
* @return ResponseInterface
|
158 |
public function send(\DeliciousBrains\WP_Offload_Media\Gcp\Psr\Http\Message\RequestInterface $request, array $options = [])
|
159 |
{
|
160 |
$retryOptions = $this->getRetryOptions($options);
|
161 |
+
$backoff = new \DeliciousBrains\WP_Offload_Media\Gcp\Google\Cloud\Core\ExponentialBackoff($retryOptions['retries'], $retryOptions['retryFunction']);
|
162 |
+
if ($retryOptions['delayFunction']) {
|
163 |
+
$backoff->setDelayFunction($retryOptions['delayFunction']);
|
164 |
+
}
|
165 |
+
if ($retryOptions['calcDelayFunction']) {
|
166 |
+
$backoff->setCalcDelayFunction($retryOptions['calcDelayFunction']);
|
167 |
+
}
|
168 |
try {
|
169 |
return $backoff->execute($this->httpHandler, [$this->applyHeaders($request), $this->getRequestOptions($options)]);
|
170 |
} catch (\Exception $ex) {
|
183 |
* @type int $retries Number of retries for a failed request.
|
184 |
* **Defaults to** `3`.
|
185 |
* @type callable $restRetryFunction Sets the conditions for whether or
|
186 |
+
* not a request should attempt to retry. Function signature should
|
187 |
+
* match: `function (\Exception $ex) : bool`.
|
188 |
+
* @type callable $restDelayFunction Executes a delay, defaults to
|
189 |
+
* utilizing `usleep`. Function signature should match:
|
190 |
+
* `function (int $delay) : void`.
|
191 |
+
* @type callable $restCalcDelayFunction Sets the conditions for
|
192 |
+
* determining how long to wait between attempts to retry. Function
|
193 |
+
* signature should match: `function (int $attempt) : int`.
|
194 |
* @type array $restOptions HTTP client specific configuration options.
|
195 |
* }
|
196 |
* @return PromiseInterface<ResponseInterface>
|
207 |
$fn = function ($retryAttempt) use(&$fn, $request, $options) {
|
208 |
$asyncHttpHandler = $this->asyncHttpHandler;
|
209 |
$retryOptions = $this->getRetryOptions($options);
|
210 |
+
if (!$retryOptions['calcDelayFunction']) {
|
211 |
+
$retryOptions['calcDelayFunction'] = [\DeliciousBrains\WP_Offload_Media\Gcp\Google\Cloud\Core\ExponentialBackoff::class, 'calculateDelay'];
|
212 |
+
}
|
213 |
return $asyncHttpHandler($this->applyHeaders($request), $this->getRequestOptions($options))->then(null, function (\Exception $ex) use($fn, $retryAttempt, $retryOptions) {
|
214 |
$shouldRetry = $retryOptions['retryFunction']($ex);
|
215 |
if ($shouldRetry === false || $retryAttempt >= $retryOptions['retries']) {
|
216 |
throw $this->convertToGoogleException($ex);
|
217 |
}
|
218 |
+
$delay = $retryOptions['calcDelayFunction']($retryAttempt);
|
219 |
+
$retryOptions['delayFunction']($delay);
|
220 |
$retryAttempt++;
|
221 |
return $fn($retryAttempt);
|
222 |
});
|
299 |
/**
|
300 |
* Gets the exception message.
|
301 |
*
|
302 |
+
* @access private
|
303 |
* @param \Exception $ex
|
304 |
* @return string
|
305 |
*/
|
306 |
private function getExceptionMessage(\Exception $ex)
|
307 |
{
|
308 |
if ($ex instanceof RequestException && $ex->hasResponse()) {
|
309 |
+
return (string) $ex->getResponse()->getBody();
|
|
|
|
|
|
|
|
|
|
|
|
|
310 |
}
|
311 |
return $ex->getMessage();
|
312 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
313 |
/**
|
314 |
* Gets a set of request options.
|
315 |
*
|
333 |
*/
|
334 |
private function getRetryOptions(array $options)
|
335 |
{
|
336 |
+
return ['retries' => isset($options['retries']) ? $options['retries'] : $this->retries, 'retryFunction' => isset($options['restRetryFunction']) ? $options['restRetryFunction'] : $this->retryFunction, 'delayFunction' => isset($options['restDelayFunction']) ? $options['restDelayFunction'] : $this->delayFunction, 'calcDelayFunction' => isset($options['restCalcDelayFunction']) ? $options['restCalcDelayFunction'] : $this->calcDelayFunction];
|
337 |
}
|
338 |
/**
|
339 |
* Builds the default async HTTP handler.
|
@@ -37,7 +37,7 @@ trait RequestWrapperTrait
|
|
37 |
*/
|
38 |
private $authCacheOptions;
|
39 |
/**
|
40 |
-
* @var FetchAuthTokenInterface Fetches credentials.
|
41 |
*/
|
42 |
private $credentialsFetcher;
|
43 |
/**
|
@@ -106,6 +106,15 @@ trait RequestWrapperTrait
|
|
106 |
{
|
107 |
return $this->keyFile;
|
108 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
109 |
/**
|
110 |
* Gets the credentials fetcher and sets up caching. Precedence is as
|
111 |
* follows:
|
37 |
*/
|
38 |
private $authCacheOptions;
|
39 |
/**
|
40 |
+
* @var FetchAuthTokenInterface|null Fetches credentials.
|
41 |
*/
|
42 |
private $credentialsFetcher;
|
43 |
/**
|
106 |
{
|
107 |
return $this->keyFile;
|
108 |
}
|
109 |
+
/**
|
110 |
+
* Get the scopes
|
111 |
+
*
|
112 |
+
* @return array
|
113 |
+
*/
|
114 |
+
public function scopes()
|
115 |
+
{
|
116 |
+
return $this->scopes;
|
117 |
+
}
|
118 |
/**
|
119 |
* Gets the credentials fetcher and sets up caching. Precedence is as
|
120 |
* follows:
|
@@ -85,4 +85,22 @@ trait RestTrait
|
|
85 |
throw $e;
|
86 |
}
|
87 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
88 |
}
|
85 |
throw $e;
|
86 |
}
|
87 |
}
|
88 |
+
/**
|
89 |
+
* Return a custom API endpoint in the proper format, or default if none provided.
|
90 |
+
*
|
91 |
+
* @param string $default
|
92 |
+
* @param array $config
|
93 |
+
* @return string
|
94 |
+
*/
|
95 |
+
private function getApiEndpoint($default, array $config)
|
96 |
+
{
|
97 |
+
$res = isset($config['apiEndpoint']) ? $config['apiEndpoint'] : $default;
|
98 |
+
if (substr($res, -1) !== '/') {
|
99 |
+
$res = $res . '/';
|
100 |
+
}
|
101 |
+
if (strpos($res, '//') === false) {
|
102 |
+
$res = 'https://' . $res;
|
103 |
+
}
|
104 |
+
return $res;
|
105 |
+
}
|
106 |
}
|
@@ -32,13 +32,13 @@ class Retry
|
|
32 |
/**
|
33 |
* @var callable
|
34 |
*/
|
35 |
-
private $
|
36 |
/**
|
37 |
-
* @var callable
|
38 |
*/
|
39 |
-
private $
|
40 |
/**
|
41 |
-
* @param int $retries Maximum number of retries for a failed request.
|
42 |
* @param callable $delayFunction A function returning an array of format
|
43 |
* `['seconds' => (int >= 0), 'nanos' => (int >= 0)] specifying how
|
44 |
* long an operation should pause before retrying. Should accept a
|
32 |
/**
|
33 |
* @var callable
|
34 |
*/
|
35 |
+
private $delayFunction;
|
36 |
/**
|
37 |
+
* @var callable|null
|
38 |
*/
|
39 |
+
private $retryFunction;
|
40 |
/**
|
41 |
+
* @param int|null $retries Maximum number of retries for a failed request.
|
42 |
* @param callable $delayFunction A function returning an array of format
|
43 |
* `['seconds' => (int >= 0), 'nanos' => (int >= 0)] specifying how
|
44 |
* long an operation should pause before retrying. Should accept a
|
@@ -17,11 +17,13 @@
|
|
17 |
*/
|
18 |
namespace DeliciousBrains\WP_Offload_Media\Gcp\Google\Cloud\Core;
|
19 |
|
|
|
20 |
/**
|
21 |
* Provides methods for deciding if a request should be retried.
|
22 |
*/
|
23 |
trait RetryDeciderTrait
|
24 |
{
|
|
|
25 |
/**
|
26 |
* @var array
|
27 |
*/
|
@@ -49,7 +51,12 @@ trait RetryDeciderTrait
|
|
49 |
if (!$shouldRetryMessages) {
|
50 |
return false;
|
51 |
}
|
52 |
-
$message =
|
|
|
|
|
|
|
|
|
|
|
53 |
if (!isset($message['error']['errors'])) {
|
54 |
return false;
|
55 |
}
|
17 |
*/
|
18 |
namespace DeliciousBrains\WP_Offload_Media\Gcp\Google\Cloud\Core;
|
19 |
|
20 |
+
use DeliciousBrains\WP_Offload_Media\Gcp\GuzzleHttp\Exception\RequestException;
|
21 |
/**
|
22 |
* Provides methods for deciding if a request should be retried.
|
23 |
*/
|
24 |
trait RetryDeciderTrait
|
25 |
{
|
26 |
+
use JsonTrait;
|
27 |
/**
|
28 |
* @var array
|
29 |
*/
|
51 |
if (!$shouldRetryMessages) {
|
52 |
return false;
|
53 |
}
|
54 |
+
$message = $ex instanceof RequestException && $ex->hasResponse() ? (string) $ex->getResponse()->getBody() : $ex->getMessage();
|
55 |
+
try {
|
56 |
+
$message = $this->jsonDecode($message, true);
|
57 |
+
} catch (\InvalidArgumentException $ex) {
|
58 |
+
return false;
|
59 |
+
}
|
60 |
if (!isset($message['error']['errors'])) {
|
61 |
return false;
|
62 |
}
|
@@ -17,6 +17,8 @@
|
|
17 |
*/
|
18 |
namespace DeliciousBrains\WP_Offload_Media\Gcp\Google\Cloud\Core;
|
19 |
|
|
|
|
|
20 |
use DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth\HttpHandler\HttpHandlerFactory;
|
21 |
use DeliciousBrains\WP_Offload_Media\Gcp\Google\Cloud\BigQuery\BigQueryClient;
|
22 |
use DeliciousBrains\WP_Offload_Media\Gcp\Google\Cloud\Datastore\DatastoreClient;
|
17 |
*/
|
18 |
namespace DeliciousBrains\WP_Offload_Media\Gcp\Google\Cloud\Core;
|
19 |
|
20 |
+
use DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth\HttpHandler\Guzzle5HttpHandler;
|
21 |
+
use DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth\HttpHandler\Guzzle6HttpHandler;
|
22 |
use DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth\HttpHandler\HttpHandlerFactory;
|
23 |
use DeliciousBrains\WP_Offload_Media\Gcp\Google\Cloud\BigQuery\BigQueryClient;
|
24 |
use DeliciousBrains\WP_Offload_Media\Gcp\Google\Cloud\Datastore\DatastoreClient;
|
@@ -28,7 +28,7 @@ trait TimeTrait
|
|
28 |
* @param string $timestamp A string representation of a timestamp, encoded
|
29 |
* in RFC 3339 format (YYYY-MM-DDTHH:MM:SS.000000[000]TZ).
|
30 |
* @return array [\DateTimeImmutable, int]
|
31 |
-
* @throws \
|
32 |
*/
|
33 |
private function parseTimeString($timestamp)
|
34 |
{
|
@@ -39,10 +39,7 @@ trait TimeTrait
|
|
39 |
$timestamp = str_replace('.' . $subSeconds, '.' . substr($subSeconds, 0, 6), $timestamp);
|
40 |
}
|
41 |
$dt = new \DateTimeImmutable($timestamp);
|
42 |
-
|
43 |
-
throw new \InvalidArgumentException(sprintf('Could not create a DateTime instance from given timestamp %s.', $timestamp));
|
44 |
-
}
|
45 |
-
$nanos = (int) str_pad($subSeconds, 9, '0', STR_PAD_RIGHT);
|
46 |
return [$dt, $nanos];
|
47 |
}
|
48 |
/**
|
@@ -69,12 +66,7 @@ trait TimeTrait
|
|
69 |
if ($ns === null) {
|
70 |
return $dateTime->format(\DeliciousBrains\WP_Offload_Media\Gcp\Google\Cloud\Core\Timestamp::FORMAT);
|
71 |
} else {
|
72 |
-
|
73 |
-
$ns = str_pad($ns, 9, '0', STR_PAD_LEFT);
|
74 |
-
if (substr($ns, 6, 3) === '000') {
|
75 |
-
$ns = substr($ns, 0, 6);
|
76 |
-
}
|
77 |
-
return sprintf($dateTime->format(\DeliciousBrains\WP_Offload_Media\Gcp\Google\Cloud\Core\Timestamp::FORMAT_INTERPOLATE), $ns);
|
78 |
}
|
79 |
}
|
80 |
/**
|
@@ -92,4 +84,38 @@ trait TimeTrait
|
|
92 |
}
|
93 |
return ['seconds' => (int) $dateTime->format('U'), 'nanos' => (int) $ns];
|
94 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
95 |
}
|
28 |
* @param string $timestamp A string representation of a timestamp, encoded
|
29 |
* in RFC 3339 format (YYYY-MM-DDTHH:MM:SS.000000[000]TZ).
|
30 |
* @return array [\DateTimeImmutable, int]
|
31 |
+
* @throws \Exception If the timestamp string is in an unrecognized format.
|
32 |
*/
|
33 |
private function parseTimeString($timestamp)
|
34 |
{
|
39 |
$timestamp = str_replace('.' . $subSeconds, '.' . substr($subSeconds, 0, 6), $timestamp);
|
40 |
}
|
41 |
$dt = new \DateTimeImmutable($timestamp);
|
42 |
+
$nanos = $this->convertFractionToNanoSeconds($subSeconds);
|
|
|
|
|
|
|
43 |
return [$dt, $nanos];
|
44 |
}
|
45 |
/**
|
66 |
if ($ns === null) {
|
67 |
return $dateTime->format(\DeliciousBrains\WP_Offload_Media\Gcp\Google\Cloud\Core\Timestamp::FORMAT);
|
68 |
} else {
|
69 |
+
return sprintf($dateTime->format(\DeliciousBrains\WP_Offload_Media\Gcp\Google\Cloud\Core\Timestamp::FORMAT_INTERPOLATE), $this->convertNanoSecondsToFraction($ns));
|
|
|
|
|
|
|
|
|
|
|
70 |
}
|
71 |
}
|
72 |
/**
|
84 |
}
|
85 |
return ['seconds' => (int) $dateTime->format('U'), 'nanos' => (int) $ns];
|
86 |
}
|
87 |
+
/**
|
88 |
+
* Convert subseconds, expressed as a decimal to nanoseconds.
|
89 |
+
*
|
90 |
+
* @param int|string $subseconds Provide value as a whole number (i.e.
|
91 |
+
* provide 0.1 as 1).
|
92 |
+
* @return int
|
93 |
+
*/
|
94 |
+
private function convertFractionToNanoSeconds($subseconds)
|
95 |
+
{
|
96 |
+
return (int) str_pad($subseconds, 9, '0', STR_PAD_RIGHT);
|
97 |
+
}
|
98 |
+
/**
|
99 |
+
* Convert nanoseconds to subseconds.
|
100 |
+
*
|
101 |
+
* Note that result should be used as a fraction of one second, but is
|
102 |
+
* given as an integer.
|
103 |
+
*
|
104 |
+
* @param int|string $nanos
|
105 |
+
* @param bool $rpad Whether to right-pad to 6 or 9 digits. **Defaults to**
|
106 |
+
* `true`.
|
107 |
+
* @return string
|
108 |
+
*/
|
109 |
+
private function convertNanoSecondsToFraction($nanos, $rpad = true)
|
110 |
+
{
|
111 |
+
$nanos = (string) $nanos;
|
112 |
+
$res = str_pad($nanos, 9, '0', STR_PAD_LEFT);
|
113 |
+
if (substr($res, 6, 3) === '000') {
|
114 |
+
$res = substr($res, 0, 6);
|
115 |
+
}
|
116 |
+
if (!$rpad) {
|
117 |
+
$res = rtrim($res, '0');
|
118 |
+
}
|
119 |
+
return $res;
|
120 |
+
}
|
121 |
}
|
@@ -34,7 +34,11 @@ class MultipartUploader extends \DeliciousBrains\WP_Offload_Media\Gcp\Google\Clo
|
|
34 |
public function upload()
|
35 |
{
|
36 |
$multipartStream = new \DeliciousBrains\WP_Offload_Media\Gcp\GuzzleHttp\Psr7\MultipartStream([['name' => 'metadata', 'headers' => ['Content-Type' => 'application/json; charset=UTF-8'], 'contents' => $this->jsonEncode($this->metadata)], ['name' => 'data', 'headers' => ['Content-Type' => $this->contentType], 'contents' => $this->data]], 'boundary');
|
37 |
-
$headers = ['Content-Type' => 'multipart/related; boundary=boundary'
|
|
|
|
|
|
|
|
|
38 |
return $this->jsonDecode($this->requestWrapper->send(new \DeliciousBrains\WP_Offload_Media\Gcp\GuzzleHttp\Psr7\Request('POST', $this->uri, $headers, $multipartStream), $this->requestOptions)->getBody(), true);
|
39 |
}
|
40 |
}
|
34 |
public function upload()
|
35 |
{
|
36 |
$multipartStream = new \DeliciousBrains\WP_Offload_Media\Gcp\GuzzleHttp\Psr7\MultipartStream([['name' => 'metadata', 'headers' => ['Content-Type' => 'application/json; charset=UTF-8'], 'contents' => $this->jsonEncode($this->metadata)], ['name' => 'data', 'headers' => ['Content-Type' => $this->contentType], 'contents' => $this->data]], 'boundary');
|
37 |
+
$headers = ['Content-Type' => 'multipart/related; boundary=boundary'];
|
38 |
+
$size = $multipartStream->getSize();
|
39 |
+
if ($size !== null) {
|
40 |
+
$headers['Content-Length'] = $size;
|
41 |
+
}
|
42 |
return $this->jsonDecode($this->requestWrapper->send(new \DeliciousBrains\WP_Offload_Media\Gcp\GuzzleHttp\Psr7\Request('POST', $this->uri, $headers, $multipartStream), $this->requestOptions)->getBody(), true);
|
43 |
}
|
44 |
}
|
@@ -18,6 +18,8 @@
|
|
18 |
namespace DeliciousBrains\WP_Offload_Media\Gcp\Google\Cloud\Core\Upload;
|
19 |
|
20 |
use DeliciousBrains\WP_Offload_Media\Gcp\Google\Cloud\Core\Exception\GoogleException;
|
|
|
|
|
21 |
use DeliciousBrains\WP_Offload_Media\Gcp\Google\Cloud\Core\JsonTrait;
|
22 |
use DeliciousBrains\WP_Offload_Media\Gcp\Google\Cloud\Core\RequestWrapper;
|
23 |
use DeliciousBrains\WP_Offload_Media\Gcp\GuzzleHttp\Psr7;
|
@@ -120,8 +122,11 @@ class ResumableUploader extends \DeliciousBrains\WP_Offload_Media\Gcp\Google\Clo
|
|
120 |
/**
|
121 |
* Triggers the upload process.
|
122 |
*
|
|
|
|
|
|
|
123 |
* @return array
|
124 |
-
* @throws
|
125 |
*/
|
126 |
public function upload()
|
127 |
{
|
@@ -138,7 +143,7 @@ class ResumableUploader extends \DeliciousBrains\WP_Offload_Media\Gcp\Google\Clo
|
|
138 |
try {
|
139 |
$response = $this->requestWrapper->send($request, $this->requestOptions);
|
140 |
} catch (GoogleException $ex) {
|
141 |
-
throw new \DeliciousBrains\WP_Offload_Media\Gcp\Google\Cloud\Core\Exception\
|
142 |
}
|
143 |
if (is_callable($this->uploadProgressCallback)) {
|
144 |
call_user_func($this->uploadProgressCallback, $currStreamLimitSize);
|
@@ -184,7 +189,7 @@ class ResumableUploader extends \DeliciousBrains\WP_Offload_Media\Gcp\Google\Clo
|
|
184 |
* Gets the starting range for the upload.
|
185 |
*
|
186 |
* @param string $rangeHeader
|
187 |
-
* @return int
|
188 |
*/
|
189 |
protected function getRangeStart($rangeHeader)
|
190 |
{
|
18 |
namespace DeliciousBrains\WP_Offload_Media\Gcp\Google\Cloud\Core\Upload;
|
19 |
|
20 |
use DeliciousBrains\WP_Offload_Media\Gcp\Google\Cloud\Core\Exception\GoogleException;
|
21 |
+
use DeliciousBrains\WP_Offload_Media\Gcp\Google\Cloud\Core\Exception\ServiceException;
|
22 |
+
use DeliciousBrains\WP_Offload_Media\Gcp\Google\Cloud\Core\Exception\UploadException;
|
23 |
use DeliciousBrains\WP_Offload_Media\Gcp\Google\Cloud\Core\JsonTrait;
|
24 |
use DeliciousBrains\WP_Offload_Media\Gcp\Google\Cloud\Core\RequestWrapper;
|
25 |
use DeliciousBrains\WP_Offload_Media\Gcp\GuzzleHttp\Psr7;
|
122 |
/**
|
123 |
* Triggers the upload process.
|
124 |
*
|
125 |
+
* Errors are of form [`google.rpc.Status`](https://cloud.google.com/apis/design/errors#error_model),
|
126 |
+
* and may be obtained via {@see Google\Cloud\Core\Exception\ServiceException::getMetadata()}.
|
127 |
+
*
|
128 |
* @return array
|
129 |
+
* @throws ServiceException
|
130 |
*/
|
131 |
public function upload()
|
132 |
{
|
143 |
try {
|
144 |
$response = $this->requestWrapper->send($request, $this->requestOptions);
|
145 |
} catch (GoogleException $ex) {
|
146 |
+
throw new \DeliciousBrains\WP_Offload_Media\Gcp\Google\Cloud\Core\Exception\ServiceException("Upload failed. Please use this URI to resume your upload: {$this->resumeUri}", $ex->getCode(), null, json_decode($ex->getMessage(), true) ?: []);
|
147 |
}
|
148 |
if (is_callable($this->uploadProgressCallback)) {
|
149 |
call_user_func($this->uploadProgressCallback, $currStreamLimitSize);
|
189 |
* Gets the starting range for the upload.
|
190 |
*
|
191 |
* @param string $rangeHeader
|
192 |
+
* @return int|null
|
193 |
*/
|
194 |
protected function getRangeStart($rangeHeader)
|
195 |
{
|
@@ -70,7 +70,7 @@ class SignedUrlUploader extends \DeliciousBrains\WP_Offload_Media\Gcp\Google\Clo
|
|
70 |
/**
|
71 |
* Decode the response body
|
72 |
*
|
73 |
-
* @param
|
74 |
* @return string
|
75 |
*/
|
76 |
protected function decodeResponse(\DeliciousBrains\WP_Offload_Media\Gcp\Psr\Http\Message\ResponseInterface $response)
|
70 |
/**
|
71 |
* Decode the response body
|
72 |
*
|
73 |
+
* @param ResponseInterface $response
|
74 |
* @return string
|
75 |
*/
|
76 |
protected function decodeResponse(\DeliciousBrains\WP_Offload_Media\Gcp\Psr\Http\Message\ResponseInterface $response)
|
@@ -1 +1 @@
|
|
1 |
-
1.
|
1 |
+
1.16.0
|
@@ -4,7 +4,8 @@
|
|
4 |
"license": "Apache-2.0",
|
5 |
"minimum-stability": "stable",
|
6 |
"require": {
|
7 |
-
"google\/cloud-core": "^1.
|
|
|
8 |
},
|
9 |
"require-dev": {
|
10 |
"phpunit\/phpunit": "^4.8|^5.0",
|
4 |
"license": "Apache-2.0",
|
5 |
"minimum-stability": "stable",
|
6 |
"require": {
|
7 |
+
"google\/cloud-core": "^1.31",
|
8 |
+
"google\/crc32": "^0.1.0"
|
9 |
},
|
10 |
"require-dev": {
|
11 |
"phpunit\/phpunit": "^4.8|^5.0",
|
@@ -24,11 +24,13 @@ use DeliciousBrains\WP_Offload_Media\Gcp\Google\Cloud\Core\Exception\ServiceExce
|
|
24 |
use DeliciousBrains\WP_Offload_Media\Gcp\Google\Cloud\Core\Iam\Iam;
|
25 |
use DeliciousBrains\WP_Offload_Media\Gcp\Google\Cloud\Core\Iterator\ItemIterator;
|
26 |
use DeliciousBrains\WP_Offload_Media\Gcp\Google\Cloud\Core\Iterator\PageIterator;
|
|
|
27 |
use DeliciousBrains\WP_Offload_Media\Gcp\Google\Cloud\Core\Upload\ResumableUploader;
|
28 |
use DeliciousBrains\WP_Offload_Media\Gcp\Google\Cloud\Core\Upload\StreamableUploader;
|
29 |
use DeliciousBrains\WP_Offload_Media\Gcp\Google\Cloud\PubSub\Topic;
|
30 |
use DeliciousBrains\WP_Offload_Media\Gcp\Google\Cloud\Storage\Connection\ConnectionInterface;
|
31 |
use DeliciousBrains\WP_Offload_Media\Gcp\Google\Cloud\Storage\Connection\IamBucket;
|
|
|
32 |
use DeliciousBrains\WP_Offload_Media\Gcp\GuzzleHttp\Psr7;
|
33 |
use DeliciousBrains\WP_Offload_Media\Gcp\Psr\Http\Message\StreamInterface;
|
34 |
/**
|
@@ -76,7 +78,7 @@ class Bucket
|
|
76 |
*/
|
77 |
private $info;
|
78 |
/**
|
79 |
-
* @var Iam
|
80 |
*/
|
81 |
private $iam;
|
82 |
/**
|
@@ -202,6 +204,7 @@ class Bucket
|
|
202 |
* uploads.
|
203 |
* @see https://cloud.google.com/storage/docs/json_api/v1/objects/insert Objects insert API documentation.
|
204 |
* @see https://cloud.google.com/storage/docs/encryption#customer-supplied Customer-supplied encryption keys.
|
|
|
205 |
*
|
206 |
* @param string|resource|StreamInterface|null $data The data to be uploaded.
|
207 |
* @param array $options [optional] {
|
@@ -211,10 +214,17 @@ class Bucket
|
|
211 |
* of type string or null.
|
212 |
* @type bool $resumable Indicates whether or not the upload will be
|
213 |
* performed in a resumable fashion.
|
214 |
-
* @type bool $validate Indicates whether or not validation will
|
215 |
-
* applied using md5 hashing functionality. If
|
216 |
-
* calculated hash does not match that of the
|
217 |
-
* upload will be rejected.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
218 |
* @type int $chunkSize If provided the upload will be done in chunks.
|
219 |
* The size must be in multiples of 262144 bytes. With chunking
|
220 |
* you have increased reliability at the risk of higher overhead.
|
@@ -234,11 +244,11 @@ class Bucket
|
|
234 |
* `"projectPrivate"`, and `"publicRead"`.
|
235 |
* @type array $metadata The full list of available options are outlined
|
236 |
* at the [JSON API docs](https://cloud.google.com/storage/docs/json_api/v1/objects/insert#request-body).
|
237 |
-
* @type array $metadata
|
238 |
* @type string $encryptionKey A base64 encoded AES-256 customer-supplied
|
239 |
* encryption key. If you would prefer to manage encryption
|
240 |
* utilizing the Cloud Key Management Service (KMS) please use the
|
241 |
-
*
|
242 |
* key ring must use the same location as the bucket.
|
243 |
* @type string $encryptionKeySHA256 Base64 encoded SHA256 hash of the
|
244 |
* customer-supplied encryption key. This value will be calculated
|
@@ -664,6 +674,7 @@ class Bucket
|
|
664 |
* @see https://cloud.google.com/storage/docs/json_api/v1/buckets/patch Buckets patch API documentation.
|
665 |
* @see https://cloud.google.com/storage/docs/key-terms#bucket-labels Bucket Labels
|
666 |
*
|
|
|
667 |
* @param array $options [optional] {
|
668 |
* Configuration options.
|
669 |
*
|
@@ -726,7 +737,19 @@ class Bucket
|
|
726 |
* @type int $retentionPolicy.retentionPeriod Specifies the duration
|
727 |
* that objects need to be retained, in seconds. Retention
|
728 |
* duration must be greater than zero and less than 100 years.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
729 |
* }
|
|
|
730 |
* @return array
|
731 |
*/
|
732 |
public function update(array $options = [])
|
@@ -1061,6 +1084,80 @@ class Bucket
|
|
1061 |
}
|
1062 |
return $this->info = $this->connection->lockRetentionPolicy($options + $this->identity);
|
1063 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1064 |
/**
|
1065 |
* Determines if an object name is required.
|
1066 |
*
|
24 |
use DeliciousBrains\WP_Offload_Media\Gcp\Google\Cloud\Core\Iam\Iam;
|
25 |
use DeliciousBrains\WP_Offload_Media\Gcp\Google\Cloud\Core\Iterator\ItemIterator;
|
26 |
use DeliciousBrains\WP_Offload_Media\Gcp\Google\Cloud\Core\Iterator\PageIterator;
|
27 |
+
use DeliciousBrains\WP_Offload_Media\Gcp\Google\Cloud\Core\Timestamp;
|
28 |
use DeliciousBrains\WP_Offload_Media\Gcp\Google\Cloud\Core\Upload\ResumableUploader;
|
29 |
use DeliciousBrains\WP_Offload_Media\Gcp\Google\Cloud\Core\Upload\StreamableUploader;
|
30 |
use DeliciousBrains\WP_Offload_Media\Gcp\Google\Cloud\PubSub\Topic;
|
31 |
use DeliciousBrains\WP_Offload_Media\Gcp\Google\Cloud\Storage\Connection\ConnectionInterface;
|
32 |
use DeliciousBrains\WP_Offload_Media\Gcp\Google\Cloud\Storage\Connection\IamBucket;
|
33 |
+
use DeliciousBrains\WP_Offload_Media\Gcp\Google\Cloud\Storage\SigningHelper;
|
34 |
use DeliciousBrains\WP_Offload_Media\Gcp\GuzzleHttp\Psr7;
|
35 |
use DeliciousBrains\WP_Offload_Media\Gcp\Psr\Http\Message\StreamInterface;
|
36 |
/**
|
78 |
*/
|
79 |
private $info;
|
80 |
/**
|
81 |
+
* @var Iam|null
|
82 |
*/
|
83 |
private $iam;
|
84 |
/**
|
204 |
* uploads.
|
205 |
* @see https://cloud.google.com/storage/docs/json_api/v1/objects/insert Objects insert API documentation.
|
206 |
* @see https://cloud.google.com/storage/docs/encryption#customer-supplied Customer-supplied encryption keys.
|
207 |
+
* @see https://github.com/google/php-crc32 crc32c PHP extension for hardware-accelerated validation hashes.
|
208 |
*
|
209 |
* @param string|resource|StreamInterface|null $data The data to be uploaded.
|
210 |
* @param array $options [optional] {
|
214 |
* of type string or null.
|
215 |
* @type bool $resumable Indicates whether or not the upload will be
|
216 |
* performed in a resumable fashion.
|
217 |
+
* @type bool|string $validate Indicates whether or not validation will
|
218 |
+
* be applied using md5 or crc32c hashing functionality. If
|
219 |
+
* enabled, and the calculated hash does not match that of the
|
220 |
+
* upstream server, the upload will be rejected. Available options
|
221 |
+
* are `true`, `false`, `md5` and `crc32`. If true, either md5 or
|
222 |
+
* crc32c will be chosen based on your platform. If false, no
|
223 |
+
* validation hash will be sent. Choose either `md5` or `crc32` to
|
224 |
+
* force a hash method regardless of performance implications. In
|
225 |
+
* PHP versions earlier than 7.4, performance will be very
|
226 |
+
* adversely impacted by using crc32c unless you install the
|
227 |
+
* `crc32c` PHP extension. **Defaults to** `true`.
|
228 |
* @type int $chunkSize If provided the upload will be done in chunks.
|
229 |
* The size must be in multiples of 262144 bytes. With chunking
|
230 |
* you have increased reliability at the risk of higher overhead.
|
244 |
* `"projectPrivate"`, and `"publicRead"`.
|
245 |
* @type array $metadata The full list of available options are outlined
|
246 |
* at the [JSON API docs](https://cloud.google.com/storage/docs/json_api/v1/objects/insert#request-body).
|
247 |
+
* @type array $metadata.metadata User-provided metadata, in key/value pairs.
|
248 |
* @type string $encryptionKey A base64 encoded AES-256 customer-supplied
|
249 |
* encryption key. If you would prefer to manage encryption
|
250 |
* utilizing the Cloud Key Management Service (KMS) please use the
|
251 |
+
* `$metadata.kmsKeyName` setting. Please note if using KMS the
|
252 |
* key ring must use the same location as the bucket.
|
253 |
* @type string $encryptionKeySHA256 Base64 encoded SHA256 hash of the
|
254 |
* customer-supplied encryption key. This value will be calculated
|
674 |
* @see https://cloud.google.com/storage/docs/json_api/v1/buckets/patch Buckets patch API documentation.
|
675 |
* @see https://cloud.google.com/storage/docs/key-terms#bucket-labels Bucket Labels
|
676 |
*
|
677 |
+
* @codingStandardsIgnoreStart
|
678 |
* @param array $options [optional] {
|
679 |
* Configuration options.
|
680 |
*
|
737 |
* @type int $retentionPolicy.retentionPeriod Specifies the duration
|
738 |
* that objects need to be retained, in seconds. Retention
|
739 |
* duration must be greater than zero and less than 100 years.
|
740 |
+
* @type array $iamConfiguration The bucket's IAM configuration.
|
741 |
+
* @type bool $iamConfiguration.bucketPolicyOnly.enabled this is an alias
|
742 |
+
* for $iamConfiguration.uniformBucketLevelAccess.
|
743 |
+
* @type bool $iamConfiguration.uniformBucketLevelAccess.enabled If set and
|
744 |
+
* true, access checks only use bucket-level IAM policies or
|
745 |
+
* above. When enabled, requests attempting to view or manipulate
|
746 |
+
* ACLs will fail with error code 400. **NOTE**: Before using
|
747 |
+
* Uniform bucket-level access, please review the
|
748 |
+
* [feature documentation](https://cloud.google.com/storage/docs/uniform-bucket-level-access),
|
749 |
+
* as well as
|
750 |
+
* [Should You Use uniform bucket-level access](https://cloud.google.com/storage/docs/uniform-bucket-level-access#should-you-use)
|
751 |
* }
|
752 |
+
* @codingStandardsIgnoreEnd
|
753 |
* @return array
|
754 |
*/
|
755 |
public function update(array $options = [])
|
1084 |
}
|
1085 |
return $this->info = $this->connection->lockRetentionPolicy($options + $this->identity);
|
1086 |
}
|
1087 |
+
/**
|
1088 |
+
* Create a Signed URL listing objects in this bucket.
|
1089 |
+
*
|
1090 |
+
* Example:
|
1091 |
+
* ```
|
1092 |
+
* $url = $bucket->signedUrl(time() + 3600);
|
1093 |
+
* ```
|
1094 |
+
*
|
1095 |
+
* ```
|
1096 |
+
* // Use V4 Signing
|
1097 |
+
* $url = $bucket->signedUrl(time() + 3600, [
|
1098 |
+
* 'version' => 'v4'
|
1099 |
+
* ]);
|
1100 |
+
* ```
|
1101 |
+
*
|
1102 |
+
* @see https://cloud.google.com/storage/docs/access-control/signed-urls Signed URLs
|
1103 |
+
*
|
1104 |
+
* @param Timestamp|\DateTimeInterface|int $expires Specifies when the URL
|
1105 |
+
* will expire. May provide an instance of {@see Google\Cloud\Core\Timestamp},
|
1106 |
+
* [http://php.net/datetimeimmutable](`\DateTimeImmutable`), or a
|
1107 |
+
* UNIX timestamp as an integer.
|
1108 |
+
* @param array $options {
|
1109 |
+
* Configuration Options.
|
1110 |
+
*
|
1111 |
+
* @type string $cname The CNAME for the bucket, for instance
|
1112 |
+
* `https://cdn.example.com`. **Defaults to**
|
1113 |
+
* `https://storage.googleapis.com`.
|
1114 |
+
* @type string $contentMd5 The MD5 digest value in base64. If you
|
1115 |
+
* provide this, the client must provide this HTTP header with
|
1116 |
+
* this same value in its request. If provided, take care to
|
1117 |
+
* always provide this value as a base64 encoded string.
|
1118 |
+
* @type string $contentType If you provide this value, the client must
|
1119 |
+
* provide this HTTP header set to the same value.
|
1120 |
+
* @type bool $forceOpenssl If true, OpenSSL will be used regardless of
|
1121 |
+
* whether phpseclib is available. **Defaults to** `false`.
|
1122 |
+
* @type array $headers If additional headers are provided, the server
|
1123 |
+
* will check to make sure that the client provides matching
|
1124 |
+
* values. Provide headers as a key/value array, where the key is
|
1125 |
+
* the header name, and the value is an array of header values.
|
1126 |
+
* Headers with multiple values may provide values as a simple
|
1127 |
+
* array, or a comma-separated string. For a reference of allowed
|
1128 |
+
* headers, see [Reference Headers](https://cloud.google.com/storage/docs/xml-api/reference-headers).
|
1129 |
+
* Header values will be trimmed of leading and trailing spaces,
|
1130 |
+
* multiple spaces within values will be collapsed to a single
|
1131 |
+
* space, and line breaks will be replaced by an empty string.
|
1132 |
+
* V2 Signed URLs may not provide `x-goog-encryption-key` or
|
1133 |
+
* `x-goog-encryption-key-sha256` headers.
|
1134 |
+
* @type array $keyFile Keyfile data to use in place of the keyfile with
|
1135 |
+
* which the client was constructed. If `$options.keyFilePath` is
|
1136 |
+
* set, this option is ignored.
|
1137 |
+
* @type string $keyFilePath A path to a valid keyfile to use in place
|
1138 |
+
* of the keyfile with which the client was constructed.
|
1139 |
+
* @type string|array $scopes One or more authentication scopes to be
|
1140 |
+
* used with a key file. This option is ignored unless
|
1141 |
+
* `$options.keyFile` or `$options.keyFilePath` is set.
|
1142 |
+
* @type array $queryParams Additional query parameters to be included
|
1143 |
+
* as part of the signed URL query string. For allowed values,
|
1144 |
+
* see [Reference Headers](https://cloud.google.com/storage/docs/xml-api/reference-headers#query).
|
1145 |
+
* @type string $version One of "v2" or "v4". *Defaults to** `"v2"`.
|
1146 |
+
* }
|
1147 |
+
* @return string
|
1148 |
+
* @throws \InvalidArgumentException If the given expiration is invalid or in the past.
|
1149 |
+
* @throws \InvalidArgumentException If the given `$options.method` is not valid.
|
1150 |
+
* @throws \InvalidArgumentException If the given `$options.keyFilePath` is not valid.
|
1151 |
+
* @throws \InvalidArgumentException If the given custom headers are invalid.
|
1152 |
+
* @throws \RuntimeException If the keyfile does not contain the required information.
|
1153 |
+
*/
|
1154 |
+
public function signedUrl($expires, array $options = [])
|
1155 |
+
{
|
1156 |
+
// May be overridden for testing.
|
1157 |
+
$signingHelper = $this->pluck('helper', $options, false) ?: \DeliciousBrains\WP_Offload_Media\Gcp\Google\Cloud\Storage\SigningHelper::getHelper();
|
1158 |
+
$resource = sprintf('/%s', $this->identity['bucket']);
|
1159 |
+
return $signingHelper->sign($this->connection, $expires, $resource, null, $options);
|
1160 |
+
}
|
1161 |
/**
|
1162 |
* Determines if an object name is required.
|
1163 |
*
|
@@ -135,4 +135,24 @@ interface ConnectionInterface
|
|
135 |
* @param array $args
|
136 |
*/
|
137 |
public function lockRetentionPolicy(array $args = []);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
138 |
}
|
135 |
* @param array $args
|
136 |
*/
|
137 |
public function lockRetentionPolicy(array $args = []);
|
138 |
+
/**
|
139 |
+
* @param array $args
|
140 |
+
*/
|
141 |
+
public function createHmacKey(array $args = []);
|
142 |
+
/**
|
143 |
+
* @param array $args
|
144 |
+
*/
|
145 |
+
public function deleteHmacKey(array $args = []);
|
146 |
+
/**
|
147 |
+
* @param array $args
|
148 |
+
*/
|
149 |
+
public function getHmacKey(array $args = []);
|
150 |
+
/**
|
151 |
+
* @param array $args
|
152 |
+
*/
|
153 |
+
public function updateHmacKey(array $args = []);
|
154 |
+
/**
|
155 |
+
* @param array $args
|
156 |
+
*/
|
157 |
+
public function listHmacKeys(array $args = []);
|
158 |
}
|
@@ -27,10 +27,12 @@ use DeliciousBrains\WP_Offload_Media\Gcp\Google\Cloud\Core\Upload\StreamableUplo
|
|
27 |
use DeliciousBrains\WP_Offload_Media\Gcp\Google\Cloud\Core\UriTrait;
|
28 |
use DeliciousBrains\WP_Offload_Media\Gcp\Google\Cloud\Storage\Connection\ConnectionInterface;
|
29 |
use DeliciousBrains\WP_Offload_Media\Gcp\Google\Cloud\Storage\StorageClient;
|
30 |
-
use DeliciousBrains\WP_Offload_Media\Gcp\
|
|
|
31 |
use DeliciousBrains\WP_Offload_Media\Gcp\GuzzleHttp\Psr7;
|
32 |
use DeliciousBrains\WP_Offload_Media\Gcp\GuzzleHttp\Psr7\Request;
|
33 |
use DeliciousBrains\WP_Offload_Media\Gcp\Psr\Http\Message\ResponseInterface;
|
|
|
34 |
/**
|
35 |
* Implementation of the
|
36 |
* [Google Cloud Storage JSON API](https://cloud.google.com/storage/docs/json_api/).
|
@@ -39,9 +41,9 @@ class Rest implements \DeliciousBrains\WP_Offload_Media\Gcp\Google\Cloud\Storage
|
|
39 |
{
|
40 |
use RestTrait;
|
41 |
use UriTrait;
|
42 |
-
const BASE_URI = 'https://
|
43 |
-
const UPLOAD_URI = 'https://
|
44 |
-
const DOWNLOAD_URI = 'https://
|
45 |
/**
|
46 |
* @var string
|
47 |
*/
|
@@ -235,9 +237,11 @@ class Rest implements \DeliciousBrains\WP_Offload_Media\Gcp\Google\Cloud\Storage
|
|
235 |
if (!$args['name']) {
|
236 |
$args['name'] = basename($args['data']->getMetadata('uri'));
|
237 |
}
|
238 |
-
|
239 |
-
if ($
|
240 |
$args['metadata']['md5Hash'] = base64_encode(\DeliciousBrains\WP_Offload_Media\Gcp\GuzzleHttp\Psr7\hash($args['data'], 'md5', true));
|
|
|
|
|
241 |
}
|
242 |
$args['metadata']['name'] = $args['name'];
|
243 |
unset($args['name']);
|
@@ -310,6 +314,41 @@ class Rest implements \DeliciousBrains\WP_Offload_Media\Gcp\Google\Cloud\Storage
|
|
310 |
{
|
311 |
return $this->send('buckets', 'lockRetentionPolicy', $args);
|
312 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
313 |
/**
|
314 |
* @param array $args
|
315 |
* @return array
|
@@ -317,8 +356,81 @@ class Rest implements \DeliciousBrains\WP_Offload_Media\Gcp\Google\Cloud\Storage
|
|
317 |
private function buildDownloadObjectParams(array $args)
|
318 |
{
|
319 |
$args += ['bucket' => null, 'object' => null, 'generation' => null, 'userProject' => null];
|
320 |
-
$requestOptions = array_intersect_key($args, ['restOptions' => null, 'retries' => null, 'restRetryFunction' => null, 'restDelayFunction' => null]);
|
321 |
$uri = $this->expandUri(self::DOWNLOAD_URI, ['bucket' => $args['bucket'], 'object' => $args['object'], 'query' => ['generation' => $args['generation'], 'alt' => 'media', 'userProject' => $args['userProject']]]);
|
322 |
return [new \DeliciousBrains\WP_Offload_Media\Gcp\GuzzleHttp\Psr7\Request('GET', \DeliciousBrains\WP_Offload_Media\Gcp\GuzzleHttp\Psr7\uri_for($uri)), $requestOptions];
|
323 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
324 |
}
|
27 |
use DeliciousBrains\WP_Offload_Media\Gcp\Google\Cloud\Core\UriTrait;
|
28 |
use DeliciousBrains\WP_Offload_Media\Gcp\Google\Cloud\Storage\Connection\ConnectionInterface;
|
29 |
use DeliciousBrains\WP_Offload_Media\Gcp\Google\Cloud\Storage\StorageClient;
|
30 |
+
use DeliciousBrains\WP_Offload_Media\Gcp\Google\CRC32\Builtin;
|
31 |
+
use DeliciousBrains\WP_Offload_Media\Gcp\Google\CRC32\CRC32;
|
32 |
use DeliciousBrains\WP_Offload_Media\Gcp\GuzzleHttp\Psr7;
|
33 |
use DeliciousBrains\WP_Offload_Media\Gcp\GuzzleHttp\Psr7\Request;
|
34 |
use DeliciousBrains\WP_Offload_Media\Gcp\Psr\Http\Message\ResponseInterface;
|
35 |
+
use DeliciousBrains\WP_Offload_Media\Gcp\Psr\Http\Message\StreamInterface;
|
36 |
/**
|
37 |
* Implementation of the
|
38 |
* [Google Cloud Storage JSON API](https://cloud.google.com/storage/docs/json_api/).
|
41 |
{
|
42 |
use RestTrait;
|
43 |
use UriTrait;
|
44 |
+
const BASE_URI = 'https://storage.googleapis.com/storage/v1/';
|
45 |
+
const UPLOAD_URI = 'https://storage.googleapis.com/upload/storage/v1/b/{bucket}/o{?query*}';
|
46 |
+
const DOWNLOAD_URI = 'https://storage.googleapis.com/storage/v1/b/{bucket}/o/{object}{?query*}';
|
47 |
/**
|
48 |
* @var string
|
49 |
*/
|
237 |
if (!$args['name']) {
|
238 |
$args['name'] = basename($args['data']->getMetadata('uri'));
|
239 |
}
|
240 |
+
$validate = $this->chooseValidationMethod($args);
|
241 |
+
if ($validate === 'md5') {
|
242 |
$args['metadata']['md5Hash'] = base64_encode(\DeliciousBrains\WP_Offload_Media\Gcp\GuzzleHttp\Psr7\hash($args['data'], 'md5', true));
|
243 |
+
} elseif ($validate === 'crc32') {
|
244 |
+
$args['metadata']['crc32c'] = $this->crcFromStream($args['data']);
|
245 |
}
|
246 |
$args['metadata']['name'] = $args['name'];
|
247 |
unset($args['name']);
|
314 |
{
|
315 |
return $this->send('buckets', 'lockRetentionPolicy', $args);
|
316 |
}
|
317 |
+
/**
|
318 |
+
* @param array $args
|
319 |
+
*/
|
320 |
+
public function createHmacKey(array $args = [])
|
321 |
+
{
|
322 |
+
return $this->send('projects.resources.hmacKeys', 'create', $args);
|
323 |
+
}
|
324 |
+
/**
|
325 |
+
* @param array $args
|
326 |
+
*/
|
327 |
+
public function deleteHmacKey(array $args = [])
|
328 |
+
{
|
329 |
+
return $this->send('projects.resources.hmacKeys', 'delete', $args);
|
330 |
+
}
|
331 |
+
/**
|
332 |
+
* @param array $args
|
333 |
+
*/
|
334 |
+
public function getHmacKey(array $args = [])
|
335 |
+
{
|
336 |
+
return $this->send('projects.resources.hmacKeys', 'get', $args);
|
337 |
+
}
|
338 |
+
/**
|
339 |
+
* @param array $args
|
340 |
+
*/
|
341 |
+
public function updateHmacKey(array $args = [])
|
342 |
+
{
|
343 |
+
return $this->send('projects.resources.hmacKeys', 'update', $args);
|
344 |
+
}
|
345 |
+
/**
|
346 |
+
* @param array $args
|
347 |
+
*/
|
348 |
+
public function listHmacKeys(array $args = [])
|
349 |
+
{
|
350 |
+
return $this->send('projects.resources.hmacKeys', 'list', $args);
|
351 |
+
}
|
352 |
/**
|
353 |
* @param array $args
|
354 |
* @return array
|
356 |
private function buildDownloadObjectParams(array $args)
|
357 |
{
|
358 |
$args += ['bucket' => null, 'object' => null, 'generation' => null, 'userProject' => null];
|
359 |
+
$requestOptions = array_intersect_key($args, ['restOptions' => null, 'retries' => null, 'restRetryFunction' => null, 'restCalcDelayFunction' => null, 'restDelayFunction' => null]);
|
360 |
$uri = $this->expandUri(self::DOWNLOAD_URI, ['bucket' => $args['bucket'], 'object' => $args['object'], 'query' => ['generation' => $args['generation'], 'alt' => 'media', 'userProject' => $args['userProject']]]);
|
361 |
return [new \DeliciousBrains\WP_Offload_Media\Gcp\GuzzleHttp\Psr7\Request('GET', \DeliciousBrains\WP_Offload_Media\Gcp\GuzzleHttp\Psr7\uri_for($uri)), $requestOptions];
|
362 |
}
|
363 |
+
/**
|
364 |
+
* Choose a upload validation method based on user input and platform
|
365 |
+
* requirements.
|
366 |
+
*
|
367 |
+
* @param array $args
|
368 |
+
* @return bool|string
|
369 |
+
*/
|
370 |
+
private function chooseValidationMethod(array $args)
|
371 |
+
{
|
372 |
+
// If the user provided a hash, skip hashing.
|
373 |
+
if (isset($args['metadata']['md5']) || isset($args['metadata']['crc32c'])) {
|
374 |
+
return false;
|
375 |
+
}
|
376 |
+
$validate = $args['validate'];
|
377 |
+
if (in_array($validate, [false, 'crc32', 'md5'], true)) {
|
378 |
+
return $validate;
|
379 |
+
}
|
380 |
+
// not documented, but the feature is called crc32c, so let's accept that as input anyways.
|
381 |
+
if ($validate === 'crc32c') {
|
382 |
+
return 'crc32';
|
383 |
+
}
|
384 |
+
// is the extension loaded?
|
385 |
+
if ($this->crc32cExtensionLoaded()) {
|
386 |
+
return 'crc32';
|
387 |
+
}
|
388 |
+
// is crc32c available in `hash()`?
|
389 |
+
if ($this->supportsBuiltinCrc32c()) {
|
390 |
+
return 'crc32';
|
391 |
+
}
|
392 |
+
return 'md5';
|
393 |
+
}
|
394 |
+
/**
|
395 |
+
* Generate a CRC32c checksum from a stream.
|
396 |
+
*
|
397 |
+
* @param StreamInterface $data
|
398 |
+
* @return string
|
399 |
+
*/
|
400 |
+
private function crcFromStream(\DeliciousBrains\WP_Offload_Media\Gcp\Psr\Http\Message\StreamInterface $data)
|
401 |
+
{
|
402 |
+
$pos = $data->tell();
|
403 |
+
if ($pos > 0) {
|
404 |
+
$data->rewind();
|
405 |
+
}
|
406 |
+
$crc32c = \DeliciousBrains\WP_Offload_Media\Gcp\Google\CRC32\CRC32::create(\DeliciousBrains\WP_Offload_Media\Gcp\Google\CRC32\CRC32::CASTAGNOLI);
|
407 |
+
$data->rewind();
|
408 |
+
while (!$data->eof()) {
|
409 |
+
$crc32c->update($data->read(1048576));
|
410 |
+
}
|
411 |
+
$data->seek($pos);
|
412 |
+
return base64_encode($crc32c->hash(true));
|
413 |
+
}
|
414 |
+
/**
|
415 |
+
* Check if the crc32c extension is available.
|
416 |
+
*
|
417 |
+
* Protected access for unit testing.
|
418 |
+
*
|
419 |
+
* @return bool
|
420 |
+
*/
|
421 |
+
protected function crc32cExtensionLoaded()
|
422 |
+
{
|
423 |
+
return extension_loaded('crc32c');
|
424 |
+
}
|
425 |
+
/**
|
426 |
+
* Check if hash() supports crc32c.
|
427 |
+
*
|
428 |
+
* Protected access for unit testing.
|
429 |
+
*
|
430 |
+
* @return bool
|
431 |
+
*/
|
432 |
+
protected function supportsBuiltinCrc32c()
|
433 |
+
{
|
434 |
+
return \DeliciousBrains\WP_Offload_Media\Gcp\Google\CRC32\Builtin::supports(\DeliciousBrains\WP_Offload_Media\Gcp\Google\CRC32\CRC32::CASTAGNOLI);
|
435 |
+
}
|
436 |
}
|
@@ -1,22 +1,22 @@
|
|
1 |
{
|
2 |
"kind": "discovery#restDescription",
|
3 |
-
"etag": "\"-
|
4 |
"discoveryVersion": "v1",
|
5 |
"id": "storage:v1",
|
6 |
"name": "storage",
|
7 |
"version": "v1",
|
8 |
-
"revision": "
|
9 |
"title": "Cloud Storage JSON API",
|
10 |
"description": "Stores and retrieves potentially large, immutable data objects.",
|
11 |
"ownerDomain": "google.com",
|
12 |
"ownerName": "Google",
|
13 |
"icons": {
|
14 |
-
|
15 |
-
|
16 |
},
|
17 |
"documentationLink": "https://developers.google.com/storage/docs/json_api/",
|
18 |
"labels": [
|
19 |
-
|
20 |
],
|
21 |
"protocol": "rest",
|
22 |
"baseUrl": "https://www.googleapis.com/storage/v1/",
|
@@ -25,3760 +25,4374 @@
|
|
25 |
"servicePath": "storage/v1/",
|
26 |
"batchPath": "batch/storage/v1",
|
27 |
"parameters": {
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
},
|
72 |
"auth": {
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
}
|
91 |
}
|
|
|
92 |
},
|
93 |
"schemas": {
|
94 |
-
|
95 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
96 |
"type": "object",
|
97 |
-
"description": "
|
98 |
"properties": {
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
"
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
157 |
"type": "boolean",
|
158 |
-
"description": "
|
159 |
-
|
160 |
-
|
161 |
-
"type": "array",
|
162 |
-
"description": "Default access controls to apply to new objects when no ACL is provided.",
|
163 |
-
"items": {
|
164 |
-
"$ref": "ObjectAccessControl"
|
165 |
-
}
|
166 |
-
},
|
167 |
-
"encryption": {
|
168 |
-
"type": "object",
|
169 |
-
"description": "Encryption configuration used by default for newly inserted objects, when no encryption config is specified.",
|
170 |
-
"properties": {
|
171 |
-
"defaultKmsKeyName": {
|
172 |
-
"type": "string",
|
173 |
-
"description": "A Cloud KMS key that will be used to encrypt objects inserted into this bucket, if no encryption method is specified. Limited availability; usable only by enabled projects."
|
174 |
-
}
|
175 |
-
}
|
176 |
-
},
|
177 |
-
"etag": {
|
178 |
-
"type": "string",
|
179 |
-
"description": "HTTP 1.1 Entity tag for the bucket."
|
180 |
-
},
|
181 |
-
"id": {
|
182 |
-
"type": "string",
|
183 |
-
"description": "The ID of the bucket. For buckets, the id and name properties are the same."
|
184 |
-
},
|
185 |
-
"kind": {
|
186 |
-
"type": "string",
|
187 |
-
"description": "The kind of item this is. For buckets, this is always storage#bucket.",
|
188 |
-
"default": "storage#bucket"
|
189 |
-
},
|
190 |
-
"labels": {
|
191 |
-
"type": "object",
|
192 |
-
"description": "User-provided labels, in key/value pairs.",
|
193 |
-
"additionalProperties": {
|
194 |
-
"type": "string",
|
195 |
-
"description": "An individual label entry."
|
196 |
-
}
|
197 |
-
},
|
198 |
-
"lifecycle": {
|
199 |
-
"type": "object",
|
200 |
-
"description": "The bucket's lifecycle configuration. See lifecycle management for more information.",
|
201 |
-
"properties": {
|
202 |
-
"rule": {
|
203 |
-
"type": "array",
|
204 |
-
"description": "A lifecycle management rule, which is made of an action to take and the condition(s) under which the action will be taken.",
|
205 |
-
"items": {
|
206 |
-
"type": "object",
|
207 |
-
"properties": {
|
208 |
-
"action": {
|
209 |
-
"type": "object",
|
210 |
-
"description": "The action to take.",
|
211 |
-
"properties": {
|
212 |
-
"storageClass": {
|
213 |
-
"type": "string",
|
214 |
-
"description": "Target storage class. Required iff the type of the action is SetStorageClass."
|
215 |
-
},
|
216 |
-
"type": {
|
217 |
-
"type": "string",
|
218 |
-
"description": "Type of the action. Currently, only Delete and SetStorageClass are supported."
|
219 |
-
}
|
220 |
-
}
|
221 |
-
},
|
222 |
-
"condition": {
|
223 |
-
"type": "object",
|
224 |
-
"description": "The condition(s) under which the action will be taken.",
|
225 |
-
"properties": {
|
226 |
-
"age": {
|
227 |
-
"type": "integer",
|
228 |
-
"description": "Age of an object (in days). This condition is satisfied when an object reaches the specified age.",
|
229 |
-
"format": "int32"
|
230 |
-
},
|
231 |
-
"createdBefore": {
|
232 |
-
"type": "string",
|
233 |
-
"description": "A date in RFC 3339 format with only the date part (for instance, \"2013-01-15\"). This condition is satisfied when an object is created before midnight of the specified date in UTC.",
|
234 |
-
"format": "date"
|
235 |
-
},
|
236 |
-
"isLive": {
|
237 |
-
"type": "boolean",
|
238 |
-
"description": "Relevant only for versioned objects. If the value is true, this condition matches live objects; if the value is false, it matches archived objects."
|
239 |
-
},
|
240 |
-
"matchesStorageClass": {
|
241 |
-
"type": "array",
|
242 |
-
"description": "Objects having any of the storage classes specified by this condition will be matched. Values include MULTI_REGIONAL, REGIONAL, NEARLINE, COLDLINE, STANDARD, and DURABLE_REDUCED_AVAILABILITY.",
|
243 |
-
"items": {
|
244 |
-
"type": "string"
|
245 |
-
}
|
246 |
-
},
|
247 |
-
"numNewerVersions": {
|
248 |
-
"type": "integer",
|
249 |
-
"description": "Relevant only for versioned objects. If the value is N, this condition is satisfied when there are at least N versions (including the live version) newer than this version of the object.",
|
250 |
-
"format": "int32"
|
251 |
-
}
|
252 |
-
}
|
253 |
-
}
|
254 |
-
}
|
255 |
-
}
|
256 |
-
}
|
257 |
-
}
|
258 |
-
},
|
259 |
-
"location": {
|
260 |
-
"type": "string",
|
261 |
-
"description": "The location of the bucket. Object data for objects in the bucket resides in physical storage within this region. Defaults to US. See the developer's guide for the authoritative list."
|
262 |
-
},
|
263 |
-
"logging": {
|
264 |
-
"type": "object",
|
265 |
-
"description": "The bucket's logging configuration, which defines the destination bucket and optional name prefix for the current bucket's logs.",
|
266 |
-
"properties": {
|
267 |
-
"logBucket": {
|
268 |
-
"type": "string",
|
269 |
-
"description": "The destination bucket where the current bucket's logs should be placed."
|
270 |
-
},
|
271 |
-
"logObjectPrefix": {
|
272 |
-
"type": "string",
|
273 |
-
"description": "A prefix for log object names."
|
274 |
-
}
|
275 |
-
}
|
276 |
-
},
|
277 |
-
"metageneration": {
|
278 |
-
"type": "string",
|
279 |
-
"description": "The metadata generation of this bucket.",
|
280 |
-
"format": "int64"
|
281 |
-
},
|
282 |
-
"name": {
|
283 |
-
"type": "string",
|
284 |
-
"description": "The name of the bucket.",
|
285 |
-
"annotations": {
|
286 |
-
"required": [
|
287 |
-
"storage.buckets.insert"
|
288 |
-
]
|
289 |
-
}
|
290 |
-
},
|
291 |
-
"owner": {
|
292 |
-
"type": "object",
|
293 |
-
"description": "The owner of the bucket. This is always the project team's owner group.",
|
294 |
-
"properties": {
|
295 |
-
"entity": {
|
296 |
-
"type": "string",
|
297 |
-
"description": "The entity, in the form project-owner-projectId."
|
298 |
-
},
|
299 |
-
"entityId": {
|
300 |
-
"type": "string",
|
301 |
-
"description": "The ID for the entity."
|
302 |
-
}
|
303 |
-
}
|
304 |
-
},
|
305 |
-
"projectNumber": {
|
306 |
-
"type": "string",
|
307 |
-
"description": "The project number of the project the bucket belongs to.",
|
308 |
-
"format": "uint64"
|
309 |
-
},
|
310 |
-
"retentionPolicy": {
|
311 |
-
"type": "object",
|
312 |
-
"description": "Defines the retention policy for a bucket. The Retention policy enforces a minimum retention time for all objects contained in the bucket, based on their creation time. Any attempt to overwrite or delete objects younger than the retention period will result in a PERMISSION_DENIED error. An unlocked retention policy can be modified or removed from the bucket via the UpdateBucketMetadata RPC. A locked retention policy cannot be removed or shortened in duration for the lifetime of the bucket. Attempting to remove or decrease period of a locked retention policy will result in a PERMISSION_DENIED error.",
|
313 |
-
"properties": {
|
314 |
-
"effectiveTime": {
|
315 |
-
"type": "string",
|
316 |
-
"description": "The time from which policy was enforced and effective. RFC 3339 format.",
|
317 |
-
"format": "date-time"
|
318 |
-
},
|
319 |
-
"isLocked": {
|
320 |
-
"type": "boolean",
|
321 |
-
"description": "Once locked, an object retention policy cannot be modified."
|
322 |
-
},
|
323 |
-
"retentionPeriod": {
|
324 |
-
"type": "string",
|
325 |
-
"description": "Specifies the duration that objects need to be retained. Retention duration must be greater than zero and less than 100 years. Note that enforcement of retention periods less than a day is not guaranteed. Such periods should only be used for testing purposes.",
|
326 |
-
"format": "int64"
|
327 |
-
}
|
328 |
-
}
|
329 |
-
},
|
330 |
-
"selfLink": {
|
331 |
"type": "string",
|
332 |
-
"description": "The
|
333 |
-
},
|
334 |
-
"storageClass": {
|
335 |
-
"type": "string",
|
336 |
-
"description": "The bucket's default storage class, used whenever no storageClass is specified for a newly-created object. This defines how objects in the bucket are stored and determines the SLA and the cost of storage. Values include MULTI_REGIONAL, REGIONAL, STANDARD, NEARLINE, COLDLINE, and DURABLE_REDUCED_AVAILABILITY. If this value is not specified when the bucket is created, it will default to STANDARD. For more information, see storage classes."
|
337 |
-
},
|
338 |
-
"timeCreated": {
|
339 |
-
"type": "string",
|
340 |
-
"description": "The creation time of the bucket in RFC 3339 format.",
|
341 |
"format": "date-time"
|
342 |
-
|
343 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
344 |
"type": "string",
|
345 |
-
"description": "The
|
346 |
"format": "date-time"
|
347 |
-
|
348 |
-
"versioning": {
|
349 |
-
"type": "object",
|
350 |
-
"description": "The bucket's versioning configuration.",
|
351 |
-
"properties": {
|
352 |
-
"enabled": {
|
353 |
-
"type": "boolean",
|
354 |
-
"description": "While set to true, versioning is fully enabled for this bucket."
|
355 |
-
}
|
356 |
-
}
|
357 |
-
},
|
358 |
-
"website": {
|
359 |
-
"type": "object",
|
360 |
-
"description": "The bucket's website configuration, controlling how the service behaves when accessing bucket contents as a web site. See the Static Website Examples for more information.",
|
361 |
-
"properties": {
|
362 |
-
"mainPageSuffix": {
|
363 |
-
"type": "string",
|
364 |
-
"description": "If the requested object path is missing, the service will ensure the path has a trailing '/', append this suffix, and attempt to retrieve the resulting object. This allows the creation of index.html objects to represent directory pages."
|
365 |
-
},
|
366 |
-
"notFoundPage": {
|
367 |
-
"type": "string",
|
368 |
-
"description": "If the requested object path is missing, and any mainPageSuffix object is missing, if applicable, the service will return the named object from this bucket as the content for a 404 Not Found result."
|
369 |
-
}
|
370 |
-
}
|
371 |
}
|
|
|
372 |
}
|
373 |
-
|
374 |
-
|
375 |
-
"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
376 |
"type": "object",
|
377 |
-
"description": "
|
378 |
-
"
|
379 |
-
|
380 |
-
|
381 |
-
"description": "The name of the bucket."
|
382 |
-
},
|
383 |
-
"domain": {
|
384 |
-
"type": "string",
|
385 |
-
"description": "The domain associated with the entity, if any."
|
386 |
-
},
|
387 |
-
"email": {
|
388 |
-
"type": "string",
|
389 |
-
"description": "The email address associated with the entity, if any."
|
390 |
-
},
|
391 |
-
"entity": {
|
392 |
-
"type": "string",
|
393 |
-
"description": "The entity holding the permission, in one of the following forms: \n- user-userId \n- user-email \n- group-groupId \n- group-email \n- domain-domain \n- project-team-projectId \n- allUsers \n- allAuthenticatedUsers Examples: \n- The user liz@example.com would be user-liz@example.com. \n- The group example@googlegroups.com would be group-example@googlegroups.com. \n- To refer to all members of the Google Apps for Business domain example.com, the entity would be domain-example.com.",
|
394 |
-
"annotations": {
|
395 |
-
"required": [
|
396 |
-
"storage.bucketAccessControls.insert"
|
397 |
-
]
|
398 |
-
}
|
399 |
-
},
|
400 |
-
"entityId": {
|
401 |
-
"type": "string",
|
402 |
-
"description": "The ID for the entity, if any."
|
403 |
-
},
|
404 |
-
"etag": {
|
405 |
-
"type": "string",
|
406 |
-
"description": "HTTP 1.1 Entity tag for the access-control entry."
|
407 |
-
},
|
408 |
-
"id": {
|
409 |
-
"type": "string",
|
410 |
-
"description": "The ID of the access-control entry."
|
411 |
-
},
|
412 |
-
"kind": {
|
413 |
-
"type": "string",
|
414 |
-
"description": "The kind of item this is. For bucket access control entries, this is always storage#bucketAccessControl.",
|
415 |
-
"default": "storage#bucketAccessControl"
|
416 |
-
},
|
417 |
-
"projectTeam": {
|
418 |
-
"type": "object",
|
419 |
-
"description": "The project team associated with the entity, if any.",
|
420 |
-
"properties": {
|
421 |
-
"projectNumber": {
|
422 |
-
"type": "string",
|
423 |
-
"description": "The project number."
|
424 |
-
},
|
425 |
-
"team": {
|
426 |
-
"type": "string",
|
427 |
-
"description": "The team."
|
428 |
-
}
|
429 |
-
}
|
430 |
-
},
|
431 |
-
"role": {
|
432 |
-
"type": "string",
|
433 |
-
"description": "The access permission for the entity.",
|
434 |
-
"annotations": {
|
435 |
-
"required": [
|
436 |
-
"storage.bucketAccessControls.insert"
|
437 |
-
]
|
438 |
-
}
|
439 |
-
},
|
440 |
-
"selfLink": {
|
441 |
-
"type": "string",
|
442 |
-
"description": "The link to this access-control entry."
|
443 |
-
}
|
444 |
}
|
445 |
-
|
446 |
-
|
447 |
-
"id": "BucketAccessControls",
|
448 |
"type": "object",
|
449 |
-
"description": "
|
450 |
"properties": {
|
|
|
|
|
|
|
451 |
"items": {
|
452 |
-
|
453 |
-
|
454 |
-
"
|
455 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
456 |
}
|
457 |
-
|
458 |
-
"kind": {
|
459 |
-
"type": "string",
|
460 |
-
"description": "The kind of item this is. For lists of bucket access control entries, this is always storage#bucketAccessControls.",
|
461 |
-
"default": "storage#bucketAccessControls"
|
462 |
}
|
|
|
463 |
}
|
464 |
-
|
465 |
-
|
466 |
-
"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
467 |
"type": "object",
|
468 |
-
"description": "
|
469 |
"properties": {
|
470 |
-
|
471 |
-
|
472 |
-
|
473 |
-
|
474 |
-
|
475 |
-
|
476 |
-
|
477 |
-
|
478 |
-
|
479 |
-
|
480 |
-
|
481 |
-
|
482 |
-
|
483 |
-
|
484 |
-
|
485 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
486 |
}
|
487 |
-
|
488 |
-
|
489 |
-
"id": "Channel",
|
490 |
"type": "object",
|
491 |
-
"description": "
|
492 |
"properties": {
|
493 |
-
|
494 |
-
|
495 |
-
|
496 |
-
|
497 |
-
|
498 |
-
|
499 |
-
|
500 |
-
|
501 |
-
},
|
502 |
-
"id": {
|
503 |
-
"type": "string",
|
504 |
-
"description": "A UUID or similar unique string that identifies this channel."
|
505 |
-
},
|
506 |
-
"kind": {
|
507 |
-
"type": "string",
|
508 |
-
"description": "Identifies this as a notification channel used to watch for changes to a resource. Value: the fixed string \"api#channel\".",
|
509 |
-
"default": "api#channel"
|
510 |
-
},
|
511 |
-
"params": {
|
512 |
-
"type": "object",
|
513 |
-
"description": "Additional parameters controlling delivery channel behavior. Optional.",
|
514 |
-
"additionalProperties": {
|
515 |
-
"type": "string",
|
516 |
-
"description": "Declares a new parameter by name."
|
517 |
-
}
|
518 |
-
},
|
519 |
-
"payload": {
|
520 |
-
"type": "boolean",
|
521 |
-
"description": "A Boolean value to indicate whether payload is wanted. Optional."
|
522 |
-
},
|
523 |
-
"resourceId": {
|
524 |
-
"type": "string",
|
525 |
-
"description": "An opaque ID that identifies the resource being watched on this channel. Stable across different API versions."
|
526 |
-
},
|
527 |
-
"resourceUri": {
|
528 |
-
"type": "string",
|
529 |
-
"description": "A version-specific identifier for the watched resource."
|
530 |
-
},
|
531 |
-
"token": {
|
532 |
-
"type": "string",
|
533 |
-
"description": "An arbitrary string delivered to the target address with each notification delivered over this channel. Optional."
|
534 |
-
},
|
535 |
-
"type": {
|
536 |
-
"type": "string",
|
537 |
-
"description": "The type of delivery mechanism used for this channel."
|
538 |
-
}
|
539 |
}
|
540 |
-
|
541 |
-
|
542 |
-
"
|
|
|
|
|
|
|
|
|
543 |
"type": "object",
|
544 |
-
"description": "A
|
545 |
"properties": {
|
546 |
-
|
547 |
-
|
548 |
-
|
549 |
-
|
550 |
-
|
551 |
-
|
552 |
-
|
553 |
-
|
554 |
-
|
555 |
-
|
556 |
-
|
557 |
-
|
558 |
-
|
559 |
-
|
560 |
-
"properties": {
|
561 |
-
"generation": {
|
562 |
-
"type": "string",
|
563 |
-
"description": "The generation of this object to use as the source.",
|
564 |
-
"format": "int64"
|
565 |
-
},
|
566 |
-
"name": {
|
567 |
-
"type": "string",
|
568 |
-
"description": "The source object's name. The source object's bucket is implicitly the destination bucket.",
|
569 |
-
"annotations": {
|
570 |
-
"required": [
|
571 |
-
"storage.objects.compose"
|
572 |
-
]
|
573 |
-
}
|
574 |
-
},
|
575 |
-
"objectPreconditions": {
|
576 |
-
"type": "object",
|
577 |
-
"description": "Conditions that must be met for this operation to execute.",
|
578 |
-
"properties": {
|
579 |
-
"ifGenerationMatch": {
|
580 |
-
"type": "string",
|
581 |
-
"description": "Only perform the composition if the generation of the source object that would be used matches this value. If this value and a generation are both specified, they must be the same value or the call will fail.",
|
582 |
-
"format": "int64"
|
583 |
-
}
|
584 |
-
}
|
585 |
-
}
|
586 |
-
}
|
587 |
-
},
|
588 |
-
"annotations": {
|
589 |
-
"required": [
|
590 |
-
"storage.objects.compose"
|
591 |
-
]
|
592 |
-
}
|
593 |
-
}
|
594 |
}
|
595 |
-
|
596 |
-
|
597 |
-
"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
598 |
"type": "object",
|
599 |
-
"description": "
|
600 |
"properties": {
|
601 |
-
|
602 |
-
|
603 |
-
|
604 |
-
|
605 |
-
"type": "string"
|
606 |
-
}
|
607 |
-
},
|
608 |
-
"etag": {
|
609 |
-
"type": "string",
|
610 |
-
"description": "HTTP 1.1 Entity tag for this subscription notification."
|
611 |
-
},
|
612 |
-
"event_types": {
|
613 |
-
"type": "array",
|
614 |
-
"description": "If present, only send notifications about listed event types. If empty, sent notifications for all event types.",
|
615 |
-
"items": {
|
616 |
-
"type": "string"
|
617 |
-
}
|
618 |
-
},
|
619 |
-
"id": {
|
620 |
-
"type": "string",
|
621 |
-
"description": "The ID of the notification."
|
622 |
-
},
|
623 |
-
"kind": {
|
624 |
-
"type": "string",
|
625 |
-
"description": "The kind of item this is. For notifications, this is always storage#notification.",
|
626 |
-
"default": "storage#notification"
|
627 |
-
},
|
628 |
-
"object_name_prefix": {
|
629 |
-
"type": "string",
|
630 |
-
"description": "If present, only apply this notification configuration to object names that begin with this prefix."
|
631 |
-
},
|
632 |
-
"payload_format": {
|
633 |
-
"type": "string",
|
634 |
-
"description": "The desired content of the Payload.",
|
635 |
-
"default": "JSON_API_V1",
|
636 |
-
"annotations": {
|
637 |
-
"required": [
|
638 |
-
"storage.notifications.insert"
|
639 |
-
]
|
640 |
-
}
|
641 |
-
},
|
642 |
-
"selfLink": {
|
643 |
-
"type": "string",
|
644 |
-
"description": "The canonical URL of this notification."
|
645 |
-
},
|
646 |
-
"topic": {
|
647 |
-
"type": "string",
|
648 |
-
"description": "The Cloud PubSub topic to which this subscription publishes. Formatted as: '//pubsub.googleapis.com/projects/{project-identifier}/topics/{my-topic}'",
|
649 |
-
"annotations": {
|
650 |
-
"required": [
|
651 |
-
"storage.notifications.insert"
|
652 |
-
]
|
653 |
-
}
|
654 |
-
}
|
655 |
}
|
656 |
-
|
657 |
-
|
658 |
-
"id": "Notifications",
|
659 |
"type": "object",
|
660 |
-
"description": "
|
661 |
"properties": {
|
662 |
-
|
663 |
-
|
664 |
-
|
665 |
-
|
666 |
-
|
667 |
-
|
668 |
-
|
669 |
-
|
670 |
-
|
671 |
-
|
672 |
-
|
673 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
674 |
}
|
675 |
-
|
676 |
-
|
677 |
-
"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
678 |
"type": "object",
|
679 |
-
"description": "
|
680 |
"properties": {
|
681 |
-
|
682 |
-
|
683 |
-
|
684 |
-
|
685 |
-
|
686 |
-
|
687 |
-
|
688 |
-
|
689 |
-
|
690 |
-
|
691 |
-
|
692 |
-
|
693 |
-
|
694 |
-
|
695 |
-
|
696 |
-
|
697 |
-
|
698 |
-
|
699 |
-
|
700 |
-
|
701 |
-
|
702 |
-
|
703 |
-
|
704 |
-
|
705 |
-
|
706 |
-
|
707 |
-
|
708 |
-
|
709 |
-
|
710 |
-
|
711 |
-
|
712 |
-
|
713 |
-
|
714 |
-
|
715 |
-
|
716 |
-
|
717 |
-
|
718 |
-
|
719 |
-
|
720 |
-
|
721 |
-
|
722 |
-
|
723 |
-
|
724 |
-
|
725 |
-
|
726 |
-
|
727 |
-
|
728 |
-
|
729 |
-
|
730 |
-
|
731 |
-
|
732 |
-
|
733 |
-
|
734 |
-
|
735 |
-
|
736 |
-
|
737 |
-
|
738 |
-
|
739 |
-
|
740 |
-
|
741 |
-
|
742 |
-
|
743 |
-
|
744 |
-
|
745 |
-
|
746 |
-
|
747 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
748 |
"generation": {
|
749 |
-
|
750 |
-
|
751 |
-
|
752 |
-
},
|
753 |
-
"id": {
|
754 |
-
"type": "string",
|
755 |
-
"description": "The ID of the object, including the bucket name, object name, and generation number."
|
756 |
-
},
|
757 |
-
"kind": {
|
758 |
-
"type": "string",
|
759 |
-
"description": "The kind of item this is. For objects, this is always storage#object.",
|
760 |
-
"default": "storage#object"
|
761 |
-
},
|
762 |
-
"kmsKeyName": {
|
763 |
-
"type": "string",
|
764 |
-
"description": "Cloud KMS Key used to encrypt this object, if the object is encrypted by such a key. Limited availability; usable only by enabled projects."
|
765 |
-
},
|
766 |
-
"md5Hash": {
|
767 |
-
"type": "string",
|
768 |
-
"description": "MD5 hash of the data; encoded using base64. For more information about using the MD5 hash, see Hashes and ETags: Best Practices."
|
769 |
-
},
|
770 |
-
"mediaLink": {
|
771 |
-
"type": "string",
|
772 |
-
"description": "Media download link."
|
773 |
-
},
|
774 |
-
"metadata": {
|
775 |
-
"type": "object",
|
776 |
-
"description": "User-provided metadata, in key/value pairs.",
|
777 |
-
"additionalProperties": {
|
778 |
-
"type": "string",
|
779 |
-
"description": "An individual metadata entry."
|
780 |
-
}
|
781 |
-
},
|
782 |
-
"metageneration": {
|
783 |
-
"type": "string",
|
784 |
-
"description": "The version of the metadata for this object at this generation. Used for preconditions and for detecting changes in metadata. A metageneration number is only meaningful in the context of a particular generation of a particular object.",
|
785 |
-
"format": "int64"
|
786 |
},
|
787 |
"name": {
|
788 |
-
|
789 |
-
|
790 |
-
|
791 |
-
|
792 |
-
|
793 |
-
|
794 |
-
|
795 |
-
|
796 |
-
|
797 |
-
|
798 |
-
|
799 |
-
|
800 |
-
|
801 |
-
|
802 |
-
|
|
|
803 |
}
|
804 |
-
|
805 |
-
"retentionExpirationTime": {
|
806 |
-
"type": "string",
|
807 |
-
"description": "Specifies the earliest time that the object's retention period expires. This value is server-determined and is in RFC 3339 format. Note 1: This field is not provided for objects with an active Event-Based hold, since retention expiration is unknown until the hold is removed. Note 2: This value can be provided even when TemporaryHold is set (so that the user can reason about policy without having to first unset the TemporaryHold).",
|
808 |
-
"format": "date-time"
|
809 |
-
},
|
810 |
-
"selfLink": {
|
811 |
-
"type": "string",
|
812 |
-
"description": "The link to this object."
|
813 |
-
},
|
814 |
-
"size": {
|
815 |
-
"type": "string",
|
816 |
-
"description": "Content-Length of the data in bytes.",
|
817 |
-
"format": "uint64"
|
818 |
-
},
|
819 |
-
"storageClass": {
|
820 |
-
"type": "string",
|
821 |
-
"description": "Storage class of the object."
|
822 |
-
},
|
823 |
-
"temporaryHold": {
|
824 |
-
"type": "boolean",
|
825 |
-
"description": "Defines the temporary hold for an object. This flag is used to enforce a temporary hold on an object. While it is set to true, the object is protected against deletion and overwrites. A common use case of this flag is regulatory investigations where objects need to be retained while the investigation is ongoing."
|
826 |
-
},
|
827 |
-
"timeCreated": {
|
828 |
-
"type": "string",
|
829 |
-
"description": "The creation time of the object in RFC 3339 format.",
|
830 |
-
"format": "date-time"
|
831 |
-
},
|
832 |
-
"timeDeleted": {
|
833 |
-
"type": "string",
|
834 |
-
"description": "The deletion time of the object in RFC 3339 format. Will be returned if and only if this version of the object has been deleted.",
|
835 |
-
"format": "date-time"
|
836 |
-
},
|
837 |
-
"timeStorageClassUpdated": {
|
838 |
-
"type": "string",
|
839 |
-
"description": "The time at which the object's storage class was last changed. When the object is initially created, it will be set to timeCreated.",
|
840 |
-
"format": "date-time"
|
841 |
-
},
|
842 |
-
"updated": {
|
843 |
-
"type": "string",
|
844 |
-
"description": "The modification time of the object metadata in RFC 3339 format.",
|
845 |
-
"format": "date-time"
|
846 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
847 |
}
|
848 |
-
|
849 |
-
|
850 |
-
|
851 |
-
|
852 |
-
|
853 |
-
|
854 |
-
|
855 |
-
|
856 |
-
|
857 |
-
|
858 |
-
|
859 |
-
|
860 |
-
|
861 |
-
|
862 |
-
|
863 |
-
|
864 |
-
|
865 |
-
|
866 |
-
|
867 |
-
|
868 |
-
|
869 |
-
|
870 |
-
|
871 |
-
|
872 |
-
|
873 |
-
|
874 |
-
|
875 |
-
|
876 |
-
|
877 |
-
|
878 |
-
|
879 |
-
|
880 |
-
|
881 |
-
|
882 |
-
|
883 |
-
|
884 |
-
|
885 |
-
|
886 |
-
|
887 |
-
|
888 |
-
|
889 |
-
|
890 |
-
|
891 |
-
|
892 |
-
|
893 |
-
|
894 |
-
|
895 |
-
|
896 |
-
|
897 |
-
|
898 |
-
|
899 |
-
|
900 |
-
|
901 |
-
|
902 |
-
|
903 |
-
|
904 |
-
|
905 |
-
|
906 |
-
|
907 |
-
|
908 |
-
|
909 |
-
|
910 |
-
|
911 |
-
|
912 |
-
|
913 |
-
|
914 |
-
|
915 |
-
|
916 |
-
|
917 |
-
|
918 |
-
|
919 |
-
|
920 |
-
|
921 |
-
|
922 |
-
|
923 |
-
|
924 |
-
|
925 |
-
|
926 |
-
|
927 |
-
|
928 |
-
|
929 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
930 |
}
|
931 |
-
|
932 |
-
|
933 |
-
"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
934 |
"type": "object",
|
935 |
-
"description": "An
|
936 |
-
"
|
937 |
-
|
938 |
-
"type": "array",
|
939 |
-
"description": "The list of items.",
|
940 |
-
"items": {
|
941 |
-
"$ref": "ObjectAccessControl"
|
942 |
-
}
|
943 |
-
},
|
944 |
-
"kind": {
|
945 |
-
"type": "string",
|
946 |
-
"description": "The kind of item this is. For lists of object access control entries, this is always storage#objectAccessControls.",
|
947 |
-
"default": "storage#objectAccessControls"
|
948 |
-
}
|
949 |
}
|
950 |
-
|
951 |
-
|
952 |
-
"
|
953 |
-
"
|
954 |
-
|
955 |
-
|
956 |
-
|
957 |
-
|
958 |
-
|
959 |
-
|
960 |
-
|
961 |
-
|
962 |
-
|
963 |
-
|
964 |
-
|
965 |
-
|
966 |
-
|
967 |
-
|
968 |
-
|
969 |
-
|
970 |
-
|
971 |
-
|
972 |
-
|
973 |
-
|
974 |
-
|
975 |
-
|
976 |
-
|
977 |
-
|
978 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
979 |
}
|
980 |
-
|
981 |
-
|
982 |
-
"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
983 |
"type": "object",
|
984 |
-
"description": "
|
985 |
"properties": {
|
986 |
-
|
987 |
-
|
988 |
-
|
989 |
-
|
990 |
-
|
991 |
-
|
992 |
-
|
993 |
-
|
994 |
-
},
|
995 |
-
"members": {
|
996 |
-
"type": "array",
|
997 |
-
"description": "A collection of identifiers for members who may assume the provided role. Recognized identifiers are as follows: \n- allUsers — A special identifier that represents anyone on the internet; with or without a Google account. \n- allAuthenticatedUsers — A special identifier that represents anyone who is authenticated with a Google account or a service account. \n- user:emailid — An email address that represents a specific account. For example, user:alice@gmail.com or user:joe@example.com. \n- serviceAccount:emailid — An email address that represents a service account. For example, serviceAccount:my-other-app@appspot.gserviceaccount.com . \n- group:emailid — An email address that represents a Google group. For example, group:admins@example.com. \n- domain:domain — A Google Apps domain name that represents all the users of that domain. For example, domain:google.com or domain:example.com. \n- projectOwner:projectid — Owners of the given project. For example, projectOwner:my-example-project \n- projectEditor:projectid — Editors of the given project. For example, projectEditor:my-example-project \n- projectViewer:projectid — Viewers of the given project. For example, projectViewer:my-example-project",
|
998 |
-
"items": {
|
999 |
-
"type": "string"
|
1000 |
-
},
|
1001 |
-
"annotations": {
|
1002 |
-
"required": [
|
1003 |
-
"storage.buckets.setIamPolicy",
|
1004 |
-
"storage.objects.setIamPolicy"
|
1005 |
-
]
|
1006 |
-
}
|
1007 |
-
},
|
1008 |
-
"role": {
|
1009 |
-
"type": "string",
|
1010 |
-
"description": "The role to which members belong. Two types of roles are supported: new IAM roles, which grant permissions that do not map directly to those provided by ACLs, and legacy IAM roles, which do map directly to ACL permissions. All roles are of the format roles/storage.specificRole.\nThe new IAM roles are: \n- roles/storage.admin — Full control of Google Cloud Storage resources. \n- roles/storage.objectViewer — Read-Only access to Google Cloud Storage objects. \n- roles/storage.objectCreator — Access to create objects in Google Cloud Storage. \n- roles/storage.objectAdmin — Full control of Google Cloud Storage objects. The legacy IAM roles are: \n- roles/storage.legacyObjectReader — Read-only access to objects without listing. Equivalent to an ACL entry on an object with the READER role. \n- roles/storage.legacyObjectOwner — Read/write access to existing objects without listing. Equivalent to an ACL entry on an object with the OWNER role. \n- roles/storage.legacyBucketReader — Read access to buckets with object listing. Equivalent to an ACL entry on a bucket with the READER role. \n- roles/storage.legacyBucketWriter — Read access to buckets with object listing/creation/deletion. Equivalent to an ACL entry on a bucket with the WRITER role. \n- roles/storage.legacyBucketOwner — Read and write access to existing buckets with object listing/creation/deletion. Equivalent to an ACL entry on a bucket with the OWNER role.",
|
1011 |
-
"annotations": {
|
1012 |
-
"required": [
|
1013 |
-
"storage.buckets.setIamPolicy",
|
1014 |
-
"storage.objects.setIamPolicy"
|
1015 |
-
]
|
1016 |
-
}
|
1017 |
-
}
|
1018 |
-
}
|
1019 |
-
},
|
1020 |
-
"annotations": {
|
1021 |
-
"required": [
|
1022 |
-
"storage.buckets.setIamPolicy",
|
1023 |
-
"storage.objects.setIamPolicy"
|
1024 |
-
]
|
1025 |
-
}
|
1026 |
-
},
|
1027 |
-
"etag": {
|
1028 |
-
"type": "string",
|
1029 |
-
"description": "HTTP 1.1 Entity tag for the policy.",
|
1030 |
-
"format": "byte"
|
1031 |
-
},
|
1032 |
-
"kind": {
|
1033 |
-
"type": "string",
|
1034 |
-
"description": "The kind of item this is. For policies, this is always storage#policy. This field is ignored on input.",
|
1035 |
-
"default": "storage#policy"
|
1036 |
-
},
|
1037 |
-
"resourceId": {
|
1038 |
-
"type": "string",
|
1039 |
-
"description": "The ID of the resource to which this policy belongs. Will be of the form projects/_/buckets/bucket for buckets, and projects/_/buckets/bucket/objects/object for objects. A specific generation may be specified by appending #generationNumber to the end of the object name, e.g. projects/_/buckets/my-bucket/objects/data.txt#17. The current generation can be denoted with #0. This field is ignored on input."
|
1040 |
-
}
|
1041 |
}
|
1042 |
-
|
1043 |
-
|
1044 |
-
"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1045 |
"type": "object",
|
1046 |
-
"description": "
|
1047 |
-
"
|
1048 |
-
|
1049 |
-
|
1050 |
-
"description": "true if the copy is finished; otherwise, false if the copy is in progress. This property is always present in the response."
|
1051 |
-
},
|
1052 |
-
"kind": {
|
1053 |
-
"type": "string",
|
1054 |
-
"description": "The kind of item this is.",
|
1055 |
-
"default": "storage#rewriteResponse"
|
1056 |
-
},
|
1057 |
-
"objectSize": {
|
1058 |
-
"type": "string",
|
1059 |
-
"description": "The total size of the object being copied in bytes. This property is always present in the response.",
|
1060 |
-
"format": "int64"
|
1061 |
-
},
|
1062 |
-
"resource": {
|
1063 |
-
"$ref": "Object",
|
1064 |
-
"description": "A resource containing the metadata for the copied-to object. This property is present in the response only when copying completes."
|
1065 |
-
},
|
1066 |
-
"rewriteToken": {
|
1067 |
-
"type": "string",
|
1068 |
-
"description": "A token to use in subsequent requests to continue copying data. This token is present in the response only when there is more data to copy."
|
1069 |
-
},
|
1070 |
-
"totalBytesRewritten": {
|
1071 |
-
"type": "string",
|
1072 |
-
"description": "The total bytes written so far, which can be used to provide a waiting user with a progress indicator. This property is always present in the response.",
|
1073 |
-
"format": "int64"
|
1074 |
-
}
|
1075 |
}
|
1076 |
-
|
1077 |
-
|
1078 |
-
"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1079 |
"type": "object",
|
1080 |
-
"description": "
|
1081 |
"properties": {
|
1082 |
-
|
1083 |
-
|
1084 |
-
|
1085 |
-
|
1086 |
-
|
1087 |
-
|
1088 |
-
|
1089 |
-
|
1090 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1091 |
}
|
1092 |
-
|
1093 |
-
|
1094 |
-
"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1095 |
"type": "object",
|
1096 |
-
"description": "
|
1097 |
"properties": {
|
1098 |
-
|
1099 |
-
|
1100 |
-
|
1101 |
-
|
1102 |
-
|
1103 |
-
"
|
1104 |
-
|
1105 |
-
|
1106 |
-
|
1107 |
-
|
1108 |
-
|
1109 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
1110 |
}
|
|
|
|
|
|
|
|
|
|
|
1111 |
}
|
1112 |
-
|
1113 |
-
|
1114 |
-
"
|
1115 |
-
|
1116 |
-
|
1117 |
-
|
1118 |
-
|
1119 |
-
|
1120 |
-
|
1121 |
-
|
1122 |
-
|
1123 |
-
|
1124 |
-
|
1125 |
-
|
1126 |
-
|
1127 |
-
|
1128 |
-
|
1129 |
-
|
1130 |
-
|
1131 |
-
|
1132 |
-
|
1133 |
-
|
1134 |
-
|
1135 |
-
|
1136 |
-
|
1137 |
-
|
1138 |
-
|
1139 |
-
|
1140 |
-
|
1141 |
-
|
1142 |
-
|
1143 |
-
|
1144 |
-
|
1145 |
-
|
1146 |
-
|
1147 |
-
|
1148 |
-
|
1149 |
-
|
1150 |
-
|
1151 |
-
|
1152 |
-
|
1153 |
-
|
1154 |
-
|
1155 |
-
|
1156 |
-
|
1157 |
-
|
1158 |
-
|
1159 |
-
|
1160 |
-
|
1161 |
-
|
1162 |
-
|
1163 |
-
|
1164 |
-
|
1165 |
-
|
1166 |
-
|
1167 |
-
|
1168 |
-
|
1169 |
-
|
1170 |
-
|
1171 |
-
|
1172 |
-
|
1173 |
-
|
1174 |
-
|
1175 |
-
|
1176 |
-
|
1177 |
-
|
1178 |
-
|
1179 |
-
|
1180 |
-
|
1181 |
-
|
1182 |
-
|
1183 |
-
|
1184 |
-
|
1185 |
-
|
1186 |
-
|
1187 |
-
"path": "b/{bucket}/acl",
|
1188 |
-
"httpMethod": "POST",
|
1189 |
-
"description": "Creates a new ACL entry on the specified bucket.",
|
1190 |
-
"parameters": {
|
1191 |
-
"bucket": {
|
1192 |
-
"type": "string",
|
1193 |
-
"description": "Name of a bucket.",
|
1194 |
-
"required": true,
|
1195 |
-
"location": "path"
|
1196 |
-
},
|
1197 |
-
"userProject": {
|
1198 |
-
"type": "string",
|
1199 |
-
"description": "The project to be billed for this request. Required for Requester Pays buckets.",
|
1200 |
-
"location": "query"
|
1201 |
-
}
|
1202 |
-
},
|
1203 |
-
"parameterOrder": [
|
1204 |
-
"bucket"
|
1205 |
-
],
|
1206 |
-
"request": {
|
1207 |
-
"$ref": "BucketAccessControl"
|
1208 |
-
},
|
1209 |
-
"response": {
|
1210 |
-
"$ref": "BucketAccessControl"
|
1211 |
-
},
|
1212 |
-
"scopes": [
|
1213 |
-
"https://www.googleapis.com/auth/cloud-platform",
|
1214 |
-
"https://www.googleapis.com/auth/devstorage.full_control"
|
1215 |
-
]
|
1216 |
-
},
|
1217 |
-
"list": {
|
1218 |
-
"id": "storage.bucketAccessControls.list",
|
1219 |
-
"path": "b/{bucket}/acl",
|
1220 |
-
"httpMethod": "GET",
|
1221 |
-
"description": "Retrieves ACL entries on the specified bucket.",
|
1222 |
-
"parameters": {
|
1223 |
-
"bucket": {
|
1224 |
-
"type": "string",
|
1225 |
-
"description": "Name of a bucket.",
|
1226 |
-
"required": true,
|
1227 |
-
"location": "path"
|
1228 |
-
},
|
1229 |
-
"userProject": {
|
1230 |
-
"type": "string",
|
1231 |
-
"description": "The project to be billed for this request. Required for Requester Pays buckets.",
|
1232 |
-
"location": "query"
|
1233 |
-
}
|
1234 |
-
},
|
1235 |
-
"parameterOrder": [
|
1236 |
-
"bucket"
|
1237 |
-
],
|
1238 |
-
"response": {
|
1239 |
-
"$ref": "BucketAccessControls"
|
1240 |
-
},
|
1241 |
-
"scopes": [
|
1242 |
-
"https://www.googleapis.com/auth/cloud-platform",
|
1243 |
-
"https://www.googleapis.com/auth/devstorage.full_control"
|
1244 |
-
]
|
1245 |
-
},
|
1246 |
-
"patch": {
|
1247 |
-
"id": "storage.bucketAccessControls.patch",
|
1248 |
-
"path": "b/{bucket}/acl/{entity}",
|
1249 |
-
"httpMethod": "PATCH",
|
1250 |
-
"description": "Updates an ACL entry on the specified bucket. This method supports patch semantics.",
|
1251 |
-
"parameters": {
|
1252 |
-
"bucket": {
|
1253 |
-
"type": "string",
|
1254 |
-
"description": "Name of a bucket.",
|
1255 |
-
"required": true,
|
1256 |
-
"location": "path"
|
1257 |
-
},
|
1258 |
-
"entity": {
|
1259 |
-
"type": "string",
|
1260 |
-
"description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
|
1261 |
-
"required": true,
|
1262 |
-
"location": "path"
|
1263 |
-
},
|
1264 |
-
"userProject": {
|
1265 |
-
"type": "string",
|
1266 |
-
"description": "The project to be billed for this request. Required for Requester Pays buckets.",
|
1267 |
-
"location": "query"
|
1268 |
-
}
|
1269 |
-
},
|
1270 |
-
"parameterOrder": [
|
1271 |
-
"bucket",
|
1272 |
-
"entity"
|
1273 |
-
],
|
1274 |
-
"request": {
|
1275 |
-
"$ref": "BucketAccessControl"
|
1276 |
-
},
|
1277 |
-
"response": {
|
1278 |
-
"$ref": "BucketAccessControl"
|
1279 |
-
},
|
1280 |
-
"scopes": [
|
1281 |
-
"https://www.googleapis.com/auth/cloud-platform",
|
1282 |
-
"https://www.googleapis.com/auth/devstorage.full_control"
|
1283 |
]
|
|
|
1284 |
},
|
1285 |
-
"
|
1286 |
-
|
1287 |
-
|
1288 |
-
|
1289 |
-
"
|
1290 |
-
|
1291 |
-
|
1292 |
-
"type": "string",
|
1293 |
-
"description": "Name of a bucket.",
|
1294 |
-
"required": true,
|
1295 |
-
"location": "path"
|
1296 |
-
},
|
1297 |
-
"entity": {
|
1298 |
-
"type": "string",
|
1299 |
-
"description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
|
1300 |
-
"required": true,
|
1301 |
-
"location": "path"
|
1302 |
-
},
|
1303 |
-
"userProject": {
|
1304 |
-
"type": "string",
|
1305 |
-
"description": "The project to be billed for this request. Required for Requester Pays buckets.",
|
1306 |
-
"location": "query"
|
1307 |
-
}
|
1308 |
-
},
|
1309 |
-
"parameterOrder": [
|
1310 |
-
"bucket",
|
1311 |
-
"entity"
|
1312 |
-
],
|
1313 |
-
"request": {
|
1314 |
-
"$ref": "BucketAccessControl"
|
1315 |
-
},
|
1316 |
-
"response": {
|
1317 |
-
"$ref": "BucketAccessControl"
|
1318 |
-
},
|
1319 |
-
"scopes": [
|
1320 |
-
"https://www.googleapis.com/auth/cloud-platform",
|
1321 |
-
"https://www.googleapis.com/auth/devstorage.full_control"
|
1322 |
]
|
|
|
1323 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1324 |
}
|
1325 |
-
|
1326 |
-
|
1327 |
-
"
|
1328 |
-
|
1329 |
-
|
1330 |
-
|
1331 |
-
|
1332 |
-
|
1333 |
-
|
1334 |
-
|
1335 |
-
|
1336 |
-
|
1337 |
-
|
1338 |
-
|
1339 |
-
|
1340 |
-
|
1341 |
-
|
1342 |
-
|
1343 |
-
|
1344 |
-
|
1345 |
-
|
1346 |
-
|
1347 |
-
|
1348 |
-
|
1349 |
-
|
1350 |
-
|
1351 |
-
|
1352 |
-
|
1353 |
-
|
1354 |
-
|
1355 |
-
|
1356 |
-
|
1357 |
-
|
1358 |
-
|
1359 |
-
|
1360 |
-
|
1361 |
-
|
1362 |
-
|
1363 |
-
|
1364 |
-
|
1365 |
-
|
1366 |
-
|
1367 |
-
|
1368 |
-
|
1369 |
-
|
1370 |
-
|
1371 |
-
|
1372 |
-
|
1373 |
-
|
1374 |
-
|
1375 |
-
|
1376 |
-
|
1377 |
-
|
1378 |
-
|
1379 |
-
|
1380 |
-
|
1381 |
-
|
1382 |
-
|
1383 |
-
|
1384 |
-
|
1385 |
-
|
1386 |
-
|
1387 |
-
|
1388 |
-
|
1389 |
-
|
1390 |
-
|
1391 |
-
|
1392 |
-
|
1393 |
-
|
1394 |
-
|
1395 |
-
|
1396 |
-
|
1397 |
-
|
1398 |
-
|
1399 |
-
|
1400 |
-
|
1401 |
-
|
1402 |
-
|
1403 |
-
|
1404 |
-
|
1405 |
-
|
1406 |
-
|
1407 |
-
|
1408 |
-
|
1409 |
-
|
1410 |
-
|
1411 |
-
|
1412 |
-
],
|
1413 |
-
"response": {
|
1414 |
-
"$ref": "Bucket"
|
1415 |
-
},
|
1416 |
-
"scopes": [
|
1417 |
-
"https://www.googleapis.com/auth/cloud-platform",
|
1418 |
-
"https://www.googleapis.com/auth/cloud-platform.read-only",
|
1419 |
-
"https://www.googleapis.com/auth/devstorage.full_control",
|
1420 |
-
"https://www.googleapis.com/auth/devstorage.read_only",
|
1421 |
-
"https://www.googleapis.com/auth/devstorage.read_write"
|
1422 |
-
]
|
1423 |
-
},
|
1424 |
-
"getIamPolicy": {
|
1425 |
-
"id": "storage.buckets.getIamPolicy",
|
1426 |
-
"path": "b/{bucket}/iam",
|
1427 |
-
"httpMethod": "GET",
|
1428 |
-
"description": "Returns an IAM policy for the specified bucket.",
|
1429 |
-
"parameters": {
|
1430 |
-
"bucket": {
|
1431 |
-
"type": "string",
|
1432 |
-
"description": "Name of a bucket.",
|
1433 |
-
"required": true,
|
1434 |
-
"location": "path"
|
1435 |
-
},
|
1436 |
-
"userProject": {
|
1437 |
-
"type": "string",
|
1438 |
-
"description": "The project to be billed for this request. Required for Requester Pays buckets.",
|
1439 |
-
"location": "query"
|
1440 |
-
}
|
1441 |
-
},
|
1442 |
-
"parameterOrder": [
|
1443 |
-
"bucket"
|
1444 |
-
],
|
1445 |
-
"response": {
|
1446 |
-
"$ref": "Policy"
|
1447 |
-
},
|
1448 |
-
"scopes": [
|
1449 |
-
"https://www.googleapis.com/auth/cloud-platform",
|
1450 |
-
"https://www.googleapis.com/auth/cloud-platform.read-only",
|
1451 |
-
"https://www.googleapis.com/auth/devstorage.full_control",
|
1452 |
-
"https://www.googleapis.com/auth/devstorage.read_only",
|
1453 |
-
"https://www.googleapis.com/auth/devstorage.read_write"
|
1454 |
-
]
|
1455 |
-
},
|
1456 |
-
"insert": {
|
1457 |
-
"id": "storage.buckets.insert",
|
1458 |
-
"path": "b",
|
1459 |
-
"httpMethod": "POST",
|
1460 |
-
"description": "Creates a new bucket.",
|
1461 |
-
"parameters": {
|
1462 |
-
"predefinedAcl": {
|
1463 |
-
"type": "string",
|
1464 |
-
"description": "Apply a predefined set of access controls to this bucket.",
|
1465 |
-
"enum": [
|
1466 |
-
"authenticatedRead",
|
1467 |
-
"private",
|
1468 |
-
"projectPrivate",
|
1469 |
-
"publicRead",
|
1470 |
-
"publicReadWrite"
|
1471 |
-
],
|
1472 |
-
"enumDescriptions": [
|
1473 |
-
"Project team owners get OWNER access, and allAuthenticatedUsers get READER access.",
|
1474 |
-
"Project team owners get OWNER access.",
|
1475 |
-
"Project team members get access according to their roles.",
|
1476 |
-
"Project team owners get OWNER access, and allUsers get READER access.",
|
1477 |
-
"Project team owners get OWNER access, and allUsers get WRITER access."
|
1478 |
-
],
|
1479 |
-
"location": "query"
|
1480 |
-
},
|
1481 |
-
"predefinedDefaultObjectAcl": {
|
1482 |
-
"type": "string",
|
1483 |
-
"description": "Apply a predefined set of default object access controls to this bucket.",
|
1484 |
-
"enum": [
|
1485 |
-
"authenticatedRead",
|
1486 |
-
"bucketOwnerFullControl",
|
1487 |
-
"bucketOwnerRead",
|
1488 |
-
"private",
|
1489 |
-
"projectPrivate",
|
1490 |
-
"publicRead"
|
1491 |
-
],
|
1492 |
-
"enumDescriptions": [
|
1493 |
-
"Object owner gets OWNER access, and allAuthenticatedUsers get READER access.",
|
1494 |
-
"Object owner gets OWNER access, and project team owners get OWNER access.",
|
1495 |
-
"Object owner gets OWNER access, and project team owners get READER access.",
|
1496 |
-
"Object owner gets OWNER access.",
|
1497 |
-
"Object owner gets OWNER access, and project team members get access according to their roles.",
|
1498 |
-
"Object owner gets OWNER access, and allUsers get READER access."
|
1499 |
-
],
|
1500 |
-
"location": "query"
|
1501 |
-
},
|
1502 |
-
"project": {
|
1503 |
-
"type": "string",
|
1504 |
-
"description": "A valid API project identifier.",
|
1505 |
-
"required": true,
|
1506 |
-
"location": "query"
|
1507 |
-
},
|
1508 |
-
"projection": {
|
1509 |
-
"type": "string",
|
1510 |
-
"description": "Set of properties to return. Defaults to noAcl, unless the bucket resource specifies acl or defaultObjectAcl properties, when it defaults to full.",
|
1511 |
-
"enum": [
|
1512 |
-
"full",
|
1513 |
-
"noAcl"
|
1514 |
-
],
|
1515 |
-
"enumDescriptions": [
|
1516 |
-
"Include all properties.",
|
1517 |
-
"Omit owner, acl and defaultObjectAcl properties."
|
1518 |
-
],
|
1519 |
-
"location": "query"
|
1520 |
-
},
|
1521 |
-
"userProject": {
|
1522 |
-
"type": "string",
|
1523 |
-
"description": "The project to be billed for this request.",
|
1524 |
-
"location": "query"
|
1525 |
-
}
|
1526 |
-
},
|
1527 |
-
"parameterOrder": [
|
1528 |
-
"project"
|
1529 |
-
],
|
1530 |
-
"request": {
|
1531 |
-
"$ref": "Bucket"
|
1532 |
-
},
|
1533 |
-
"response": {
|
1534 |
-
"$ref": "Bucket"
|
1535 |
-
},
|
1536 |
-
"scopes": [
|
1537 |
-
"https://www.googleapis.com/auth/cloud-platform",
|
1538 |
-
"https://www.googleapis.com/auth/devstorage.full_control",
|
1539 |
-
"https://www.googleapis.com/auth/devstorage.read_write"
|
1540 |
-
]
|
1541 |
-
},
|
1542 |
-
"list": {
|
1543 |
-
"id": "storage.buckets.list",
|
1544 |
-
"path": "b",
|
1545 |
-
"httpMethod": "GET",
|
1546 |
-
"description": "Retrieves a list of buckets for a given project.",
|
1547 |
-
"parameters": {
|
1548 |
-
"maxResults": {
|
1549 |
-
"type": "integer",
|
1550 |
-
"description": "Maximum number of buckets to return in a single response. The service will use this parameter or 1,000 items, whichever is smaller.",
|
1551 |
-
"default": "1000",
|
1552 |
-
"format": "uint32",
|
1553 |
-
"minimum": "0",
|
1554 |
-
"location": "query"
|
1555 |
-
},
|
1556 |
-
"pageToken": {
|
1557 |
-
"type": "string",
|
1558 |
-
"description": "A previously-returned page token representing part of the larger set of results to view.",
|
1559 |
-
"location": "query"
|
1560 |
-
},
|
1561 |
-
"prefix": {
|
1562 |
-
"type": "string",
|
1563 |
-
"description": "Filter results to buckets whose names begin with this prefix.",
|
1564 |
-
"location": "query"
|
1565 |
-
},
|
1566 |
-
"project": {
|
1567 |
-
"type": "string",
|
1568 |
-
"description": "A valid API project identifier.",
|
1569 |
-
"required": true,
|
1570 |
-
"location": "query"
|
1571 |
-
},
|
1572 |
-
"projection": {
|
1573 |
-
"type": "string",
|
1574 |
-
"description": "Set of properties to return. Defaults to noAcl.",
|
1575 |
-
"enum": [
|
1576 |
-
"full",
|
1577 |
-
"noAcl"
|
1578 |
-
],
|
1579 |
-
"enumDescriptions": [
|
1580 |
-
"Include all properties.",
|
1581 |
-
"Omit owner, acl and defaultObjectAcl properties."
|
1582 |
-
],
|
1583 |
-
"location": "query"
|
1584 |
-
},
|
1585 |
-
"userProject": {
|
1586 |
-
"type": "string",
|
1587 |
-
"description": "The project to be billed for this request.",
|
1588 |
-
"location": "query"
|
1589 |
-
}
|
1590 |
-
},
|
1591 |
-
"parameterOrder": [
|
1592 |
-
"project"
|
1593 |
-
],
|
1594 |
-
"response": {
|
1595 |
-
"$ref": "Buckets"
|
1596 |
-
},
|
1597 |
-
"scopes": [
|
1598 |
-
"https://www.googleapis.com/auth/cloud-platform",
|
1599 |
-
"https://www.googleapis.com/auth/cloud-platform.read-only",
|
1600 |
-
"https://www.googleapis.com/auth/devstorage.full_control",
|
1601 |
-
"https://www.googleapis.com/auth/devstorage.read_only",
|
1602 |
-
"https://www.googleapis.com/auth/devstorage.read_write"
|
1603 |
-
]
|
1604 |
-
},
|
1605 |
-
"lockRetentionPolicy": {
|
1606 |
-
"id": "storage.buckets.lockRetentionPolicy",
|
1607 |
-
"path": "b/{bucket}/lockRetentionPolicy",
|
1608 |
-
"httpMethod": "POST",
|
1609 |
-
"description": "Locks retention policy on a bucket.",
|
1610 |
-
"parameters": {
|
1611 |
-
"bucket": {
|
1612 |
-
"type": "string",
|
1613 |
-
"description": "Name of a bucket.",
|
1614 |
-
"required": true,
|
1615 |
-
"location": "path"
|
1616 |
-
},
|
1617 |
-
"ifMetagenerationMatch": {
|
1618 |
-
"type": "string",
|
1619 |
-
"description": "Makes the operation conditional on whether bucket's current metageneration matches the given value.",
|
1620 |
-
"required": true,
|
1621 |
-
"format": "int64",
|
1622 |
-
"location": "query"
|
1623 |
-
},
|
1624 |
-
"userProject": {
|
1625 |
-
"type": "string",
|
1626 |
-
"description": "The project to be billed for this request. Required for Requester Pays buckets.",
|
1627 |
-
"location": "query"
|
1628 |
-
}
|
1629 |
-
},
|
1630 |
-
"parameterOrder": [
|
1631 |
-
"bucket",
|
1632 |
-
"ifMetagenerationMatch"
|
1633 |
-
],
|
1634 |
-
"response": {
|
1635 |
-
"$ref": "Bucket"
|
1636 |
-
},
|
1637 |
-
"scopes": [
|
1638 |
-
"https://www.googleapis.com/auth/cloud-platform",
|
1639 |
-
"https://www.googleapis.com/auth/devstorage.full_control",
|
1640 |
-
"https://www.googleapis.com/auth/devstorage.read_write"
|
1641 |
-
]
|
1642 |
-
},
|
1643 |
-
"patch": {
|
1644 |
-
"id": "storage.buckets.patch",
|
1645 |
-
"path": "b/{bucket}",
|
1646 |
-
"httpMethod": "PATCH",
|
1647 |
-
"description": "Updates a bucket. Changes to the bucket will be readable immediately after writing, but configuration changes may take time to propagate. This method supports patch semantics.",
|
1648 |
-
"parameters": {
|
1649 |
-
"bucket": {
|
1650 |
-
"type": "string",
|
1651 |
-
"description": "Name of a bucket.",
|
1652 |
-
"required": true,
|
1653 |
-
"location": "path"
|
1654 |
-
},
|
1655 |
-
"ifMetagenerationMatch": {
|
1656 |
-
"type": "string",
|
1657 |
-
"description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration matches the given value.",
|
1658 |
-
"format": "int64",
|
1659 |
-
"location": "query"
|
1660 |
-
},
|
1661 |
-
"ifMetagenerationNotMatch": {
|
1662 |
-
"type": "string",
|
1663 |
-
"description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration does not match the given value.",
|
1664 |
-
"format": "int64",
|
1665 |
-
"location": "query"
|
1666 |
-
},
|
1667 |
-
"predefinedAcl": {
|
1668 |
-
"type": "string",
|
1669 |
-
"description": "Apply a predefined set of access controls to this bucket.",
|
1670 |
-
"enum": [
|
1671 |
-
"authenticatedRead",
|
1672 |
-
"private",
|
1673 |
-
"projectPrivate",
|
1674 |
-
"publicRead",
|
1675 |
-
"publicReadWrite"
|
1676 |
-
],
|
1677 |
-
"enumDescriptions": [
|
1678 |
-
"Project team owners get OWNER access, and allAuthenticatedUsers get READER access.",
|
1679 |
-
"Project team owners get OWNER access.",
|
1680 |
-
"Project team members get access according to their roles.",
|
1681 |
-
"Project team owners get OWNER access, and allUsers get READER access.",
|
1682 |
-
"Project team owners get OWNER access, and allUsers get WRITER access."
|
1683 |
-
],
|
1684 |
-
"location": "query"
|
1685 |
-
},
|
1686 |
-
"predefinedDefaultObjectAcl": {
|
1687 |
-
"type": "string",
|
1688 |
-
"description": "Apply a predefined set of default object access controls to this bucket.",
|
1689 |
-
"enum": [
|
1690 |
-
"authenticatedRead",
|
1691 |
-
"bucketOwnerFullControl",
|
1692 |
-
"bucketOwnerRead",
|
1693 |
-
"private",
|
1694 |
-
"projectPrivate",
|
1695 |
-
"publicRead"
|
1696 |
-
],
|
1697 |
-
"enumDescriptions": [
|
1698 |
-
"Object owner gets OWNER access, and allAuthenticatedUsers get READER access.",
|
1699 |
-
"Object owner gets OWNER access, and project team owners get OWNER access.",
|
1700 |
-
"Object owner gets OWNER access, and project team owners get READER access.",
|
1701 |
-
"Object owner gets OWNER access.",
|
1702 |
-
"Object owner gets OWNER access, and project team members get access according to their roles.",
|
1703 |
-
"Object owner gets OWNER access, and allUsers get READER access."
|
1704 |
-
],
|
1705 |
-
"location": "query"
|
1706 |
-
},
|
1707 |
-
"projection": {
|
1708 |
-
"type": "string",
|
1709 |
-
"description": "Set of properties to return. Defaults to full.",
|
1710 |
-
"enum": [
|
1711 |
-
"full",
|
1712 |
-
"noAcl"
|
1713 |
-
],
|
1714 |
-
"enumDescriptions": [
|
1715 |
-
"Include all properties.",
|
1716 |
-
"Omit owner, acl and defaultObjectAcl properties."
|
1717 |
-
],
|
1718 |
-
"location": "query"
|
1719 |
-
},
|
1720 |
-
"userProject": {
|
1721 |
-
"type": "string",
|
1722 |
-
"description": "The project to be billed for this request. Required for Requester Pays buckets.",
|
1723 |
-
"location": "query"
|
1724 |
-
}
|
1725 |
-
},
|
1726 |
-
"parameterOrder": [
|
1727 |
-
"bucket"
|
1728 |
-
],
|
1729 |
-
"request": {
|
1730 |
-
"$ref": "Bucket"
|
1731 |
-
},
|
1732 |
-
"response": {
|
1733 |
-
"$ref": "Bucket"
|
1734 |
-
},
|
1735 |
-
"scopes": [
|
1736 |
-
"https://www.googleapis.com/auth/cloud-platform",
|
1737 |
-
"https://www.googleapis.com/auth/devstorage.full_control"
|
1738 |
-
]
|
1739 |
-
},
|
1740 |
-
"setIamPolicy": {
|
1741 |
-
"id": "storage.buckets.setIamPolicy",
|
1742 |
-
"path": "b/{bucket}/iam",
|
1743 |
-
"httpMethod": "PUT",
|
1744 |
-
"description": "Updates an IAM policy for the specified bucket.",
|
1745 |
-
"parameters": {
|
1746 |
-
"bucket": {
|
1747 |
-
"type": "string",
|
1748 |
-
"description": "Name of a bucket.",
|
1749 |
-
"required": true,
|
1750 |
-
"location": "path"
|
1751 |
-
},
|
1752 |
-
"userProject": {
|
1753 |
-
"type": "string",
|
1754 |
-
"description": "The project to be billed for this request. Required for Requester Pays buckets.",
|
1755 |
-
"location": "query"
|
1756 |
-
}
|
1757 |
-
},
|
1758 |
-
"parameterOrder": [
|
1759 |
-
"bucket"
|
1760 |
-
],
|
1761 |
-
"request": {
|
1762 |
-
"$ref": "Policy"
|
1763 |
-
},
|
1764 |
-
"response": {
|
1765 |
-
"$ref": "Policy"
|
1766 |
-
},
|
1767 |
-
"scopes": [
|
1768 |
-
"https://www.googleapis.com/auth/cloud-platform",
|
1769 |
-
"https://www.googleapis.com/auth/devstorage.full_control",
|
1770 |
-
"https://www.googleapis.com/auth/devstorage.read_write"
|
1771 |
-
]
|
1772 |
-
},
|
1773 |
-
"testIamPermissions": {
|
1774 |
-
"id": "storage.buckets.testIamPermissions",
|
1775 |
-
"path": "b/{bucket}/iam/testPermissions",
|
1776 |
-
"httpMethod": "GET",
|
1777 |
-
"description": "Tests a set of permissions on the given bucket to see which, if any, are held by the caller.",
|
1778 |
-
"parameters": {
|
1779 |
-
"bucket": {
|
1780 |
-
"type": "string",
|
1781 |
-
"description": "Name of a bucket.",
|
1782 |
-
"required": true,
|
1783 |
-
"location": "path"
|
1784 |
-
},
|
1785 |
-
"permissions": {
|
1786 |
-
"type": "string",
|
1787 |
-
"description": "Permissions to test.",
|
1788 |
-
"required": true,
|
1789 |
-
"repeated": true,
|
1790 |
-
"location": "query"
|
1791 |
-
},
|
1792 |
-
"userProject": {
|
1793 |
-
"type": "string",
|
1794 |
-
"description": "The project to be billed for this request. Required for Requester Pays buckets.",
|
1795 |
-
"location": "query"
|
1796 |
-
}
|
1797 |
-
},
|
1798 |
-
"parameterOrder": [
|
1799 |
-
"bucket",
|
1800 |
-
"permissions"
|
1801 |
-
],
|
1802 |
-
"response": {
|
1803 |
-
"$ref": "TestIamPermissionsResponse"
|
1804 |
-
},
|
1805 |
-
"scopes": [
|
1806 |
-
"https://www.googleapis.com/auth/cloud-platform",
|
1807 |
-
"https://www.googleapis.com/auth/cloud-platform.read-only",
|
1808 |
-
"https://www.googleapis.com/auth/devstorage.full_control",
|
1809 |
-
"https://www.googleapis.com/auth/devstorage.read_only",
|
1810 |
-
"https://www.googleapis.com/auth/devstorage.read_write"
|
1811 |
-
]
|
1812 |
-
},
|
1813 |
-
"update": {
|
1814 |
-
"id": "storage.buckets.update",
|
1815 |
-
"path": "b/{bucket}",
|
1816 |
-
"httpMethod": "PUT",
|
1817 |
-
"description": "Updates a bucket. Changes to the bucket will be readable immediately after writing, but configuration changes may take time to propagate.",
|
1818 |
-
"parameters": {
|
1819 |
-
"bucket": {
|
1820 |
-
"type": "string",
|
1821 |
-
"description": "Name of a bucket.",
|
1822 |
-
"required": true,
|
1823 |
-
"location": "path"
|
1824 |
-
},
|
1825 |
-
"ifMetagenerationMatch": {
|
1826 |
-
"type": "string",
|
1827 |
-
"description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration matches the given value.",
|
1828 |
-
"format": "int64",
|
1829 |
-
"location": "query"
|
1830 |
-
},
|
1831 |
-
"ifMetagenerationNotMatch": {
|
1832 |
-
"type": "string",
|
1833 |
-
"description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration does not match the given value.",
|
1834 |
-
"format": "int64",
|
1835 |
-
"location": "query"
|
1836 |
-
},
|
1837 |
-
"predefinedAcl": {
|
1838 |
-
"type": "string",
|
1839 |
-
"description": "Apply a predefined set of access controls to this bucket.",
|
1840 |
-
"enum": [
|
1841 |
-
"authenticatedRead",
|
1842 |
-
"private",
|
1843 |
-
"projectPrivate",
|
1844 |
-
"publicRead",
|
1845 |
-
"publicReadWrite"
|
1846 |
-
],
|
1847 |
-
"enumDescriptions": [
|
1848 |
-
"Project team owners get OWNER access, and allAuthenticatedUsers get READER access.",
|
1849 |
-
"Project team owners get OWNER access.",
|
1850 |
-
"Project team members get access according to their roles.",
|
1851 |
-
"Project team owners get OWNER access, and allUsers get READER access.",
|
1852 |
-
"Project team owners get OWNER access, and allUsers get WRITER access."
|
1853 |
-
],
|
1854 |
-
"location": "query"
|
1855 |
-
},
|
1856 |
-
"predefinedDefaultObjectAcl": {
|
1857 |
-
"type": "string",
|
1858 |
-
"description": "Apply a predefined set of default object access controls to this bucket.",
|
1859 |
-
"enum": [
|
1860 |
-
"authenticatedRead",
|
1861 |
-
"bucketOwnerFullControl",
|
1862 |
-
"bucketOwnerRead",
|
1863 |
-
"private",
|
1864 |
-
"projectPrivate",
|
1865 |
-
"publicRead"
|
1866 |
-
],
|
1867 |
-
"enumDescriptions": [
|
1868 |
-
"Object owner gets OWNER access, and allAuthenticatedUsers get READER access.",
|
1869 |
-
"Object owner gets OWNER access, and project team owners get OWNER access.",
|
1870 |
-
"Object owner gets OWNER access, and project team owners get READER access.",
|
1871 |
-
"Object owner gets OWNER access.",
|
1872 |
-
"Object owner gets OWNER access, and project team members get access according to their roles.",
|
1873 |
-
"Object owner gets OWNER access, and allUsers get READER access."
|
1874 |
-
],
|
1875 |
-
"location": "query"
|
1876 |
-
},
|
1877 |
-
"projection": {
|
1878 |
-
"type": "string",
|
1879 |
-
"description": "Set of properties to return. Defaults to full.",
|
1880 |
-
"enum": [
|
1881 |
-
"full",
|
1882 |
-
"noAcl"
|
1883 |
-
],
|
1884 |
-
"enumDescriptions": [
|
1885 |
-
"Include all properties.",
|
1886 |
-
"Omit owner, acl and defaultObjectAcl properties."
|
1887 |
-
],
|
1888 |
-
"location": "query"
|
1889 |
-
},
|
1890 |
-
"userProject": {
|
1891 |
-
"type": "string",
|
1892 |
-
"description": "The project to be billed for this request. Required for Requester Pays buckets.",
|
1893 |
-
"location": "query"
|
1894 |
-
}
|
1895 |
-
},
|
1896 |
-
"parameterOrder": [
|
1897 |
-
"bucket"
|
1898 |
-
],
|
1899 |
-
"request": {
|
1900 |
-
"$ref": "Bucket"
|
1901 |
-
},
|
1902 |
-
"response": {
|
1903 |
-
"$ref": "Bucket"
|
1904 |
-
},
|
1905 |
-
"scopes": [
|
1906 |
-
"https://www.googleapis.com/auth/cloud-platform",
|
1907 |
-
"https://www.googleapis.com/auth/devstorage.full_control"
|
1908 |
-
]
|
1909 |
-
}
|
1910 |
-
}
|
1911 |
-
},
|
1912 |
-
"channels": {
|
1913 |
-
"methods": {
|
1914 |
-
"stop": {
|
1915 |
-
"id": "storage.channels.stop",
|
1916 |
-
"path": "channels/stop",
|
1917 |
-
"httpMethod": "POST",
|
1918 |
-
"description": "Stop watching resources through this channel",
|
1919 |
-
"request": {
|
1920 |
-
"$ref": "Channel",
|
1921 |
-
"parameterName": "resource"
|
1922 |
-
},
|
1923 |
-
"scopes": [
|
1924 |
-
"https://www.googleapis.com/auth/cloud-platform",
|
1925 |
-
"https://www.googleapis.com/auth/cloud-platform.read-only",
|
1926 |
-
"https://www.googleapis.com/auth/devstorage.full_control",
|
1927 |
-
"https://www.googleapis.com/auth/devstorage.read_only",
|
1928 |
-
"https://www.googleapis.com/auth/devstorage.read_write"
|
1929 |
-
]
|
1930 |
-
}
|
1931 |
-
}
|
1932 |
-
},
|
1933 |
-
"defaultObjectAccessControls": {
|
1934 |
-
"methods": {
|
1935 |
-
"delete": {
|
1936 |
-
"id": "storage.defaultObjectAccessControls.delete",
|
1937 |
-
"path": "b/{bucket}/defaultObjectAcl/{entity}",
|
1938 |
-
"httpMethod": "DELETE",
|
1939 |
-
"description": "Permanently deletes the default object ACL entry for the specified entity on the specified bucket.",
|
1940 |
-
"parameters": {
|
1941 |
-
"bucket": {
|
1942 |
-
"type": "string",
|
1943 |
-
"description": "Name of a bucket.",
|
1944 |
-
"required": true,
|
1945 |
-
"location": "path"
|
1946 |
-
},
|
1947 |
-
"entity": {
|
1948 |
-
"type": "string",
|
1949 |
-
"description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
|
1950 |
-
"required": true,
|
1951 |
-
"location": "path"
|
1952 |
-
},
|
1953 |
-
"userProject": {
|
1954 |
-
"type": "string",
|
1955 |
-
"description": "The project to be billed for this request. Required for Requester Pays buckets.",
|
1956 |
-
"location": "query"
|
1957 |
-
}
|
1958 |
-
},
|
1959 |
-
"parameterOrder": [
|
1960 |
-
"bucket",
|
1961 |
-
"entity"
|
1962 |
-
],
|
1963 |
-
"scopes": [
|
1964 |
-
"https://www.googleapis.com/auth/cloud-platform",
|
1965 |
-
"https://www.googleapis.com/auth/devstorage.full_control"
|
1966 |
-
]
|
1967 |
-
},
|
1968 |
-
"get": {
|
1969 |
-
"id": "storage.defaultObjectAccessControls.get",
|
1970 |
-
"path": "b/{bucket}/defaultObjectAcl/{entity}",
|
1971 |
-
"httpMethod": "GET",
|
1972 |
-
"description": "Returns the default object ACL entry for the specified entity on the specified bucket.",
|
1973 |
-
"parameters": {
|
1974 |
-
"bucket": {
|
1975 |
-
"type": "string",
|
1976 |
-
"description": "Name of a bucket.",
|
1977 |
-
"required": true,
|
1978 |
-
"location": "path"
|
1979 |
-
},
|
1980 |
-
"entity": {
|
1981 |
-
"type": "string",
|
1982 |
-
"description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
|
1983 |
-
"required": true,
|
1984 |
-
"location": "path"
|
1985 |
-
},
|
1986 |
-
"userProject": {
|
1987 |
-
"type": "string",
|
1988 |
-
"description": "The project to be billed for this request. Required for Requester Pays buckets.",
|
1989 |
-
"location": "query"
|
1990 |
-
}
|
1991 |
-
},
|
1992 |
-
"parameterOrder": [
|
1993 |
-
"bucket",
|
1994 |
-
"entity"
|
1995 |
-
],
|
1996 |
-
"response": {
|
1997 |
-
"$ref": "ObjectAccessControl"
|
1998 |
-
},
|
1999 |
-
"scopes": [
|
2000 |
-
"https://www.googleapis.com/auth/cloud-platform",
|
2001 |
-
"https://www.googleapis.com/auth/devstorage.full_control"
|
2002 |
-
]
|
2003 |
-
},
|
2004 |
-
"insert": {
|
2005 |
-
"id": "storage.defaultObjectAccessControls.insert",
|
2006 |
-
"path": "b/{bucket}/defaultObjectAcl",
|
2007 |
-
"httpMethod": "POST",
|
2008 |
-
"description": "Creates a new default object ACL entry on the specified bucket.",
|
2009 |
-
"parameters": {
|
2010 |
-
"bucket": {
|
2011 |
-
"type": "string",
|
2012 |
-
"description": "Name of a bucket.",
|
2013 |
-
"required": true,
|
2014 |
-
"location": "path"
|
2015 |
-
},
|
2016 |
-
"userProject": {
|
2017 |
-
"type": "string",
|
2018 |
-
"description": "The project to be billed for this request. Required for Requester Pays buckets.",
|
2019 |
-
"location": "query"
|
2020 |
-
}
|
2021 |
-
},
|
2022 |
-
"parameterOrder": [
|
2023 |
-
"bucket"
|
2024 |
-
],
|
2025 |
-
"request": {
|
2026 |
-
"$ref": "ObjectAccessControl"
|
2027 |
-
},
|
2028 |
-
"response": {
|
2029 |
-
"$ref": "ObjectAccessControl"
|
2030 |
-
},
|
2031 |
-
"scopes": [
|
2032 |
-
"https://www.googleapis.com/auth/cloud-platform",
|
2033 |
-
"https://www.googleapis.com/auth/devstorage.full_control"
|
2034 |
-
]
|
2035 |
-
},
|
2036 |
-
"list": {
|
2037 |
-
"id": "storage.defaultObjectAccessControls.list",
|
2038 |
-
"path": "b/{bucket}/defaultObjectAcl",
|
2039 |
-
"httpMethod": "GET",
|
2040 |
-
"description": "Retrieves default object ACL entries on the specified bucket.",
|
2041 |
-
"parameters": {
|
2042 |
-
"bucket": {
|
2043 |
-
"type": "string",
|
2044 |
-
"description": "Name of a bucket.",
|
2045 |
-
"required": true,
|
2046 |
-
"location": "path"
|
2047 |
-
},
|
2048 |
-
"ifMetagenerationMatch": {
|
2049 |
-
"type": "string",
|
2050 |
-
"description": "If present, only return default ACL listing if the bucket's current metageneration matches this value.",
|
2051 |
-
"format": "int64",
|
2052 |
-
"location": "query"
|
2053 |
-
},
|
2054 |
-
"ifMetagenerationNotMatch": {
|
2055 |
-
"type": "string",
|
2056 |
-
"description": "If present, only return default ACL listing if the bucket's current metageneration does not match the given value.",
|
2057 |
-
"format": "int64",
|
2058 |
-
"location": "query"
|
2059 |
-
},
|
2060 |
-
"userProject": {
|
2061 |
-
"type": "string",
|
2062 |
-
"description": "The project to be billed for this request. Required for Requester Pays buckets.",
|
2063 |
-
"location": "query"
|
2064 |
-
}
|
2065 |
-
},
|
2066 |
-
"parameterOrder": [
|
2067 |
-
"bucket"
|
2068 |
-
],
|
2069 |
-
"response": {
|
2070 |
-
"$ref": "ObjectAccessControls"
|
2071 |
-
},
|
2072 |
-
"scopes": [
|
2073 |
-
"https://www.googleapis.com/auth/cloud-platform",
|
2074 |
-
"https://www.googleapis.com/auth/devstorage.full_control"
|
2075 |
-
]
|
2076 |
-
},
|
2077 |
-
"patch": {
|
2078 |
-
"id": "storage.defaultObjectAccessControls.patch",
|
2079 |
-
"path": "b/{bucket}/defaultObjectAcl/{entity}",
|
2080 |
-
"httpMethod": "PATCH",
|
2081 |
-
"description": "Updates a default object ACL entry on the specified bucket. This method supports patch semantics.",
|
2082 |
-
"parameters": {
|
2083 |
-
"bucket": {
|
2084 |
-
"type": "string",
|
2085 |
-
"description": "Name of a bucket.",
|
2086 |
-
"required": true,
|
2087 |
-
"location": "path"
|
2088 |
-
},
|
2089 |
-
"entity": {
|
2090 |
-
"type": "string",
|
2091 |
-
"description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
|
2092 |
-
"required": true,
|
2093 |
-
"location": "path"
|
2094 |
-
},
|
2095 |
-
"userProject": {
|
2096 |
-
"type": "string",
|
2097 |
-
"description": "The project to be billed for this request. Required for Requester Pays buckets.",
|
2098 |
-
"location": "query"
|
2099 |
-
}
|
2100 |
-
},
|
2101 |
-
"parameterOrder": [
|
2102 |
-
"bucket",
|
2103 |
-
"entity"
|
2104 |
-
],
|
2105 |
-
"request": {
|
2106 |
-
"$ref": "ObjectAccessControl"
|
2107 |
-
},
|
2108 |
-
"response": {
|
2109 |
-
"$ref": "ObjectAccessControl"
|
2110 |
-
},
|
2111 |
-
"scopes": [
|
2112 |
-
"https://www.googleapis.com/auth/cloud-platform",
|
2113 |
-
"https://www.googleapis.com/auth/devstorage.full_control"
|
2114 |
-
]
|
2115 |
-
},
|
2116 |
-
"update": {
|
2117 |
-
"id": "storage.defaultObjectAccessControls.update",
|
2118 |
-
"path": "b/{bucket}/defaultObjectAcl/{entity}",
|
2119 |
-
"httpMethod": "PUT",
|
2120 |
-
"description": "Updates a default object ACL entry on the specified bucket.",
|
2121 |
-
"parameters": {
|
2122 |
-
"bucket": {
|
2123 |
-
"type": "string",
|
2124 |
-
"description": "Name of a bucket.",
|
2125 |
-
"required": true,
|
2126 |
-
"location": "path"
|
2127 |
-
},
|
2128 |
-
"entity": {
|
2129 |
-
"type": "string",
|
2130 |
-
"description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
|
2131 |
-
"required": true,
|
2132 |
-
"location": "path"
|
2133 |
-
},
|
2134 |
-
"userProject": {
|
2135 |
-
"type": "string",
|
2136 |
-
"description": "The project to be billed for this request. Required for Requester Pays buckets.",
|
2137 |
-
"location": "query"
|
2138 |
-
}
|
2139 |
-
},
|
2140 |
-
"parameterOrder": [
|
2141 |
-
"bucket",
|
2142 |
-
"entity"
|
2143 |
-
],
|
2144 |
-
"request": {
|
2145 |
-
"$ref": "ObjectAccessControl"
|
2146 |
-
},
|
2147 |
-
"response": {
|
2148 |
-
"$ref": "ObjectAccessControl"
|
2149 |
-
},
|
2150 |
-
"scopes": [
|
2151 |
-
"https://www.googleapis.com/auth/cloud-platform",
|
2152 |
-
"https://www.googleapis.com/auth/devstorage.full_control"
|
2153 |
-
]
|
2154 |
-
}
|
2155 |
}
|
2156 |
-
|
2157 |
-
|
2158 |
-
|
2159 |
-
|
2160 |
-
|
2161 |
-
|
2162 |
-
|
2163 |
-
|
2164 |
-
|
2165 |
-
|
2166 |
-
|
2167 |
-
|
2168 |
-
|
2169 |
-
|
2170 |
-
|
2171 |
-
|
2172 |
-
|
2173 |
-
|
2174 |
-
|
2175 |
-
|
2176 |
-
|
2177 |
-
|
2178 |
-
|
2179 |
-
|
2180 |
-
|
2181 |
-
|
2182 |
-
|
2183 |
-
|
2184 |
-
|
2185 |
-
|
2186 |
-
|
2187 |
-
|
2188 |
-
|
2189 |
-
|
2190 |
-
|
2191 |
-
|
2192 |
-
|
2193 |
-
|
2194 |
-
|
2195 |
-
|
2196 |
-
|
2197 |
-
|
2198 |
-
|
2199 |
-
|
2200 |
-
|
2201 |
-
|
2202 |
-
|
2203 |
-
|
2204 |
-
|
2205 |
-
|
2206 |
-
|
2207 |
-
|
2208 |
-
|
2209 |
-
|
2210 |
-
|
2211 |
-
|
2212 |
-
|
2213 |
-
|
2214 |
-
|
2215 |
-
|
2216 |
-
|
2217 |
-
|
2218 |
-
|
2219 |
-
|
2220 |
-
|
2221 |
-
|
2222 |
-
|
2223 |
-
|
2224 |
-
|
2225 |
-
|
2226 |
-
|
2227 |
-
|
2228 |
-
|
2229 |
-
|
2230 |
-
|
2231 |
-
|
2232 |
-
|
2233 |
-
|
2234 |
-
|
2235 |
-
|
2236 |
-
|
2237 |
-
|
2238 |
-
|
2239 |
-
|
2240 |
-
|
2241 |
-
|
2242 |
-
|
2243 |
-
|
2244 |
-
|
2245 |
-
|
2246 |
-
|
2247 |
-
|
2248 |
-
|
2249 |
-
|
2250 |
-
|
2251 |
-
|
2252 |
-
|
2253 |
-
|
2254 |
-
|
2255 |
-
|
2256 |
-
|
2257 |
-
|
2258 |
-
|
2259 |
-
|
2260 |
-
|
2261 |
-
|
2262 |
-
|
2263 |
-
|
2264 |
-
|
2265 |
-
|
2266 |
-
|
2267 |
-
|
2268 |
-
|
2269 |
-
|
2270 |
-
|
2271 |
-
|
2272 |
-
|
2273 |
-
|
2274 |
-
|
2275 |
-
|
2276 |
-
|
2277 |
-
|
2278 |
-
|
2279 |
-
|
2280 |
-
|
2281 |
-
|
2282 |
-
|
2283 |
-
|
2284 |
-
|
2285 |
-
|
2286 |
-
|
2287 |
-
|
2288 |
-
|
2289 |
-
|
2290 |
-
|
2291 |
-
|
2292 |
-
|
2293 |
-
|
2294 |
-
|
2295 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2296 |
}
|
|
|
2297 |
}
|
2298 |
-
|
2299 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2300 |
"methods": {
|
2301 |
-
|
2302 |
-
|
2303 |
-
|
2304 |
-
|
2305 |
-
|
2306 |
-
|
2307 |
-
|
2308 |
-
|
2309 |
-
|
2310 |
-
|
2311 |
-
|
2312 |
-
|
2313 |
-
|
2314 |
-
|
2315 |
-
|
2316 |
-
|
2317 |
-
|
2318 |
-
|
2319 |
-
|
2320 |
-
|
2321 |
-
|
2322 |
-
|
2323 |
-
|
2324 |
-
|
2325 |
-
|
2326 |
-
|
2327 |
-
|
2328 |
-
|
2329 |
-
|
2330 |
-
|
2331 |
-
|
2332 |
-
|
2333 |
-
|
2334 |
-
|
2335 |
-
|
2336 |
-
|
2337 |
-
|
2338 |
-
|
2339 |
-
|
2340 |
-
|
2341 |
-
|
2342 |
-
|
2343 |
-
|
2344 |
-
|
2345 |
-
|
2346 |
-
|
2347 |
-
|
2348 |
-
|
2349 |
-
|
2350 |
-
"
|
2351 |
-
"description": "
|
2352 |
-
"
|
2353 |
-
|
2354 |
-
|
2355 |
-
|
2356 |
-
|
2357 |
-
|
2358 |
-
|
2359 |
-
|
2360 |
-
|
2361 |
-
|
2362 |
-
|
2363 |
-
|
2364 |
-
|
2365 |
-
|
2366 |
-
|
2367 |
-
|
2368 |
-
|
2369 |
-
|
2370 |
-
|
2371 |
-
|
2372 |
-
|
2373 |
-
|
2374 |
-
|
2375 |
-
|
2376 |
-
|
2377 |
-
|
2378 |
-
|
2379 |
-
|
2380 |
-
|
2381 |
-
|
2382 |
-
|
2383 |
-
|
2384 |
-
|
2385 |
-
|
2386 |
-
|
2387 |
-
|
2388 |
-
|
2389 |
-
|
2390 |
-
|
2391 |
-
"
|
2392 |
-
|
2393 |
-
|
2394 |
-
|
2395 |
-
|
2396 |
-
|
2397 |
-
|
2398 |
-
|
2399 |
-
|
2400 |
-
|
2401 |
-
|
2402 |
-
|
2403 |
-
|
2404 |
-
|
2405 |
-
|
2406 |
-
|
2407 |
-
|
2408 |
-
|
2409 |
-
|
2410 |
-
|
2411 |
-
|
2412 |
-
|
2413 |
-
|
2414 |
-
|
2415 |
-
|
2416 |
-
|
2417 |
-
|
2418 |
-
|
2419 |
-
|
2420 |
-
|
2421 |
-
|
2422 |
-
|
2423 |
-
|
2424 |
-
|
2425 |
-
|
2426 |
-
"
|
2427 |
-
|
2428 |
-
|
2429 |
-
|
2430 |
-
"
|
2431 |
-
|
2432 |
-
|
2433 |
-
|
2434 |
-
|
2435 |
-
|
2436 |
-
"
|
2437 |
-
|
2438 |
-
|
2439 |
-
|
2440 |
-
|
2441 |
-
|
2442 |
-
"
|
2443 |
-
|
2444 |
-
|
2445 |
-
"
|
2446 |
-
"
|
2447 |
-
|
2448 |
-
|
2449 |
-
|
2450 |
-
|
2451 |
-
|
2452 |
-
|
2453 |
-
|
2454 |
-
|
2455 |
-
|
2456 |
-
|
2457 |
-
|
2458 |
-
|
2459 |
-
|
2460 |
-
|
2461 |
-
|
2462 |
-
|
2463 |
-
|
2464 |
-
|
2465 |
-
|
2466 |
-
|
2467 |
-
|
2468 |
-
|
2469 |
-
|
2470 |
-
|
2471 |
-
"
|
2472 |
-
|
2473 |
-
|
2474 |
-
|
2475 |
-
|
2476 |
-
|
2477 |
-
|
2478 |
-
"
|
2479 |
-
|
2480 |
-
|
2481 |
-
|
2482 |
-
|
2483 |
-
|
2484 |
-
"
|
2485 |
-
|
2486 |
-
|
2487 |
-
|
2488 |
-
|
2489 |
-
|
2490 |
-
|
2491 |
-
|
2492 |
-
|
2493 |
-
|
2494 |
-
|
2495 |
-
|
2496 |
-
|
2497 |
-
|
2498 |
-
|
2499 |
-
|
2500 |
-
|
2501 |
-
|
2502 |
-
"type": "string",
|
2503 |
-
"description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
|
2504 |
-
"format": "int64",
|
2505 |
-
"location": "query"
|
2506 |
-
},
|
2507 |
-
"object": {
|
2508 |
-
"type": "string",
|
2509 |
-
"description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
|
2510 |
-
"required": true,
|
2511 |
-
"location": "path"
|
2512 |
-
},
|
2513 |
-
"userProject": {
|
2514 |
-
"type": "string",
|
2515 |
-
"description": "The project to be billed for this request. Required for Requester Pays buckets.",
|
2516 |
-
"location": "query"
|
2517 |
-
}
|
2518 |
-
},
|
2519 |
-
"parameterOrder": [
|
2520 |
-
"bucket",
|
2521 |
-
"object",
|
2522 |
-
"entity"
|
2523 |
-
],
|
2524 |
-
"request": {
|
2525 |
-
"$ref": "ObjectAccessControl"
|
2526 |
-
},
|
2527 |
-
"response": {
|
2528 |
-
"$ref": "ObjectAccessControl"
|
2529 |
-
},
|
2530 |
-
"scopes": [
|
2531 |
-
"https://www.googleapis.com/auth/cloud-platform",
|
2532 |
-
"https://www.googleapis.com/auth/devstorage.full_control"
|
2533 |
-
]
|
2534 |
-
},
|
2535 |
-
"update": {
|
2536 |
-
"id": "storage.objectAccessControls.update",
|
2537 |
-
"path": "b/{bucket}/o/{object}/acl/{entity}",
|
2538 |
-
"httpMethod": "PUT",
|
2539 |
-
"description": "Updates an ACL entry on the specified object.",
|
2540 |
-
"parameters": {
|
2541 |
-
"bucket": {
|
2542 |
-
"type": "string",
|
2543 |
-
"description": "Name of a bucket.",
|
2544 |
-
"required": true,
|
2545 |
-
"location": "path"
|
2546 |
-
},
|
2547 |
-
"entity": {
|
2548 |
-
"type": "string",
|
2549 |
-
"description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
|
2550 |
-
"required": true,
|
2551 |
-
"location": "path"
|
2552 |
-
},
|
2553 |
-
"generation": {
|
2554 |
-
"type": "string",
|
2555 |
-
"description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
|
2556 |
-
"format": "int64",
|
2557 |
-
"location": "query"
|
2558 |
-
},
|
2559 |
-
"object": {
|
2560 |
-
"type": "string",
|
2561 |
-
"description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
|
2562 |
-
"required": true,
|
2563 |
-
"location": "path"
|
2564 |
-
},
|
2565 |
-
"userProject": {
|
2566 |
-
"type": "string",
|
2567 |
-
"description": "The project to be billed for this request. Required for Requester Pays buckets.",
|
2568 |
-
"location": "query"
|
2569 |
-
}
|
2570 |
-
},
|
2571 |
-
"parameterOrder": [
|
2572 |
-
"bucket",
|
2573 |
-
"object",
|
2574 |
-
"entity"
|
2575 |
-
],
|
2576 |
-
"request": {
|
2577 |
-
"$ref": "ObjectAccessControl"
|
2578 |
-
},
|
2579 |
-
"response": {
|
2580 |
-
"$ref": "ObjectAccessControl"
|
2581 |
-
},
|
2582 |
-
"scopes": [
|
2583 |
-
"https://www.googleapis.com/auth/cloud-platform",
|
2584 |
-
"https://www.googleapis.com/auth/devstorage.full_control"
|
2585 |
-
]
|
2586 |
-
}
|
2587 |
}
|
2588 |
-
|
2589 |
-
|
2590 |
"methods": {
|
2591 |
-
|
2592 |
-
|
2593 |
-
|
2594 |
-
|
2595 |
-
|
2596 |
-
|
2597 |
-
|
2598 |
-
|
2599 |
-
|
2600 |
-
|
2601 |
-
|
2602 |
-
|
2603 |
-
|
2604 |
-
|
2605 |
-
|
2606 |
-
|
2607 |
-
|
2608 |
-
|
2609 |
-
|
2610 |
-
|
2611 |
-
|
2612 |
-
|
2613 |
-
|
2614 |
-
|
2615 |
-
|
2616 |
-
|
2617 |
-
|
2618 |
-
|
2619 |
-
|
2620 |
-
|
2621 |
-
|
2622 |
-
|
2623 |
-
|
2624 |
-
|
2625 |
-
|
2626 |
-
|
2627 |
-
|
2628 |
-
"location": "query"
|
2629 |
-
},
|
2630 |
-
"ifGenerationMatch": {
|
2631 |
-
"type": "string",
|
2632 |
-
"description": "Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.",
|
2633 |
-
"format": "int64",
|
2634 |
-
"location": "query"
|
2635 |
-
},
|
2636 |
-
"ifMetagenerationMatch": {
|
2637 |
-
"type": "string",
|
2638 |
-
"description": "Makes the operation conditional on whether the object's current metageneration matches the given value.",
|
2639 |
-
"format": "int64",
|
2640 |
-
"location": "query"
|
2641 |
-
},
|
2642 |
-
"kmsKeyName": {
|
2643 |
-
"type": "string",
|
2644 |
-
"description": "Resource name of the Cloud KMS key, of the form projects/my-project/locations/global/keyRings/my-kr/cryptoKeys/my-key, that will be used to encrypt the object. Overrides the object metadata's kms_key_name value, if any.",
|
2645 |
-
"location": "query"
|
2646 |
-
},
|
2647 |
-
"userProject": {
|
2648 |
-
"type": "string",
|
2649 |
-
"description": "The project to be billed for this request. Required for Requester Pays buckets.",
|
2650 |
-
"location": "query"
|
2651 |
-
}
|
2652 |
-
},
|
2653 |
-
"parameterOrder": [
|
2654 |
-
"destinationBucket",
|
2655 |
-
"destinationObject"
|
2656 |
-
],
|
2657 |
-
"request": {
|
2658 |
-
"$ref": "ComposeRequest"
|
2659 |
-
},
|
2660 |
-
"response": {
|
2661 |
-
"$ref": "Object"
|
2662 |
-
},
|
2663 |
-
"scopes": [
|
2664 |
-
"https://www.googleapis.com/auth/cloud-platform",
|
2665 |
-
"https://www.googleapis.com/auth/devstorage.full_control",
|
2666 |
-
"https://www.googleapis.com/auth/devstorage.read_write"
|
2667 |
-
]
|
2668 |
-
},
|
2669 |
-
"copy": {
|
2670 |
-
"id": "storage.objects.copy",
|
2671 |
-
"path": "b/{sourceBucket}/o/{sourceObject}/copyTo/b/{destinationBucket}/o/{destinationObject}",
|
2672 |
-
"httpMethod": "POST",
|
2673 |
-
"description": "Copies a source object to a destination object. Optionally overrides metadata.",
|
2674 |
-
"parameters": {
|
2675 |
-
"destinationBucket": {
|
2676 |
-
"type": "string",
|
2677 |
-
"description": "Name of the bucket in which to store the new object. Overrides the provided object metadata's bucket value, if any.For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
|
2678 |
-
"required": true,
|
2679 |
-
"location": "path"
|
2680 |
-
},
|
2681 |
-
"destinationObject": {
|
2682 |
-
"type": "string",
|
2683 |
-
"description": "Name of the new object. Required when the object metadata is not otherwise provided. Overrides the object metadata's name value, if any.",
|
2684 |
-
"required": true,
|
2685 |
-
"location": "path"
|
2686 |
-
},
|
2687 |
-
"destinationPredefinedAcl": {
|
2688 |
-
"type": "string",
|
2689 |
-
"description": "Apply a predefined set of access controls to the destination object.",
|
2690 |
-
"enum": [
|
2691 |
-
"authenticatedRead",
|
2692 |
-
"bucketOwnerFullControl",
|
2693 |
-
"bucketOwnerRead",
|
2694 |
-
"private",
|
2695 |
-
"projectPrivate",
|
2696 |
-
"publicRead"
|
2697 |
-
],
|
2698 |
-
"enumDescriptions": [
|
2699 |
-
"Object owner gets OWNER access, and allAuthenticatedUsers get READER access.",
|
2700 |
-
"Object owner gets OWNER access, and project team owners get OWNER access.",
|
2701 |
-
"Object owner gets OWNER access, and project team owners get READER access.",
|
2702 |
-
"Object owner gets OWNER access.",
|
2703 |
-
"Object owner gets OWNER access, and project team members get access according to their roles.",
|
2704 |
-
"Object owner gets OWNER access, and allUsers get READER access."
|
2705 |
-
],
|
2706 |
-
"location": "query"
|
2707 |
-
},
|
2708 |
-
"ifGenerationMatch": {
|
2709 |
-
"type": "string",
|
2710 |
-
"description": "Makes the operation conditional on whether the destination object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.",
|
2711 |
-
"format": "int64",
|
2712 |
-
"location": "query"
|
2713 |
-
},
|
2714 |
-
"ifGenerationNotMatch": {
|
2715 |
-
"type": "string",
|
2716 |
-
"description": "Makes the operation conditional on whether the destination object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.",
|
2717 |
-
"format": "int64",
|
2718 |
-
"location": "query"
|
2719 |
-
},
|
2720 |
-
"ifMetagenerationMatch": {
|
2721 |
-
"type": "string",
|
2722 |
-
"description": "Makes the operation conditional on whether the destination object's current metageneration matches the given value.",
|
2723 |
-
"format": "int64",
|
2724 |
-
"location": "query"
|
2725 |
-
},
|
2726 |
-
"ifMetagenerationNotMatch": {
|
2727 |
-
"type": "string",
|
2728 |
-
"description": "Makes the operation conditional on whether the destination object's current metageneration does not match the given value.",
|
2729 |
-
"format": "int64",
|
2730 |
-
"location": "query"
|
2731 |
-
},
|
2732 |
-
"ifSourceGenerationMatch": {
|
2733 |
-
"type": "string",
|
2734 |
-
"description": "Makes the operation conditional on whether the source object's current generation matches the given value.",
|
2735 |
-
"format": "int64",
|
2736 |
-
"location": "query"
|
2737 |
-
},
|
2738 |
-
"ifSourceGenerationNotMatch": {
|
2739 |
-
"type": "string",
|
2740 |
-
"description": "Makes the operation conditional on whether the source object's current generation does not match the given value.",
|
2741 |
-
"format": "int64",
|
2742 |
-
"location": "query"
|
2743 |
-
},
|
2744 |
-
"ifSourceMetagenerationMatch": {
|
2745 |
-
"type": "string",
|
2746 |
-
"description": "Makes the operation conditional on whether the source object's current metageneration matches the given value.",
|
2747 |
-
"format": "int64",
|
2748 |
-
"location": "query"
|
2749 |
-
},
|
2750 |
-
"ifSourceMetagenerationNotMatch": {
|
2751 |
-
"type": "string",
|
2752 |
-
"description": "Makes the operation conditional on whether the source object's current metageneration does not match the given value.",
|
2753 |
-
"format": "int64",
|
2754 |
-
"location": "query"
|
2755 |
-
},
|
2756 |
-
"projection": {
|
2757 |
-
"type": "string",
|
2758 |
-
"description": "Set of properties to return. Defaults to noAcl, unless the object resource specifies the acl property, when it defaults to full.",
|
2759 |
-
"enum": [
|
2760 |
-
"full",
|
2761 |
-
"noAcl"
|
2762 |
-
],
|
2763 |
-
"enumDescriptions": [
|
2764 |
-
"Include all properties.",
|
2765 |
-
"Omit the owner, acl property."
|
2766 |
-
],
|
2767 |
-
"location": "query"
|
2768 |
-
},
|
2769 |
-
"sourceBucket": {
|
2770 |
-
"type": "string",
|
2771 |
-
"description": "Name of the bucket in which to find the source object.",
|
2772 |
-
"required": true,
|
2773 |
-
"location": "path"
|
2774 |
-
},
|
2775 |
-
"sourceGeneration": {
|
2776 |
-
"type": "string",
|
2777 |
-
"description": "If present, selects a specific revision of the source object (as opposed to the latest version, the default).",
|
2778 |
-
"format": "int64",
|
2779 |
-
"location": "query"
|
2780 |
-
},
|
2781 |
-
"sourceObject": {
|
2782 |
-
"type": "string",
|
2783 |
-
"description": "Name of the source object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
|
2784 |
-
"required": true,
|
2785 |
-
"location": "path"
|
2786 |
-
},
|
2787 |
-
"userProject": {
|
2788 |
-
"type": "string",
|
2789 |
-
"description": "The project to be billed for this request. Required for Requester Pays buckets.",
|
2790 |
-
"location": "query"
|
2791 |
-
}
|
2792 |
-
},
|
2793 |
-
"parameterOrder": [
|
2794 |
-
"sourceBucket",
|
2795 |
-
"sourceObject",
|
2796 |
-
"destinationBucket",
|
2797 |
-
"destinationObject"
|
2798 |
-
],
|
2799 |
-
"request": {
|
2800 |
-
"$ref": "Object"
|
2801 |
-
},
|
2802 |
-
"response": {
|
2803 |
-
"$ref": "Object"
|
2804 |
-
},
|
2805 |
-
"scopes": [
|
2806 |
-
"https://www.googleapis.com/auth/cloud-platform",
|
2807 |
-
"https://www.googleapis.com/auth/devstorage.full_control",
|
2808 |
-
"https://www.googleapis.com/auth/devstorage.read_write"
|
2809 |
-
]
|
2810 |
-
},
|
2811 |
-
"delete": {
|
2812 |
-
"id": "storage.objects.delete",
|
2813 |
-
"path": "b/{bucket}/o/{object}",
|
2814 |
-
"httpMethod": "DELETE",
|
2815 |
-
"description": "Deletes an object and its metadata. Deletions are permanent if versioning is not enabled for the bucket, or if the generation parameter is used.",
|
2816 |
-
"parameters": {
|
2817 |
-
"bucket": {
|
2818 |
-
"type": "string",
|
2819 |
-
"description": "Name of the bucket in which the object resides.",
|
2820 |
-
"required": true,
|
2821 |
-
"location": "path"
|
2822 |
-
},
|
2823 |
-
"generation": {
|
2824 |
-
"type": "string",
|
2825 |
-
"description": "If present, permanently deletes a specific revision of this object (as opposed to the latest version, the default).",
|
2826 |
-
"format": "int64",
|
2827 |
-
"location": "query"
|
2828 |
-
},
|
2829 |
-
"ifGenerationMatch": {
|
2830 |
-
"type": "string",
|
2831 |
-
"description": "Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.",
|
2832 |
-
"format": "int64",
|
2833 |
-
"location": "query"
|
2834 |
-
},
|
2835 |
-
"ifGenerationNotMatch": {
|
2836 |
-
"type": "string",
|
2837 |
-
"description": "Makes the operation conditional on whether the object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.",
|
2838 |
-
"format": "int64",
|
2839 |
-
"location": "query"
|
2840 |
-
},
|
2841 |
-
"ifMetagenerationMatch": {
|
2842 |
-
"type": "string",
|
2843 |
-
"description": "Makes the operation conditional on whether the object's current metageneration matches the given value.",
|
2844 |
-
"format": "int64",
|
2845 |
-
"location": "query"
|
2846 |
-
},
|
2847 |
-
"ifMetagenerationNotMatch": {
|
2848 |
-
"type": "string",
|
2849 |
-
"description": "Makes the operation conditional on whether the object's current metageneration does not match the given value.",
|
2850 |
-
"format": "int64",
|
2851 |
-
"location": "query"
|
2852 |
-
},
|
2853 |
-
"object": {
|
2854 |
-
"type": "string",
|
2855 |
-
"description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
|
2856 |
-
"required": true,
|
2857 |
-
"location": "path"
|
2858 |
-
},
|
2859 |
-
"userProject": {
|
2860 |
-
"type": "string",
|
2861 |
-
"description": "The project to be billed for this request. Required for Requester Pays buckets.",
|
2862 |
-
"location": "query"
|
2863 |
-
}
|
2864 |
-
},
|
2865 |
-
"parameterOrder": [
|
2866 |
-
"bucket",
|
2867 |
-
"object"
|
2868 |
-
],
|
2869 |
-
"scopes": [
|
2870 |
-
"https://www.googleapis.com/auth/cloud-platform",
|
2871 |
-
"https://www.googleapis.com/auth/devstorage.full_control",
|
2872 |
-
"https://www.googleapis.com/auth/devstorage.read_write"
|
2873 |
-
]
|
2874 |
-
},
|
2875 |
-
"get": {
|
2876 |
-
"id": "storage.objects.get",
|
2877 |
-
"path": "b/{bucket}/o/{object}",
|
2878 |
-
"httpMethod": "GET",
|
2879 |
-
"description": "Retrieves an object or its metadata.",
|
2880 |
-
"parameters": {
|
2881 |
-
"bucket": {
|
2882 |
-
"type": "string",
|
2883 |
-
"description": "Name of the bucket in which the object resides.",
|
2884 |
-
"required": true,
|
2885 |
-
"location": "path"
|
2886 |
-
},
|
2887 |
-
"generation": {
|
2888 |
-
"type": "string",
|
2889 |
-
"description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
|
2890 |
-
"format": "int64",
|
2891 |
-
"location": "query"
|
2892 |
-
},
|
2893 |
-
"ifGenerationMatch": {
|
2894 |
-
"type": "string",
|
2895 |
-
"description": "Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.",
|
2896 |
-
"format": "int64",
|
2897 |
-
"location": "query"
|
2898 |
-
},
|
2899 |
-
"ifGenerationNotMatch": {
|
2900 |
-
"type": "string",
|
2901 |
-
"description": "Makes the operation conditional on whether the object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.",
|
2902 |
-
"format": "int64",
|
2903 |
-
"location": "query"
|
2904 |
-
},
|
2905 |
-
"ifMetagenerationMatch": {
|
2906 |
-
"type": "string",
|
2907 |
-
"description": "Makes the operation conditional on whether the object's current metageneration matches the given value.",
|
2908 |
-
"format": "int64",
|
2909 |
-
"location": "query"
|
2910 |
-
},
|
2911 |
-
"ifMetagenerationNotMatch": {
|
2912 |
-
"type": "string",
|
2913 |
-
"description": "Makes the operation conditional on whether the object's current metageneration does not match the given value.",
|
2914 |
-
"format": "int64",
|
2915 |
-
"location": "query"
|
2916 |
-
},
|
2917 |
-
"object": {
|
2918 |
-
"type": "string",
|
2919 |
-
"description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
|
2920 |
-
"required": true,
|
2921 |
-
"location": "path"
|
2922 |
-
},
|
2923 |
-
"projection": {
|
2924 |
-
"type": "string",
|
2925 |
-
"description": "Set of properties to return. Defaults to noAcl.",
|
2926 |
-
"enum": [
|
2927 |
-
"full",
|
2928 |
-
"noAcl"
|
2929 |
-
],
|
2930 |
-
"enumDescriptions": [
|
2931 |
-
"Include all properties.",
|
2932 |
-
"Omit the owner, acl property."
|
2933 |
-
],
|
2934 |
-
"location": "query"
|
2935 |
-
},
|
2936 |
-
"userProject": {
|
2937 |
-
"type": "string",
|
2938 |
-
"description": "The project to be billed for this request. Required for Requester Pays buckets.",
|
2939 |
-
"location": "query"
|
2940 |
-
}
|
2941 |
-
},
|
2942 |
-
"parameterOrder": [
|
2943 |
-
"bucket",
|
2944 |
-
"object"
|
2945 |
-
],
|
2946 |
-
"response": {
|
2947 |
-
"$ref": "Object"
|
2948 |
-
},
|
2949 |
-
"scopes": [
|
2950 |
-
"https://www.googleapis.com/auth/cloud-platform",
|
2951 |
-
"https://www.googleapis.com/auth/cloud-platform.read-only",
|
2952 |
-
"https://www.googleapis.com/auth/devstorage.full_control",
|
2953 |
-
"https://www.googleapis.com/auth/devstorage.read_only",
|
2954 |
-
"https://www.googleapis.com/auth/devstorage.read_write"
|
2955 |
-
],
|
2956 |
-
"supportsMediaDownload": true,
|
2957 |
-
"useMediaDownloadService": true
|
2958 |
-
},
|
2959 |
-
"getIamPolicy": {
|
2960 |
-
"id": "storage.objects.getIamPolicy",
|
2961 |
-
"path": "b/{bucket}/o/{object}/iam",
|
2962 |
-
"httpMethod": "GET",
|
2963 |
-
"description": "Returns an IAM policy for the specified object.",
|
2964 |
-
"parameters": {
|
2965 |
-
"bucket": {
|
2966 |
-
"type": "string",
|
2967 |
-
"description": "Name of the bucket in which the object resides.",
|
2968 |
-
"required": true,
|
2969 |
-
"location": "path"
|
2970 |
-
},
|
2971 |
-
"generation": {
|
2972 |
-
"type": "string",
|
2973 |
-
"description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
|
2974 |
-
"format": "int64",
|
2975 |
-
"location": "query"
|
2976 |
-
},
|
2977 |
-
"object": {
|
2978 |
-
"type": "string",
|
2979 |
-
"description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
|
2980 |
-
"required": true,
|
2981 |
-
"location": "path"
|
2982 |
-
},
|
2983 |
-
"userProject": {
|
2984 |
-
"type": "string",
|
2985 |
-
"description": "The project to be billed for this request. Required for Requester Pays buckets.",
|
2986 |
-
"location": "query"
|
2987 |
-
}
|
2988 |
-
},
|
2989 |
-
"parameterOrder": [
|
2990 |
-
"bucket",
|
2991 |
-
"object"
|
2992 |
-
],
|
2993 |
-
"response": {
|
2994 |
-
"$ref": "Policy"
|
2995 |
-
},
|
2996 |
-
"scopes": [
|
2997 |
-
"https://www.googleapis.com/auth/cloud-platform",
|
2998 |
-
"https://www.googleapis.com/auth/cloud-platform.read-only",
|
2999 |
-
"https://www.googleapis.com/auth/devstorage.full_control",
|
3000 |
-
"https://www.googleapis.com/auth/devstorage.read_only",
|
3001 |
-
"https://www.googleapis.com/auth/devstorage.read_write"
|
3002 |
-
]
|
3003 |
-
},
|
3004 |
-
"insert": {
|
3005 |
-
"id": "storage.objects.insert",
|
3006 |
-
"path": "b/{bucket}/o",
|
3007 |
-
"httpMethod": "POST",
|
3008 |
-
"description": "Stores a new object and metadata.",
|
3009 |
-
"parameters": {
|
3010 |
-
"bucket": {
|
3011 |
-
"type": "string",
|
3012 |
-
"description": "Name of the bucket in which to store the new object. Overrides the provided object metadata's bucket value, if any.",
|
3013 |
-
"required": true,
|
3014 |
-
"location": "path"
|
3015 |
-
},
|
3016 |
-
"contentEncoding": {
|
3017 |
-
"type": "string",
|
3018 |
-
"description": "If set, sets the contentEncoding property of the final object to this value. Setting this parameter is equivalent to setting the contentEncoding metadata property. This can be useful when uploading an object with uploadType=media to indicate the encoding of the content being uploaded.",
|
3019 |
-
"location": "query"
|
3020 |
-
},
|
3021 |
-
"ifGenerationMatch": {
|
3022 |
-
"type": "string",
|
3023 |
-
"description": "Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.",
|
3024 |
-
"format": "int64",
|
3025 |
-
"location": "query"
|
3026 |
-
},
|
3027 |
-
"ifGenerationNotMatch": {
|
3028 |
-
"type": "string",
|
3029 |
-
"description": "Makes the operation conditional on whether the object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.",
|
3030 |
-
"format": "int64",
|
3031 |
-
"location": "query"
|
3032 |
-
},
|
3033 |
-
"ifMetagenerationMatch": {
|
3034 |
-
"type": "string",
|
3035 |
-
"description": "Makes the operation conditional on whether the object's current metageneration matches the given value.",
|
3036 |
-
"format": "int64",
|
3037 |
-
"location": "query"
|
3038 |
-
},
|
3039 |
-
"ifMetagenerationNotMatch": {
|
3040 |
-
"type": "string",
|
3041 |
-
"description": "Makes the operation conditional on whether the object's current metageneration does not match the given value.",
|
3042 |
-
"format": "int64",
|
3043 |
-
"location": "query"
|
3044 |
-
},
|
3045 |
-
"kmsKeyName": {
|
3046 |
-
"type": "string",
|
3047 |
-
"description": "Resource name of the Cloud KMS key, of the form projects/my-project/locations/global/keyRings/my-kr/cryptoKeys/my-key, that will be used to encrypt the object. Overrides the object metadata's kms_key_name value, if any. Limited availability; usable only by enabled projects.",
|
3048 |
-
"location": "query"
|
3049 |
-
},
|
3050 |
-
"name": {
|
3051 |
-
"type": "string",
|
3052 |
-
"description": "Name of the object. Required when the object metadata is not otherwise provided. Overrides the object metadata's name value, if any. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
|
3053 |
-
"location": "query"
|
3054 |
-
},
|
3055 |
-
"predefinedAcl": {
|
3056 |
-
"type": "string",
|
3057 |
-
"description": "Apply a predefined set of access controls to this object.",
|
3058 |
-
"enum": [
|
3059 |
-
"authenticatedRead",
|
3060 |
-
"bucketOwnerFullControl",
|
3061 |
-
"bucketOwnerRead",
|
3062 |
-
"private",
|
3063 |
-
"projectPrivate",
|
3064 |
-
"publicRead"
|
3065 |
-
],
|
3066 |
-
"enumDescriptions": [
|
3067 |
-
"Object owner gets OWNER access, and allAuthenticatedUsers get READER access.",
|
3068 |
-
"Object owner gets OWNER access, and project team owners get OWNER access.",
|
3069 |
-
"Object owner gets OWNER access, and project team owners get READER access.",
|
3070 |
-
"Object owner gets OWNER access.",
|
3071 |
-
"Object owner gets OWNER access, and project team members get access according to their roles.",
|
3072 |
-
"Object owner gets OWNER access, and allUsers get READER access."
|
3073 |
-
],
|
3074 |
-
"location": "query"
|
3075 |
-
},
|
3076 |
-
"projection": {
|
3077 |
-
"type": "string",
|
3078 |
-
"description": "Set of properties to return. Defaults to noAcl, unless the object resource specifies the acl property, when it defaults to full.",
|
3079 |
-
"enum": [
|
3080 |
-
"full",
|
3081 |
-
"noAcl"
|
3082 |
-
],
|
3083 |
-
"enumDescriptions": [
|
3084 |
-
"Include all properties.",
|
3085 |
-
"Omit the owner, acl property."
|
3086 |
-
],
|
3087 |
-
"location": "query"
|
3088 |
-
},
|
3089 |
-
"userProject": {
|
3090 |
-
"type": "string",
|
3091 |
-
"description": "The project to be billed for this request. Required for Requester Pays buckets.",
|
3092 |
-
"location": "query"
|
3093 |
-
}
|
3094 |
-
},
|
3095 |
-
"parameterOrder": [
|
3096 |
-
"bucket"
|
3097 |
-
],
|
3098 |
-
"request": {
|
3099 |
-
"$ref": "Object"
|
3100 |
-
},
|
3101 |
-
"response": {
|
3102 |
-
"$ref": "Object"
|
3103 |
-
},
|
3104 |
-
"scopes": [
|
3105 |
-
"https://www.googleapis.com/auth/cloud-platform",
|
3106 |
-
"https://www.googleapis.com/auth/devstorage.full_control",
|
3107 |
-
"https://www.googleapis.com/auth/devstorage.read_write"
|
3108 |
-
],
|
3109 |
-
"supportsMediaUpload": true,
|
3110 |
-
"mediaUpload": {
|
3111 |
-
"accept": [
|
3112 |
-
"*/*"
|
3113 |
-
],
|
3114 |
-
"protocols": {
|
3115 |
-
"simple": {
|
3116 |
-
"multipart": true,
|
3117 |
-
"path": "/upload/storage/v1/b/{bucket}/o"
|
3118 |
-
},
|
3119 |
-
"resumable": {
|
3120 |
-
"multipart": true,
|
3121 |
-
"path": "/resumable/upload/storage/v1/b/{bucket}/o"
|
3122 |
-
}
|
3123 |
-
}
|
3124 |
-
}
|
3125 |
-
},
|
3126 |
-
"list": {
|
3127 |
-
"id": "storage.objects.list",
|
3128 |
-
"path": "b/{bucket}/o",
|
3129 |
-
"httpMethod": "GET",
|
3130 |
-
"description": "Retrieves a list of objects matching the criteria.",
|
3131 |
-
"parameters": {
|
3132 |
-
"bucket": {
|
3133 |
-
"type": "string",
|
3134 |
-
"description": "Name of the bucket in which to look for objects.",
|
3135 |
-
"required": true,
|
3136 |
-
"location": "path"
|
3137 |
-
},
|
3138 |
-
"delimiter": {
|
3139 |
-
"type": "string",
|
3140 |
-
"description": "Returns results in a directory-like mode. items will contain only objects whose names, aside from the prefix, do not contain delimiter. Objects whose names, aside from the prefix, contain delimiter will have their name, truncated after the delimiter, returned in prefixes. Duplicate prefixes are omitted.",
|
3141 |
-
"location": "query"
|
3142 |
-
},
|
3143 |
-
"maxResults": {
|
3144 |
-
"type": "integer",
|
3145 |
-
"description": "Maximum number of items plus prefixes to return in a single page of responses. As duplicate prefixes are omitted, fewer total results may be returned than requested. The service will use this parameter or 1,000 items, whichever is smaller.",
|
3146 |
-
"default": "1000",
|
3147 |
-
"format": "uint32",
|
3148 |
-
"minimum": "0",
|
3149 |
-
"location": "query"
|
3150 |
-
},
|
3151 |
-
"pageToken": {
|
3152 |
-
"type": "string",
|
3153 |
-
"description": "A previously-returned page token representing part of the larger set of results to view.",
|
3154 |
-
"location": "query"
|
3155 |
-
},
|
3156 |
-
"prefix": {
|
3157 |
-
"type": "string",
|
3158 |
-
"description": "Filter results to objects whose names begin with this prefix.",
|
3159 |
-
"location": "query"
|
3160 |
-
},
|
3161 |
-
"projection": {
|
3162 |
-
"type": "string",
|
3163 |
-
"description": "Set of properties to return. Defaults to noAcl.",
|
3164 |
-
"enum": [
|
3165 |
-
"full",
|
3166 |
-
"noAcl"
|
3167 |
-
],
|
3168 |
-
"enumDescriptions": [
|
3169 |
-
"Include all properties.",
|
3170 |
-
"Omit the owner, acl property."
|
3171 |
-
],
|
3172 |
-
"location": "query"
|
3173 |
-
},
|
3174 |
-
"userProject": {
|
3175 |
-
"type": "string",
|
3176 |
-
"description": "The project to be billed for this request. Required for Requester Pays buckets.",
|
3177 |
-
"location": "query"
|
3178 |
-
},
|
3179 |
-
"versions": {
|
3180 |
-
"type": "boolean",
|
3181 |
-
"description": "If true, lists all versions of an object as distinct results. The default is false. For more information, see Object Versioning.",
|
3182 |
-
"location": "query"
|
3183 |
-
}
|
3184 |
-
},
|
3185 |
-
"parameterOrder": [
|
3186 |
-
"bucket"
|
3187 |
-
],
|
3188 |
-
"response": {
|
3189 |
-
"$ref": "Objects"
|
3190 |
-
},
|
3191 |
-
"scopes": [
|
3192 |
-
"https://www.googleapis.com/auth/cloud-platform",
|
3193 |
-
"https://www.googleapis.com/auth/cloud-platform.read-only",
|
3194 |
-
"https://www.googleapis.com/auth/devstorage.full_control",
|
3195 |
-
"https://www.googleapis.com/auth/devstorage.read_only",
|
3196 |
-
"https://www.googleapis.com/auth/devstorage.read_write"
|
3197 |
-
],
|
3198 |
-
"supportsSubscription": true
|
3199 |
-
},
|
3200 |
-
"patch": {
|
3201 |
-
"id": "storage.objects.patch",
|
3202 |
-
"path": "b/{bucket}/o/{object}",
|
3203 |
-
"httpMethod": "PATCH",
|
3204 |
-
"description": "Patches an object's metadata.",
|
3205 |
-
"parameters": {
|
3206 |
-
"bucket": {
|
3207 |
-
"type": "string",
|
3208 |
-
"description": "Name of the bucket in which the object resides.",
|
3209 |
-
"required": true,
|
3210 |
-
"location": "path"
|
3211 |
-
},
|
3212 |
-
"generation": {
|
3213 |
-
"type": "string",
|
3214 |
-
"description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
|
3215 |
-
"format": "int64",
|
3216 |
-
"location": "query"
|
3217 |
-
},
|
3218 |
-
"ifGenerationMatch": {
|
3219 |
-
"type": "string",
|
3220 |
-
"description": "Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.",
|
3221 |
-
"format": "int64",
|
3222 |
-
"location": "query"
|
3223 |
-
},
|
3224 |
-
"ifGenerationNotMatch": {
|
3225 |
-
"type": "string",
|
3226 |
-
"description": "Makes the operation conditional on whether the object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.",
|
3227 |
-
"format": "int64",
|
3228 |
-
"location": "query"
|
3229 |
-
},
|
3230 |
-
"ifMetagenerationMatch": {
|
3231 |
-
"type": "string",
|
3232 |
-
"description": "Makes the operation conditional on whether the object's current metageneration matches the given value.",
|
3233 |
-
"format": "int64",
|
3234 |
-
"location": "query"
|
3235 |
-
},
|
3236 |
-
"ifMetagenerationNotMatch": {
|
3237 |
-
"type": "string",
|
3238 |
-
"description": "Makes the operation conditional on whether the object's current metageneration does not match the given value.",
|
3239 |
-
"format": "int64",
|
3240 |
-
"location": "query"
|
3241 |
-
},
|
3242 |
-
"object": {
|
3243 |
-
"type": "string",
|
3244 |
-
"description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
|
3245 |
-
"required": true,
|
3246 |
-
"location": "path"
|
3247 |
-
},
|
3248 |
-
"predefinedAcl": {
|
3249 |
-
"type": "string",
|
3250 |
-
"description": "Apply a predefined set of access controls to this object.",
|
3251 |
-
"enum": [
|
3252 |
-
"authenticatedRead",
|
3253 |
-
"bucketOwnerFullControl",
|
3254 |
-
"bucketOwnerRead",
|
3255 |
-
"private",
|
3256 |
-
"projectPrivate",
|
3257 |
-
"publicRead"
|
3258 |
-
],
|
3259 |
-
"enumDescriptions": [
|
3260 |
-
"Object owner gets OWNER access, and allAuthenticatedUsers get READER access.",
|
3261 |
-
"Object owner gets OWNER access, and project team owners get OWNER access.",
|
3262 |
-
"Object owner gets OWNER access, and project team owners get READER access.",
|
3263 |
-
"Object owner gets OWNER access.",
|
3264 |
-
"Object owner gets OWNER access, and project team members get access according to their roles.",
|
3265 |
-
"Object owner gets OWNER access, and allUsers get READER access."
|
3266 |
-
],
|
3267 |
-
"location": "query"
|
3268 |
-
},
|
3269 |
-
"projection": {
|
3270 |
-
"type": "string",
|
3271 |
-
"description": "Set of properties to return. Defaults to full.",
|
3272 |
-
"enum": [
|
3273 |
-
"full",
|
3274 |
-
"noAcl"
|
3275 |
-
],
|
3276 |
-
"enumDescriptions": [
|
3277 |
-
"Include all properties.",
|
3278 |
-
"Omit the owner, acl property."
|
3279 |
-
],
|
3280 |
-
"location": "query"
|
3281 |
-
},
|
3282 |
-
"userProject": {
|
3283 |
-
"type": "string",
|
3284 |
-
"description": "The project to be billed for this request, for Requester Pays buckets.",
|
3285 |
-
"location": "query"
|
3286 |
-
}
|
3287 |
-
},
|
3288 |
-
"parameterOrder": [
|
3289 |
-
"bucket",
|
3290 |
-
"object"
|
3291 |
-
],
|
3292 |
-
"request": {
|
3293 |
-
"$ref": "Object"
|
3294 |
-
},
|
3295 |
-
"response": {
|
3296 |
-
"$ref": "Object"
|
3297 |
-
},
|
3298 |
-
"scopes": [
|
3299 |
-
"https://www.googleapis.com/auth/cloud-platform",
|
3300 |
-
"https://www.googleapis.com/auth/devstorage.full_control"
|
3301 |
-
]
|
3302 |
-
},
|
3303 |
-
"rewrite": {
|
3304 |
-
"id": "storage.objects.rewrite",
|
3305 |
-
"path": "b/{sourceBucket}/o/{sourceObject}/rewriteTo/b/{destinationBucket}/o/{destinationObject}",
|
3306 |
-
"httpMethod": "POST",
|
3307 |
-
"description": "Rewrites a source object to a destination object. Optionally overrides metadata.",
|
3308 |
-
"parameters": {
|
3309 |
-
"destinationBucket": {
|
3310 |
-
"type": "string",
|
3311 |
-
"description": "Name of the bucket in which to store the new object. Overrides the provided object metadata's bucket value, if any.",
|
3312 |
-
"required": true,
|
3313 |
-
"location": "path"
|
3314 |
-
},
|
3315 |
-
"destinationKmsKeyName": {
|
3316 |
-
"type": "string",
|
3317 |
-
"description": "Resource name of the Cloud KMS key, of the form projects/my-project/locations/global/keyRings/my-kr/cryptoKeys/my-key, that will be used to encrypt the object. Overrides the object metadata's kms_key_name value, if any.",
|
3318 |
-
"location": "query"
|
3319 |
-
},
|
3320 |
-
"destinationObject": {
|
3321 |
-
"type": "string",
|
3322 |
-
"description": "Name of the new object. Required when the object metadata is not otherwise provided. Overrides the object metadata's name value, if any. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
|
3323 |
-
"required": true,
|
3324 |
-
"location": "path"
|
3325 |
-
},
|
3326 |
-
"destinationPredefinedAcl": {
|
3327 |
-
"type": "string",
|
3328 |
-
"description": "Apply a predefined set of access controls to the destination object.",
|
3329 |
-
"enum": [
|
3330 |
-
"authenticatedRead",
|
3331 |
-
"bucketOwnerFullControl",
|
3332 |
-
"bucketOwnerRead",
|
3333 |
-
"private",
|
3334 |
-
"projectPrivate",
|
3335 |
-
"publicRead"
|
3336 |
-
],
|
3337 |
-
"enumDescriptions": [
|
3338 |
-
"Object owner gets OWNER access, and allAuthenticatedUsers get READER access.",
|
3339 |
-
"Object owner gets OWNER access, and project team owners get OWNER access.",
|
3340 |
-
"Object owner gets OWNER access, and project team owners get READER access.",
|
3341 |
-
"Object owner gets OWNER access.",
|
3342 |
-
"Object owner gets OWNER access, and project team members get access according to their roles.",
|
3343 |
-
"Object owner gets OWNER access, and allUsers get READER access."
|
3344 |
-
],
|
3345 |
-
"location": "query"
|
3346 |
-
},
|
3347 |
-
"ifGenerationMatch": {
|
3348 |
-
"type": "string",
|
3349 |
-
"description": "Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.",
|
3350 |
-
"format": "int64",
|
3351 |
-
"location": "query"
|
3352 |
-
},
|
3353 |
-
"ifGenerationNotMatch": {
|
3354 |
-
"type": "string",
|
3355 |
-
"description": "Makes the operation conditional on whether the object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.",
|
3356 |
-
"format": "int64",
|
3357 |
-
"location": "query"
|
3358 |
-
},
|
3359 |
-
"ifMetagenerationMatch": {
|
3360 |
-
"type": "string",
|
3361 |
-
"description": "Makes the operation conditional on whether the destination object's current metageneration matches the given value.",
|
3362 |
-
"format": "int64",
|
3363 |
-
"location": "query"
|
3364 |
-
},
|
3365 |
-
"ifMetagenerationNotMatch": {
|
3366 |
-
"type": "string",
|
3367 |
-
"description": "Makes the operation conditional on whether the destination object's current metageneration does not match the given value.",
|
3368 |
-
"format": "int64",
|
3369 |
-
"location": "query"
|
3370 |
-
},
|
3371 |
-
"ifSourceGenerationMatch": {
|
3372 |
-
"type": "string",
|
3373 |
-
"description": "Makes the operation conditional on whether the source object's current generation matches the given value.",
|
3374 |
-
"format": "int64",
|
3375 |
-
"location": "query"
|
3376 |
-
},
|
3377 |
-
"ifSourceGenerationNotMatch": {
|
3378 |
-
"type": "string",
|
3379 |
-
"description": "Makes the operation conditional on whether the source object's current generation does not match the given value.",
|
3380 |
-
"format": "int64",
|
3381 |
-
"location": "query"
|
3382 |
-
},
|
3383 |
-
"ifSourceMetagenerationMatch": {
|
3384 |
-
"type": "string",
|
3385 |
-
"description": "Makes the operation conditional on whether the source object's current metageneration matches the given value.",
|
3386 |
-
"format": "int64",
|
3387 |
-
"location": "query"
|
3388 |
-
},
|
3389 |
-
"ifSourceMetagenerationNotMatch": {
|
3390 |
-
"type": "string",
|
3391 |
-
"description": "Makes the operation conditional on whether the source object's current metageneration does not match the given value.",
|
3392 |
-
"format": "int64",
|
3393 |
-
"location": "query"
|
3394 |
-
},
|
3395 |
-
"maxBytesRewrittenPerCall": {
|
3396 |
-
"type": "string",
|
3397 |
-
"description": "The maximum number of bytes that will be rewritten per rewrite request. Most callers shouldn't need to specify this parameter - it is primarily in place to support testing. If specified the value must be an integral multiple of 1 MiB (1048576). Also, this only applies to requests where the source and destination span locations and/or storage classes. Finally, this value must not change across rewrite calls else you'll get an error that the rewriteToken is invalid.",
|
3398 |
-
"format": "int64",
|
3399 |
-
"location": "query"
|
3400 |
-
},
|
3401 |
-
"projection": {
|
3402 |
-
"type": "string",
|
3403 |
-
"description": "Set of properties to return. Defaults to noAcl, unless the object resource specifies the acl property, when it defaults to full.",
|
3404 |
-
"enum": [
|
3405 |
-
"full",
|
3406 |
-
"noAcl"
|
3407 |
-
],
|
3408 |
-
"enumDescriptions": [
|
3409 |
-
"Include all properties.",
|
3410 |
-
"Omit the owner, acl property."
|
3411 |
-
],
|
3412 |
-
"location": "query"
|
3413 |
-
},
|
3414 |
-
"rewriteToken": {
|
3415 |
-
"type": "string",
|
3416 |
-
"description": "Include this field (from the previous rewrite response) on each rewrite request after the first one, until the rewrite response 'done' flag is true. Calls that provide a rewriteToken can omit all other request fields, but if included those fields must match the values provided in the first rewrite request.",
|
3417 |
-
"location": "query"
|
3418 |
-
},
|
3419 |
-
"sourceBucket": {
|
3420 |
-
"type": "string",
|
3421 |
-
"description": "Name of the bucket in which to find the source object.",
|
3422 |
-
"required": true,
|
3423 |
-
"location": "path"
|
3424 |
-
},
|
3425 |
-
"sourceGeneration": {
|
3426 |
-
"type": "string",
|
3427 |
-
"description": "If present, selects a specific revision of the source object (as opposed to the latest version, the default).",
|
3428 |
-
"format": "int64",
|
3429 |
-
"location": "query"
|
3430 |
-
},
|
3431 |
-
"sourceObject": {
|
3432 |
-
"type": "string",
|
3433 |
-
"description": "Name of the source object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
|
3434 |
-
"required": true,
|
3435 |
-
"location": "path"
|
3436 |
-
},
|
3437 |
-
"userProject": {
|
3438 |
-
"type": "string",
|
3439 |
-
"description": "The project to be billed for this request. Required for Requester Pays buckets.",
|
3440 |
-
"location": "query"
|
3441 |
-
}
|
3442 |
-
},
|
3443 |
-
"parameterOrder": [
|
3444 |
-
"sourceBucket",
|
3445 |
-
"sourceObject",
|
3446 |
-
"destinationBucket",
|
3447 |
-
"destinationObject"
|
3448 |
-
],
|
3449 |
-
"request": {
|
3450 |
-
"$ref": "Object"
|
3451 |
-
},
|
3452 |
-
"response": {
|
3453 |
-
"$ref": "RewriteResponse"
|
3454 |
-
},
|
3455 |
-
"scopes": [
|
3456 |
-
"https://www.googleapis.com/auth/cloud-platform",
|
3457 |
-
"https://www.googleapis.com/auth/devstorage.full_control",
|
3458 |
-
"https://www.googleapis.com/auth/devstorage.read_write"
|
3459 |
-
]
|
3460 |
-
},
|
3461 |
-
"setIamPolicy": {
|
3462 |
-
"id": "storage.objects.setIamPolicy",
|
3463 |
-
"path": "b/{bucket}/o/{object}/iam",
|
3464 |
-
"httpMethod": "PUT",
|
3465 |
-
"description": "Updates an IAM policy for the specified object.",
|
3466 |
-
"parameters": {
|
3467 |
-
"bucket": {
|
3468 |
-
"type": "string",
|
3469 |
-
"description": "Name of the bucket in which the object resides.",
|
3470 |
-
"required": true,
|
3471 |
-
"location": "path"
|
3472 |
-
},
|
3473 |
-
"generation": {
|
3474 |
-
"type": "string",
|
3475 |
-
"description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
|
3476 |
-
"format": "int64",
|
3477 |
-
"location": "query"
|
3478 |
-
},
|
3479 |
-
"object": {
|
3480 |
-
"type": "string",
|
3481 |
-
"description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
|
3482 |
-
"required": true,
|
3483 |
-
"location": "path"
|
3484 |
-
},
|
3485 |
-
"userProject": {
|
3486 |
-
"type": "string",
|
3487 |
-
"description": "The project to be billed for this request. Required for Requester Pays buckets.",
|
3488 |
-
"location": "query"
|
3489 |
-
}
|
3490 |
-
},
|
3491 |
-
"parameterOrder": [
|
3492 |
-
"bucket",
|
3493 |
-
"object"
|
3494 |
-
],
|
3495 |
-
"request": {
|
3496 |
-
"$ref": "Policy"
|
3497 |
-
},
|
3498 |
-
"response": {
|
3499 |
-
"$ref": "Policy"
|
3500 |
-
},
|
3501 |
-
"scopes": [
|
3502 |
-
"https://www.googleapis.com/auth/cloud-platform",
|
3503 |
-
"https://www.googleapis.com/auth/devstorage.full_control",
|
3504 |
-
"https://www.googleapis.com/auth/devstorage.read_write"
|
3505 |
-
]
|
3506 |
-
},
|
3507 |
-
"testIamPermissions": {
|
3508 |
-
"id": "storage.objects.testIamPermissions",
|
3509 |
-
"path": "b/{bucket}/o/{object}/iam/testPermissions",
|
3510 |
-
"httpMethod": "GET",
|
3511 |
-
"description": "Tests a set of permissions on the given object to see which, if any, are held by the caller.",
|
3512 |
-
"parameters": {
|
3513 |
-
"bucket": {
|
3514 |
-
"type": "string",
|
3515 |
-
"description": "Name of the bucket in which the object resides.",
|
3516 |
-
"required": true,
|
3517 |
-
"location": "path"
|
3518 |
-
},
|
3519 |
-
"generation": {
|
3520 |
-
"type": "string",
|
3521 |
-
"description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
|
3522 |
-
"format": "int64",
|
3523 |
-
"location": "query"
|
3524 |
-
},
|
3525 |
-
"object": {
|
3526 |
-
"type": "string",
|
3527 |
-
"description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
|
3528 |
-
"required": true,
|
3529 |
-
"location": "path"
|
3530 |
-
},
|
3531 |
-
"permissions": {
|
3532 |
-
"type": "string",
|
3533 |
-
"description": "Permissions to test.",
|
3534 |
-
"required": true,
|
3535 |
-
"repeated": true,
|
3536 |
-
"location": "query"
|
3537 |
-
},
|
3538 |
-
"userProject": {
|
3539 |
-
"type": "string",
|
3540 |
-
"description": "The project to be billed for this request. Required for Requester Pays buckets.",
|
3541 |
-
"location": "query"
|
3542 |
-
}
|
3543 |
-
},
|
3544 |
-
"parameterOrder": [
|
3545 |
-
"bucket",
|
3546 |
-
"object",
|
3547 |
-
"permissions"
|
3548 |
-
],
|
3549 |
-
"response": {
|
3550 |
-
"$ref": "TestIamPermissionsResponse"
|
3551 |
-
},
|
3552 |
-
"scopes": [
|
3553 |
-
"https://www.googleapis.com/auth/cloud-platform",
|
3554 |
-
"https://www.googleapis.com/auth/cloud-platform.read-only",
|
3555 |
-
"https://www.googleapis.com/auth/devstorage.full_control",
|
3556 |
-
"https://www.googleapis.com/auth/devstorage.read_only",
|
3557 |
-
"https://www.googleapis.com/auth/devstorage.read_write"
|
3558 |
-
]
|
3559 |
-
},
|
3560 |
-
"update": {
|
3561 |
-
"id": "storage.objects.update",
|
3562 |
-
"path": "b/{bucket}/o/{object}",
|
3563 |
-
"httpMethod": "PUT",
|
3564 |
-
"description": "Updates an object's metadata.",
|
3565 |
-
"parameters": {
|
3566 |
-
"bucket": {
|
3567 |
-
"type": "string",
|
3568 |
-
"description": "Name of the bucket in which the object resides.",
|
3569 |
-
"required": true,
|
3570 |
-
"location": "path"
|
3571 |
-
},
|
3572 |
-
"generation": {
|
3573 |
-
"type": "string",
|
3574 |
-
"description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
|
3575 |
-
"format": "int64",
|
3576 |
-
"location": "query"
|
3577 |
-
},
|
3578 |
-
"ifGenerationMatch": {
|
3579 |
-
"type": "string",
|
3580 |
-
"description": "Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.",
|
3581 |
-
"format": "int64",
|
3582 |
-
"location": "query"
|
3583 |
-
},
|
3584 |
-
"ifGenerationNotMatch": {
|
3585 |
-
"type": "string",
|
3586 |
-
"description": "Makes the operation conditional on whether the object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.",
|
3587 |
-
"format": "int64",
|
3588 |
-
"location": "query"
|
3589 |
-
},
|
3590 |
-
"ifMetagenerationMatch": {
|
3591 |
-
"type": "string",
|
3592 |
-
"description": "Makes the operation conditional on whether the object's current metageneration matches the given value.",
|
3593 |
-
"format": "int64",
|
3594 |
-
"location": "query"
|
3595 |
-
},
|
3596 |
-
"ifMetagenerationNotMatch": {
|
3597 |
-
"type": "string",
|
3598 |
-
"description": "Makes the operation conditional on whether the object's current metageneration does not match the given value.",
|
3599 |
-
"format": "int64",
|
3600 |
-
"location": "query"
|
3601 |
-
},
|
3602 |
-
"object": {
|
3603 |
-
"type": "string",
|
3604 |
-
"description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
|
3605 |
-
"required": true,
|
3606 |
-
"location": "path"
|
3607 |
-
},
|
3608 |
-
"predefinedAcl": {
|
3609 |
-
"type": "string",
|
3610 |
-
"description": "Apply a predefined set of access controls to this object.",
|
3611 |
-
"enum": [
|
3612 |
-
"authenticatedRead",
|
3613 |
-
"bucketOwnerFullControl",
|
3614 |
-
"bucketOwnerRead",
|
3615 |
-
"private",
|
3616 |
-
"projectPrivate",
|
3617 |
-
"publicRead"
|
3618 |
-
],
|
3619 |
-
"enumDescriptions": [
|
3620 |
-
"Object owner gets OWNER access, and allAuthenticatedUsers get READER access.",
|
3621 |
-
"Object owner gets OWNER access, and project team owners get OWNER access.",
|
3622 |
-
"Object owner gets OWNER access, and project team owners get READER access.",
|
3623 |
-
"Object owner gets OWNER access.",
|
3624 |
-
"Object owner gets OWNER access, and project team members get access according to their roles.",
|
3625 |
-
"Object owner gets OWNER access, and allUsers get READER access."
|
3626 |
-
],
|
3627 |
-
"location": "query"
|
3628 |
-
},
|
3629 |
-
"projection": {
|
3630 |
-
"type": "string",
|
3631 |
-
"description": "Set of properties to return. Defaults to full.",
|
3632 |
-
"enum": [
|
3633 |
-
"full",
|
3634 |
-
"noAcl"
|
3635 |
-
],
|
3636 |
-
"enumDescriptions": [
|
3637 |
-
"Include all properties.",
|
3638 |
-
"Omit the owner, acl property."
|
3639 |
-
],
|
3640 |
-
"location": "query"
|
3641 |
-
},
|
3642 |
-
"userProject": {
|
3643 |
-
"type": "string",
|
3644 |
-
"description": "The project to be billed for this request. Required for Requester Pays buckets.",
|
3645 |
-
"location": "query"
|
3646 |
-
}
|
3647 |
-
},
|
3648 |
-
"parameterOrder": [
|
3649 |
-
"bucket",
|
3650 |
-
"object"
|
3651 |
-
],
|
3652 |
-
"request": {
|
3653 |
-
"$ref": "Object"
|
3654 |
-
},
|
3655 |
-
"response": {
|
3656 |
-
"$ref": "Object"
|
3657 |
-
},
|
3658 |
-
"scopes": [
|
3659 |
-
"https://www.googleapis.com/auth/cloud-platform",
|
3660 |
-
"https://www.googleapis.com/auth/devstorage.full_control"
|
3661 |
-
]
|
3662 |
-
},
|
3663 |
-
"watchAll": {
|
3664 |
-
"id": "storage.objects.watchAll",
|
3665 |
-
"path": "b/{bucket}/o/watch",
|
3666 |
-
"httpMethod": "POST",
|
3667 |
-
"description": "Watch for changes on all objects in a bucket.",
|
3668 |
-
"parameters": {
|
3669 |
-
"bucket": {
|
3670 |
-
"type": "string",
|
3671 |
-
"description": "Name of the bucket in which to look for objects.",
|
3672 |
-
"required": true,
|
3673 |
-
"location": "path"
|
3674 |
-
},
|
3675 |
-
"delimiter": {
|
3676 |
-
"type": "string",
|
3677 |
-
"description": "Returns results in a directory-like mode. items will contain only objects whose names, aside from the prefix, do not contain delimiter. Objects whose names, aside from the prefix, contain delimiter will have their name, truncated after the delimiter, returned in prefixes. Duplicate prefixes are omitted.",
|
3678 |
-
"location": "query"
|
3679 |
-
},
|
3680 |
-
"maxResults": {
|
3681 |
-
"type": "integer",
|
3682 |
-
"description": "Maximum number of items plus prefixes to return in a single page of responses. As duplicate prefixes are omitted, fewer total results may be returned than requested. The service will use this parameter or 1,000 items, whichever is smaller.",
|
3683 |
-
"default": "1000",
|
3684 |
-
"format": "uint32",
|
3685 |
-
"minimum": "0",
|
3686 |
-
"location": "query"
|
3687 |
-
},
|
3688 |
-
"pageToken": {
|
3689 |
-
"type": "string",
|
3690 |
-
"description": "A previously-returned page token representing part of the larger set of results to view.",
|
3691 |
-
"location": "query"
|
3692 |
-
},
|
3693 |
-
"prefix": {
|
3694 |
-
"type": "string",
|
3695 |
-
"description": "Filter results to objects whose names begin with this prefix.",
|
3696 |
-
"location": "query"
|
3697 |
-
},
|
3698 |
-
"projection": {
|
3699 |
-
"type": "string",
|
3700 |
-
"description": "Set of properties to return. Defaults to noAcl.",
|
3701 |
-
"enum": [
|
3702 |
-
"full",
|
3703 |
-
"noAcl"
|
3704 |
-
],
|
3705 |
-
"enumDescriptions": [
|
3706 |
-
"Include all properties.",
|
3707 |
-
"Omit the owner, acl property."
|
3708 |
-
],
|
3709 |
-
"location": "query"
|
3710 |
-
},
|
3711 |
-
"userProject": {
|
3712 |
-
"type": "string",
|
3713 |
-
"description": "The project to be billed for this request. Required for Requester Pays buckets.",
|
3714 |
-
"location": "query"
|
3715 |
-
},
|
3716 |
-
"versions": {
|
3717 |
-
"type": "boolean",
|
3718 |
-
"description": "If true, lists all versions of an object as distinct results. The default is false. For more information, see Object Versioning.",
|
3719 |
-
"location": "query"
|
3720 |
-
}
|
3721 |
-
},
|
3722 |
-
"parameterOrder": [
|
3723 |
-
"bucket"
|
3724 |
-
],
|
3725 |
-
"request": {
|
3726 |
-
"$ref": "Channel",
|
3727 |
-
"parameterName": "resource"
|
3728 |
-
},
|
3729 |
-
"response": {
|
3730 |
-
"$ref": "Channel"
|
3731 |
-
},
|
3732 |
-
"scopes": [
|
3733 |
-
"https://www.googleapis.com/auth/cloud-platform",
|
3734 |
-
"https://www.googleapis.com/auth/cloud-platform.read-only",
|
3735 |
-
"https://www.googleapis.com/auth/devstorage.full_control",
|
3736 |
-
"https://www.googleapis.com/auth/devstorage.read_only",
|
3737 |
-
"https://www.googleapis.com/auth/devstorage.read_write"
|
3738 |
-
],
|
3739 |
-
"supportsSubscription": true
|
3740 |
-
}
|
3741 |
-
}
|
3742 |
-
},
|
3743 |
-
"projects": {
|
3744 |
-
"resources": {
|
3745 |
-
"serviceAccount": {
|
3746 |
-
"methods": {
|
3747 |
-
"get": {
|
3748 |
-
"id": "storage.projects.serviceAccount.get",
|
3749 |
-
"path": "projects/{projectId}/serviceAccount",
|
3750 |
-
"httpMethod": "GET",
|
3751 |
-
"description": "Get the email address of this project's Google Cloud Storage service account.",
|
3752 |
-
"parameters": {
|
3753 |
-
"projectId": {
|
3754 |
-
"type": "string",
|
3755 |
-
"description": "Project ID",
|
3756 |
-
"required": true,
|
3757 |
-
"location": "path"
|
3758 |
-
},
|
3759 |
-
"userProject": {
|
3760 |
-
"type": "string",
|
3761 |
-
"description": "The project to be billed for this request.",
|
3762 |
-
"location": "query"
|
3763 |
-
}
|
3764 |
-
},
|
3765 |
-
"parameterOrder": [
|
3766 |
-
"projectId"
|
3767 |
-
],
|
3768 |
-
"response": {
|
3769 |
-
"$ref": "ServiceAccount"
|
3770 |
-
},
|
3771 |
-
"scopes": [
|
3772 |
-
"https://www.googleapis.com/auth/cloud-platform",
|
3773 |
-
"https://www.googleapis.com/auth/cloud-platform.read-only",
|
3774 |
-
"https://www.googleapis.com/auth/devstorage.full_control",
|
3775 |
-
"https://www.googleapis.com/auth/devstorage.read_only",
|
3776 |
-
"https://www.googleapis.com/auth/devstorage.read_write"
|
3777 |
-
]
|
3778 |
-
}
|
3779 |
-
}
|
3780 |
-
}
|
3781 |
}
|
|
|
3782 |
}
|
|
|
3783 |
}
|
3784 |
-
}
|
1 |
{
|
2 |
"kind": "discovery#restDescription",
|
3 |
+
"etag": "\"F5McR9eEaw0XRpaO3M9gbIugkbs/bQWWH-5yykbmINHZHPMOypW2I3M\"",
|
4 |
"discoveryVersion": "v1",
|
5 |
"id": "storage:v1",
|
6 |
"name": "storage",
|
7 |
"version": "v1",
|
8 |
+
"revision": "20191011",
|
9 |
"title": "Cloud Storage JSON API",
|
10 |
"description": "Stores and retrieves potentially large, immutable data objects.",
|
11 |
"ownerDomain": "google.com",
|
12 |
"ownerName": "Google",
|
13 |
"icons": {
|
14 |
+
"x16": "https://www.google.com/images/icons/product/cloud_storage-16.png",
|
15 |
+
"x32": "https://www.google.com/images/icons/product/cloud_storage-32.png"
|
16 |
},
|
17 |
"documentationLink": "https://developers.google.com/storage/docs/json_api/",
|
18 |
"labels": [
|
19 |
+
"labs"
|
20 |
],
|
21 |
"protocol": "rest",
|
22 |
"baseUrl": "https://www.googleapis.com/storage/v1/",
|
25 |
"servicePath": "storage/v1/",
|
26 |
"batchPath": "batch/storage/v1",
|
27 |
"parameters": {
|
28 |
+
"alt": {
|
29 |
+
"type": "string",
|
30 |
+
"description": "Data format for the response.",
|
31 |
+
"default": "json",
|
32 |
+
"enum": [
|
33 |
+
"json"
|
34 |
+
],
|
35 |
+
"enumDescriptions": [
|
36 |
+
"Responses with Content-Type of application/json"
|
37 |
+
],
|
38 |
+
"location": "query"
|
39 |
+
},
|
40 |
+
"fields": {
|
41 |
+
"type": "string",
|
42 |
+
"description": "Selector specifying which fields to include in a partial response.",
|
43 |
+
"location": "query"
|
44 |
+
},
|
45 |
+
"key": {
|
46 |
+
"type": "string",
|
47 |
+
"description": "API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.",
|
48 |
+
"location": "query"
|
49 |
+
},
|
50 |
+
"oauth_token": {
|
51 |
+
"type": "string",
|
52 |
+
"description": "OAuth 2.0 token for the current user.",
|
53 |
+
"location": "query"
|
54 |
+
},
|
55 |
+
"prettyPrint": {
|
56 |
+
"type": "boolean",
|
57 |
+
"description": "Returns response with indentations and line breaks.",
|
58 |
+
"default": "true",
|
59 |
+
"location": "query"
|
60 |
+
},
|
61 |
+
"quotaUser": {
|
62 |
+
"type": "string",
|
63 |
+
"description": "An opaque string that represents a user for quota purposes. Must not exceed 40 characters.",
|
64 |
+
"location": "query"
|
65 |
+
},
|
66 |
+
"userIp": {
|
67 |
+
"type": "string",
|
68 |
+
"description": "Deprecated. Please use quotaUser instead.",
|
69 |
+
"location": "query"
|
70 |
+
}
|
71 |
},
|
72 |
"auth": {
|
73 |
+
"oauth2": {
|
74 |
+
"scopes": {
|
75 |
+
"https://www.googleapis.com/auth/cloud-platform": {
|
76 |
+
"description": "View and manage your data across Google Cloud Platform services"
|
77 |
+
},
|
78 |
+
"https://www.googleapis.com/auth/cloud-platform.read-only": {
|
79 |
+
"description": "View your data across Google Cloud Platform services"
|
80 |
+
},
|
81 |
+
"https://www.googleapis.com/auth/devstorage.full_control": {
|
82 |
+
"description": "Manage your data and permissions in Google Cloud Storage"
|
83 |
+
},
|
84 |
+
"https://www.googleapis.com/auth/devstorage.read_only": {
|
85 |
+
"description": "View your data in Google Cloud Storage"
|
86 |
+
},
|
87 |
+
"https://www.googleapis.com/auth/devstorage.read_write": {
|
88 |
+
"description": "Manage your data in Google Cloud Storage"
|
89 |
+
}
|
|
|
90 |
}
|
91 |
+
}
|
92 |
},
|
93 |
"schemas": {
|
94 |
+
"Bucket": {
|
95 |
+
"id": "Bucket",
|
96 |
+
"type": "object",
|
97 |
+
"description": "A bucket.",
|
98 |
+
"properties": {
|
99 |
+
"acl": {
|
100 |
+
"type": "array",
|
101 |
+
"description": "Access controls on the bucket.",
|
102 |
+
"items": {
|
103 |
+
"$ref": "BucketAccessControl"
|
104 |
+
},
|
105 |
+
"annotations": {
|
106 |
+
"required": [
|
107 |
+
"storage.buckets.update"
|
108 |
+
]
|
109 |
+
}
|
110 |
+
},
|
111 |
+
"billing": {
|
112 |
"type": "object",
|
113 |
+
"description": "The bucket's billing configuration.",
|
114 |
"properties": {
|
115 |
+
"requesterPays": {
|
116 |
+
"type": "boolean",
|
117 |
+
"description": "When set to true, Requester Pays is enabled for this bucket."
|
118 |
+
}
|
119 |
+
}
|
120 |
+
},
|
121 |
+
"cors": {
|
122 |
+
"type": "array",
|
123 |
+
"description": "The bucket's Cross-Origin Resource Sharing (CORS) configuration.",
|
124 |
+
"items": {
|
125 |
+
"type": "object",
|
126 |
+
"properties": {
|
127 |
+
"maxAgeSeconds": {
|
128 |
+
"type": "integer",
|
129 |
+
"description": "The value, in seconds, to return in the Access-Control-Max-Age header used in preflight responses.",
|
130 |
+
"format": "int32"
|
131 |
+
},
|
132 |
+
"method": {
|
133 |
+
"type": "array",
|
134 |
+
"description": "The list of HTTP methods on which to include CORS response headers, (GET, OPTIONS, POST, etc) Note: \"*\" is permitted in the list of methods, and means \"any method\".",
|
135 |
+
"items": {
|
136 |
+
"type": "string"
|
137 |
+
}
|
138 |
+
},
|
139 |
+
"origin": {
|
140 |
+
"type": "array",
|
141 |
+
"description": "The list of Origins eligible to receive CORS response headers. Note: \"*\" is permitted in the list of origins, and means \"any Origin\".",
|
142 |
+
"items": {
|
143 |
+
"type": "string"
|
144 |
+
}
|
145 |
+
},
|
146 |
+
"responseHeader": {
|
147 |
+
"type": "array",
|
148 |
+
"description": "The list of HTTP headers other than the simple response headers to give permission for the user-agent to share across domains.",
|
149 |
+
"items": {
|
150 |
+
"type": "string"
|
151 |
+
}
|
152 |
+
}
|
153 |
+
}
|
154 |
+
}
|
155 |
+
},
|
156 |
+
"defaultEventBasedHold": {
|
157 |
+
"type": "boolean",
|
158 |
+
"description": "The default value for event-based hold on newly created objects in this bucket. Event-based hold is a way to retain objects indefinitely until an event occurs, signified by the hold's release. After being released, such objects will be subject to bucket-level retention (if any). One sample use case of this flag is for banks to hold loan documents for at least 3 years after loan is paid in full. Here, bucket-level retention is 3 years and the event is loan being paid in full. In this example, these objects will be held intact for any number of years until the event has occurred (event-based hold on the object is released) and then 3 more years after that. That means retention duration of the objects begins from the moment event-based hold transitioned from true to false. Objects under event-based hold cannot be deleted, overwritten or archived until the hold is removed."
|
159 |
+
},
|
160 |
+
"defaultObjectAcl": {
|
161 |
+
"type": "array",
|
162 |
+
"description": "Default access controls to apply to new objects when no ACL is provided.",
|
163 |
+
"items": {
|
164 |
+
"$ref": "ObjectAccessControl"
|
165 |
+
}
|
166 |
+
},
|
167 |
+
"encryption": {
|
168 |
+
"type": "object",
|
169 |
+
"description": "Encryption configuration for a bucket.",
|
170 |
+
"properties": {
|
171 |
+
"defaultKmsKeyName": {
|
172 |
+
"type": "string",
|
173 |
+
"description": "A Cloud KMS key that will be used to encrypt objects inserted into this bucket, if no encryption method is specified."
|
174 |
+
}
|
175 |
+
}
|
176 |
+
},
|
177 |
+
"etag": {
|
178 |
+
"type": "string",
|
179 |
+
"description": "HTTP 1.1 Entity tag for the bucket."
|
180 |
+
},
|
181 |
+
"iamConfiguration": {
|
182 |
+
"type": "object",
|
183 |
+
"description": "The bucket's IAM configuration.",
|
184 |
+
"properties": {
|
185 |
+
"bucketPolicyOnly": {
|
186 |
+
"type": "object",
|
187 |
+
"description": "The bucket's Bucket Policy Only configuration.",
|
188 |
+
"properties": {
|
189 |
+
"enabled": {
|
190 |
"type": "boolean",
|
191 |
+
"description": "If set, access is controlled only by bucket-level or above IAM policies."
|
192 |
+
},
|
193 |
+
"lockedTime": {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
194 |
"type": "string",
|
195 |
+
"description": "The deadline for changing iamConfiguration.bucketPolicyOnly.enabled from true to false in RFC 3339 format. iamConfiguration.bucketPolicyOnly.enabled may be changed from true to false until the locked time, after which the field is immutable.",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
196 |
"format": "date-time"
|
197 |
+
}
|
198 |
+
}
|
199 |
+
},
|
200 |
+
"uniformBucketLevelAccess": {
|
201 |
+
"type": "object",
|
202 |
+
"description": "The bucket's uniform bucket-level access configuration.",
|
203 |
+
"properties": {
|
204 |
+
"enabled": {
|
205 |
+
"type": "boolean",
|
206 |
+
"description": "If set, access is controlled only by bucket-level or above IAM policies."
|
207 |
+
},
|
208 |
+
"lockedTime": {
|
209 |
"type": "string",
|
210 |
+
"description": "The deadline for changing iamConfiguration.uniformBucketLevelAccess.enabled from true to false in RFC 3339 format. iamConfiguration.uniformBucketLevelAccess.enabled may be changed from true to false until the locked time, after which the field is immutable.",
|
211 |
"format": "date-time"
|
212 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
213 |
}
|
214 |
+
}
|
215 |
}
|
216 |
+
},
|
217 |
+
"id": {
|
218 |
+
"type": "string",
|
219 |
+
"description": "The ID of the bucket. For buckets, the id and name properties are the same."
|
220 |
+
},
|
221 |
+
"kind": {
|
222 |
+
"type": "string",
|
223 |
+
"description": "The kind of item this is. For buckets, this is always storage#bucket.",
|
224 |
+
"default": "storage#bucket"
|
225 |
+
},
|
226 |
+
"labels": {
|
227 |
"type": "object",
|
228 |
+
"description": "User-provided labels, in key/value pairs.",
|
229 |
+
"additionalProperties": {
|
230 |
+
"type": "string",
|
231 |
+
"description": "An individual label entry."
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
232 |
}
|
233 |
+
},
|
234 |
+
"lifecycle": {
|
|
|
235 |
"type": "object",
|
236 |
+
"description": "The bucket's lifecycle configuration. See lifecycle management for more information.",
|
237 |
"properties": {
|
238 |
+
"rule": {
|
239 |
+
"type": "array",
|
240 |
+
"description": "A lifecycle management rule, which is made of an action to take and the condition(s) under which the action will be taken.",
|
241 |
"items": {
|
242 |
+
"type": "object",
|
243 |
+
"properties": {
|
244 |
+
"action": {
|
245 |
+
"type": "object",
|
246 |
+
"description": "The action to take.",
|
247 |
+
"properties": {
|
248 |
+
"storageClass": {
|
249 |
+
"type": "string",
|
250 |
+
"description": "Target storage class. Required iff the type of the action is SetStorageClass."
|
251 |
+
},
|
252 |
+
"type": {
|
253 |
+
"type": "string",
|
254 |
+
"description": "Type of the action. Currently, only Delete and SetStorageClass are supported."
|
255 |
+
}
|
256 |
+
}
|
257 |
+
},
|
258 |
+
"condition": {
|
259 |
+
"type": "object",
|
260 |
+
"description": "The condition(s) under which the action will be taken.",
|
261 |
+
"properties": {
|
262 |
+
"age": {
|
263 |
+
"type": "integer",
|
264 |
+
"description": "Age of an object (in days). This condition is satisfied when an object reaches the specified age.",
|
265 |
+
"format": "int32"
|
266 |
+
},
|
267 |
+
"createdBefore": {
|
268 |
+
"type": "string",
|
269 |
+
"description": "A date in RFC 3339 format with only the date part (for instance, \"2013-01-15\"). This condition is satisfied when an object is created before midnight of the specified date in UTC.",
|
270 |
+
"format": "date"
|
271 |
+
},
|
272 |
+
"isLive": {
|
273 |
+
"type": "boolean",
|
274 |
+
"description": "Relevant only for versioned objects. If the value is true, this condition matches live objects; if the value is false, it matches archived objects."
|
275 |
+
},
|
276 |
+
"matchesPattern": {
|
277 |
+
"type": "string",
|
278 |
+
"description": "A regular expression that satisfies the RE2 syntax. This condition is satisfied when the name of the object matches the RE2 pattern. Note: This feature is currently in the \"Early Access\" launch stage and is only available to a whitelisted set of users; that means that this feature may be changed in backward-incompatible ways and that it is not guaranteed to be released."
|
279 |
+
},
|
280 |
+
"matchesStorageClass": {
|
281 |
+
"type": "array",
|
282 |
+
"description": "Objects having any of the storage classes specified by this condition will be matched. Values include MULTI_REGIONAL, REGIONAL, NEARLINE, COLDLINE, STANDARD, and DURABLE_REDUCED_AVAILABILITY.",
|
283 |
+
"items": {
|
284 |
+
"type": "string"
|
285 |
+
}
|
286 |
+
},
|
287 |
+
"numNewerVersions": {
|
288 |
+
"type": "integer",
|
289 |
+
"description": "Relevant only for versioned objects. If the value is N, this condition is satisfied when there are at least N versions (including the live version) newer than this version of the object.",
|
290 |
+
"format": "int32"
|
291 |
+
}
|
292 |
+
}
|
293 |
}
|
294 |
+
}
|
|
|
|
|
|
|
|
|
295 |
}
|
296 |
+
}
|
297 |
}
|
298 |
+
},
|
299 |
+
"location": {
|
300 |
+
"type": "string",
|
301 |
+
"description": "The location of the bucket. Object data for objects in the bucket resides in physical storage within this region. Defaults to US. See the developer's guide for the authoritative list."
|
302 |
+
},
|
303 |
+
"locationType": {
|
304 |
+
"type": "string",
|
305 |
+
"description": "The type of the bucket location."
|
306 |
+
},
|
307 |
+
"logging": {
|
308 |
"type": "object",
|
309 |
+
"description": "The bucket's logging configuration, which defines the destination bucket and optional name prefix for the current bucket's logs.",
|
310 |
"properties": {
|
311 |
+
"logBucket": {
|
312 |
+
"type": "string",
|
313 |
+
"description": "The destination bucket where the current bucket's logs should be placed."
|
314 |
+
},
|
315 |
+
"logObjectPrefix": {
|
316 |
+
"type": "string",
|
317 |
+
"description": "A prefix for log object names."
|
318 |
+
}
|
319 |
+
}
|
320 |
+
},
|
321 |
+
"metageneration": {
|
322 |
+
"type": "string",
|
323 |
+
"description": "The metadata generation of this bucket.",
|
324 |
+
"format": "int64"
|
325 |
+
},
|
326 |
+
"name": {
|
327 |
+
"type": "string",
|
328 |
+
"description": "The name of the bucket.",
|
329 |
+
"annotations": {
|
330 |
+
"required": [
|
331 |
+
"storage.buckets.insert"
|
332 |
+
]
|
333 |
}
|
334 |
+
},
|
335 |
+
"owner": {
|
|
|
336 |
"type": "object",
|
337 |
+
"description": "The owner of the bucket. This is always the project team's owner group.",
|
338 |
"properties": {
|
339 |
+
"entity": {
|
340 |
+
"type": "string",
|
341 |
+
"description": "The entity, in the form project-owner-projectId."
|
342 |
+
},
|
343 |
+
"entityId": {
|
344 |
+
"type": "string",
|
345 |
+
"description": "The ID for the entity."
|
346 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
347 |
}
|
348 |
+
},
|
349 |
+
"projectNumber": {
|
350 |
+
"type": "string",
|
351 |
+
"description": "The project number of the project the bucket belongs to.",
|
352 |
+
"format": "uint64"
|
353 |
+
},
|
354 |
+
"retentionPolicy": {
|
355 |
"type": "object",
|
356 |
+
"description": "The bucket's retention policy. The retention policy enforces a minimum retention time for all objects contained in the bucket, based on their creation time. Any attempt to overwrite or delete objects younger than the retention period will result in a PERMISSION_DENIED error. An unlocked retention policy can be modified or removed from the bucket via a storage.buckets.update operation. A locked retention policy cannot be removed or shortened in duration for the lifetime of the bucket. Attempting to remove or decrease period of a locked retention policy will result in a PERMISSION_DENIED error.",
|
357 |
"properties": {
|
358 |
+
"effectiveTime": {
|
359 |
+
"type": "string",
|
360 |
+
"description": "Server-determined value that indicates the time from which policy was enforced and effective. This value is in RFC 3339 format.",
|
361 |
+
"format": "date-time"
|
362 |
+
},
|
363 |
+
"isLocked": {
|
364 |
+
"type": "boolean",
|
365 |
+
"description": "Once locked, an object retention policy cannot be modified."
|
366 |
+
},
|
367 |
+
"retentionPeriod": {
|
368 |
+
"type": "string",
|
369 |
+
"description": "The duration in seconds that objects need to be retained. Retention duration must be greater than zero and less than 100 years. Note that enforcement of retention periods less than a day is not guaranteed. Such periods should only be used for testing purposes.",
|
370 |
+
"format": "int64"
|
371 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
372 |
}
|
373 |
+
},
|
374 |
+
"selfLink": {
|
375 |
+
"type": "string",
|
376 |
+
"description": "The URI of this bucket."
|
377 |
+
},
|
378 |
+
"storageClass": {
|
379 |
+
"type": "string",
|
380 |
+
"description": "The bucket's default storage class, used whenever no storageClass is specified for a newly-created object. This defines how objects in the bucket are stored and determines the SLA and the cost of storage. Values include MULTI_REGIONAL, REGIONAL, STANDARD, NEARLINE, COLDLINE, and DURABLE_REDUCED_AVAILABILITY. If this value is not specified when the bucket is created, it will default to STANDARD. For more information, see storage classes."
|
381 |
+
},
|
382 |
+
"timeCreated": {
|
383 |
+
"type": "string",
|
384 |
+
"description": "The creation time of the bucket in RFC 3339 format.",
|
385 |
+
"format": "date-time"
|
386 |
+
},
|
387 |
+
"updated": {
|
388 |
+
"type": "string",
|
389 |
+
"description": "The modification time of the bucket in RFC 3339 format.",
|
390 |
+
"format": "date-time"
|
391 |
+
},
|
392 |
+
"versioning": {
|
393 |
"type": "object",
|
394 |
+
"description": "The bucket's versioning configuration.",
|
395 |
"properties": {
|
396 |
+
"enabled": {
|
397 |
+
"type": "boolean",
|
398 |
+
"description": "While set to true, versioning is fully enabled for this bucket."
|
399 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
400 |
}
|
401 |
+
},
|
402 |
+
"website": {
|
|
|
403 |
"type": "object",
|
404 |
+
"description": "The bucket's website configuration, controlling how the service behaves when accessing bucket contents as a web site. See the Static Website Examples for more information.",
|
405 |
"properties": {
|
406 |
+
"mainPageSuffix": {
|
407 |
+
"type": "string",
|
408 |
+
"description": "If the requested object path is missing, the service will ensure the path has a trailing '/', append this suffix, and attempt to retrieve the resulting object. This allows the creation of index.html objects to represent directory pages."
|
409 |
+
},
|
410 |
+
"notFoundPage": {
|
411 |
+
"type": "string",
|
412 |
+
"description": "If the requested object path is missing, and any mainPageSuffix object is missing, if applicable, the service will return the named object from this bucket as the content for a 404 Not Found result."
|
413 |
+
}
|
414 |
+
}
|
415 |
+
}
|
416 |
+
}
|
417 |
+
},
|
418 |
+
"BucketAccessControl": {
|
419 |
+
"id": "BucketAccessControl",
|
420 |
+
"type": "object",
|
421 |
+
"description": "An access-control entry.",
|
422 |
+
"properties": {
|
423 |
+
"bucket": {
|
424 |
+
"type": "string",
|
425 |
+
"description": "The name of the bucket."
|
426 |
+
},
|
427 |
+
"domain": {
|
428 |
+
"type": "string",
|
429 |
+
"description": "The domain associated with the entity, if any."
|
430 |
+
},
|
431 |
+
"email": {
|
432 |
+
"type": "string",
|
433 |
+
"description": "The email address associated with the entity, if any."
|
434 |
+
},
|
435 |
+
"entity": {
|
436 |
+
"type": "string",
|
437 |
+
"description": "The entity holding the permission, in one of the following forms: \n- user-userId \n- user-email \n- group-groupId \n- group-email \n- domain-domain \n- project-team-projectId \n- allUsers \n- allAuthenticatedUsers Examples: \n- The user liz@example.com would be user-liz@example.com. \n- The group example@googlegroups.com would be group-example@googlegroups.com. \n- To refer to all members of the Google Apps for Business domain example.com, the entity would be domain-example.com.",
|
438 |
+
"annotations": {
|
439 |
+
"required": [
|
440 |
+
"storage.bucketAccessControls.insert"
|
441 |
+
]
|
442 |
}
|
443 |
+
},
|
444 |
+
"entityId": {
|
445 |
+
"type": "string",
|
446 |
+
"description": "The ID for the entity, if any."
|
447 |
+
},
|
448 |
+
"etag": {
|
449 |
+
"type": "string",
|
450 |
+
"description": "HTTP 1.1 Entity tag for the access-control entry."
|
451 |
+
},
|
452 |
+
"id": {
|
453 |
+
"type": "string",
|
454 |
+
"description": "The ID of the access-control entry."
|
455 |
+
},
|
456 |
+
"kind": {
|
457 |
+
"type": "string",
|
458 |
+
"description": "The kind of item this is. For bucket access control entries, this is always storage#bucketAccessControl.",
|
459 |
+
"default": "storage#bucketAccessControl"
|
460 |
+
},
|
461 |
+
"projectTeam": {
|
462 |
"type": "object",
|
463 |
+
"description": "The project team associated with the entity, if any.",
|
464 |
"properties": {
|
465 |
+
"projectNumber": {
|
466 |
+
"type": "string",
|
467 |
+
"description": "The project number."
|
468 |
+
},
|
469 |
+
"team": {
|
470 |
+
"type": "string",
|
471 |
+
"description": "The team."
|
472 |
+
}
|
473 |
+
}
|
474 |
+
},
|
475 |
+
"role": {
|
476 |
+
"type": "string",
|
477 |
+
"description": "The access permission for the entity.",
|
478 |
+
"annotations": {
|
479 |
+
"required": [
|
480 |
+
"storage.bucketAccessControls.insert"
|
481 |
+
]
|
482 |
+
}
|
483 |
+
},
|
484 |
+
"selfLink": {
|
485 |
+
"type": "string",
|
486 |
+
"description": "The link to this access-control entry."
|
487 |
+
}
|
488 |
+
}
|
489 |
+
},
|
490 |
+
"BucketAccessControls": {
|
491 |
+
"id": "BucketAccessControls",
|
492 |
+
"type": "object",
|
493 |
+
"description": "An access-control list.",
|
494 |
+
"properties": {
|
495 |
+
"items": {
|
496 |
+
"type": "array",
|
497 |
+
"description": "The list of items.",
|
498 |
+
"items": {
|
499 |
+
"$ref": "BucketAccessControl"
|
500 |
+
}
|
501 |
+
},
|
502 |
+
"kind": {
|
503 |
+
"type": "string",
|
504 |
+
"description": "The kind of item this is. For lists of bucket access control entries, this is always storage#bucketAccessControls.",
|
505 |
+
"default": "storage#bucketAccessControls"
|
506 |
+
}
|
507 |
+
}
|
508 |
+
},
|
509 |
+
"Buckets": {
|
510 |
+
"id": "Buckets",
|
511 |
+
"type": "object",
|
512 |
+
"description": "A list of buckets.",
|
513 |
+
"properties": {
|
514 |
+
"items": {
|
515 |
+
"type": "array",
|
516 |
+
"description": "The list of items.",
|
517 |
+
"items": {
|
518 |
+
"$ref": "Bucket"
|
519 |
+
}
|
520 |
+
},
|
521 |
+
"kind": {
|
522 |
+
"type": "string",
|
523 |
+
"description": "The kind of item this is. For lists of buckets, this is always storage#buckets.",
|
524 |
+
"default": "storage#buckets"
|
525 |
+
},
|
526 |
+
"nextPageToken": {
|
527 |
+
"type": "string",
|
528 |
+
"description": "The continuation token, used to page through large result sets. Provide this value in a subsequent request to return the next page of results."
|
529 |
+
}
|
530 |
+
}
|
531 |
+
},
|
532 |
+
"Channel": {
|
533 |
+
"id": "Channel",
|
534 |
+
"type": "object",
|
535 |
+
"description": "An notification channel used to watch for resource changes.",
|
536 |
+
"properties": {
|
537 |
+
"address": {
|
538 |
+
"type": "string",
|
539 |
+
"description": "The address where notifications are delivered for this channel."
|
540 |
+
},
|
541 |
+
"expiration": {
|
542 |
+
"type": "string",
|
543 |
+
"description": "Date and time of notification channel expiration, expressed as a Unix timestamp, in milliseconds. Optional.",
|
544 |
+
"format": "int64"
|
545 |
+
},
|
546 |
+
"id": {
|
547 |
+
"type": "string",
|
548 |
+
"description": "A UUID or similar unique string that identifies this channel."
|
549 |
+
},
|
550 |
+
"kind": {
|
551 |
+
"type": "string",
|
552 |
+
"description": "Identifies this as a notification channel used to watch for changes to a resource, which is \"api#channel\".",
|
553 |
+
"default": "api#channel"
|
554 |
+
},
|
555 |
+
"params": {
|
556 |
+
"type": "object",
|
557 |
+
"description": "Additional parameters controlling delivery channel behavior. Optional.",
|
558 |
+
"additionalProperties": {
|
559 |
+
"type": "string",
|
560 |
+
"description": "Declares a new parameter by name."
|
561 |
+
}
|
562 |
+
},
|
563 |
+
"payload": {
|
564 |
+
"type": "boolean",
|
565 |
+
"description": "A Boolean value to indicate whether payload is wanted. Optional."
|
566 |
+
},
|
567 |
+
"resourceId": {
|
568 |
+
"type": "string",
|
569 |
+
"description": "An opaque ID that identifies the resource being watched on this channel. Stable across different API versions."
|
570 |
+
},
|
571 |
+
"resourceUri": {
|
572 |
+
"type": "string",
|
573 |
+
"description": "A version-specific identifier for the watched resource."
|
574 |
+
},
|
575 |
+
"token": {
|
576 |
+
"type": "string",
|
577 |
+
"description": "An arbitrary string delivered to the target address with each notification delivered over this channel. Optional."
|
578 |
+
},
|
579 |
+
"type": {
|
580 |
+
"type": "string",
|
581 |
+
"description": "The type of delivery mechanism used for this channel."
|
582 |
+
}
|
583 |
+
}
|
584 |
+
},
|
585 |
+
"ComposeRequest": {
|
586 |
+
"id": "ComposeRequest",
|
587 |
+
"type": "object",
|
588 |
+
"description": "A Compose request.",
|
589 |
+
"properties": {
|
590 |
+
"destination": {
|
591 |
+
"$ref": "Object",
|
592 |
+
"description": "Properties of the resulting object."
|
593 |
+
},
|
594 |
+
"kind": {
|
595 |
+
"type": "string",
|
596 |
+
"description": "The kind of item this is.",
|
597 |
+
"default": "storage#composeRequest"
|
598 |
+
},
|
599 |
+
"sourceObjects": {
|
600 |
+
"type": "array",
|
601 |
+
"description": "The list of source objects that will be concatenated into a single object.",
|
602 |
+
"items": {
|
603 |
+
"type": "object",
|
604 |
+
"properties": {
|
605 |
"generation": {
|
606 |
+
"type": "string",
|
607 |
+
"description": "The generation of this object to use as the source.",
|
608 |
+
"format": "int64"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
609 |
},
|
610 |
"name": {
|
611 |
+
"type": "string",
|
612 |
+
"description": "The source object's name. All source objects must reside in the same bucket.",
|
613 |
+
"annotations": {
|
614 |
+
"required": [
|
615 |
+
"storage.objects.compose"
|
616 |
+
]
|
617 |
+
}
|
618 |
+
},
|
619 |
+
"objectPreconditions": {
|
620 |
+
"type": "object",
|
621 |
+
"description": "Conditions that must be met for this operation to execute.",
|
622 |
+
"properties": {
|
623 |
+
"ifGenerationMatch": {
|
624 |
+
"type": "string",
|
625 |
+
"description": "Only perform the composition if the generation of the source object that would be used matches this value. If this value and a generation are both specified, they must be the same value or the call will fail.",
|
626 |
+
"format": "int64"
|
627 |
}
|
628 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
629 |
}
|
630 |
+
}
|
631 |
+
},
|
632 |
+
"annotations": {
|
633 |
+
"required": [
|
634 |
+
"storage.objects.compose"
|
635 |
+
]
|
636 |
}
|
637 |
+
}
|
638 |
+
}
|
639 |
+
},
|
640 |
+
"Expr": {
|
641 |
+
"id": "Expr",
|
642 |
+
"type": "object",
|
643 |
+
"description": "Represents an expression text. Example: title: \"User account presence\" description: \"Determines whether the request has a user account\" expression: \"size(request.user) \u003e 0\"",
|
644 |
+
"properties": {
|
645 |
+
"description": {
|
646 |
+
"type": "string",
|
647 |
+
"description": "An optional description of the expression. This is a longer text which describes the expression, e.g. when hovered over it in a UI."
|
648 |
+
},
|
649 |
+
"expression": {
|
650 |
+
"type": "string",
|
651 |
+
"description": "Textual representation of an expression in Common Expression Language syntax. The application context of the containing message determines which well-known feature set of CEL is supported."
|
652 |
+
},
|
653 |
+
"location": {
|
654 |
+
"type": "string",
|
655 |
+
"description": "An optional string indicating the location of the expression for error reporting, e.g. a file name and a position in the file."
|
656 |
+
},
|
657 |
+
"title": {
|
658 |
+
"type": "string",
|
659 |
+
"description": "An optional title for the expression, i.e. a short string describing its purpose. This can be used e.g. in UIs which allow to enter the expression."
|
660 |
+
}
|
661 |
+
}
|
662 |
+
},
|
663 |
+
"HmacKey": {
|
664 |
+
"id": "HmacKey",
|
665 |
+
"type": "object",
|
666 |
+
"description": "JSON template to produce a JSON-style HMAC Key resource for Create responses.",
|
667 |
+
"properties": {
|
668 |
+
"kind": {
|
669 |
+
"type": "string",
|
670 |
+
"description": "The kind of item this is. For HMAC keys, this is always storage#hmacKey.",
|
671 |
+
"default": "storage#hmacKey"
|
672 |
+
},
|
673 |
+
"metadata": {
|
674 |
+
"$ref": "HmacKeyMetadata",
|
675 |
+
"description": "Key metadata."
|
676 |
+
},
|
677 |
+
"secret": {
|
678 |
+
"type": "string",
|
679 |
+
"description": "HMAC secret key material."
|
680 |
+
}
|
681 |
+
}
|
682 |
+
},
|
683 |
+
"HmacKeyMetadata": {
|
684 |
+
"id": "HmacKeyMetadata",
|
685 |
+
"type": "object",
|
686 |
+
"description": "JSON template to produce a JSON-style HMAC Key metadata resource.",
|
687 |
+
"properties": {
|
688 |
+
"accessId": {
|
689 |
+
"type": "string",
|
690 |
+
"description": "The ID of the HMAC Key."
|
691 |
+
},
|
692 |
+
"etag": {
|
693 |
+
"type": "string",
|
694 |
+
"description": "HTTP 1.1 Entity tag for the HMAC key."
|
695 |
+
},
|
696 |
+
"id": {
|
697 |
+
"type": "string",
|
698 |
+
"description": "The ID of the HMAC key, including the Project ID and the Access ID."
|
699 |
+
},
|
700 |
+
"kind": {
|
701 |
+
"type": "string",
|
702 |
+
"description": "The kind of item this is. For HMAC Key metadata, this is always storage#hmacKeyMetadata.",
|
703 |
+
"default": "storage#hmacKeyMetadata"
|
704 |
+
},
|
705 |
+
"projectId": {
|
706 |
+
"type": "string",
|
707 |
+
"description": "Project ID owning the service account to which the key authenticates."
|
708 |
+
},
|
709 |
+
"selfLink": {
|
710 |
+
"type": "string",
|
711 |
+
"description": "The link to this resource."
|
712 |
+
},
|
713 |
+
"serviceAccountEmail": {
|
714 |
+
"type": "string",
|
715 |
+
"description": "The email address of the key's associated service account."
|
716 |
+
},
|
717 |
+
"state": {
|
718 |
+
"type": "string",
|
719 |
+
"description": "The state of the key. Can be one of ACTIVE, INACTIVE, or DELETED."
|
720 |
+
},
|
721 |
+
"timeCreated": {
|
722 |
+
"type": "string",
|
723 |
+
"description": "The creation time of the HMAC key in RFC 3339 format.",
|
724 |
+
"format": "date-time"
|
725 |
+
},
|
726 |
+
"updated": {
|
727 |
+
"type": "string",
|
728 |
+
"description": "The last modification time of the HMAC key metadata in RFC 3339 format.",
|
729 |
+
"format": "date-time"
|
730 |
+
}
|
731 |
+
}
|
732 |
+
},
|
733 |
+
"HmacKeysMetadata": {
|
734 |
+
"id": "HmacKeysMetadata",
|
735 |
+
"type": "object",
|
736 |
+
"description": "A list of hmacKeys.",
|
737 |
+
"properties": {
|
738 |
+
"items": {
|
739 |
+
"type": "array",
|
740 |
+
"description": "The list of items.",
|
741 |
+
"items": {
|
742 |
+
"$ref": "HmacKeyMetadata"
|
743 |
}
|
744 |
+
},
|
745 |
+
"kind": {
|
746 |
+
"type": "string",
|
747 |
+
"description": "The kind of item this is. For lists of hmacKeys, this is always storage#hmacKeysMetadata.",
|
748 |
+
"default": "storage#hmacKeysMetadata"
|
749 |
+
},
|
750 |
+
"nextPageToken": {
|
751 |
+
"type": "string",
|
752 |
+
"description": "The continuation token, used to page through large result sets. Provide this value in a subsequent request to return the next page of results."
|
753 |
+
}
|
754 |
+
}
|
755 |
+
},
|
756 |
+
"Notification": {
|
757 |
+
"id": "Notification",
|
758 |
+
"type": "object",
|
759 |
+
"description": "A subscription to receive Google PubSub notifications.",
|
760 |
+
"properties": {
|
761 |
+
"custom_attributes": {
|
762 |
"type": "object",
|
763 |
+
"description": "An optional list of additional attributes to attach to each Cloud PubSub message published for this notification subscription.",
|
764 |
+
"additionalProperties": {
|
765 |
+
"type": "string"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
766 |
}
|
767 |
+
},
|
768 |
+
"etag": {
|
769 |
+
"type": "string",
|
770 |
+
"description": "HTTP 1.1 Entity tag for this subscription notification."
|
771 |
+
},
|
772 |
+
"event_types": {
|
773 |
+
"type": "array",
|
774 |
+
"description": "If present, only send notifications about listed event types. If empty, sent notifications for all event types.",
|
775 |
+
"items": {
|
776 |
+
"type": "string"
|
777 |
+
}
|
778 |
+
},
|
779 |
+
"id": {
|
780 |
+
"type": "string",
|
781 |
+
"description": "The ID of the notification."
|
782 |
+
},
|
783 |
+
"kind": {
|
784 |
+
"type": "string",
|
785 |
+
"description": "The kind of item this is. For notifications, this is always storage#notification.",
|
786 |
+
"default": "storage#notification"
|
787 |
+
},
|
788 |
+
"object_name_prefix": {
|
789 |
+
"type": "string",
|
790 |
+
"description": "If present, only apply this notification configuration to object names that begin with this prefix."
|
791 |
+
},
|
792 |
+
"payload_format": {
|
793 |
+
"type": "string",
|
794 |
+
"description": "The desired content of the Payload.",
|
795 |
+
"default": "JSON_API_V1",
|
796 |
+
"annotations": {
|
797 |
+
"required": [
|
798 |
+
"storage.notifications.insert"
|
799 |
+
]
|
800 |
+
}
|
801 |
+
},
|
802 |
+
"selfLink": {
|
803 |
+
"type": "string",
|
804 |
+
"description": "The canonical URL of this notification."
|
805 |
+
},
|
806 |
+
"topic": {
|
807 |
+
"type": "string",
|
808 |
+
"description": "The Cloud PubSub topic to which this subscription publishes. Formatted as: '//pubsub.googleapis.com/projects/{project-identifier}/topics/{my-topic}'",
|
809 |
+
"annotations": {
|
810 |
+
"required": [
|
811 |
+
"storage.notifications.insert"
|
812 |
+
]
|
813 |
+
}
|
814 |
+
}
|
815 |
+
}
|
816 |
+
},
|
817 |
+
"Notifications": {
|
818 |
+
"id": "Notifications",
|
819 |
+
"type": "object",
|
820 |
+
"description": "A list of notification subscriptions.",
|
821 |
+
"properties": {
|
822 |
+
"items": {
|
823 |
+
"type": "array",
|
824 |
+
"description": "The list of items.",
|
825 |
+
"items": {
|
826 |
+
"$ref": "Notification"
|
827 |
}
|
828 |
+
},
|
829 |
+
"kind": {
|
830 |
+
"type": "string",
|
831 |
+
"description": "The kind of item this is. For lists of notifications, this is always storage#notifications.",
|
832 |
+
"default": "storage#notifications"
|
833 |
+
}
|
834 |
+
}
|
835 |
+
},
|
836 |
+
"Object": {
|
837 |
+
"id": "Object",
|
838 |
+
"type": "object",
|
839 |
+
"description": "An object.",
|
840 |
+
"properties": {
|
841 |
+
"acl": {
|
842 |
+
"type": "array",
|
843 |
+
"description": "Access controls on the object.",
|
844 |
+
"items": {
|
845 |
+
"$ref": "ObjectAccessControl"
|
846 |
+
},
|
847 |
+
"annotations": {
|
848 |
+
"required": [
|
849 |
+
"storage.objects.update"
|
850 |
+
]
|
851 |
+
}
|
852 |
+
},
|
853 |
+
"bucket": {
|
854 |
+
"type": "string",
|
855 |
+
"description": "The name of the bucket containing this object."
|
856 |
+
},
|
857 |
+
"cacheControl": {
|
858 |
+
"type": "string",
|
859 |
+
"description": "Cache-Control directive for the object data. If omitted, and the object is accessible to all anonymous users, the default will be public, max-age=3600."
|
860 |
+
},
|
861 |
+
"componentCount": {
|
862 |
+
"type": "integer",
|
863 |
+
"description": "Number of underlying components that make up this object. Components are accumulated by compose operations.",
|
864 |
+
"format": "int32"
|
865 |
+
},
|
866 |
+
"contentDisposition": {
|
867 |
+
"type": "string",
|
868 |
+
"description": "Content-Disposition of the object data."
|
869 |
+
},
|
870 |
+
"contentEncoding": {
|
871 |
+
"type": "string",
|
872 |
+
"description": "Content-Encoding of the object data."
|
873 |
+
},
|
874 |
+
"contentLanguage": {
|
875 |
+
"type": "string",
|
876 |
+
"description": "Content-Language of the object data."
|
877 |
+
},
|
878 |
+
"contentType": {
|
879 |
+
"type": "string",
|
880 |
+
"description": "Content-Type of the object data. If an object is stored without a Content-Type, it is served as application/octet-stream."
|
881 |
+
},
|
882 |
+
"crc32c": {
|
883 |
+
"type": "string",
|
884 |
+
"description": "CRC32c checksum, as described in RFC 4960, Appendix B; encoded using base64 in big-endian byte order. For more information about using the CRC32c checksum, see Hashes and ETags: Best Practices."
|
885 |
+
},
|
886 |
+
"customerEncryption": {
|
887 |
"type": "object",
|
888 |
+
"description": "Metadata of customer-supplied encryption key, if the object is encrypted by such a key.",
|
889 |
"properties": {
|
890 |
+
"encryptionAlgorithm": {
|
891 |
+
"type": "string",
|
892 |
+
"description": "The encryption algorithm."
|
893 |
+
},
|
894 |
+
"keySha256": {
|
895 |
+
"type": "string",
|
896 |
+
"description": "SHA256 hash value of the encryption key."
|
897 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
898 |
}
|
899 |
+
},
|
900 |
+
"etag": {
|
901 |
+
"type": "string",
|
902 |
+
"description": "HTTP 1.1 Entity tag for the object."
|
903 |
+
},
|
904 |
+
"eventBasedHold": {
|
905 |
+
"type": "boolean",
|
906 |
+
"description": "Whether an object is under event-based hold. Event-based hold is a way to retain objects until an event occurs, which is signified by the hold's release (i.e. this value is set to false). After being released (set to false), such objects will be subject to bucket-level retention (if any). One sample use case of this flag is for banks to hold loan documents for at least 3 years after loan is paid in full. Here, bucket-level retention is 3 years and the event is the loan being paid in full. In this example, these objects will be held intact for any number of years until the event has occurred (event-based hold on the object is released) and then 3 more years after that. That means retention duration of the objects begins from the moment event-based hold transitioned from true to false."
|
907 |
+
},
|
908 |
+
"generation": {
|
909 |
+
"type": "string",
|
910 |
+
"description": "The content generation of this object. Used for object versioning.",
|
911 |
+
"format": "int64"
|
912 |
+
},
|
913 |
+
"id": {
|
914 |
+
"type": "string",
|
915 |
+
"description": "The ID of the object, including the bucket name, object name, and generation number."
|
916 |
+
},
|
917 |
+
"kind": {
|
918 |
+
"type": "string",
|
919 |
+
"description": "The kind of item this is. For objects, this is always storage#object.",
|
920 |
+
"default": "storage#object"
|
921 |
+
},
|
922 |
+
"kmsKeyName": {
|
923 |
+
"type": "string",
|
924 |
+
"description": "Cloud KMS Key used to encrypt this object, if the object is encrypted by such a key."
|
925 |
+
},
|
926 |
+
"md5Hash": {
|
927 |
+
"type": "string",
|
928 |
+
"description": "MD5 hash of the data; encoded using base64. For more information about using the MD5 hash, see Hashes and ETags: Best Practices."
|
929 |
+
},
|
930 |
+
"mediaLink": {
|
931 |
+
"type": "string",
|
932 |
+
"description": "Media download link."
|
933 |
+
},
|
934 |
+
"metadata": {
|
935 |
"type": "object",
|
936 |
+
"description": "User-provided metadata, in key/value pairs.",
|
937 |
+
"additionalProperties": {
|
938 |
+
"type": "string",
|
939 |
+
"description": "An individual metadata entry."
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
940 |
}
|
941 |
+
},
|
942 |
+
"metageneration": {
|
943 |
+
"type": "string",
|
944 |
+
"description": "The version of the metadata for this object at this generation. Used for preconditions and for detecting changes in metadata. A metageneration number is only meaningful in the context of a particular generation of a particular object.",
|
945 |
+
"format": "int64"
|
946 |
+
},
|
947 |
+
"name": {
|
948 |
+
"type": "string",
|
949 |
+
"description": "The name of the object. Required if not specified by URL parameter."
|
950 |
+
},
|
951 |
+
"owner": {
|
952 |
"type": "object",
|
953 |
+
"description": "The owner of the object. This will always be the uploader of the object.",
|
954 |
"properties": {
|
955 |
+
"entity": {
|
956 |
+
"type": "string",
|
957 |
+
"description": "The entity, in the form user-userId."
|
958 |
+
},
|
959 |
+
"entityId": {
|
960 |
+
"type": "string",
|
961 |
+
"description": "The ID for the entity."
|
962 |
+
}
|
963 |
+
}
|
964 |
+
},
|
965 |
+
"retentionExpirationTime": {
|
966 |
+
"type": "string",
|
967 |
+
"description": "A server-determined value that specifies the earliest time that the object's retention period expires. This value is in RFC 3339 format. Note 1: This field is not provided for objects with an active event-based hold, since retention expiration is unknown until the hold is removed. Note 2: This value can be provided even when temporary hold is set (so that the user can reason about policy without having to first unset the temporary hold).",
|
968 |
+
"format": "date-time"
|
969 |
+
},
|
970 |
+
"selfLink": {
|
971 |
+
"type": "string",
|
972 |
+
"description": "The link to this object."
|
973 |
+
},
|
974 |
+
"size": {
|
975 |
+
"type": "string",
|
976 |
+
"description": "Content-Length of the data in bytes.",
|
977 |
+
"format": "uint64"
|
978 |
+
},
|
979 |
+
"storageClass": {
|
980 |
+
"type": "string",
|
981 |
+
"description": "Storage class of the object."
|
982 |
+
},
|
983 |
+
"temporaryHold": {
|
984 |
+
"type": "boolean",
|
985 |
+
"description": "Whether an object is under temporary hold. While this flag is set to true, the object is protected against deletion and overwrites. A common use case of this flag is regulatory investigations where objects need to be retained while the investigation is ongoing. Note that unlike event-based hold, temporary hold does not impact retention expiration time of an object."
|
986 |
+
},
|
987 |
+
"timeCreated": {
|
988 |
+
"type": "string",
|
989 |
+
"description": "The creation time of the object in RFC 3339 format.",
|
990 |
+
"format": "date-time"
|
991 |
+
},
|
992 |
+
"timeDeleted": {
|
993 |
+
"type": "string",
|
994 |
+
"description": "The deletion time of the object in RFC 3339 format. Will be returned if and only if this version of the object has been deleted.",
|
995 |
+
"format": "date-time"
|
996 |
+
},
|
997 |
+
"timeStorageClassUpdated": {
|
998 |
+
"type": "string",
|
999 |
+
"description": "The time at which the object's storage class was last changed. When the object is initially created, it will be set to timeCreated.",
|
1000 |
+
"format": "date-time"
|
1001 |
+
},
|
1002 |
+
"updated": {
|
1003 |
+
"type": "string",
|
1004 |
+
"description": "The modification time of the object metadata in RFC 3339 format.",
|
1005 |
+
"format": "date-time"
|
1006 |
+
}
|
1007 |
+
}
|
1008 |
+
},
|
1009 |
+
"ObjectAccessControl": {
|
1010 |
+
"id": "ObjectAccessControl",
|
1011 |
+
"type": "object",
|
1012 |
+
"description": "An access-control entry.",
|
1013 |
+
"properties": {
|
1014 |
+
"bucket": {
|
1015 |
+
"type": "string",
|
1016 |
+
"description": "The name of the bucket."
|
1017 |
+
},
|
1018 |
+
"domain": {
|
1019 |
+
"type": "string",
|
1020 |
+
"description": "The domain associated with the entity, if any."
|
1021 |
+
},
|
1022 |
+
"email": {
|
1023 |
+
"type": "string",
|
1024 |
+
"description": "The email address associated with the entity, if any."
|
1025 |
+
},
|
1026 |
+
"entity": {
|
1027 |
+
"type": "string",
|
1028 |
+
"description": "The entity holding the permission, in one of the following forms: \n- user-userId \n- user-email \n- group-groupId \n- group-email \n- domain-domain \n- project-team-projectId \n- allUsers \n- allAuthenticatedUsers Examples: \n- The user liz@example.com would be user-liz@example.com. \n- The group example@googlegroups.com would be group-example@googlegroups.com. \n- To refer to all members of the Google Apps for Business domain example.com, the entity would be domain-example.com.",
|
1029 |
+
"annotations": {
|
1030 |
+
"required": [
|
1031 |
+
"storage.defaultObjectAccessControls.insert",
|
1032 |
+
"storage.objectAccessControls.insert"
|
1033 |
+
]
|
1034 |
}
|
1035 |
+
},
|
1036 |
+
"entityId": {
|
1037 |
+
"type": "string",
|
1038 |
+
"description": "The ID for the entity, if any."
|
1039 |
+
},
|
1040 |
+
"etag": {
|
1041 |
+
"type": "string",
|
1042 |
+
"description": "HTTP 1.1 Entity tag for the access-control entry."
|
1043 |
+
},
|
1044 |
+
"generation": {
|
1045 |
+
"type": "string",
|
1046 |
+
"description": "The content generation of the object, if applied to an object.",
|
1047 |
+
"format": "int64"
|
1048 |
+
},
|
1049 |
+
"id": {
|
1050 |
+
"type": "string",
|
1051 |
+
"description": "The ID of the access-control entry."
|
1052 |
+
},
|
1053 |
+
"kind": {
|
1054 |
+
"type": "string",
|
1055 |
+
"description": "The kind of item this is. For object access control entries, this is always storage#objectAccessControl.",
|
1056 |
+
"default": "storage#objectAccessControl"
|
1057 |
+
},
|
1058 |
+
"object": {
|
1059 |
+
"type": "string",
|
1060 |
+
"description": "The name of the object, if applied to an object."
|
1061 |
+
},
|
1062 |
+
"projectTeam": {
|
1063 |
"type": "object",
|
1064 |
+
"description": "The project team associated with the entity, if any.",
|
1065 |
"properties": {
|
1066 |
+
"projectNumber": {
|
1067 |
+
"type": "string",
|
1068 |
+
"description": "The project number."
|
1069 |
+
},
|
1070 |
+
"team": {
|
1071 |
+
"type": "string",
|
1072 |
+
"description": "The team."
|
1073 |
+
}
|
1074 |
+
}
|
1075 |
+
},
|
1076 |
+
"role": {
|
1077 |
+
"type": "string",
|
1078 |
+
"description": "The access permission for the entity.",
|
1079 |
+
"annotations": {
|
1080 |
+
"required": [
|
1081 |
+
"storage.defaultObjectAccessControls.insert",
|
1082 |
+
"storage.objectAccessControls.insert"
|
1083 |
+
]
|
1084 |
}
|
1085 |
+
},
|
1086 |
+
"selfLink": {
|
1087 |
+
"type": "string",
|
1088 |
+
"description": "The link to this access-control entry."
|
1089 |
+
}
|
1090 |
}
|
1091 |
+
},
|
1092 |
+
"ObjectAccessControls": {
|
1093 |
+
"id": "ObjectAccessControls",
|
1094 |
+
"type": "object",
|
1095 |
+
"description": "An access-control list.",
|
1096 |
+
"properties": {
|
1097 |
+
"items": {
|
1098 |
+
"type": "array",
|
1099 |
+
"description": "The list of items.",
|
1100 |
+
"items": {
|
1101 |
+
"$ref": "ObjectAccessControl"
|
1102 |
+
}
|
1103 |
+
},
|
1104 |
+
"kind": {
|
1105 |
+
"type": "string",
|
1106 |
+
"description": "The kind of item this is. For lists of object access control entries, this is always storage#objectAccessControls.",
|
1107 |
+
"default": "storage#objectAccessControls"
|
1108 |
+
}
|
1109 |
+
}
|
1110 |
+
},
|
1111 |
+
"Objects": {
|
1112 |
+
"id": "Objects",
|
1113 |
+
"type": "object",
|
1114 |
+
"description": "A list of objects.",
|
1115 |
+
"properties": {
|
1116 |
+
"items": {
|
1117 |
+
"type": "array",
|
1118 |
+
"description": "The list of items.",
|
1119 |
+
"items": {
|
1120 |
+
"$ref": "Object"
|
1121 |
+
}
|
1122 |
+
},
|
1123 |
+
"kind": {
|
1124 |
+
"type": "string",
|
1125 |
+
"description": "The kind of item this is. For lists of objects, this is always storage#objects.",
|
1126 |
+
"default": "storage#objects"
|
1127 |
+
},
|
1128 |
+
"nextPageToken": {
|
1129 |
+
"type": "string",
|
1130 |
+
"description": "The continuation token, used to page through large result sets. Provide this value in a subsequent request to return the next page of results."
|
1131 |
+
},
|
1132 |
+
"prefixes": {
|
1133 |
+
"type": "array",
|
1134 |
+
"description": "The list of prefixes of objects matching-but-not-listed up to and including the requested delimiter.",
|
1135 |
+
"items": {
|
1136 |
+
"type": "string"
|
1137 |
+
}
|
1138 |
+
}
|
1139 |
+
}
|
1140 |
+
},
|
1141 |
+
"Policy": {
|
1142 |
+
"id": "Policy",
|
1143 |
+
"type": "object",
|
1144 |
+
"description": "A bucket/object IAM policy.",
|
1145 |
+
"properties": {
|
1146 |
+
"bindings": {
|
1147 |
+
"type": "array",
|
1148 |
+
"description": "An association between a role, which comes with a set of permissions, and members who may assume that role.",
|
1149 |
+
"items": {
|
1150 |
+
"type": "object",
|
1151 |
+
"properties": {
|
1152 |
+
"condition": {
|
1153 |
+
"$ref": "Expr",
|
1154 |
+
"description": "The condition that is associated with this binding. NOTE: an unsatisfied condition will not allow user access via current binding. Different bindings, including their conditions, are examined independently."
|
1155 |
+
},
|
1156 |
+
"members": {
|
1157 |
+
"type": "array",
|
1158 |
+
"description": "A collection of identifiers for members who may assume the provided role. Recognized identifiers are as follows: \n- allUsers — A special identifier that represents anyone on the internet; with or without a Google account. \n- allAuthenticatedUsers — A special identifier that represents anyone who is authenticated with a Google account or a service account. \n- user:emailid — An email address that represents a specific account. For example, user:alice@gmail.com or user:joe@example.com. \n- serviceAccount:emailid — An email address that represents a service account. For example, serviceAccount:my-other-app@appspot.gserviceaccount.com . \n- group:emailid — An email address that represents a Google group. For example, group:admins@example.com. \n- domain:domain — A Google Apps domain name that represents all the users of that domain. For example, domain:google.com or domain:example.com. \n- projectOwner:projectid — Owners of the given project. For example, projectOwner:my-example-project \n- projectEditor:projectid — Editors of the given project. For example, projectEditor:my-example-project \n- projectViewer:projectid — Viewers of the given project. For example, projectViewer:my-example-project",
|
1159 |
+
"items": {
|
1160 |
+
"type": "string"
|
1161 |
+
},
|
1162 |
+
"annotations": {
|
1163 |
+
"required": [
|
1164 |
+
"storage.buckets.setIamPolicy",
|
1165 |
+
"storage.objects.setIamPolicy"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1166 |
]
|
1167 |
+
}
|
1168 |
},
|
1169 |
+
"role": {
|
1170 |
+
"type": "string",
|
1171 |
+
"description": "The role to which members belong. Two types of roles are supported: new IAM roles, which grant permissions that do not map directly to those provided by ACLs, and legacy IAM roles, which do map directly to ACL permissions. All roles are of the format roles/storage.specificRole.\nThe new IAM roles are: \n- roles/storage.admin — Full control of Google Cloud Storage resources. \n- roles/storage.objectViewer — Read-Only access to Google Cloud Storage objects. \n- roles/storage.objectCreator — Access to create objects in Google Cloud Storage. \n- roles/storage.objectAdmin — Full control of Google Cloud Storage objects. The legacy IAM roles are: \n- roles/storage.legacyObjectReader — Read-only access to objects without listing. Equivalent to an ACL entry on an object with the READER role. \n- roles/storage.legacyObjectOwner — Read/write access to existing objects without listing. Equivalent to an ACL entry on an object with the OWNER role. \n- roles/storage.legacyBucketReader — Read access to buckets with object listing. Equivalent to an ACL entry on a bucket with the READER role. \n- roles/storage.legacyBucketWriter — Read access to buckets with object listing/creation/deletion. Equivalent to an ACL entry on a bucket with the WRITER role. \n- roles/storage.legacyBucketOwner — Read and write access to existing buckets with object listing/creation/deletion. Equivalent to an ACL entry on a bucket with the OWNER role.",
|
1172 |
+
"annotations": {
|
1173 |
+
"required": [
|
1174 |
+
"storage.buckets.setIamPolicy",
|
1175 |
+
"storage.objects.setIamPolicy"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1176 |
]
|
1177 |
+
}
|
1178 |
}
|
1179 |
+
}
|
1180 |
+
},
|
1181 |
+
"annotations": {
|
1182 |
+
"required": [
|
1183 |
+
"storage.buckets.setIamPolicy",
|
1184 |
+
"storage.objects.setIamPolicy"
|
1185 |
+
]
|
1186 |
}
|
1187 |
+
},
|
1188 |
+
"etag": {
|
1189 |
+
"type": "string",
|
1190 |
+
"description": "HTTP 1.1 Entity tag for the policy.",
|
1191 |
+
"format": "byte"
|
1192 |
+
},
|
1193 |
+
"kind": {
|
1194 |
+
"type": "string",
|
1195 |
+
"description": "The kind of item this is. For policies, this is always storage#policy. This field is ignored on input.",
|
1196 |
+
"default": "storage#policy"
|
1197 |
+
},
|
1198 |
+
"resourceId": {
|
1199 |
+
"type": "string",
|
1200 |
+
"description": "The ID of the resource to which this policy belongs. Will be of the form projects/_/buckets/bucket for buckets, and projects/_/buckets/bucket/objects/object for objects. A specific generation may be specified by appending #generationNumber to the end of the object name, e.g. projects/_/buckets/my-bucket/objects/data.txt#17. The current generation can be denoted with #0. This field is ignored on input."
|
1201 |
+
},
|
1202 |
+
"version": {
|
1203 |
+
"type": "integer",
|
1204 |
+
"description": "The IAM policy format version.",
|
1205 |
+
"format": "int32"
|
1206 |
+
}
|
1207 |
+
}
|
1208 |
+
},
|
1209 |
+
"RewriteResponse": {
|
1210 |
+
"id": "RewriteResponse",
|
1211 |
+
"type": "object",
|
1212 |
+
"description": "A rewrite response.",
|
1213 |
+
"properties": {
|
1214 |
+
"done": {
|
1215 |
+
"type": "boolean",
|
1216 |
+
"description": "true if the copy is finished; otherwise, false if the copy is in progress. This property is always present in the response."
|
1217 |
+
},
|
1218 |
+
"kind": {
|
1219 |
+
"type": "string",
|
1220 |
+
"description": "The kind of item this is.",
|
1221 |
+
"default": "storage#rewriteResponse"
|
1222 |
+
},
|
1223 |
+
"objectSize": {
|
1224 |
+
"type": "string",
|
1225 |
+
"description": "The total size of the object being copied in bytes. This property is always present in the response.",
|
1226 |
+
"format": "int64"
|
1227 |
+
},
|
1228 |
+
"resource": {
|
1229 |
+
"$ref": "Object",
|
1230 |
+
"description": "A resource containing the metadata for the copied-to object. This property is present in the response only when copying completes."
|
1231 |
+
},
|
1232 |
+
"rewriteToken": {
|
1233 |
+
"type": "string",
|
1234 |
+
"description": "A token to use in subsequent requests to continue copying data. This token is present in the response only when there is more data to copy."
|
1235 |
+
},
|
1236 |
+
"totalBytesRewritten": {
|
1237 |
+
"type": "string",
|
1238 |
+
"description": "The total bytes written so far, which can be used to provide a waiting user with a progress indicator. This property is always present in the response.",
|
1239 |
+
"format": "int64"
|
1240 |
+
}
|
1241 |
+
}
|
1242 |
+
},
|
1243 |
+
"ServiceAccount": {
|
1244 |
+
"id": "ServiceAccount",
|
1245 |
+
"type": "object",
|
1246 |
+
"description": "A subscription to receive Google PubSub notifications.",
|
1247 |
+
"properties": {
|
1248 |
+
"email_address": {
|
1249 |
+
"type": "string",
|
1250 |
+
"description": "The ID of the notification."
|
1251 |
+
},
|
1252 |
+
"kind": {
|
1253 |
+
"type": "string",
|
1254 |
+
"description": "The kind of item this is. For notifications, this is always storage#notification.",
|
1255 |
+
"default": "storage#serviceAccount"
|
1256 |
+
}
|
1257 |
+
}
|
1258 |
+
},
|
1259 |
+
"TestIamPermissionsResponse": {
|
1260 |
+
"id": "TestIamPermissionsResponse",
|
1261 |
+
"type": "object",
|
1262 |
+
"description": "A storage.(buckets|objects).testIamPermissions response.",
|
1263 |
+
"properties": {
|
1264 |
+
"kind": {
|
1265 |
+
"type": "string",
|
1266 |
+
"description": "The kind of item this is.",
|
1267 |
+
"default": "storage#testIamPermissionsResponse"
|
1268 |
+
},
|
1269 |
+
"permissions": {
|
1270 |
+
"type": "array",
|
1271 |
+
"description": "The permissions held by the caller. Permissions are always of the format storage.resource.capability, where resource is one of buckets or objects. The supported permissions are as follows: \n- storage.buckets.delete — Delete bucket. \n- storage.buckets.get — Read bucket metadata. \n- storage.buckets.getIamPolicy — Read bucket IAM policy. \n- storage.buckets.create — Create bucket. \n- storage.buckets.list — List buckets. \n- storage.buckets.setIamPolicy — Update bucket IAM policy. \n- storage.buckets.update — Update bucket metadata. \n- storage.objects.delete — Delete object. \n- storage.objects.get — Read object data and metadata. \n- storage.objects.getIamPolicy — Read object IAM policy. \n- storage.objects.create — Create object. \n- storage.objects.list — List objects. \n- storage.objects.setIamPolicy — Update object IAM policy. \n- storage.objects.update — Update object metadata.",
|
1272 |
+
"items": {
|
1273 |
+
"type": "string"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1274 |
}
|
1275 |
+
}
|
1276 |
+
}
|
1277 |
+
}
|
1278 |
+
},
|
1279 |
+
"resources": {
|
1280 |
+
"bucketAccessControls": {
|
1281 |
+
"methods": {
|
1282 |
+
"delete": {
|
1283 |
+
"id": "storage.bucketAccessControls.delete",
|
1284 |
+
"path": "b/{bucket}/acl/{entity}",
|
1285 |
+
"httpMethod": "DELETE",
|
1286 |
+
"description": "Permanently deletes the ACL entry for the specified entity on the specified bucket.",
|
1287 |
+
"parameters": {
|
1288 |
+
"bucket": {
|
1289 |
+
"type": "string",
|
1290 |
+
"description": "Name of a bucket.",
|
1291 |
+
"required": true,
|
1292 |
+
"location": "path"
|
1293 |
+
},
|
1294 |
+
"entity": {
|
1295 |
+
"type": "string",
|
1296 |
+
"description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
|
1297 |
+
"required": true,
|
1298 |
+
"location": "path"
|
1299 |
+
},
|
1300 |
+
"provisionalUserProject": {
|
1301 |
+
"type": "string",
|
1302 |
+
"description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
|
1303 |
+
"location": "query"
|
1304 |
+
},
|
1305 |
+
"userProject": {
|
1306 |
+
"type": "string",
|
1307 |
+
"description": "The project to be billed for this request. Required for Requester Pays buckets.",
|
1308 |
+
"location": "query"
|
1309 |
+
}
|
1310 |
+
},
|
1311 |
+
"parameterOrder": [
|
1312 |
+
"bucket",
|
1313 |
+
"entity"
|
1314 |
+
],
|
1315 |
+
"scopes": [
|
1316 |
+
"https://www.googleapis.com/auth/cloud-platform",
|
1317 |
+
"https://www.googleapis.com/auth/devstorage.full_control"
|
1318 |
+
]
|
1319 |
+
},
|
1320 |
+
"get": {
|
1321 |
+
"id": "storage.bucketAccessControls.get",
|
1322 |
+
"path": "b/{bucket}/acl/{entity}",
|
1323 |
+
"httpMethod": "GET",
|
1324 |
+
"description": "Returns the ACL entry for the specified entity on the specified bucket.",
|
1325 |
+
"parameters": {
|
1326 |
+
"bucket": {
|
1327 |
+
"type": "string",
|
1328 |
+
"description": "Name of a bucket.",
|
1329 |
+
"required": true,
|
1330 |
+
"location": "path"
|
1331 |
+
},
|
1332 |
+
"entity": {
|
1333 |
+
"type": "string",
|
1334 |
+
"description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
|
1335 |
+
"required": true,
|
1336 |
+
"location": "path"
|
1337 |
+
},
|
1338 |
+
"provisionalUserProject": {
|
1339 |
+
"type": "string",
|
1340 |
+
"description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
|
1341 |
+
"location": "query"
|
1342 |
+
},
|
1343 |
+
"userProject": {
|
1344 |
+
"type": "string",
|
1345 |
+
"description": "The project to be billed for this request. Required for Requester Pays buckets.",
|
1346 |
+
"location": "query"
|
1347 |
+
}
|
1348 |
+
},
|
1349 |
+
"parameterOrder": [
|
1350 |
+
"bucket",
|
1351 |
+
"entity"
|
1352 |
+
],
|
1353 |
+
"response": {
|
1354 |
+
"$ref": "BucketAccessControl"
|
1355 |
+
},
|
1356 |
+
"scopes": [
|
1357 |
+
"https://www.googleapis.com/auth/cloud-platform",
|
1358 |
+
"https://www.googleapis.com/auth/devstorage.full_control"
|
1359 |
+
]
|
1360 |
+
},
|
1361 |
+
"insert": {
|
1362 |
+
"id": "storage.bucketAccessControls.insert",
|
1363 |
+
"path": "b/{bucket}/acl",
|
1364 |
+
"httpMethod": "POST",
|
1365 |
+
"description": "Creates a new ACL entry on the specified bucket.",
|
1366 |
+
"parameters": {
|
1367 |
+
"bucket": {
|
1368 |
+
"type": "string",
|
1369 |
+
"description": "Name of a bucket.",
|
1370 |
+
"required": true,
|
1371 |
+
"location": "path"
|
1372 |
+
},
|
1373 |
+
"provisionalUserProject": {
|
1374 |
+
"type": "string",
|
1375 |
+
"description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
|
1376 |
+
"location": "query"
|
1377 |
+
},
|
1378 |
+
"userProject": {
|
1379 |
+
"type": "string",
|
1380 |
+
"description": "The project to be billed for this request. Required for Requester Pays buckets.",
|
1381 |
+
"location": "query"
|
1382 |
+
}
|
1383 |
+
},
|
1384 |
+
"parameterOrder": [
|
1385 |
+
"bucket"
|
1386 |
+
],
|
1387 |
+
"request": {
|
1388 |
+
"$ref": "BucketAccessControl"
|
1389 |
+
},
|
1390 |
+
"response": {
|
1391 |
+
"$ref": "BucketAccessControl"
|
1392 |
+
},
|
1393 |
+
"scopes": [
|
1394 |
+
"https://www.googleapis.com/auth/cloud-platform",
|
1395 |
+
"https://www.googleapis.com/auth/devstorage.full_control"
|
1396 |
+
]
|
1397 |
+
},
|
1398 |
+
"list": {
|
1399 |
+
"id": "storage.bucketAccessControls.list",
|
1400 |
+
"path": "b/{bucket}/acl",
|
1401 |
+
"httpMethod": "GET",
|
1402 |
+
"description": "Retrieves ACL entries on the specified bucket.",
|
1403 |
+
"parameters": {
|
1404 |
+
"bucket": {
|
1405 |
+
"type": "string",
|
1406 |
+
"description": "Name of a bucket.",
|
1407 |
+
"required": true,
|
1408 |
+
"location": "path"
|
1409 |
+
},
|
1410 |
+
"provisionalUserProject": {
|
1411 |
+
"type": "string",
|
1412 |
+
"description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
|
1413 |
+
"location": "query"
|
1414 |
+
},
|
1415 |
+
"userProject": {
|
1416 |
+
"type": "string",
|
1417 |
+
"description": "The project to be billed for this request. Required for Requester Pays buckets.",
|
1418 |
+
"location": "query"
|
1419 |
+
}
|
1420 |
+
},
|
1421 |
+
"parameterOrder": [
|
1422 |
+
"bucket"
|
1423 |
+
],
|
1424 |
+
"response": {
|
1425 |
+
"$ref": "BucketAccessControls"
|
1426 |
+
},
|
1427 |
+
"scopes": [
|
1428 |
+
"https://www.googleapis.com/auth/cloud-platform",
|
1429 |
+
"https://www.googleapis.com/auth/devstorage.full_control"
|
1430 |
+
]
|
1431 |
+
},
|
1432 |
+
"patch": {
|
1433 |
+
"id": "storage.bucketAccessControls.patch",
|
1434 |
+
"path": "b/{bucket}/acl/{entity}",
|
1435 |
+
"httpMethod": "PATCH",
|
1436 |
+
"description": "Patches an ACL entry on the specified bucket.",
|
1437 |
+
"parameters": {
|
1438 |
+
"bucket": {
|
1439 |
+
"type": "string",
|
1440 |
+
"description": "Name of a bucket.",
|
1441 |
+
"required": true,
|
1442 |
+
"location": "path"
|
1443 |
+
},
|
1444 |
+
"entity": {
|
1445 |
+
"type": "string",
|
1446 |
+
"description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
|
1447 |
+
"required": true,
|
1448 |
+
"location": "path"
|
1449 |
+
},
|
1450 |
+
"provisionalUserProject": {
|
1451 |
+
"type": "string",
|
1452 |
+
"description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
|
1453 |
+
"location": "query"
|
1454 |
+
},
|
1455 |
+
"userProject": {
|
1456 |
+
"type": "string",
|
1457 |
+
"description": "The project to be billed for this request. Required for Requester Pays buckets.",
|
1458 |
+
"location": "query"
|
1459 |
+
}
|
1460 |
+
},
|
1461 |
+
"parameterOrder": [
|
1462 |
+
"bucket",
|
1463 |
+
"entity"
|
1464 |
+
],
|
1465 |
+
"request": {
|
1466 |
+
"$ref": "BucketAccessControl"
|
1467 |
+
},
|
1468 |
+
"response": {
|
1469 |
+
"$ref": "BucketAccessControl"
|
1470 |
+
},
|
1471 |
+
"scopes": [
|
1472 |
+
"https://www.googleapis.com/auth/cloud-platform",
|
1473 |
+
"https://www.googleapis.com/auth/devstorage.full_control"
|
1474 |
+
]
|
1475 |
+
},
|
1476 |
+
"update": {
|
1477 |
+
"id": "storage.bucketAccessControls.update",
|
1478 |
+
"path": "b/{bucket}/acl/{entity}",
|
1479 |
+
"httpMethod": "PUT",
|
1480 |
+
"description": "Updates an ACL entry on the specified bucket.",
|
1481 |
+
"parameters": {
|
1482 |
+
"bucket": {
|
1483 |
+
"type": "string",
|
1484 |
+
"description": "Name of a bucket.",
|
1485 |
+
"required": true,
|
1486 |
+
"location": "path"
|
1487 |
+
},
|
1488 |
+
"entity": {
|
1489 |
+
"type": "string",
|
1490 |
+
"description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
|
1491 |
+
"required": true,
|
1492 |
+
"location": "path"
|
1493 |
+
},
|
1494 |
+
"provisionalUserProject": {
|
1495 |
+
"type": "string",
|
1496 |
+
"description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
|
1497 |
+
"location": "query"
|
1498 |
+
},
|
1499 |
+
"userProject": {
|
1500 |
+
"type": "string",
|
1501 |
+
"description": "The project to be billed for this request. Required for Requester Pays buckets.",
|
1502 |
+
"location": "query"
|
1503 |
+
}
|
1504 |
+
},
|
1505 |
+
"parameterOrder": [
|
1506 |
+
"bucket",
|
1507 |
+
"entity"
|
1508 |
+
],
|
1509 |
+
"request": {
|
1510 |
+
"$ref": "BucketAccessControl"
|
1511 |
+
},
|
1512 |
+
"response": {
|
1513 |
+
"$ref": "BucketAccessControl"
|
1514 |
+
},
|
1515 |
+
"scopes": [
|
1516 |
+
"https://www.googleapis.com/auth/cloud-platform",
|
1517 |
+
"https://www.googleapis.com/auth/devstorage.full_control"
|
1518 |
+
]
|
1519 |
+
}
|
1520 |
+
}
|
1521 |
+
},
|
1522 |
+
"buckets": {
|
1523 |
+
"methods": {
|
1524 |
+
"delete": {
|
1525 |
+
"id": "storage.buckets.delete",
|
1526 |
+
"path": "b/{bucket}",
|
1527 |
+
"httpMethod": "DELETE",
|
1528 |
+
"description": "Permanently deletes an empty bucket.",
|
1529 |
+
"parameters": {
|
1530 |
+
"bucket": {
|
1531 |
+
"type": "string",
|
1532 |
+
"description": "Name of a bucket.",
|
1533 |
+
"required": true,
|
1534 |
+
"location": "path"
|
1535 |
+
},
|
1536 |
+
"ifMetagenerationMatch": {
|
1537 |
+
"type": "string",
|
1538 |
+
"description": "If set, only deletes the bucket if its metageneration matches this value.",
|
1539 |
+
"format": "int64",
|
1540 |
+
"location": "query"
|
1541 |
+
},
|
1542 |
+
"ifMetagenerationNotMatch": {
|
1543 |
+
"type": "string",
|
1544 |
+
"description": "If set, only deletes the bucket if its metageneration does not match this value.",
|
1545 |
+
"format": "int64",
|
1546 |
+
"location": "query"
|
1547 |
+
},
|
1548 |
+
"provisionalUserProject": {
|
1549 |
+
"type": "string",
|
1550 |
+
"description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
|
1551 |
+
"location": "query"
|
1552 |
+
},
|
1553 |
+
"userProject": {
|
1554 |
+
"type": "string",
|
1555 |
+
"description": "The project to be billed for this request. Required for Requester Pays buckets.",
|
1556 |
+
"location": "query"
|
1557 |
+
}
|
1558 |
+
},
|
1559 |
+
"parameterOrder": [
|
1560 |
+
"bucket"
|
1561 |
+
],
|
1562 |
+
"scopes": [
|
1563 |
+
"https://www.googleapis.com/auth/cloud-platform",
|
1564 |
+
"https://www.googleapis.com/auth/devstorage.full_control",
|
1565 |
+
"https://www.googleapis.com/auth/devstorage.read_write"
|
1566 |
+
]
|
1567 |
+
},
|
1568 |
+
"get": {
|
1569 |
+
"id": "storage.buckets.get",
|
1570 |
+
"path": "b/{bucket}",
|
1571 |
+
"httpMethod": "GET",
|
1572 |
+
"description": "Returns metadata for the specified bucket.",
|
1573 |
+
"parameters": {
|
1574 |
+
"bucket": {
|
1575 |
+
"type": "string",
|
1576 |
+
"description": "Name of a bucket.",
|
1577 |
+
"required": true,
|
1578 |
+
"location": "path"
|
1579 |
+
},
|
1580 |
+
"ifMetagenerationMatch": {
|
1581 |
+
"type": "string",
|
1582 |
+
"description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration matches the given value.",
|
1583 |
+
"format": "int64",
|
1584 |
+
"location": "query"
|
1585 |
+
},
|
1586 |
+
"ifMetagenerationNotMatch": {
|
1587 |
+
"type": "string",
|
1588 |
+
"description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration does not match the given value.",
|
1589 |
+
"format": "int64",
|
1590 |
+
"location": "query"
|
1591 |
+
},
|
1592 |
+
"projection": {
|
1593 |
+
"type": "string",
|
1594 |
+
"description": "Set of properties to return. Defaults to noAcl.",
|
1595 |
+
"enum": [
|
1596 |
+
"full",
|
1597 |
+
"noAcl"
|
1598 |
+
],
|
1599 |
+
"enumDescriptions": [
|
1600 |
+
"Include all properties.",
|
1601 |
+
"Omit owner, acl and defaultObjectAcl properties."
|
1602 |
+
],
|
1603 |
+
"location": "query"
|
1604 |
+
},
|
1605 |
+
"provisionalUserProject": {
|
1606 |
+
"type": "string",
|
1607 |
+
"description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
|
1608 |
+
"location": "query"
|
1609 |
+
},
|
1610 |
+
"userProject": {
|
1611 |
+
"type": "string",
|
1612 |
+
"description": "The project to be billed for this request. Required for Requester Pays buckets.",
|
1613 |
+
"location": "query"
|
1614 |
+
}
|
1615 |
+
},
|
1616 |
+
"parameterOrder": [
|
1617 |
+
"bucket"
|
1618 |
+
],
|
1619 |
+
"response": {
|
1620 |
+
"$ref": "Bucket"
|
1621 |
+
},
|
1622 |
+
"scopes": [
|
1623 |
+
"https://www.googleapis.com/auth/cloud-platform",
|
1624 |
+
"https://www.googleapis.com/auth/cloud-platform.read-only",
|
1625 |
+
"https://www.googleapis.com/auth/devstorage.full_control",
|
1626 |
+
"https://www.googleapis.com/auth/devstorage.read_only",
|
1627 |
+
"https://www.googleapis.com/auth/devstorage.read_write"
|
1628 |
+
]
|
1629 |
+
},
|
1630 |
+
"getIamPolicy": {
|
1631 |
+
"id": "storage.buckets.getIamPolicy",
|
1632 |
+
"path": "b/{bucket}/iam",
|
1633 |
+
"httpMethod": "GET",
|
1634 |
+
"description": "Returns an IAM policy for the specified bucket.",
|
1635 |
+
"parameters": {
|
1636 |
+
"bucket": {
|
1637 |
+
"type": "string",
|
1638 |
+
"description": "Name of a bucket.",
|
1639 |
+
"required": true,
|
1640 |
+
"location": "path"
|
1641 |
+
},
|
1642 |
+
"optionsRequestedPolicyVersion": {
|
1643 |
+
"type": "integer",
|
1644 |
+
"description": "The IAM policy format version to be returned. If the optionsRequestedPolicyVersion is for an older version that doesn't support part of the requested IAM policy, the request fails.",
|
1645 |
+
"format": "int32",
|
1646 |
+
"minimum": "1",
|
1647 |
+
"location": "query"
|
1648 |
+
},
|
1649 |
+
"provisionalUserProject": {
|
1650 |
+
"type": "string",
|
1651 |
+
"description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
|
1652 |
+
"location": "query"
|
1653 |
+
},
|
1654 |
+
"userProject": {
|
1655 |
+
"type": "string",
|
1656 |
+
"description": "The project to be billed for this request. Required for Requester Pays buckets.",
|
1657 |
+
"location": "query"
|
1658 |
+
}
|
1659 |
+
},
|
1660 |
+
"parameterOrder": [
|
1661 |
+
"bucket"
|
1662 |
+
],
|
1663 |
+
"response": {
|
1664 |
+
"$ref": "Policy"
|
1665 |
+
},
|
1666 |
+
"scopes": [
|
1667 |
+
"https://www.googleapis.com/auth/cloud-platform",
|
1668 |
+
"https://www.googleapis.com/auth/devstorage.full_control"
|
1669 |
+
]
|
1670 |
+
},
|
1671 |
+
"insert": {
|
1672 |
+
"id": "storage.buckets.insert",
|
1673 |
+
"path": "b",
|
1674 |
+
"httpMethod": "POST",
|
1675 |
+
"description": "Creates a new bucket.",
|
1676 |
+
"parameters": {
|
1677 |
+
"predefinedAcl": {
|
1678 |
+
"type": "string",
|
1679 |
+
"description": "Apply a predefined set of access controls to this bucket.",
|
1680 |
+
"enum": [
|
1681 |
+
"authenticatedRead",
|
1682 |
+
"private",
|
1683 |
+
"projectPrivate",
|
1684 |
+
"publicRead",
|
1685 |
+
"publicReadWrite"
|
1686 |
+
],
|
1687 |
+
"enumDescriptions": [
|
1688 |
+
"Project team owners get OWNER access, and allAuthenticatedUsers get READER access.",
|
1689 |
+
"Project team owners get OWNER access.",
|
1690 |
+
"Project team members get access according to their roles.",
|
1691 |
+
"Project team owners get OWNER access, and allUsers get READER access.",
|
1692 |
+
"Project team owners get OWNER access, and allUsers get WRITER access."
|
1693 |
+
],
|
1694 |
+
"location": "query"
|
1695 |
+
},
|
1696 |
+
"predefinedDefaultObjectAcl": {
|
1697 |
+
"type": "string",
|
1698 |
+
"description": "Apply a predefined set of default object access controls to this bucket.",
|
1699 |
+
"enum": [
|
1700 |
+
"authenticatedRead",
|
1701 |
+
"bucketOwnerFullControl",
|
1702 |
+
"bucketOwnerRead",
|
1703 |
+
"private",
|
1704 |
+
"projectPrivate",
|
1705 |
+
"publicRead"
|
1706 |
+
],
|
1707 |
+
"enumDescriptions": [
|
1708 |
+
"Object owner gets OWNER access, and allAuthenticatedUsers get READER access.",
|
1709 |
+
"Object owner gets OWNER access, and project team owners get OWNER access.",
|
1710 |
+
"Object owner gets OWNER access, and project team owners get READER access.",
|
1711 |
+
"Object owner gets OWNER access.",
|
1712 |
+
"Object owner gets OWNER access, and project team members get access according to their roles.",
|
1713 |
+
"Object owner gets OWNER access, and allUsers get READER access."
|
1714 |
+
],
|
1715 |
+
"location": "query"
|
1716 |
+
},
|
1717 |
+
"project": {
|
1718 |
+
"type": "string",
|
1719 |
+
"description": "A valid API project identifier.",
|
1720 |
+
"required": true,
|
1721 |
+
"location": "query"
|
1722 |
+
},
|
1723 |
+
"projection": {
|
1724 |
+
"type": "string",
|
1725 |
+
"description": "Set of properties to return. Defaults to noAcl, unless the bucket resource specifies acl or defaultObjectAcl properties, when it defaults to full.",
|
1726 |
+
"enum": [
|
1727 |
+
"full",
|
1728 |
+
"noAcl"
|
1729 |
+
],
|
1730 |
+
"enumDescriptions": [
|
1731 |
+
"Include all properties.",
|
1732 |
+
"Omit owner, acl and defaultObjectAcl properties."
|
1733 |
+
],
|
1734 |
+
"location": "query"
|
1735 |
+
},
|
1736 |
+
"provisionalUserProject": {
|
1737 |
+
"type": "string",
|
1738 |
+
"description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
|
1739 |
+
"location": "query"
|
1740 |
+
},
|
1741 |
+
"userProject": {
|
1742 |
+
"type": "string",
|
1743 |
+
"description": "The project to be billed for this request.",
|
1744 |
+
"location": "query"
|
1745 |
+
}
|
1746 |
+
},
|
1747 |
+
"parameterOrder": [
|
1748 |
+
"project"
|
1749 |
+
],
|
1750 |
+
"request": {
|
1751 |
+
"$ref": "Bucket"
|
1752 |
+
},
|
1753 |
+
"response": {
|
1754 |
+
"$ref": "Bucket"
|
1755 |
+
},
|
1756 |
+
"scopes": [
|
1757 |
+
"https://www.googleapis.com/auth/cloud-platform",
|
1758 |
+
"https://www.googleapis.com/auth/devstorage.full_control",
|
1759 |
+
"https://www.googleapis.com/auth/devstorage.read_write"
|
1760 |
+
]
|
1761 |
+
},
|
1762 |
+
"list": {
|
1763 |
+
"id": "storage.buckets.list",
|
1764 |
+
"path": "b",
|
1765 |
+
"httpMethod": "GET",
|
1766 |
+
"description": "Retrieves a list of buckets for a given project.",
|
1767 |
+
"parameters": {
|
1768 |
+
"maxResults": {
|
1769 |
+
"type": "integer",
|
1770 |
+
"description": "Maximum number of buckets to return in a single response. The service will use this parameter or 1,000 items, whichever is smaller.",
|
1771 |
+
"default": "1000",
|
1772 |
+
"format": "uint32",
|
1773 |
+
"minimum": "0",
|
1774 |
+
"location": "query"
|
1775 |
+
},
|
1776 |
+
"pageToken": {
|
1777 |
+
"type": "string",
|
1778 |
+
"description": "A previously-returned page token representing part of the larger set of results to view.",
|
1779 |
+
"location": "query"
|
1780 |
+
},
|
1781 |
+
"prefix": {
|
1782 |
+
"type": "string",
|
1783 |
+
"description": "Filter results to buckets whose names begin with this prefix.",
|
1784 |
+
"location": "query"
|
1785 |
+
},
|
1786 |
+
"project": {
|
1787 |
+
"type": "string",
|
1788 |
+
"description": "A valid API project identifier.",
|
1789 |
+
"required": true,
|
1790 |
+
"location": "query"
|
1791 |
+
},
|
1792 |
+
"projection": {
|
1793 |
+
"type": "string",
|
1794 |
+
"description": "Set of properties to return. Defaults to noAcl.",
|
1795 |
+
"enum": [
|
1796 |
+
"full",
|
1797 |
+
"noAcl"
|
1798 |
+
],
|
1799 |
+
"enumDescriptions": [
|
1800 |
+
"Include all properties.",
|
1801 |
+
"Omit owner, acl and defaultObjectAcl properties."
|
1802 |
+
],
|
1803 |
+
"location": "query"
|
1804 |
+
},
|
1805 |
+
"provisionalUserProject": {
|
1806 |
+
"type": "string",
|
1807 |
+
"description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
|
1808 |
+
"location": "query"
|
1809 |
+
},
|
1810 |
+
"userProject": {
|
1811 |
+
"type": "string",
|
1812 |
+
"description": "The project to be billed for this request.",
|
1813 |
+
"location": "query"
|
1814 |
+
}
|
1815 |
+
},
|
1816 |
+
"parameterOrder": [
|
1817 |
+
"project"
|
1818 |
+
],
|
1819 |
+
"response": {
|
1820 |
+
"$ref": "Buckets"
|
1821 |
+
},
|
1822 |
+
"scopes": [
|
1823 |
+
"https://www.googleapis.com/auth/cloud-platform",
|
1824 |
+
"https://www.googleapis.com/auth/cloud-platform.read-only",
|
1825 |
+
"https://www.googleapis.com/auth/devstorage.full_control",
|
1826 |
+
"https://www.googleapis.com/auth/devstorage.read_only",
|
1827 |
+
"https://www.googleapis.com/auth/devstorage.read_write"
|
1828 |
+
]
|
1829 |
+
},
|
1830 |
+
"lockRetentionPolicy": {
|
1831 |
+
"id": "storage.buckets.lockRetentionPolicy",
|
1832 |
+
"path": "b/{bucket}/lockRetentionPolicy",
|
1833 |
+
"httpMethod": "POST",
|
1834 |
+
"description": "Locks retention policy on a bucket.",
|
1835 |
+
"parameters": {
|
1836 |
+
"bucket": {
|
1837 |
+
"type": "string",
|
1838 |
+
"description": "Name of a bucket.",
|
1839 |
+
"required": true,
|
1840 |
+
"location": "path"
|
1841 |
+
},
|
1842 |
+
"ifMetagenerationMatch": {
|
1843 |
+
"type": "string",
|
1844 |
+
"description": "Makes the operation conditional on whether bucket's current metageneration matches the given value.",
|
1845 |
+
"required": true,
|
1846 |
+
"format": "int64",
|
1847 |
+
"location": "query"
|
1848 |
+
},
|
1849 |
+
"provisionalUserProject": {
|
1850 |
+
"type": "string",
|
1851 |
+
"description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
|
1852 |
+
"location": "query"
|
1853 |
+
},
|
1854 |
+
"userProject": {
|
1855 |
+
"type": "string",
|
1856 |
+
"description": "The project to be billed for this request. Required for Requester Pays buckets.",
|
1857 |
+
"location": "query"
|
1858 |
+
}
|
1859 |
+
},
|
1860 |
+
"parameterOrder": [
|
1861 |
+
"bucket",
|
1862 |
+
"ifMetagenerationMatch"
|
1863 |
+
],
|
1864 |
+
"response": {
|
1865 |
+
"$ref": "Bucket"
|
1866 |
+
},
|
1867 |
+
"scopes": [
|
1868 |
+
"https://www.googleapis.com/auth/cloud-platform",
|
1869 |
+
"https://www.googleapis.com/auth/devstorage.full_control",
|
1870 |
+
"https://www.googleapis.com/auth/devstorage.read_write"
|
1871 |
+
]
|
1872 |
+
},
|
1873 |
+
"patch": {
|
1874 |
+
"id": "storage.buckets.patch",
|
1875 |
+
"path": "b/{bucket}",
|
1876 |
+
"httpMethod": "PATCH",
|
1877 |
+
"description": "Patches a bucket. Changes to the bucket will be readable immediately after writing, but configuration changes may take time to propagate.",
|
1878 |
+
"parameters": {
|
1879 |
+
"bucket": {
|
1880 |
+
"type": "string",
|
1881 |
+
"description": "Name of a bucket.",
|
1882 |
+
"required": true,
|
1883 |
+
"location": "path"
|
1884 |
+
},
|
1885 |
+
"ifMetagenerationMatch": {
|
1886 |
+
"type": "string",
|
1887 |
+
"description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration matches the given value.",
|
1888 |
+
"format": "int64",
|
1889 |
+
"location": "query"
|
1890 |
+
},
|
1891 |
+
"ifMetagenerationNotMatch": {
|
1892 |
+
"type": "string",
|
1893 |
+
"description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration does not match the given value.",
|
1894 |
+
"format": "int64",
|
1895 |
+
"location": "query"
|
1896 |
+
},
|
1897 |
+
"predefinedAcl": {
|
1898 |
+
"type": "string",
|
1899 |
+
"description": "Apply a predefined set of access controls to this bucket.",
|
1900 |
+
"enum": [
|
1901 |
+
"authenticatedRead",
|
1902 |
+
"private",
|
1903 |
+
"projectPrivate",
|
1904 |
+
"publicRead",
|
1905 |
+
"publicReadWrite"
|
1906 |
+
],
|
1907 |
+
"enumDescriptions": [
|
1908 |
+
"Project team owners get OWNER access, and allAuthenticatedUsers get READER access.",
|
1909 |
+
"Project team owners get OWNER access.",
|
1910 |
+
"Project team members get access according to their roles.",
|
1911 |
+
"Project team owners get OWNER access, and allUsers get READER access.",
|
1912 |
+
"Project team owners get OWNER access, and allUsers get WRITER access."
|
1913 |
+
],
|
1914 |
+
"location": "query"
|
1915 |
+
},
|
1916 |
+
"predefinedDefaultObjectAcl": {
|
1917 |
+
"type": "string",
|
1918 |
+
"description": "Apply a predefined set of default object access controls to this bucket.",
|
1919 |
+
"enum": [
|
1920 |
+
"authenticatedRead",
|
1921 |
+
"bucketOwnerFullControl",
|
1922 |
+
"bucketOwnerRead",
|
1923 |
+
"private",
|
1924 |
+
"projectPrivate",
|
1925 |
+
"publicRead"
|
1926 |
+
],
|
1927 |
+
"enumDescriptions": [
|
1928 |
+
"Object owner gets OWNER access, and allAuthenticatedUsers get READER access.",
|
1929 |
+
"Object owner gets OWNER access, and project team owners get OWNER access.",
|
1930 |
+
"Object owner gets OWNER access, and project team owners get READER access.",
|
1931 |
+
"Object owner gets OWNER access.",
|
1932 |
+
"Object owner gets OWNER access, and project team members get access according to their roles.",
|
1933 |
+
"Object owner gets OWNER access, and allUsers get READER access."
|
1934 |
+
],
|
1935 |
+
"location": "query"
|
1936 |
+
},
|
1937 |
+
"projection": {
|
1938 |
+
"type": "string",
|
1939 |
+
"description": "Set of properties to return. Defaults to full.",
|
1940 |
+
"enum": [
|
1941 |
+
"full",
|
1942 |
+
"noAcl"
|
1943 |
+
],
|
1944 |
+
"enumDescriptions": [
|
1945 |
+
"Include all properties.",
|
1946 |
+
"Omit owner, acl and defaultObjectAcl properties."
|
1947 |
+
],
|
1948 |
+
"location": "query"
|
1949 |
+
},
|
1950 |
+
"provisionalUserProject": {
|
1951 |
+
"type": "string",
|
1952 |
+
"description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
|
1953 |
+
"location": "query"
|
1954 |
+
},
|
1955 |
+
"userProject": {
|
1956 |
+
"type": "string",
|
1957 |
+
"description": "The project to be billed for this request. Required for Requester Pays buckets.",
|
1958 |
+
"location": "query"
|
1959 |
+
}
|
1960 |
+
},
|
1961 |
+
"parameterOrder": [
|
1962 |
+
"bucket"
|
1963 |
+
],
|
1964 |
+
"request": {
|
1965 |
+
"$ref": "Bucket"
|
1966 |
+
},
|
1967 |
+
"response": {
|
1968 |
+
"$ref": "Bucket"
|
1969 |
+
},
|
1970 |
+
"scopes": [
|
1971 |
+
"https://www.googleapis.com/auth/cloud-platform",
|
1972 |
+
"https://www.googleapis.com/auth/devstorage.full_control"
|
1973 |
+
]
|
1974 |
+
},
|
1975 |
+
"setIamPolicy": {
|
1976 |
+
"id": "storage.buckets.setIamPolicy",
|
1977 |
+
"path": "b/{bucket}/iam",
|
1978 |
+
"httpMethod": "PUT",
|
1979 |
+
"description": "Updates an IAM policy for the specified bucket.",
|
1980 |
+
"parameters": {
|
1981 |
+
"bucket": {
|
1982 |
+
"type": "string",
|
1983 |
+
"description": "Name of a bucket.",
|
1984 |
+
"required": true,
|
1985 |
+
"location": "path"
|
1986 |
+
},
|
1987 |
+
"provisionalUserProject": {
|
1988 |
+
"type": "string",
|
1989 |
+
"description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
|
1990 |
+
"location": "query"
|
1991 |
+
},
|
1992 |
+
"userProject": {
|
1993 |
+
"type": "string",
|
1994 |
+
"description": "The project to be billed for this request. Required for Requester Pays buckets.",
|
1995 |
+
"location": "query"
|
1996 |
+
}
|
1997 |
+
},
|
1998 |
+
"parameterOrder": [
|
1999 |
+
"bucket"
|
2000 |
+
],
|
2001 |
+
"request": {
|
2002 |
+
"$ref": "Policy"
|
2003 |
+
},
|
2004 |
+
"response": {
|
2005 |
+
"$ref": "Policy"
|
2006 |
+
},
|
2007 |
+
"scopes": [
|
2008 |
+
"https://www.googleapis.com/auth/cloud-platform",
|
2009 |
+
"https://www.googleapis.com/auth/devstorage.full_control"
|
2010 |
+
]
|
2011 |
+
},
|
2012 |
+
"testIamPermissions": {
|
2013 |
+
"id": "storage.buckets.testIamPermissions",
|
2014 |
+
"path": "b/{bucket}/iam/testPermissions",
|
2015 |
+
"httpMethod": "GET",
|
2016 |
+
"description": "Tests a set of permissions on the given bucket to see which, if any, are held by the caller.",
|
2017 |
+
"parameters": {
|
2018 |
+
"bucket": {
|
2019 |
+
"type": "string",
|
2020 |
+
"description": "Name of a bucket.",
|
2021 |
+
"required": true,
|
2022 |
+
"location": "path"
|
2023 |
+
},
|
2024 |
+
"permissions": {
|
2025 |
+
"type": "string",
|
2026 |
+
"description": "Permissions to test.",
|
2027 |
+
"required": true,
|
2028 |
+
"repeated": true,
|
2029 |
+
"location": "query"
|
2030 |
+
},
|
2031 |
+
"provisionalUserProject": {
|
2032 |
+
"type": "string",
|
2033 |
+
"description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
|
2034 |
+
"location": "query"
|
2035 |
+
},
|
2036 |
+
"userProject": {
|
2037 |
+
"type": "string",
|
2038 |
+
"description": "The project to be billed for this request. Required for Requester Pays buckets.",
|
2039 |
+
"location": "query"
|
2040 |
+
}
|
2041 |
+
},
|
2042 |
+
"parameterOrder": [
|
2043 |
+
"bucket",
|
2044 |
+
"permissions"
|
2045 |
+
],
|
2046 |
+
"response": {
|
2047 |
+
"$ref": "TestIamPermissionsResponse"
|
2048 |
+
},
|
2049 |
+
"scopes": [
|
2050 |
+
"https://www.googleapis.com/auth/cloud-platform",
|
2051 |
+
"https://www.googleapis.com/auth/cloud-platform.read-only",
|
2052 |
+
"https://www.googleapis.com/auth/devstorage.full_control",
|
2053 |
+
"https://www.googleapis.com/auth/devstorage.read_only",
|
2054 |
+
"https://www.googleapis.com/auth/devstorage.read_write"
|
2055 |
+
]
|
2056 |
+
},
|
2057 |
+
"update": {
|
2058 |
+
"id": "storage.buckets.update",
|
2059 |
+
"path": "b/{bucket}",
|
2060 |
+
"httpMethod": "PUT",
|
2061 |
+
"description": "Updates a bucket. Changes to the bucket will be readable immediately after writing, but configuration changes may take time to propagate.",
|
2062 |
+
"parameters": {
|
2063 |
+
"bucket": {
|
2064 |
+
"type": "string",
|
2065 |
+
"description": "Name of a bucket.",
|
2066 |
+
"required": true,
|
2067 |
+
"location": "path"
|
2068 |
+
},
|
2069 |
+
"ifMetagenerationMatch": {
|
2070 |
+
"type": "string",
|
2071 |
+
"description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration matches the given value.",
|
2072 |
+
"format": "int64",
|
2073 |
+
"location": "query"
|
2074 |
+
},
|
2075 |
+
"ifMetagenerationNotMatch": {
|
2076 |
+
"type": "string",
|
2077 |
+
"description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration does not match the given value.",
|
2078 |
+
"format": "int64",
|
2079 |
+
"location": "query"
|
2080 |
+
},
|
2081 |
+
"predefinedAcl": {
|
2082 |
+
"type": "string",
|
2083 |
+
"description": "Apply a predefined set of access controls to this bucket.",
|
2084 |
+
"enum": [
|
2085 |
+
"authenticatedRead",
|
2086 |
+
"private",
|
2087 |
+
"projectPrivate",
|
2088 |
+
"publicRead",
|
2089 |
+
"publicReadWrite"
|
2090 |
+
],
|
2091 |
+
"enumDescriptions": [
|
2092 |
+
"Project team owners get OWNER access, and allAuthenticatedUsers get READER access.",
|
2093 |
+
"Project team owners get OWNER access.",
|
2094 |
+
"Project team members get access according to their roles.",
|
2095 |
+
"Project team owners get OWNER access, and allUsers get READER access.",
|
2096 |
+
"Project team owners get OWNER access, and allUsers get WRITER access."
|
2097 |
+
],
|
2098 |
+
"location": "query"
|
2099 |
+
},
|
2100 |
+
"predefinedDefaultObjectAcl": {
|
2101 |
+
"type": "string",
|
2102 |
+
"description": "Apply a predefined set of default object access controls to this bucket.",
|
2103 |
+
"enum": [
|
2104 |
+
"authenticatedRead",
|
2105 |
+
"bucketOwnerFullControl",
|
2106 |
+
"bucketOwnerRead",
|
2107 |
+
"private",
|
2108 |
+
"projectPrivate",
|
2109 |
+
"publicRead"
|
2110 |
+
],
|
2111 |
+
"enumDescriptions": [
|
2112 |
+
"Object owner gets OWNER access, and allAuthenticatedUsers get READER access.",
|
2113 |
+
"Object owner gets OWNER access, and project team owners get OWNER access.",
|
2114 |
+
"Object owner gets OWNER access, and project team owners get READER access.",
|
2115 |
+
"Object owner gets OWNER access.",
|
2116 |
+
"Object owner gets OWNER access, and project team members get access according to their roles.",
|
2117 |
+
"Object owner gets OWNER access, and allUsers get READER access."
|
2118 |
+
],
|
2119 |
+
"location": "query"
|
2120 |
+
},
|
2121 |
+
"projection": {
|
2122 |
+
"type": "string",
|
2123 |
+
"description": "Set of properties to return. Defaults to full.",
|
2124 |
+
"enum": [
|
2125 |
+
"full",
|
2126 |
+
"noAcl"
|
2127 |
+
],
|
2128 |
+
"enumDescriptions": [
|
2129 |
+
"Include all properties.",
|
2130 |
+
"Omit owner, acl and defaultObjectAcl properties."
|
2131 |
+
],
|
2132 |
+
"location": "query"
|
2133 |
+
},
|
2134 |
+
"provisionalUserProject": {
|
2135 |
+
"type": "string",
|
2136 |
+
"description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
|
2137 |
+
"location": "query"
|
2138 |
+
},
|
2139 |
+
"userProject": {
|
2140 |
+
"type": "string",
|
2141 |
+
"description": "The project to be billed for this request. Required for Requester Pays buckets.",
|
2142 |
+
"location": "query"
|
2143 |
+
}
|
2144 |
+
},
|
2145 |
+
"parameterOrder": [
|
2146 |
+
"bucket"
|
2147 |
+
],
|
2148 |
+
"request": {
|
2149 |
+
"$ref": "Bucket"
|
2150 |
+
},
|
2151 |
+
"response": {
|
2152 |
+
"$ref": "Bucket"
|
2153 |
+
},
|
2154 |
+
"scopes": [
|
2155 |
+
"https://www.googleapis.com/auth/cloud-platform",
|
2156 |
+
"https://www.googleapis.com/auth/devstorage.full_control"
|
2157 |
+
]
|
2158 |
+
}
|
2159 |
+
}
|
2160 |
+
},
|
2161 |
+
"channels": {
|
2162 |
+
"methods": {
|
2163 |
+
"stop": {
|
2164 |
+
"id": "storage.channels.stop",
|
2165 |
+
"path": "channels/stop",
|
2166 |
+
"httpMethod": "POST",
|
2167 |
+
"description": "Stop watching resources through this channel",
|
2168 |
+
"request": {
|
2169 |
+
"$ref": "Channel",
|
2170 |
+
"parameterName": "resource"
|
2171 |
+
},
|
2172 |
+
"scopes": [
|
2173 |
+
"https://www.googleapis.com/auth/cloud-platform",
|
2174 |
+
"https://www.googleapis.com/auth/cloud-platform.read-only",
|
2175 |
+
"https://www.googleapis.com/auth/devstorage.full_control",
|
2176 |
+
"https://www.googleapis.com/auth/devstorage.read_only",
|
2177 |
+
"https://www.googleapis.com/auth/devstorage.read_write"
|
2178 |
+
]
|
2179 |
+
}
|
2180 |
+
}
|
2181 |
+
},
|
2182 |
+
"defaultObjectAccessControls": {
|
2183 |
+
"methods": {
|
2184 |
+
"delete": {
|
2185 |
+
"id": "storage.defaultObjectAccessControls.delete",
|
2186 |
+
"path": "b/{bucket}/defaultObjectAcl/{entity}",
|
2187 |
+
"httpMethod": "DELETE",
|
2188 |
+
"description": "Permanently deletes the default object ACL entry for the specified entity on the specified bucket.",
|
2189 |
+
"parameters": {
|
2190 |
+
"bucket": {
|
2191 |
+
"type": "string",
|
2192 |
+
"description": "Name of a bucket.",
|
2193 |
+
"required": true,
|
2194 |
+
"location": "path"
|
2195 |
+
},
|
2196 |
+
"entity": {
|
2197 |
+
"type": "string",
|
2198 |
+
"description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
|
2199 |
+
"required": true,
|
2200 |
+
"location": "path"
|
2201 |
+
},
|
2202 |
+
"provisionalUserProject": {
|
2203 |
+
"type": "string",
|
2204 |
+
"description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
|
2205 |
+
"location": "query"
|
2206 |
+
},
|
2207 |
+
"userProject": {
|
2208 |
+
"type": "string",
|
2209 |
+
"description": "The project to be billed for this request. Required for Requester Pays buckets.",
|
2210 |
+
"location": "query"
|
2211 |
+
}
|
2212 |
+
},
|
2213 |
+
"parameterOrder": [
|
2214 |
+
"bucket",
|
2215 |
+
"entity"
|
2216 |
+
],
|
2217 |
+
"scopes": [
|
2218 |
+
"https://www.googleapis.com/auth/cloud-platform",
|
2219 |
+
"https://www.googleapis.com/auth/devstorage.full_control"
|
2220 |
+
]
|
2221 |
+
},
|
2222 |
+
"get": {
|
2223 |
+
"id": "storage.defaultObjectAccessControls.get",
|
2224 |
+
"path": "b/{bucket}/defaultObjectAcl/{entity}",
|
2225 |
+
"httpMethod": "GET",
|
2226 |
+
"description": "Returns the default object ACL entry for the specified entity on the specified bucket.",
|
2227 |
+
"parameters": {
|
2228 |
+
"bucket": {
|
2229 |
+
"type": "string",
|
2230 |
+
"description": "Name of a bucket.",
|
2231 |
+
"required": true,
|
2232 |
+
"location": "path"
|
2233 |
+
},
|
2234 |
+
"entity": {
|
2235 |
+
"type": "string",
|
2236 |
+
"description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
|
2237 |
+
"required": true,
|
2238 |
+
"location": "path"
|
2239 |
+
},
|
2240 |
+
"provisionalUserProject": {
|
2241 |
+
"type": "string",
|
2242 |
+
"description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
|
2243 |
+
"location": "query"
|
2244 |
+
},
|
2245 |
+
"userProject": {
|
2246 |
+
"type": "string",
|
2247 |
+
"description": "The project to be billed for this request. Required for Requester Pays buckets.",
|
2248 |
+
"location": "query"
|
2249 |
+
}
|
2250 |
+
},
|
2251 |
+
"parameterOrder": [
|
2252 |
+
"bucket",
|
2253 |
+
"entity"
|
2254 |
+
],
|
2255 |
+
"response": {
|
2256 |
+
"$ref": "ObjectAccessControl"
|
2257 |
+
},
|
2258 |
+
"scopes": [
|
2259 |
+
"https://www.googleapis.com/auth/cloud-platform",
|
2260 |
+
"https://www.googleapis.com/auth/devstorage.full_control"
|
2261 |
+
]
|
2262 |
+
},
|
2263 |
+
"insert": {
|
2264 |
+
"id": "storage.defaultObjectAccessControls.insert",
|
2265 |
+
"path": "b/{bucket}/defaultObjectAcl",
|
2266 |
+
"httpMethod": "POST",
|
2267 |
+
"description": "Creates a new default object ACL entry on the specified bucket.",
|
2268 |
+
"parameters": {
|
2269 |
+
"bucket": {
|
2270 |
+
"type": "string",
|
2271 |
+
"description": "Name of a bucket.",
|
2272 |
+
"required": true,
|
2273 |
+
"location": "path"
|
2274 |
+
},
|
2275 |
+
"provisionalUserProject": {
|
2276 |
+
"type": "string",
|
2277 |
+
"description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
|
2278 |
+
"location": "query"
|
2279 |
+
},
|
2280 |
+
"userProject": {
|
2281 |
+
"type": "string",
|
2282 |
+
"description": "The project to be billed for this request. Required for Requester Pays buckets.",
|
2283 |
+
"location": "query"
|
2284 |
+
}
|
2285 |
+
},
|
2286 |
+
"parameterOrder": [
|
2287 |
+
"bucket"
|
2288 |
+
],
|
2289 |
+
"request": {
|
2290 |
+
"$ref": "ObjectAccessControl"
|
2291 |
+
},
|
2292 |
+
"response": {
|
2293 |
+
"$ref": "ObjectAccessControl"
|
2294 |
+
},
|
2295 |
+
"scopes": [
|
2296 |
+
"https://www.googleapis.com/auth/cloud-platform",
|
2297 |
+
"https://www.googleapis.com/auth/devstorage.full_control"
|
2298 |
+
]
|
2299 |
+
},
|
2300 |
+
"list": {
|
2301 |
+
"id": "storage.defaultObjectAccessControls.list",
|
2302 |
+
"path": "b/{bucket}/defaultObjectAcl",
|
2303 |
+
"httpMethod": "GET",
|
2304 |
+
"description": "Retrieves default object ACL entries on the specified bucket.",
|
2305 |
+
"parameters": {
|
2306 |
+
"bucket": {
|
2307 |
+
"type": "string",
|
2308 |
+
"description": "Name of a bucket.",
|
2309 |
+
"required": true,
|
2310 |
+
"location": "path"
|
2311 |
+
},
|
2312 |
+
"ifMetagenerationMatch": {
|
2313 |
+
"type": "string",
|
2314 |
+
"description": "If present, only return default ACL listing if the bucket's current metageneration matches this value.",
|
2315 |
+
"format": "int64",
|
2316 |
+
"location": "query"
|
2317 |
+
},
|
2318 |
+
"ifMetagenerationNotMatch": {
|
2319 |
+
"type": "string",
|
2320 |
+
"description": "If present, only return default ACL listing if the bucket's current metageneration does not match the given value.",
|
2321 |
+
"format": "int64",
|
2322 |
+
"location": "query"
|
2323 |
+
},
|
2324 |
+
"provisionalUserProject": {
|
2325 |
+
"type": "string",
|
2326 |
+
"description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
|
2327 |
+
"location": "query"
|
2328 |
+
},
|
2329 |
+
"userProject": {
|
2330 |
+
"type": "string",
|
2331 |
+
"description": "The project to be billed for this request. Required for Requester Pays buckets.",
|
2332 |
+
"location": "query"
|
2333 |
+
}
|
2334 |
+
},
|
2335 |
+
"parameterOrder": [
|
2336 |
+
"bucket"
|
2337 |
+
],
|
2338 |
+
"response": {
|
2339 |
+
"$ref": "ObjectAccessControls"
|
2340 |
+
},
|
2341 |
+
"scopes": [
|
2342 |
+
"https://www.googleapis.com/auth/cloud-platform",
|
2343 |
+
"https://www.googleapis.com/auth/devstorage.full_control"
|
2344 |
+
]
|
2345 |
+
},
|
2346 |
+
"patch": {
|
2347 |
+
"id": "storage.defaultObjectAccessControls.patch",
|
2348 |
+
"path": "b/{bucket}/defaultObjectAcl/{entity}",
|
2349 |
+
"httpMethod": "PATCH",
|
2350 |
+
"description": "Patches a default object ACL entry on the specified bucket.",
|
2351 |
+
"parameters": {
|
2352 |
+
"bucket": {
|
2353 |
+
"type": "string",
|
2354 |
+
"description": "Name of a bucket.",
|
2355 |
+
"required": true,
|
2356 |
+
"location": "path"
|
2357 |
+
},
|
2358 |
+
"entity": {
|
2359 |
+
"type": "string",
|
2360 |
+
"description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
|
2361 |
+
"required": true,
|
2362 |
+
"location": "path"
|
2363 |
+
},
|
2364 |
+
"provisionalUserProject": {
|
2365 |
+
"type": "string",
|
2366 |
+
"description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
|
2367 |
+
"location": "query"
|
2368 |
+
},
|
2369 |
+
"userProject": {
|
2370 |
+
"type": "string",
|
2371 |
+
"description": "The project to be billed for this request. Required for Requester Pays buckets.",
|
2372 |
+
"location": "query"
|
2373 |
+
}
|
2374 |
+
},
|
2375 |
+
"parameterOrder": [
|
2376 |
+
"bucket",
|
2377 |
+
"entity"
|
2378 |
+
],
|
2379 |
+
"request": {
|
2380 |
+
"$ref": "ObjectAccessControl"
|
2381 |
+
},
|
2382 |
+
"response": {
|
2383 |
+
"$ref": "ObjectAccessControl"
|
2384 |
+
},
|
2385 |
+
"scopes": [
|
2386 |
+
"https://www.googleapis.com/auth/cloud-platform",
|
2387 |
+
"https://www.googleapis.com/auth/devstorage.full_control"
|
2388 |
+
]
|
2389 |
+
},
|
2390 |
+
"update": {
|
2391 |
+
"id": "storage.defaultObjectAccessControls.update",
|
2392 |
+
"path": "b/{bucket}/defaultObjectAcl/{entity}",
|
2393 |
+
"httpMethod": "PUT",
|
2394 |
+
"description": "Updates a default object ACL entry on the specified bucket.",
|
2395 |
+
"parameters": {
|
2396 |
+
"bucket": {
|
2397 |
+
"type": "string",
|
2398 |
+
"description": "Name of a bucket.",
|
2399 |
+
"required": true,
|
2400 |
+
"location": "path"
|
2401 |
+
},
|
2402 |
+
"entity": {
|
2403 |
+
"type": "string",
|
2404 |
+
"description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
|
2405 |
+
"required": true,
|
2406 |
+
"location": "path"
|
2407 |
+
},
|
2408 |
+
"provisionalUserProject": {
|
2409 |
+
"type": "string",
|
2410 |
+
"description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
|
2411 |
+
"location": "query"
|
2412 |
+
},
|
2413 |
+
"userProject": {
|
2414 |
+
"type": "string",
|
2415 |
+
"description": "The project to be billed for this request. Required for Requester Pays buckets.",
|
2416 |
+
"location": "query"
|
2417 |
+
}
|
2418 |
+
},
|
2419 |
+
"parameterOrder": [
|
2420 |
+
"bucket",
|
2421 |
+
"entity"
|
2422 |
+
],
|
2423 |
+
"request": {
|
2424 |
+
"$ref": "ObjectAccessControl"
|
2425 |
+
},
|
2426 |
+
"response": {
|
2427 |
+
"$ref": "ObjectAccessControl"
|
2428 |
+
},
|
2429 |
+
"scopes": [
|
2430 |
+
"https://www.googleapis.com/auth/cloud-platform",
|
2431 |
+
"https://www.googleapis.com/auth/devstorage.full_control"
|
2432 |
+
]
|
2433 |
+
}
|
2434 |
+
}
|
2435 |
+
},
|
2436 |
+
"notifications": {
|
2437 |
+
"methods": {
|
2438 |
+
"delete": {
|
2439 |
+
"id": "storage.notifications.delete",
|
2440 |
+
"path": "b/{bucket}/notificationConfigs/{notification}",
|
2441 |
+
"httpMethod": "DELETE",
|
2442 |
+
"description": "Permanently deletes a notification subscription.",
|
2443 |
+
"parameters": {
|
2444 |
+
"bucket": {
|
2445 |
+
"type": "string",
|
2446 |
+
"description": "The parent bucket of the notification.",
|
2447 |
+
"required": true,
|
2448 |
+
"location": "path"
|
2449 |
+
},
|
2450 |
+
"notification": {
|
2451 |
+
"type": "string",
|
2452 |
+
"description": "ID of the notification to delete.",
|
2453 |
+
"required": true,
|
2454 |
+
"location": "path"
|
2455 |
+
},
|
2456 |
+
"provisionalUserProject": {
|
2457 |
+
"type": "string",
|
2458 |
+
"description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
|
2459 |
+
"location": "query"
|
2460 |
+
},
|
2461 |
+
"userProject": {
|
2462 |
+
"type": "string",
|
2463 |
+
"description": "The project to be billed for this request. Required for Requester Pays buckets.",
|
2464 |
+
"location": "query"
|
2465 |
+
}
|
2466 |
+
},
|
2467 |
+
"parameterOrder": [
|
2468 |
+
"bucket",
|
2469 |
+
"notification"
|
2470 |
+
],
|
2471 |
+
"scopes": [
|
2472 |
+
"https://www.googleapis.com/auth/cloud-platform",
|
2473 |
+
"https://www.googleapis.com/auth/devstorage.full_control",
|
2474 |
+
"https://www.googleapis.com/auth/devstorage.read_write"
|
2475 |
+
]
|
2476 |
+
},
|
2477 |
+
"get": {
|
2478 |
+
"id": "storage.notifications.get",
|
2479 |
+
"path": "b/{bucket}/notificationConfigs/{notification}",
|
2480 |
+
"httpMethod": "GET",
|
2481 |
+
"description": "View a notification configuration.",
|
2482 |
+
"parameters": {
|
2483 |
+
"bucket": {
|
2484 |
+
"type": "string",
|
2485 |
+
"description": "The parent bucket of the notification.",
|
2486 |
+
"required": true,
|
2487 |
+
"location": "path"
|
2488 |
+
},
|
2489 |
+
"notification": {
|
2490 |
+
"type": "string",
|
2491 |
+
"description": "Notification ID",
|
2492 |
+
"required": true,
|
2493 |
+
"location": "path"
|
2494 |
+
},
|
2495 |
+
"provisionalUserProject": {
|
2496 |
+
"type": "string",
|
2497 |
+
"description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
|
2498 |
+
"location": "query"
|
2499 |
+
},
|
2500 |
+
"userProject": {
|
2501 |
+
"type": "string",
|
2502 |
+
"description": "The project to be billed for this request. Required for Requester Pays buckets.",
|
2503 |
+
"location": "query"
|
2504 |
+
}
|
2505 |
+
},
|
2506 |
+
"parameterOrder": [
|
2507 |
+
"bucket",
|
2508 |
+
"notification"
|
2509 |
+
],
|
2510 |
+
"response": {
|
2511 |
+
"$ref": "Notification"
|
2512 |
+
},
|
2513 |
+
"scopes": [
|
2514 |
+
"https://www.googleapis.com/auth/cloud-platform",
|
2515 |
+
"https://www.googleapis.com/auth/cloud-platform.read-only",
|
2516 |
+
"https://www.googleapis.com/auth/devstorage.full_control",
|
2517 |
+
"https://www.googleapis.com/auth/devstorage.read_only",
|
2518 |
+
"https://www.googleapis.com/auth/devstorage.read_write"
|
2519 |
+
]
|
2520 |
+
},
|
2521 |
+
"insert": {
|
2522 |
+
"id": "storage.notifications.insert",
|
2523 |
+
"path": "b/{bucket}/notificationConfigs",
|
2524 |
+
"httpMethod": "POST",
|
2525 |
+
"description": "Creates a notification subscription for a given bucket.",
|
2526 |
+
"parameters": {
|
2527 |
+
"bucket": {
|
2528 |
+
"type": "string",
|
2529 |
+
"description": "The parent bucket of the notification.",
|
2530 |
+
"required": true,
|
2531 |
+
"location": "path"
|
2532 |
+
},
|
2533 |
+
"provisionalUserProject": {
|
2534 |
+
"type": "string",
|
2535 |
+
"description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
|
2536 |
+
"location": "query"
|
2537 |
+
},
|
2538 |
+
"userProject": {
|
2539 |
+
"type": "string",
|
2540 |
+
"description": "The project to be billed for this request. Required for Requester Pays buckets.",
|
2541 |
+
"location": "query"
|
2542 |
+
}
|
2543 |
+
},
|
2544 |
+
"parameterOrder": [
|
2545 |
+
"bucket"
|
2546 |
+
],
|
2547 |
+
"request": {
|
2548 |
+
"$ref": "Notification"
|
2549 |
+
},
|
2550 |
+
"response": {
|
2551 |
+
"$ref": "Notification"
|
2552 |
+
},
|
2553 |
+
"scopes": [
|
2554 |
+
"https://www.googleapis.com/auth/cloud-platform",
|
2555 |
+
"https://www.googleapis.com/auth/devstorage.full_control",
|
2556 |
+
"https://www.googleapis.com/auth/devstorage.read_write"
|
2557 |
+
]
|
2558 |
+
},
|
2559 |
+
"list": {
|
2560 |
+
"id": "storage.notifications.list",
|
2561 |
+
"path": "b/{bucket}/notificationConfigs",
|
2562 |
+
"httpMethod": "GET",
|
2563 |
+
"description": "Retrieves a list of notification subscriptions for a given bucket.",
|
2564 |
+
"parameters": {
|
2565 |
+
"bucket": {
|
2566 |
+
"type": "string",
|
2567 |
+
"description": "Name of a Google Cloud Storage bucket.",
|
2568 |
+
"required": true,
|
2569 |
+
"location": "path"
|
2570 |
+
},
|
2571 |
+
"provisionalUserProject": {
|
2572 |
+
"type": "string",
|
2573 |
+
"description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
|
2574 |
+
"location": "query"
|
2575 |
+
},
|
2576 |
+
"userProject": {
|
2577 |
+
"type": "string",
|
2578 |
+
"description": "The project to be billed for this request. Required for Requester Pays buckets.",
|
2579 |
+
"location": "query"
|
2580 |
+
}
|
2581 |
+
},
|
2582 |
+
"parameterOrder": [
|
2583 |
+
"bucket"
|
2584 |
+
],
|
2585 |
+
"response": {
|
2586 |
+
"$ref": "Notifications"
|
2587 |
+
},
|
2588 |
+
"scopes": [
|
2589 |
+
"https://www.googleapis.com/auth/cloud-platform",
|
2590 |
+
"https://www.googleapis.com/auth/cloud-platform.read-only",
|
2591 |
+
"https://www.googleapis.com/auth/devstorage.full_control",
|
2592 |
+
"https://www.googleapis.com/auth/devstorage.read_only",
|
2593 |
+
"https://www.googleapis.com/auth/devstorage.read_write"
|
2594 |
+
]
|
2595 |
+
}
|
2596 |
+
}
|
2597 |
+
},
|
2598 |
+
"objectAccessControls": {
|
2599 |
+
"methods": {
|
2600 |
+
"delete": {
|
2601 |
+
"id": "storage.objectAccessControls.delete",
|
2602 |
+
"path": "b/{bucket}/o/{object}/acl/{entity}",
|
2603 |
+
"httpMethod": "DELETE",
|
2604 |
+
"description": "Permanently deletes the ACL entry for the specified entity on the specified object.",
|
2605 |
+
"parameters": {
|
2606 |
+
"bucket": {
|
2607 |
+
"type": "string",
|
2608 |
+
"description": "Name of a bucket.",
|
2609 |
+
"required": true,
|
2610 |
+
"location": "path"
|
2611 |
+
},
|
2612 |
+
"entity": {
|
2613 |
+
"type": "string",
|
2614 |
+
"description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
|
2615 |
+
"required": true,
|
2616 |
+
"location": "path"
|
2617 |
+
},
|
2618 |
+
"generation": {
|
2619 |
+
"type": "string",
|
2620 |
+
"description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
|
2621 |
+
"format": "int64",
|
2622 |
+
"location": "query"
|
2623 |
+
},
|
2624 |
+
"object": {
|
2625 |
+
"type": "string",
|
2626 |
+
"description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
|
2627 |
+
"required": true,
|
2628 |
+
"location": "path"
|
2629 |
+
},
|
2630 |
+
"provisionalUserProject": {
|
2631 |
+
"type": "string",
|
2632 |
+
"description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
|
2633 |
+
"location": "query"
|
2634 |
+
},
|
2635 |
+
"userProject": {
|
2636 |
+
"type": "string",
|
2637 |
+
"description": "The project to be billed for this request. Required for Requester Pays buckets.",
|
2638 |
+
"location": "query"
|
2639 |
+
}
|
2640 |
+
},
|
2641 |
+
"parameterOrder": [
|
2642 |
+
"bucket",
|
2643 |
+
"object",
|
2644 |
+
"entity"
|
2645 |
+
],
|
2646 |
+
"scopes": [
|
2647 |
+
"https://www.googleapis.com/auth/cloud-platform",
|
2648 |
+
"https://www.googleapis.com/auth/devstorage.full_control"
|
2649 |
+
]
|
2650 |
+
},
|
2651 |
+
"get": {
|
2652 |
+
"id": "storage.objectAccessControls.get",
|
2653 |
+
"path": "b/{bucket}/o/{object}/acl/{entity}",
|
2654 |
+
"httpMethod": "GET",
|
2655 |
+
"description": "Returns the ACL entry for the specified entity on the specified object.",
|
2656 |
+
"parameters": {
|
2657 |
+
"bucket": {
|
2658 |
+
"type": "string",
|
2659 |
+
"description": "Name of a bucket.",
|
2660 |
+
"required": true,
|
2661 |
+
"location": "path"
|
2662 |
+
},
|
2663 |
+
"entity": {
|
2664 |
+
"type": "string",
|
2665 |
+
"description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
|
2666 |
+
"required": true,
|
2667 |
+
"location": "path"
|
2668 |
+
},
|
2669 |
+
"generation": {
|
2670 |
+
"type": "string",
|
2671 |
+
"description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
|
2672 |
+
"format": "int64",
|
2673 |
+
"location": "query"
|
2674 |
+
},
|
2675 |
+
"object": {
|
2676 |
+
"type": "string",
|
2677 |
+
"description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
|
2678 |
+
"required": true,
|
2679 |
+
"location": "path"
|
2680 |
+
},
|
2681 |
+
"provisionalUserProject": {
|
2682 |
+
"type": "string",
|
2683 |
+
"description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
|
2684 |
+
"location": "query"
|
2685 |
+
},
|
2686 |
+
"userProject": {
|
2687 |
+
"type": "string",
|
2688 |
+
"description": "The project to be billed for this request. Required for Requester Pays buckets.",
|
2689 |
+
"location": "query"
|
2690 |
+
}
|
2691 |
+
},
|
2692 |
+
"parameterOrder": [
|
2693 |
+
"bucket",
|
2694 |
+
"object",
|
2695 |
+
"entity"
|
2696 |
+
],
|
2697 |
+
"response": {
|
2698 |
+
"$ref": "ObjectAccessControl"
|
2699 |
+
},
|
2700 |
+
"scopes": [
|
2701 |
+
"https://www.googleapis.com/auth/cloud-platform",
|
2702 |
+
"https://www.googleapis.com/auth/devstorage.full_control"
|
2703 |
+
]
|
2704 |
+
},
|
2705 |
+
"insert": {
|
2706 |
+
"id": "storage.objectAccessControls.insert",
|
2707 |
+
"path": "b/{bucket}/o/{object}/acl",
|
2708 |
+
"httpMethod": "POST",
|
2709 |
+
"description": "Creates a new ACL entry on the specified object.",
|
2710 |
+
"parameters": {
|
2711 |
+
"bucket": {
|
2712 |
+
"type": "string",
|
2713 |
+
"description": "Name of a bucket.",
|
2714 |
+
"required": true,
|
2715 |
+
"location": "path"
|
2716 |
+
},
|
2717 |
+
"generation": {
|
2718 |
+
"type": "string",
|
2719 |
+
"description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
|
2720 |
+
"format": "int64",
|
2721 |
+
"location": "query"
|
2722 |
+
},
|
2723 |
+
"object": {
|
2724 |
+
"type": "string",
|
2725 |
+
"description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
|
2726 |
+
"required": true,
|
2727 |
+
"location": "path"
|
2728 |
+
},
|
2729 |
+
"provisionalUserProject": {
|
2730 |
+
"type": "string",
|
2731 |
+
"description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
|
2732 |
+
"location": "query"
|
2733 |
+
},
|
2734 |
+
"userProject": {
|
2735 |
+
"type": "string",
|
2736 |
+
"description": "The project to be billed for this request. Required for Requester Pays buckets.",
|
2737 |
+
"location": "query"
|
2738 |
+
}
|
2739 |
+
},
|
2740 |
+
"parameterOrder": [
|
2741 |
+
"bucket",
|
2742 |
+
"object"
|
2743 |
+
],
|
2744 |
+
"request": {
|
2745 |
+
"$ref": "ObjectAccessControl"
|
2746 |
+
},
|
2747 |
+
"response": {
|
2748 |
+
"$ref": "ObjectAccessControl"
|
2749 |
+
},
|
2750 |
+
"scopes": [
|
2751 |
+
"https://www.googleapis.com/auth/cloud-platform",
|
2752 |
+
"https://www.googleapis.com/auth/devstorage.full_control"
|
2753 |
+
]
|
2754 |
+
},
|
2755 |
+
"list": {
|
2756 |
+
"id": "storage.objectAccessControls.list",
|
2757 |
+
"path": "b/{bucket}/o/{object}/acl",
|
2758 |
+
"httpMethod": "GET",
|
2759 |
+
"description": "Retrieves ACL entries on the specified object.",
|
2760 |
+
"parameters": {
|
2761 |
+
"bucket": {
|
2762 |
+
"type": "string",
|
2763 |
+
"description": "Name of a bucket.",
|
2764 |
+
"required": true,
|
2765 |
+
"location": "path"
|
2766 |
+
},
|
2767 |
+
"generation": {
|
2768 |
+
"type": "string",
|
2769 |
+
"description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
|
2770 |
+
"format": "int64",
|
2771 |
+
"location": "query"
|
2772 |
+
},
|
2773 |
+
"object": {
|
2774 |
+
"type": "string",
|
2775 |
+
"description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
|
2776 |
+
"required": true,
|
2777 |
+
"location": "path"
|
2778 |
+
},
|
2779 |
+
"provisionalUserProject": {
|
2780 |
+
"type": "string",
|
2781 |
+
"description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
|
2782 |
+
"location": "query"
|
2783 |
+
},
|
2784 |
+
"userProject": {
|
2785 |
+
"type": "string",
|
2786 |
+
"description": "The project to be billed for this request. Required for Requester Pays buckets.",
|
2787 |
+
"location": "query"
|
2788 |
+
}
|
2789 |
+
},
|
2790 |
+
"parameterOrder": [
|
2791 |
+
"bucket",
|
2792 |
+
"object"
|
2793 |
+
],
|
2794 |
+
"response": {
|
2795 |
+
"$ref": "ObjectAccessControls"
|
2796 |
+
},
|
2797 |
+
"scopes": [
|
2798 |
+
"https://www.googleapis.com/auth/cloud-platform",
|
2799 |
+
"https://www.googleapis.com/auth/devstorage.full_control"
|
2800 |
+
]
|
2801 |
+
},
|
2802 |
+
"patch": {
|
2803 |
+
"id": "storage.objectAccessControls.patch",
|
2804 |
+
"path": "b/{bucket}/o/{object}/acl/{entity}",
|
2805 |
+
"httpMethod": "PATCH",
|
2806 |
+
"description": "Patches an ACL entry on the specified object.",
|
2807 |
+
"parameters": {
|
2808 |
+
"bucket": {
|
2809 |
+
"type": "string",
|
2810 |
+
"description": "Name of a bucket.",
|
2811 |
+
"required": true,
|
2812 |
+
"location": "path"
|
2813 |
+
},
|
2814 |
+
"entity": {
|
2815 |
+
"type": "string",
|
2816 |
+
"description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
|
2817 |
+
"required": true,
|
2818 |
+
"location": "path"
|
2819 |
+
},
|
2820 |
+
"generation": {
|
2821 |
+
"type": "string",
|
2822 |
+
"description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
|
2823 |
+
"format": "int64",
|
2824 |
+
"location": "query"
|
2825 |
+
},
|
2826 |
+
"object": {
|
2827 |
+
"type": "string",
|
2828 |
+
"description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
|
2829 |
+
"required": true,
|
2830 |
+
"location": "path"
|
2831 |
+
},
|
2832 |
+
"provisionalUserProject": {
|
2833 |
+
"type": "string",
|
2834 |
+
"description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
|
2835 |
+
"location": "query"
|
2836 |
+
},
|
2837 |
+
"userProject": {
|
2838 |
+
"type": "string",
|
2839 |
+
"description": "The project to be billed for this request. Required for Requester Pays buckets.",
|
2840 |
+
"location": "query"
|
2841 |
+
}
|
2842 |
+
},
|
2843 |
+
"parameterOrder": [
|
2844 |
+
"bucket",
|
2845 |
+
"object",
|
2846 |
+
"entity"
|
2847 |
+
],
|
2848 |
+
"request": {
|
2849 |
+
"$ref": "ObjectAccessControl"
|
2850 |
+
},
|
2851 |
+
"response": {
|
2852 |
+
"$ref": "ObjectAccessControl"
|
2853 |
+
},
|
2854 |
+
"scopes": [
|
2855 |
+
"https://www.googleapis.com/auth/cloud-platform",
|
2856 |
+
"https://www.googleapis.com/auth/devstorage.full_control"
|
2857 |
+
]
|
2858 |
+
},
|
2859 |
+
"update": {
|
2860 |
+
"id": "storage.objectAccessControls.update",
|
2861 |
+
"path": "b/{bucket}/o/{object}/acl/{entity}",
|
2862 |
+
"httpMethod": "PUT",
|
2863 |
+
"description": "Updates an ACL entry on the specified object.",
|
2864 |
+
"parameters": {
|
2865 |
+
"bucket": {
|
2866 |
+
"type": "string",
|
2867 |
+
"description": "Name of a bucket.",
|
2868 |
+
"required": true,
|
2869 |
+
"location": "path"
|
2870 |
+
},
|
2871 |
+
"entity": {
|
2872 |
+
"type": "string",
|
2873 |
+
"description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
|
2874 |
+
"required": true,
|
2875 |
+
"location": "path"
|
2876 |
+
},
|
2877 |
+
"generation": {
|
2878 |
+
"type": "string",
|
2879 |
+
"description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
|
2880 |
+
"format": "int64",
|
2881 |
+
"location": "query"
|
2882 |
+
},
|
2883 |
+
"object": {
|
2884 |
+
"type": "string",
|
2885 |
+
"description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
|
2886 |
+
"required": true,
|
2887 |
+
"location": "path"
|
2888 |
+
},
|
2889 |
+
"provisionalUserProject": {
|
2890 |
+
"type": "string",
|
2891 |
+
"description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
|
2892 |
+
"location": "query"
|
2893 |
+
},
|
2894 |
+
"userProject": {
|
2895 |
+
"type": "string",
|
2896 |
+
"description": "The project to be billed for this request. Required for Requester Pays buckets.",
|
2897 |
+
"location": "query"
|
2898 |
+
}
|
2899 |
+
},
|
2900 |
+
"parameterOrder": [
|
2901 |
+
"bucket",
|
2902 |
+
"object",
|
2903 |
+
"entity"
|
2904 |
+
],
|
2905 |
+
"request": {
|
2906 |
+
"$ref": "ObjectAccessControl"
|
2907 |
+
},
|
2908 |
+
"response": {
|
2909 |
+
"$ref": "ObjectAccessControl"
|
2910 |
+
},
|
2911 |
+
"scopes": [
|
2912 |
+
"https://www.googleapis.com/auth/cloud-platform",
|
2913 |
+
"https://www.googleapis.com/auth/devstorage.full_control"
|
2914 |
+
]
|
2915 |
+
}
|
2916 |
+
}
|
2917 |
+
},
|
2918 |
+
"objects": {
|
2919 |
+
"methods": {
|
2920 |
+
"compose": {
|
2921 |
+
"id": "storage.objects.compose",
|
2922 |
+
"path": "b/{destinationBucket}/o/{destinationObject}/compose",
|
2923 |
+
"httpMethod": "POST",
|
2924 |
+
"description": "Concatenates a list of existing objects into a new object in the same bucket.",
|
2925 |
+
"parameters": {
|
2926 |
+
"destinationBucket": {
|
2927 |
+
"type": "string",
|
2928 |
+
"description": "Name of the bucket containing the source objects. The destination object is stored in this bucket.",
|
2929 |
+
"required": true,
|
2930 |
+
"location": "path"
|
2931 |
+
},
|
2932 |
+
"destinationObject": {
|
2933 |
+
"type": "string",
|
2934 |
+
"description": "Name of the new object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
|
2935 |
+
"required": true,
|
2936 |
+
"location": "path"
|
2937 |
+
},
|
2938 |
+
"destinationPredefinedAcl": {
|
2939 |
+
"type": "string",
|
2940 |
+
"description": "Apply a predefined set of access controls to the destination object.",
|
2941 |
+
"enum": [
|
2942 |
+
"authenticatedRead",
|
2943 |
+
"bucketOwnerFullControl",
|
2944 |
+
"bucketOwnerRead",
|
2945 |
+
"private",
|
2946 |
+
"projectPrivate",
|
2947 |
+
"publicRead"
|
2948 |
+
],
|
2949 |
+
"enumDescriptions": [
|
2950 |
+
"Object owner gets OWNER access, and allAuthenticatedUsers get READER access.",
|
2951 |
+
"Object owner gets OWNER access, and project team owners get OWNER access.",
|
2952 |
+
"Object owner gets OWNER access, and project team owners get READER access.",
|
2953 |
+
"Object owner gets OWNER access.",
|
2954 |
+
"Object owner gets OWNER access, and project team members get access according to their roles.",
|
2955 |
+
"Object owner gets OWNER access, and allUsers get READER access."
|
2956 |
+
],
|
2957 |
+
"location": "query"
|
2958 |
+
},
|
2959 |
+
"ifGenerationMatch": {
|
2960 |
+
"type": "string",
|
2961 |
+
"description": "Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.",
|
2962 |
+
"format": "int64",
|
2963 |
+
"location": "query"
|
2964 |
+
},
|
2965 |
+
"ifMetagenerationMatch": {
|
2966 |
+
"type": "string",
|
2967 |
+
"description": "Makes the operation conditional on whether the object's current metageneration matches the given value.",
|
2968 |
+
"format": "int64",
|
2969 |
+
"location": "query"
|
2970 |
+
},
|
2971 |
+
"kmsKeyName": {
|
2972 |
+
"type": "string",
|
2973 |
+
"description": "Resource name of the Cloud KMS key, of the form projects/my-project/locations/global/keyRings/my-kr/cryptoKeys/my-key, that will be used to encrypt the object. Overrides the object metadata's kms_key_name value, if any.",
|
2974 |
+
"location": "query"
|
2975 |
+
},
|
2976 |
+
"provisionalUserProject": {
|
2977 |
+
"type": "string",
|
2978 |
+
"description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
|
2979 |
+
"location": "query"
|
2980 |
+
},
|
2981 |
+
"userProject": {
|
2982 |
+
"type": "string",
|
2983 |
+
"description": "The project to be billed for this request. Required for Requester Pays buckets.",
|
2984 |
+
"location": "query"
|
2985 |
+
}
|
2986 |
+
},
|
2987 |
+
"parameterOrder": [
|
2988 |
+
"destinationBucket",
|
2989 |
+
"destinationObject"
|
2990 |
+
],
|
2991 |
+
"request": {
|
2992 |
+
"$ref": "ComposeRequest"
|
2993 |
+
},
|
2994 |
+
"response": {
|
2995 |
+
"$ref": "Object"
|
2996 |
+
},
|
2997 |
+
"scopes": [
|
2998 |
+
"https://www.googleapis.com/auth/cloud-platform",
|
2999 |
+
"https://www.googleapis.com/auth/devstorage.full_control",
|
3000 |
+
"https://www.googleapis.com/auth/devstorage.read_write"
|
3001 |
+
]
|
3002 |
+
},
|
3003 |
+
"copy": {
|
3004 |
+
"id": "storage.objects.copy",
|
3005 |
+
"path": "b/{sourceBucket}/o/{sourceObject}/copyTo/b/{destinationBucket}/o/{destinationObject}",
|
3006 |
+
"httpMethod": "POST",
|
3007 |
+
"description": "Copies a source object to a destination object. Optionally overrides metadata.",
|
3008 |
+
"parameters": {
|
3009 |
+
"destinationBucket": {
|
3010 |
+
"type": "string",
|
3011 |
+
"description": "Name of the bucket in which to store the new object. Overrides the provided object metadata's bucket value, if any.For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
|
3012 |
+
"required": true,
|
3013 |
+
"location": "path"
|
3014 |
+
},
|
3015 |
+
"destinationObject": {
|
3016 |
+
"type": "string",
|
3017 |
+
"description": "Name of the new object. Required when the object metadata is not otherwise provided. Overrides the object metadata's name value, if any.",
|
3018 |
+
"required": true,
|
3019 |
+
"location": "path"
|
3020 |
+
},
|
3021 |
+
"destinationPredefinedAcl": {
|
3022 |
+
"type": "string",
|
3023 |
+
"description": "Apply a predefined set of access controls to the destination object.",
|
3024 |
+
"enum": [
|
3025 |
+
"authenticatedRead",
|
3026 |
+
"bucketOwnerFullControl",
|
3027 |
+
"bucketOwnerRead",
|
3028 |
+
"private",
|
3029 |
+
"projectPrivate",
|
3030 |
+
"publicRead"
|
3031 |
+
],
|
3032 |
+
"enumDescriptions": [
|
3033 |
+
"Object owner gets OWNER access, and allAuthenticatedUsers get READER access.",
|
3034 |
+
"Object owner gets OWNER access, and project team owners get OWNER access.",
|
3035 |
+
"Object owner gets OWNER access, and project team owners get READER access.",
|
3036 |
+
"Object owner gets OWNER access.",
|
3037 |
+
"Object owner gets OWNER access, and project team members get access according to their roles.",
|
3038 |
+
"Object owner gets OWNER access, and allUsers get READER access."
|
3039 |
+
],
|
3040 |
+
"location": "query"
|
3041 |
+
},
|
3042 |
+
"ifGenerationMatch": {
|
3043 |
+
"type": "string",
|
3044 |
+
"description": "Makes the operation conditional on whether the destination object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.",
|
3045 |
+
"format": "int64",
|
3046 |
+
"location": "query"
|
3047 |
+
},
|
3048 |
+
"ifGenerationNotMatch": {
|
3049 |
+
"type": "string",
|
3050 |
+
"description": "Makes the operation conditional on whether the destination object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.",
|
3051 |
+
"format": "int64",
|
3052 |
+
"location": "query"
|
3053 |
+
},
|
3054 |
+
"ifMetagenerationMatch": {
|
3055 |
+
"type": "string",
|
3056 |
+
"description": "Makes the operation conditional on whether the destination object's current metageneration matches the given value.",
|
3057 |
+
"format": "int64",
|
3058 |
+
"location": "query"
|
3059 |
+
},
|
3060 |
+
"ifMetagenerationNotMatch": {
|
3061 |
+
"type": "string",
|
3062 |
+
"description": "Makes the operation conditional on whether the destination object's current metageneration does not match the given value.",
|
3063 |
+
"format": "int64",
|
3064 |
+
"location": "query"
|
3065 |
+
},
|
3066 |
+
"ifSourceGenerationMatch": {
|
3067 |
+
"type": "string",
|
3068 |
+
"description": "Makes the operation conditional on whether the source object's current generation matches the given value.",
|
3069 |
+
"format": "int64",
|
3070 |
+
"location": "query"
|
3071 |
+
},
|
3072 |
+
"ifSourceGenerationNotMatch": {
|
3073 |
+
"type": "string",
|
3074 |
+
"description": "Makes the operation conditional on whether the source object's current generation does not match the given value.",
|
3075 |
+
"format": "int64",
|
3076 |
+
"location": "query"
|
3077 |
+
},
|
3078 |
+
"ifSourceMetagenerationMatch": {
|
3079 |
+
"type": "string",
|
3080 |
+
"description": "Makes the operation conditional on whether the source object's current metageneration matches the given value.",
|
3081 |
+
"format": "int64",
|
3082 |
+
"location": "query"
|
3083 |
+
},
|
3084 |
+
"ifSourceMetagenerationNotMatch": {
|
3085 |
+
"type": "string",
|
3086 |
+
"description": "Makes the operation conditional on whether the source object's current metageneration does not match the given value.",
|
3087 |
+
"format": "int64",
|
3088 |
+
"location": "query"
|
3089 |
+
},
|
3090 |
+
"projection": {
|
3091 |
+
"type": "string",
|
3092 |
+
"description": "Set of properties to return. Defaults to noAcl, unless the object resource specifies the acl property, when it defaults to full.",
|
3093 |
+
"enum": [
|
3094 |
+
"full",
|
3095 |
+
"noAcl"
|
3096 |
+
],
|
3097 |
+
"enumDescriptions": [
|
3098 |
+
"Include all properties.",
|
3099 |
+
"Omit the owner, acl property."
|
3100 |
+
],
|
3101 |
+
"location": "query"
|
3102 |
+
},
|
3103 |
+
"provisionalUserProject": {
|
3104 |
+
"type": "string",
|
3105 |
+
"description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
|
3106 |
+
"location": "query"
|
3107 |
+
},
|
3108 |
+
"sourceBucket": {
|
3109 |
+
"type": "string",
|
3110 |
+
"description": "Name of the bucket in which to find the source object.",
|
3111 |
+
"required": true,
|
3112 |
+
"location": "path"
|
3113 |
+
},
|
3114 |
+
"sourceGeneration": {
|
3115 |
+
"type": "string",
|
3116 |
+
"description": "If present, selects a specific revision of the source object (as opposed to the latest version, the default).",
|
3117 |
+
"format": "int64",
|
3118 |
+
"location": "query"
|
3119 |
+
},
|
3120 |
+
"sourceObject": {
|
3121 |
+
"type": "string",
|
3122 |
+
"description": "Name of the source object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
|
3123 |
+
"required": true,
|
3124 |
+
"location": "path"
|
3125 |
+
},
|
3126 |
+
"userProject": {
|
3127 |
+
"type": "string",
|
3128 |
+
"description": "The project to be billed for this request. Required for Requester Pays buckets.",
|
3129 |
+
"location": "query"
|
3130 |
+
}
|
3131 |
+
},
|
3132 |
+
"parameterOrder": [
|
3133 |
+
"sourceBucket",
|
3134 |
+
"sourceObject",
|
3135 |
+
"destinationBucket",
|
3136 |
+
"destinationObject"
|
3137 |
+
],
|
3138 |
+
"request": {
|
3139 |
+
"$ref": "Object"
|
3140 |
+
},
|
3141 |
+
"response": {
|
3142 |
+
"$ref": "Object"
|
3143 |
+
},
|
3144 |
+
"scopes": [
|
3145 |
+
"https://www.googleapis.com/auth/cloud-platform",
|
3146 |
+
"https://www.googleapis.com/auth/devstorage.full_control",
|
3147 |
+
"https://www.googleapis.com/auth/devstorage.read_write"
|
3148 |
+
]
|
3149 |
+
},
|
3150 |
+
"delete": {
|
3151 |
+
"id": "storage.objects.delete",
|
3152 |
+
"path": "b/{bucket}/o/{object}",
|
3153 |
+
"httpMethod": "DELETE",
|
3154 |
+
"description": "Deletes an object and its metadata. Deletions are permanent if versioning is not enabled for the bucket, or if the generation parameter is used.",
|
3155 |
+
"parameters": {
|
3156 |
+
"bucket": {
|
3157 |
+
"type": "string",
|
3158 |
+
"description": "Name of the bucket in which the object resides.",
|
3159 |
+
"required": true,
|
3160 |
+
"location": "path"
|
3161 |
+
},
|
3162 |
+
"generation": {
|
3163 |
+
"type": "string",
|
3164 |
+
"description": "If present, permanently deletes a specific revision of this object (as opposed to the latest version, the default).",
|
3165 |
+
"format": "int64",
|
3166 |
+
"location": "query"
|
3167 |
+
},
|
3168 |
+
"ifGenerationMatch": {
|
3169 |
+
"type": "string",
|
3170 |
+
"description": "Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.",
|
3171 |
+
"format": "int64",
|
3172 |
+
"location": "query"
|
3173 |
+
},
|
3174 |
+
"ifGenerationNotMatch": {
|
3175 |
+
"type": "string",
|
3176 |
+
"description": "Makes the operation conditional on whether the object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.",
|
3177 |
+
"format": "int64",
|
3178 |
+
"location": "query"
|
3179 |
+
},
|
3180 |
+
"ifMetagenerationMatch": {
|
3181 |
+
"type": "string",
|
3182 |
+
"description": "Makes the operation conditional on whether the object's current metageneration matches the given value.",
|
3183 |
+
"format": "int64",
|
3184 |
+
"location": "query"
|
3185 |
+
},
|
3186 |
+
"ifMetagenerationNotMatch": {
|
3187 |
+
"type": "string",
|
3188 |
+
"description": "Makes the operation conditional on whether the object's current metageneration does not match the given value.",
|
3189 |
+
"format": "int64",
|
3190 |
+
"location": "query"
|
3191 |
+
},
|
3192 |
+
"object": {
|
3193 |
+
"type": "string",
|
3194 |
+
"description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
|
3195 |
+
"required": true,
|
3196 |
+
"location": "path"
|
3197 |
+
},
|
3198 |
+
"provisionalUserProject": {
|
3199 |
+
"type": "string",
|
3200 |
+
"description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
|
3201 |
+
"location": "query"
|
3202 |
+
},
|
3203 |
+
"userProject": {
|
3204 |
+
"type": "string",
|
3205 |
+
"description": "The project to be billed for this request. Required for Requester Pays buckets.",
|
3206 |
+
"location": "query"
|
3207 |
+
}
|
3208 |
+
},
|
3209 |
+
"parameterOrder": [
|
3210 |
+
"bucket",
|
3211 |
+
"object"
|
3212 |
+
],
|
3213 |
+
"scopes": [
|
3214 |
+
"https://www.googleapis.com/auth/cloud-platform",
|
3215 |
+
"https://www.googleapis.com/auth/devstorage.full_control",
|
3216 |
+
"https://www.googleapis.com/auth/devstorage.read_write"
|
3217 |
+
]
|
3218 |
+
},
|
3219 |
+
"get": {
|
3220 |
+
"id": "storage.objects.get",
|
3221 |
+
"path": "b/{bucket}/o/{object}",
|
3222 |
+
"httpMethod": "GET",
|
3223 |
+
"description": "Retrieves an object or its metadata.",
|
3224 |
+
"parameters": {
|
3225 |
+
"bucket": {
|
3226 |
+
"type": "string",
|
3227 |
+
"description": "Name of the bucket in which the object resides.",
|
3228 |
+
"required": true,
|
3229 |
+
"location": "path"
|
3230 |
+
},
|
3231 |
+
"generation": {
|
3232 |
+
"type": "string",
|
3233 |
+
"description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
|
3234 |
+
"format": "int64",
|
3235 |
+
"location": "query"
|
3236 |
+
},
|
3237 |
+
"ifGenerationMatch": {
|
3238 |
+
"type": "string",
|
3239 |
+
"description": "Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.",
|
3240 |
+
"format": "int64",
|
3241 |
+
"location": "query"
|
3242 |
+
},
|
3243 |
+
"ifGenerationNotMatch": {
|
3244 |
+
"type": "string",
|
3245 |
+
"description": "Makes the operation conditional on whether the object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.",
|
3246 |
+
"format": "int64",
|
3247 |
+
"location": "query"
|
3248 |
+
},
|
3249 |
+
"ifMetagenerationMatch": {
|
3250 |
+
"type": "string",
|
3251 |
+
"description": "Makes the operation conditional on whether the object's current metageneration matches the given value.",
|
3252 |
+
"format": "int64",
|
3253 |
+
"location": "query"
|
3254 |
+
},
|
3255 |
+
"ifMetagenerationNotMatch": {
|
3256 |
+
"type": "string",
|
3257 |
+
"description": "Makes the operation conditional on whether the object's current metageneration does not match the given value.",
|
3258 |
+
"format": "int64",
|
3259 |
+
"location": "query"
|
3260 |
+
},
|
3261 |
+
"object": {
|
3262 |
+
"type": "string",
|
3263 |
+
"description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
|
3264 |
+
"required": true,
|
3265 |
+
"location": "path"
|
3266 |
+
},
|
3267 |
+
"projection": {
|
3268 |
+
"type": "string",
|
3269 |
+
"description": "Set of properties to return. Defaults to noAcl.",
|
3270 |
+
"enum": [
|
3271 |
+
"full",
|
3272 |
+
"noAcl"
|
3273 |
+
],
|
3274 |
+
"enumDescriptions": [
|
3275 |
+
"Include all properties.",
|
3276 |
+
"Omit the owner, acl property."
|
3277 |
+
],
|
3278 |
+
"location": "query"
|
3279 |
+
},
|
3280 |
+
"provisionalUserProject": {
|
3281 |
+
"type": "string",
|
3282 |
+
"description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
|
3283 |
+
"location": "query"
|
3284 |
+
},
|
3285 |
+
"userProject": {
|
3286 |
+
"type": "string",
|
3287 |
+
"description": "The project to be billed for this request. Required for Requester Pays buckets.",
|
3288 |
+
"location": "query"
|
3289 |
+
}
|
3290 |
+
},
|
3291 |
+
"parameterOrder": [
|
3292 |
+
"bucket",
|
3293 |
+
"object"
|
3294 |
+
],
|
3295 |
+
"response": {
|
3296 |
+
"$ref": "Object"
|
3297 |
+
},
|
3298 |
+
"scopes": [
|
3299 |
+
"https://www.googleapis.com/auth/cloud-platform",
|
3300 |
+
"https://www.googleapis.com/auth/cloud-platform.read-only",
|
3301 |
+
"https://www.googleapis.com/auth/devstorage.full_control",
|
3302 |
+
"https://www.googleapis.com/auth/devstorage.read_only",
|
3303 |
+
"https://www.googleapis.com/auth/devstorage.read_write"
|
3304 |
+
],
|
3305 |
+
"supportsMediaDownload": true,
|
3306 |
+
"useMediaDownloadService": true
|
3307 |
+
},
|
3308 |
+
"getIamPolicy": {
|
3309 |
+
"id": "storage.objects.getIamPolicy",
|
3310 |
+
"path": "b/{bucket}/o/{object}/iam",
|
3311 |
+
"httpMethod": "GET",
|
3312 |
+
"description": "Returns an IAM policy for the specified object.",
|
3313 |
+
"parameters": {
|
3314 |
+
"bucket": {
|
3315 |
+
"type": "string",
|
3316 |
+
"description": "Name of the bucket in which the object resides.",
|
3317 |
+
"required": true,
|
3318 |
+
"location": "path"
|
3319 |
+
},
|
3320 |
+
"generation": {
|
3321 |
+
"type": "string",
|
3322 |
+
"description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
|
3323 |
+
"format": "int64",
|
3324 |
+
"location": "query"
|
3325 |
+
},
|
3326 |
+
"object": {
|
3327 |
+
"type": "string",
|
3328 |
+
"description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
|
3329 |
+
"required": true,
|
3330 |
+
"location": "path"
|
3331 |
+
},
|
3332 |
+
"provisionalUserProject": {
|
3333 |
+
"type": "string",
|
3334 |
+
"description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
|
3335 |
+
"location": "query"
|
3336 |
+
},
|
3337 |
+
"userProject": {
|
3338 |
+
"type": "string",
|
3339 |
+
"description": "The project to be billed for this request. Required for Requester Pays buckets.",
|
3340 |
+
"location": "query"
|
3341 |
+
}
|
3342 |
+
},
|
3343 |
+
"parameterOrder": [
|
3344 |
+
"bucket",
|
3345 |
+
"object"
|
3346 |
+
],
|
3347 |
+
"response": {
|
3348 |
+
"$ref": "Policy"
|
3349 |
+
},
|
3350 |
+
"scopes": [
|
3351 |
+
"https://www.googleapis.com/auth/cloud-platform",
|
3352 |
+
"https://www.googleapis.com/auth/cloud-platform.read-only",
|
3353 |
+
"https://www.googleapis.com/auth/devstorage.full_control",
|
3354 |
+
"https://www.googleapis.com/auth/devstorage.read_only",
|
3355 |
+
"https://www.googleapis.com/auth/devstorage.read_write"
|
3356 |
+
]
|
3357 |
+
},
|
3358 |
+
"insert": {
|
3359 |
+
"id": "storage.objects.insert",
|
3360 |
+
"path": "b/{bucket}/o",
|
3361 |
+
"httpMethod": "POST",
|
3362 |
+
"description": "Stores a new object and metadata.",
|
3363 |
+
"parameters": {
|
3364 |
+
"bucket": {
|
3365 |
+
"type": "string",
|
3366 |
+
"description": "Name of the bucket in which to store the new object. Overrides the provided object metadata's bucket value, if any.",
|
3367 |
+
"required": true,
|
3368 |
+
"location": "path"
|
3369 |
+
},
|
3370 |
+
"contentEncoding": {
|
3371 |
+
"type": "string",
|
3372 |
+
"description": "If set, sets the contentEncoding property of the final object to this value. Setting this parameter is equivalent to setting the contentEncoding metadata property. This can be useful when uploading an object with uploadType=media to indicate the encoding of the content being uploaded.",
|
3373 |
+
"location": "query"
|
3374 |
+
},
|
3375 |
+
"ifGenerationMatch": {
|
3376 |
+
"type": "string",
|
3377 |
+
"description": "Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.",
|
3378 |
+
"format": "int64",
|
3379 |
+
"location": "query"
|
3380 |
+
},
|
3381 |
+
"ifGenerationNotMatch": {
|
3382 |
+
"type": "string",
|
3383 |
+
"description": "Makes the operation conditional on whether the object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.",
|
3384 |
+
"format": "int64",
|
3385 |
+
"location": "query"
|
3386 |
+
},
|
3387 |
+
"ifMetagenerationMatch": {
|
3388 |
+
"type": "string",
|
3389 |
+
"description": "Makes the operation conditional on whether the object's current metageneration matches the given value.",
|
3390 |
+
"format": "int64",
|
3391 |
+
"location": "query"
|
3392 |
+
},
|
3393 |
+
"ifMetagenerationNotMatch": {
|
3394 |
+
"type": "string",
|
3395 |
+
"description": "Makes the operation conditional on whether the object's current metageneration does not match the given value.",
|
3396 |
+
"format": "int64",
|
3397 |
+
"location": "query"
|
3398 |
+
},
|
3399 |
+
"kmsKeyName": {
|
3400 |
+
"type": "string",
|
3401 |
+
"description": "Resource name of the Cloud KMS key, of the form projects/my-project/locations/global/keyRings/my-kr/cryptoKeys/my-key, that will be used to encrypt the object. Overrides the object metadata's kms_key_name value, if any.",
|
3402 |
+
"location": "query"
|
3403 |
+
},
|
3404 |
+
"name": {
|
3405 |
+
"type": "string",
|
3406 |
+
"description": "Name of the object. Required when the object metadata is not otherwise provided. Overrides the object metadata's name value, if any. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
|
3407 |
+
"location": "query"
|
3408 |
+
},
|
3409 |
+
"predefinedAcl": {
|
3410 |
+
"type": "string",
|
3411 |
+
"description": "Apply a predefined set of access controls to this object.",
|
3412 |
+
"enum": [
|
3413 |
+
"authenticatedRead",
|
3414 |
+
"bucketOwnerFullControl",
|
3415 |
+
"bucketOwnerRead",
|
3416 |
+
"private",
|
3417 |
+
"projectPrivate",
|
3418 |
+
"publicRead"
|
3419 |
+
],
|
3420 |
+
"enumDescriptions": [
|
3421 |
+
"Object owner gets OWNER access, and allAuthenticatedUsers get READER access.",
|
3422 |
+
"Object owner gets OWNER access, and project team owners get OWNER access.",
|
3423 |
+
"Object owner gets OWNER access, and project team owners get READER access.",
|
3424 |
+
"Object owner gets OWNER access.",
|
3425 |
+
"Object owner gets OWNER access, and project team members get access according to their roles.",
|
3426 |
+
"Object owner gets OWNER access, and allUsers get READER access."
|
3427 |
+
],
|
3428 |
+
"location": "query"
|
3429 |
+
},
|
3430 |
+
"projection": {
|
3431 |
+
"type": "string",
|
3432 |
+
"description": "Set of properties to return. Defaults to noAcl, unless the object resource specifies the acl property, when it defaults to full.",
|
3433 |
+
"enum": [
|
3434 |
+
"full",
|
3435 |
+
"noAcl"
|
3436 |
+
],
|
3437 |
+
"enumDescriptions": [
|
3438 |
+
"Include all properties.",
|
3439 |
+
"Omit the owner, acl property."
|
3440 |
+
],
|
3441 |
+
"location": "query"
|
3442 |
+
},
|
3443 |
+
"provisionalUserProject": {
|
3444 |
+
"type": "string",
|
3445 |
+
"description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
|
3446 |
+
"location": "query"
|
3447 |
+
},
|
3448 |
+
"userProject": {
|
3449 |
+
"type": "string",
|
3450 |
+
"description": "The project to be billed for this request. Required for Requester Pays buckets.",
|
3451 |
+
"location": "query"
|
3452 |
+
}
|
3453 |
+
},
|
3454 |
+
"parameterOrder": [
|
3455 |
+
"bucket"
|
3456 |
+
],
|
3457 |
+
"request": {
|
3458 |
+
"$ref": "Object"
|
3459 |
+
},
|
3460 |
+
"response": {
|
3461 |
+
"$ref": "Object"
|
3462 |
+
},
|
3463 |
+
"scopes": [
|
3464 |
+
"https://www.googleapis.com/auth/cloud-platform",
|
3465 |
+
"https://www.googleapis.com/auth/devstorage.full_control",
|
3466 |
+
"https://www.googleapis.com/auth/devstorage.read_write"
|
3467 |
+
],
|
3468 |
+
"supportsMediaUpload": true,
|
3469 |
+
"mediaUpload": {
|
3470 |
+
"accept": [
|
3471 |
+
"*/*"
|
3472 |
+
],
|
3473 |
+
"protocols": {
|
3474 |
+
"simple": {
|
3475 |
+
"multipart": true,
|
3476 |
+
"path": "/upload/storage/v1/b/{bucket}/o"
|
3477 |
+
},
|
3478 |
+
"resumable": {
|
3479 |
+
"multipart": true,
|
3480 |
+
"path": "/resumable/upload/storage/v1/b/{bucket}/o"
|
3481 |
}
|
3482 |
+
}
|
3483 |
}
|
3484 |
+
},
|
3485 |
+
"list": {
|
3486 |
+
"id": "storage.objects.list",
|
3487 |
+
"path": "b/{bucket}/o",
|
3488 |
+
"httpMethod": "GET",
|
3489 |
+
"description": "Retrieves a list of objects matching the criteria.",
|
3490 |
+
"parameters": {
|
3491 |
+
"bucket": {
|
3492 |
+
"type": "string",
|
3493 |
+
"description": "Name of the bucket in which to look for objects.",
|
3494 |
+
"required": true,
|
3495 |
+
"location": "path"
|
3496 |
+
},
|
3497 |
+
"delimiter": {
|
3498 |
+
"type": "string",
|
3499 |
+
"description": "Returns results in a directory-like mode. items will contain only objects whose names, aside from the prefix, do not contain delimiter. Objects whose names, aside from the prefix, contain delimiter will have their name, truncated after the delimiter, returned in prefixes. Duplicate prefixes are omitted.",
|
3500 |
+
"location": "query"
|
3501 |
+
},
|
3502 |
+
"includeTrailingDelimiter": {
|
3503 |
+
"type": "boolean",
|
3504 |
+
"description": "If true, objects that end in exactly one instance of delimiter will have their metadata included in items in addition to prefixes.",
|
3505 |
+
"location": "query"
|
3506 |
+
},
|
3507 |
+
"maxResults": {
|
3508 |
+
"type": "integer",
|
3509 |
+
"description": "Maximum number of items plus prefixes to return in a single page of responses. As duplicate prefixes are omitted, fewer total results may be returned than requested. The service will use this parameter or 1,000 items, whichever is smaller.",
|
3510 |
+
"default": "1000",
|
3511 |
+
"format": "uint32",
|
3512 |
+
"minimum": "0",
|
3513 |
+
"location": "query"
|
3514 |
+
},
|
3515 |
+
"pageToken": {
|
3516 |
+
"type": "string",
|
3517 |
+
"description": "A previously-returned page token representing part of the larger set of results to view.",
|
3518 |
+
"location": "query"
|
3519 |
+
},
|
3520 |
+
"prefix": {
|
3521 |
+
"type": "string",
|
3522 |
+
"description": "Filter results to objects whose names begin with this prefix.",
|
3523 |
+
"location": "query"
|
3524 |
+
},
|
3525 |
+
"projection": {
|
3526 |
+
"type": "string",
|
3527 |
+
"description": "Set of properties to return. Defaults to noAcl.",
|
3528 |
+
"enum": [
|
3529 |
+
"full",
|
3530 |
+
"noAcl"
|
3531 |
+
],
|
3532 |
+
"enumDescriptions": [
|
3533 |
+
"Include all properties.",
|
3534 |
+
"Omit the owner, acl property."
|
3535 |
+
],
|
3536 |
+
"location": "query"
|
3537 |
+
},
|
3538 |
+
"provisionalUserProject": {
|
3539 |
+
"type": "string",
|
3540 |
+
"description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
|
3541 |
+
"location": "query"
|
3542 |
+
},
|
3543 |
+
"userProject": {
|
3544 |
+
"type": "string",
|
3545 |
+
"description": "The project to be billed for this request. Required for Requester Pays buckets.",
|
3546 |
+
"location": "query"
|
3547 |
+
},
|
3548 |
+
"versions": {
|
3549 |
+
"type": "boolean",
|
3550 |
+
"description": "If true, lists all versions of an object as distinct results. The default is false. For more information, see Object Versioning.",
|
3551 |
+
"location": "query"
|
3552 |
+
}
|
3553 |
+
},
|
3554 |
+
"parameterOrder": [
|
3555 |
+
"bucket"
|
3556 |
+
],
|
3557 |
+
"response": {
|
3558 |
+
"$ref": "Objects"
|
3559 |
+
},
|
3560 |
+
"scopes": [
|
3561 |
+
"https://www.googleapis.com/auth/cloud-platform",
|
3562 |
+
"https://www.googleapis.com/auth/cloud-platform.read-only",
|
3563 |
+
"https://www.googleapis.com/auth/devstorage.full_control",
|
3564 |
+
"https://www.googleapis.com/auth/devstorage.read_only",
|
3565 |
+
"https://www.googleapis.com/auth/devstorage.read_write"
|
3566 |
+
],
|
3567 |
+
"supportsSubscription": true
|
3568 |
+
},
|
3569 |
+
"patch": {
|
3570 |
+
"id": "storage.objects.patch",
|
3571 |
+
"path": "b/{bucket}/o/{object}",
|
3572 |
+
"httpMethod": "PATCH",
|
3573 |
+
"description": "Patches an object's metadata.",
|
3574 |
+
"parameters": {
|
3575 |
+
"bucket": {
|
3576 |
+
"type": "string",
|
3577 |
+
"description": "Name of the bucket in which the object resides.",
|
3578 |
+
"required": true,
|
3579 |
+
"location": "path"
|
3580 |
+
},
|
3581 |
+
"generation": {
|
3582 |
+
"type": "string",
|
3583 |
+
"description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
|
3584 |
+
"format": "int64",
|
3585 |
+
"location": "query"
|
3586 |
+
},
|
3587 |
+
"ifGenerationMatch": {
|
3588 |
+
"type": "string",
|
3589 |
+
"description": "Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.",
|
3590 |
+
"format": "int64",
|
3591 |
+
"location": "query"
|
3592 |
+
},
|
3593 |
+
"ifGenerationNotMatch": {
|
3594 |
+
"type": "string",
|
3595 |
+
"description": "Makes the operation conditional on whether the object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.",
|
3596 |
+
"format": "int64",
|
3597 |
+
"location": "query"
|
3598 |
+
},
|
3599 |
+
"ifMetagenerationMatch": {
|
3600 |
+
"type": "string",
|
3601 |
+
"description": "Makes the operation conditional on whether the object's current metageneration matches the given value.",
|
3602 |
+
"format": "int64",
|
3603 |
+
"location": "query"
|
3604 |
+
},
|
3605 |
+
"ifMetagenerationNotMatch": {
|
3606 |
+
"type": "string",
|
3607 |
+
"description": "Makes the operation conditional on whether the object's current metageneration does not match the given value.",
|
3608 |
+
"format": "int64",
|
3609 |
+
"location": "query"
|
3610 |
+
},
|
3611 |
+
"object": {
|
3612 |
+
"type": "string",
|
3613 |
+
"description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
|
3614 |
+
"required": true,
|
3615 |
+
"location": "path"
|
3616 |
+
},
|
3617 |
+
"predefinedAcl": {
|
3618 |
+
"type": "string",
|
3619 |
+
"description": "Apply a predefined set of access controls to this object.",
|
3620 |
+
"enum": [
|
3621 |
+
"authenticatedRead",
|
3622 |
+
"bucketOwnerFullControl",
|
3623 |
+
"bucketOwnerRead",
|
3624 |
+
"private",
|
3625 |
+
"projectPrivate",
|
3626 |
+
"publicRead"
|
3627 |
+
],
|
3628 |
+
"enumDescriptions": [
|
3629 |
+
"Object owner gets OWNER access, and allAuthenticatedUsers get READER access.",
|
3630 |
+
"Object owner gets OWNER access, and project team owners get OWNER access.",
|
3631 |
+
"Object owner gets OWNER access, and project team owners get READER access.",
|
3632 |
+
"Object owner gets OWNER access.",
|
3633 |
+
"Object owner gets OWNER access, and project team members get access according to their roles.",
|
3634 |
+
"Object owner gets OWNER access, and allUsers get READER access."
|
3635 |
+
],
|
3636 |
+
"location": "query"
|
3637 |
+
},
|
3638 |
+
"projection": {
|
3639 |
+
"type": "string",
|
3640 |
+
"description": "Set of properties to return. Defaults to full.",
|
3641 |
+
"enum": [
|
3642 |
+
"full",
|
3643 |
+
"noAcl"
|
3644 |
+
],
|
3645 |
+
"enumDescriptions": [
|
3646 |
+
"Include all properties.",
|
3647 |
+
"Omit the owner, acl property."
|
3648 |
+
],
|
3649 |
+
"location": "query"
|
3650 |
+
},
|
3651 |
+
"provisionalUserProject": {
|
3652 |
+
"type": "string",
|
3653 |
+
"description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
|
3654 |
+
"location": "query"
|
3655 |
+
},
|
3656 |
+
"userProject": {
|
3657 |
+
"type": "string",
|
3658 |
+
"description": "The project to be billed for this request, for Requester Pays buckets.",
|
3659 |
+
"location": "query"
|
3660 |
+
}
|
3661 |
+
},
|
3662 |
+
"parameterOrder": [
|
3663 |
+
"bucket",
|
3664 |
+
"object"
|
3665 |
+
],
|
3666 |
+
"request": {
|
3667 |
+
"$ref": "Object"
|
3668 |
+
},
|
3669 |
+
"response": {
|
3670 |
+
"$ref": "Object"
|
3671 |
+
},
|
3672 |
+
"scopes": [
|
3673 |
+
"https://www.googleapis.com/auth/cloud-platform",
|
3674 |
+
"https://www.googleapis.com/auth/devstorage.full_control"
|
3675 |
+
]
|
3676 |
+
},
|
3677 |
+
"rewrite": {
|
3678 |
+
"id": "storage.objects.rewrite",
|
3679 |
+
"path": "b/{sourceBucket}/o/{sourceObject}/rewriteTo/b/{destinationBucket}/o/{destinationObject}",
|
3680 |
+
"httpMethod": "POST",
|
3681 |
+
"description": "Rewrites a source object to a destination object. Optionally overrides metadata.",
|
3682 |
+
"parameters": {
|
3683 |
+
"destinationBucket": {
|
3684 |
+
"type": "string",
|
3685 |
+
"description": "Name of the bucket in which to store the new object. Overrides the provided object metadata's bucket value, if any.",
|
3686 |
+
"required": true,
|
3687 |
+
"location": "path"
|
3688 |
+
},
|
3689 |
+
"destinationKmsKeyName": {
|
3690 |
+
"type": "string",
|
3691 |
+
"description": "Resource name of the Cloud KMS key, of the form projects/my-project/locations/global/keyRings/my-kr/cryptoKeys/my-key, that will be used to encrypt the object. Overrides the object metadata's kms_key_name value, if any.",
|
3692 |
+
"location": "query"
|
3693 |
+
},
|
3694 |
+
"destinationObject": {
|
3695 |
+
"type": "string",
|
3696 |
+
"description": "Name of the new object. Required when the object metadata is not otherwise provided. Overrides the object metadata's name value, if any. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
|
3697 |
+
"required": true,
|
3698 |
+
"location": "path"
|
3699 |
+
},
|
3700 |
+
"destinationPredefinedAcl": {
|
3701 |
+
"type": "string",
|
3702 |
+
"description": "Apply a predefined set of access controls to the destination object.",
|
3703 |
+
"enum": [
|
3704 |
+
"authenticatedRead",
|
3705 |
+
"bucketOwnerFullControl",
|
3706 |
+
"bucketOwnerRead",
|
3707 |
+
"private",
|
3708 |
+
"projectPrivate",
|
3709 |
+
"publicRead"
|
3710 |
+
],
|
3711 |
+
"enumDescriptions": [
|
3712 |
+
"Object owner gets OWNER access, and allAuthenticatedUsers get READER access.",
|
3713 |
+
"Object owner gets OWNER access, and project team owners get OWNER access.",
|
3714 |
+
"Object owner gets OWNER access, and project team owners get READER access.",
|
3715 |
+
"Object owner gets OWNER access.",
|
3716 |
+
"Object owner gets OWNER access, and project team members get access according to their roles.",
|
3717 |
+
"Object owner gets OWNER access, and allUsers get READER access."
|
3718 |
+
],
|
3719 |
+
"location": "query"
|
3720 |
+
},
|
3721 |
+
"ifGenerationMatch": {
|
3722 |
+
"type": "string",
|
3723 |
+
"description": "Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.",
|
3724 |
+
"format": "int64",
|
3725 |
+
"location": "query"
|
3726 |
+
},
|
3727 |
+
"ifGenerationNotMatch": {
|
3728 |
+
"type": "string",
|
3729 |
+
"description": "Makes the operation conditional on whether the object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.",
|
3730 |
+
"format": "int64",
|
3731 |
+
"location": "query"
|
3732 |
+
},
|
3733 |
+
"ifMetagenerationMatch": {
|
3734 |
+
"type": "string",
|
3735 |
+
"description": "Makes the operation conditional on whether the destination object's current metageneration matches the given value.",
|
3736 |
+
"format": "int64",
|
3737 |
+
"location": "query"
|
3738 |
+
},
|
3739 |
+
"ifMetagenerationNotMatch": {
|
3740 |
+
"type": "string",
|
3741 |
+
"description": "Makes the operation conditional on whether the destination object's current metageneration does not match the given value.",
|
3742 |
+
"format": "int64",
|
3743 |
+
"location": "query"
|
3744 |
+
},
|
3745 |
+
"ifSourceGenerationMatch": {
|
3746 |
+
"type": "string",
|
3747 |
+
"description": "Makes the operation conditional on whether the source object's current generation matches the given value.",
|
3748 |
+
"format": "int64",
|
3749 |
+
"location": "query"
|
3750 |
+
},
|
3751 |
+
"ifSourceGenerationNotMatch": {
|
3752 |
+
"type": "string",
|
3753 |
+
"description": "Makes the operation conditional on whether the source object's current generation does not match the given value.",
|
3754 |
+
"format": "int64",
|
3755 |
+
"location": "query"
|
3756 |
+
},
|
3757 |
+
"ifSourceMetagenerationMatch": {
|
3758 |
+
"type": "string",
|
3759 |
+
"description": "Makes the operation conditional on whether the source object's current metageneration matches the given value.",
|
3760 |
+
"format": "int64",
|
3761 |
+
"location": "query"
|
3762 |
+
},
|
3763 |
+
"ifSourceMetagenerationNotMatch": {
|
3764 |
+
"type": "string",
|
3765 |
+
"description": "Makes the operation conditional on whether the source object's current metageneration does not match the given value.",
|
3766 |
+
"format": "int64",
|
3767 |
+
"location": "query"
|
3768 |
+
},
|
3769 |
+
"maxBytesRewrittenPerCall": {
|
3770 |
+
"type": "string",
|
3771 |
+
"description": "The maximum number of bytes that will be rewritten per rewrite request. Most callers shouldn't need to specify this parameter - it is primarily in place to support testing. If specified the value must be an integral multiple of 1 MiB (1048576). Also, this only applies to requests where the source and destination span locations and/or storage classes. Finally, this value must not change across rewrite calls else you'll get an error that the rewriteToken is invalid.",
|
3772 |
+
"format": "int64",
|
3773 |
+
"location": "query"
|
3774 |
+
},
|
3775 |
+
"projection": {
|
3776 |
+
"type": "string",
|
3777 |
+
"description": "Set of properties to return. Defaults to noAcl, unless the object resource specifies the acl property, when it defaults to full.",
|
3778 |
+
"enum": [
|
3779 |
+
"full",
|
3780 |
+
"noAcl"
|
3781 |
+
],
|
3782 |
+
"enumDescriptions": [
|
3783 |
+
"Include all properties.",
|
3784 |
+
"Omit the owner, acl property."
|
3785 |
+
],
|
3786 |
+
"location": "query"
|
3787 |
+
},
|
3788 |
+
"provisionalUserProject": {
|
3789 |
+
"type": "string",
|
3790 |
+
"description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
|
3791 |
+
"location": "query"
|
3792 |
+
},
|
3793 |
+
"rewriteToken": {
|
3794 |
+
"type": "string",
|
3795 |
+
"description": "Include this field (from the previous rewrite response) on each rewrite request after the first one, until the rewrite response 'done' flag is true. Calls that provide a rewriteToken can omit all other request fields, but if included those fields must match the values provided in the first rewrite request.",
|
3796 |
+
"location": "query"
|
3797 |
+
},
|
3798 |
+
"sourceBucket": {
|
3799 |
+
"type": "string",
|
3800 |
+
"description": "Name of the bucket in which to find the source object.",
|
3801 |
+
"required": true,
|
3802 |
+
"location": "path"
|
3803 |
+
},
|
3804 |
+
"sourceGeneration": {
|
3805 |
+
"type": "string",
|
3806 |
+
"description": "If present, selects a specific revision of the source object (as opposed to the latest version, the default).",
|
3807 |
+
"format": "int64",
|
3808 |
+
"location": "query"
|
3809 |
+
},
|
3810 |
+
"sourceObject": {
|
3811 |
+
"type": "string",
|
3812 |
+
"description": "Name of the source object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
|
3813 |
+
"required": true,
|
3814 |
+
"location": "path"
|
3815 |
+
},
|
3816 |
+
"userProject": {
|
3817 |
+
"type": "string",
|
3818 |
+
"description": "The project to be billed for this request. Required for Requester Pays buckets.",
|
3819 |
+
"location": "query"
|
3820 |
+
}
|
3821 |
+
},
|
3822 |
+
"parameterOrder": [
|
3823 |
+
"sourceBucket",
|
3824 |
+
"sourceObject",
|
3825 |
+
"destinationBucket",
|
3826 |
+
"destinationObject"
|
3827 |
+
],
|
3828 |
+
"request": {
|
3829 |
+
"$ref": "Object"
|
3830 |
+
},
|
3831 |
+
"response": {
|
3832 |
+
"$ref": "RewriteResponse"
|
3833 |
+
},
|
3834 |
+
"scopes": [
|
3835 |
+
"https://www.googleapis.com/auth/cloud-platform",
|
3836 |
+
"https://www.googleapis.com/auth/devstorage.full_control",
|
3837 |
+
"https://www.googleapis.com/auth/devstorage.read_write"
|
3838 |
+
]
|
3839 |
+
},
|
3840 |
+
"setIamPolicy": {
|
3841 |
+
"id": "storage.objects.setIamPolicy",
|
3842 |
+
"path": "b/{bucket}/o/{object}/iam",
|
3843 |
+
"httpMethod": "PUT",
|
3844 |
+
"description": "Updates an IAM policy for the specified object.",
|
3845 |
+
"parameters": {
|
3846 |
+
"bucket": {
|
3847 |
+
"type": "string",
|
3848 |
+
"description": "Name of the bucket in which the object resides.",
|
3849 |
+
"required": true,
|
3850 |
+
"location": "path"
|
3851 |
+
},
|
3852 |
+
"generation": {
|
3853 |
+
"type": "string",
|
3854 |
+
"description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
|
3855 |
+
"format": "int64",
|
3856 |
+
"location": "query"
|
3857 |
+
},
|
3858 |
+
"object": {
|
3859 |
+
"type": "string",
|
3860 |
+
"description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
|
3861 |
+
"required": true,
|
3862 |
+
"location": "path"
|
3863 |
+
},
|
3864 |
+
"provisionalUserProject": {
|
3865 |
+
"type": "string",
|
3866 |
+
"description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
|
3867 |
+
"location": "query"
|
3868 |
+
},
|
3869 |
+
"userProject": {
|
3870 |
+
"type": "string",
|
3871 |
+
"description": "The project to be billed for this request. Required for Requester Pays buckets.",
|
3872 |
+
"location": "query"
|
3873 |
+
}
|
3874 |
+
},
|
3875 |
+
"parameterOrder": [
|
3876 |
+
"bucket",
|
3877 |
+
"object"
|
3878 |
+
],
|
3879 |
+
"request": {
|
3880 |
+
"$ref": "Policy"
|
3881 |
+
},
|
3882 |
+
"response": {
|
3883 |
+
"$ref": "Policy"
|
3884 |
+
},
|
3885 |
+
"scopes": [
|
3886 |
+
"https://www.googleapis.com/auth/cloud-platform",
|
3887 |
+
"https://www.googleapis.com/auth/devstorage.full_control",
|
3888 |
+
"https://www.googleapis.com/auth/devstorage.read_write"
|
3889 |
+
]
|
3890 |
+
},
|
3891 |
+
"testIamPermissions": {
|
3892 |
+
"id": "storage.objects.testIamPermissions",
|
3893 |
+
"path": "b/{bucket}/o/{object}/iam/testPermissions",
|
3894 |
+
"httpMethod": "GET",
|
3895 |
+
"description": "Tests a set of permissions on the given object to see which, if any, are held by the caller.",
|
3896 |
+
"parameters": {
|
3897 |
+
"bucket": {
|
3898 |
+
"type": "string",
|
3899 |
+
"description": "Name of the bucket in which the object resides.",
|
3900 |
+
"required": true,
|
3901 |
+
"location": "path"
|
3902 |
+
},
|
3903 |
+
"generation": {
|
3904 |
+
"type": "string",
|
3905 |
+
"description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
|
3906 |
+
"format": "int64",
|
3907 |
+
"location": "query"
|
3908 |
+
},
|
3909 |
+
"object": {
|
3910 |
+
"type": "string",
|
3911 |
+
"description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
|
3912 |
+
"required": true,
|
3913 |
+
"location": "path"
|
3914 |
+
},
|
3915 |
+
"permissions": {
|
3916 |
+
"type": "string",
|
3917 |
+
"description": "Permissions to test.",
|
3918 |
+
"required": true,
|
3919 |
+
"repeated": true,
|
3920 |
+
"location": "query"
|
3921 |
+
},
|
3922 |
+
"provisionalUserProject": {
|
3923 |
+
"type": "string",
|
3924 |
+
"description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
|
3925 |
+
"location": "query"
|
3926 |
+
},
|
3927 |
+
"userProject": {
|
3928 |
+
"type": "string",
|
3929 |
+
"description": "The project to be billed for this request. Required for Requester Pays buckets.",
|
3930 |
+
"location": "query"
|
3931 |
+
}
|
3932 |
+
},
|
3933 |
+
"parameterOrder": [
|
3934 |
+
"bucket",
|
3935 |
+
"object",
|
3936 |
+
"permissions"
|
3937 |
+
],
|
3938 |
+
"response": {
|
3939 |
+
"$ref": "TestIamPermissionsResponse"
|
3940 |
+
},
|
3941 |
+
"scopes": [
|
3942 |
+
"https://www.googleapis.com/auth/cloud-platform",
|
3943 |
+
"https://www.googleapis.com/auth/cloud-platform.read-only",
|
3944 |
+
"https://www.googleapis.com/auth/devstorage.full_control",
|
3945 |
+
"https://www.googleapis.com/auth/devstorage.read_only",
|
3946 |
+
"https://www.googleapis.com/auth/devstorage.read_write"
|
3947 |
+
]
|
3948 |
+
},
|
3949 |
+
"update": {
|
3950 |
+
"id": "storage.objects.update",
|
3951 |
+
"path": "b/{bucket}/o/{object}",
|
3952 |
+
"httpMethod": "PUT",
|
3953 |
+
"description": "Updates an object's metadata.",
|
3954 |
+
"parameters": {
|
3955 |
+
"bucket": {
|
3956 |
+
"type": "string",
|
3957 |
+
"description": "Name of the bucket in which the object resides.",
|
3958 |
+
"required": true,
|
3959 |
+
"location": "path"
|
3960 |
+
},
|
3961 |
+
"generation": {
|
3962 |
+
"type": "string",
|
3963 |
+
"description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
|
3964 |
+
"format": "int64",
|
3965 |
+
"location": "query"
|
3966 |
+
},
|
3967 |
+
"ifGenerationMatch": {
|
3968 |
+
"type": "string",
|
3969 |
+
"description": "Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.",
|
3970 |
+
"format": "int64",
|
3971 |
+
"location": "query"
|
3972 |
+
},
|
3973 |
+
"ifGenerationNotMatch": {
|
3974 |
+
"type": "string",
|
3975 |
+
"description": "Makes the operation conditional on whether the object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.",
|
3976 |
+
"format": "int64",
|
3977 |
+
"location": "query"
|
3978 |
+
},
|
3979 |
+
"ifMetagenerationMatch": {
|
3980 |
+
"type": "string",
|
3981 |
+
"description": "Makes the operation conditional on whether the object's current metageneration matches the given value.",
|
3982 |
+
"format": "int64",
|
3983 |
+
"location": "query"
|
3984 |
+
},
|
3985 |
+
"ifMetagenerationNotMatch": {
|
3986 |
+
"type": "string",
|
3987 |
+
"description": "Makes the operation conditional on whether the object's current metageneration does not match the given value.",
|
3988 |
+
"format": "int64",
|
3989 |
+
"location": "query"
|
3990 |
+
},
|
3991 |
+
"object": {
|
3992 |
+
"type": "string",
|
3993 |
+
"description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
|
3994 |
+
"required": true,
|
3995 |
+
"location": "path"
|
3996 |
+
},
|
3997 |
+
"predefinedAcl": {
|
3998 |
+
"type": "string",
|
3999 |
+
"description": "Apply a predefined set of access controls to this object.",
|
4000 |
+
"enum": [
|
4001 |
+
"authenticatedRead",
|
4002 |
+
"bucketOwnerFullControl",
|
4003 |
+
"bucketOwnerRead",
|
4004 |
+
"private",
|
4005 |
+
"projectPrivate",
|
4006 |
+
"publicRead"
|
4007 |
+
],
|
4008 |
+
"enumDescriptions": [
|
4009 |
+
"Object owner gets OWNER access, and allAuthenticatedUsers get READER access.",
|
4010 |
+
"Object owner gets OWNER access, and project team owners get OWNER access.",
|
4011 |
+
"Object owner gets OWNER access, and project team owners get READER access.",
|
4012 |
+
"Object owner gets OWNER access.",
|
4013 |
+
"Object owner gets OWNER access, and project team members get access according to their roles.",
|
4014 |
+
"Object owner gets OWNER access, and allUsers get READER access."
|
4015 |
+
],
|
4016 |
+
"location": "query"
|
4017 |
+
},
|
4018 |
+
"projection": {
|
4019 |
+
"type": "string",
|
4020 |
+
"description": "Set of properties to return. Defaults to full.",
|
4021 |
+
"enum": [
|
4022 |
+
"full",
|
4023 |
+
"noAcl"
|
4024 |
+
],
|
4025 |
+
"enumDescriptions": [
|
4026 |
+
"Include all properties.",
|
4027 |
+
"Omit the owner, acl property."
|
4028 |
+
],
|
4029 |
+
"location": "query"
|
4030 |
+
},
|
4031 |
+
"provisionalUserProject": {
|
4032 |
+
"type": "string",
|
4033 |
+
"description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
|
4034 |
+
"location": "query"
|
4035 |
+
},
|
4036 |
+
"userProject": {
|
4037 |
+
"type": "string",
|
4038 |
+
"description": "The project to be billed for this request. Required for Requester Pays buckets.",
|
4039 |
+
"location": "query"
|
4040 |
+
}
|
4041 |
+
},
|
4042 |
+
"parameterOrder": [
|
4043 |
+
"bucket",
|
4044 |
+
"object"
|
4045 |
+
],
|
4046 |
+
"request": {
|
4047 |
+
"$ref": "Object"
|
4048 |
+
},
|
4049 |
+
"response": {
|
4050 |
+
"$ref": "Object"
|
4051 |
+
},
|
4052 |
+
"scopes": [
|
4053 |
+
"https://www.googleapis.com/auth/cloud-platform",
|
4054 |
+
"https://www.googleapis.com/auth/devstorage.full_control"
|
4055 |
+
]
|
4056 |
+
},
|
4057 |
+
"watchAll": {
|
4058 |
+
"id": "storage.objects.watchAll",
|
4059 |
+
"path": "b/{bucket}/o/watch",
|
4060 |
+
"httpMethod": "POST",
|
4061 |
+
"description": "Watch for changes on all objects in a bucket.",
|
4062 |
+
"parameters": {
|
4063 |
+
"bucket": {
|
4064 |
+
"type": "string",
|
4065 |
+
"description": "Name of the bucket in which to look for objects.",
|
4066 |
+
"required": true,
|
4067 |
+
"location": "path"
|
4068 |
+
},
|
4069 |
+
"delimiter": {
|
4070 |
+
"type": "string",
|
4071 |
+
"description": "Returns results in a directory-like mode. items will contain only objects whose names, aside from the prefix, do not contain delimiter. Objects whose names, aside from the prefix, contain delimiter will have their name, truncated after the delimiter, returned in prefixes. Duplicate prefixes are omitted.",
|
4072 |
+
"location": "query"
|
4073 |
+
},
|
4074 |
+
"includeTrailingDelimiter": {
|
4075 |
+
"type": "boolean",
|
4076 |
+
"description": "If true, objects that end in exactly one instance of delimiter will have their metadata included in items in addition to prefixes.",
|
4077 |
+
"location": "query"
|
4078 |
+
},
|
4079 |
+
"maxResults": {
|
4080 |
+
"type": "integer",
|
4081 |
+
"description": "Maximum number of items plus prefixes to return in a single page of responses. As duplicate prefixes are omitted, fewer total results may be returned than requested. The service will use this parameter or 1,000 items, whichever is smaller.",
|
4082 |
+
"default": "1000",
|
4083 |
+
"format": "uint32",
|
4084 |
+
"minimum": "0",
|
4085 |
+
"location": "query"
|
4086 |
+
},
|
4087 |
+
"pageToken": {
|
4088 |
+
"type": "string",
|
4089 |
+
"description": "A previously-returned page token representing part of the larger set of results to view.",
|
4090 |
+
"location": "query"
|
4091 |
+
},
|
4092 |
+
"prefix": {
|
4093 |
+
"type": "string",
|
4094 |
+
"description": "Filter results to objects whose names begin with this prefix.",
|
4095 |
+
"location": "query"
|
4096 |
+
},
|
4097 |
+
"projection": {
|
4098 |
+
"type": "string",
|
4099 |
+
"description": "Set of properties to return. Defaults to noAcl.",
|
4100 |
+
"enum": [
|
4101 |
+
"full",
|
4102 |
+
"noAcl"
|
4103 |
+
],
|
4104 |
+
"enumDescriptions": [
|
4105 |
+
"Include all properties.",
|
4106 |
+
"Omit the owner, acl property."
|
4107 |
+
],
|
4108 |
+
"location": "query"
|
4109 |
+
},
|
4110 |
+
"provisionalUserProject": {
|
4111 |
+
"type": "string",
|
4112 |
+
"description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
|
4113 |
+
"location": "query"
|
4114 |
+
},
|
4115 |
+
"userProject": {
|
4116 |
+
"type": "string",
|
4117 |
+
"description": "The project to be billed for this request. Required for Requester Pays buckets.",
|
4118 |
+
"location": "query"
|
4119 |
+
},
|
4120 |
+
"versions": {
|
4121 |
+
"type": "boolean",
|
4122 |
+
"description": "If true, lists all versions of an object as distinct results. The default is false. For more information, see Object Versioning.",
|
4123 |
+
"location": "query"
|
4124 |
+
}
|
4125 |
+
},
|
4126 |
+
"parameterOrder": [
|
4127 |
+
"bucket"
|
4128 |
+
],
|
4129 |
+
"request": {
|
4130 |
+
"$ref": "Channel",
|
4131 |
+
"parameterName": "resource"
|
4132 |
+
},
|
4133 |
+
"response": {
|
4134 |
+
"$ref": "Channel"
|
4135 |
+
},
|
4136 |
+
"scopes": [
|
4137 |
+
"https://www.googleapis.com/auth/cloud-platform",
|
4138 |
+
"https://www.googleapis.com/auth/cloud-platform.read-only",
|
4139 |
+
"https://www.googleapis.com/auth/devstorage.full_control",
|
4140 |
+
"https://www.googleapis.com/auth/devstorage.read_only",
|
4141 |
+
"https://www.googleapis.com/auth/devstorage.read_write"
|
4142 |
+
],
|
4143 |
+
"supportsSubscription": true
|
4144 |
+
}
|
4145 |
+
}
|
4146 |
+
},
|
4147 |
+
"projects": {
|
4148 |
+
"resources": {
|
4149 |
+
"hmacKeys": {
|
4150 |
"methods": {
|
4151 |
+
"create": {
|
4152 |
+
"id": "storage.projects.hmacKeys.create",
|
4153 |
+
"path": "projects/{projectId}/hmacKeys",
|
4154 |
+
"httpMethod": "POST",
|
4155 |
+
"description": "Creates a new HMAC key for the specified service account.",
|
4156 |
+
"parameters": {
|
4157 |
+
"projectId": {
|
4158 |
+
"type": "string",
|
4159 |
+
"description": "Project ID owning the service account.",
|
4160 |
+
"required": true,
|
4161 |
+
"location": "path"
|
4162 |
+
},
|
4163 |
+
"serviceAccountEmail": {
|
4164 |
+
"type": "string",
|
4165 |
+
"description": "Email address of the service account.",
|
4166 |
+
"required": true,
|
4167 |
+
"location": "query"
|
4168 |
+
},
|
4169 |
+
"userProject": {
|
4170 |
+
"type": "string",
|
4171 |
+
"description": "The project to be billed for this request.",
|
4172 |
+
"location": "query"
|
4173 |
+
}
|
4174 |
+
},
|
4175 |
+
"parameterOrder": [
|
4176 |
+
"projectId",
|
4177 |
+
"serviceAccountEmail"
|
4178 |
+
],
|
4179 |
+
"response": {
|
4180 |
+
"$ref": "HmacKey"
|
4181 |
+
},
|
4182 |
+
"scopes": [
|
4183 |
+
"https://www.googleapis.com/auth/cloud-platform",
|
4184 |
+
"https://www.googleapis.com/auth/devstorage.full_control"
|
4185 |
+
]
|
4186 |
+
},
|
4187 |
+
"delete": {
|
4188 |
+
"id": "storage.projects.hmacKeys.delete",
|
4189 |
+
"path": "projects/{projectId}/hmacKeys/{accessId}",
|
4190 |
+
"httpMethod": "DELETE",
|
4191 |
+
"description": "Deletes an HMAC key.",
|
4192 |
+
"parameters": {
|
4193 |
+
"accessId": {
|
4194 |
+
"type": "string",
|
4195 |
+
"description": "Name of the HMAC key to be deleted.",
|
4196 |
+
"required": true,
|
4197 |
+
"location": "path"
|
4198 |
+
},
|
4199 |
+
"projectId": {
|
4200 |
+
"type": "string",
|
4201 |
+
"description": "Project ID owning the requested key",
|
4202 |
+
"required": true,
|
4203 |
+
"location": "path"
|
4204 |
+
},
|
4205 |
+
"userProject": {
|
4206 |
+
"type": "string",
|
4207 |
+
"description": "The project to be billed for this request.",
|
4208 |
+
"location": "query"
|
4209 |
+
}
|
4210 |
+
},
|
4211 |
+
"parameterOrder": [
|
4212 |
+
"projectId",
|
4213 |
+
"accessId"
|
4214 |
+
],
|
4215 |
+
"scopes": [
|
4216 |
+
"https://www.googleapis.com/auth/cloud-platform",
|
4217 |
+
"https://www.googleapis.com/auth/devstorage.full_control",
|
4218 |
+
"https://www.googleapis.com/auth/devstorage.read_write"
|
4219 |
+
]
|
4220 |
+
},
|
4221 |
+
"get": {
|
4222 |
+
"id": "storage.projects.hmacKeys.get",
|
4223 |
+
"path": "projects/{projectId}/hmacKeys/{accessId}",
|
4224 |
+
"httpMethod": "GET",
|
4225 |
+
"description": "Retrieves an HMAC key's metadata",
|
4226 |
+
"parameters": {
|
4227 |
+
"accessId": {
|
4228 |
+
"type": "string",
|
4229 |
+
"description": "Name of the HMAC key.",
|
4230 |
+
"required": true,
|
4231 |
+
"location": "path"
|
4232 |
+
},
|
4233 |
+
"projectId": {
|
4234 |
+
"type": "string",
|
4235 |
+
"description": "Project ID owning the service account of the requested key.",
|
4236 |
+
"required": true,
|
4237 |
+
"location": "path"
|
4238 |
+
},
|
4239 |
+
"userProject": {
|
4240 |
+
"type": "string",
|
4241 |
+
"description": "The project to be billed for this request.",
|
4242 |
+
"location": "query"
|
4243 |
+
}
|
4244 |
+
},
|
4245 |
+
"parameterOrder": [
|
4246 |
+
"projectId",
|
4247 |
+
"accessId"
|
4248 |
+
],
|
4249 |
+
"response": {
|
4250 |
+
"$ref": "HmacKeyMetadata"
|
4251 |
+
},
|
4252 |
+
"scopes": [
|
4253 |
+
"https://www.googleapis.com/auth/cloud-platform",
|
4254 |
+
"https://www.googleapis.com/auth/cloud-platform.read-only",
|
4255 |
+
"https://www.googleapis.com/auth/devstorage.full_control",
|
4256 |
+
"https://www.googleapis.com/auth/devstorage.read_only"
|
4257 |
+
]
|
4258 |
+
},
|
4259 |
+
"list": {
|
4260 |
+
"id": "storage.projects.hmacKeys.list",
|
4261 |
+
"path": "projects/{projectId}/hmacKeys",
|
4262 |
+
"httpMethod": "GET",
|
4263 |
+
"description": "Retrieves a list of HMAC keys matching the criteria.",
|
4264 |
+
"parameters": {
|
4265 |
+
"maxResults": {
|
4266 |
+
"type": "integer",
|
4267 |
+
"description": "Maximum number of items to return in a single page of responses. The service uses this parameter or 250 items, whichever is smaller. The max number of items per page will also be limited by the number of distinct service accounts in the response. If the number of service accounts in a single response is too high, the page will truncated and a next page token will be returned.",
|
4268 |
+
"default": "250",
|
4269 |
+
"format": "uint32",
|
4270 |
+
"minimum": "0",
|
4271 |
+
"location": "query"
|
4272 |
+
},
|
4273 |
+
"pageToken": {
|
4274 |
+
"type": "string",
|
4275 |
+
"description": "A previously-returned page token representing part of the larger set of results to view.",
|
4276 |
+
"location": "query"
|
4277 |
+
},
|
4278 |
+
"projectId": {
|
4279 |
+
"type": "string",
|
4280 |
+
"description": "Name of the project in which to look for HMAC keys.",
|
4281 |
+
"required": true,
|
4282 |
+
"location": "path"
|
4283 |
+
},
|
4284 |
+
"serviceAccountEmail": {
|
4285 |
+
"type": "string",
|
4286 |
+
"description": "If present, only keys for the given service account are returned.",
|
4287 |
+
"location": "query"
|
4288 |
+
},
|
4289 |
+
"showDeletedKeys": {
|
4290 |
+
"type": "boolean",
|
4291 |
+
"description": "Whether or not to show keys in the DELETED state.",
|
4292 |
+
"location": "query"
|
4293 |
+
},
|
4294 |
+
"userProject": {
|
4295 |
+
"type": "string",
|
4296 |
+
"description": "The project to be billed for this request.",
|
4297 |
+
"location": "query"
|
4298 |
+
}
|
4299 |
+
},
|
4300 |
+
"parameterOrder": [
|
4301 |
+
"projectId"
|
4302 |
+
],
|
4303 |
+
"response": {
|
4304 |
+
"$ref": "HmacKeysMetadata"
|
4305 |
+
},
|
4306 |
+
"scopes": [
|
4307 |
+
"https://www.googleapis.com/auth/cloud-platform",
|
4308 |
+
"https://www.googleapis.com/auth/cloud-platform.read-only",
|
4309 |
+
"https://www.googleapis.com/auth/devstorage.full_control",
|
4310 |
+
"https://www.googleapis.com/auth/devstorage.read_only"
|
4311 |
+
]
|
4312 |
+
},
|
4313 |
+
"update": {
|
4314 |
+
"id": "storage.projects.hmacKeys.update",
|
4315 |
+
"path": "projects/{projectId}/hmacKeys/{accessId}",
|
4316 |
+
"httpMethod": "PUT",
|
4317 |
+
"description": "Updates the state of an HMAC key. See the HMAC Key resource descriptor for valid states.",
|
4318 |
+
"parameters": {
|
4319 |
+
"accessId": {
|
4320 |
+
"type": "string",
|
4321 |
+
"description": "Name of the HMAC key being updated.",
|
4322 |
+
"required": true,
|
4323 |
+
"location": "path"
|
4324 |
+
},
|
4325 |
+
"projectId": {
|
4326 |
+
"type": "string",
|
4327 |
+
"description": "Project ID owning the service account of the updated key.",
|
4328 |
+
"required": true,
|
4329 |
+
"location": "path"
|
4330 |
+
},
|
4331 |
+
"userProject": {
|
4332 |
+
"type": "string",
|
4333 |
+
"description": "The project to be billed for this request.",
|
4334 |
+
"location": "query"
|
4335 |
+
}
|
4336 |
+
},
|
4337 |
+
"parameterOrder": [
|
4338 |
+
"projectId",
|
4339 |
+
"accessId"
|
4340 |
+
],
|
4341 |
+
"request": {
|
4342 |
+
"$ref": "HmacKeyMetadata"
|
4343 |
+
},
|
4344 |
+
"response": {
|
4345 |
+
"$ref": "HmacKeyMetadata"
|
4346 |
+
},
|
4347 |
+
"scopes": [
|
4348 |
+
"https://www.googleapis.com/auth/cloud-platform",
|
4349 |
+
"https://www.googleapis.com/auth/devstorage.full_control"
|
4350 |
+
]
|
4351 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4352 |
}
|
4353 |
+
},
|
4354 |
+
"serviceAccount": {
|
4355 |
"methods": {
|
4356 |
+
"get": {
|
4357 |
+
"id": "storage.projects.serviceAccount.get",
|
4358 |
+
"path": "projects/{projectId}/serviceAccount",
|
4359 |
+
"httpMethod": "GET",
|
4360 |
+
"description": "Get the email address of this project's Google Cloud Storage service account.",
|
4361 |
+
"parameters": {
|
4362 |
+
"projectId": {
|
4363 |
+
"type": "string",
|
4364 |
+
"description": "Project ID",
|
4365 |
+
"required": true,
|
4366 |
+
"location": "path"
|
4367 |
+
},
|
4368 |
+
"provisionalUserProject": {
|
4369 |
+
"type": "string",
|
4370 |
+
"description": "The project to be billed for this request if the target bucket is requester-pays bucket.",
|
4371 |
+
"location": "query"
|
4372 |
+
},
|
4373 |
+
"userProject": {
|
4374 |
+
"type": "string",
|
4375 |
+
"description": "The project to be billed for this request.",
|
4376 |
+
"location": "query"
|
4377 |
+
}
|
4378 |
+
},
|
4379 |
+
"parameterOrder": [
|
4380 |
+
"projectId"
|
4381 |
+
],
|
4382 |
+
"response": {
|
4383 |
+
"$ref": "ServiceAccount"
|
4384 |
+
},
|
4385 |
+
"scopes": [
|
4386 |
+
"https://www.googleapis.com/auth/cloud-platform",
|
4387 |
+
"https://www.googleapis.com/auth/cloud-platform.read-only",
|
4388 |
+
"https://www.googleapis.com/auth/devstorage.full_control",
|
4389 |
+
"https://www.googleapis.com/auth/devstorage.read_only",
|
4390 |
+
"https://www.googleapis.com/auth/devstorage.read_write"
|
4391 |
+
]
|
4392 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4393 |
}
|
4394 |
+
}
|
4395 |
}
|
4396 |
+
}
|
4397 |
}
|
4398 |
+
}
|
@@ -0,0 +1,82 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Copyright 2019 Google LLC
|
5 |
+
*
|
6 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
7 |
+
* you may not use this file except in compliance with the License.
|
8 |
+
* You may obtain a copy of the License at
|
9 |
+
*
|
10 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
11 |
+
*
|
12 |
+
* Unless required by applicable law or agreed to in writing, software
|
13 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
14 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
15 |
+
* See the License for the specific language governing permissions and
|
16 |
+
* limitations under the License.
|
17 |
+
*/
|
18 |
+
namespace DeliciousBrains\WP_Offload_Media\Gcp\Google\Cloud\Storage;
|
19 |
+
|
20 |
+
/**
|
21 |
+
* Represents a newly created HMAC key. Provides access to the key metadata and
|
22 |
+
* secret.
|
23 |
+
*
|
24 |
+
* Example:
|
25 |
+
* ```
|
26 |
+
* use Google\Cloud\Storage\StorageClient;
|
27 |
+
*
|
28 |
+
* $storage = new StorageClient();
|
29 |
+
* $response = $storage->createHmacKey($serviceAccountEmail);
|
30 |
+
* ```
|
31 |
+
*/
|
32 |
+
class CreatedHmacKey
|
33 |
+
{
|
34 |
+
/**
|
35 |
+
* @var HmacKey
|
36 |
+
*/
|
37 |
+
private $hmacKey;
|
38 |
+
/**
|
39 |
+
* @var string
|
40 |
+
*/
|
41 |
+
private $secret;
|
42 |
+
/**
|
43 |
+
* @param HmacKey $hmacKey The HMAC Key object.
|
44 |
+
* @param string $secret The HMAC key secret.
|
45 |
+
*/
|
46 |
+
public function __construct(\DeliciousBrains\WP_Offload_Media\Gcp\Google\Cloud\Storage\HmacKey $hmacKey, $secret)
|
47 |
+
{
|
48 |
+
$this->hmacKey = $hmacKey;
|
49 |
+
$this->secret = $secret;
|
50 |
+
}
|
51 |
+
/**
|
52 |
+
* Get the HMAC key object.
|
53 |
+
*
|
54 |
+
* Example:
|
55 |
+
* ```
|
56 |
+
* $key = $response->hmacKey();
|
57 |
+
* ```
|
58 |
+
*
|
59 |
+
* @return HmacKey
|
60 |
+
*/
|
61 |
+
public function hmacKey()
|
62 |
+
{
|
63 |
+
return $this->hmacKey;
|
64 |
+
}
|
65 |
+
/**
|
66 |
+
* Get the HMAC key secret.
|
67 |
+
*
|
68 |
+
* This value will never be returned from the API after first creation. Make
|
69 |
+
* sure to record it for later use immediately upon key creation.
|
70 |
+
*
|
71 |
+
* Example:
|
72 |
+
* ```
|
73 |
+
* $secret = $response->secret();
|
74 |
+
* ```
|
75 |
+
*
|
76 |
+
* @return string
|
77 |
+
*/
|
78 |
+
public function secret()
|
79 |
+
{
|
80 |
+
return $this->secret;
|
81 |
+
}
|
82 |
+
}
|
@@ -17,7 +17,6 @@
|
|
17 |
*/
|
18 |
namespace DeliciousBrains\WP_Offload_Media\Gcp\Google\Cloud\Storage;
|
19 |
|
20 |
-
use InvalidArgumentException;
|
21 |
use DeliciousBrains\WP_Offload_Media\Gcp\phpseclib\Crypt\RSA;
|
22 |
/**
|
23 |
* Trait which provides helper methods for customer-supplied encryption.
|
@@ -85,6 +84,10 @@ trait EncryptionTrait
|
|
85 |
/**
|
86 |
* Sign a string using a given private key.
|
87 |
*
|
|
|
|
|
|
|
|
|
88 |
* @param string $privateKey The private key to use to sign the data.
|
89 |
* @param string $data The data to sign.
|
90 |
* @param bool $forceOpenssl If true, OpenSSL will be used regardless of
|
17 |
*/
|
18 |
namespace DeliciousBrains\WP_Offload_Media\Gcp\Google\Cloud\Storage;
|
19 |
|
|
|
20 |
use DeliciousBrains\WP_Offload_Media\Gcp\phpseclib\Crypt\RSA;
|
21 |
/**
|
22 |
* Trait which provides helper methods for customer-supplied encryption.
|
84 |
/**
|
85 |
* Sign a string using a given private key.
|
86 |
*
|
87 |
+
* @deprecated Please use the {@see Google\Auth\SignBlobInterface::signBlob()}
|
88 |
+
* and implementations for signing strings.
|
89 |
+
* This method will be removed in a future release.
|
90 |
+
*
|
91 |
* @param string $privateKey The private key to use to sign the data.
|
92 |
* @param string $data The data to sign.
|
93 |
* @param bool $forceOpenssl If true, OpenSSL will be used regardless of
|
@@ -0,0 +1,170 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Copyright 2019 Google LLC
|
5 |
+
*
|
6 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
7 |
+
* you may not use this file except in compliance with the License.
|
8 |
+
* You may obtain a copy of the License at
|
9 |
+
*
|
10 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
11 |
+
*
|
12 |
+
* Unless required by applicable law or agreed to in writing, software
|
13 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
14 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
15 |
+
* See the License for the specific language governing permissions and
|
16 |
+
* limitations under the License.
|
17 |
+
*/
|
18 |
+
namespace DeliciousBrains\WP_Offload_Media\Gcp\Google\Cloud\Storage;
|
19 |
+
|
20 |
+
use DeliciousBrains\WP_Offload_Media\Gcp\Google\Cloud\Storage\Connection\ConnectionInterface;
|
21 |
+
/**
|
22 |
+
* Represents a Service Account HMAC key.
|
23 |
+
*
|
24 |
+
* Example:
|
25 |
+
* ```
|
26 |
+
* use Google\Cloud\Storage\StorageClient;
|
27 |
+
*
|
28 |
+
* $storage = new StorageClient();
|
29 |
+
* $hmacKey = $storage->hmacKey($accessId);
|
30 |
+
* ```
|
31 |
+
*/
|
32 |
+
class HmacKey
|
33 |
+
{
|
34 |
+
/**
|
35 |
+
* @var ConnectionInterface
|
36 |
+
*/
|
37 |
+
private $connection;
|
38 |
+
/**
|
39 |
+
* @var string
|
40 |
+
*/
|
41 |
+
private $projectId;
|
42 |
+
/**
|
43 |
+
* @var string
|
44 |
+
*/
|
45 |
+
private $accessId;
|
46 |
+
/**
|
47 |
+
* @var array|null
|
48 |
+
*/
|
49 |
+
private $info;
|
50 |
+
/**
|
51 |
+
* @param ConnectionInterface $connection A connection to Cloud Storage.
|
52 |
+
* @param string $projectId The current project ID.
|
53 |
+
* @param string $accessId The key identifier.
|
54 |
+
* @param array|null $info The key metadata.
|
55 |
+
*/
|
56 |
+
public function __construct(\DeliciousBrains\WP_Offload_Media\Gcp\Google\Cloud\Storage\Connection\ConnectionInterface $connection, $projectId, $accessId, array $info = [])
|
57 |
+
{
|
58 |
+
$this->connection = $connection;
|
59 |
+
$this->projectId = $projectId;
|
60 |
+
$this->accessId = $accessId;
|
61 |
+
$this->info = $info;
|
62 |
+
}
|
63 |
+
/**
|
64 |
+
* Get the HMAC Key Access ID.
|
65 |
+
*
|
66 |
+
* Example:
|
67 |
+
* ```
|
68 |
+
* $accessId = $hmacKey->accessId();
|
69 |
+
* ```
|
70 |
+
*
|
71 |
+
* @return string
|
72 |
+
*/
|
73 |
+
public function accessId()
|
74 |
+
{
|
75 |
+
return $this->accessId;
|
76 |
+
}
|
77 |
+
/**
|
78 |
+
* Fetch the key metadata from Cloud Storage.
|
79 |
+
*
|
80 |
+
* Example:
|
81 |
+
* ```
|
82 |
+
* $keyMetadata = $hmacKey->reload();
|
83 |
+
* ```
|
84 |
+
*
|
85 |
+
* @param array $options {
|
86 |
+
* Configuration Options
|
87 |
+
*
|
88 |
+
* @type string $userProject If set, this is the ID of the project which
|
89 |
+
* will be billed for the request. **NOTE**: This option is
|
90 |
+
* currently ignored by Cloud Storage.
|
91 |
+
* }
|
92 |
+
* @return array
|
93 |
+
*/
|
94 |
+
public function reload(array $options = [])
|
95 |
+
{
|
96 |
+
$this->info = $this->connection->getHmacKey(['projectId' => $this->projectId, 'accessId' => $this->accessId] + $options);
|
97 |
+
return $this->info;
|
98 |
+
}
|
99 |
+
/**
|
100 |
+
* Get the HMAC Key Metadata.
|
101 |
+
*
|
102 |
+
* If the metadata is not already available, it will be requested from Cloud
|
103 |
+
* Storage.
|
104 |
+
*
|
105 |
+
* Example:
|
106 |
+
* ```
|
107 |
+
* $keyMetadata = $hmacKey->info();
|
108 |
+
* ```
|
109 |
+
*
|
110 |
+
* @param array $options {
|
111 |
+
* Configuration Options
|
112 |
+
*
|
113 |
+
* @type string $userProject If set, this is the ID of the project which
|
114 |
+
* will be billed for the request. **NOTE**: This option is
|
115 |
+
* currently ignored by Cloud Storage.
|
116 |
+
* }
|
117 |
+
* @return array
|
118 |
+
*/
|
119 |
+
public function info(array $options = [])
|
120 |
+
{
|
121 |
+
return $this->info ?: $this->reload($options);
|
122 |
+
}
|
123 |
+
/**
|
124 |
+
* Update the HMAC Key state.
|
125 |
+
*
|
126 |
+
* Example:
|
127 |
+
* ```
|
128 |
+
* $hmacKey->update('INACTIVE');
|
129 |
+
* ```
|
130 |
+
*
|
131 |
+
* @param string $state The key state. Either `ACTIVE` or `INACTIVE`.
|
132 |
+
* @param array $options {
|
133 |
+
* Configuration Options
|
134 |
+
*
|
135 |
+
* @type string $userProject If set, this is the ID of the project which
|
136 |
+
* will be billed for the request. **NOTE**: This option is
|
137 |
+
* currently ignored by Cloud Storage.
|
138 |
+
* }
|
139 |
+
* @return array
|
140 |
+
*/
|
141 |
+
public function update($state, array $options = [])
|
142 |
+
{
|
143 |
+
$this->info = $this->connection->updateHmacKey(['accessId' => $this->accessId, 'projectId' => $this->projectId, 'state' => $state] + $options);
|
144 |
+
return $this->info;
|
145 |
+
}
|
146 |
+
/**
|
147 |
+
* Delete the HMAC Key.
|
148 |
+
*
|
149 |
+
* Key state must be set to `INACTIVE` prior to deletion. See
|
150 |
+
* {@see Google\Cloud\Storage\HmacKey::update()} for details.
|
151 |
+
*
|
152 |
+
* Example:
|
153 |
+
* ```
|
154 |
+
* $hmacKey->delete();
|
155 |
+
* ```
|
156 |
+
*
|
157 |
+
* @param array $options {
|
158 |
+
* Configuration Options
|
159 |
+
*
|
160 |
+
* @type string $userProject If set, this is the ID of the project which
|
161 |
+
* will be billed for the request. **NOTE**: This option is
|
162 |
+
* currently ignored by Cloud Storage.
|
163 |
+
* }
|
164 |
+
* @return void
|
165 |
+
*/
|
166 |
+
public function delete(array $options = [])
|
167 |
+
{
|
168 |
+
$this->connection->deleteHmacKey(['accessId' => $this->accessId, 'projectId' => $this->projectId] + $options);
|
169 |
+
}
|
170 |
+
}
|
@@ -173,7 +173,7 @@ class Notification
|
|
173 |
* echo $notification->identity()['bucket'];
|
174 |
* ```
|
175 |
*
|
176 |
-
* @return
|
177 |
*/
|
178 |
public function identity()
|
179 |
{
|
173 |
* echo $notification->identity()['bucket'];
|
174 |
* ```
|
175 |
*
|
176 |
+
* @return array
|
177 |
*/
|
178 |
public function identity()
|
179 |
{
|
@@ -32,6 +32,6 @@ class ObjectIterator implements \Iterator
|
|
32 |
*/
|
33 |
public function prefixes()
|
34 |
{
|
35 |
-
return $this->pageIterator->prefixes();
|
36 |
}
|
37 |
}
|
32 |
*/
|
33 |
public function prefixes()
|
34 |
{
|
35 |
+
return method_exists($this->pageIterator, 'prefixes') ? $this->pageIterator->prefixes() : [];
|
36 |
}
|
37 |
}
|
@@ -0,0 +1,452 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Copyright 2019 Google LLC
|
5 |
+
*
|
6 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
7 |
+
* you may not use this file except in compliance with the License.
|
8 |
+
* You may obtain a copy of the License at
|
9 |
+
*
|
10 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
11 |
+
*
|
12 |
+
* Unless required by applicable law or agreed to in writing, software
|
13 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
14 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
15 |
+
* See the License for the specific language governing permissions and
|
16 |
+
* limitations under the License.
|
17 |
+
*/
|
18 |
+
namespace DeliciousBrains\WP_Offload_Media\Gcp\Google\Cloud\Storage;
|
19 |
+
|
20 |
+
use DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth\CredentialsLoader;
|
21 |
+
use DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth\SignBlobInterface;
|
22 |
+
use DeliciousBrains\WP_Offload_Media\Gcp\Google\Cloud\Core\JsonTrait;
|
23 |
+
use DeliciousBrains\WP_Offload_Media\Gcp\Google\Cloud\Core\Timestamp;
|
24 |
+
use DeliciousBrains\WP_Offload_Media\Gcp\Google\Cloud\Storage\Connection\ConnectionInterface;
|
25 |
+
/**
|
26 |
+
* Provides common methods for signing storage URLs.
|
27 |
+
*
|
28 |
+
* @internal
|
29 |
+
*/
|
30 |
+
class SigningHelper
|
31 |
+
{
|
32 |
+
use JsonTrait;
|
33 |
+
const DEFAULT_URL_SIGNING_VERSION = 'v2';
|
34 |
+
const DEFAULT_DOWNLOAD_HOST = 'storage.googleapis.com';
|
35 |
+
const V4_ALGO_NAME = 'GOOG4-RSA-SHA256';
|
36 |
+
const V4_TIMESTAMP_FORMAT = 'Ymd\\THis\\Z';
|
37 |
+
const V4_DATESTAMP_FORMAT = 'Ymd';
|
38 |
+
/**
|
39 |
+
* Create or fetch a SigningHelper instance.
|
40 |
+
*
|
41 |
+
* @return SigningHelper
|
42 |
+
*/
|
43 |
+
public static function getHelper()
|
44 |
+
{
|
45 |
+
static $helper;
|
46 |
+
if (!$helper) {
|
47 |
+
$helper = new static();
|
48 |
+
}
|
49 |
+
return $helper;
|
50 |
+
}
|
51 |
+
/**
|
52 |
+
* Sign using the version inferred from `$options.version`.
|
53 |
+
*
|
54 |
+
* @param ConnectionInterface $connection A connection to the Cloud Storage
|
55 |
+
* API.
|
56 |
+
* @param Timestamp|\DateTimeInterface|int $expires The signed URL
|
57 |
+
* expiration.
|
58 |
+
* @param string $resource The URI to the storage resource, preceded by a
|
59 |
+
* leading slash.
|
60 |
+
* @param int|null $generation The resource generation.
|
61 |
+
* @param array $options Configuration options. See
|
62 |
+
* {@see Google\Cloud\Storage\StorageObject::signedUrl()} for
|
63 |
+
* details.
|
64 |
+
* @return string
|
65 |
+
* @throws \InvalidArgumentException
|
66 |
+
* @throws \RuntimeException If required data could not be gathered from
|
67 |
+
* credentials.
|
68 |
+
* @throws \RuntimeException If OpenSSL signing is required by user input
|
69 |
+
* and OpenSSL is not available.
|
70 |
+
*/
|
71 |
+
public function sign(\DeliciousBrains\WP_Offload_Media\Gcp\Google\Cloud\Storage\Connection\ConnectionInterface $connection, $expires, $resource, $generation, array $options)
|
72 |
+
{
|
73 |
+
$version = isset($options['version']) ? $options['version'] : self::DEFAULT_URL_SIGNING_VERSION;
|
74 |
+
unset($options['version']);
|
75 |
+
switch (strtolower($version)) {
|
76 |
+
case 'v2':
|
77 |
+
$method = 'v2Sign';
|
78 |
+
break;
|
79 |
+
case 'v4':
|
80 |
+
$method = 'v4Sign';
|
81 |
+
break;
|
82 |
+
default:
|
83 |
+
throw new \InvalidArgumentException('Invalid signing version.');
|
84 |
+
}
|
85 |
+
return call_user_func_array([$this, $method], func_get_args());
|
86 |
+
}
|
87 |
+
/**
|
88 |
+
* Sign a URL using Google Signed URLs v2.
|
89 |
+
*
|
90 |
+
* This method will be deprecated in the future.
|
91 |
+
*
|
92 |
+
* @param ConnectionInterface $connection A connection to the Cloud Storage
|
93 |
+
* API.
|
94 |
+
* @param Timestamp|\DateTimeInterface|int $expires The signed URL
|
95 |
+
* expiration.
|
96 |
+
* @param string $resource The URI to the storage resource, preceded by a
|
97 |
+
* leading slash.
|
98 |
+
* @param int|null $generation The resource generation.
|
99 |
+
* @param array $options Configuration options. See
|
100 |
+
* {@see Google\Cloud\Storage\StorageObject::signedUrl()} for
|
101 |
+
* details.
|
102 |
+
* @return string
|
103 |
+
* @throws \InvalidArgumentException
|
104 |
+
* @throws \RuntimeException If required data could not be gathered from
|
105 |
+
* credentials.
|
106 |
+
* @throws \RuntimeException If OpenSSL signing is required by user input
|
107 |
+
* and OpenSSL is not available.
|
108 |
+
*/
|
109 |
+
public function v2Sign(\DeliciousBrains\WP_Offload_Media\Gcp\Google\Cloud\Storage\Connection\ConnectionInterface $connection, $expires, $resource, $generation, array $options)
|
110 |
+
{
|
111 |
+
list($credentials, $options) = $this->getSigningCredentials($connection, $options);
|
112 |
+
$expires = $this->normalizeExpiration($expires);
|
113 |
+
$resource = $this->normalizeResource($resource);
|
114 |
+
$options = $this->normalizeOptions($options);
|
115 |
+
$headers = $this->normalizeHeaders($options['headers']);
|
116 |
+
// Make sure disallowed headers are not included.
|
117 |
+
$illegalHeaders = ['x-goog-encryption-key', 'x-goog-encryption-key-sha256'];
|
118 |
+
if ($illegal = array_intersect_key(array_flip($illegalHeaders), $headers)) {
|
119 |
+
throw new \InvalidArgumentException(sprintf('%s %s not allowed in Signed URL headers.', implode(' and ', array_keys($illegal)), count($illegal) === 1 ? 'is' : 'are'));
|
120 |
+
}
|
121 |
+
// Sort headers by name.
|
122 |
+
ksort($headers);
|
123 |
+
$toSign = [$options['method'], $options['contentMd5'], $options['contentType'], $expires];
|
124 |
+
$signedHeaders = [];
|
125 |
+
foreach ($headers as $name => $value) {
|
126 |
+
$signedHeaders[] = $name . ':' . $value;
|
127 |
+
}
|
128 |
+
// Push the headers onto the end of the signing string.
|
129 |
+
if ($signedHeaders) {
|
130 |
+
$toSign = array_merge($toSign, $signedHeaders);
|
131 |
+
}
|
132 |
+
$toSign[] = $resource;
|
133 |
+
$stringToSign = $this->createV2CanonicalRequest($toSign);
|
134 |
+
$signature = $credentials->signBlob($stringToSign, ['forceOpenssl' => $options['forceOpenssl']]);
|
135 |
+
// Start with user-provided query params and add required parameters.
|
136 |
+
$params = $options['queryParams'];
|
137 |
+
$params['GoogleAccessId'] = $credentials->getClientName();
|
138 |
+
$params['Expires'] = $expires;
|
139 |
+
$params['Signature'] = $signature;
|
140 |
+
$params = $this->addCommonParams($generation, $params, $options);
|
141 |
+
$queryString = $this->buildQueryString($params);
|
142 |
+
$resource = $this->normalizeUriPath($options['cname'], $resource);
|
143 |
+
return 'https://' . $options['cname'] . $resource . '?' . $queryString;
|
144 |
+
}
|
145 |
+
/**
|
146 |
+
* Sign a storage URL using Google Signed URLs v4.
|
147 |
+
*
|
148 |
+
* @param ConnectionInterface $connection A connection to the Cloud Storage
|
149 |
+
* API.
|
150 |
+
* @param Timestamp|\DateTimeInterface|int $expires The signed URL
|
151 |
+
* expiration.
|
152 |
+
* @param string $resource The URI to the storage resource, preceded by a
|
153 |
+
* leading slash.
|
154 |
+
* @param int|null $generation The resource generation.
|
155 |
+
* @param array $options Configuration options. See
|
156 |
+
* {@see Google\Cloud\Storage\StorageObject::signedUrl()} for
|
157 |
+
* details.
|
158 |
+
* @return string
|
159 |
+
* @throws \InvalidArgumentException
|
160 |
+
* @throws \RuntimeException If required data could not be gathered from
|
161 |
+
* credentials.
|
162 |
+
* @throws \RuntimeException If OpenSSL signing is required by user input
|
163 |
+
* and OpenSSL is not available.
|
164 |
+
*/
|
165 |
+
public function v4Sign(\DeliciousBrains\WP_Offload_Media\Gcp\Google\Cloud\Storage\Connection\ConnectionInterface $connection, $expires, $resource, $generation, array $options)
|
166 |
+
{
|
167 |
+
list($credentials, $options) = $this->getSigningCredentials($connection, $options);
|
168 |
+
$expires = $this->normalizeExpiration($expires);
|
169 |
+
$resource = $this->normalizeResource($resource);
|
170 |
+
$options = $this->normalizeOptions($options);
|
171 |
+
$time = $options['timestamp'];
|
172 |
+
$requestTimestamp = $time->format(self::V4_TIMESTAMP_FORMAT);
|
173 |
+
$requestDatestamp = $time->format(self::V4_DATESTAMP_FORMAT);
|
174 |
+
$timeSeconds = $time->format('U');
|
175 |
+
$expireLimit = $timeSeconds + 604800;
|
176 |
+
if ($expires > $expireLimit) {
|
177 |
+
throw new \InvalidArgumentException('V4 Signed URLs may not have an expiration greater than seven days in the future.');
|
178 |
+
}
|
179 |
+
$clientEmail = $credentials->getClientName();
|
180 |
+
$credentialScope = sprintf('%s/auto/storage/goog4_request', $requestDatestamp);
|
181 |
+
$credential = sprintf('%s/%s', $clientEmail, $credentialScope);
|
182 |
+
// Add headers and query params based on provided options.
|
183 |
+
$params = $options['queryParams'];
|
184 |
+
$headers = $options['headers'] + ['host' => $options['cname']];
|
185 |
+
if ($options['contentType']) {
|
186 |
+
$headers['content-type'] = $options['contentType'];
|
187 |
+
}
|
188 |
+
if ($options['contentMd5']) {
|
189 |
+
$headers['content-md5'] = $options['contentMd5'];
|
190 |
+
}
|
191 |
+
$params = $this->addCommonParams($generation, $params, $options);
|
192 |
+
$headers = $this->normalizeHeaders($headers);
|
193 |
+
// sort headers by name
|
194 |
+
ksort($headers, SORT_NATURAL | SORT_FLAG_CASE);
|
195 |
+
// Canonical headers are a list, newline separated, of keys and values,
|
196 |
+
// comma separated.
|
197 |
+
// Signed headers are a list of keys, separated by a semicolon.
|
198 |
+
$canonicalHeaders = [];
|
199 |
+
$signedHeaders = [];
|
200 |
+
foreach ($headers as $key => $val) {
|
201 |
+
$canonicalHeaders[] = sprintf('%s:%s', $key, $val);
|
202 |
+
$signedHeaders[] = $key;
|
203 |
+
}
|
204 |
+
$canonicalHeaders = implode("\n", $canonicalHeaders) . "\n";
|
205 |
+
$signedHeaders = implode(';', $signedHeaders);
|
206 |
+
// Add required query parameters.
|
207 |
+
$params['X-Goog-Algorithm'] = self::V4_ALGO_NAME;
|
208 |
+
$params['X-Goog-Credential'] = $credential;
|
209 |
+
$params['X-Goog-Date'] = $requestTimestamp;
|
210 |
+
$params['X-Goog-Expires'] = $expires - $timeSeconds;
|
211 |
+
$params['X-Goog-SignedHeaders'] = $signedHeaders;
|
212 |
+
// Sort query string params by name.
|
213 |
+
ksort($params, SORT_NATURAL | SORT_FLAG_CASE);
|
214 |
+
$canonicalQueryString = $this->buildQueryString($params);
|
215 |
+
$canonicalRequest = [$options['method'], $resource, $canonicalQueryString, $canonicalHeaders, $signedHeaders, 'UNSIGNED-PAYLOAD'];
|
216 |
+
$requestHash = $this->createV4CanonicalRequest($canonicalRequest);
|
217 |
+
// Construct the string to sign.
|
218 |
+
$stringToSign = implode("\n", [self::V4_ALGO_NAME, $requestTimestamp, $credentialScope, $requestHash]);
|
219 |
+
$signature = bin2hex(base64_decode($credentials->signBlob($stringToSign, ['forceOpenssl' => $options['forceOpenssl']])));
|
220 |
+
// Construct the modified resource name. If a custom cname is provided,
|
221 |
+
// this will remove the bucket name from the resource.
|
222 |
+
$resource = $this->normalizeUriPath($options['cname'], $resource);
|
223 |
+
return sprintf('https://%s%s?%s&X-Goog-Signature=%s', $options['cname'], $resource, $canonicalQueryString, $signature);
|
224 |
+
}
|
225 |
+
/**
|
226 |
+
* Creates a canonical request hash for a V4 Signed URL.
|
227 |
+
*
|
228 |
+
* NOTE: While in most cases `PHP_EOL` is preferable to a system-specific
|
229 |
+
* character, in this case `\n` is required.
|
230 |
+
*
|
231 |
+
* @param array $canonicalRequest The canonical request, with each element
|
232 |
+
* representing a line in the request.
|
233 |
+
* @return string
|
234 |
+
*/
|
235 |
+
private function createV4CanonicalRequest(array $canonicalRequest)
|
236 |
+
{
|
237 |
+
return bin2hex(hash('sha256', implode("\n", $canonicalRequest), true));
|
238 |
+
}
|
239 |
+
/**
|
240 |
+
* Creates a canonical request for a V2 Signed URL.
|
241 |
+
*
|
242 |
+
* NOTE: While in most cases `PHP_EOL` is preferable to a system-specific
|
243 |
+
* character, in this case `\n` is required.
|
244 |
+
*
|
245 |
+
* @param array $canonicalRequest The canonical request, with each element
|
246 |
+
* representing a line in the request.
|
247 |
+
* @return string
|
248 |
+
*/
|
249 |
+
private function createV2CanonicalRequest(array $canonicalRequest)
|
250 |
+
{
|
251 |
+
return implode("\n", $canonicalRequest);
|
252 |
+
}
|
253 |
+
/**
|
254 |
+
* Normalizes and validates an expiration.
|
255 |
+
*
|
256 |
+
* @param Timestamp|\DateTimeInterface|int $expires The expiration
|
257 |
+
* @return int
|
258 |
+
* @throws \InvalidArgumentException If an invalid value is given.
|
259 |
+
*/
|
260 |
+
private function normalizeExpiration($expires)
|
261 |
+
{
|
262 |
+
if ($expires instanceof Timestamp) {
|
263 |
+
$seconds = $expires->get()->format('U');
|
264 |
+
} elseif ($expires instanceof \DateTimeInterface) {
|
265 |
+
$seconds = $expires->format('U');
|
266 |
+
} elseif (is_numeric($expires)) {
|
267 |
+
$seconds = (int) $expires;
|
268 |
+
} else {
|
269 |
+
throw new \InvalidArgumentException('Invalid expiration.');
|
270 |
+
}
|
271 |
+
return $seconds;
|
272 |
+
}
|
273 |
+
/**
|
274 |
+
* Normalizes and encodes the resource identifier.
|
275 |
+
*
|
276 |
+
* @param string $resource The resource identifier. In form
|
277 |
+
* `[/]$bucket/$object`.
|
278 |
+
* @return string The resource, with pieces encoded and prefixed with a
|
279 |
+
* forward slash.
|
280 |
+
*/
|
281 |
+
private function normalizeResource($resource)
|
282 |
+
{
|
283 |
+
$pieces = explode('/', trim($resource, '/'));
|
284 |
+
array_walk($pieces, function (&$piece) {
|
285 |
+
$piece = rawurlencode($piece);
|
286 |
+
});
|
287 |
+
return '/' . implode('/', $pieces);
|
288 |
+
}
|
289 |
+
/**
|
290 |
+
* Fixes the user input options, filters and validates data.
|
291 |
+
*
|
292 |
+
* @param array $options Signed URL configuration options.
|
293 |
+
* @return array
|
294 |
+
* @throws \InvalidArgumentException
|
295 |
+
*/
|
296 |
+
private function normalizeOptions(array $options)
|
297 |
+
{
|
298 |
+
$options += ['method' => 'GET', 'cname' => self::DEFAULT_DOWNLOAD_HOST, 'contentMd5' => null, 'contentType' => null, 'headers' => [], 'saveAsName' => null, 'responseDisposition' => null, 'responseType' => null, 'keyFile' => null, 'keyFilePath' => null, 'allowPost' => false, 'forceOpenssl' => false, 'queryParams' => [], 'timestamp' => null];
|
299 |
+
$allowedMethods = ['GET', 'PUT', 'POST', 'DELETE'];
|
300 |
+
$options['method'] = strtoupper($options['method']);
|
301 |
+
if (!in_array($options['method'], $allowedMethods)) {
|
302 |
+
throw new \InvalidArgumentException('$options.method must be one of `GET`, `PUT` or `DELETE`.');
|
303 |
+
}
|
304 |
+
if ($options['method'] === 'POST' && !$options['allowPost']) {
|
305 |
+
throw new \InvalidArgumentException('Invalid method. To create an upload URI, use StorageObject::signedUploadUrl().');
|
306 |
+
}
|
307 |
+
unset($options['allowPost']);
|
308 |
+
// For backwards compatibility, strip protocol from cname.
|
309 |
+
$cnameParts = explode('//', $options['cname']);
|
310 |
+
if (count($cnameParts) > 1) {
|
311 |
+
$options['cname'] = $cnameParts[1];
|
312 |
+
}
|
313 |
+
$options['cname'] = trim($options['cname'], '/');
|
314 |
+
// If a timestamp is provided, use it in place of `now` for v4 URLs only..
|
315 |
+
// This option exists for testing purposes, and should not generally be provided by users.
|
316 |
+
if ($options['timestamp']) {
|
317 |
+
if (!$options['timestamp'] instanceof \DateTimeInterface) {
|
318 |
+
if (!is_string($options['timestamp'])) {
|
319 |
+
throw new \InvalidArgumentException('User-provided timestamps must be a string or instance of `\\DateTimeInterface`.');
|
320 |
+
}
|
321 |
+
$options['timestamp'] = \DateTimeImmutable::createFromFormat(self::V4_TIMESTAMP_FORMAT, $options['timestamp'], new \DateTimeZone('UTC'));
|
322 |
+
if (!$options['timestamp']) {
|
323 |
+
throw new \InvalidArgumentException('Given timestamp string is in an invalid format. Provide timestamp formatted as follows: `' . self::V4_TIMESTAMP_FORMAT . '`. Note that timestamps MUST be in UTC.');
|
324 |
+
}
|
325 |
+
}
|
326 |
+
} else {
|
327 |
+
$options['timestamp'] = new \DateTimeImmutable('now', new \DateTimeZone('UTC'));
|
328 |
+
}
|
329 |
+
return $options;
|
330 |
+
}
|
331 |
+
/**
|
332 |
+
* Cleans and normalizes header values.
|
333 |
+
*
|
334 |
+
* Arrays of values are collapsed into a comma-separated list, trailing and
|
335 |
+
* leading spaces are removed, newlines are replaced by empty strings, and
|
336 |
+
* multiple whitespace chars are replaced by a single space.
|
337 |
+
*
|
338 |
+
* @param array $headers Input headers
|
339 |
+
* @return array
|
340 |
+
*/
|
341 |
+
private function normalizeHeaders(array $headers)
|
342 |
+
{
|
343 |
+
$out = [];
|
344 |
+
foreach ($headers as $name => $value) {
|
345 |
+
$name = strtolower(trim($name));
|
346 |
+
// collapse arrays of values into a comma-separated list.
|
347 |
+
if (!is_array($value)) {
|
348 |
+
$value = [$value];
|
349 |
+
}
|
350 |
+
foreach ($value as &$headerValue) {
|
351 |
+
// strip trailing and leading spaces.
|
352 |
+
$headerValue = trim($headerValue);
|
353 |
+
// replace newlines with empty strings.
|
354 |
+
$headerValue = str_replace(PHP_EOL, '', $headerValue);
|
355 |
+
// collapse multiple whitespace chars to a single space.
|
356 |
+
$headerValue = preg_replace('/\\s+/', ' ', $headerValue);
|
357 |
+
}
|
358 |
+
$out[$name] = implode(', ', $value);
|
359 |
+
}
|
360 |
+
return $out;
|
361 |
+
}
|
362 |
+
/**
|
363 |
+
* Returns a resource formatted for use in a URI.
|
364 |
+
*
|
365 |
+
* If the cname is other than the default, will omit the bucket name.
|
366 |
+
*
|
367 |
+
* @param string $cname The cname provided by the user, or the default
|
368 |
+
* value.
|
369 |
+
* @param string $resource The GCS resource path (i.e. /bucket/object).
|
370 |
+
* @return string
|
371 |
+
*/
|
372 |
+
private function normalizeUriPath($cname, $resource)
|
373 |
+
{
|
374 |
+
if ($cname !== self::DEFAULT_DOWNLOAD_HOST) {
|
375 |
+
$resourceParts = explode('/', trim($resource, '/'));
|
376 |
+
array_shift($resourceParts);
|
377 |
+
// Resource is a Bucket.
|
378 |
+
if (empty($resourceParts)) {
|
379 |
+
$resource = '/';
|
380 |
+
} else {
|
381 |
+
$resource = '/' . implode('/', $resourceParts);
|
382 |
+
}
|
383 |
+
}
|
384 |
+
return $resource;
|
385 |
+
}
|
386 |
+
/**
|
387 |
+
* Get the credentials for use with signing.
|
388 |
+
*
|
389 |
+
* @param ConnectionInterface $connection A Storage connection object.
|
390 |
+
* @param array $options Configuration options.
|
391 |
+
* @return array A list containing a credentials object at index 0 and the
|
392 |
+
* modified options at index 1.
|
393 |
+
* @throws \RuntimeException If the credentials type is not valid for signing.
|
394 |
+
* @throws \InvalidArgumentException If a keyfile is given and is not valid.
|
395 |
+
*/
|
396 |
+
private function getSigningCredentials(\DeliciousBrains\WP_Offload_Media\Gcp\Google\Cloud\Storage\Connection\ConnectionInterface $connection, array $options)
|
397 |
+
{
|
398 |
+
$keyFilePath = isset($options['keyFilePath']) ? $options['keyFilePath'] : null;
|
399 |
+
if ($keyFilePath) {
|
400 |
+
if (!file_exists($keyFilePath)) {
|
401 |
+
throw new \InvalidArgumentException(sprintf('Keyfile path %s does not exist.', $keyFilePath));
|
402 |
+
}
|
403 |
+
$options['keyFile'] = self::jsonDecode(file_get_contents($keyFilePath), true);
|
404 |
+
}
|
405 |
+
$rw = $connection->requestWrapper();
|
406 |
+
$keyFile = isset($options['keyFile']) ? $options['keyFile'] : null;
|
407 |
+
if ($keyFile) {
|
408 |
+
$scopes = isset($options['scopes']) ? $options['scopes'] : $rw->scopes();
|
409 |
+
$credentials = \DeliciousBrains\WP_Offload_Media\Gcp\Google\Auth\CredentialsLoader::makeCredentials($scopes, $keyFile);
|
410 |
+
} else {
|
411 |
+
$credentials = $rw->getCredentialsFetcher();
|
412 |
+
}
|
413 |
+
if (!$credentials instanceof SignBlobInterface) {
|
414 |
+
throw new \RuntimeException(sprintf('Credentials object is of type `%s` and is not valid for signing.', get_class($credentials)));
|
415 |
+
}
|
416 |
+
unset($options['keyFilePath'], $options['keyFile'], $options['scopes']);
|
417 |
+
return [$credentials, $options];
|
418 |
+
}
|
419 |
+
/**
|
420 |
+
* Add parameters common to all signed URL versions.
|
421 |
+
*
|
422 |
+
* @param int|null $generation
|
423 |
+
* @param array $params
|
424 |
+
* @param array $options
|
425 |
+
* @return array
|
426 |
+
*/
|
427 |
+
private function addCommonParams($generation, array $params, array $options)
|
428 |
+
{
|
429 |
+
if ($options['responseType']) {
|
430 |
+
$params['response-content-type'] = $options['responseType'];
|
431 |
+
}
|
432 |
+
if ($options['responseDisposition']) {
|
433 |
+
$params['response-content-disposition'] = $options['responseDisposition'];
|
434 |
+
} elseif ($options['saveAsName']) {
|
435 |
+
$params['response-content-disposition'] = 'attachment; filename=' . '"' . $options['saveAsName'] . '"';
|
436 |
+
}
|
437 |
+
if ($generation) {
|
438 |
+
$params['generation'] = $generation;
|
439 |
+
}
|
440 |
+
return $params;
|
441 |
+
}
|
442 |
+
/**
|
443 |
+
* Create a query string from an array, encoding spaces as `%20` rather than `+`.
|
444 |
+
*
|
445 |
+
* @param array $input
|
446 |
+
* @return string
|
447 |
+
*/
|
448 |
+
private function buildQueryString(array $input)
|
449 |
+
{
|
450 |
+
return http_build_query($input, '', '&', PHP_QUERY_RFC3986);
|
451 |
+
}
|
452 |
+
}
|
@@ -45,7 +45,7 @@ class StorageClient
|
|
45 |
{
|
46 |
use ArrayTrait;
|
47 |
use ClientTrait;
|
48 |
-
const VERSION = '1.
|
49 |
const FULL_CONTROL_SCOPE = 'https://www.googleapis.com/auth/devstorage.full_control';
|
50 |
const READ_ONLY_SCOPE = 'https://www.googleapis.com/auth/devstorage.read_only';
|
51 |
const READ_WRITE_SCOPE = 'https://www.googleapis.com/auth/devstorage.read_write';
|
@@ -170,9 +170,7 @@ class StorageClient
|
|
170 |
*/
|
171 |
public function buckets(array $options = [])
|
172 |
{
|
173 |
-
|
174 |
-
throw new \DeliciousBrains\WP_Offload_Media\Gcp\Google\Cloud\Core\Exception\GoogleException('No project ID was provided, ' . 'and we were unable to detect a default project ID.');
|
175 |
-
}
|
176 |
$resultLimit = $this->pluck('resultLimit', $options, false);
|
177 |
$bucketUserProject = $this->pluck('bucketUserProject', $options, false);
|
178 |
$bucketUserProject = !is_null($bucketUserProject) ? $bucketUserProject : true;
|
@@ -204,6 +202,7 @@ class StorageClient
|
|
204 |
* @see https://cloud.google.com/storage/docs/json_api/v1/buckets/insert Buckets insert API documentation.
|
205 |
*
|
206 |
* @param string $name Name of the bucket to be created.
|
|
|
207 |
* @param array $options [optional] {
|
208 |
* Configuration options.
|
209 |
*
|
@@ -270,15 +269,25 @@ class StorageClient
|
|
270 |
* period for objects in seconds. During the retention period an
|
271 |
* object cannot be overwritten or deleted. Retention period must
|
272 |
* be greater than zero and less than 100 years.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
273 |
* }
|
|
|
274 |
* @return Bucket
|
275 |
* @throws GoogleException When a project ID has not been detected.
|
276 |
*/
|
277 |
public function createBucket($name, array $options = [])
|
278 |
{
|
279 |
-
|
280 |
-
throw new \DeliciousBrains\WP_Offload_Media\Gcp\Google\Cloud\Core\Exception\GoogleException('No project ID was provided, ' . 'and we were unable to detect a default project ID.');
|
281 |
-
}
|
282 |
if (isset($options['lifecycle']) && $options['lifecycle'] instanceof Lifecycle) {
|
283 |
$options['lifecycle'] = $options['lifecycle']->toArray();
|
284 |
}
|
@@ -333,7 +342,7 @@ class StorageClient
|
|
333 |
* $timestamp = $storage->timestamp(new \DateTime('2003-02-05 11:15:02.421827Z'));
|
334 |
* ```
|
335 |
*
|
336 |
-
* @param \DateTimeInterface $
|
337 |
* @param int $nanoSeconds [optional] The number of nanoseconds in the timestamp.
|
338 |
* @return Timestamp
|
339 |
*/
|
@@ -362,4 +371,111 @@ class StorageClient
|
|
362 |
$resp = $this->connection->getServiceAccount($options + ['projectId' => $this->projectId]);
|
363 |
return $resp['email_address'];
|
364 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
365 |
}
|
45 |
{
|
46 |
use ArrayTrait;
|
47 |
use ClientTrait;
|
48 |
+
const VERSION = '1.16.0';
|
49 |
const FULL_CONTROL_SCOPE = 'https://www.googleapis.com/auth/devstorage.full_control';
|
50 |
const READ_ONLY_SCOPE = 'https://www.googleapis.com/auth/devstorage.read_only';
|
51 |
const READ_WRITE_SCOPE = 'https://www.googleapis.com/auth/devstorage.read_write';
|
170 |
*/
|
171 |
public function buckets(array $options = [])
|
172 |
{
|
173 |
+
$this->requireProjectId();
|
|
|
|
|
174 |
$resultLimit = $this->pluck('resultLimit', $options, false);
|
175 |
$bucketUserProject = $this->pluck('bucketUserProject', $options, false);
|
176 |
$bucketUserProject = !is_null($bucketUserProject) ? $bucketUserProject : true;
|
202 |
* @see https://cloud.google.com/storage/docs/json_api/v1/buckets/insert Buckets insert API documentation.
|
203 |
*
|
204 |
* @param string $name Name of the bucket to be created.
|
205 |
+
* @codingStandardsIgnoreStart
|
206 |
* @param array $options [optional] {
|
207 |
* Configuration options.
|
208 |
*
|
269 |
* period for objects in seconds. During the retention period an
|
270 |
* object cannot be overwritten or deleted. Retention period must
|
271 |
* be greater than zero and less than 100 years.
|
272 |
+
* @type array $iamConfiguration The bucket's IAM configuration.
|
273 |
+
* @type bool $iamConfiguration.bucketPolicyOnly.enabled this is an alias
|
274 |
+
* for $iamConfiguration.uniformBucketLevelAccess.
|
275 |
+
* @type bool $iamConfiguration.uniformBucketLevelAccess.enabled If set and
|
276 |
+
* true, access checks only use bucket-level IAM policies or
|
277 |
+
* above. When enabled, requests attempting to view or manipulate
|
278 |
+
* ACLs will fail with error code 400. **NOTE**: Before using
|
279 |
+
* Uniform bucket-level access, please review the
|
280 |
+
* [feature documentation](https://cloud.google.com/storage/docs/uniform-bucket-level-access),
|
281 |
+
* as well as
|
282 |
+
* [Should You Use uniform bucket-level access](https://cloud.google.com/storage/docs/uniform-bucket-level-access#should-you-use)
|
283 |
* }
|
284 |
+
* @codingStandardsIgnoreEnd
|
285 |
* @return Bucket
|
286 |
* @throws GoogleException When a project ID has not been detected.
|
287 |
*/
|
288 |
public function createBucket($name, array $options = [])
|
289 |
{
|
290 |
+
$this->requireProjectId();
|
|
|
|
|
291 |
if (isset($options['lifecycle']) && $options['lifecycle'] instanceof Lifecycle) {
|
292 |
$options['lifecycle'] = $options['lifecycle']->toArray();
|
293 |
}
|
342 |
* $timestamp = $storage->timestamp(new \DateTime('2003-02-05 11:15:02.421827Z'));
|
343 |
* ```
|
344 |
*
|
345 |
+
* @param \DateTimeInterface $timestamp The timestamp value.
|
346 |
* @param int $nanoSeconds [optional] The number of nanoseconds in the timestamp.
|
347 |
* @return Timestamp
|
348 |
*/
|
371 |
$resp = $this->connection->getServiceAccount($options + ['projectId' => $this->projectId]);
|
372 |
return $resp['email_address'];
|
373 |
}
|
374 |
+
/**
|
375 |
+
* List Service Account HMAC keys in the project.
|
376 |
+
*
|
377 |
+
* Example:
|
378 |
+
* ```
|
379 |
+
* $hmacKeys = $storage->hmacKeys();
|
380 |
+
* ```
|
381 |
+
*
|
382 |
+
* ```
|
383 |
+
* // Get the HMAC keys associated with a Service Account email
|
384 |
+
* $hmacKeys = $storage->hmacKeys([
|
385 |
+
* 'serviceAccountEmail' => $serviceAccountEmail
|
386 |
+
* ]);
|
387 |
+
* ```
|
388 |
+
*
|
389 |
+
* @param array $options {
|
390 |
+
* Configuration Options
|
391 |
+
*
|
392 |
+
* @type string $serviceAccountEmail If present, only keys for the given
|
393 |
+
* service account are returned.
|
394 |
+
* @type bool $showDeletedKeys Whether or not to show keys in the
|
395 |
+
* DELETED state.
|
396 |
+
* @type string $userProject If set, this is the ID of the project which
|
397 |
+
* will be billed for the request.
|
398 |
+
* @type string $projectId The project ID to use, if different from that
|
399 |
+
* with which the client was created.
|
400 |
+
* }
|
401 |
+
* @return ItemIterator<HmacKey>
|
402 |
+
*/
|
403 |
+
public function hmacKeys(array $options = [])
|
404 |
+
{
|
405 |
+
$options += ['projectId' => $this->projectId];
|
406 |
+
if (!$options['projectId']) {
|
407 |
+
$this->requireProjectId();
|
408 |
+
}
|
409 |
+
$resultLimit = $this->pluck('resultLimit', $options, false);
|
410 |
+
return new \DeliciousBrains\WP_Offload_Media\Gcp\Google\Cloud\Core\Iterator\ItemIterator(new \DeliciousBrains\WP_Offload_Media\Gcp\Google\Cloud\Core\Iterator\PageIterator(function (array $metadata) use($options) {
|
411 |
+
return $this->hmacKey($metadata['accessId'], $options['projectId'], $metadata);
|
412 |
+
}, [$this->connection, 'listHmacKeys'], $options, ['resultLimit' => $resultLimit]));
|
413 |
+
}
|
414 |
+
/**
|
415 |
+
* Lazily instantiate an HMAC Key instance using an Access ID.
|
416 |
+
*
|
417 |
+
* Example:
|
418 |
+
* ```
|
419 |
+
* $hmacKey = $storage->hmacKey($accessId);
|
420 |
+
* ```
|
421 |
+
*
|
422 |
+
* @param string $accessId The ID of the HMAC Key.
|
423 |
+
* @param string $projectId [optional] The project ID to use, if different
|
424 |
+
* from that with which the client was created.
|
425 |
+
* @param array $metadata [optional] HMAC key metadata.
|
426 |
+
* @return HmacKey
|
427 |
+
*/
|
428 |
+
public function hmacKey($accessId, $projectId = null, array $metadata = [])
|
429 |
+
{
|
430 |
+
if (!$projectId) {
|
431 |
+
$this->requireProjectId();
|
432 |
+
}
|
433 |
+
return new \DeliciousBrains\WP_Offload_Media\Gcp\Google\Cloud\Storage\HmacKey($this->connection, $projectId ?: $this->projectId, $accessId, $metadata);
|
434 |
+
}
|
435 |
+
/**
|
436 |
+
* Creates a new HMAC key for the specified service account.
|
437 |
+
*
|
438 |
+
* Please note that the HMAC secret is only available at creation. Make sure
|
439 |
+
* to note the secret after creation.
|
440 |
+
*
|
441 |
+
* Example:
|
442 |
+
* ```
|
443 |
+
* $response = $storage->createHmacKey('account@myProject.iam.gserviceaccount.com');
|
444 |
+
* $secret = $response->secret();
|
445 |
+
* ```
|
446 |
+
*
|
447 |
+
* @param string $serviceAccountEmail Email address of the service account.
|
448 |
+
* @param array $options {
|
449 |
+
* Configuration Options
|
450 |
+
*
|
451 |
+
* @type string $userProject If set, this is the ID of the project which
|
452 |
+
* will be billed for the request. **NOTE**: This option is
|
453 |
+
* currently ignored by Cloud Storage.
|
454 |
+
* @type string $projectId The project ID to use, if different from that
|
455 |
+
* with which the client was created.
|
456 |
+
* }
|
457 |
+
* @return CreatedHmacKey
|
458 |
+
*/
|
459 |
+
public function createHmacKey($serviceAccountEmail, array $options = [])
|
460 |
+
{
|
461 |
+
$options += ['projectId' => $this->projectId];
|
462 |
+
if (!$options['projectId']) {
|
463 |
+
$this->requireProjectId();
|
464 |
+
}
|
465 |
+
$res = $this->connection->createHmacKey(['projectId' => $options['projectId'], 'serviceAccountEmail' => $serviceAccountEmail] + $options);
|
466 |
+
$key = new \DeliciousBrains\WP_Offload_Media\Gcp\Google\Cloud\Storage\HmacKey($this->connection, $options['projectId'], $res['metadata']['accessId'], $res['metadata']);
|
467 |
+
return new \DeliciousBrains\WP_Offload_Media\Gcp\Google\Cloud\Storage\CreatedHmacKey($key, $res['secret']);
|
468 |
+
}
|
469 |
+
/**
|
470 |
+
* Throw an exception if no project ID available.
|
471 |
+
*
|
472 |
+
* @return void
|
473 |
+
* @throws GoogleException
|
474 |
+
*/
|
475 |
+
private function requireProjectId()
|
476 |
+
{
|
477 |
+
if (!$this->projectId) {
|
478 |
+
throw new \DeliciousBrains\WP_Offload_Media\Gcp\Google\Cloud\Core\Exception\GoogleException('No project ID was provided, ' . 'and we were unable to detect a default project ID.');
|
479 |
+
}
|
480 |
+
}
|
481 |
}
|
@@ -43,7 +43,10 @@ class StorageObject
|
|
43 |
{
|
44 |
use ArrayTrait;
|
45 |
use EncryptionTrait;
|
46 |
-
|
|
|
|
|
|
|
47 |
/**
|
48 |
* @var Acl ACL for the object.
|
49 |
*/
|
@@ -475,12 +478,18 @@ class StorageObject
|
|
475 |
/**
|
476 |
* Download an object as a string.
|
477 |
*
|
|
|
|
|
|
|
478 |
* Example:
|
479 |
* ```
|
480 |
* $string = $object->downloadAsString();
|
481 |
* echo $string;
|
482 |
* ```
|
483 |
*
|
|
|
|
|
|
|
484 |
* @param array $options [optional] {
|
485 |
* Configuration Options.
|
486 |
*
|
@@ -502,11 +511,17 @@ class StorageObject
|
|
502 |
/**
|
503 |
* Download an object to a specified location.
|
504 |
*
|
|
|
|
|
|
|
505 |
* Example:
|
506 |
* ```
|
507 |
* $stream = $object->downloadToFile(__DIR__ . '/my-file.txt');
|
508 |
* ```
|
509 |
*
|
|
|
|
|
|
|
510 |
* @param string $path Path to download the file to.
|
511 |
* @param array $options [optional] {
|
512 |
* Configuration Options.
|
@@ -532,12 +547,35 @@ class StorageObject
|
|
532 |
/**
|
533 |
* Download an object as a stream.
|
534 |
*
|
|
|
|
|
|
|
|
|
535 |
* Example:
|
536 |
* ```
|
537 |
* $stream = $object->downloadAsStream();
|
538 |
* echo $stream->getContents();
|
539 |
* ```
|
540 |
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
541 |
* @param array $options [optional] {
|
542 |
* Configuration Options.
|
543 |
*
|
@@ -559,6 +597,9 @@ class StorageObject
|
|
559 |
/**
|
560 |
* Asynchronously download an object as a stream.
|
561 |
*
|
|
|
|
|
|
|
562 |
* Example:
|
563 |
* ```
|
564 |
* use Psr\Http\Message\StreamInterface;
|
@@ -588,6 +629,8 @@ class StorageObject
|
|
588 |
* Promise\unwrap($promises);
|
589 |
* ```
|
590 |
*
|
|
|
|
|
591 |
* @see https://github.com/guzzle/promises Learn more about Guzzle Promises
|
592 |
*
|
593 |
* @param array $options [optional] {
|
@@ -618,18 +661,41 @@ class StorageObject
|
|
618 |
* Signed URLs can be complex, and it is strongly recommended you read and
|
619 |
* understand the [documentation](https://cloud.google.com/storage/docs/access-control/signed-urls).
|
620 |
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
621 |
* Example:
|
622 |
* ```
|
623 |
-
* $url = $object->signedUrl(new
|
624 |
* ```
|
625 |
*
|
626 |
* ```
|
627 |
* // Create a signed URL allowing updates to the object.
|
628 |
-
* $url = $object->signedUrl(new
|
629 |
* 'method' => 'PUT'
|
630 |
* ]);
|
631 |
* ```
|
632 |
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
633 |
* @see https://cloud.google.com/storage/docs/access-control/signed-urls Signed URLs
|
634 |
*
|
635 |
* @param Timestamp|\DateTimeInterface|int $expires Specifies when the URL
|
@@ -639,8 +705,6 @@ class StorageObject
|
|
639 |
* @param array $options {
|
640 |
* Configuration Options.
|
641 |
*
|
642 |
-
* @type string $method One of `GET`, `PUT` or `DELETE`.
|
643 |
-
* **Defaults to** `GET`.
|
644 |
* @type string $cname The CNAME for the bucket, for instance
|
645 |
* `https://cdn.example.com`. **Defaults to**
|
646 |
* `https://storage.googleapis.com`.
|
@@ -648,136 +712,60 @@ class StorageObject
|
|
648 |
* provide this, the client must provide this HTTP header with
|
649 |
* this same value in its request. If provided, take care to
|
650 |
* always provide this value as a base64 encoded string.
|
651 |
-
* @type array $headers If these headers are used, the server will check
|
652 |
-
* to make sure that the client provides matching values. Provide
|
653 |
-
* headers as a key/value array, where the key is the header name,
|
654 |
-
* and the value is an array of header values. Headers with multiple
|
655 |
-
* values may provide values as a simple array, or a
|
656 |
-
* comma-separated string. Headers names MUST begin with `x-goog-`.
|
657 |
-
* @type string $saveAsName The filename to prompt the user to save the
|
658 |
-
* file as when the signed url is accessed. This is ignored if
|
659 |
-
* `$options.responseDisposition` is set.
|
660 |
-
* @type string $responseDisposition The
|
661 |
-
* [`response-content-disposition`](http://www.iana.org/assignments/cont-disp/cont-disp.xhtml)
|
662 |
-
* parameter of the signed url.
|
663 |
* @type string $contentType If you provide this value, the client must
|
664 |
* provide this HTTP header set to the same value.
|
665 |
-
* @type
|
666 |
-
*
|
667 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
668 |
* @type array $keyFile Keyfile data to use in place of the keyfile with
|
669 |
* which the client was constructed. If `$options.keyFilePath` is
|
670 |
* set, this option is ignored.
|
671 |
* @type string $keyFilePath A path to a valid Keyfile to use in place
|
672 |
* of the keyfile with which the client was constructed.
|
673 |
-
* @type
|
674 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
675 |
* }
|
676 |
* @return string
|
677 |
* @throws \InvalidArgumentException If the given expiration is invalid or in the past.
|
678 |
* @throws \InvalidArgumentException If the given `$options.method` is not valid.
|
679 |
* @throws \InvalidArgumentException If the given `$options.keyFilePath` is not valid.
|
680 |
* @throws \InvalidArgumentException If the given custom headers are invalid.
|
681 |
-
* @throws \
|
|
|
682 |
*/
|
683 |
public function signedUrl($expires, array $options = [])
|
684 |
{
|
685 |
-
|
686 |
-
|
687 |
-
|
688 |
-
|
689 |
-
$seconds = $expires->format('U');
|
690 |
-
} elseif (is_numeric($expires)) {
|
691 |
-
$seconds = (int) $expires;
|
692 |
-
} else {
|
693 |
-
throw new \InvalidArgumentException('Invalid expiration.');
|
694 |
-
}
|
695 |
-
if ($seconds < time()) {
|
696 |
-
throw new \InvalidArgumentException('Expiration cannot be in the past.');
|
697 |
-
}
|
698 |
-
$allowedMethods = ['GET', 'PUT', 'POST', 'DELETE'];
|
699 |
-
$options['method'] = strtoupper($options['method']);
|
700 |
-
if (!in_array($options['method'], $allowedMethods)) {
|
701 |
-
throw new \InvalidArgumentException('$options.method must be one of `GET`, `PUT` or `DELETE`.');
|
702 |
-
}
|
703 |
-
if ($options['method'] === 'POST' && !$options['allowPost']) {
|
704 |
-
throw new \InvalidArgumentException('Invalid method. To create an upload URI, use StorageObject::signedUploadUrl().');
|
705 |
-
}
|
706 |
-
if ($options['keyFilePath']) {
|
707 |
-
if (!file_exists($options['keyFilePath'])) {
|
708 |
-
throw new \InvalidArgumentException(sprintf('Keyfile path %s does not exist.', $options['keyFilePath']));
|
709 |
-
}
|
710 |
-
$keyFile = json_decode(file_get_contents($options['keyFilePath']), true);
|
711 |
-
if (json_last_error() !== JSON_ERROR_NONE) {
|
712 |
-
throw new \InvalidArgumentException(sprintf('Keyfile path %s does not contain valid json.', $options['keyFilePath']));
|
713 |
-
}
|
714 |
-
} elseif ($options['keyFile']) {
|
715 |
-
$keyFile = $options['keyFile'];
|
716 |
-
} else {
|
717 |
-
$requestWrapper = $this->connection->requestWrapper();
|
718 |
-
$keyFile = $requestWrapper->keyFile();
|
719 |
-
}
|
720 |
-
if (!isset($keyFile['private_key']) || !isset($keyFile['client_email'])) {
|
721 |
-
throw new \RuntimeException('Keyfile does not provide required information. ' . 'Please ensure keyfile includes `private_key` and `client_email`.');
|
722 |
-
}
|
723 |
-
// Make sure disallowed headers are not included.
|
724 |
-
$illegalHeaders = ['x-goog-encryption-key', 'x-goog-encryption-key-sha256'];
|
725 |
-
if ($illegal = array_intersect_key(array_flip($illegalHeaders), $options['headers'])) {
|
726 |
-
throw new \InvalidArgumentException(sprintf('%s %s not allowed in Signed URL headers.', implode(' and ', array_keys($illegal)), count($illegal) === 1 ? 'is' : 'are'));
|
727 |
-
}
|
728 |
-
// Sort headers by name.
|
729 |
-
ksort($options['headers']);
|
730 |
-
$headers = [];
|
731 |
-
foreach ($options['headers'] as $name => $value) {
|
732 |
-
$name = strtolower(trim($name));
|
733 |
-
$value = is_array($value) ? implode(',', array_map('trim', $value)) : trim($value);
|
734 |
-
// Linebreaks are not allowed in headers.
|
735 |
-
// Rather than strip, we throw because we don't want to change the expected value without the user knowing.
|
736 |
-
if (strpos($value, PHP_EOL) !== false) {
|
737 |
-
throw new \InvalidArgumentException('Line endings are not allowed in header values. Replace line endings with a single space.');
|
738 |
-
}
|
739 |
-
// Invalid header names throw exception.
|
740 |
-
if (strpos($name, 'x-goog-') !== 0) {
|
741 |
-
throw new \InvalidArgumentException('Header names must begin with `x-goog-`.');
|
742 |
-
}
|
743 |
-
$headers[] = $name . ':' . $value;
|
744 |
-
}
|
745 |
-
if ($headers) {
|
746 |
-
$headers[] = '';
|
747 |
-
}
|
748 |
-
$objectPieces = explode('/', $this->identity['object']);
|
749 |
-
array_walk($objectPieces, function (&$piece) {
|
750 |
-
$piece = rawurlencode($piece);
|
751 |
-
});
|
752 |
-
$objectName = implode('/', $objectPieces);
|
753 |
-
$resource = sprintf('/%s/%s', $this->identity['bucket'], $objectName);
|
754 |
-
$toSign = [$options['method'], $options['contentMd5'], $options['contentType'], $seconds, implode("\n", $headers) . $resource];
|
755 |
-
// NOTE: While in most cases `PHP_EOL` is preferable to a system-specific character,
|
756 |
-
// in this case `\n` is required.
|
757 |
-
$string = implode("\n", $toSign);
|
758 |
-
$signature = $this->signString($keyFile['private_key'], $string, $options['forceOpenssl']);
|
759 |
-
$encodedSignature = urlencode(base64_encode($signature));
|
760 |
-
$query = [];
|
761 |
-
$query[] = 'GoogleAccessId=' . $keyFile['client_email'];
|
762 |
-
$query[] = 'Expires=' . $seconds;
|
763 |
-
$query[] = 'Signature=' . $encodedSignature;
|
764 |
-
if ($options['responseDisposition']) {
|
765 |
-
$query[] = 'response-content-disposition=' . urlencode($options['responseDisposition']);
|
766 |
-
} elseif ($options['saveAsName']) {
|
767 |
-
$query[] = 'response-content-disposition=attachment;filename="' . urlencode($options['saveAsName']) . '"';
|
768 |
-
}
|
769 |
-
if ($options['responseType']) {
|
770 |
-
$query[] = 'response-content-type=' . urlencode($options['responseType']);
|
771 |
-
}
|
772 |
-
if ($this->identity['generation']) {
|
773 |
-
$query[] = 'generation=' . $this->identity['generation'];
|
774 |
-
}
|
775 |
-
$options['cname'] = trim($options['cname'], '/');
|
776 |
-
// If a custom cname is used, then the resource is simply the objectName
|
777 |
-
if ($options['cname'] !== self::DEFAULT_DOWNLOAD_URL) {
|
778 |
-
$resource = '/' . $objectName;
|
779 |
-
}
|
780 |
-
return $options['cname'] . $resource . '?' . implode('&', $query);
|
781 |
}
|
782 |
/**
|
783 |
* Create a Signed Upload URL for this object.
|
@@ -800,8 +788,14 @@ class StorageObject
|
|
800 |
*
|
801 |
* Example:
|
802 |
* ```
|
803 |
-
* $
|
804 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
805 |
* ```
|
806 |
*
|
807 |
* @param Timestamp|\DateTimeInterface|int $expires Specifies when the URL
|
@@ -811,35 +805,57 @@ class StorageObject
|
|
811 |
* @param array $options {
|
812 |
* Configuration Options.
|
813 |
*
|
814 |
-
* @type string $
|
815 |
-
*
|
|
|
816 |
* @type string $contentMd5 The MD5 digest value in base64. If you
|
817 |
* provide this, the client must provide this HTTP header with
|
818 |
* this same value in its request. If provided, take care to
|
819 |
* always provide this value as a base64 encoded string.
|
820 |
-
* @type
|
821 |
-
*
|
822 |
-
*
|
823 |
-
*
|
824 |
-
*
|
825 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
826 |
* @type array $keyFile Keyfile data to use in place of the keyfile with
|
827 |
* which the client was constructed. If `$options.keyFilePath` is
|
828 |
* set, this option is ignored.
|
829 |
* @type string $keyFilePath A path to a valid Keyfile to use in place
|
830 |
* of the keyfile with which the client was constructed.
|
831 |
-
* @type
|
832 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
833 |
* }
|
834 |
* @return string
|
835 |
*/
|
836 |
public function signedUploadUrl($expires, array $options = [])
|
837 |
{
|
838 |
-
$options += ['
|
839 |
-
|
840 |
-
$options['headers'] = [];
|
841 |
-
}
|
842 |
-
$options['headers']['x-goog-resumable'] = ['start'];
|
843 |
unset($options['cname'], $options['saveAsName'], $options['responseDisposition'], $options['responseType']);
|
844 |
return $this->signedUrl($expires, ['method' => 'POST', 'allowPost' => true] + $options);
|
845 |
}
|
@@ -859,39 +875,59 @@ class StorageObject
|
|
859 |
* $url = $object->beginSignedUploadSession();
|
860 |
* ```
|
861 |
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
862 |
* @see https://cloud.google.com/storage/docs/xml-api/resumable-upload#practices Resumable Upload Best Practices
|
863 |
*
|
864 |
* @param array $options {
|
865 |
* Configuration Options.
|
866 |
*
|
867 |
-
* @type string $contentType If you provide this value, the client must
|
868 |
-
* provide this HTTP header set to the same value.
|
869 |
-
* @type string $origin Value of CORS header
|
870 |
-
* "Access-Control-Allow-Origin". **Defaults to** `"*"`.
|
871 |
* @type string $contentMd5 The MD5 digest value in base64. If you
|
872 |
* provide this, the client must provide this HTTP header with
|
873 |
* this same value in its request. If provided, take care to
|
874 |
* always provide this value as a base64 encoded string.
|
875 |
-
* @type
|
876 |
-
*
|
877 |
-
*
|
878 |
-
*
|
879 |
-
*
|
880 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
881 |
* @type array $keyFile Keyfile data to use in place of the keyfile with
|
882 |
* which the client was constructed. If `$options.keyFilePath` is
|
883 |
* set, this option is ignored.
|
884 |
* @type string $keyFilePath A path to a valid Keyfile to use in place
|
885 |
* of the keyfile with which the client was constructed.
|
886 |
-
* @type
|
887 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
888 |
* }
|
889 |
* @return string
|
890 |
*/
|
891 |
public function beginSignedUploadSession(array $options = [])
|
892 |
{
|
893 |
-
$
|
894 |
-
$startUri = $this->signedUploadUrl($
|
895 |
$uploaderOptions = $this->pluckArray(['contentType', 'origin'], $options);
|
896 |
if (!isset($uploaderOptions['origin'])) {
|
897 |
$uploaderOptions['origin'] = '*';
|
@@ -1011,7 +1047,7 @@ class StorageObject
|
|
1011 |
* echo $object->identity()['object'];
|
1012 |
* ```
|
1013 |
*
|
1014 |
-
* @return
|
1015 |
*/
|
1016 |
public function identity()
|
1017 |
{
|
43 |
{
|
44 |
use ArrayTrait;
|
45 |
use EncryptionTrait;
|
46 |
+
/**
|
47 |
+
* @deprecated
|
48 |
+
*/
|
49 |
+
const DEFAULT_DOWNLOAD_URL = \DeliciousBrains\WP_Offload_Media\Gcp\Google\Cloud\Storage\SigningHelper::DEFAULT_DOWNLOAD_HOST;
|
50 |
/**
|
51 |
* @var Acl ACL for the object.
|
52 |
*/
|
478 |
/**
|
479 |
* Download an object as a string.
|
480 |
*
|
481 |
+
* For an example of setting the range header to download a subrange of the
|
482 |
+
* object please see {@see Google\Cloud\Storage\StorageObject::downloadAsStream()}.
|
483 |
+
*
|
484 |
* Example:
|
485 |
* ```
|
486 |
* $string = $object->downloadAsString();
|
487 |
* echo $string;
|
488 |
* ```
|
489 |
*
|
490 |
+
* @see https://cloud.google.com/storage/docs/json_api/v1/objects/get Objects get API documentation.
|
491 |
+
* @see https://cloud.google.com/storage/docs/json_api/v1/parameters#range Learn more about the Range header.
|
492 |
+
*
|
493 |
* @param array $options [optional] {
|
494 |
* Configuration Options.
|
495 |
*
|
511 |
/**
|
512 |
* Download an object to a specified location.
|
513 |
*
|
514 |
+
* For an example of setting the range header to download a subrange of the
|
515 |
+
* object please see {@see Google\Cloud\Storage\StorageObject::downloadAsStream()}.
|
516 |
+
*
|
517 |
* Example:
|
518 |
* ```
|
519 |
* $stream = $object->downloadToFile(__DIR__ . '/my-file.txt');
|
520 |
* ```
|
521 |
*
|
522 |
+
* @see https://cloud.google.com/storage/docs/json_api/v1/objects/get Objects get API documentation.
|
523 |
+
* @see https://cloud.google.com/storage/docs/json_api/v1/parameters#range Learn more about the Range header.
|
524 |
+
*
|
525 |
* @param string $path Path to download the file to.
|
526 |
* @param array $options [optional] {
|
527 |
* Configuration Options.
|
547 |
/**
|
548 |
* Download an object as a stream.
|
549 |
*
|
550 |
+
* Please note Google Cloud Storage respects the Range header as specified
|
551 |
+
* by [RFC7233](https://tools.ietf.org/html/rfc7233#section-3.1). See below
|
552 |
+
* for an example of this in action.
|
553 |
+
*
|
554 |
* Example:
|
555 |
* ```
|
556 |
* $stream = $object->downloadAsStream();
|
557 |
* echo $stream->getContents();
|
558 |
* ```
|
559 |
*
|
560 |
+
* ```
|
561 |
+
* // Set the Range header in order to download a subrange of the object. For more examples of
|
562 |
+
* // setting the Range header, please see [RFC7233](https://tools.ietf.org/html/rfc7233#section-3.1).
|
563 |
+
* $firstFiveBytes = '0-4'; // Get the first 5 bytes.
|
564 |
+
* $fromFifthByteToLastByte = '4-'; // Get the bytes starting with the 5th to the last.
|
565 |
+
* $lastFiveBytes = '-5'; // Get the last 5 bytes.
|
566 |
+
*
|
567 |
+
* $stream = $object->downloadAsStream([
|
568 |
+
* 'restOptions' => [
|
569 |
+
* 'headers' => [
|
570 |
+
* 'Range' => "bytes=$firstFiveBytes"
|
571 |
+
* ]
|
572 |
+
* ]
|
573 |
+
* ]);
|
574 |
+
* ```
|
575 |
+
*
|
576 |
+
* @see https://cloud.google.com/storage/docs/json_api/v1/objects/get Objects get API documentation.
|
577 |
+
* @see https://cloud.google.com/storage/docs/json_api/v1/parameters#range Learn more about the Range header.
|
578 |
+
*
|
579 |
* @param array $options [optional] {
|
580 |
* Configuration Options.
|
581 |
*
|
597 |
/**
|
598 |
* Asynchronously download an object as a stream.
|
599 |
*
|
600 |
+
* For an example of setting the range header to download a subrange of the
|
601 |
+
* object please see {@see Google\Cloud\Storage\StorageObject::downloadAsStream()}.
|
602 |
+
*
|
603 |
* Example:
|
604 |
* ```
|
605 |
* use Psr\Http\Message\StreamInterface;
|
629 |
* Promise\unwrap($promises);
|
630 |
* ```
|
631 |
*
|
632 |
+
* @see https://cloud.google.com/storage/docs/json_api/v1/objects/get Objects get API documentation.
|
633 |
+
* @see https://cloud.google.com/storage/docs/json_api/v1/parameters#range Learn more about the Range header.
|
634 |
* @see https://github.com/guzzle/promises Learn more about Guzzle Promises
|
635 |
*
|
636 |
* @param array $options [optional] {
|
661 |
* Signed URLs can be complex, and it is strongly recommended you read and
|
662 |
* understand the [documentation](https://cloud.google.com/storage/docs/access-control/signed-urls).
|
663 |
*
|
664 |
+
* In cases where a keyfile is available, signing is accomplished in the
|
665 |
+
* client using your Service Account private key. In Google Compute Engine,
|
666 |
+
* signing is accomplished using
|
667 |
+
* [IAM signBlob](https://cloud.google.com/iam/credentials/reference/rest/v1/projects.serviceAccounts/signBlob).
|
668 |
+
* Signing using IAM requires that your service account be granted the
|
669 |
+
* `iam.serviceAccounts.signBlob` permission, part of the "Service Account
|
670 |
+
* Token Creator" IAM role.
|
671 |
+
*
|
672 |
+
* Additionally, signing using IAM requires different scopes. When creating
|
673 |
+
* an instance of {@see Google\Cloud\Storage\StorageClient}, provide the
|
674 |
+
* `https://www.googleapis.com/auth/cloud-platform` scopein `$options.scopes`.
|
675 |
+
* This scope may be used entirely in place of the scopes provided in
|
676 |
+
* {@see Google\Cloud\Storage\StorageClient}.
|
677 |
+
*
|
678 |
+
* App Engine and Compute Engine will attempt to sign URLs using IAM.
|
679 |
+
*
|
680 |
* Example:
|
681 |
* ```
|
682 |
+
* $url = $object->signedUrl(new \DateTime('tomorrow'));
|
683 |
* ```
|
684 |
*
|
685 |
* ```
|
686 |
* // Create a signed URL allowing updates to the object.
|
687 |
+
* $url = $object->signedUrl(new \DateTime('tomorrow'), [
|
688 |
* 'method' => 'PUT'
|
689 |
* ]);
|
690 |
* ```
|
691 |
*
|
692 |
+
* ```
|
693 |
+
* // Use Signed URLs v4
|
694 |
+
* $url = $object->signedUrl(new \DateTime('tomorrow'), [
|
695 |
+
* 'version' => 'v4'
|
696 |
+
* ]);
|
697 |
+
* ```
|
698 |
+
*
|
699 |
* @see https://cloud.google.com/storage/docs/access-control/signed-urls Signed URLs
|
700 |
*
|
701 |
* @param Timestamp|\DateTimeInterface|int $expires Specifies when the URL
|
705 |
* @param array $options {
|
706 |
* Configuration Options.
|
707 |
*
|
|
|
|
|
708 |
* @type string $cname The CNAME for the bucket, for instance
|
709 |
* `https://cdn.example.com`. **Defaults to**
|
710 |
* `https://storage.googleapis.com`.
|
712 |
* provide this, the client must provide this HTTP header with
|
713 |
* this same value in its request. If provided, take care to
|
714 |
* always provide this value as a base64 encoded string.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
715 |
* @type string $contentType If you provide this value, the client must
|
716 |
* provide this HTTP header set to the same value.
|
717 |
+
* @type bool $forceOpenssl If true, OpenSSL will be used regardless of
|
718 |
+
* whether phpseclib is available. **Defaults to** `false`.
|
719 |
+
* @type array $headers If additional headers are provided, the server
|
720 |
+
* will check to make sure that the client provides matching
|
721 |
+
* values. Provide headers as a key/value array, where the key is
|
722 |
+
* the header name, and the value is an array of header values.
|
723 |
+
* Headers with multiple values may provide values as a simple
|
724 |
+
* array, or a comma-separated string. For a reference of allowed
|
725 |
+
* headers, see [Reference Headers](https://cloud.google.com/storage/docs/xml-api/reference-headers).
|
726 |
+
* Header values will be trimmed of leading and trailing spaces,
|
727 |
+
* multiple spaces within values will be collapsed to a single
|
728 |
+
* space, and line breaks will be replaced by an empty string.
|
729 |
+
* V2 Signed URLs may not provide `x-goog-encryption-key` or
|
730 |
+
* `x-goog-encryption-key-sha256` headers.
|
731 |
* @type array $keyFile Keyfile data to use in place of the keyfile with
|
732 |
* which the client was constructed. If `$options.keyFilePath` is
|
733 |
* set, this option is ignored.
|
734 |
* @type string $keyFilePath A path to a valid Keyfile to use in place
|
735 |
* of the keyfile with which the client was constructed.
|
736 |
+
* @type string $method One of `GET`, `PUT` or `DELETE`.
|
737 |
+
* **Defaults to** `GET`.
|
738 |
+
* @type string $responseDisposition The
|
739 |
+
* [`response-content-disposition`](http://www.iana.org/assignments/cont-disp/cont-disp.xhtml)
|
740 |
+
* parameter of the signed url.
|
741 |
+
* @type string $responseType The `response-content-type` parameter of the
|
742 |
+
* signed url. When the server contentType is `null`, this option
|
743 |
+
* may be used to control the content type of the response.
|
744 |
+
* @type string $saveAsName The filename to prompt the user to save the
|
745 |
+
* file as when the signed url is accessed. This is ignored if
|
746 |
+
* `$options.responseDisposition` is set.
|
747 |
+
* @type string|array $scopes One or more authentication scopes to be
|
748 |
+
* used with a key file. This option is ignored unless
|
749 |
+
* `$options.keyFile` or `$options.keyFilePath` is set.
|
750 |
+
* @type array $queryParams Additional query parameters to be included
|
751 |
+
* as part of the signed URL query string. For allowed values,
|
752 |
+
* see [Reference Headers](https://cloud.google.com/storage/docs/xml-api/reference-headers#query).
|
753 |
+
* @type string $version One of "v2" or "v4". **Defaults to** `"v2"`.
|
754 |
* }
|
755 |
* @return string
|
756 |
* @throws \InvalidArgumentException If the given expiration is invalid or in the past.
|
757 |
* @throws \InvalidArgumentException If the given `$options.method` is not valid.
|
758 |
* @throws \InvalidArgumentException If the given `$options.keyFilePath` is not valid.
|
759 |
* @throws \InvalidArgumentException If the given custom headers are invalid.
|
760 |
+
* @throws \InvalidArgumentException If the keyfile does not contain the required information.
|
761 |
+
* @throws \RuntimeException If the credentials provided cannot be used for signing strings.
|
762 |
*/
|
763 |
public function signedUrl($expires, array $options = [])
|
764 |
{
|
765 |
+
// May be overridden for testing.
|
766 |
+
$signingHelper = $this->pluck('helper', $options, false) ?: \DeliciousBrains\WP_Offload_Media\Gcp\Google\Cloud\Storage\SigningHelper::getHelper();
|
767 |
+
$resource = sprintf('/%s/%s', $this->identity['bucket'], $this->identity['object']);
|
768 |
+
return $signingHelper->sign($this->connection, $expires, $resource, $this->identity['generation'], $options);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
769 |
}
|
770 |
/**
|
771 |
* Create a Signed Upload URL for this object.
|
788 |
*
|
789 |
* Example:
|
790 |
* ```
|
791 |
+
* $url = $object->signedUploadUrl(new \DateTime('tomorrow'));
|
792 |
+
* ```
|
793 |
+
*
|
794 |
+
* ```
|
795 |
+
* // Use Signed URLs v4
|
796 |
+
* $url = $object->signedUploadUrl(new \DateTime('tomorrow'), [
|
797 |
+
* 'version' => 'v4'
|
798 |
+
* ]);
|
799 |
* ```
|
800 |
*
|
801 |
* @param Timestamp|\DateTimeInterface|int $expires Specifies when the URL
|
805 |
* @param array $options {
|
806 |
* Configuration Options.
|
807 |
*
|
808 |
+
* @type string $cname The CNAME for the bucket, for instance
|
809 |
+
* `https://cdn.example.com`. **Defaults to**
|
810 |
+
* `https://storage.googleapis.com`.
|
811 |
* @type string $contentMd5 The MD5 digest value in base64. If you
|
812 |
* provide this, the client must provide this HTTP header with
|
813 |
* this same value in its request. If provided, take care to
|
814 |
* always provide this value as a base64 encoded string.
|
815 |
+
* @type string $contentType If you provide this value, the client must
|
816 |
+
* provide this HTTP header set to the same value.
|
817 |
+
* @type bool $forceOpenssl If true, OpenSSL will be used regardless of
|
818 |
+
* whether phpseclib is available. **Defaults to** `false`.
|
819 |
+
* @type array $headers If additional headers are provided, the server
|
820 |
+
* will check to make sure that the client provides matching
|
821 |
+
* values. Provide headers as a key/value array, where the key is
|
822 |
+
* the header name, and the value is an array of header values.
|
823 |
+
* Headers with multiple values may provide values as a simple
|
824 |
+
* array, or a comma-separated string. For a reference of allowed
|
825 |
+
* headers, see [Reference Headers](https://cloud.google.com/storage/docs/xml-api/reference-headers).
|
826 |
+
* Header values will be trimmed of leading and trailing spaces,
|
827 |
+
* multiple spaces within values will be collapsed to a single
|
828 |
+
* space, and line breaks will be replaced by an empty string.
|
829 |
+
* V2 Signed URLs may not provide `x-goog-encryption-key` or
|
830 |
+
* `x-goog-encryption-key-sha256` headers.
|
831 |
* @type array $keyFile Keyfile data to use in place of the keyfile with
|
832 |
* which the client was constructed. If `$options.keyFilePath` is
|
833 |
* set, this option is ignored.
|
834 |
* @type string $keyFilePath A path to a valid Keyfile to use in place
|
835 |
* of the keyfile with which the client was constructed.
|
836 |
+
* @type string $responseDisposition The
|
837 |
+
* [`response-content-disposition`](http://www.iana.org/assignments/cont-disp/cont-disp.xhtml)
|
838 |
+
* parameter of the signed url.
|
839 |
+
* @type string $responseType The `response-content-type` parameter of the
|
840 |
+
* signed url. When the server contentType is `null`, this option
|
841 |
+
* may be used to control the content type of the response.
|
842 |
+
* @type string $saveAsName The filename to prompt the user to save the
|
843 |
+
* file as when the signed url is accessed. This is ignored if
|
844 |
+
* `$options.responseDisposition` is set.
|
845 |
+
* @type string|array $scopes One or more authentication scopes to be
|
846 |
+
* used with a key file. This option is ignored unless
|
847 |
+
* `$options.keyFile` or `$options.keyFilePath` is set.
|
848 |
+
* @type array $queryParams Additional query parameters to be included
|
849 |
+
* as part of the signed URL query string. For allowed values,
|
850 |
+
* see [Reference Headers](https://cloud.google.com/storage/docs/xml-api/reference-headers#query).
|
851 |
+
* @type string $version One of "v2" or "v4". **Defaults to** `"v2"`.
|
852 |
* }
|
853 |
* @return string
|
854 |
*/
|
855 |
public function signedUploadUrl($expires, array $options = [])
|
856 |
{
|
857 |
+
$options += ['headers' => []];
|
858 |
+
$options['headers']['x-goog-resumable'] = 'start';
|
|
|
|
|
|
|
859 |
unset($options['cname'], $options['saveAsName'], $options['responseDisposition'], $options['responseType']);
|
860 |
return $this->signedUrl($expires, ['method' => 'POST', 'allowPost' => true] + $options);
|
861 |
}
|
875 |
* $url = $object->beginSignedUploadSession();
|
876 |
* ```
|
877 |
*
|
878 |
+
* ```
|
879 |
+
* // Use Signed URLs v4
|
880 |
+
* $url = $object->beginSignedUploadSession([
|
881 |
+
* 'version' => 'v4'
|
882 |
+
* ]);
|
883 |
+
* ```
|
884 |
+
*
|
885 |
* @see https://cloud.google.com/storage/docs/xml-api/resumable-upload#practices Resumable Upload Best Practices
|
886 |
*
|
887 |
* @param array $options {
|
888 |
* Configuration Options.
|
889 |
*
|
|
|
|
|
|
|
|
|
890 |
* @type string $contentMd5 The MD5 digest value in base64. If you
|
891 |
* provide this, the client must provide this HTTP header with
|
892 |
* this same value in its request. If provided, take care to
|
893 |
* always provide this value as a base64 encoded string.
|
894 |
+
* @type string $contentType If you provide this value, the client must
|
895 |
+
* provide this HTTP header set to the same value.
|
896 |
+
* @type bool $forceOpenssl If true, OpenSSL will be used regardless of
|
897 |
+
* whether phpseclib is available. **Defaults to** `false`.
|
898 |
+
* @type array $headers If additional headers are provided, the server
|
899 |
+
* will check to make sure that the client provides matching
|
900 |
+
* values. Provide headers as a key/value array, where the key is
|
901 |
+
* the header name, and the value is an array of header values.
|
902 |
+
* Headers with multiple values may provide values as a simple
|
903 |
+
* array, or a comma-separated string. For a reference of allowed
|
904 |
+
* headers, see [Reference Headers](https://cloud.google.com/storage/docs/xml-api/reference-headers).
|
905 |
+
* Header values will be trimmed of leading and trailing spaces,
|
906 |
+
* multiple spaces within values will be collapsed to a single
|
907 |
+
* space, and line breaks will be replaced by an empty string.
|
908 |
+
* V2 Signed URLs may not provide `x-goog-encryption-key` or
|
909 |
+
* `x-goog-encryption-key-sha256` headers.
|
910 |
* @type array $keyFile Keyfile data to use in place of the keyfile with
|
911 |
* which the client was constructed. If `$options.keyFilePath` is
|
912 |
* set, this option is ignored.
|
913 |
* @type string $keyFilePath A path to a valid Keyfile to use in place
|
914 |
* of the keyfile with which the client was constructed.
|
915 |
+
* @type string $origin Value of CORS header
|
916 |
+
* "Access-Control-Allow-Origin". **Defaults to** `"*"`.
|
917 |
+
* @type string|array $scopes One or more authentication scopes to be
|
918 |
+
* used with a key file. This option is ignored unless
|
919 |
+
* `$options.keyFile` or `$options.keyFilePath` is set.
|
920 |
+
* @type array $queryParams Additional query parameters to be included
|
921 |
+
* as part of the signed URL query string. For allowed values,
|
922 |
+
* see [Reference Headers](https://cloud.google.com/storage/docs/xml-api/reference-headers#query).
|
923 |
+
* @type string $version One of "v2" or "v4". **Defaults to** `"v2"`.
|
924 |
* }
|
925 |
* @return string
|
926 |
*/
|
927 |
public function beginSignedUploadSession(array $options = [])
|
928 |
{
|
929 |
+
$expires = new \DateTimeImmutable('+1 minute');
|
930 |
+
$startUri = $this->signedUploadUrl($expires, $options);
|
931 |
$uploaderOptions = $this->pluckArray(['contentType', 'origin'], $options);
|
932 |
if (!isset($uploaderOptions['origin'])) {
|
933 |
$uploaderOptions['origin'] = '*';
|
1047 |
* echo $object->identity()['object'];
|
1048 |
* ```
|
1049 |
*
|
1050 |
+
* @return array
|
1051 |
*/
|
1052 |
public function identity()
|
1053 |
{
|
@@ -40,7 +40,7 @@ class StreamWrapper
|
|
40 |
const DIRECTORY_READABLE_MODE = 16676;
|
41 |
// 40444 in octal
|
42 |
/**
|
43 |
-
* @var resource Must be public according to the PHP documentation.
|
44 |
*/
|
45 |
public $context;
|
46 |
/**
|
@@ -66,7 +66,7 @@ class StreamWrapper
|
|
66 |
*/
|
67 |
private static $clients = [];
|
68 |
/**
|
69 |
-
* @var
|
70 |
*/
|
71 |
private $directoryIterator;
|
72 |
/**
|
@@ -336,7 +336,7 @@ class StreamWrapper
|
|
336 |
$url = (array) parse_url($to) + ['path' => '', 'host' => ''];
|
337 |
$destinationBucket = $url['host'];
|
338 |
$destinationPath = substr($url['path'], 1);
|
339 |
-
$this->dir_opendir($from,
|
340 |
foreach ($this->directoryIterator as $file) {
|
341 |
$name = $file->name();
|
342 |
$newPath = str_replace($this->file, $destinationPath, $name);
|
40 |
const DIRECTORY_READABLE_MODE = 16676;
|
41 |
// 40444 in octal
|
42 |
/**
|
43 |
+
* @var resource|null Must be public according to the PHP documentation.
|
44 |
*/
|
45 |
public $context;
|
46 |
/**
|
66 |
*/
|
67 |
private static $clients = [];
|
68 |
/**
|
69 |
+
* @var ObjectIterator Used for iterating through a directory
|
70 |
*/
|
71 |
private $directoryIterator;
|
72 |
/**
|
336 |
$url = (array) parse_url($to) + ['path' => '', 'host' => ''];
|
337 |
$destinationBucket = $url['host'];
|
338 |
$destinationPath = substr($url['path'], 1);
|
339 |
+
$this->dir_opendir($from, 0);
|
340 |
foreach ($this->directoryIterator as $file) {
|
341 |
$name = $file->name();
|
342 |
$newPath = str_replace($this->file, $destinationPath, $name);
|
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# How to Contribute
|
2 |
+
|
3 |
+
We'd love to accept your patches and contributions to this project. There are
|
4 |
+
just a few small guidelines you need to follow.
|
5 |
+
|
6 |
+
## Contributor License Agreement
|
7 |
+
|
8 |
+
Contributions to this project must be accompanied by a Contributor License
|
9 |
+
Agreement. You (or your employer) retain the copyright to your contribution;
|
10 |
+
this simply gives us permission to use and redistribute your contributions as
|
11 |
+
part of the project. Head over to <https://cla.developers.google.com/> to see
|
12 |
+
your current agreements on file or to sign a new one.
|
13 |
+
|
14 |
+
You generally only need to submit a CLA once, so if you've already submitted one
|
15 |
+
(even if it was for a different project), you probably don't need to do it
|
16 |
+
again.
|
17 |
+
|
18 |
+
## Code reviews
|
19 |
+
|
20 |
+
All submissions, including submissions by project members, require review. We
|
21 |
+
use GitHub pull requests for this purpose. Consult
|
22 |
+
[GitHub Help](https://help.github.com/articles/about-pull-requests/) for more
|
23 |
+
information on using pull requests.
|
24 |
+
|
25 |
+
## Community Guidelines
|
26 |
+
|
27 |
+
This project follows [Google's Open Source Community
|
28 |
+
Guidelines](https://opensource.google.com/conduct/).
|
@@ -0,0 +1,201 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
Apache License
|
2 |
+
Version 2.0, January 2004
|
3 |
+
http://www.apache.org/licenses/
|
4 |
+
|
5 |
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
6 |
+
|
7 |
+
1. Definitions.
|
8 |
+
|
9 |
+
"License" shall mean the terms and conditions for use, reproduction,
|
10 |
+
and distribution as defined by Sections 1 through 9 of this document.
|
11 |
+
|
12 |
+
"Licensor" shall mean the copyright owner or entity authorized by
|
13 |
+
the copyright owner that is granting the License.
|
14 |
+
|
15 |
+
"Legal Entity" shall mean the union of the acting entity and all
|
16 |
+
other entities that control, are controlled by, or are under common
|
17 |
+
control with that entity. For the purposes of this definition,
|
18 |
+
"control" means (i) the power, direct or indirect, to cause the
|
19 |
+
direction or management of such entity, whether by contract or
|
20 |
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
21 |
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
22 |
+
|
23 |
+
"You" (or "Your") shall mean an individual or Legal Entity
|
24 |
+
exercising permissions granted by this License.
|
25 |
+
|
26 |
+
"Source" form shall mean the preferred form for making modifications,
|
27 |
+
including but not limited to software source code, documentation
|
28 |
+
source, and configuration files.
|
29 |
+
|
30 |
+
"Object" form shall mean any form resulting from mechanical
|
31 |
+
transformation or translation of a Source form, including but
|
32 |
+
not limited to compiled object code, generated documentation,
|
33 |
+
and conversions to other media types.
|
34 |
+
|
35 |
+
"Work" shall mean the work of authorship, whether in Source or
|
36 |
+
Object form, made available under the License, as indicated by a
|
37 |
+
copyright notice that is included in or attached to the work
|
38 |
+
(an example is provided in the Appendix below).
|
39 |
+
|
40 |
+
"Derivative Works" shall mean any work, whether in Source or Object
|
41 |
+
form, that is based on (or derived from) the Work and for which the
|
42 |
+
editorial revisions, annotations, elaborations, or other modifications
|
43 |
+
represent, as a whole, an original work of authorship. For the purposes
|
44 |
+
of this License, Derivative Works shall not include works that remain
|
45 |
+
separable from, or merely link (or bind by name) to the interfaces of,
|
46 |
+
the Work and Derivative Works thereof.
|
47 |
+
|
48 |
+
"Contribution" shall mean any work of authorship, including
|
49 |
+
the original version of the Work and any modifications or additions
|
50 |
+
to that Work or Derivative Works thereof, that is intentionally
|
51 |
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
52 |
+
or by an individual or Legal Entity authorized to submit on behalf of
|
53 |
+
the copyright owner. For the purposes of this definition, "submitted"
|
54 |
+
means any form of electronic, verbal, or written communication sent
|
55 |
+
to the Licensor or its representatives, including but not limited to
|
56 |
+
communication on electronic mailing lists, source code control systems,
|
57 |
+
and issue tracking systems that are managed by, or on behalf of, the
|
58 |
+
Licensor for the purpose of discussing and improving the Work, but
|
59 |
+
excluding communication that is conspicuously marked or otherwise
|
60 |
+
designated in writing by the copyright owner as "Not a Contribution."
|
61 |
+
|
62 |
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
63 |
+
on behalf of whom a Contribution has been received by Licensor and
|
64 |
+
subsequently incorporated within the Work.
|
65 |
+
|
66 |
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
67 |
+
this License, each Contributor hereby grants to You a perpetual,
|
68 |
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
69 |
+
copyright license to reproduce, prepare Derivative Works of,
|
70 |
+
publicly display, publicly perform, sublicense, and distribute the
|
71 |
+
Work and such Derivative Works in Source or Object form.
|
72 |
+
|
73 |
+
3. Grant of Patent License. Subject to the terms and conditions of
|
74 |
+
this License, each Contributor hereby grants to You a perpetual,
|
75 |
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
76 |
+
(except as stated in this section) patent license to make, have made,
|
77 |
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
78 |
+
where such license applies only to those patent claims licensable
|
79 |
+
by such Contributor that are necessarily infringed by their
|
80 |
+
Contribution(s) alone or by combination of their Contribution(s)
|
81 |
+
with the Work to which such Contribution(s) was submitted. If You
|
82 |
+
institute patent litigation against any entity (including a
|
83 |
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
84 |
+
or a Contribution incorporated within the Work constitutes direct
|
85 |
+
or contributory patent infringement, then any patent licenses
|
86 |
+
granted to You under this License for that Work shall terminate
|
87 |
+
as of the date such litigation is filed.
|
88 |
+
|
89 |
+
4. Redistribution. You may reproduce and distribute copies of the
|
90 |
+
Work or Derivative Works thereof in any medium, with or without
|
91 |
+
modifications, and in Source or Object form, provided that You
|
92 |
+
meet the following conditions:
|
93 |
+
|
94 |
+
(a) You must give any other recipients of the Work or
|
95 |
+
Derivative Works a copy of this License; and
|
96 |
+
|
97 |
+
(b) You must cause any modified files to carry prominent notices
|
98 |
+
stating that You changed the files; and
|
99 |
+
|
100 |
+
(c) You must retain, in the Source form of any Derivative Works
|
101 |
+
that You distribute, all copyright, patent, trademark, and
|
102 |
+
attribution notices from the Source form of the Work,
|
103 |
+
excluding those notices that do not pertain to any part of
|
104 |
+
the Derivative Works; and
|
105 |
+
|
106 |
+
(d) If the Work includes a "NOTICE" text file as part of its
|
107 |
+
distribution, then any Derivative Works that You distribute must
|
108 |
+
include a readable copy of the attribution notices contained
|
109 |
+
within such NOTICE file, excluding those notices that do not
|
110 |
+
pertain to any part of the Derivative Works, in at least one
|
111 |
+
of the following places: within a NOTICE text file distributed
|
112 |
+
as part of the Derivative Works; within the Source form or
|
113 |
+
documentation, if provided along with the Derivative Works; or,
|
114 |
+
within a display generated by the Derivative Works, if and
|
115 |
+
wherever such third-party notices normally appear. The contents
|
116 |
+
of the NOTICE file are for informational purposes only and
|
117 |
+
do not modify the License. You may add Your own attribution
|
118 |
+
notices within Derivative Works that You distribute, alongside
|
119 |
+
or as an addendum to the NOTICE text from the Work, provided
|
120 |
+
that such additional attribution notices cannot be construed
|
121 |
+
as modifying the License.
|
122 |
+
|
123 |
+
You may add Your own copyright statement to Your modifications and
|
124 |
+
may provide additional or different license terms and conditions
|
125 |
+
for use, reproduction, or distribution of Your modifications, or
|
126 |
+
for any such Derivative Works as a whole, provided Your use,
|
127 |
+
reproduction, and distribution of the Work otherwise complies with
|
128 |
+
the conditions stated in this License.
|
129 |
+
|
130 |
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
131 |
+
any Contribution intentionally submitted for inclusion in the Work
|
132 |
+
by You to the Licensor shall be under the terms and conditions of
|
133 |
+
this License, without any additional terms or conditions.
|
134 |
+
Notwithstanding the above, nothing herein shall supersede or modify
|
135 |
+
the terms of any separate license agreement you may have executed
|
136 |
+
with Licensor regarding such Contributions.
|
137 |
+
|
138 |
+
6. Trademarks. This License does not grant permission to use the trade
|
139 |
+
names, trademarks, service marks, or product names of the Licensor,
|
140 |
+
except as required for reasonable and customary use in describing the
|
141 |
+
origin of the Work and reproducing the content of the NOTICE file.
|
142 |
+
|
143 |
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
144 |
+
agreed to in writing, Licensor provides the Work (and each
|
145 |
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
146 |
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
147 |
+
implied, including, without limitation, any warranties or conditions
|
148 |
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
149 |
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
150 |
+
appropriateness of using or redistributing the Work and assume any
|
151 |
+
risks associated with Your exercise of permissions under this License.
|
152 |
+
|
153 |
+
8. Limitation of Liability. In no event and under no legal theory,
|
154 |
+
whether in tort (including negligence), contract, or otherwise,
|
155 |
+
unless required by applicable law (such as deliberate and grossly
|
156 |
+
negligent acts) or agreed to in writing, shall any Contributor be
|
157 |
+
liable to You for damages, including any direct, indirect, special,
|
158 |
+
incidental, or consequential damages of any character arising as a
|
159 |
+
result of this License or out of the use or inability to use the
|
160 |
+
Work (including but not limited to damages for loss of goodwill,
|
161 |
+
work stoppage, computer failure or malfunction, or any and all
|
162 |
+
other commercial damages or losses), even if such Contributor
|
163 |
+
has been advised of the possibility of such damages.
|
164 |
+
|
165 |
+
9. Accepting Warranty or Additional Liability. While redistributing
|
166 |
+
the Work or Derivative Works thereof, You may choose to offer,
|
167 |
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
168 |
+
or other liability obligations and/or rights consistent with this
|
169 |
+
License. However, in accepting such obligations, You may act only
|
170 |
+
on Your own behalf and on Your sole responsibility, not on behalf
|
171 |
+
of any other Contributor, and only if You agree to indemnify,
|
172 |
+
defend, and hold each Contributor harmless for any liability
|
173 |
+
incurred by, or claims asserted against, such Contributor by reason
|
174 |
+
of your accepting any such warranty or additional liability.
|
175 |
+
|
176 |
+
END OF TERMS AND CONDITIONS
|
177 |
+
|
178 |
+
APPENDIX: How to apply the Apache License to your work.
|
179 |
+
|
180 |
+
To apply the Apache License to your work, attach the following
|
181 |
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
182 |
+
replaced with your own identifying information. (Don't include
|
183 |
+
the brackets!) The text should be enclosed in the appropriate
|
184 |
+
comment syntax for the file format. We also recommend that a
|
185 |
+
file or class name and description of purpose be included on the
|
186 |
+
same "printed page" as the copyright notice for easier
|
187 |
+
identification within third-party archives.
|
188 |
+
|
189 |
+
Copyright [yyyy] [name of copyright owner]
|
190 |
+
|
191 |
+
Licensed under the Apache License, Version 2.0 (the "License");
|
192 |
+
you may not use this file except in compliance with the License.
|
193 |
+
You may obtain a copy of the License at
|
194 |
+
|
195 |
+
http://www.apache.org/licenses/LICENSE-2.0
|
196 |
+
|
197 |
+
Unless required by applicable law or agreed to in writing, software
|
198 |
+
distributed under the License is distributed on an "AS IS" BASIS,
|
199 |
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
200 |
+
See the License for the specific language governing permissions and
|
201 |
+
limitations under the License.
|
@@ -0,0 +1,71 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
##
|
2 |
+
# Copyright 2019 Google Inc. All Rights Reserved.
|
3 |
+
#
|
4 |
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
5 |
+
# you may not use this file except in compliance with the License.
|
6 |
+
# You may obtain a copy of the License at
|
7 |
+
#
|
8 |
+
# http://www.apache.org/licenses/LICENSE-2.0
|
9 |
+
#
|
10 |
+
# Unless required by applicable law or agreed to in writing, software
|
11 |
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
12 |
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13 |
+
# See the License for the specific language governing permissions and
|
14 |
+
# limitations under the License.
|
15 |
+
##
|
16 |
+
|
17 |
+
.PHONY : all clean benchmark test test_all lint ext ext_test
|
18 |
+
|
19 |
+
COMPOSER ?= composer
|
20 |
+
PHP_CS_FIXER ?= vendor/bin/php-cs-fixer
|
21 |
+
PHP_UNIT ?= vendor/bin/phpunit
|
22 |
+
|
23 |
+
PHP_BIN ?= $(shell php-config --prefix)/bin
|
24 |
+
PHP ?= $(PHP_BIN)/php
|
25 |
+
PHP_CONFIG ?= $(PHP_BIN)/php-config
|
26 |
+
PHPIZE ?= $(PHP_BIN)/phpize
|
27 |
+
|
28 |
+
all: lint test
|
29 |
+
|
30 |
+
clean:
|
31 |
+
-rm -r .php_cs.cache
|
32 |
+
$(MAKE) -C ext clean
|
33 |
+
|
34 |
+
vendor: composer.lock
|
35 |
+
composer.lock: composer.json
|
36 |
+
$(COMPOSER) update
|
37 |
+
touch composer.lock
|
38 |
+
|
39 |
+
lint: vendor
|
40 |
+
$(PHP_CS_FIXER) fix --dry-run --diff src
|
41 |
+
$(PHP_CS_FIXER) fix --dry-run --diff crc32_benchmark.php
|
42 |
+
$(PHP_CS_FIXER) fix --dry-run --diff tests
|
43 |
+
$(PHP_CS_FIXER) fix --dry-run --diff ext/tests
|
44 |
+
|
45 |
+
benchmark: ext vendor
|
46 |
+
$(PHP) -d extension=ext/modules/crc32c.so crc32_benchmark.php
|
47 |
+
|
48 |
+
test: ext vendor
|
49 |
+
$(PHP) -v
|
50 |
+
$(PHP) -d extension=ext/modules/crc32c.so $(PHP_UNIT) tests/
|
51 |
+
|
52 |
+
# Test all the local versions of PHP
|
53 |
+
test_all:
|
54 |
+
for phpize in $$(ls $$(brew --prefix)/Cellar/php*/*/bin/phpize); do \
|
55 |
+
NO_INTERACTION=1 \
|
56 |
+
PHP_BIN=$$(dirname $$phpize) \
|
57 |
+
$(MAKE) clean test; \
|
58 |
+
done
|
59 |
+
|
60 |
+
ext: ext/modules/crc32c.so
|
61 |
+
|
62 |
+
ext_test: ext
|
63 |
+
NO_INTERACTION=1 $(MAKE) -C ext test
|
64 |
+
|
65 |
+
ext/modules/crc32c.so: ext/hash_crc32c.c ext/php_crc32c.c ext/php_crc32c.h
|
66 |
+
cd ext && \
|
67 |
+
./install_crc32c.sh && \
|
68 |
+
$(PHPIZE) && \
|
69 |
+
./configure \
|
70 |
+
--with-php-config=$(PHP_CONFIG) && \
|
71 |
+
$(MAKE)
|
@@ -0,0 +1,136 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# php-crc32
|
2 |
+
|
3 |
+
[![Build Status](https://travis-ci.org/google/php-crc32.svg?branch=master)](https://travis-ci.org/google/php-crc32)
|
4 |
+
|
5 |
+
by [Andrew Brampton](https://bramp.net)
|
6 |
+
|
7 |
+
CRC32 implementations, that support all crc32 polynomials, as well as (if you
|
8 |
+
install the pecl extension) hardware accelerated versions of CRC32C (Castagnoli).
|
9 |
+
|
10 |
+
Supports PHP 5.4 though PHP 7.4.
|
11 |
+
|
12 |
+
# Usage
|
13 |
+
|
14 |
+
```php
|
15 |
+
require 'vendor/autoload.php';
|
16 |
+
|
17 |
+
use Google\CRC32\CRC32;
|
18 |
+
|
19 |
+
$crc = CRC32::create(CRC32::CASTAGNOLI);
|
20 |
+
$crc->update('hello');
|
21 |
+
echo $crc->hash();
|
22 |
+
```
|
23 |
+
|
24 |
+
Depending on the environment and the polynomial, `CRC32::create` will choose
|
25 |
+
the fastest available verison, and return one of the following classes:
|
26 |
+
|
27 |
+
* `Google\CRC32\PHP` - A pure PHP implementation.
|
28 |
+
* `Google\CRC32\Builtin` - A [PHP Hash framework](http://php.net/manual/en/book.hash.php) implementation.
|
29 |
+
* `Google\CRC32\Google` - A hardware accelerated implementation (using [google/crc32c](https://github.com/google/crc32c)).
|
30 |
+
|
31 |
+
When reading 1M byte chunks, using `CRC32::CASTAGNOLI` with PHP 7.4 on a 2014 Macbook Pro we get the following performance (higher is better):
|
32 |
+
|
33 |
+
```
|
34 |
+
Google\CRC32\PHP 12.27 MB/s
|
35 |
+
Google\CRC32\Builtin 468.74 MB/s (available since PHP 7.4)
|
36 |
+
Google\CRC32\Google 24,684.46 MB/s (using crc32c.so)
|
37 |
+
```
|
38 |
+
|
39 |
+
# Install
|
40 |
+
|
41 |
+
```shell
|
42 |
+
$ composer require google/crc32
|
43 |
+
```
|
44 |
+
|
45 |
+
# crc32c.so
|
46 |
+
|
47 |
+
To use the hardware accelerated, a custom PHP extension must be installed. This makes use of [google/crc32c](https://github.com/google/crc32c) which provides a highly optomised `CRC32C` (Castagnoli) implementation using the SSE 4.2 instruction set of Intel CPUs.
|
48 |
+
|
49 |
+
The extension can be installed from pecl, or compiled from stratch.
|
50 |
+
|
51 |
+
```shell
|
52 |
+
TODO pecl install crc32c
|
53 |
+
```
|
54 |
+
|
55 |
+
Once installed or compiled, you'll need to add `extension=crc32c.so` to your php.ini file.
|
56 |
+
|
57 |
+
## Compile (Linux / Mac)
|
58 |
+
|
59 |
+
Ensure that [composer](https://getcomposer.org), build tools (e.g [build-essential](https://packages.debian.org/sid/devel/build-essential), [cmake](https://packages.debian.org/sid/devel/cmake), etc), and php dev headers (e.g [php-dev](https://packages.debian.org/sid/php/php-dev)) are installed.
|
60 |
+
|
61 |
+
Simple (using Makefile):
|
62 |
+
|
63 |
+
```shell
|
64 |
+
make test
|
65 |
+
```
|
66 |
+
|
67 |
+
Alternatively (manually):
|
68 |
+
|
69 |
+
```shell
|
70 |
+
cd ext
|
71 |
+
|
72 |
+
# Install the google/crc32c library
|
73 |
+
./install_crc32c.sh # From source (recommended)
|
74 |
+
|
75 |
+
# or use your favorite package manager, e.g.
|
76 |
+
# brew install crc32c
|
77 |
+
|
78 |
+
# Prepare the build environment
|
79 |
+
phpize
|
80 |
+
./configure
|
81 |
+
|
82 |
+
# or if using a custom crc32c
|
83 |
+
# ./configure --with-crc32c=$(brew --prefix crc32c)
|
84 |
+
|
85 |
+
## Build and test
|
86 |
+
make test
|
87 |
+
```
|
88 |
+
|
89 |
+
The extension will now be at `ext/modules/crc32c.so`. This file should be copied to your [extension directory](https://php.net/extension-dir) and reference in your php.ini.
|
90 |
+
|
91 |
+
```
|
92 |
+
# php.ini
|
93 |
+
extension=crc32c.so
|
94 |
+
```
|
95 |
+
|
96 |
+
## Testing
|
97 |
+
|
98 |
+
`make test` will test with the current PHP. `make test_all` will search for available
|
99 |
+
PHP installs, and test with all of them.
|
100 |
+
|
101 |
+
## Benchmark
|
102 |
+
|
103 |
+
To compare the performance of the different `CRC32C` implementations, run `make benchmark`.
|
104 |
+
|
105 |
+
# Related
|
106 |
+
|
107 |
+
* https://bugs.php.net/bug.php?id=71890
|
108 |
+
|
109 |
+
# TODO
|
110 |
+
|
111 |
+
- [ ] Test if this works on 32 bit machine.
|
112 |
+
- [x] Add php unit (or similar) testing.
|
113 |
+
- [x] Publish to packagist
|
114 |
+
- [ ] Publish to pecl (https://pecl.php.net/account-request.php)
|
115 |
+
- [x] Update instructions for linux.
|
116 |
+
|
117 |
+
|
118 |
+
# Licence (Apache 2)
|
119 |
+
|
120 |
+
*This is not an official Google product (experimental or otherwise), it is just code that happens to be owned by Google.*
|
121 |
+
|
122 |
+
```
|
123 |
+
Copyright 2019 Google Inc. All Rights Reserved.
|
124 |
+
|
125 |
+
Licensed under the Apache License, Version 2.0 (the "License");
|
126 |
+
you may not use this file except in compliance with the License.
|
127 |
+
You may obtain a copy of the License at
|
128 |
+
|
129 |
+
http://www.apache.org/licenses/LICENSE-2.0
|
130 |
+
|
131 |
+
Unless required by applicable law or agreed to in writing, software
|
132 |
+
distributed under the License is distributed on an "AS IS" BASIS,
|
133 |
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
134 |
+
See the License for the specific language governing permissions and
|
135 |
+
limitations under the License.
|
136 |
+
```
|
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"name": "google\/crc32",
|
3 |
+
"description": "Various CRC32 implementations",
|
4 |
+
"homepage": "https:\/\/github.com\/google\/php-crc32",
|
5 |
+
"type": "library",
|
6 |
+
"license": "Apache-2.0",
|
7 |
+
"authors": [
|
8 |
+
{
|
9 |
+
"name": "Andrew Brampton",
|
10 |
+
"email": "bramp@google.com"
|
11 |
+
}
|
12 |
+
],
|
13 |
+
"require": {
|
14 |
+
"php": ">=5.4"
|
15 |
+
},
|
16 |
+
"require-dev": {
|
17 |
+
"paragonie\/random_compat": ">=2",
|
18 |
+
"friendsofphp\/php-cs-fixer": "^1.13 || v2.14.2",
|
19 |
+
"phpunit\/phpunit": "^4"
|
20 |
+
},
|
21 |
+
"autoload": {
|
22 |
+
"psr-4": {
|
23 |
+
"DeliciousBrains\\WP_Offload_Media\\Gcp\\Google\\CRC32\\": "src"
|
24 |
+
}
|
25 |
+
}
|
26 |
+
}
|
@@ -0,0 +1,96 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Copyright 2019 Google LLC
|
5 |
+
*
|
6 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
7 |
+
* you may not use this file except in compliance with the License.
|
8 |
+
* You may obtain a copy of the License at
|
9 |
+
*
|
10 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
11 |
+
*
|
12 |
+
* Unless required by applicable law or agreed to in writing, software
|
13 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
14 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
15 |
+
* See the License for the specific language governing permissions and
|
16 |
+
* limitations under the License.
|
17 |
+
*/
|
18 |
+
include __DIR__ . '/vendor/autoload.php';
|
19 |
+
use DeliciousBrains\WP_Offload_Media\Gcp\Google\CRC32\Builtin;
|
20 |
+
use DeliciousBrains\WP_Offload_Media\Gcp\Google\CRC32\CRC32;
|
21 |
+
use DeliciousBrains\WP_Offload_Media\Gcp\Google\CRC32\Google;
|
22 |
+
use DeliciousBrains\WP_Offload_Media\Gcp\Google\CRC32\PHP;
|
23 |
+
use DeliciousBrains\WP_Offload_Media\Gcp\Google\CRC32\PHPSlicedBy4;
|
24 |
+
\define('min_duration', 5);
|
25 |
+
// Min duration of test in seconds.
|
26 |
+
\define('max_duration', 30);
|
27 |
+
// Max duration of test in seconds.
|
28 |
+
\define('min_iterations', 10000);
|
29 |
+
// Min number of iterations.
|
30 |
+
/*
|
31 |
+
Tested on my mid-2014 MacBook Pro (with SSE4.2)
|
32 |
+
Google CRC Benchmarks
|
33 |
+
CRC32CBenchmark/Public/256 214 ns 213 ns 3152131 bytes_per_second=1.11688G/s
|
34 |
+
CRC32CBenchmark/Public/4096 1975 ns 1974 ns 346883 bytes_per_second=1.9328G/s
|
35 |
+
CRC32CBenchmark/Public/65536 31805 ns 31782 ns 21701 bytes_per_second=1.92044G/s
|
36 |
+
CRC32CBenchmark/Public/1048576 508704 ns 508373 ns 1312 bytes_per_second=1.92096G/s
|
37 |
+
CRC32CBenchmark/Public/16777216 8526064 ns 8516872 ns 78 bytes_per_second=1.83459G/s
|
38 |
+
CRC32CBenchmark/Portable/256 363 ns 363 ns 1900480 bytes_per_second=672.139M/s
|
39 |
+
CRC32CBenchmark/Portable/4096 4610 ns 4607 ns 150221 bytes_per_second=847.9M/s
|
40 |
+
CRC32CBenchmark/Portable/65536 72886 ns 72815 ns 9168 bytes_per_second=858.341M/s
|
41 |
+
CRC32CBenchmark/Portable/1048576 1151197 ns 1150417 ns 585 bytes_per_second=869.25M/s
|
42 |
+
CRC32CBenchmark/Portable/16777216 18655381 ns 18640083 ns 36 bytes_per_second=858.365M/s
|
43 |
+
CRC32CBenchmark/Sse42/256 211 ns 211 ns 3245158 bytes_per_second=1.13004G/s
|
44 |
+
CRC32CBenchmark/Sse42/4096 1959 ns 1958 ns 347583 bytes_per_second=1.94816G/s
|
45 |
+
CRC32CBenchmark/Sse42/65536 32041 ns 32013 ns 21616 bytes_per_second=1.90658G/s
|
46 |
+
CRC32CBenchmark/Sse42/1048576 514282 ns 514035 ns 1296 bytes_per_second=1.8998G/s
|
47 |
+
CRC32CBenchmark/Sse42/16777216 8437749 ns 8433051 ns 78 bytes_per_second=1.85283G/s
|
48 |
+
CRC32_PHP 256 1500 11.48 MB/s
|
49 |
+
CRC32_Builtin 256 1500 315.81 MB/s
|
50 |
+
CRC32C_Google 256 1500 1078.78 MB/s
|
51 |
+
CRC32_PHP 4096 1500 11.65 MB/s
|
52 |
+
CRC32_Builtin 4096 1500 457.41 MB/s
|
53 |
+
CRC32C_Google 4096 1500 10836.76 MB/s
|
54 |
+
CRC32_PHP 1048576 118 12.27 MB/s
|
55 |
+
CRC32_Builtin 1048576 1500 468.74 MB/s
|
56 |
+
CRC32C_Google 1048576 1500 24684.46 MB/s
|
57 |
+
CRC32_PHP 16777216 8 12.24 MB/s
|
58 |
+
CRC32_Builtin 16777216 276 461.51 MB/s
|
59 |
+
CRC32C_Google 16777216 1500 20221.71 MB/s
|
60 |
+
*/
|
61 |
+
function test($crc, $chunk_size)
|
62 |
+
{
|
63 |
+
//xdebug_start_trace();
|
64 |
+
$name = \get_class($crc);
|
65 |
+
$chunk = \random_bytes($chunk_size);
|
66 |
+
// TODO for php 5 use https://github.com/paragonie/random_compat
|
67 |
+
$i = 0;
|
68 |
+
$now = \microtime(\true);
|
69 |
+
$start = $now;
|
70 |
+
$duration = 0;
|
71 |
+
while (\true) {
|
72 |
+
$crc->update($chunk);
|
73 |
+
$i++;
|
74 |
+
$now = \microtime(\true);
|
75 |
+
$duration = $now - $start;
|
76 |
+
if ($duration >= \max_duration) {
|
77 |
+
break;
|
78 |
+
}
|
79 |
+
if ($duration >= \min_duration && $i >= \min_iterations) {
|
80 |
+
break;
|
81 |
+
}
|
82 |
+
}
|
83 |
+
// Very quick sanity check
|
84 |
+
if ($crc->hash() == '00000000') {
|
85 |
+
exit($name . ' crc check failed');
|
86 |
+
}
|
87 |
+
$bytes = $i * $chunk_size;
|
88 |
+
echo \sprintf("%s\t%10d\t%5d\t%8.2f MB/s\n", $name, $chunk_size, $i, $bytes / ($now - $start) / 1000000);
|
89 |
+
}
|
90 |
+
foreach (array(256, 4096, 1048576, 16777216) as $chunk_size) {
|
91 |
+
\test(new \DeliciousBrains\WP_Offload_Media\Gcp\Google\CRC32\PHP(\DeliciousBrains\WP_Offload_Media\Gcp\Google\CRC32\CRC32::CASTAGNOLI), $chunk_size);
|
92 |
+
\test(new \DeliciousBrains\WP_Offload_Media\Gcp\Google\CRC32\PHPSlicedBy4(\DeliciousBrains\WP_Offload_Media\Gcp\Google\CRC32\CRC32::CASTAGNOLI), $chunk_size);
|
93 |
+
// Using IEEE, avoiding the CASTAGNOLI version crc32c.so adds.
|
94 |
+
\test(new \DeliciousBrains\WP_Offload_Media\Gcp\Google\CRC32\Builtin(\DeliciousBrains\WP_Offload_Media\Gcp\Google\CRC32\CRC32::IEEE), $chunk_size);
|
95 |
+
\test(new \DeliciousBrains\WP_Offload_Media\Gcp\Google\CRC32\Google(), $chunk_size);
|
96 |
+
}
|
@@ -0,0 +1,63 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
dnl Copyright 2019 Google Inc. All Rights Reserved.
|
2 |
+
dnl
|
3 |
+
dnl Licensed under the Apache License, Version 2.0 (the "License");
|
4 |
+
dnl you may not use this file except in compliance with the License.
|
5 |
+
dnl You may obtain a copy of the License at
|
6 |
+
dnl
|
7 |
+
dnl http://www.apache.org/licenses/LICENSE-2.0
|
8 |
+
dnl
|
9 |
+
dnl Unless required by applicable law or agreed to in writing, software
|
10 |
+
dnl distributed under the License is distributed on an "AS-IS" BASIS,
|
11 |
+
dnl WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12 |
+
dnl See the License for the specific language governing permissions and
|
13 |
+
dnl limitations under the License.
|
14 |
+
dnl
|
15 |
+
|
16 |
+
PHP_ARG_WITH(crc32c, for crc32c support,
|
17 |
+
[ --with-crc32c[=DIR] Include crc32c support. File is the optional path to google/crc32c])
|
18 |
+
|
19 |
+
if test "$PHP_CRC32C" != "no"; then
|
20 |
+
PHP_REQUIRE_CXX() # The external crc32c library uses C++.
|
21 |
+
|
22 |
+
if test -r $PHP_CRC32C/; then
|
23 |
+
SEARCH_PATH=$PHP_CRC32C
|
24 |
+
else
|
25 |
+
SEARCH_PATH="$PWD/crc32c/build /usr/local /usr"
|
26 |
+
fi
|
27 |
+
|
28 |
+
|
29 |
+
AC_MSG_CHECKING([for crc32c files])
|
30 |
+
SEARCH_FOR="include/crc32c/crc32c.h"
|
31 |
+
|
32 |
+
for i in $SEARCH_PATH ; do
|
33 |
+
if test -r $i/$SEARCH_FOR; then
|
34 |
+
CRC32C_DIR=$i
|
35 |
+
AC_MSG_RESULT(found in $i)
|
36 |
+
fi
|
37 |
+
done
|
38 |
+
|
39 |
+
# --with-crc32c -> check with-path
|
40 |
+
if test -z "$CRC32C_DIR"; then
|
41 |
+
AC_MSG_RESULT([not found])
|
42 |
+
AC_MSG_ERROR([Please install the google/crc32c package, and use --with-crc32c])
|
43 |
+
fi
|
44 |
+
|
45 |
+
# --with-crc32c -> add include path
|
46 |
+
PHP_ADD_INCLUDE($CRC32C_DIR/include)
|
47 |
+
|
48 |
+
# --with-crc32c -> check for lib and symbol presence
|
49 |
+
LIBNAME=crc32c
|
50 |
+
LIBSYMBOL=crc32c_extend
|
51 |
+
|
52 |
+
PHP_CHECK_LIBRARY($LIBNAME, $LIBSYMBOL,
|
53 |
+
[
|
54 |
+
PHP_ADD_LIBRARY_WITH_PATH($LIBNAME, $CRC32C_DIR/$PHP_LIBDIR, CRC32C_SHARED_LIBADD)
|
55 |
+
],[
|
56 |
+
AC_MSG_FAILURE([wrong crc32c lib version or lib not found])
|
57 |
+
],[
|
58 |
+
-L$CRC32C_DIR/$PHP_LIBDIR -lm
|
59 |
+
])
|
60 |
+
|
61 |
+
PHP_SUBST(CRC32C_SHARED_LIBADD)
|
62 |
+
PHP_NEW_EXTENSION(crc32c, hash_crc32c.c php_crc32c.c, $ext_shared, , -Wall -Werror)
|
63 |
+
fi
|
@@ -0,0 +1,63 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* Copyright 2019 Google Inc. All Rights Reserved.
|
3 |
+
*
|
4 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
5 |
+
* you may not use this file except in compliance with the License.
|
6 |
+
* You may obtain a copy of the License at
|
7 |
+
*
|
8 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
9 |
+
*
|
10 |
+
* Unless required by applicable law or agreed to in writing, software
|
11 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
12 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13 |
+
* See the License for the specific language governing permissions and
|
14 |
+
* limitations under the License.
|
15 |
+
*/
|
16 |
+
|
17 |
+
/**
|
18 |
+
* crc32c hash extension for PHP
|
19 |
+
*
|
20 |
+
* This file contains the crc32c hash function for
|
21 |
+
* http://php.net/manual/en/function.hash.php
|
22 |
+
*/
|
23 |
+
#include "php_crc32c.h"
|
24 |
+
|
25 |
+
#include "ext/hash/php_hash.h"
|
26 |
+
#include "ext/hash/php_hash_crc32.h"
|
27 |
+
|
28 |
+
#include "crc32c/crc32c.h"
|
29 |
+
|
30 |
+
PHP_HASH_API void CRC32CInit(PHP_CRC32_CTX *context)
|
31 |
+
{
|
32 |
+
context->state = 0;
|
33 |
+
}
|
34 |
+
|
35 |
+
PHP_HASH_API void CRC32CUpdate(PHP_CRC32_CTX *context, const unsigned char *input, size_t len)
|
36 |
+
{
|
37 |
+
context->state = crc32c_extend(context->state, input, len);
|
38 |
+
}
|
39 |
+
|
40 |
+
PHP_HASH_API void CRC32CFinal(uint8_t crc[4], PHP_CRC32_CTX *context)
|
41 |
+
{
|
42 |
+
int2byte(context->state, crc);
|
43 |
+
context->state = 0;
|
44 |
+
}
|
45 |
+
|
46 |
+
PHP_HASH_API int CRC32CCopy(const php_hash_ops *ops, PHP_CRC32_CTX *orig_context, PHP_CRC32_CTX *copy_context)
|
47 |
+
{
|
48 |
+
copy_context->state = orig_context->state;
|
49 |
+
return SUCCESS;
|
50 |
+
}
|
51 |
+
|
52 |
+
const php_hash_ops crc32_ops = {
|
53 |
+
(php_hash_init_func_t) CRC32CInit,
|
54 |
+
(php_hash_update_func_t) CRC32CUpdate,
|
55 |
+
(php_hash_final_func_t) CRC32CFinal,
|
56 |
+
(php_hash_copy_func_t) CRC32CCopy,
|
57 |
+
4, /* what to say here? */
|
58 |
+
4,
|
59 |
+
sizeof(PHP_CRC32_CTX),
|
60 |
+
#if PHP_API_VERSION >= 20170718
|
61 |
+
0
|
62 |
+
#endif
|
63 |
+
};
|
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#!/bin/sh
|
2 |
+
# Used to build and install the google/crc32c library.
|
3 |
+
|
4 |
+
##
|
5 |
+
# Copyright 2019 Google Inc. All Rights Reserved.
|
6 |
+
#
|
7 |
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
8 |
+
# you may not use this file except in compliance with the License.
|
9 |
+
# You may obtain a copy of the License at
|
10 |
+
#
|
11 |
+
# http://www.apache.org/licenses/LICENSE-2.0
|
12 |
+
#
|
13 |
+
# Unless required by applicable law or agreed to in writing, software
|
14 |
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
15 |
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
16 |
+
# See the License for the specific language governing permissions and
|
17 |
+
# limitations under the License.
|
18 |
+
##
|
19 |
+
|
20 |
+
git clone https://github.com/google/crc32c
|
21 |
+
|
22 |
+
cd crc32c
|
23 |
+
git submodule update --init --recursive
|
24 |
+
|
25 |
+
mkdir build
|
26 |
+
cd build
|
27 |
+
cmake -DCRC32C_BUILD_TESTS=0 \
|
28 |
+
-DCRC32C_BUILD_BENCHMARKS=0 \
|
29 |
+
-DCRC32C_USE_GLOG=0 \
|
30 |
+
-DBUILD_SHARED_LIBS=0 \
|
31 |
+
-DCMAKE_POSITION_INDEPENDENT_CODE=TRUE \
|
32 |
+
-DCMAKE_INSTALL_PREFIX:PATH=$PWD \
|
33 |
+
..
|
34 |
+
cmake --build . --target install
|
@@ -0,0 +1,174 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* Copyright 2019 Google Inc. All Rights Reserved.
|
3 |
+
*
|
4 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
5 |
+
* you may not use this file except in compliance with the License.
|
6 |
+
* You may obtain a copy of the License at
|
7 |
+
*
|
8 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
9 |
+
*
|
10 |
+
* Unless required by applicable law or agreed to in writing, software
|
11 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
12 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13 |
+
* See the License for the specific language governing permissions and
|
14 |
+
* limitations under the License.
|
15 |
+
*/
|
16 |
+
|
17 |
+
/**
|
18 |
+
* crc32c extension for PHP
|
19 |
+
*
|
20 |
+
* This file sets up the crc32c module, and provide the 'crc32c' function.
|
21 |
+
*/
|
22 |
+
|
23 |
+
#include "php_crc32c.h"
|
24 |
+
|
25 |
+
#include "ext/hash/php_hash.h"
|
26 |
+
#include "ext/standard/info.h"
|
27 |
+
|
28 |
+
#include "crc32c/crc32c.h"
|
29 |
+
|
30 |
+
extern const php_hash_ops crc32_ops;
|
31 |
+
|
32 |
+
static uint32_t byte2int(const uint8_t hash[4]) {
|
33 |
+
return (hash[0] << 24) | (hash[1] << 16) | (hash[2] << 8) | hash[3];
|
34 |
+
}
|
35 |
+
|
36 |
+
/* {{{ int crc32c( string $data [, int $crc ] )
|
37 |
+
*/
|
38 |
+
PHP_FUNCTION(crc32c)
|
39 |
+
{
|
40 |
+
char *data_arg = NULL;
|
41 |
+
size_t data_len = 0;
|
42 |
+
char *crc_arg = NULL;
|
43 |
+
size_t crc_len = 0;
|
44 |
+
|
45 |
+
#if PHP_API_VERSION >= 20151012 /* >= PHP 7.0 */
|
46 |
+
// fast_zpp is a faster way to parse paramters.
|
47 |
+
ZEND_PARSE_PARAMETERS_START(1, 2)
|
48 |
+
Z_PARAM_STRING(data_arg, data_len)
|
49 |
+
Z_PARAM_OPTIONAL
|
50 |
+
Z_PARAM_STRING_EX(crc_arg, crc_len, /* check_null */ 1, 0)
|
51 |
+
ZEND_PARSE_PARAMETERS_END_EX(RETURN_FALSE);
|
52 |
+
#else
|
53 |
+
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|s!", &data_arg, &data_len, &crc_arg, &crc_len) == FAILURE) {
|
54 |
+
RETURN_BOOL(false);
|
55 |
+
}
|
56 |
+
#endif
|
57 |
+
|
58 |
+
uint32_t crc = 0;
|
59 |
+
|
60 |
+
if (crc_len == 4) {
|
61 |
+
crc = byte2int((uint8_t *)crc_arg);
|
62 |
+
|
63 |
+
} else if (crc_arg != NULL) {
|
64 |
+
zend_error(E_WARNING, "crc32c(): Supplied crc must be a 4 byte string");
|
65 |
+
RETURN_BOOL(false);
|
66 |
+
}
|
67 |
+
|
68 |
+
crc = crc32c_extend(crc, (const uint8_t *)data_arg, data_len);
|
69 |
+
|
70 |
+
uint8_t hash[4];
|
71 |
+
int2byte(crc, hash);
|
72 |
+
|
73 |
+
#if PHP_API_VERSION >= 20151012 /* >= PHP 7.0 */
|
74 |
+
RETURN_STRINGL((const char *)hash, sizeof(hash));
|
75 |
+
#else
|
76 |
+
RETURN_STRINGL((const char *)hash, sizeof(hash), /* dup */ 1);
|
77 |
+
#endif
|
78 |
+
}
|
79 |
+
/* }}}*/
|
80 |
+
|
81 |
+
|
82 |
+
/* {{{ PHP_RINIT_FUNCTION
|
83 |
+
*/
|
84 |
+
PHP_RINIT_FUNCTION(crc32c)
|
85 |
+
{
|
86 |
+
#if PHP_VERSION_ID >= 70000
|
87 |
+
# if defined(ZTS) && defined(COMPILE_DL_CRC32C)
|
88 |
+
ZEND_TSRMLS_CACHE_UPDATE();
|
89 |
+
# endif
|
90 |
+
#endif
|
91 |
+
|
92 |
+
return SUCCESS;
|
93 |
+
}
|
94 |
+
/* }}} */
|
95 |
+
|
96 |
+
/* {{{ PHP_MINIT_FUNCTION
|
97 |
+
*/
|
98 |
+
PHP_MINIT_FUNCTION(crc32c)
|
99 |
+
{
|
100 |
+
php_hash_register_algo("crc32c", &crc32_ops);
|
101 |
+
return SUCCESS;
|
102 |
+
}
|
103 |
+
/* }}} */
|
104 |
+
|
105 |
+
/* {{{ PHP_MSHUTDOWN_FUNCTION
|
106 |
+
*/
|
107 |
+
PHP_MSHUTDOWN_FUNCTION(crc32c)
|
108 |
+
{
|
109 |
+
// TODO Unregister php_hash_register_algo
|
110 |
+
return SUCCESS;
|
111 |
+
}
|
112 |
+
/* }}} */
|
113 |
+
|
114 |
+
/* {{{ PHP_MINFO_FUNCTION
|
115 |
+
*/
|
116 |
+
PHP_MINFO_FUNCTION(crc32c)
|
117 |
+
{
|
118 |
+
php_info_print_table_start();
|
119 |
+
php_info_print_table_header(2, "Google CRC32C support", "enabled");
|
120 |
+
php_info_print_table_end();
|
121 |
+
}
|
122 |
+
/* }}} */
|
123 |
+
|
124 |
+
/* {{{ arginfo
|
125 |
+
*/
|
126 |
+
ZEND_BEGIN_ARG_INFO_EX(arginfo_crc32c, 0, 0, 1)
|
127 |
+
ZEND_ARG_INFO(0, str)
|
128 |
+
ZEND_ARG_INFO(0, crc)
|
129 |
+
ZEND_END_ARG_INFO()
|
130 |
+
/* }}} */
|
131 |
+
|
132 |
+
/* {{{ crc32c_functions[]
|
133 |
+
*/
|
134 |
+
static const zend_function_entry crc32c_functions[] = {
|
135 |
+
PHP_FE(crc32c, arginfo_crc32c)
|
136 |
+
PHP_FE_END
|
137 |
+
};
|
138 |
+
/* }}} */
|
139 |
+
|
140 |
+
/* {{{ crc32c_deps
|
141 |
+
*/
|
142 |
+
static const zend_module_dep crc32c_deps[] = {
|
143 |
+
ZEND_MOD_REQUIRED("hash")
|
144 |
+
ZEND_MOD_END
|
145 |
+
};
|
146 |
+
/* }}} */
|
147 |
+
|
148 |
+
/* {{{ crc32c_module_entry
|
149 |
+
*/
|
150 |
+
zend_module_entry crc32c_module_entry = {
|
151 |
+
STANDARD_MODULE_HEADER_EX, NULL,
|
152 |
+
crc32c_deps, /* Module dependencies */
|
153 |
+
"crc32c", /* Extension name */
|
154 |
+
crc32c_functions, /* zend_function_entry */
|
155 |
+
PHP_MINIT(crc32c), /* PHP_MINIT - Module initialization */
|
156 |
+
PHP_MSHUTDOWN(crc32c), /* PHP_MSHUTDOWN - Module shutdown */
|
157 |
+
PHP_RINIT(crc32c), /* PHP_RINIT - Request initialization */
|
158 |
+
NULL, /* PHP_RSHUTDOWN - Request shutdown */
|
159 |
+
PHP_MINFO(crc32c), /* PHP_MINFO - Module info */
|
160 |
+
PHP_CRC32C_VERSION, /* Version */
|
161 |
+
STANDARD_MODULE_PROPERTIES
|
162 |
+
};
|
163 |
+
/* }}} */
|
164 |
+
|
165 |
+
#ifdef COMPILE_DL_CRC32C
|
166 |
+
|
167 |
+
# if PHP_VERSION_ID >= 70000
|
168 |
+
# ifdef ZTS
|
169 |
+
ZEND_TSRMLS_CACHE_DEFINE()
|
170 |
+
# endif
|
171 |
+
# endif /* PHP_VERSION_ID >= 70000 */
|
172 |
+
|
173 |
+
ZEND_GET_MODULE(crc32c)
|
174 |
+
#endif /* COMPILE_DL_CRC32C */
|
@@ -0,0 +1,53 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* Copyright 2019 Google Inc. All Rights Reserved.
|
3 |
+
*
|
4 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
5 |
+
* you may not use this file except in compliance with the License.
|
6 |
+
* You may obtain a copy of the License at
|
7 |
+
*
|
8 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
9 |
+
*
|
10 |
+
* Unless required by applicable law or agreed to in writing, software
|
11 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
12 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13 |
+
* See the License for the specific language governing permissions and
|
14 |
+
* limitations under the License.
|
15 |
+
*/
|
16 |
+
|
17 |
+
/**
|
18 |
+
* crc32c extension for PHP
|
19 |
+
*/
|
20 |
+
#ifndef PHP_CRC32C_H
|
21 |
+
# define PHP_CRC32C_H
|
22 |
+
|
23 |
+
#ifdef HAVE_CONFIG_H
|
24 |
+
# include "config.h"
|
25 |
+
#endif
|
26 |
+
|
27 |
+
#include "php.h"
|
28 |
+
|
29 |
+
#include <stdint.h>
|
30 |
+
#include <stdbool.h>
|
31 |
+
|
32 |
+
#ifdef ZTS
|
33 |
+
# include "TSRM.h"
|
34 |
+
#endif
|
35 |
+
|
36 |
+
extern zend_module_entry crc32c_module_entry;
|
37 |
+
|
38 |
+
# define PHP_CRC32C_VERSION "1.0.0"
|
39 |
+
|
40 |
+
# if PHP_VERSION_ID >= 70000
|
41 |
+
# if defined(ZTS) && defined(COMPILE_DL_CRC32C)
|
42 |
+
ZEND_TSRMLS_CACHE_EXTERN()
|
43 |
+
# endif
|
44 |
+
# endif
|
45 |
+
|
46 |
+
static void int2byte(uint32_t i, uint8_t b[4]) {
|
47 |
+
b[0] = (uint8_t) ((i >> 24) & 0xff);
|
48 |
+
b[1] = (uint8_t) ((i >> 16) & 0xff);
|
49 |
+
b[2] = (uint8_t) ((i >> 8) & 0xff);
|
50 |
+
b[3] = (uint8_t) (i & 0xff);
|
51 |
+
}
|
52 |
+
|
53 |
+
#endif /* PHP_CRC32C_H */
|
@@ -0,0 +1,74 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Copyright 2019 Google LLC
|
5 |
+
*
|
6 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
7 |
+
* you may not use this file except in compliance with the License.
|
8 |
+
* You may obtain a copy of the License at
|
9 |
+
*
|
10 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
11 |
+
*
|
12 |
+
* Unless required by applicable law or agreed to in writing, software
|
13 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
14 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
15 |
+
* See the License for the specific language governing permissions and
|
16 |
+
* limitations under the License.
|
17 |
+
*/
|
18 |
+
namespace DeliciousBrains\WP_Offload_Media\Gcp\Google\CRC32;
|
19 |
+
|
20 |
+
use DeliciousBrains\WP_Offload_Media\Gcp\Google\CRC32\CRC32;
|
21 |
+
use DeliciousBrains\WP_Offload_Media\Gcp\Google\CRC32\CRCInterface;
|
22 |
+
/**
|
23 |
+
* A CRC32 implementation based on the PHP hash functions.
|
24 |
+
*/
|
25 |
+
final class Builtin implements \DeliciousBrains\WP_Offload_Media\Gcp\Google\CRC32\CRCInterface
|
26 |
+
{
|
27 |
+
private $hc;
|
28 |
+
private static $mapping = [\DeliciousBrains\WP_Offload_Media\Gcp\Google\CRC32\CRC32::IEEE => 'crc32b', \DeliciousBrains\WP_Offload_Media\Gcp\Google\CRC32\CRC32::CASTAGNOLI => 'crc32c'];
|
29 |
+
/**
|
30 |
+
* Returns true if this $polynomial is supported by the builtin PHP hash function.
|
31 |
+
*
|
32 |
+
* @param integer $polynomial The polynomial
|
33 |
+
*
|
34 |
+
* @return boolean
|
35 |
+
*/
|
36 |
+
public static function supports($polynomial)
|
37 |
+
{
|
38 |
+
if (!isset(self::$mapping[$polynomial])) {
|
39 |
+
return false;
|
40 |
+
}
|
41 |
+
$algo = self::$mapping[$polynomial];
|
42 |
+
return in_array($algo, hash_algos());
|
43 |
+
}
|
44 |
+
public function __construct($polynomial)
|
45 |
+
{
|
46 |
+
if (!self::supports($polynomial)) {
|
47 |
+
throw new \InvalidArgumentException("hash_algos() does not list this polynomial.");
|
48 |
+
}
|
49 |
+
$this->algo = self::$mapping[$polynomial];
|
50 |
+
$this->reset();
|
51 |
+
}
|
52 |
+
public function reset()
|
53 |
+
{
|
54 |
+
$this->hc = hash_init($this->algo);
|
55 |
+
}
|
56 |
+
public function update($data)
|
57 |
+
{
|
58 |
+
hash_update($this->hc, $data);
|
59 |
+
}
|
60 |
+
public function hash($raw_output = null)
|
61 |
+
{
|
62 |
+
// hash_final will destory the Hash Context resource, so operate on a copy.
|
63 |
+
$hc = hash_copy($this->hc);
|
64 |
+
return hash_final($hc, $raw_output);
|
65 |
+
}
|
66 |
+
public function version()
|
67 |
+
{
|
68 |
+
return $this->algo . ' PHP HASH';
|
69 |
+
}
|
70 |
+
public function __clone()
|
71 |
+
{
|
72 |
+
$this->hc = hash_copy($this->hc);
|
73 |
+
}
|
74 |
+
}
|
@@ -0,0 +1,97 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Copyright 2019 Google LLC
|
5 |
+
*
|
6 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
7 |
+
* you may not use this file except in compliance with the License.
|
8 |
+
* You may obtain a copy of the License at
|
9 |
+
*
|
10 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
11 |
+
*
|
12 |
+
* Unless required by applicable law or agreed to in writing, software
|
13 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
14 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
15 |
+
* See the License for the specific language governing permissions and
|
16 |
+
* limitations under the License.
|
17 |
+
*/
|
18 |
+
namespace DeliciousBrains\WP_Offload_Media\Gcp\Google\CRC32;
|
19 |
+
|
20 |
+
use DeliciousBrains\WP_Offload_Media\Gcp\Google\CRC32\Builtin;
|
21 |
+
use DeliciousBrains\WP_Offload_Media\Gcp\Google\CRC32\Google;
|
22 |
+
use DeliciousBrains\WP_Offload_Media\Gcp\Google\CRC32\PHP;
|
23 |
+
/**
|
24 |
+
* Various CRC32 implementations.
|
25 |
+
*
|
26 |
+
* ```
|
27 |
+
* use Google\CRC32\CRC32;
|
28 |
+
*
|
29 |
+
* $crc = CRC32::create(CRC32::CASTAGNOLI);
|
30 |
+
* $crc->update('hello');
|
31 |
+
*
|
32 |
+
* echo $crc->hash();
|
33 |
+
* ```
|
34 |
+
*/
|
35 |
+
class CRC32
|
36 |
+
{
|
37 |
+
use CRCTrait;
|
38 |
+
/**
|
39 |
+
* IEEE polynomial as used by ethernet (IEEE 802.3), v.42, fddi, gzip,
|
40 |
+
* zip, png, ...
|
41 |
+
*/
|
42 |
+
const IEEE = 0xedb88320;
|
43 |
+
/**
|
44 |
+
* Castagnoli's polynomial, used in iSCSI, SCTP, Google Cloud Storage,
|
45 |
+
* Apache Kafka, and has hardware-accelerated in modern intel CPUs.
|
46 |
+
* https://doi.org/10.1109/26.231911
|
47 |
+
*/
|
48 |
+
const CASTAGNOLI = 0x82f63b78;
|
49 |
+
/**
|
50 |
+
* Koopman's polynomial.
|
51 |
+
* https://doi.org/10.1109/DSN.2002.1028931
|
52 |
+
*/
|
53 |
+
const KOOPMAN = 0xeb31d82e;
|
54 |
+
/**
|
55 |
+
* The size of the checksum in bytes.
|
56 |
+
*/
|
57 |
+
const SIZE = 4;
|
58 |
+
private static $mapping = [self::IEEE => 'IEEE', self::CASTAGNOLI => 'Castagnoli', self::KOOPMAN => 'Koopman'];
|
59 |
+
private function __construct()
|
60 |
+
{
|
61 |
+
// Prevent instantiation.
|
62 |
+
}
|
63 |
+
/**
|
64 |
+
* Returns the best CRC implementation available on this machine.
|
65 |
+
*
|
66 |
+
* @param integer $polynomial The CRC polynomial. Use a 32-bit number,
|
67 |
+
* or one of the supplied constants, CRC32::IEEE,
|
68 |
+
* CRC32::CASTAGNOLI, or CRC32::KOOPMAN.
|
69 |
+
*
|
70 |
+
* @return CRC32Interface
|
71 |
+
*/
|
72 |
+
public static function create($polynomial)
|
73 |
+
{
|
74 |
+
if (\DeliciousBrains\WP_Offload_Media\Gcp\Google\CRC32\Google::supports($polynomial) && function_exists('crc32c')) {
|
75 |
+
return new \DeliciousBrains\WP_Offload_Media\Gcp\Google\CRC32\Google();
|
76 |
+
}
|
77 |
+
if (\DeliciousBrains\WP_Offload_Media\Gcp\Google\CRC32\Builtin::supports($polynomial)) {
|
78 |
+
return new \DeliciousBrains\WP_Offload_Media\Gcp\Google\CRC32\Builtin($polynomial);
|
79 |
+
}
|
80 |
+
// Fallback to the pure PHP version
|
81 |
+
return new \DeliciousBrains\WP_Offload_Media\Gcp\Google\CRC32\PHP($polynomial);
|
82 |
+
}
|
83 |
+
/**
|
84 |
+
* Prints the human friendly name for this polynomial.
|
85 |
+
*
|
86 |
+
* @param integer $polynomial The CRC polynomial.
|
87 |
+
*
|
88 |
+
* @return string
|
89 |
+
*/
|
90 |
+
public static function string($polynomial)
|
91 |
+
{
|
92 |
+
if (isset(self::$mapping[$polynomial])) {
|
93 |
+
return self::$mapping[$polynomial];
|
94 |
+
}
|
95 |
+
return '0x' . self::int2hex($polynomial);
|
96 |
+
}
|
97 |
+
}
|
@@ -0,0 +1,56 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Copyright 2019 Google LLC
|
5 |
+
*
|
6 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
7 |
+
* you may not use this file except in compliance with the License.
|
8 |
+
* You may obtain a copy of the License at
|
9 |
+
*
|
10 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
11 |
+
*
|
12 |
+
* Unless required by applicable law or agreed to in writing, software
|
13 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
14 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
15 |
+
* See the License for the specific language governing permissions and
|
16 |
+
* limitations under the License.
|
17 |
+
*/
|
18 |
+
namespace DeliciousBrains\WP_Offload_Media\Gcp\Google\CRC32;
|
19 |
+
|
20 |
+
/**
|
21 |
+
* CRC calculation interface.
|
22 |
+
*
|
23 |
+
* Lots of great info on the different algorithms used:
|
24 |
+
* https://create.stephan-brumme.com/crc32/
|
25 |
+
*/
|
26 |
+
interface CRCInterface
|
27 |
+
{
|
28 |
+
/**
|
29 |
+
* Updates the CRC calculation with the supplied data.
|
30 |
+
*
|
31 |
+
* @param string $data The data
|
32 |
+
*/
|
33 |
+
public function update($data);
|
34 |
+
/**
|
35 |
+
* Resets the CRC calculation.
|
36 |
+
*/
|
37 |
+
public function reset();
|
38 |
+
/**
|
39 |
+
* Return the current calculated CRC hash.
|
40 |
+
*
|
41 |
+
* @param boolean $raw_output When set to TRUE, outputs raw binary data.
|
42 |
+
* FALSE outputs lowercase hexits.
|
43 |
+
*
|
44 |
+
* @return string Returns a string containing the calculated CRC as
|
45 |
+
* lowercase hexits unless raw_output is set to true in
|
46 |
+
* which case the raw binary representation of the CRC is
|
47 |
+
* returned.
|
48 |
+
*/
|
49 |
+
public function hash($raw_output = null);
|
50 |
+
/**
|
51 |
+
* Returns information about the CRC implementation and polynomial.
|
52 |
+
*
|
53 |
+
* @return string
|
54 |
+
*/
|
55 |
+
public function version();
|
56 |
+
}
|
@@ -0,0 +1,53 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Copyright 2019 Google LLC
|
5 |
+
*
|
6 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
7 |
+
* you may not use this file except in compliance with the License.
|
8 |
+
* You may obtain a copy of the License at
|
9 |
+
*
|
10 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
11 |
+
*
|
12 |
+
* Unless required by applicable law or agreed to in writing, software
|
13 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
14 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
15 |
+
* See the License for the specific language governing permissions and
|
16 |
+
* limitations under the License.
|
17 |
+
*/
|
18 |
+
namespace DeliciousBrains\WP_Offload_Media\Gcp\Google\CRC32;
|
19 |
+
|
20 |
+
trait CRCTrait
|
21 |
+
{
|
22 |
+
/**
|
23 |
+
* Converts a integer into a 8 character hex string in lower case.
|
24 |
+
*
|
25 |
+
* @param integer $i Integer to convert.
|
26 |
+
*
|
27 |
+
* @return string 8 character hex string in lower case.
|
28 |
+
*/
|
29 |
+
private static function int2hex($i)
|
30 |
+
{
|
31 |
+
return str_pad(dechex($i), 8, '0', STR_PAD_LEFT);
|
32 |
+
}
|
33 |
+
/**
|
34 |
+
* { function_description }
|
35 |
+
*
|
36 |
+
* @param integer $crc The CRC hash
|
37 |
+
* @param boolean $raw_output When set to TRUE, outputs raw binary data.
|
38 |
+
* FALSE outputs lowercase hexits.
|
39 |
+
*
|
40 |
+
* @return string Returns a string containing the calculated CRC as
|
41 |
+
* lowercase hexits unless raw_output is set to true in
|
42 |
+
* which case the raw binary representation of the CRC is
|
43 |
+
* returned.
|
44 |
+
*/
|
45 |
+
private static function crcHash($crc, $raw_output)
|
46 |
+
{
|
47 |
+
$crc = $crc & 0xffffffff;
|
48 |
+
if ($raw_output) {
|
49 |
+
return pack('N', $crc);
|
50 |
+
}
|
51 |
+
return self::int2hex($crc);
|
52 |
+
}
|
53 |
+
}
|
@@ -0,0 +1,60 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Copyright 2019 Google LLC
|
5 |
+
*
|
6 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
7 |
+
* you may not use this file except in compliance with the License.
|
8 |
+
* You may obtain a copy of the License at
|
9 |
+
*
|
10 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
11 |
+
*
|
12 |
+
* Unless required by applicable law or agreed to in writing, software
|
13 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
14 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
15 |
+
* See the License for the specific language governing permissions and
|
16 |
+
* limitations under the License.
|
17 |
+
*/
|
18 |
+
namespace DeliciousBrains\WP_Offload_Media\Gcp\Google\CRC32;
|
19 |
+
|
20 |
+
use DeliciousBrains\WP_Offload_Media\Gcp\Google\CRC32\CRC32;
|
21 |
+
use DeliciousBrains\WP_Offload_Media\Gcp\Google\CRC32\CRCInterface;
|
22 |
+
/**
|
23 |
+
* A CRC32 implementation using hardware acceleration.
|
24 |
+
*
|
25 |
+
* This uses the C++ https://github.com/google/crc32c library, thus depends on
|
26 |
+
* the `crc32c` PHP extension.
|
27 |
+
*/
|
28 |
+
final class Google implements \DeliciousBrains\WP_Offload_Media\Gcp\Google\CRC32\CRCInterface
|
29 |
+
{
|
30 |
+
public static function supports($algo)
|
31 |
+
{
|
32 |
+
return $algo === \DeliciousBrains\WP_Offload_Media\Gcp\Google\CRC32\CRC32::CASTAGNOLI;
|
33 |
+
}
|
34 |
+
public function __construct()
|
35 |
+
{
|
36 |
+
if (!function_exists('crc32c')) {
|
37 |
+
throw new \InvalidArgumentException("crc32c function not found. Please load the 'crc32c' extension.");
|
38 |
+
}
|
39 |
+
$this->reset();
|
40 |
+
}
|
41 |
+
public function reset()
|
42 |
+
{
|
43 |
+
$this->crc = hex2bin('00000000');
|
44 |
+
}
|
45 |
+
public function update($data)
|
46 |
+
{
|
47 |
+
$this->crc = crc32c($data, $this->crc);
|
48 |
+
}
|
49 |
+
public function hash($raw_output = null)
|
50 |
+
{
|
51 |
+
if ($raw_output === true) {
|
52 |
+
return $this->crc;
|
53 |
+
}
|
54 |
+
return bin2hex($this->crc);
|
55 |
+
}
|
56 |
+
public function version()
|
57 |
+
{
|
58 |
+
return 'Hardware accelerated (https://github.com/google/crc32c)';
|
59 |
+
}
|
60 |
+
}
|
@@ -0,0 +1,69 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Copyright 2019 Google LLC
|
5 |
+
*
|
6 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
7 |
+
* you may not use this file except in compliance with the License.
|
8 |
+
* You may obtain a copy of the License at
|
9 |
+
*
|
10 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
11 |
+
*
|
12 |
+
* Unless required by applicable law or agreed to in writing, software
|
13 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
14 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
15 |
+
* See the License for the specific language governing permissions and
|
16 |
+
* limitations under the License.
|
17 |
+
*/
|
18 |
+
namespace DeliciousBrains\WP_Offload_Media\Gcp\Google\CRC32;
|
19 |
+
|
20 |
+
use DeliciousBrains\WP_Offload_Media\Gcp\Google\CRC32\CRCInterface;
|
21 |
+
use DeliciousBrains\WP_Offload_Media\Gcp\Google\CRC32\CRCTrait;
|
22 |
+
use DeliciousBrains\WP_Offload_Media\Gcp\Google\CRC32\Table;
|
23 |
+
/**
|
24 |
+
* PHP implementation of the CRC32 algorithm.
|
25 |
+
*
|
26 |
+
* Uses a simple lookup table to improve the performances.
|
27 |
+
*/
|
28 |
+
final class PHP implements \DeliciousBrains\WP_Offload_Media\Gcp\Google\CRC32\CRCInterface
|
29 |
+
{
|
30 |
+
use CRCTrait;
|
31 |
+
public static function supports($algo)
|
32 |
+
{
|
33 |
+
return true;
|
34 |
+
}
|
35 |
+
private $table = [];
|
36 |
+
/**
|
37 |
+
* Creates a new instance for this polynomial.
|
38 |
+
*
|
39 |
+
* @param integer $polynomial The polynomial
|
40 |
+
*/
|
41 |
+
public function __construct($polynomial)
|
42 |
+
{
|
43 |
+
$this->polynomial = $polynomial;
|
44 |
+
$this->table = \DeliciousBrains\WP_Offload_Media\Gcp\Google\CRC32\Table::get($polynomial);
|
45 |
+
$this->reset();
|
46 |
+
}
|
47 |
+
public function reset()
|
48 |
+
{
|
49 |
+
$this->crc = ~0;
|
50 |
+
}
|
51 |
+
public function update($data)
|
52 |
+
{
|
53 |
+
$crc = $this->crc;
|
54 |
+
$table = $this->table;
|
55 |
+
$len = strlen($data);
|
56 |
+
for ($i = 0; $i < $len; ++$i) {
|
57 |
+
$crc = $crc >> 8 & 0xffffff ^ $table[($crc ^ ord($data[$i])) & 0xff];
|
58 |
+
}
|
59 |
+
$this->crc = $crc;
|
60 |
+
}
|
61 |
+
public function hash($raw_output = null)
|
62 |
+
{
|
63 |
+
return $this->crcHash(~$this->crc, $raw_output === true);
|
64 |
+
}
|
65 |
+
public function version()
|
66 |
+
{
|
67 |
+
return 'crc32(' . $this->int2hex($this->polynomial) . ') software version';
|
68 |
+
}
|
69 |
+
}
|
@@ -0,0 +1,87 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Copyright 2019 Google LLC
|
5 |
+
*
|
6 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
7 |
+
* you may not use this file except in compliance with the License.
|
8 |
+
* You may obtain a copy of the License at
|
9 |
+
*
|
10 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
11 |
+
*
|
12 |
+
* Unless required by applicable law or agreed to in writing, software
|
13 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
14 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
15 |
+
* See the License for the specific language governing permissions and
|
16 |
+
* limitations under the License.
|
17 |
+
*/
|
18 |
+
namespace DeliciousBrains\WP_Offload_Media\Gcp\Google\CRC32;
|
19 |
+
|
20 |
+
use DeliciousBrains\WP_Offload_Media\Gcp\Google\CRC32\CRCInterface;
|
21 |
+
use DeliciousBrains\WP_Offload_Media\Gcp\Google\CRC32\CRCTrait;
|
22 |
+
use DeliciousBrains\WP_Offload_Media\Gcp\Google\CRC32\Table;
|
23 |
+
/**
|
24 |
+
* PHP implementation of the CRC32 sliced-by-4 algorithm.
|
25 |
+
*
|
26 |
+
* This is typically faster, but the PHP implementation seems slower than the
|
27 |
+
* simple implementation.
|
28 |
+
*/
|
29 |
+
final class PHPSlicedBy4 implements \DeliciousBrains\WP_Offload_Media\Gcp\Google\CRC32\CRCInterface
|
30 |
+
{
|
31 |
+
use CRCTrait;
|
32 |
+
public static function supports($algo)
|
33 |
+
{
|
34 |
+
return true;
|
35 |
+
}
|
36 |
+
private $table;
|
37 |
+
public function __construct($polynomial)
|
38 |
+
{
|
39 |
+
$this->polynomial = $polynomial;
|
40 |
+
$this->table = \DeliciousBrains\WP_Offload_Media\Gcp\Google\CRC32\Table::create4($polynomial);
|
41 |
+
$this->reset();
|
42 |
+
}
|
43 |
+
public function reset()
|
44 |
+
{
|
45 |
+
$this->crc = ~0;
|
46 |
+
}
|
47 |
+
public function update($data)
|
48 |
+
{
|
49 |
+
$crc = $this->crc;
|
50 |
+
$table0 = $this->table[0];
|
51 |
+
$table1 = $this->table[1];
|
52 |
+
$table2 = $this->table[2];
|
53 |
+
$table3 = $this->table[3];
|
54 |
+
$len = strlen($data);
|
55 |
+
$remain = $len % 4;
|
56 |
+
$len1 = $len - $remain;
|
57 |
+
for ($i = 0; $i < $len1; $i += 4) {
|
58 |
+
$b = ord($data[$i + 3]) << 24 | ord($data[$i + 2]) << 16 | ord($data[$i + 1]) << 8 | ord($data[$i]);
|
59 |
+
$crc = ($crc ^ $b) & 0xffffffff;
|
60 |
+
$crc = $table3[$crc & 0xff] ^ $table2[$crc >> 8 & 0xff] ^ $table1[$crc >> 16 & 0xff] ^ $table0[$crc >> 24 & 0xff];
|
61 |
+
}
|
62 |
+
switch ($remain) {
|
63 |
+
case 3:
|
64 |
+
$crc = $crc >> 8 & 0xffffff ^ $table0[($crc ^ ord($data[$i])) & 0xff];
|
65 |
+
$crc = $crc >> 8 & 0xffffff ^ $table0[($crc ^ ord($data[$i + 1])) & 0xff];
|
66 |
+
$crc = $crc >> 8 & 0xffffff ^ $table0[($crc ^ ord($data[$i + 2])) & 0xff];
|
67 |
+
break;
|
68 |
+
case 2:
|
69 |
+
$crc = $crc >> 8 & 0xffffff ^ $table0[($crc ^ ord($data[$i])) & 0xff];
|
70 |
+
$crc = $crc >> 8 & 0xffffff ^ $table0[($crc ^ ord($data[$i + 1])) & 0xff];
|
71 |
+
break;
|
72 |
+
case 1:
|
73 |
+
$crc = $crc >> 8 & 0xffffff ^ $table0[($crc ^ ord($data[$i])) & 0xff];
|
74 |
+
break;
|
75 |
+
case 0:
|
76 |
+
}
|
77 |
+
$this->crc = $crc;
|
78 |
+
}
|
79 |
+
public function hash($raw_output = null)
|
80 |
+
{
|
81 |
+
return $this->crcHash(~$this->crc, $raw_output === true);
|
82 |
+
}
|
83 |
+
public function version()
|
84 |
+
{
|
85 |
+
return 'crc32(' . $this->int2hex($this->polynomial) . ') software version';
|
86 |
+
}
|
87 |
+
}
|
@@ -0,0 +1,104 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Copyright 2019 Google LLC
|
5 |
+
*
|
6 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
7 |
+
* you may not use this file except in compliance with the License.
|
8 |
+
* You may obtain a copy of the License at
|
9 |
+
*
|
10 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
11 |
+
*
|
12 |
+
* Unless required by applicable law or agreed to in writing, software
|
13 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
14 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
15 |
+
* See the License for the specific language governing permissions and
|
16 |
+
* limitations under the License.
|
17 |
+
*/
|
18 |
+
namespace DeliciousBrains\WP_Offload_Media\Gcp\Google\CRC32;
|
19 |
+
|
20 |
+
final class Table
|
21 |
+
{
|
22 |
+
private static $tables = array();
|
23 |
+
/**
|
24 |
+
* Echos the given table. Useful for building a static table to include in source code.
|
25 |
+
*
|
26 |
+
* @param array $table The table
|
27 |
+
*/
|
28 |
+
public static function output(array $table)
|
29 |
+
{
|
30 |
+
foreach ($table as $i => $value) {
|
31 |
+
echo "0x" . int2hex($value) . ",";
|
32 |
+
if ($i % 4 == 3) {
|
33 |
+
echo "\n";
|
34 |
+
} else {
|
35 |
+
echo " ";
|
36 |
+
}
|
37 |
+
}
|
38 |
+
echo "\n\n";
|
39 |
+
}
|
40 |
+
/**
|
41 |
+
* Gets a CRC table, by creating it, or using a previously cached result.
|
42 |
+
*
|
43 |
+
* @param integer $polynomial The polynomial
|
44 |
+
*
|
45 |
+
* @return array The table
|
46 |
+
*/
|
47 |
+
public static function get($polynomial)
|
48 |
+
{
|
49 |
+
if (isset(self::$tables[$polynomial])) {
|
50 |
+
return self::$tables[$polynomial];
|
51 |
+
}
|
52 |
+
self::$tables[$polynomial] = self::create($polynomial);
|
53 |
+
return self::$tables[$polynomial];
|
54 |
+
}
|
55 |
+
/**
|
56 |
+
* Create a CRC table.
|
57 |
+
*
|
58 |
+
* @param integer $polynomial The polynomial.
|
59 |
+
*
|
60 |
+
* @return array The table.
|
61 |
+
*/
|
62 |
+
public static function create($polynomial)
|
63 |
+
{
|
64 |
+
$table = array_fill(0, 256, 0);
|
65 |
+
for ($i = 0; $i < 256; $i++) {
|
66 |
+
$crc = $i;
|
67 |
+
for ($j = 0; $j < 8; $j++) {
|
68 |
+
if ($crc & 1 == 1) {
|
69 |
+
$crc = $crc >> 1 ^ $polynomial;
|
70 |
+
} else {
|
71 |
+
$crc >>= 1;
|
72 |
+
}
|
73 |
+
}
|
74 |
+
$table[$i] = $crc;
|
75 |
+
}
|
76 |
+
return $table;
|
77 |
+
}
|
78 |
+
/**
|
79 |
+
* Create a CRC table sliced by 4.
|
80 |
+
*
|
81 |
+
* @param integer $polynomial The polynomial.
|
82 |
+
*
|
83 |
+
* @return array The table.
|
84 |
+
*/
|
85 |
+
public static function create4($polynomial)
|
86 |
+
{
|
87 |
+
$table = array_fill(0, 4, array_fill(0, 256, 0));
|
88 |
+
$table[0] = self::create($polynomial);
|
89 |
+
for ($i = 0; $i < 256; $i++) {
|
90 |
+
// for Slicing-by-4 and Slicing-by-8
|
91 |
+
$table[1][$i] = $table[0][$i] >> 8 ^ $table[0][$table[0][$i] & 0xff];
|
92 |
+
$table[2][$i] = $table[1][$i] >> 8 ^ $table[0][$table[1][$i] & 0xff];
|
93 |
+
$table[3][$i] = $table[2][$i] >> 8 ^ $table[0][$table[2][$i] & 0xff];
|
94 |
+
/*
|
95 |
+
// only Slicing-by-8
|
96 |
+
$table[4][$i] = ($table[3][$i] >> 8) ^ $table[0][$table[3][$i] & 0xFF];
|
97 |
+
$table[5][$i] = ($table[4][$i] >> 8) ^ $table[0][$table[4][$i] & 0xFF];
|
98 |
+
$table[6][$i] = ($table[5][$i] >> 8) ^ $table[0][$table[5][$i] & 0xFF];
|
99 |
+
$table[7][$i] = ($table[6][$i] >> 8) ^ $table[0][$table[6][$i] & 0xFF];
|
100 |
+
*/
|
101 |
+
}
|
102 |
+
return $table;
|
103 |
+
}
|
104 |
+
}
|
@@ -1,5 +1,22 @@
|
|
1 |
# Change Log
|
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
## 6.3.3 - 2018-04-22
|
4 |
|
5 |
* Fix: Default headers when decode_content is specified
|
1 |
# Change Log
|
2 |
|
3 |
+
## 6.4.1 - 2019-10-23
|
4 |
+
|
5 |
+
* No `guzzle.phar` was created in 6.4.0 due expired API token. This release will fix that
|
6 |
+
* Added `parent::__construct()` to `FileCookieJar` and `SessionCookieJar`
|
7 |
+
|
8 |
+
## 6.4.0 - 2019-10-23
|
9 |
+
|
10 |
+
* Improvement: Improved error messages when using curl < 7.21.2 [#2108](https://github.com/guzzle/guzzle/pull/2108)
|
11 |
+
* Fix: Test if response is readable before returning a summary in `RequestException::getResponseBodySummary()` [#2081](https://github.com/guzzle/guzzle/pull/2081)
|
12 |
+
* Fix: Add support for GUZZLE_CURL_SELECT_TIMEOUT environment variable [#2161](https://github.com/guzzle/guzzle/pull/2161)
|
13 |
+
* Improvement: Added `GuzzleHttp\Exception\InvalidArgumentException` [#2163](https://github.com/guzzle/guzzle/pull/2163)
|
14 |
+
* Improvement: Added `GuzzleHttp\_current_time()` to use `hrtime()` if that function exists. [#2242](https://github.com/guzzle/guzzle/pull/2242)
|
15 |
+
* Improvement: Added curl's `appconnect_time` in `TransferStats` [#2284](https://github.com/guzzle/guzzle/pull/2284)
|
16 |
+
* Improvement: Make GuzzleException extend Throwable wherever it's available [#2273](https://github.com/guzzle/guzzle/pull/2273)
|
17 |
+
* Fix: Prevent concurrent writes to file when saving `CookieJar` [#2335](https://github.com/guzzle/guzzle/pull/2335)
|
18 |
+
* Improvement: Update `MockHandler` so we can test transfer time [#2362](https://github.com/guzzle/guzzle/pull/2362)
|
19 |
+
|
20 |
## 6.3.3 - 2018-04-22
|
21 |
|
22 |
* Fix: Default headers when decode_content is specified
|
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
FROM composer:latest as setup
|
2 |
+
|
3 |
+
RUN mkdir /guzzle
|
4 |
+
|
5 |
+
WORKDIR /guzzle
|
6 |
+
|
7 |
+
RUN set -xe \
|
8 |
+
&& composer init --name=guzzlehttp/test --description="Simple project for testing Guzzle scripts" --author="Márk Sági-Kazár <mark.sagikazar@gmail.com>" --no-interaction \
|
9 |
+
&& composer require guzzlehttp/guzzle
|
10 |
+
|
11 |
+
|
12 |
+
FROM php:7.3
|
13 |
+
|
14 |
+
RUN mkdir /guzzle
|
15 |
+
|
16 |
+
WORKDIR /guzzle
|
17 |
+
|
18 |
+
COPY --from=setup /guzzle /guzzle
|
@@ -21,19 +21,18 @@ trivial to integrate with web services.
|
|
21 |
|
22 |
```php
|
23 |
$client = new \GuzzleHttp\Client();
|
24 |
-
$
|
25 |
-
|
26 |
-
|
27 |
-
echo $
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
// Send an asynchronous request.
|
33 |
$request = new \GuzzleHttp\Psr7\Request('GET', 'http://httpbin.org');
|
34 |
$promise = $client->sendAsync($request)->then(function ($response) {
|
35 |
echo 'I completed! ' . $response->getBody();
|
36 |
});
|
|
|
37 |
$promise->wait();
|
38 |
```
|
39 |
|
@@ -57,7 +56,7 @@ curl -sS https://getcomposer.org/installer | php
|
|
57 |
Next, run the Composer command to install the latest stable version of Guzzle:
|
58 |
|
59 |
```bash
|
60 |
-
|
61 |
```
|
62 |
|
63 |
After installing, you need to require Composer's autoloader:
|
@@ -69,7 +68,7 @@ require 'vendor/autoload.php';
|
|
69 |
You can then later update Guzzle using composer:
|
70 |
|
71 |
```bash
|
72 |
-
composer
|
73 |
```
|
74 |
|
75 |
|
@@ -86,6 +85,6 @@ composer.phar update
|
|
86 |
[guzzle-4-repo]: https://github.com/guzzle/guzzle/tree/4.x
|
87 |
[guzzle-5-repo]: https://github.com/guzzle/guzzle/tree/5.3
|
88 |
[guzzle-6-repo]: https://github.com/guzzle/guzzle
|
89 |
-
[guzzle-3-docs]: http://guzzle3.readthedocs.org
|
90 |
[guzzle-5-docs]: http://guzzle.readthedocs.org/en/5.3/
|
91 |
[guzzle-6-docs]: http://guzzle.readthedocs.org/en/latest/
|
21 |
|
22 |
```php
|
23 |
$client = new \GuzzleHttp\Client();
|
24 |
+
$response = $client->request('GET', 'https://api.github.com/repos/guzzle/guzzle');
|
25 |
+
|
26 |
+
echo $response->getStatusCode(); # 200
|
27 |
+
echo $response->getHeaderLine('content-type'); # 'application/json; charset=utf8'
|
28 |
+
echo $response->getBody(); # '{"id": 1420053, "name": "guzzle", ...}'
|
29 |
+
|
30 |
+
# Send an asynchronous request.
|
|
|
|
|
31 |
$request = new \GuzzleHttp\Psr7\Request('GET', 'http://httpbin.org');
|
32 |
$promise = $client->sendAsync($request)->then(function ($response) {
|
33 |
echo 'I completed! ' . $response->getBody();
|
34 |
});
|
35 |
+
|
36 |
$promise->wait();
|
37 |
```
|
38 |
|
56 |
Next, run the Composer command to install the latest stable version of Guzzle:
|
57 |
|
58 |
```bash
|
59 |
+
composer require guzzlehttp/guzzle
|
60 |
```
|
61 |
|
62 |
After installing, you need to require Composer's autoloader:
|
68 |
You can then later update Guzzle using composer:
|
69 |
|
70 |
```bash
|
71 |
+
composer update
|
72 |
```
|
73 |
|
74 |
|
85 |
[guzzle-4-repo]: https://github.com/guzzle/guzzle/tree/4.x
|
86 |
[guzzle-5-repo]: https://github.com/guzzle/guzzle/tree/5.3
|
87 |
[guzzle-6-repo]: https://github.com/guzzle/guzzle
|
88 |
+
[guzzle-3-docs]: http://guzzle3.readthedocs.org
|
89 |
[guzzle-5-docs]: http://guzzle.readthedocs.org/en/5.3/
|
90 |
[guzzle-6-docs]: http://guzzle.readthedocs.org/en/latest/
|
@@ -22,33 +22,37 @@
|
|
22 |
],
|
23 |
"require": {
|
24 |
"php": ">=5.5",
|
25 |
-
"
|
26 |
-
"guzzlehttp\/promises": "^1.0"
|
|
|
27 |
},
|
28 |
"require-dev": {
|
29 |
"ext-curl": "*",
|
30 |
"phpunit\/phpunit": "^4.8.35 || ^5.7 || ^6.4 || ^7.0",
|
31 |
-
"psr\/log": "^1.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
32 |
},
|
33 |
"autoload": {
|
34 |
-
"files": [
|
35 |
-
"src\/functions_include.php"
|
36 |
-
],
|
37 |
"psr-4": {
|
38 |
"DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\": "src\/"
|
39 |
-
}
|
|
|
|
|
|
|
40 |
},
|
41 |
"autoload-dev": {
|
42 |
"psr-4": {
|
43 |
"DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Tests\\": "tests\/"
|
44 |
}
|
45 |
-
},
|
46 |
-
"suggest": {
|
47 |
-
"psr\/log": "Required for using the Log middleware"
|
48 |
-
},
|
49 |
-
"extra": {
|
50 |
-
"branch-alias": {
|
51 |
-
"dev-master": "6.3-dev"
|
52 |
-
}
|
53 |
}
|
54 |
}
|
22 |
],
|
23 |
"require": {
|
24 |
"php": ">=5.5",
|
25 |
+
"ext-json": "*",
|
26 |
+
"guzzlehttp\/promises": "^1.0",
|
27 |
+
"guzzlehttp\/psr7": "^1.6.1"
|
28 |
},
|
29 |
"require-dev": {
|
30 |
"ext-curl": "*",
|
31 |
"phpunit\/phpunit": "^4.8.35 || ^5.7 || ^6.4 || ^7.0",
|
32 |
+
"psr\/log": "^1.1"
|
33 |
+
},
|
34 |
+
"suggest": {
|
35 |
+
"psr\/log": "Required for using the Log middleware"
|
36 |
+
},
|
37 |
+
"config": {
|
38 |
+
"sort-packages": true
|
39 |
+
},
|
40 |
+
"extra": {
|
41 |
+
"branch-alias": {
|
42 |
+
"dev-master": "6.3-dev"
|
43 |
+
}
|
44 |
},
|
45 |
"autoload": {
|
|
|
|
|
|
|
46 |
"psr-4": {
|
47 |
"DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\": "src\/"
|
48 |
+
},
|
49 |
+
"files": [
|
50 |
+
"src\/functions_include.php"
|
51 |
+
]
|
52 |
},
|
53 |
"autoload-dev": {
|
54 |
"psr-4": {
|
55 |
"DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Tests\\": "tests\/"
|
56 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
57 |
}
|
58 |
}
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
parameters:
|
2 |
+
level: 1
|
3 |
+
paths:
|
4 |
+
- src
|
5 |
+
|
6 |
+
ignoreErrors:
|
7 |
+
-
|
8 |
+
message: '#Function uri_template not found#'
|
9 |
+
path: %currentWorkingDirectory%/src/functions.php
|
@@ -172,7 +172,7 @@ class Client implements \DeliciousBrains\WP_Offload_Media\Gcp\GuzzleHttp\ClientI
|
|
172 |
*
|
173 |
* @return array
|
174 |
*/
|
175 |
-
private function prepareDefaults($options)
|
176 |
{
|
177 |
$defaults = $this->config;
|
178 |
if (!empty($defaults['headers'])) {
|
172 |
*
|
173 |
* @return array
|
174 |
*/
|
175 |
+
private function prepareDefaults(array $options)
|
176 |
{
|
177 |
$defaults = $this->config;
|
178 |
if (!empty($defaults['headers'])) {
|
@@ -12,7 +12,7 @@ use DeliciousBrains\WP_Offload_Media\Gcp\Psr\Http\Message\UriInterface;
|
|
12 |
*/
|
13 |
interface ClientInterface
|
14 |
{
|
15 |
-
const VERSION = '6.
|
16 |
/**
|
17 |
* Send an HTTP request.
|
18 |
*
|
12 |
*/
|
13 |
interface ClientInterface
|
14 |
{
|
15 |
+
const VERSION = '6.4.1';
|
16 |
/**
|
17 |
* Send an HTTP request.
|
18 |
*
|
@@ -100,7 +100,7 @@ class CookieJar implements \DeliciousBrains\WP_Offload_Media\Gcp\GuzzleHttp\Cook
|
|
100 |
$this->cookies = [];
|
101 |
return;
|
102 |
} elseif (!$path) {
|
103 |
-
$this->cookies = array_filter($this->cookies, function (\DeliciousBrains\WP_Offload_Media\Gcp\GuzzleHttp\Cookie\SetCookie $cookie) use($
|
104 |
return !$cookie->matchesDomain($domain);
|
105 |
});
|
106 |
} elseif (!$name) {
|
100 |
$this->cookies = [];
|
101 |
return;
|
102 |
} elseif (!$path) {
|
103 |
+
$this->cookies = array_filter($this->cookies, function (\DeliciousBrains\WP_Offload_Media\Gcp\GuzzleHttp\Cookie\SetCookie $cookie) use($domain) {
|
104 |
return !$cookie->matchesDomain($domain);
|
105 |
});
|
106 |
} elseif (!$name) {
|
@@ -22,6 +22,7 @@ class FileCookieJar extends \DeliciousBrains\WP_Offload_Media\Gcp\GuzzleHttp\Coo
|
|
22 |
*/
|
23 |
public function __construct($cookieFile, $storeSessionCookies = false)
|
24 |
{
|
|
|
25 |
$this->filename = $cookieFile;
|
26 |
$this->storeSessionCookies = $storeSessionCookies;
|
27 |
if (file_exists($cookieFile)) {
|
@@ -51,7 +52,7 @@ class FileCookieJar extends \DeliciousBrains\WP_Offload_Media\Gcp\GuzzleHttp\Coo
|
|
51 |
}
|
52 |
}
|
53 |
$jsonStr = \DeliciousBrains\WP_Offload_Media\Gcp\GuzzleHttp\json_encode($json);
|
54 |
-
if (false === file_put_contents($filename, $jsonStr)) {
|
55 |
throw new \RuntimeException("Unable to save file {$filename}");
|
56 |
}
|
57 |
}
|
22 |
*/
|
23 |
public function __construct($cookieFile, $storeSessionCookies = false)
|
24 |
{
|
25 |
+
parent::__construct();
|
26 |
$this->filename = $cookieFile;
|
27 |
$this->storeSessionCookies = $storeSessionCookies;
|
28 |
if (file_exists($cookieFile)) {
|
52 |
}
|
53 |
}
|
54 |
$jsonStr = \DeliciousBrains\WP_Offload_Media\Gcp\GuzzleHttp\json_encode($json);
|
55 |
+
if (false === file_put_contents($filename, $jsonStr, LOCK_EX)) {
|
56 |
throw new \RuntimeException("Unable to save file {$filename}");
|
57 |
}
|
58 |
}
|
@@ -21,6 +21,7 @@ class SessionCookieJar extends \DeliciousBrains\WP_Offload_Media\Gcp\GuzzleHttp\
|
|
21 |
*/
|
22 |
public function __construct($sessionKey, $storeSessionCookies = false)
|
23 |
{
|
|
|
24 |
$this->sessionKey = $sessionKey;
|
25 |
$this->storeSessionCookies = $storeSessionCookies;
|
26 |
$this->load();
|
21 |
*/
|
22 |
public function __construct($sessionKey, $storeSessionCookies = false)
|
23 |
{
|
24 |
+
parent::__construct();
|
25 |
$this->sessionKey = $sessionKey;
|
26 |
$this->storeSessionCookies = $storeSessionCookies;
|
27 |
$this->load();
|
@@ -192,7 +192,7 @@ class SetCookie
|
|
192 |
/**
|
193 |
* Get whether or not this is a secure cookie
|
194 |
*
|
195 |
-
* @return null
|
196 |
*/
|
197 |
public function getSecure()
|
198 |
{
|
@@ -210,7 +210,7 @@ class SetCookie
|
|
210 |
/**
|
211 |
* Get whether or not this is a session cookie
|
212 |
*
|
213 |
-
* @return null
|
214 |
*/
|
215 |
public function getDiscard()
|
216 |
{
|
192 |
/**
|
193 |
* Get whether or not this is a secure cookie
|
194 |
*
|
195 |
+
* @return bool|null
|
196 |
*/
|
197 |
public function getSecure()
|
198 |
{
|
210 |
/**
|
211 |
* Get whether or not this is a session cookie
|
212 |
*
|
213 |
+
* @return bool|null
|
214 |
*/
|
215 |
public function getDiscard()
|
216 |
{
|
@@ -2,15 +2,22 @@
|
|
2 |
|
3 |
namespace DeliciousBrains\WP_Offload_Media\Gcp\GuzzleHttp\Exception;
|
4 |
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16 |
}
|
2 |
|
3 |
namespace DeliciousBrains\WP_Offload_Media\Gcp\GuzzleHttp\Exception;
|
4 |
|
5 |
+
use Throwable;
|
6 |
+
if (interface_exists(\Throwable::class)) {
|
7 |
+
interface GuzzleException extends Throwable
|
8 |
+
{
|
9 |
+
}
|
10 |
+
} else {
|
11 |
+
/**
|
12 |
+
* @method string getMessage()
|
13 |
+
* @method \Throwable|null getPrevious()
|
14 |
+
* @method mixed getCode()
|
15 |
+
* @method string getFile()
|
16 |
+
* @method int getLine()
|
17 |
+
* @method array getTrace()
|
18 |
+
* @method string getTraceAsString()
|
19 |
+
*/
|
20 |
+
interface GuzzleException
|
21 |
+
{
|
22 |
+
}
|
23 |
}
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace DeliciousBrains\WP_Offload_Media\Gcp\GuzzleHttp\Exception;
|
4 |
+
|
5 |
+
final class InvalidArgumentException extends \InvalidArgumentException implements \DeliciousBrains\WP_Offload_Media\Gcp\GuzzleHttp\Exception\GuzzleException
|
6 |
+
{
|
7 |
+
}
|
@@ -87,7 +87,7 @@ class RequestException extends \DeliciousBrains\WP_Offload_Media\Gcp\GuzzleHttp\
|
|
87 |
public static function getResponseBodySummary(\DeliciousBrains\WP_Offload_Media\Gcp\Psr\Http\Message\ResponseInterface $response)
|
88 |
{
|
89 |
$body = $response->getBody();
|
90 |
-
if (!$body->isSeekable()) {
|
91 |
return null;
|
92 |
}
|
93 |
$size = $body->getSize();
|
87 |
public static function getResponseBodySummary(\DeliciousBrains\WP_Offload_Media\Gcp\Psr\Http\Message\ResponseInterface $response)
|
88 |
{
|
89 |
$body = $response->getBody();
|
90 |
+
if (!$body->isSeekable() || !$body->isReadable()) {
|
91 |
return null;
|
92 |
}
|
93 |
$size = $body->getSize();
|
@@ -14,6 +14,8 @@ use DeliciousBrains\WP_Offload_Media\Gcp\Psr\Http\Message\RequestInterface;
|
|
14 |
*/
|
15 |
class CurlFactory implements \DeliciousBrains\WP_Offload_Media\Gcp\GuzzleHttp\Handler\CurlFactoryInterface
|
16 |
{
|
|
|
|
|
17 |
/** @var array */
|
18 |
private $handles = [];
|
19 |
/** @var int Total number of idle handles to keep in cache */
|
@@ -97,13 +99,15 @@ class CurlFactory implements \DeliciousBrains\WP_Offload_Media\Gcp\GuzzleHttp\Ha
|
|
97 |
private static function invokeStats(\DeliciousBrains\WP_Offload_Media\Gcp\GuzzleHttp\Handler\EasyHandle $easy)
|
98 |
{
|
99 |
$curlStats = curl_getinfo($easy->handle);
|
|
|
100 |
$stats = new \DeliciousBrains\WP_Offload_Media\Gcp\GuzzleHttp\TransferStats($easy->request, $easy->response, $curlStats['total_time'], $easy->errno, $curlStats);
|
101 |
call_user_func($easy->options['on_stats'], $stats);
|
102 |
}
|
103 |
private static function finishError(callable $handler, \DeliciousBrains\WP_Offload_Media\Gcp\GuzzleHttp\Handler\EasyHandle $easy, \DeliciousBrains\WP_Offload_Media\Gcp\GuzzleHttp\Handler\CurlFactoryInterface $factory)
|
104 |
{
|
105 |
// Get error information and release the handle to the factory.
|
106 |
-
$ctx = ['errno' => $easy->errno, 'error' => curl_error($easy->handle)] + curl_getinfo($easy->handle);
|
|
|
107 |
$factory->release($easy);
|
108 |
// Retry when nothing is present or when curl failed to rewind.
|
109 |
if (empty($easy->options['_err_message']) && (!$easy->errno || $easy->errno == 65)) {
|
@@ -119,7 +123,11 @@ class CurlFactory implements \DeliciousBrains\WP_Offload_Media\Gcp\GuzzleHttp\Ha
|
|
119 |
if ($easy->onHeadersException) {
|
120 |
return \DeliciousBrains\WP_Offload_Media\Gcp\GuzzleHttp\Promise\rejection_for(new \DeliciousBrains\WP_Offload_Media\Gcp\GuzzleHttp\Exception\RequestException('An error was encountered during the on_headers event', $easy->request, $easy->response, $easy->onHeadersException, $ctx));
|
121 |
}
|
122 |
-
|
|
|
|
|
|
|
|
|
123 |
// Create a connection exception if it was a specific error code.
|
124 |
$error = isset($connectionErrors[$easy->errno]) ? new \DeliciousBrains\WP_Offload_Media\Gcp\GuzzleHttp\Exception\ConnectException($message, $easy->request, null, $ctx) : new \DeliciousBrains\WP_Offload_Media\Gcp\GuzzleHttp\Exception\RequestException($message, $easy->request, $easy->response, null, $ctx);
|
125 |
return \DeliciousBrains\WP_Offload_Media\Gcp\GuzzleHttp\Promise\rejection_for($error);
|
14 |
*/
|
15 |
class CurlFactory implements \DeliciousBrains\WP_Offload_Media\Gcp\GuzzleHttp\Handler\CurlFactoryInterface
|
16 |
{
|
17 |
+
const CURL_VERSION_STR = 'curl_version';
|
18 |
+
const LOW_CURL_VERSION_NUMBER = '7.21.2';
|
19 |
/** @var array */
|
20 |
private $handles = [];
|
21 |
/** @var int Total number of idle handles to keep in cache */
|
99 |
private static function invokeStats(\DeliciousBrains\WP_Offload_Media\Gcp\GuzzleHttp\Handler\EasyHandle $easy)
|
100 |
{
|
101 |
$curlStats = curl_getinfo($easy->handle);
|
102 |
+
$curlStats['appconnect_time'] = curl_getinfo($easy->handle, CURLINFO_APPCONNECT_TIME);
|
103 |
$stats = new \DeliciousBrains\WP_Offload_Media\Gcp\GuzzleHttp\TransferStats($easy->request, $easy->response, $curlStats['total_time'], $easy->errno, $curlStats);
|
104 |
call_user_func($easy->options['on_stats'], $stats);
|
105 |
}
|
106 |
private static function finishError(callable $handler, \DeliciousBrains\WP_Offload_Media\Gcp\GuzzleHttp\Handler\EasyHandle $easy, \DeliciousBrains\WP_Offload_Media\Gcp\GuzzleHttp\Handler\CurlFactoryInterface $factory)
|
107 |
{
|
108 |
// Get error information and release the handle to the factory.
|
109 |
+
$ctx = ['errno' => $easy->errno, 'error' => curl_error($easy->handle), 'appconnect_time' => curl_getinfo($easy->handle, CURLINFO_APPCONNECT_TIME)] + curl_getinfo($easy->handle);
|
110 |
+
$ctx[self::CURL_VERSION_STR] = curl_version()['version'];
|
111 |
$factory->release($easy);
|
112 |
// Retry when nothing is present or when curl failed to rewind.
|
113 |
if (empty($easy->options['_err_message']) && (!$easy->errno || $easy->errno == 65)) {
|
123 |
if ($easy->onHeadersException) {
|
124 |
return \DeliciousBrains\WP_Offload_Media\Gcp\GuzzleHttp\Promise\rejection_for(new \DeliciousBrains\WP_Offload_Media\Gcp\GuzzleHttp\Exception\RequestException('An error was encountered during the on_headers event', $easy->request, $easy->response, $easy->onHeadersException, $ctx));
|
125 |
}
|
126 |
+
if (version_compare($ctx[self::CURL_VERSION_STR], self::LOW_CURL_VERSION_NUMBER)) {
|
127 |
+
$message = sprintf('cURL error %s: %s (%s)', $ctx['errno'], $ctx['error'], 'see https://curl.haxx.se/libcurl/c/libcurl-errors.html');
|
128 |
+
} else {
|
129 |
+
$message = sprintf('cURL error %s: %s (%s) for %s', $ctx['errno'], $ctx['error'], 'see https://curl.haxx.se/libcurl/c/libcurl-errors.html', $easy->request->getUri());
|
130 |
+
}
|
131 |
// Create a connection exception if it was a specific error code.
|
132 |
$error = isset($connectionErrors[$easy->errno]) ? new \DeliciousBrains\WP_Offload_Media\Gcp\GuzzleHttp\Exception\ConnectException($message, $easy->request, null, $ctx) : new \DeliciousBrains\WP_Offload_Media\Gcp\GuzzleHttp\Exception\RequestException($message, $easy->request, $easy->response, null, $ctx);
|
133 |
return \DeliciousBrains\WP_Offload_Media\Gcp\GuzzleHttp\Promise\rejection_for($error);
|
@@ -35,7 +35,13 @@ class CurlMultiHandler
|
|
35 |
public function __construct(array $options = [])
|
36 |
{
|
37 |
$this->factory = isset($options['handle_factory']) ? $options['handle_factory'] : new \DeliciousBrains\WP_Offload_Media\Gcp\GuzzleHttp\Handler\CurlFactory(50);
|
38 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
39 |
}
|
40 |
public function __get($name)
|
41 |
{
|
@@ -68,7 +74,7 @@ class CurlMultiHandler
|
|
68 |
{
|
69 |
// Add any delayed handles if needed.
|
70 |
if ($this->delays) {
|
71 |
-
$currentTime =
|
72 |
foreach ($this->delays as $id => $delay) {
|
73 |
if ($currentTime >= $delay) {
|
74 |
unset($this->delays[$id]);
|
@@ -109,7 +115,7 @@ class CurlMultiHandler
|
|
109 |
if (empty($easy->options['delay'])) {
|
110 |
curl_multi_add_handle($this->_mh, $easy->handle);
|
111 |
} else {
|
112 |
-
$this->delays[$id] =
|
113 |
}
|
114 |
}
|
115 |
/**
|
@@ -148,7 +154,7 @@ class CurlMultiHandler
|
|
148 |
}
|
149 |
private function timeToNext()
|
150 |
{
|
151 |
-
$currentTime =
|
152 |
$nextTime = PHP_INT_MAX;
|
153 |
foreach ($this->delays as $time) {
|
154 |
if ($time < $nextTime) {
|
35 |
public function __construct(array $options = [])
|
36 |
{
|
37 |
$this->factory = isset($options['handle_factory']) ? $options['handle_factory'] : new \DeliciousBrains\WP_Offload_Media\Gcp\GuzzleHttp\Handler\CurlFactory(50);
|
38 |
+
if (isset($options['select_timeout'])) {
|
39 |
+
$this->selectTimeout = $options['select_timeout'];
|
40 |
+
} elseif ($selectTimeout = getenv('GUZZLE_CURL_SELECT_TIMEOUT')) {
|
41 |
+
$this->selectTimeout = $selectTimeout;
|
42 |
+
} else {
|
43 |
+
$this->selectTimeout = 1;
|
44 |
+
}
|
45 |
}
|
46 |
public function __get($name)
|
47 |
{
|
74 |
{
|
75 |
// Add any delayed handles if needed.
|
76 |
if ($this->delays) {
|
77 |
+
$currentTime = \DeliciousBrains\WP_Offload_Media\Gcp\GuzzleHttp\_current_time();
|
78 |
foreach ($this->delays as $id => $delay) {
|
79 |
if ($currentTime >= $delay) {
|
80 |
unset($this->delays[$id]);
|
115 |
if (empty($easy->options['delay'])) {
|
116 |
curl_multi_add_handle($this->_mh, $easy->handle);
|
117 |
} else {
|
118 |
+
$this->delays[$id] = \DeliciousBrains\WP_Offload_Media\Gcp\GuzzleHttp\_current_time() + $easy->options['delay'] / 1000;
|
119 |
}
|
120 |
}
|
121 |
/**
|
154 |
}
|
155 |
private function timeToNext()
|
156 |
{
|
157 |
+
$currentTime = \DeliciousBrains\WP_Offload_Media\Gcp\GuzzleHttp\_current_time();
|
158 |
$nextTime = PHP_INT_MAX;
|
159 |
foreach ($this->delays as $time) {
|
160 |
if ($time < $nextTime) {
|
@@ -145,7 +145,8 @@ class MockHandler implements \Countable
|
|
145 |
private function invokeStats(\DeliciousBrains\WP_Offload_Media\Gcp\Psr\Http\Message\RequestInterface $request, array $options, \DeliciousBrains\WP_Offload_Media\Gcp\Psr\Http\Message\ResponseInterface $response = null, $reason = null)
|
146 |
{
|
147 |
if (isset($options['on_stats'])) {
|
148 |
-
$
|
|
|
149 |
call_user_func($options['on_stats'], $stats);
|
150 |
}
|
151 |
}
|
145 |
private function invokeStats(\DeliciousBrains\WP_Offload_Media\Gcp\Psr\Http\Message\RequestInterface $request, array $options, \DeliciousBrains\WP_Offload_Media\Gcp\Psr\Http\Message\ResponseInterface $response = null, $reason = null)
|
146 |
{
|
147 |
if (isset($options['on_stats'])) {
|
148 |
+
$transferTime = isset($options['transfer_time']) ? $options['transfer_time'] : 0;
|
149 |
+
$stats = new \DeliciousBrains\WP_Offload_Media\Gcp\GuzzleHttp\TransferStats($request, $response, $transferTime, $reason);
|
150 |
call_user_func($options['on_stats'], $stats);
|
151 |
}
|
152 |
}
|
@@ -31,14 +31,14 @@ class StreamHandler
|
|
31 |
if (isset($options['delay'])) {
|
32 |
usleep($options['delay'] * 1000);
|
33 |
}
|
34 |
-
$startTime = isset($options['on_stats']) ?
|
35 |
try {
|
36 |
// Does not support the expect header.
|
37 |
$request = $request->withoutHeader('Expect');
|
38 |
// Append a content-length header if body size is zero to match
|
39 |
// cURL's behavior.
|
40 |
if (0 === $request->getBody()->getSize()) {
|
41 |
-
$request = $request->withHeader('Content-Length', 0);
|
42 |
}
|
43 |
return $this->createResponse($request, $options, $this->createStream($request, $options), $startTime);
|
44 |
} catch (\InvalidArgumentException $e) {
|
@@ -58,7 +58,7 @@ class StreamHandler
|
|
58 |
private function invokeStats(array $options, \DeliciousBrains\WP_Offload_Media\Gcp\Psr\Http\Message\RequestInterface $request, $startTime, \DeliciousBrains\WP_Offload_Media\Gcp\Psr\Http\Message\ResponseInterface $response = null, $error = null)
|
59 |
{
|
60 |
if (isset($options['on_stats'])) {
|
61 |
-
$stats = new \DeliciousBrains\WP_Offload_Media\Gcp\GuzzleHttp\TransferStats($request, $response,
|
62 |
call_user_func($options['on_stats'], $stats);
|
63 |
}
|
64 |
}
|
31 |
if (isset($options['delay'])) {
|
32 |
usleep($options['delay'] * 1000);
|
33 |
}
|
34 |
+
$startTime = isset($options['on_stats']) ? \DeliciousBrains\WP_Offload_Media\Gcp\GuzzleHttp\_current_time() : null;
|
35 |
try {
|
36 |
// Does not support the expect header.
|
37 |
$request = $request->withoutHeader('Expect');
|
38 |
// Append a content-length header if body size is zero to match
|
39 |
// cURL's behavior.
|
40 |
if (0 === $request->getBody()->getSize()) {
|
41 |
+
$request = $request->withHeader('Content-Length', '0');
|
42 |
}
|
43 |
return $this->createResponse($request, $options, $this->createStream($request, $options), $startTime);
|
44 |
} catch (\InvalidArgumentException $e) {
|
58 |
private function invokeStats(array $options, \DeliciousBrains\WP_Offload_Media\Gcp\Psr\Http\Message\RequestInterface $request, $startTime, \DeliciousBrains\WP_Offload_Media\Gcp\Psr\Http\Message\ResponseInterface $response = null, $error = null)
|
59 |
{
|
60 |
if (isset($options['on_stats'])) {
|
61 |
+
$stats = new \DeliciousBrains\WP_Offload_Media\Gcp\GuzzleHttp\TransferStats($request, $response, \DeliciousBrains\WP_Offload_Media\Gcp\GuzzleHttp\_current_time() - $startTime, $error, []);
|
62 |
call_user_func($options['on_stats'], $stats);
|
63 |
}
|
64 |
}
|
@@ -180,7 +180,7 @@ class HandlerStack
|
|
180 |
return $this->cached;
|
181 |
}
|
182 |
/**
|
183 |
-
* @param $name
|
184 |
* @return int
|
185 |
*/
|
186 |
private function findByName($name)
|
@@ -195,10 +195,10 @@ class HandlerStack
|
|
195 |
/**
|
196 |
* Splices a function into the middleware list at a specific position.
|
197 |
*
|
198 |
-
* @param
|
199 |
-
* @param
|
200 |
* @param callable $middleware
|
201 |
-
* @param
|
202 |
*/
|
203 |
private function splice($findName, $withName, callable $middleware, $before)
|
204 |
{
|
180 |
return $this->cached;
|
181 |
}
|
182 |
/**
|
183 |
+
* @param string $name
|
184 |
* @return int
|
185 |
*/
|
186 |
private function findByName($name)
|
195 |
/**
|
196 |
* Splices a function into the middleware list at a specific position.
|
197 |
*
|
198 |
+
* @param string $findName
|
199 |
+
* @param string $withName
|
200 |
* @param callable $middleware
|
201 |
+
* @param bool $before
|
202 |
*/
|
203 |
private function splice($findName, $withName, callable $middleware, $before)
|
204 |
{
|
@@ -8,7 +8,6 @@ use DeliciousBrains\WP_Offload_Media\Gcp\GuzzleHttp\Promise\RejectedPromise;
|
|
8 |
use DeliciousBrains\WP_Offload_Media\Gcp\GuzzleHttp\Psr7;
|
9 |
use DeliciousBrains\WP_Offload_Media\Gcp\Psr\Http\Message\ResponseInterface;
|
10 |
use DeliciousBrains\WP_Offload_Media\Gcp\Psr\Log\LoggerInterface;
|
11 |
-
use DeliciousBrains\WP_Offload_Media\Gcp\Psr\Log\LogLevel;
|
12 |
/**
|
13 |
* Functions used to create and wrap handlers with handler middleware.
|
14 |
*/
|
@@ -53,7 +52,7 @@ final class Middleware
|
|
53 |
if (empty($options['http_errors'])) {
|
54 |
return $handler($request, $options);
|
55 |
}
|
56 |
-
return $handler($request, $options)->then(function (\DeliciousBrains\WP_Offload_Media\Gcp\Psr\Http\Message\ResponseInterface $response) use($request
|
57 |
$code = $response->getStatusCode();
|
58 |
if ($code < 400) {
|
59 |
return $response;
|
@@ -158,7 +157,7 @@ final class Middleware
|
|
158 |
*
|
159 |
* @return callable Returns a function that accepts the next handler.
|
160 |
*/
|
161 |
-
public static function log(\DeliciousBrains\WP_Offload_Media\Gcp\Psr\Log\LoggerInterface $logger, \DeliciousBrains\WP_Offload_Media\Gcp\GuzzleHttp\MessageFormatter $formatter, $logLevel =
|
162 |
{
|
163 |
return function (callable $handler) use($logger, $formatter, $logLevel) {
|
164 |
return function ($request, array $options) use($handler, $logger, $formatter, $logLevel) {
|
8 |
use DeliciousBrains\WP_Offload_Media\Gcp\GuzzleHttp\Psr7;
|
9 |
use DeliciousBrains\WP_Offload_Media\Gcp\Psr\Http\Message\ResponseInterface;
|
10 |
use DeliciousBrains\WP_Offload_Media\Gcp\Psr\Log\LoggerInterface;
|
|
|
11 |
/**
|
12 |
* Functions used to create and wrap handlers with handler middleware.
|
13 |
*/
|
52 |
if (empty($options['http_errors'])) {
|
53 |
return $handler($request, $options);
|
54 |
}
|
55 |
+
return $handler($request, $options)->then(function (\DeliciousBrains\WP_Offload_Media\Gcp\Psr\Http\Message\ResponseInterface $response) use($request) {
|
56 |
$code = $response->getStatusCode();
|
57 |
if ($code < 400) {
|
58 |
return $response;
|
157 |
*
|
158 |
* @return callable Returns a function that accepts the next handler.
|
159 |
*/
|
160 |
+
public static function log(\DeliciousBrains\WP_Offload_Media\Gcp\Psr\Log\LoggerInterface $logger, \DeliciousBrains\WP_Offload_Media\Gcp\GuzzleHttp\MessageFormatter $formatter, $logLevel = 'info')
|
161 |
{
|
162 |
return function (callable $handler) use($logger, $formatter, $logLevel) {
|
163 |
return function ($request, array $options) use($handler, $logger, $formatter, $logLevel) {
|
@@ -6,7 +6,7 @@ use DeliciousBrains\WP_Offload_Media\Gcp\GuzzleHttp\Promise\PromisorInterface;
|
|
6 |
use DeliciousBrains\WP_Offload_Media\Gcp\Psr\Http\Message\RequestInterface;
|
7 |
use DeliciousBrains\WP_Offload_Media\Gcp\GuzzleHttp\Promise\EachPromise;
|
8 |
/**
|
9 |
-
* Sends
|
10 |
*
|
11 |
* The pool will read from an iterator until it is cancelled or until the
|
12 |
* iterator is consumed. When a request is yielded, the request is sent after
|
6 |
use DeliciousBrains\WP_Offload_Media\Gcp\Psr\Http\Message\RequestInterface;
|
7 |
use DeliciousBrains\WP_Offload_Media\Gcp\GuzzleHttp\Promise\EachPromise;
|
8 |
/**
|
9 |
+
* Sends an iterator of requests concurrently using a capped pool size.
|
10 |
*
|
11 |
* The pool will read from an iterator until it is cancelled or until the
|
12 |
* iterator is consumed. When a request is yielded, the request is sent after
|
@@ -128,7 +128,7 @@ class RedirectMiddleware
|
|
128 |
// Add the Referer header if it is told to do so and only
|
129 |
// add the header if we are not redirecting from https to http.
|
130 |
if ($options['allow_redirects']['referer'] && $modify['uri']->getScheme() === $request->getUri()->getScheme()) {
|
131 |
-
$uri = $request->getUri()->withUserInfo(''
|
132 |
$modify['set_headers']['Referer'] = (string) $uri;
|
133 |
} else {
|
134 |
$modify['remove_headers'][] = 'Referer';
|
128 |
// Add the Referer header if it is told to do so and only
|
129 |
// add the header if we are not redirecting from https to http.
|
130 |
if ($options['allow_redirects']['referer'] && $modify['uri']->getScheme() === $request->getUri()->getScheme()) {
|
131 |
+
$uri = $request->getUri()->withUserInfo('');
|
132 |
$modify['set_headers']['Referer'] = (string) $uri;
|
133 |
} else {
|
134 |
$modify['remove_headers'][] = 'Referer';
|
@@ -23,7 +23,7 @@ final class RequestOptions
|
|
23 |
* - strict: (bool, default=false) Set to true to use strict redirects
|
24 |
* meaning redirect POST requests with POST requests vs. doing what most
|
25 |
* browsers do which is redirect POST requests with GET requests
|
26 |
-
* - referer: (bool, default=
|
27 |
* header.
|
28 |
* - protocols: (array, default=['http', 'https']) Allowed redirect
|
29 |
* protocols.
|
23 |
* - strict: (bool, default=false) Set to true to use strict redirects
|
24 |
* meaning redirect POST requests with POST requests vs. doing what most
|
25 |
* browsers do which is redirect POST requests with GET requests
|
26 |
+
* - referer: (bool, default=false) Set to true to enable the Referer
|
27 |
* header.
|
28 |
* - protocols: (array, default=['http', 'https']) Allowed redirect
|
29 |
* protocols.
|
@@ -17,6 +17,8 @@ class RetryMiddleware
|
|
17 |
private $nextHandler;
|
18 |
/** @var callable */
|
19 |
private $decider;
|
|
|
|
|
20 |
/**
|
21 |
* @param callable $decider Function that accepts the number of retries,
|
22 |
* a request, [response], and [exception] and
|
@@ -36,7 +38,7 @@ class RetryMiddleware
|
|
36 |
/**
|
37 |
* Default exponential backoff delay function.
|
38 |
*
|
39 |
-
* @param $retries
|
40 |
*
|
41 |
* @return int
|
42 |
*/
|
17 |
private $nextHandler;
|
18 |
/** @var callable */
|
19 |
private $decider;
|
20 |
+
/** @var callable */
|
21 |
+
private $delay;
|
22 |
/**
|
23 |
* @param callable $decider Function that accepts the number of retries,
|
24 |
* a request, [response], and [exception] and
|
38 |
/**
|
39 |
* Default exponential backoff delay function.
|
40 |
*
|
41 |
+
* @param int $retries
|
42 |
*
|
43 |
* @return int
|
44 |
*/
|
@@ -19,7 +19,7 @@ final class TransferStats
|
|
19 |
/**
|
20 |
* @param RequestInterface $request Request that was sent.
|
21 |
* @param ResponseInterface $response Response received (if any)
|
22 |
-
* @param null
|
23 |
* @param mixed $handlerErrorData Handler error data.
|
24 |
* @param array $handlerStats Handler specific stats.
|
25 |
*/
|
19 |
/**
|
20 |
* @param RequestInterface $request Request that was sent.
|
21 |
* @param ResponseInterface $response Response received (if any)
|
22 |
+
* @param float|null $transferTime Total handler transfer time.
|
23 |
* @param mixed $handlerErrorData Handler error data.
|
24 |
* @param array $handlerStats Handler specific stats.
|
25 |
*/
|
@@ -262,14 +262,14 @@ function is_host_in_noproxy($host, array $noProxyArray)
|
|
262 |
* @param int $options Bitmask of JSON decode options.
|
263 |
*
|
264 |
* @return mixed
|
265 |
-
* @throws \InvalidArgumentException if the JSON cannot be decoded.
|
266 |
* @link http://www.php.net/manual/en/function.json-decode.php
|
267 |
*/
|
268 |
function json_decode($json, $assoc = false, $depth = 512, $options = 0)
|
269 |
{
|
270 |
$data = \json_decode($json, $assoc, $depth, $options);
|
271 |
if (JSON_ERROR_NONE !== json_last_error()) {
|
272 |
-
throw new \InvalidArgumentException('json_decode error: ' . json_last_error_msg());
|
273 |
}
|
274 |
return $data;
|
275 |
}
|
@@ -281,14 +281,25 @@ function json_decode($json, $assoc = false, $depth = 512, $options = 0)
|
|
281 |
* @param int $depth Set the maximum depth. Must be greater than zero.
|
282 |
*
|
283 |
* @return string
|
284 |
-
* @throws \InvalidArgumentException if the JSON cannot be encoded.
|
285 |
* @link http://www.php.net/manual/en/function.json-encode.php
|
286 |
*/
|
287 |
function json_encode($value, $options = 0, $depth = 512)
|
288 |
{
|
289 |
$json = \json_encode($value, $options, $depth);
|
290 |
if (JSON_ERROR_NONE !== json_last_error()) {
|
291 |
-
throw new \InvalidArgumentException('json_encode error: ' . json_last_error_msg());
|
292 |
}
|
293 |
return $json;
|
294 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
262 |
* @param int $options Bitmask of JSON decode options.
|
263 |
*
|
264 |
* @return mixed
|
265 |
+
* @throws Exception\InvalidArgumentException if the JSON cannot be decoded.
|
266 |
* @link http://www.php.net/manual/en/function.json-decode.php
|
267 |
*/
|
268 |
function json_decode($json, $assoc = false, $depth = 512, $options = 0)
|
269 |
{
|
270 |
$data = \json_decode($json, $assoc, $depth, $options);
|
271 |
if (JSON_ERROR_NONE !== json_last_error()) {
|
272 |
+
throw new \DeliciousBrains\WP_Offload_Media\Gcp\GuzzleHttp\Exception\InvalidArgumentException('json_decode error: ' . json_last_error_msg());
|
273 |
}
|
274 |
return $data;
|
275 |
}
|
281 |
* @param int $depth Set the maximum depth. Must be greater than zero.
|
282 |
*
|
283 |
* @return string
|
284 |
+
* @throws Exception\InvalidArgumentException if the JSON cannot be encoded.
|
285 |
* @link http://www.php.net/manual/en/function.json-encode.php
|
286 |
*/
|
287 |
function json_encode($value, $options = 0, $depth = 512)
|
288 |
{
|
289 |
$json = \json_encode($value, $options, $depth);
|
290 |
if (JSON_ERROR_NONE !== json_last_error()) {
|
291 |
+
throw new \DeliciousBrains\WP_Offload_Media\Gcp\GuzzleHttp\Exception\InvalidArgumentException('json_encode error: ' . json_last_error_msg());
|
292 |
}
|
293 |
return $json;
|
294 |
}
|
295 |
+
/**
|
296 |
+
* Wrapper for the hrtime() or microtime() functions
|
297 |
+
* (depending on the PHP version, one of the two is used)
|
298 |
+
*
|
299 |
+
* @return float|mixed UNIX timestamp
|
300 |
+
* @internal
|
301 |
+
*/
|
302 |
+
function _current_time()
|
303 |
+
{
|
304 |
+
return function_exists('hrtime') ? hrtime(true) / 1000000000.0 : microtime(true);
|
305 |
+
}
|
@@ -10,6 +10,26 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
|
|
10 |
## [Unreleased]
|
11 |
|
12 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
## [1.5.2] - 2018-12-04
|
14 |
|
15 |
### Fixed
|
@@ -209,7 +229,8 @@ Currently unsupported:
|
|
209 |
|
210 |
|
211 |
|
212 |
-
[Unreleased]: https://github.com/guzzle/psr7/compare/1.
|
|
|
213 |
[1.5.2]: https://github.com/guzzle/psr7/compare/1.5.1...1.5.2
|
214 |
[1.5.1]: https://github.com/guzzle/psr7/compare/1.5.0...1.5.1
|
215 |
[1.5.0]: https://github.com/guzzle/psr7/compare/1.4.2...1.5.0
|
10 |
## [Unreleased]
|
11 |
|
12 |
|
13 |
+
## [1.6.0]
|
14 |
+
|
15 |
+
### Added
|
16 |
+
|
17 |
+
- Allowed version `^3.0` of `ralouphie/getallheaders` dependency (#244)
|
18 |
+
- Added MIME type for WEBP image format (#246)
|
19 |
+
- Added more validation of values according to PSR-7 and RFC standards, e.g. status code range (#250, #272)
|
20 |
+
|
21 |
+
### Changed
|
22 |
+
|
23 |
+
- Tests don't pass with HHVM 4.0, so HHVM support got dropped. Other libraries like composer have done the same. (#262)
|
24 |
+
- Accept port number 0 to be valid (#270)
|
25 |
+
|
26 |
+
### Fixed
|
27 |
+
|
28 |
+
- Fixed subsequent reads from `php://input` in ServerRequest (#247)
|
29 |
+
- Fixed readable/writable detection for certain stream modes (#248)
|
30 |
+
- Fixed encoding of special characters in the `userInfo` component of an URI (#253)
|
31 |
+
|
32 |
+
|
33 |
## [1.5.2] - 2018-12-04
|
34 |
|
35 |
### Fixed
|
229 |
|
230 |
|
231 |
|
232 |
+
[Unreleased]: https://github.com/guzzle/psr7/compare/1.6.0...HEAD
|
233 |
+
[1.6.0]: https://github.com/guzzle/psr7/compare/1.5.2...1.6.0
|
234 |
[1.5.2]: https://github.com/guzzle/psr7/compare/1.5.1...1.5.2
|
235 |
[1.5.1]: https://github.com/guzzle/psr7/compare/1.5.0...1.5.1
|
236 |
[1.5.0]: https://github.com/guzzle/psr7/compare/1.4.2...1.5.0
|
@@ -27,14 +27,18 @@
|
|
27 |
"require": {
|
28 |
"php": ">=5.4.0",
|
29 |
"psr\/http-message": "~1.0",
|
30 |
-
"ralouphie\/getallheaders": "^2.0.5"
|
31 |
},
|
32 |
"require-dev": {
|
33 |
-
"phpunit\/phpunit": "~4.8.36 || ^5.7.27 || ^6.5.8"
|
|
|
34 |
},
|
35 |
"provide": {
|
36 |
"psr\/http-message-implementation": "1.0"
|
37 |
},
|
|
|
|
|
|
|
38 |
"autoload": {
|
39 |
"psr-4": {
|
40 |
"DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Psr7\\": "src\/"
|
@@ -50,7 +54,7 @@
|
|
50 |
},
|
51 |
"extra": {
|
52 |
"branch-alias": {
|
53 |
-
"dev-master": "1.
|
54 |
}
|
55 |
}
|
56 |
}
|
27 |
"require": {
|
28 |
"php": ">=5.4.0",
|
29 |
"psr\/http-message": "~1.0",
|
30 |
+
"ralouphie\/getallheaders": "^2.0.5 || ^3.0.0"
|
31 |
},
|
32 |
"require-dev": {
|
33 |
+
"phpunit\/phpunit": "~4.8.36 || ^5.7.27 || ^6.5.8",
|
34 |
+
"ext-zlib": "*"
|
35 |
},
|
36 |
"provide": {
|
37 |
"psr\/http-message-implementation": "1.0"
|
38 |
},
|
39 |
+
"suggest": {
|
40 |
+
"zendframework\/zend-httphandlerrunner": "Emit PSR-7 responses"
|
41 |
+
},
|
42 |
"autoload": {
|
43 |
"psr-4": {
|
44 |
"DeliciousBrains\\WP_Offload_Media\\Gcp\\GuzzleHttp\\Psr7\\": "src\/"
|
54 |
},
|
55 |
"extra": {
|
56 |
"branch-alias": {
|
57 |
+
"dev-master": "1.6-dev"
|
58 |
}
|
59 |
}
|
60 |
}
|
@@ -59,7 +59,7 @@ class LimitStream implements \DeliciousBrains\WP_Offload_Media\Gcp\Psr\Http\Mess
|
|
59 |
public function seek($offset, $whence = SEEK_SET)
|
60 |
{
|
61 |
if ($whence !== SEEK_SET || $offset < 0) {
|
62 |
-
throw new \RuntimeException(sprintf('Cannot seek to offset % with whence %s', $offset, $whence));
|
63 |
}
|
64 |
$offset += $this->offset;
|
65 |
if ($this->limit !== -1) {
|
59 |
public function seek($offset, $whence = SEEK_SET)
|
60 |
{
|
61 |
if ($whence !== SEEK_SET || $offset < 0) {
|
62 |
+
throw new \RuntimeException(sprintf('Cannot seek to offset %s with whence %s', $offset, $whence));
|
63 |
}
|
64 |
$offset += $this->offset;
|
65 |
if ($this->limit !== -1) {
|
@@ -52,10 +52,8 @@ trait MessageTrait
|
|
52 |
}
|
53 |
public function withHeader($header, $value)
|
54 |
{
|
55 |
-
|
56 |
-
|
57 |
-
}
|
58 |
-
$value = $this->trimHeaderValues($value);
|
59 |
$normalized = strtolower($header);
|
60 |
$new = clone $this;
|
61 |
if (isset($new->headerNames[$normalized])) {
|
@@ -67,10 +65,8 @@ trait MessageTrait
|
|
67 |
}
|
68 |
public function withAddedHeader($header, $value)
|
69 |
{
|
70 |
-
|
71 |
-
|
72 |
-
}
|
73 |
-
$value = $this->trimHeaderValues($value);
|
74 |
$normalized = strtolower($header);
|
75 |
$new = clone $this;
|
76 |
if (isset($new->headerNames[$normalized])) {
|
@@ -113,10 +109,13 @@ trait MessageTrait
|
|
113 |
{
|
114 |
$this->headerNames = $this->headers = [];
|
115 |
foreach ($headers as $header => $value) {
|
116 |
-
if (
|
117 |
-
|
|
|
|
|
118 |
}
|
119 |
-
$
|
|
|
120 |
$normalized = strtolower($header);
|
121 |
if (isset($this->headerNames[$normalized])) {
|
122 |
$header = $this->headerNames[$normalized];
|
@@ -127,6 +126,16 @@ trait MessageTrait
|
|
127 |
}
|
128 |
}
|
129 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
130 |
/**
|
131 |
* Trims whitespace from the header values.
|
132 |
*
|
@@ -144,7 +153,19 @@ trait MessageTrait
|
|
144 |
private function trimHeaderValues(array $values)
|
145 |
{
|
146 |
return array_map(function ($value) {
|
147 |
-
|
|
|
|
|
|
|
148 |
}, $values);
|
149 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
150 |
}
|
52 |
}
|
53 |
public function withHeader($header, $value)
|
54 |
{
|
55 |
+
$this->assertHeader($header);
|
56 |
+
$value = $this->normalizeHeaderValue($value);
|
|
|
|
|
57 |
$normalized = strtolower($header);
|
58 |
$new = clone $this;
|
59 |
if (isset($new->headerNames[$normalized])) {
|
65 |
}
|
66 |
public function withAddedHeader($header, $value)
|
67 |
{
|
68 |
+
$this->assertHeader($header);
|
69 |
+
$value = $this->normalizeHeaderValue($value);
|
|
|
|
|
70 |
$normalized = strtolower($header);
|
71 |
$new = clone $this;
|
72 |
if (isset($new->headerNames[$normalized])) {
|
109 |
{
|
110 |
$this->headerNames = $this->headers = [];
|
111 |
foreach ($headers as $header => $value) {
|
112 |
+
if (is_int($header)) {
|
113 |
+
// Numeric array keys are converted to int by PHP but having a header name '123' is not forbidden by the spec
|
114 |
+
// and also allowed in withHeader(). So we need to cast it to string again for the following assertion to pass.
|
115 |
+
$header = (string) $header;
|
116 |
}
|
117 |
+
$this->assertHeader($header);
|
118 |
+
$value = $this->normalizeHeaderValue($value);
|
119 |
$normalized = strtolower($header);
|
120 |
if (isset($this->headerNames[$normalized])) {
|
121 |
$header = $this->headerNames[$normalized];
|
126 |
}
|
127 |
}
|
128 |
}
|
129 |
+
private function normalizeHeaderValue($value)
|
130 |
+
{
|
131 |
+
if (!is_array($value)) {
|
132 |
+
return $this->trimHeaderValues([$value]);
|
133 |
+
}
|
134 |
+
if (count($value) === 0) {
|
135 |
+
throw new \InvalidArgumentException('Header value can not be an empty array.');
|
136 |
+
}
|
137 |
+
return $this->trimHeaderValues($value);
|
138 |
+
}
|
139 |
/**
|
140 |
* Trims whitespace from the header values.
|
141 |
*
|
153 |
private function trimHeaderValues(array $values)
|
154 |
{
|
155 |
return array_map(function ($value) {
|
156 |
+
if (!is_scalar($value) && null !== $value) {
|
157 |
+
throw new \InvalidArgumentException(sprintf('Header value must be scalar or null but %s provided.', is_object($value) ? get_class($value) : gettype($value)));
|
158 |
+
}
|
159 |
+
return trim((string) $value, " \t");
|
160 |
}, $values);
|
161 |
}
|
162 |
+
private function assertHeader($header)
|
163 |
+
{
|
164 |
+
if (!is_string($header)) {
|
165 |
+
throw new \InvalidArgumentException(sprintf('Header name must be a string but %s provided.', is_object($header) ? get_class($header) : gettype($header)));
|
166 |
+
}
|
167 |
+
if ($header === '') {
|
168 |
+
throw new \InvalidArgumentException('Header name can not be empty.');
|
169 |
+
}
|
170 |
+
}
|
171 |
}
|
@@ -27,6 +27,7 @@ class Request implements \DeliciousBrains\WP_Offload_Media\Gcp\Psr\Http\Message\
|
|
27 |
*/
|
28 |
public function __construct($method, $uri, array $headers = [], $body = null, $version = '1.1')
|
29 |
{
|
|
|
30 |
if (!$uri instanceof UriInterface) {
|
31 |
$uri = new \DeliciousBrains\WP_Offload_Media\Gcp\GuzzleHttp\Psr7\Uri($uri);
|
32 |
}
|
@@ -70,6 +71,7 @@ class Request implements \DeliciousBrains\WP_Offload_Media\Gcp\Psr\Http\Message\
|
|
70 |
}
|
71 |
public function withMethod($method)
|
72 |
{
|
|
|
73 |
$new = clone $this;
|
74 |
$new->method = strtoupper($method);
|
75 |
return $new;
|
@@ -109,4 +111,10 @@ class Request implements \DeliciousBrains\WP_Offload_Media\Gcp\Psr\Http\Message\
|
|
109 |
// See: http://tools.ietf.org/html/rfc7230#section-5.4
|
110 |
$this->headers = [$header => [$host]] + $this->headers;
|
111 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
112 |
}
|
27 |
*/
|
28 |
public function __construct($method, $uri, array $headers = [], $body = null, $version = '1.1')
|
29 |
{
|
30 |
+
$this->assertMethod($method);
|
31 |
if (!$uri instanceof UriInterface) {
|
32 |
$uri = new \DeliciousBrains\WP_Offload_Media\Gcp\GuzzleHttp\Psr7\Uri($uri);
|
33 |
}
|
71 |
}
|
72 |
public function withMethod($method)
|
73 |
{
|
74 |
+
$this->assertMethod($method);
|
75 |
$new = clone $this;
|
76 |
$new->method = strtoupper($method);
|
77 |
return $new;
|
111 |
// See: http://tools.ietf.org/html/rfc7230#section-5.4
|
112 |
$this->headers = [$header => [$host]] + $this->headers;
|
113 |
}
|
114 |
+
private function assertMethod($method)
|
115 |
+
{
|
116 |
+
if (!is_string($method) || $method === '') {
|
117 |
+
throw new \InvalidArgumentException('Method must be a non-empty string.');
|
118 |
+
}
|
119 |
+
}
|
120 |
}
|
@@ -25,10 +25,10 @@ class Response implements \DeliciousBrains\WP_Offload_Media\Gcp\Psr\Http\Message
|
|
25 |
*/
|
26 |
public function __construct($status = 200, array $headers = [], $body = null, $version = '1.1', $reason = null)
|
27 |
{
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
$this->statusCode =
|
32 |
if ($body !== '' && $body !== null) {
|
33 |
$this->stream = stream_for($body);
|
34 |
}
|
@@ -50,12 +50,27 @@ class Response implements \DeliciousBrains\WP_Offload_Media\Gcp\Psr\Http\Message
|
|
50 |
}
|
51 |
public function withStatus($code, $reasonPhrase = '')
|
52 |
{
|
|
|
|
|
|
|
53 |
$new = clone $this;
|
54 |
-
$new->statusCode =
|
55 |
if ($reasonPhrase == '' && isset(self::$phrases[$new->statusCode])) {
|
56 |
$reasonPhrase = self::$phrases[$new->statusCode];
|
57 |
}
|
58 |
$new->reasonPhrase = $reasonPhrase;
|
59 |
return $new;
|
60 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
61 |
}
|
25 |
*/
|
26 |
public function __construct($status = 200, array $headers = [], $body = null, $version = '1.1', $reason = null)
|
27 |
{
|
28 |
+
$this->assertStatusCodeIsInteger($status);
|
29 |
+
$status = (int) $status;
|
30 |
+
$this->assertStatusCodeRange($status);
|
31 |
+
$this->statusCode = $status;
|
32 |
if ($body !== '' && $body !== null) {
|
33 |
$this->stream = stream_for($body);
|
34 |
}
|
50 |
}
|
51 |
public function withStatus($code, $reasonPhrase = '')
|
52 |
{
|
53 |
+
$this->assertStatusCodeIsInteger($code);
|
54 |
+
$code = (int) $code;
|
55 |
+
$this->assertStatusCodeRange($code);
|
56 |
$new = clone $this;
|
57 |
+
$new->statusCode = $code;
|
58 |
if ($reasonPhrase == '' && isset(self::$phrases[$new->statusCode])) {
|
59 |
$reasonPhrase = self::$phrases[$new->statusCode];
|
60 |
}
|
61 |
$new->reasonPhrase = $reasonPhrase;
|
62 |
return $new;
|
63 |
}
|
64 |
+
private function assertStatusCodeIsInteger($statusCode)
|
65 |
+
{
|
66 |
+
if (filter_var($statusCode, FILTER_VALIDATE_INT) === false) {
|
67 |
+
throw new \InvalidArgumentException('Status code must be an integer value.');
|
68 |
+
}
|
69 |
+
}
|
70 |
+
private function assertStatusCodeRange($statusCode)
|
71 |
+
{
|
72 |
+
if ($statusCode < 100 || $statusCode >= 600) {
|
73 |
+
throw new \InvalidArgumentException('Status code must be an integer value between 1xx and 5xx.');
|
74 |
+
}
|
75 |
+
}
|
76 |
}
|
@@ -133,7 +133,7 @@ class ServerRequest extends \DeliciousBrains\WP_Offload_Media\Gcp\GuzzleHttp\Psr
|
|
133 |
$method = isset($_SERVER['REQUEST_METHOD']) ? $_SERVER['REQUEST_METHOD'] : 'GET';
|
134 |
$headers = getallheaders();
|
135 |
$uri = self::getUriFromGlobals();
|
136 |
-
$body = new \DeliciousBrains\WP_Offload_Media\Gcp\GuzzleHttp\Psr7\LazyOpenStream('php://input', 'r+');
|
137 |
$protocol = isset($_SERVER['SERVER_PROTOCOL']) ? str_replace('HTTP/', '', $_SERVER['SERVER_PROTOCOL']) : '1.1';
|
138 |
$serverRequest = new \DeliciousBrains\WP_Offload_Media\Gcp\GuzzleHttp\Psr7\ServerRequest($method, $uri, $headers, $body, $protocol, $_SERVER);
|
139 |
return $serverRequest->withCookieParams($_COOKIE)->withQueryParams($_GET)->withParsedBody($_POST)->withUploadedFiles(self::normalizeFiles($_FILES));
|
133 |
$method = isset($_SERVER['REQUEST_METHOD']) ? $_SERVER['REQUEST_METHOD'] : 'GET';
|
134 |
$headers = getallheaders();
|
135 |
$uri = self::getUriFromGlobals();
|
136 |
+
$body = new \DeliciousBrains\WP_Offload_Media\Gcp\GuzzleHttp\Psr7\CachingStream(new \DeliciousBrains\WP_Offload_Media\Gcp\GuzzleHttp\Psr7\LazyOpenStream('php://input', 'r+'));
|
137 |
$protocol = isset($_SERVER['SERVER_PROTOCOL']) ? str_replace('HTTP/', '', $_SERVER['SERVER_PROTOCOL']) : '1.1';
|
138 |
$serverRequest = new \DeliciousBrains\WP_Offload_Media\Gcp\GuzzleHttp\Psr7\ServerRequest($method, $uri, $headers, $body, $protocol, $_SERVER);
|
139 |
return $serverRequest->withCookieParams($_COOKIE)->withQueryParams($_GET)->withParsedBody($_POST)->withUploadedFiles(self::normalizeFiles($_FILES));
|
@@ -10,6 +10,16 @@ use DeliciousBrains\WP_Offload_Media\Gcp\Psr\Http\Message\StreamInterface;
|
|
10 |
*/
|
11 |
class Stream implements \DeliciousBrains\WP_Offload_Media\Gcp\Psr\Http\Message\StreamInterface
|
12 |
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
private $stream;
|
14 |
private $size;
|
15 |
private $seekable;
|
@@ -17,8 +27,6 @@ class Stream implements \DeliciousBrains\WP_Offload_Media\Gcp\Psr\Http\Message\S
|
|
17 |
private $writable;
|
18 |
private $uri;
|
19 |
private $customMetadata;
|
20 |
-
/** @var array Hash of readable and writable stream types */
|
21 |
-
private static $readWriteHash = ['read' => ['r' => true, 'w+' => true, 'r+' => true, 'x+' => true, 'c+' => true, 'rb' => true, 'w+b' => true, 'r+b' => true, 'x+b' => true, 'c+b' => true, 'rt' => true, 'w+t' => true, 'r+t' => true, 'x+t' => true, 'c+t' => true, 'a+' => true, 'rb+' => true], 'write' => ['w' => true, 'w+' => true, 'rw' => true, 'r+' => true, 'x+' => true, 'c+' => true, 'wb' => true, 'w+b' => true, 'r+b' => true, 'rb+' => true, 'x+b' => true, 'c+b' => true, 'w+t' => true, 'r+t' => true, 'x+t' => true, 'c+t' => true, 'a' => true, 'a+' => true]];
|
22 |
/**
|
23 |
* This constructor accepts an associative array of options.
|
24 |
*
|
@@ -45,8 +53,8 @@ class Stream implements \DeliciousBrains\WP_Offload_Media\Gcp\Psr\Http\Message\S
|
|
45 |
$this->stream = $stream;
|
46 |
$meta = stream_get_meta_data($this->stream);
|
47 |
$this->seekable = $meta['seekable'];
|
48 |
-
$this->readable =
|
49 |
-
$this->writable =
|
50 |
$this->uri = $this->getMetadata('uri');
|
51 |
}
|
52 |
/**
|
@@ -151,6 +159,7 @@ class Stream implements \DeliciousBrains\WP_Offload_Media\Gcp\Psr\Http\Message\S
|
|
151 |
}
|
152 |
public function seek($offset, $whence = SEEK_SET)
|
153 |
{
|
|
|
154 |
if (!isset($this->stream)) {
|
155 |
throw new \RuntimeException('Stream is detached');
|
156 |
}
|
10 |
*/
|
11 |
class Stream implements \DeliciousBrains\WP_Offload_Media\Gcp\Psr\Http\Message\StreamInterface
|
12 |
{
|
13 |
+
/**
|
14 |
+
* Resource modes.
|
15 |
+
*
|
16 |
+
* @var string
|
17 |
+
*
|
18 |
+
* @see http://php.net/manual/function.fopen.php
|
19 |
+
* @see http://php.net/manual/en/function.gzopen.php
|
20 |
+
*/
|
21 |
+
const READABLE_MODES = '/r|a\\+|ab\\+|w\\+|wb\\+|x\\+|xb\\+|c\\+|cb\\+/';
|
22 |
+
const WRITABLE_MODES = '/a|w|r\\+|rb\\+|rw|x|c/';
|
23 |
private $stream;
|
24 |
private $size;
|
25 |
private $seekable;
|
27 |
private $writable;
|
28 |
private $uri;
|
29 |
private $customMetadata;
|
|
|
|
|
30 |
/**
|
31 |
* This constructor accepts an associative array of options.
|
32 |
*
|
53 |
$this->stream = $stream;
|
54 |
$meta = stream_get_meta_data($this->stream);
|
55 |
$this->seekable = $meta['seekable'];
|
56 |
+
$this->readable = (bool) preg_match(self::READABLE_MODES, $meta['mode']);
|
57 |
+
$this->writable = (bool) preg_match(self::WRITABLE_MODES, $meta['mode']);
|
58 |
$this->uri = $this->getMetadata('uri');
|
59 |
}
|
60 |
/**
|
159 |
}
|
160 |
public function seek($offset, $whence = SEEK_SET)
|
161 |
{
|
162 |
+
$whence = (int) $whence;
|
163 |
if (!isset($this->stream)) {
|
164 |
throw new \RuntimeException('Stream is detached');
|
165 |
}
|
@@ -356,9 +356,9 @@ class Uri implements \DeliciousBrains\WP_Offload_Media\Gcp\Psr\Http\Message\UriI
|
|
356 |
}
|
357 |
public function withUserInfo($user, $password = null)
|
358 |
{
|
359 |
-
$info = $user;
|
360 |
-
if ($password
|
361 |
-
$info .= ':' . $password;
|
362 |
}
|
363 |
if ($this->userInfo === $info) {
|
364 |
return $this;
|
@@ -430,14 +430,14 @@ class Uri implements \DeliciousBrains\WP_Offload_Media\Gcp\Psr\Http\Message\UriI
|
|
430 |
private function applyParts(array $parts)
|
431 |
{
|
432 |
$this->scheme = isset($parts['scheme']) ? $this->filterScheme($parts['scheme']) : '';
|
433 |
-
$this->userInfo = isset($parts['user']) ? $parts['user'] : '';
|
434 |
$this->host = isset($parts['host']) ? $this->filterHost($parts['host']) : '';
|
435 |
$this->port = isset($parts['port']) ? $this->filterPort($parts['port']) : null;
|
436 |
$this->path = isset($parts['path']) ? $this->filterPath($parts['path']) : '';
|
437 |
$this->query = isset($parts['query']) ? $this->filterQueryAndFragment($parts['query']) : '';
|
438 |
$this->fragment = isset($parts['fragment']) ? $this->filterQueryAndFragment($parts['fragment']) : '';
|
439 |
if (isset($parts['pass'])) {
|
440 |
-
$this->userInfo .= ':' . $parts['pass'];
|
441 |
}
|
442 |
$this->removeDefaultPort();
|
443 |
}
|
@@ -455,6 +455,20 @@ class Uri implements \DeliciousBrains\WP_Offload_Media\Gcp\Psr\Http\Message\UriI
|
|
455 |
}
|
456 |
return strtolower($scheme);
|
457 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
458 |
/**
|
459 |
* @param string $host
|
460 |
*
|
@@ -482,8 +496,8 @@ class Uri implements \DeliciousBrains\WP_Offload_Media\Gcp\Psr\Http\Message\UriI
|
|
482 |
return null;
|
483 |
}
|
484 |
$port = (int) $port;
|
485 |
-
if (
|
486 |
-
throw new \InvalidArgumentException(sprintf('Invalid port: %d. Must be between
|
487 |
}
|
488 |
return $port;
|
489 |
}
|
356 |
}
|
357 |
public function withUserInfo($user, $password = null)
|
358 |
{
|
359 |
+
$info = $this->filterUserInfoComponent($user);
|
360 |
+
if ($password !== null) {
|
361 |
+
$info .= ':' . $this->filterUserInfoComponent($password);
|
362 |
}
|
363 |
if ($this->userInfo === $info) {
|
364 |
return $this;
|
430 |
private function applyParts(array $parts)
|
431 |
{
|
432 |
$this->scheme = isset($parts['scheme']) ? $this->filterScheme($parts['scheme']) : '';
|
433 |
+
$this->userInfo = isset($parts['user']) ? $this->filterUserInfoComponent($parts['user']) : '';
|
434 |
$this->host = isset($parts['host']) ? $this->filterHost($parts['host']) : '';
|
435 |
$this->port = isset($parts['port']) ? $this->filterPort($parts['port']) : null;
|
436 |
$this->path = isset($parts['path']) ? $this->filterPath($parts['path']) : '';
|
437 |
$this->query = isset($parts['query']) ? $this->filterQueryAndFragment($parts['query']) : '';
|
438 |
$this->fragment = isset($parts['fragment']) ? $this->filterQueryAndFragment($parts['fragment']) : '';
|
439 |
if (isset($parts['pass'])) {
|
440 |
+
$this->userInfo .= ':' . $this->filterUserInfoComponent($parts['pass']);
|
441 |
}
|
442 |
$this->removeDefaultPort();
|
443 |
}
|
455 |
}
|
456 |
return strtolower($scheme);
|
457 |
}
|
458 |
+
/**
|
459 |
+
* @param string $component
|
460 |
+
*
|
461 |
+
* @return string
|
462 |
+
*
|
463 |
+
* @throws \InvalidArgumentException If the user info is invalid.
|
464 |
+
*/
|
465 |
+
private function filterUserInfoComponent($component)
|
466 |
+
{
|
467 |
+
if (!is_string($component)) {
|
468 |
+
throw new \InvalidArgumentException('User info must be a string');
|
469 |
+
}
|
470 |
+
return preg_replace_callback('/(?:[^%' . self::$charUnreserved . self::$charSubDelims . ']+|%(?![A-Fa-f0-9]{2}))/', [$this, 'rawurlencodeMatchZero'], $component);
|
471 |
+
}
|
472 |
/**
|
473 |
* @param string $host
|
474 |
*
|
496 |
return null;
|
497 |
}
|
498 |
$port = (int) $port;
|
499 |
+
if (0 > $port || 0xffff < $port) {
|
500 |
+
throw new \InvalidArgumentException(sprintf('Invalid port: %d. Must be between 0 and 65535', $port));
|
501 |
}
|
502 |
return $port;
|
503 |
}
|
@@ -533,7 +533,7 @@ function mimetype_from_filename($filename)
|
|
533 |
*/
|
534 |
function mimetype_from_extension($extension)
|
535 |
{
|
536 |
-
static $mimetypes = ['3gp' => 'video/3gpp', '7z' => 'application/x-7z-compressed', 'aac' => 'audio/x-aac', 'ai' => 'application/postscript', 'aif' => 'audio/x-aiff', 'asc' => 'text/plain', 'asf' => 'video/x-ms-asf', 'atom' => 'application/atom+xml', 'avi' => 'video/x-msvideo', 'bmp' => 'image/bmp', 'bz2' => 'application/x-bzip2', 'cer' => 'application/pkix-cert', 'crl' => 'application/pkix-crl', 'crt' => 'application/x-x509-ca-cert', 'css' => 'text/css', 'csv' => 'text/csv', 'cu' => 'application/cu-seeme', 'deb' => 'application/x-debian-package', 'doc' => 'application/msword', 'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'dvi' => 'application/x-dvi', 'eot' => 'application/vnd.ms-fontobject', 'eps' => 'application/postscript', 'epub' => 'application/epub+zip', 'etx' => 'text/x-setext', 'flac' => 'audio/flac', 'flv' => 'video/x-flv', 'gif' => 'image/gif', 'gz' => 'application/gzip', 'htm' => 'text/html', 'html' => 'text/html', 'ico' => 'image/x-icon', 'ics' => 'text/calendar', 'ini' => 'text/plain', 'iso' => 'application/x-iso9660-image', 'jar' => 'application/java-archive', 'jpe' => 'image/jpeg', 'jpeg' => 'image/jpeg', 'jpg' => 'image/jpeg', 'js' => 'text/javascript', 'json' => 'application/json', 'latex' => 'application/x-latex', 'log' => 'text/plain', 'm4a' => 'audio/mp4', 'm4v' => 'video/mp4', 'mid' => 'audio/midi', 'midi' => 'audio/midi', 'mov' => 'video/quicktime', 'mkv' => 'video/x-matroska', 'mp3' => 'audio/mpeg', 'mp4' => 'video/mp4', 'mp4a' => 'audio/mp4', 'mp4v' => 'video/mp4', 'mpe' => 'video/mpeg', 'mpeg' => 'video/mpeg', 'mpg' => 'video/mpeg', 'mpg4' => 'video/mp4', 'oga' => 'audio/ogg', 'ogg' => 'audio/ogg', 'ogv' => 'video/ogg', 'ogx' => 'application/ogg', 'pbm' => 'image/x-portable-bitmap', 'pdf' => 'application/pdf', 'pgm' => 'image/x-portable-graymap', 'png' => 'image/png', 'pnm' => 'image/x-portable-anymap', 'ppm' => 'image/x-portable-pixmap', 'ppt' => 'application/vnd.ms-powerpoint', 'pptx' => 'application/vnd.openxmlformats-officedocument.presentationml.presentation', 'ps' => 'application/postscript', 'qt' => 'video/quicktime', 'rar' => 'application/x-rar-compressed', 'ras' => 'image/x-cmu-raster', 'rss' => 'application/rss+xml', 'rtf' => 'application/rtf', 'sgm' => 'text/sgml', 'sgml' => 'text/sgml', 'svg' => 'image/svg+xml', 'swf' => 'application/x-shockwave-flash', 'tar' => 'application/x-tar', 'tif' => 'image/tiff', 'tiff' => 'image/tiff', 'torrent' => 'application/x-bittorrent', 'ttf' => 'application/x-font-ttf', 'txt' => 'text/plain', 'wav' => 'audio/x-wav', 'webm' => 'video/webm', 'wma' => 'audio/x-ms-wma', 'wmv' => 'video/x-ms-wmv', 'woff' => 'application/x-font-woff', 'wsdl' => 'application/wsdl+xml', 'xbm' => 'image/x-xbitmap', 'xls' => 'application/vnd.ms-excel', 'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'xml' => 'application/xml', 'xpm' => 'image/x-xpixmap', 'xwd' => 'image/x-xwindowdump', 'yaml' => 'text/yaml', 'yml' => 'text/yaml', 'zip' => 'application/zip'];
|
537 |
$extension = strtolower($extension);
|
538 |
return isset($mimetypes[$extension]) ? $mimetypes[$extension] : null;
|
539 |
}
|
533 |
*/
|
534 |
function mimetype_from_extension($extension)
|
535 |
{
|
536 |
+
static $mimetypes = ['3gp' => 'video/3gpp', '7z' => 'application/x-7z-compressed', 'aac' => 'audio/x-aac', 'ai' => 'application/postscript', 'aif' => 'audio/x-aiff', 'asc' => 'text/plain', 'asf' => 'video/x-ms-asf', 'atom' => 'application/atom+xml', 'avi' => 'video/x-msvideo', 'bmp' => 'image/bmp', 'bz2' => 'application/x-bzip2', 'cer' => 'application/pkix-cert', 'crl' => 'application/pkix-crl', 'crt' => 'application/x-x509-ca-cert', 'css' => 'text/css', 'csv' => 'text/csv', 'cu' => 'application/cu-seeme', 'deb' => 'application/x-debian-package', 'doc' => 'application/msword', 'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'dvi' => 'application/x-dvi', 'eot' => 'application/vnd.ms-fontobject', 'eps' => 'application/postscript', 'epub' => 'application/epub+zip', 'etx' => 'text/x-setext', 'flac' => 'audio/flac', 'flv' => 'video/x-flv', 'gif' => 'image/gif', 'gz' => 'application/gzip', 'htm' => 'text/html', 'html' => 'text/html', 'ico' => 'image/x-icon', 'ics' => 'text/calendar', 'ini' => 'text/plain', 'iso' => 'application/x-iso9660-image', 'jar' => 'application/java-archive', 'jpe' => 'image/jpeg', 'jpeg' => 'image/jpeg', 'jpg' => 'image/jpeg', 'js' => 'text/javascript', 'json' => 'application/json', 'latex' => 'application/x-latex', 'log' => 'text/plain', 'm4a' => 'audio/mp4', 'm4v' => 'video/mp4', 'mid' => 'audio/midi', 'midi' => 'audio/midi', 'mov' => 'video/quicktime', 'mkv' => 'video/x-matroska', 'mp3' => 'audio/mpeg', 'mp4' => 'video/mp4', 'mp4a' => 'audio/mp4', 'mp4v' => 'video/mp4', 'mpe' => 'video/mpeg', 'mpeg' => 'video/mpeg', 'mpg' => 'video/mpeg', 'mpg4' => 'video/mp4', 'oga' => 'audio/ogg', 'ogg' => 'audio/ogg', 'ogv' => 'video/ogg', 'ogx' => 'application/ogg', 'pbm' => 'image/x-portable-bitmap', 'pdf' => 'application/pdf', 'pgm' => 'image/x-portable-graymap', 'png' => 'image/png', 'pnm' => 'image/x-portable-anymap', 'ppm' => 'image/x-portable-pixmap', 'ppt' => 'application/vnd.ms-powerpoint', 'pptx' => 'application/vnd.openxmlformats-officedocument.presentationml.presentation', 'ps' => 'application/postscript', 'qt' => 'video/quicktime', 'rar' => 'application/x-rar-compressed', 'ras' => 'image/x-cmu-raster', 'rss' => 'application/rss+xml', 'rtf' => 'application/rtf', 'sgm' => 'text/sgml', 'sgml' => 'text/sgml', 'svg' => 'image/svg+xml', 'swf' => 'application/x-shockwave-flash', 'tar' => 'application/x-tar', 'tif' => 'image/tiff', 'tiff' => 'image/tiff', 'torrent' => 'application/x-bittorrent', 'ttf' => 'application/x-font-ttf', 'txt' => 'text/plain', 'wav' => 'audio/x-wav', 'webm' => 'video/webm', 'webp' => 'image/webp', 'wma' => 'audio/x-ms-wma', 'wmv' => 'video/x-ms-wmv', 'woff' => 'application/x-font-woff', 'wsdl' => 'application/wsdl+xml', 'xbm' => 'image/x-xbitmap', 'xls' => 'application/vnd.ms-excel', 'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'xml' => 'application/xml', 'xpm' => 'image/x-xpixmap', 'xwd' => 'image/x-xwindowdump', 'yaml' => 'text/yaml', 'yml' => 'text/yaml', 'zip' => 'application/zip'];
|
537 |
$extension = strtolower($extension);
|
538 |
return isset($mimetypes[$extension]) ? $mimetypes[$extension] : null;
|
539 |
}
|
@@ -1,5 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
### 1.24.0 (2018-11-05)
|
2 |
|
|
|
3 |
* Added a `ResettableInterface` in order to reset/reset/clear/flush handlers and processors
|
4 |
* Added a `ProcessorInterface` as an optional way to label a class as being a processor (mostly useful for autowiring dependency containers)
|
5 |
* Added a way to log signals being received using Monolog\SignalHandler
|
1 |
+
### 1.25.2 (2019-11-13)
|
2 |
+
|
3 |
+
* Fixed normalization of Traversables to avoid traversing them as not all of them are rewindable
|
4 |
+
* Fixed setFormatter/getFormatter to forward to the nested handler in FilterHandler, FingersCrossedHandler, BufferHandler and SamplingHandler
|
5 |
+
* Fixed BrowserConsoleHandler formatting when using multiple styles
|
6 |
+
* Fixed normalization of exception codes to be always integers even for PDOException which have them as numeric strings
|
7 |
+
* Fixed normalization of SoapFault objects containing non-strings as "detail"
|
8 |
+
* Fixed json encoding across all handlers to always attempt recovery of non-UTF-8 strings instead of failing the whole encoding
|
9 |
+
|
10 |
+
### 1.25.1 (2019-09-06)
|
11 |
+
|
12 |
+
* Fixed forward-compatible interfaces to be compatible with Monolog 1.x too.
|
13 |
+
|
14 |
+
### 1.25.0 (2019-09-06)
|
15 |
+
|
16 |
+
* Deprecated SlackbotHandler, use SlackWebhookHandler or SlackHandler instead
|
17 |
+
* Deprecated RavenHandler, use sentry/sentry 2.x and their Sentry\Monolog\Handler instead
|
18 |
+
* Deprecated HipChatHandler, migrate to Slack and use SlackWebhookHandler or SlackHandler instead
|
19 |
+
* Added forward-compatible interfaces and traits FormattableHandlerInterface, FormattableHandlerTrait, ProcessableHandlerInterface, ProcessableHandlerTrait. If you use modern PHP and want to make code compatible with Monolog 1 and 2 this can help. You will have to require at least Monolog 1.25 though.
|
20 |
+
* Added support for RFC3164 (outdated BSD syslog protocol) to SyslogUdpHandler
|
21 |
+
* Fixed issue in GroupHandler and WhatFailureGroupHandler where setting multiple processors would duplicate records
|
22 |
+
* Fixed issue in SignalHandler restarting syscalls functionality
|
23 |
+
* Fixed normalizers handling of exception backtraces to avoid serializing arguments in some cases
|
24 |
+
* Fixed ZendMonitorHandler to work with the latest Zend Server versions
|
25 |
+
* Fixed ChromePHPHandler to avoid sending more data than latest Chrome versions allow in headers (4KB down from 256KB).
|
26 |
+
|
27 |
### 1.24.0 (2018-11-05)
|
28 |
|
29 |
+
* BC Notice: If you are extending any of the Monolog's Formatters' `normalize` method, make sure you add the new `$depth = 0` argument to your function signature to avoid strict PHP warnings.
|
30 |
* Added a `ResettableInterface` in order to reset/reset/clear/flush handlers and processors
|
31 |
* Added a `ProcessorInterface` as an optional way to label a class as being a processor (mostly useful for autowiring dependency containers)
|
32 |
* Added a way to log signals being received using Monolog\SignalHandler
|
@@ -90,5 +90,5 @@ Monolog is licensed under the MIT License - see the `LICENSE` file for details
|
|
90 |
|
91 |
### Acknowledgements
|
92 |
|
93 |
-
This library is heavily inspired by Python's [Logbook](
|
94 |
library, although most concepts have been adjusted to fit to the PHP world.
|
90 |
|
91 |
### Acknowledgements
|
92 |
|
93 |
+
This library is heavily inspired by Python's [Logbook](https://logbook.readthedocs.io/en/stable/)
|
94 |
library, although most concepts have been adjusted to fit to the PHP world.
|
@@ -67,7 +67,7 @@
|
|
67 |
},
|
68 |
"scripts": {
|
69 |
"test": [
|
70 |
-
"parallel-lint . --exclude vendor",
|
71 |
"phpunit"
|
72 |
]
|
73 |
}
|
67 |
},
|
68 |
"scripts": {
|
69 |
"test": [
|
70 |
+
"parallel-lint . --exclude vendor --exclude src\/Monolog\/Handler\/FormattableHandlerInterface.php --exclude src\/Monolog\/Handler\/FormattableHandlerTrait.php --exclude src\/Monolog\/Handler\/ProcessableHandlerInterface.php --exclude src\/Monolog\/Handler\/ProcessableHandlerTrait.php",
|
71 |
"phpunit"
|
72 |
]
|
73 |
}
|
@@ -1,231 +0,0 @@
|
|
1 |
-
# Using Monolog
|
2 |
-
|
3 |
-
- [Installation](#installation)
|
4 |
-
- [Core Concepts](#core-concepts)
|
5 |
-
- [Log Levels](#log-levels)
|
6 |
-
- [Configuring a logger](#configuring-a-logger)
|
7 |
-
- [Adding extra data in the records](#adding-extra-data-in-the-records)
|
8 |
-
- [Leveraging channels](#leveraging-channels)
|
9 |
-
- [Customizing the log format](#customizing-the-log-format)
|
10 |
-
|
11 |
-
## Installation
|
12 |
-
|
13 |
-
Monolog is available on Packagist ([monolog/monolog](http://packagist.org/packages/monolog/monolog))
|
14 |
-
and as such installable via [Composer](http://getcomposer.org/).
|
15 |
-
|
16 |
-
```bash
|
17 |
-
composer require monolog/monolog
|
18 |
-
```
|
19 |
-
|
20 |
-
If you do not use Composer, you can grab the code from GitHub, and use any
|
21 |
-
PSR-0 compatible autoloader (e.g. the [Symfony2 ClassLoader component](https://github.com/symfony/ClassLoader))
|
22 |
-
to load Monolog classes.
|
23 |
-
|
24 |
-
## Core Concepts
|
25 |
-
|
26 |
-
Every `Logger` instance has a channel (name) and a stack of handlers. Whenever
|
27 |
-
you add a record to the logger, it traverses the handler stack. Each handler
|
28 |
-
decides whether it fully handled the record, and if so, the propagation of the
|
29 |
-
record ends there.
|
30 |
-
|
31 |
-
This allows for flexible logging setups, for example having a `StreamHandler` at
|
32 |
-
the bottom of the stack that will log anything to disk, and on top of that add
|
33 |
-
a `MailHandler` that will send emails only when an error message is logged.
|
34 |
-
Handlers also have a `$bubble` property which defines whether they block the
|
35 |
-
record or not if they handled it. In this example, setting the `MailHandler`'s
|
36 |
-
`$bubble` argument to false means that records handled by the `MailHandler` will
|
37 |
-
not propagate to the `StreamHandler` anymore.
|
38 |
-
|
39 |
-
You can create many `Logger`s, each defining a channel (e.g.: db, request,
|
40 |
-
router, ..) and each of them combining various handlers, which can be shared
|
41 |
-
or not. The channel is reflected in the logs and allows you to easily see or
|
42 |
-
filter records.
|
43 |
-
|
44 |
-
Each Handler also has a Formatter, a default one with settings that make sense
|
45 |
-
will be created if you don't set one. The formatters normalize and format
|
46 |
-
incoming records so that they can be used by the handlers to output useful
|
47 |
-
information.
|
48 |
-
|
49 |
-
Custom severity levels are not available. Only the eight
|
50 |
-
[RFC 5424](http://tools.ietf.org/html/rfc5424) levels (debug, info, notice,
|
51 |
-
warning, error, critical, alert, emergency) are present for basic filtering
|
52 |
-
purposes, but for sorting and other use cases that would require
|
53 |
-
flexibility, you should add Processors to the Logger that can add extra
|
54 |
-
information (tags, user ip, ..) to the records before they are handled.
|
55 |
-
|
56 |
-
## Log Levels
|
57 |
-
|
58 |
-
Monolog supports the logging levels described by [RFC 5424](http://tools.ietf.org/html/rfc5424).
|
59 |
-
|
60 |
-
- **DEBUG** (100): Detailed debug information.
|
61 |
-
|
62 |
-
- **INFO** (200): Interesting events. Examples: User logs in, SQL logs.
|
63 |
-
|
64 |
-
- **NOTICE** (250): Normal but significant events.
|
65 |
-
|
66 |
-
- **WARNING** (300): Exceptional occurrences that are not errors. Examples:
|
67 |
-
Use of deprecated APIs, poor use of an API, undesirable things that are not
|
68 |
-
necessarily wrong.
|
69 |
-
|
70 |
-
- **ERROR** (400): Runtime errors that do not require immediate action but
|
71 |
-
should typically be logged and monitored.
|
72 |
-
|
73 |
-
- **CRITICAL** (500): Critical conditions. Example: Application component
|
74 |
-
unavailable, unexpected exception.
|
75 |
-
|
76 |
-
- **ALERT** (550): Action must be taken immediately. Example: Entire website
|
77 |
-
down, database unavailable, etc. This should trigger the SMS alerts and wake
|
78 |
-
you up.
|
79 |
-
|
80 |
-
- **EMERGENCY** (600): Emergency: system is unusable.
|
81 |
-
|
82 |
-
## Configuring a logger
|
83 |
-
|
84 |
-
Here is a basic setup to log to a file and to firephp on the DEBUG level:
|
85 |
-
|
86 |
-
```php
|
87 |
-
<?php
|
88 |
-
|
89 |
-
use Monolog\Logger;
|
90 |
-
use Monolog\Handler\StreamHandler;
|
91 |
-
use Monolog\Handler\FirePHPHandler;
|
92 |
-
|
93 |
-
// Create the logger
|
94 |
-
$logger = new Logger('my_logger');
|
95 |
-
// Now add some handlers
|
96 |
-
$logger->pushHandler(new StreamHandler(__DIR__.'/my_app.log', Logger::DEBUG));
|
97 |
-
$logger->pushHandler(new FirePHPHandler());
|
98 |
-
|
99 |
-
// You can now use your logger
|
100 |
-
$logger->addInfo('My logger is now ready');
|
101 |
-
```
|
102 |
-
|
103 |
-
Let's explain it. The first step is to create the logger instance which will
|
104 |
-
be used in your code. The argument is a channel name, which is useful when
|
105 |
-
you use several loggers (see below for more details about it).
|
106 |
-
|
107 |
-
The logger itself does not know how to handle a record. It delegates it to
|
108 |
-
some handlers. The code above registers two handlers in the stack to allow
|
109 |
-
handling records in two different ways.
|
110 |
-
|
111 |
-
Note that the FirePHPHandler is called first as it is added on top of the
|
112 |
-
stack. This allows you to temporarily add a logger with bubbling disabled if
|
113 |
-
you want to override other configured loggers.
|
114 |
-
|
115 |
-
> If you use Monolog standalone and are looking for an easy way to
|
116 |
-
> configure many handlers, the [theorchard/monolog-cascade](https://github.com/theorchard/monolog-cascade)
|
117 |
-
> can help you build complex logging configs via PHP arrays, yaml or json configs.
|
118 |
-
|
119 |
-
## Adding extra data in the records
|
120 |
-
|
121 |
-
Monolog provides two different ways to add extra informations along the simple
|
122 |
-
textual message.
|
123 |
-
|
124 |
-
### Using the logging context
|
125 |
-
|
126 |
-
The first way is the context, allowing to pass an array of data along the
|
127 |
-
record:
|
128 |
-
|
129 |
-
```php
|
130 |
-
<?php
|
131 |
-
|
132 |
-
$logger->addInfo('Adding a new user', array('username' => 'Seldaek'));
|
133 |
-
```
|
134 |
-
|
135 |
-
Simple handlers (like the StreamHandler for instance) will simply format
|
136 |
-
the array to a string but richer handlers can take advantage of the context
|
137 |
-
(FirePHP is able to display arrays in pretty way for instance).
|
138 |
-
|
139 |
-
### Using processors
|
140 |
-
|
141 |
-
The second way is to add extra data for all records by using a processor.
|
142 |
-
Processors can be any callable. They will get the record as parameter and
|
143 |
-
must return it after having eventually changed the `extra` part of it. Let's
|
144 |
-
write a processor adding some dummy data in the record:
|
145 |
-
|
146 |
-
```php
|
147 |
-
<?php
|
148 |
-
|
149 |
-
$logger->pushProcessor(function ($record) {
|
150 |
-
$record['extra']['dummy'] = 'Hello world!';
|
151 |
-
|
152 |
-
return $record;
|
153 |
-
});
|
154 |
-
```
|
155 |
-
|
156 |
-
Monolog provides some built-in processors that can be used in your project.
|
157 |
-
Look at the [dedicated chapter](https://github.com/Seldaek/monolog/blob/master/doc/02-handlers-formatters-processors.md#processors) for the list.
|
158 |
-
|
159 |
-
> Tip: processors can also be registered on a specific handler instead of
|
160 |
-
the logger to apply only for this handler.
|
161 |
-
|
162 |
-
## Leveraging channels
|
163 |
-
|
164 |
-
Channels are a great way to identify to which part of the application a record
|
165 |
-
is related. This is useful in big applications (and is leveraged by
|
166 |
-
MonologBundle in Symfony2).
|
167 |
-
|
168 |
-
Picture two loggers sharing a handler that writes to a single log file.
|
169 |
-
Channels would allow you to identify the logger that issued every record.
|
170 |
-
You can easily grep through the log files filtering this or that channel.
|
171 |
-
|
172 |
-
```php
|
173 |
-
<?php
|
174 |
-
|
175 |
-
use Monolog\Logger;
|
176 |
-
use Monolog\Handler\StreamHandler;
|
177 |
-
use Monolog\Handler\FirePHPHandler;
|
178 |
-
|
179 |
-
// Create some handlers
|
180 |
-
$stream = new StreamHandler(__DIR__.'/my_app.log', Logger::DEBUG);
|
181 |
-
$firephp = new FirePHPHandler();
|
182 |
-
|
183 |
-
// Create the main logger of the app
|
184 |
-
$logger = new Logger('my_logger');
|
185 |
-
$logger->pushHandler($stream);
|
186 |
-
$logger->pushHandler($firephp);
|
187 |
-
|
188 |
-
// Create a logger for the security-related stuff with a different channel
|
189 |
-
$securityLogger = new Logger('security');
|
190 |
-
$securityLogger->pushHandler($stream);
|
191 |
-
$securityLogger->pushHandler($firephp);
|
192 |
-
|
193 |
-
// Or clone the first one to only change the channel
|
194 |
-
$securityLogger = $logger->withName('security');
|
195 |
-
```
|
196 |
-
|
197 |
-
## Customizing the log format
|
198 |
-
|
199 |
-
In Monolog it's easy to customize the format of the logs written into files,
|
200 |
-
sockets, mails, databases and other handlers. Most of the handlers use the
|
201 |
-
|
202 |
-
```php
|
203 |
-
$record['formatted']
|
204 |
-
```
|
205 |
-
|
206 |
-
value to be automatically put into the log device. This value depends on the
|
207 |
-
formatter settings. You can choose between predefined formatter classes or
|
208 |
-
write your own (e.g. a multiline text file for human-readable output).
|
209 |
-
|
210 |
-
To configure a predefined formatter class, just set it as the handler's field:
|
211 |
-
|
212 |
-
```php
|
213 |
-
// the default date format is "Y-m-d H:i:s"
|
214 |
-
$dateFormat = "Y n j, g:i a";
|
215 |
-
// the default output format is "[%datetime%] %channel%.%level_name%: %message% %context% %extra%\n"
|
216 |
-
$output = "%datetime% > %level_name% > %message% %context% %extra%\n";
|
217 |
-
// finally, create a formatter
|
218 |
-
$formatter = new LineFormatter($output, $dateFormat);
|
219 |
-
|
220 |
-
// Create a handler
|
221 |
-
$stream = new StreamHandler(__DIR__.'/my_app.log', Logger::DEBUG);
|
222 |
-
$stream->setFormatter($formatter);
|
223 |
-
// bind it to a logger object
|
224 |
-
$securityLogger = new Logger('security');
|
225 |
-
$securityLogger->pushHandler($stream);
|
226 |
-
```
|
227 |
-
|
228 |
-
You may also reuse the same formatter between multiple handlers and share those
|
229 |
-
handlers between multiple loggers.
|
230 |
-
|
231 |
-
[Handlers, Formatters and Processors](02-handlers-formatters-processors.md) →
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -1,158 +0,0 @@
|
|
1 |
-
# Handlers, Formatters and Processors
|
2 |
-
|
3 |
-
- [Handlers](#handlers)
|
4 |
-
- [Log to files and syslog](#log-to-files-and-syslog)
|
5 |
-
- [Send alerts and emails](#send-alerts-and-emails)
|
6 |
-
- [Log specific servers and networked logging](#log-specific-servers-and-networked-logging)
|
7 |
-
- [Logging in development](#logging-in-development)
|
8 |
-
- [Log to databases](#log-to-databases)
|
9 |
-
- [Wrappers / Special Handlers](#wrappers--special-handlers)
|
10 |
-
- [Formatters](#formatters)
|
11 |
-
- [Processors](#processors)
|
12 |
-
- [Third Party Packages](#third-party-packages)
|
13 |
-
|
14 |
-
## Handlers
|
15 |
-
|
16 |
-
### Log to files and syslog
|
17 |
-
|
18 |
-
- _StreamHandler_: Logs records into any PHP stream, use this for log files.
|
19 |
-
- _RotatingFileHandler_: Logs records to a file and creates one logfile per day.
|
20 |
-
It will also delete files older than `$maxFiles`. You should use
|
21 |
-
[logrotate](http://linuxcommand.org/man_pages/logrotate8.html) for high profile
|
22 |
-
setups though, this is just meant as a quick and dirty solution.
|
23 |
-
- _SyslogHandler_: Logs records to the syslog.
|
24 |
-
- _ErrorLogHandler_: Logs records to PHP's
|
25 |
-
[`error_log()`](http://docs.php.net/manual/en/function.error-log.php) function.
|
26 |
-
|
27 |
-
### Send alerts and emails
|
28 |
-
|
29 |
-
- _NativeMailerHandler_: Sends emails using PHP's
|
30 |
-
[`mail()`](http://php.net/manual/en/function.mail.php) function.
|
31 |
-
- _SwiftMailerHandler_: Sends emails using a [`Swift_Mailer`](http://swiftmailer.org/) instance.
|
32 |
-
- _PushoverHandler_: Sends mobile notifications via the [Pushover](https://www.pushover.net/) API.
|
33 |
-
- _HipChatHandler_: Logs records to a [HipChat](http://hipchat.com) chat room using its API.
|
34 |
-
- _FlowdockHandler_: Logs records to a [Flowdock](https://www.flowdock.com/) account.
|
35 |
-
- _SlackHandler_: Logs records to a [Slack](https://www.slack.com/) account using the Slack API.
|
36 |
-
- _SlackbotHandler_: Logs records to a [Slack](https://www.slack.com/) account using the Slackbot incoming hook.
|
37 |
-
- _SlackWebhookHandler_: Logs records to a [Slack](https://www.slack.com/) account using Slack Webhooks.
|
38 |
-
- _MandrillHandler_: Sends emails via the Mandrill API using a [`Swift_Message`](http://swiftmailer.org/) instance.
|
39 |
-
- _FleepHookHandler_: Logs records to a [Fleep](https://fleep.io/) conversation using Webhooks.
|
40 |
-
- _IFTTTHandler_: Notifies an [IFTTT](https://ifttt.com/maker) trigger with the log channel, level name and message.
|
41 |
-
|
42 |
-
### Log specific servers and networked logging
|
43 |
-
|
44 |
-
- _SocketHandler_: Logs records to [sockets](http://php.net/fsockopen), use this
|
45 |
-
for UNIX and TCP sockets. See an [example](sockets.md).
|
46 |
-
- _AmqpHandler_: Logs records to an [amqp](http://www.amqp.org/) compatible
|
47 |
-
server. Requires the [php-amqp](http://pecl.php.net/package/amqp) extension (1.0+).
|
48 |
-
- _GelfHandler_: Logs records to a [Graylog2](http://www.graylog2.org) server.
|
49 |
-
- _CubeHandler_: Logs records to a [Cube](http://square.github.com/cube/) server.
|
50 |
-
- _RavenHandler_: Logs records to a [Sentry](http://getsentry.com/) server using
|
51 |
-
[raven](https://packagist.org/packages/raven/raven).
|
52 |
-
- _ZendMonitorHandler_: Logs records to the Zend Monitor present in Zend Server.
|
53 |
-
- _NewRelicHandler_: Logs records to a [NewRelic](http://newrelic.com/) application.
|
54 |
-
- _LogglyHandler_: Logs records to a [Loggly](http://www.loggly.com/) account.
|
55 |
-
- _RollbarHandler_: Logs records to a [Rollbar](https://rollbar.com/) account.
|
56 |
-
- _SyslogUdpHandler_: Logs records to a remote [Syslogd](http://www.rsyslog.com/) server.
|
57 |
-
- _LogEntriesHandler_: Logs records to a [LogEntries](http://logentries.com/) account.
|
58 |
-
- _InsightOpsHandler_: Logs records to a [InsightOps](https://www.rapid7.com/products/insightops/) account.
|
59 |
-
|
60 |
-
### Logging in development
|
61 |
-
|
62 |
-
- _FirePHPHandler_: Handler for [FirePHP](http://www.firephp.org/), providing
|
63 |
-
inline `console` messages within [FireBug](http://getfirebug.com/).
|
64 |
-
- _ChromePHPHandler_: Handler for [ChromePHP](http://www.chromephp.com/), providing
|
65 |
-
inline `console` messages within Chrome.
|
66 |
-
- _BrowserConsoleHandler_: Handler to send logs to browser's Javascript `console` with
|
67 |
-
no browser extension required. Most browsers supporting `console` API are supported.
|
68 |
-
- _PHPConsoleHandler_: Handler for [PHP Console](https://chrome.google.com/webstore/detail/php-console/nfhmhhlpfleoednkpnnnkolmclajemef), providing
|
69 |
-
inline `console` and notification popup messages within Chrome.
|
70 |
-
|
71 |
-
### Log to databases
|
72 |
-
|
73 |
-
- _RedisHandler_: Logs records to a [redis](http://redis.io) server.
|
74 |
-
- _MongoDBHandler_: Handler to write records in MongoDB via a
|
75 |
-
[Mongo](http://pecl.php.net/package/mongo) extension connection.
|
76 |
-
- _CouchDBHandler_: Logs records to a CouchDB server.
|
77 |
-
- _DoctrineCouchDBHandler_: Logs records to a CouchDB server via the Doctrine CouchDB ODM.
|
78 |
-
- _ElasticSearchHandler_: Logs records to an Elastic Search server.
|
79 |
-
- _DynamoDbHandler_: Logs records to a DynamoDB table with the [AWS SDK](https://github.com/aws/aws-sdk-php).
|
80 |
-
|
81 |
-
### Wrappers / Special Handlers
|
82 |
-
|
83 |
-
- _FingersCrossedHandler_: A very interesting wrapper. It takes a logger as
|
84 |
-
parameter and will accumulate log records of all levels until a record
|
85 |
-
exceeds the defined severity level. At which point it delivers all records,
|
86 |
-
including those of lower severity, to the handler it wraps. This means that
|
87 |
-
until an error actually happens you will not see anything in your logs, but
|
88 |
-
when it happens you will have the full information, including debug and info
|
89 |
-
records. This provides you with all the information you need, but only when
|
90 |
-
you need it.
|
91 |
-
- _DeduplicationHandler_: Useful if you are sending notifications or emails
|
92 |
-
when critical errors occur. It takes a logger as parameter and will
|
93 |
-
accumulate log records of all levels until the end of the request (or
|
94 |
-
`flush()` is called). At that point it delivers all records to the handler
|
95 |
-
it wraps, but only if the records are unique over a given time period
|
96 |
-
(60seconds by default). If the records are duplicates they are simply
|
97 |
-
discarded. The main use of this is in case of critical failure like if your
|
98 |
-
database is unreachable for example all your requests will fail and that
|
99 |
-
can result in a lot of notifications being sent. Adding this handler reduces
|
100 |
-
the amount of notifications to a manageable level.
|
101 |
-
- _WhatFailureGroupHandler_: This handler extends the _GroupHandler_ ignoring
|
102 |
-
exceptions raised by each child handler. This allows you to ignore issues
|
103 |
-
where a remote tcp connection may have died but you do not want your entire
|
104 |
-
application to crash and may wish to continue to log to other handlers.
|
105 |
-
- _BufferHandler_: This handler will buffer all the log records it receives
|
106 |
-
until `close()` is called at which point it will call `handleBatch()` on the
|
107 |
-
handler it wraps with all the log messages at once. This is very useful to
|
108 |
-
send an email with all records at once for example instead of having one mail
|
109 |
-
for every log record.
|
110 |
-
- _GroupHandler_: This handler groups other handlers. Every record received is
|
111 |
-
sent to all the handlers it is configured with.
|
112 |
-
- _FilterHandler_: This handler only lets records of the given levels through
|
113 |
-
to the wrapped handler.
|
114 |
-
- _SamplingHandler_: Wraps around another handler and lets you sample records
|
115 |
-
if you only want to store some of them.
|
116 |
-
- _NullHandler_: Any record it can handle will be thrown away. This can be used
|
117 |
-
to put on top of an existing handler stack to disable it temporarily.
|
118 |
-
- _PsrHandler_: Can be used to forward log records to an existing PSR-3 logger
|
119 |
-
- _TestHandler_: Used for testing, it records everything that is sent to it and
|
120 |
-
has accessors to read out the information.
|
121 |
-
- _HandlerWrapper_: A simple handler wrapper you can inherit from to create
|
122 |
-
your own wrappers easily.
|
123 |
-
|
124 |
-
## Formatters
|
125 |
-
|
126 |
-
- _LineFormatter_: Formats a log record into a one-line string.
|
127 |
-
- _HtmlFormatter_: Used to format log records into a human readable html table, mainly suitable for emails.
|
128 |
-
- _NormalizerFormatter_: Normalizes objects/resources down to strings so a record can easily be serialized/encoded.
|
129 |
-
- _ScalarFormatter_: Used to format log records into an associative array of scalar values.
|
130 |
-
- _JsonFormatter_: Encodes a log record into json.
|
131 |
-
- _WildfireFormatter_: Used to format log records into the Wildfire/FirePHP protocol, only useful for the FirePHPHandler.
|
132 |
-
- _ChromePHPFormatter_: Used to format log records into the ChromePHP format, only useful for the ChromePHPHandler.
|
133 |
-
- _GelfMessageFormatter_: Used to format log records into Gelf message instances, only useful for the GelfHandler.
|
134 |
-
- _LogstashFormatter_: Used to format log records into [logstash](http://logstash.net/) event json, useful for any handler listed under inputs [here](http://logstash.net/docs/latest).
|
135 |
-
- _ElasticaFormatter_: Used to format log records into an Elastica\Document object, only useful for the ElasticSearchHandler.
|
136 |
-
- _LogglyFormatter_: Used to format log records into Loggly messages, only useful for the LogglyHandler.
|
137 |
-
- _FlowdockFormatter_: Used to format log records into Flowdock messages, only useful for the FlowdockHandler.
|
138 |
-
- _MongoDBFormatter_: Converts \DateTime instances to \MongoDate and objects recursively to arrays, only useful with the MongoDBHandler.
|
139 |
-
|
140 |
-
## Processors
|
141 |
-
|
142 |
-
- _PsrLogMessageProcessor_: Processes a log record's message according to PSR-3 rules, replacing `{foo}` with the value from `$context['foo']`.
|
143 |
-
- _IntrospectionProcessor_: Adds the line/file/class/method from which the log call originated.
|
144 |
-
- _WebProcessor_: Adds the current request URI, request method and client IP to a log record.
|
145 |
-
- _MemoryUsageProcessor_: Adds the current memory usage to a log record.
|
146 |
-
- _MemoryPeakUsageProcessor_: Adds the peak memory usage to a log record.
|
147 |
-
- _ProcessIdProcessor_: Adds the process id to a log record.
|
148 |
-
- _UidProcessor_: Adds a unique identifier to a log record.
|
149 |
-
- _GitProcessor_: Adds the current git branch and commit to a log record.
|
150 |
-
- _TagProcessor_: Adds an array of predefined tags to a log record.
|
151 |
-
|
152 |
-
## Third Party Packages
|
153 |
-
|
154 |
-
Third party handlers, formatters and processors are
|
155 |
-
[listed in the wiki](https://github.com/Seldaek/monolog/wiki/Third-Party-Packages). You
|
156 |
-
can also add your own there if you publish one.
|
157 |
-
|
158 |
-
← [Usage](01-usage.md) | [Utility classes](03-utilities.md) →
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -1,15 +0,0 @@
|
|
1 |
-
# Utilities
|
2 |
-
|
3 |
-
- _Registry_: The `Monolog\Registry` class lets you configure global loggers that you
|
4 |
-
can then statically access from anywhere. It is not really a best practice but can
|
5 |
-
help in some older codebases or for ease of use.
|
6 |
-
- _ErrorHandler_: The `Monolog\ErrorHandler` class allows you to easily register
|
7 |
-
a Logger instance as an exception handler, error handler or fatal error handler.
|
8 |
-
- _SignalHandler_: The `Monolog\SignalHandler` class allows you to easily register
|
9 |
-
a Logger instance as a POSIX signal handler.
|
10 |
-
- _ErrorLevelActivationStrategy_: Activates a FingersCrossedHandler when a certain log
|
11 |
-
level is reached.
|
12 |
-
- _ChannelLevelActivationStrategy_: Activates a FingersCrossedHandler when a certain
|
13 |
-
log level is reached, depending on which channel received the log record.
|
14 |
-
|
15 |
-
← [Handlers, Formatters and Processors](02-handlers-formatters-processors.md) | [Extending Monolog](04-extending.md) →
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -1,76 +0,0 @@
|
|
1 |
-
# Extending Monolog
|
2 |
-
|
3 |
-
Monolog is fully extensible, allowing you to adapt your logger to your needs.
|
4 |
-
|
5 |
-
## Writing your own handler
|
6 |
-
|
7 |
-
Monolog provides many built-in handlers. But if the one you need does not
|
8 |
-
exist, you can write it and use it in your logger. The only requirement is
|
9 |
-
to implement `Monolog\Handler\HandlerInterface`.
|
10 |
-
|
11 |
-
Let's write a PDOHandler to log records to a database. We will extend the
|
12 |
-
abstract class provided by Monolog to keep things DRY.
|
13 |
-
|
14 |
-
```php
|
15 |
-
<?php
|
16 |
-
|
17 |
-
use Monolog\Logger;
|
18 |
-
use Monolog\Handler\AbstractProcessingHandler;
|
19 |
-
|
20 |
-
class PDOHandler extends AbstractProcessingHandler
|
21 |
-
{
|
22 |
-
private $initialized = false;
|
23 |
-
private $pdo;
|
24 |
-
private $statement;
|
25 |
-
|
26 |
-
public function __construct(PDO $pdo, $level = Logger::DEBUG, $bubble = true)
|
27 |
-
{
|
28 |
-
$this->pdo = $pdo;
|
29 |
-
parent::__construct($level, $bubble);
|
30 |
-
}
|
31 |
-
|
32 |
-
protected function write(array $record)
|
33 |
-
{
|
34 |
-
if (!$this->initialized) {
|
35 |
-
$this->initialize();
|
36 |
-
}
|
37 |
-
|
38 |
-
$this->statement->execute(array(
|
39 |
-
'channel' => $record['channel'],
|
40 |
-
'level' => $record['level'],
|
41 |
-
'message' => $record['formatted'],
|
42 |
-
'time' => $record['datetime']->format('U'),
|
43 |
-
));
|
44 |
-
}
|
45 |
-
|
46 |
-
private function initialize()
|
47 |
-
{
|
48 |
-
$this->pdo->exec(
|
49 |
-
'CREATE TABLE IF NOT EXISTS monolog '
|
50 |
-
.'(channel VARCHAR(255), level INTEGER, message LONGTEXT, time INTEGER UNSIGNED)'
|
51 |
-
);
|
52 |
-
$this->statement = $this->pdo->prepare(
|
53 |
-
'INSERT INTO monolog (channel, level, message, time) VALUES (:channel, :level, :message, :time)'
|
54 |
-
);
|
55 |
-
|
56 |
-
$this->initialized = true;
|
57 |
-
}
|
58 |
-
}
|
59 |
-
```
|
60 |
-
|
61 |
-
You can now use this handler in your logger:
|
62 |
-
|
63 |
-
```php
|
64 |
-
<?php
|
65 |
-
|
66 |
-
$logger->pushHandler(new PDOHandler(new PDO('sqlite:logs.sqlite')));
|
67 |
-
|
68 |
-
// You can now use your logger
|
69 |
-
$logger->addInfo('My logger is now ready');
|
70 |
-
```
|
71 |
-
|
72 |
-
The `Monolog\Handler\AbstractProcessingHandler` class provides most of the
|
73 |
-
logic needed for the handler, including the use of processors and the formatting
|
74 |
-
of the record (which is why we use ``$record['formatted']`` instead of ``$record['message']``).
|
75 |
-
|
76 |
-
← [Utility classes](03-utilities.md)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -1,39 +0,0 @@
|
|
1 |
-
Sockets Handler
|
2 |
-
===============
|
3 |
-
|
4 |
-
This handler allows you to write your logs to sockets using [fsockopen](http://php.net/fsockopen)
|
5 |
-
or [pfsockopen](http://php.net/pfsockopen).
|
6 |
-
|
7 |
-
Persistent sockets are mainly useful in web environments where you gain some performance not closing/opening
|
8 |
-
the connections between requests.
|
9 |
-
|
10 |
-
You can use a `unix://` prefix to access unix sockets and `udp://` to open UDP sockets instead of the default TCP.
|
11 |
-
|
12 |
-
Basic Example
|
13 |
-
-------------
|
14 |
-
|
15 |
-
```php
|
16 |
-
<?php
|
17 |
-
|
18 |
-
use Monolog\Logger;
|
19 |
-
use Monolog\Handler\SocketHandler;
|
20 |
-
|
21 |
-
// Create the logger
|
22 |
-
$logger = new Logger('my_logger');
|
23 |
-
|
24 |
-
// Create the handler
|
25 |
-
$handler = new SocketHandler('unix:///var/log/httpd_app_log.socket');
|
26 |
-
$handler->setPersistent(true);
|
27 |
-
|
28 |
-
// Now add the handler
|
29 |
-
$logger->pushHandler($handler, Logger::DEBUG);
|
30 |
-
|
31 |
-
// You can now use your logger
|
32 |
-
$logger->addInfo('My logger is now ready');
|
33 |
-
|
34 |
-
```
|
35 |
-
|
36 |
-
In this example, using syslog-ng, you should see the log on the log server:
|
37 |
-
|
38 |
-
cweb1 [2012-02-26 00:12:03] my_logger.INFO: My logger is now ready [] []
|
39 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -1,19 +0,0 @@
|
|
1 |
-
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
-
|
3 |
-
<phpunit bootstrap="vendor/autoload.php" colors="true">
|
4 |
-
<testsuites>
|
5 |
-
<testsuite name="Monolog Test Suite">
|
6 |
-
<directory>tests/Monolog/</directory>
|
7 |
-
</testsuite>
|
8 |
-
</testsuites>
|
9 |
-
|
10 |
-
<filter>
|
11 |
-
<whitelist>
|
12 |
-
<directory suffix=".php">src/Monolog/</directory>
|
13 |
-
</whitelist>
|
14 |
-
</filter>
|
15 |
-
|
16 |
-
<php>
|
17 |
-
<ini name="date.timezone" value="UTC"/>
|
18 |
-
</php>
|
19 |
-
</phpunit>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -10,6 +10,7 @@
|
|
10 |
*/
|
11 |
namespace DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Formatter;
|
12 |
|
|
|
13 |
/**
|
14 |
* Class FluentdFormatter
|
15 |
*
|
@@ -59,7 +60,7 @@ class FluentdFormatter implements \DeliciousBrains\WP_Offload_Media\Gcp\Monolog\
|
|
59 |
$message['level'] = $record['level'];
|
60 |
$message['level_name'] = $record['level_name'];
|
61 |
}
|
62 |
-
return
|
63 |
}
|
64 |
public function formatBatch(array $records)
|
65 |
{
|
10 |
*/
|
11 |
namespace DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Formatter;
|
12 |
|
13 |
+
use DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Utils;
|
14 |
/**
|
15 |
* Class FluentdFormatter
|
16 |
*
|
60 |
$message['level'] = $record['level'];
|
61 |
$message['level_name'] = $record['level_name'];
|
62 |
}
|
63 |
+
return \DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Utils::jsonEncode(array($tag, $record['datetime']->getTimestamp(), $message));
|
64 |
}
|
65 |
public function formatBatch(array $records)
|
66 |
{
|
@@ -11,6 +11,7 @@
|
|
11 |
namespace DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Formatter;
|
12 |
|
13 |
use DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Logger;
|
|
|
14 |
/**
|
15 |
* Formats incoming records into an HTML table
|
16 |
*
|
@@ -111,8 +112,8 @@ class HtmlFormatter extends \DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Format
|
|
111 |
}
|
112 |
$data = $this->normalize($data);
|
113 |
if (version_compare(PHP_VERSION, '5.4.0', '>=')) {
|
114 |
-
return
|
115 |
}
|
116 |
-
return str_replace('\\/', '/',
|
117 |
}
|
118 |
}
|
11 |
namespace DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Formatter;
|
12 |
|
13 |
use DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Logger;
|
14 |
+
use DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Utils;
|
15 |
/**
|
16 |
* Formats incoming records into an HTML table
|
17 |
*
|
112 |
}
|
113 |
$data = $this->normalize($data);
|
114 |
if (version_compare(PHP_VERSION, '5.4.0', '>=')) {
|
115 |
+
return \DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Utils::jsonEncode($data, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE, true);
|
116 |
}
|
117 |
+
return str_replace('\\/', '/', \DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Utils::jsonEncode($data, null, true));
|
118 |
}
|
119 |
}
|
@@ -128,7 +128,7 @@ class JsonFormatter extends \DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Format
|
|
128 |
if ($depth > 9) {
|
129 |
return 'Over 9 levels deep, aborting normalization';
|
130 |
}
|
131 |
-
if (is_array($data)
|
132 |
$normalized = array();
|
133 |
$count = 1;
|
134 |
foreach ($data as $key => $value) {
|
@@ -159,18 +159,12 @@ class JsonFormatter extends \DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Format
|
|
159 |
if (!$e instanceof Exception && !$e instanceof Throwable) {
|
160 |
throw new \InvalidArgumentException('Exception/Throwable expected, got ' . gettype($e) . ' / ' . \DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Utils::getClass($e));
|
161 |
}
|
162 |
-
$data = array('class' => \DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Utils::getClass($e), 'message' => $e->getMessage(), 'code' => $e->getCode(), 'file' => $e->getFile() . ':' . $e->getLine());
|
163 |
if ($this->includeStacktraces) {
|
164 |
$trace = $e->getTrace();
|
165 |
foreach ($trace as $frame) {
|
166 |
if (isset($frame['file'])) {
|
167 |
$data['trace'][] = $frame['file'] . ':' . $frame['line'];
|
168 |
-
} elseif (isset($frame['function']) && $frame['function'] === '{closure}') {
|
169 |
-
// We should again normalize the frames, because it might contain invalid items
|
170 |
-
$data['trace'][] = $frame['function'];
|
171 |
-
} else {
|
172 |
-
// We should again normalize the frames, because it might contain invalid items
|
173 |
-
$data['trace'][] = $this->normalize($frame);
|
174 |
}
|
175 |
}
|
176 |
}
|
128 |
if ($depth > 9) {
|
129 |
return 'Over 9 levels deep, aborting normalization';
|
130 |
}
|
131 |
+
if (is_array($data)) {
|
132 |
$normalized = array();
|
133 |
$count = 1;
|
134 |
foreach ($data as $key => $value) {
|
159 |
if (!$e instanceof Exception && !$e instanceof Throwable) {
|
160 |
throw new \InvalidArgumentException('Exception/Throwable expected, got ' . gettype($e) . ' / ' . \DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Utils::getClass($e));
|
161 |
}
|
162 |
+
$data = array('class' => \DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Utils::getClass($e), 'message' => $e->getMessage(), 'code' => (int) $e->getCode(), 'file' => $e->getFile() . ':' . $e->getLine());
|
163 |
if ($this->includeStacktraces) {
|
164 |
$trace = $e->getTrace();
|
165 |
foreach ($trace as $frame) {
|
166 |
if (isset($frame['file'])) {
|
167 |
$data['trace'][] = $frame['file'] . ':' . $frame['line'];
|
|
|
|
|
|
|
|
|
|
|
|
|
168 |
}
|
169 |
}
|
170 |
}
|
@@ -135,7 +135,7 @@ class LineFormatter extends \DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Format
|
|
135 |
if (version_compare(PHP_VERSION, '5.4.0', '>=')) {
|
136 |
return $this->toJson($data, true);
|
137 |
}
|
138 |
-
return str_replace('\\/', '/',
|
139 |
}
|
140 |
protected function replaceNewlines($str)
|
141 |
{
|
135 |
if (version_compare(PHP_VERSION, '5.4.0', '>=')) {
|
136 |
return $this->toJson($data, true);
|
137 |
}
|
138 |
+
return str_replace('\\/', '/', $this->toJson($data, true));
|
139 |
}
|
140 |
protected function replaceNewlines($str)
|
141 |
{
|
@@ -73,7 +73,7 @@ class MongoDBFormatter implements \DeliciousBrains\WP_Offload_Media\Gcp\Monolog\
|
|
73 |
}
|
74 |
protected function formatException(\Exception $exception, $nestingLevel)
|
75 |
{
|
76 |
-
$formattedException = array('class' => \DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Utils::getClass($exception), 'message' => $exception->getMessage(), 'code' => $exception->getCode(), 'file' => $exception->getFile() . ':' . $exception->getLine());
|
77 |
if ($this->exceptionTraceAsString === true) {
|
78 |
$formattedException['trace'] = $exception->getTraceAsString();
|
79 |
} else {
|
73 |
}
|
74 |
protected function formatException(\Exception $exception, $nestingLevel)
|
75 |
{
|
76 |
+
$formattedException = array('class' => \DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Utils::getClass($exception), 'message' => $exception->getMessage(), 'code' => (int) $exception->getCode(), 'file' => $exception->getFile() . ':' . $exception->getLine());
|
77 |
if ($this->exceptionTraceAsString === true) {
|
78 |
$formattedException['trace'] = $exception->getTraceAsString();
|
79 |
} else {
|
@@ -104,7 +104,7 @@ class NormalizerFormatter implements \DeliciousBrains\WP_Offload_Media\Gcp\Monol
|
|
104 |
if (!$e instanceof Exception && !$e instanceof \Throwable) {
|
105 |
throw new \InvalidArgumentException('Exception/Throwable expected, got ' . gettype($e) . ' / ' . \DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Utils::getClass($e));
|
106 |
}
|
107 |
-
$data = array('class' => \DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Utils::getClass($e), 'message' => $e->getMessage(), 'code' => $e->getCode(), 'file' => $e->getFile() . ':' . $e->getLine());
|
108 |
if ($e instanceof \SoapFault) {
|
109 |
if (isset($e->faultcode)) {
|
110 |
$data['faultcode'] = $e->faultcode;
|
@@ -112,30 +112,14 @@ class NormalizerFormatter implements \DeliciousBrains\WP_Offload_Media\Gcp\Monol
|
|
112 |
if (isset($e->faultactor)) {
|
113 |
$data['faultactor'] = $e->faultactor;
|
114 |
}
|
115 |
-
if (isset($e->detail)) {
|
116 |
-
$data['detail'] = $e->detail;
|
117 |
}
|
118 |
}
|
119 |
$trace = $e->getTrace();
|
120 |
foreach ($trace as $frame) {
|
121 |
if (isset($frame['file'])) {
|
122 |
$data['trace'][] = $frame['file'] . ':' . $frame['line'];
|
123 |
-
} elseif (isset($frame['function']) && $frame['function'] === '{closure}') {
|
124 |
-
// Simplify closures handling
|
125 |
-
$data['trace'][] = $frame['function'];
|
126 |
-
} else {
|
127 |
-
if (isset($frame['args'])) {
|
128 |
-
// Make sure that objects present as arguments are not serialized nicely but rather only
|
129 |
-
// as a class name to avoid any unexpected leak of sensitive information
|
130 |
-
$frame['args'] = array_map(function ($arg) {
|
131 |
-
if (is_object($arg) && !($arg instanceof \DateTime || $arg instanceof \DateTimeInterface)) {
|
132 |
-
return sprintf("[object] (%s)", \DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Utils::getClass($arg));
|
133 |
-
}
|
134 |
-
return $arg;
|
135 |
-
}, $frame['args']);
|
136 |
-
}
|
137 |
-
// We should again normalize the frames, because it might contain invalid items
|
138 |
-
$data['trace'][] = $this->toJson($this->normalize($frame), true);
|
139 |
}
|
140 |
}
|
141 |
if ($previous = $e->getPrevious()) {
|
@@ -153,108 +137,6 @@ class NormalizerFormatter implements \DeliciousBrains\WP_Offload_Media\Gcp\Monol
|
|
153 |
*/
|
154 |
protected function toJson($data, $ignoreErrors = false)
|
155 |
{
|
156 |
-
|
157 |
-
if ($ignoreErrors) {
|
158 |
-
return @$this->jsonEncode($data);
|
159 |
-
}
|
160 |
-
$json = $this->jsonEncode($data);
|
161 |
-
if ($json === false) {
|
162 |
-
$json = $this->handleJsonError(json_last_error(), $data);
|
163 |
-
}
|
164 |
-
return $json;
|
165 |
-
}
|
166 |
-
/**
|
167 |
-
* @param mixed $data
|
168 |
-
* @return string JSON encoded data or null on failure
|
169 |
-
*/
|
170 |
-
private function jsonEncode($data)
|
171 |
-
{
|
172 |
-
if (version_compare(PHP_VERSION, '5.4.0', '>=')) {
|
173 |
-
return json_encode($data, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);
|
174 |
-
}
|
175 |
-
return json_encode($data);
|
176 |
-
}
|
177 |
-
/**
|
178 |
-
* Handle a json_encode failure.
|
179 |
-
*
|
180 |
-
* If the failure is due to invalid string encoding, try to clean the
|
181 |
-
* input and encode again. If the second encoding attempt fails, the
|
182 |
-
* inital error is not encoding related or the input can't be cleaned then
|
183 |
-
* raise a descriptive exception.
|
184 |
-
*
|
185 |
-
* @param int $code return code of json_last_error function
|
186 |
-
* @param mixed $data data that was meant to be encoded
|
187 |
-
* @throws \RuntimeException if failure can't be corrected
|
188 |
-
* @return string JSON encoded data after error correction
|
189 |
-
*/
|
190 |
-
private function handleJsonError($code, $data)
|
191 |
-
{
|
192 |
-
if ($code !== JSON_ERROR_UTF8) {
|
193 |
-
$this->throwEncodeError($code, $data);
|
194 |
-
}
|
195 |
-
if (is_string($data)) {
|
196 |
-
$this->detectAndCleanUtf8($data);
|
197 |
-
} elseif (is_array($data)) {
|
198 |
-
array_walk_recursive($data, array($this, 'detectAndCleanUtf8'));
|
199 |
-
} else {
|
200 |
-
$this->throwEncodeError($code, $data);
|
201 |
-
}
|
202 |
-
$json = $this->jsonEncode($data);
|
203 |
-
if ($json === false) {
|
204 |
-
$this->throwEncodeError(json_last_error(), $data);
|
205 |
-
}
|
206 |
-
return $json;
|
207 |
-
}
|
208 |
-
/**
|
209 |
-
* Throws an exception according to a given code with a customized message
|
210 |
-
*
|
211 |
-
* @param int $code return code of json_last_error function
|
212 |
-
* @param mixed $data data that was meant to be encoded
|
213 |
-
* @throws \RuntimeException
|
214 |
-
*/
|
215 |
-
private function throwEncodeError($code, $data)
|
216 |
-
{
|
217 |
-
switch ($code) {
|
218 |
-
case JSON_ERROR_DEPTH:
|
219 |
-
$msg = 'Maximum stack depth exceeded';
|
220 |
-
break;
|
221 |
-
case JSON_ERROR_STATE_MISMATCH:
|
222 |
-
$msg = 'Underflow or the modes mismatch';
|
223 |
-
break;
|
224 |
-
case JSON_ERROR_CTRL_CHAR:
|
225 |
-
$msg = 'Unexpected control character found';
|
226 |
-
break;
|
227 |
-
case JSON_ERROR_UTF8:
|
228 |
-
$msg = 'Malformed UTF-8 characters, possibly incorrectly encoded';
|
229 |
-
break;
|
230 |
-
default:
|
231 |
-
$msg = 'Unknown error';
|
232 |
-
}
|
233 |
-
throw new \RuntimeException('JSON encoding failed: ' . $msg . '. Encoding: ' . var_export($data, true));
|
234 |
-
}
|
235 |
-
/**
|
236 |
-
* Detect invalid UTF-8 string characters and convert to valid UTF-8.
|
237 |
-
*
|
238 |
-
* Valid UTF-8 input will be left unmodified, but strings containing
|
239 |
-
* invalid UTF-8 codepoints will be reencoded as UTF-8 with an assumed
|
240 |
-
* original encoding of ISO-8859-15. This conversion may result in
|
241 |
-
* incorrect output if the actual encoding was not ISO-8859-15, but it
|
242 |
-
* will be clean UTF-8 output and will not rely on expensive and fragile
|
243 |
-
* detection algorithms.
|
244 |
-
*
|
245 |
-
* Function converts the input in place in the passed variable so that it
|
246 |
-
* can be used as a callback for array_walk_recursive.
|
247 |
-
*
|
248 |
-
* @param mixed &$data Input to check and convert if needed
|
249 |
-
* @private
|
250 |
-
*/
|
251 |
-
public function detectAndCleanUtf8(&$data)
|
252 |
-
{
|
253 |
-
if (is_string($data) && !preg_match('//u', $data)) {
|
254 |
-
$data = preg_replace_callback('/[\\x80-\\xFF]+/', function ($m) {
|
255 |
-
return utf8_encode($m[0]);
|
256 |
-
}, $data);
|
257 |
-
$data = str_replace(array('¤', '¦', '¨', '´', '¸', '¼', '½', '¾'), array('€', 'Š', 'š', 'Ž', 'ž', 'Œ', 'œ', 'Ÿ'), $data);
|
258 |
-
}
|
259 |
}
|
260 |
}
|
104 |
if (!$e instanceof Exception && !$e instanceof \Throwable) {
|
105 |
throw new \InvalidArgumentException('Exception/Throwable expected, got ' . gettype($e) . ' / ' . \DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Utils::getClass($e));
|
106 |
}
|
107 |
+
$data = array('class' => \DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Utils::getClass($e), 'message' => $e->getMessage(), 'code' => (int) $e->getCode(), 'file' => $e->getFile() . ':' . $e->getLine());
|
108 |
if ($e instanceof \SoapFault) {
|
109 |
if (isset($e->faultcode)) {
|
110 |
$data['faultcode'] = $e->faultcode;
|
112 |
if (isset($e->faultactor)) {
|
113 |
$data['faultactor'] = $e->faultactor;
|
114 |
}
|
115 |
+
if (isset($e->detail) && (is_string($e->detail) || is_object($e->detail) || is_array($e->detail))) {
|
116 |
+
$data['detail'] = is_string($e->detail) ? $e->detail : reset($e->detail);
|
117 |
}
|
118 |
}
|
119 |
$trace = $e->getTrace();
|
120 |
foreach ($trace as $frame) {
|
121 |
if (isset($frame['file'])) {
|
122 |
$data['trace'][] = $frame['file'] . ':' . $frame['line'];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
123 |
}
|
124 |
}
|
125 |
if ($previous = $e->getPrevious()) {
|
137 |
*/
|
138 |
protected function toJson($data, $ignoreErrors = false)
|
139 |
{
|
140 |
+
return \DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Utils::jsonEncode($data, null, $ignoreErrors);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
141 |
}
|
142 |
}
|
@@ -141,17 +141,18 @@ class BrowserConsoleHandler extends \DeliciousBrains\WP_Offload_Media\Gcp\Monolo
|
|
141 |
}
|
142 |
private static function handleStyles($formatted)
|
143 |
{
|
144 |
-
$args = array(
|
145 |
$format = '%c' . $formatted;
|
146 |
preg_match_all('/\\[\\[(.*?)\\]\\]\\{([^}]*)\\}/s', $format, $matches, PREG_OFFSET_CAPTURE | PREG_SET_ORDER);
|
147 |
foreach (array_reverse($matches) as $match) {
|
148 |
-
$args[] = static::quote(static::handleCustomStyles($match[2][0], $match[1][0]));
|
149 |
$args[] = '"font-weight: normal"';
|
|
|
150 |
$pos = $match[0][1];
|
151 |
$format = substr($format, 0, $pos) . '%c' . $match[1][0] . '%c' . substr($format, $pos + strlen($match[0][0]));
|
152 |
}
|
153 |
-
|
154 |
-
|
|
|
155 |
}
|
156 |
private static function handleCustomStyles($style, $string)
|
157 |
{
|
141 |
}
|
142 |
private static function handleStyles($formatted)
|
143 |
{
|
144 |
+
$args = array();
|
145 |
$format = '%c' . $formatted;
|
146 |
preg_match_all('/\\[\\[(.*?)\\]\\]\\{([^}]*)\\}/s', $format, $matches, PREG_OFFSET_CAPTURE | PREG_SET_ORDER);
|
147 |
foreach (array_reverse($matches) as $match) {
|
|
|
148 |
$args[] = '"font-weight: normal"';
|
149 |
+
$args[] = static::quote(static::handleCustomStyles($match[2][0], $match[1][0]));
|
150 |
$pos = $match[0][1];
|
151 |
$format = substr($format, 0, $pos) . '%c' . $match[1][0] . '%c' . substr($format, $pos + strlen($match[0][0]));
|
152 |
}
|
153 |
+
$args[] = static::quote('font-weight: normal');
|
154 |
+
$args[] = static::quote($format);
|
155 |
+
return array_reverse($args);
|
156 |
}
|
157 |
private static function handleCustomStyles($style, $string)
|
158 |
{
|
@@ -12,6 +12,7 @@ namespace DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Handler;
|
|
12 |
|
13 |
use DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Logger;
|
14 |
use DeliciousBrains\WP_Offload_Media\Gcp\Monolog\ResettableInterface;
|
|
|
15 |
/**
|
16 |
* Buffers all records until closing the handler and then pass them as batch.
|
17 |
*
|
@@ -109,4 +110,19 @@ class BufferHandler extends \DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Handle
|
|
109 |
$this->handler->reset();
|
110 |
}
|
111 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
112 |
}
|
12 |
|
13 |
use DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Logger;
|
14 |
use DeliciousBrains\WP_Offload_Media\Gcp\Monolog\ResettableInterface;
|
15 |
+
use DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Formatter\FormatterInterface;
|
16 |
/**
|
17 |
* Buffers all records until closing the handler and then pass them as batch.
|
18 |
*
|
110 |
$this->handler->reset();
|
111 |
}
|
112 |
}
|
113 |
+
/**
|
114 |
+
* {@inheritdoc}
|
115 |
+
*/
|
116 |
+
public function setFormatter(\DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Formatter\FormatterInterface $formatter)
|
117 |
+
{
|
118 |
+
$this->handler->setFormatter($formatter);
|
119 |
+
return $this;
|
120 |
+
}
|
121 |
+
/**
|
122 |
+
* {@inheritdoc}
|
123 |
+
*/
|
124 |
+
public function getFormatter()
|
125 |
+
{
|
126 |
+
return $this->handler->getFormatter();
|
127 |
+
}
|
128 |
}
|
@@ -12,6 +12,7 @@ namespace DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Handler;
|
|
12 |
|
13 |
use DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Formatter\ChromePHPFormatter;
|
14 |
use DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Logger;
|
|
|
15 |
/**
|
16 |
* Handler sending logs to the ChromePHP extension (http://www.chromephp.com/)
|
17 |
*
|
@@ -37,7 +38,7 @@ class ChromePHPHandler extends \DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Han
|
|
37 |
/**
|
38 |
* Tracks whether we sent too much data
|
39 |
*
|
40 |
-
* Chrome limits the headers to
|
41 |
*
|
42 |
* @var bool
|
43 |
*/
|
@@ -110,13 +111,13 @@ class ChromePHPHandler extends \DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Han
|
|
110 |
}
|
111 |
self::$json['request_uri'] = isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : '';
|
112 |
}
|
113 |
-
$json =
|
114 |
$data = base64_encode(utf8_encode($json));
|
115 |
-
if (strlen($data) >
|
116 |
self::$overflowed = true;
|
117 |
$record = array('message' => 'Incomplete logs, chrome header size limit reached', 'context' => array(), 'level' => \DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Logger::WARNING, 'level_name' => \DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Logger::getLevelName(\DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Logger::WARNING), 'channel' => 'monolog', 'datetime' => new \DateTime(), 'extra' => array());
|
118 |
self::$json['rows'][count(self::$json['rows']) - 1] = $this->getFormatter()->format($record);
|
119 |
-
$json =
|
120 |
$data = base64_encode(utf8_encode($json));
|
121 |
}
|
122 |
if (trim($data) !== '') {
|
12 |
|
13 |
use DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Formatter\ChromePHPFormatter;
|
14 |
use DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Logger;
|
15 |
+
use DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Utils;
|
16 |
/**
|
17 |
* Handler sending logs to the ChromePHP extension (http://www.chromephp.com/)
|
18 |
*
|
38 |
/**
|
39 |
* Tracks whether we sent too much data
|
40 |
*
|
41 |
+
* Chrome limits the headers to 4KB, so when we sent 3KB we stop sending
|
42 |
*
|
43 |
* @var bool
|
44 |
*/
|
111 |
}
|
112 |
self::$json['request_uri'] = isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : '';
|
113 |
}
|
114 |
+
$json = \DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Utils::jsonEncode(self::$json, null, true);
|
115 |
$data = base64_encode(utf8_encode($json));
|
116 |
+
if (strlen($data) > 3 * 1024) {
|
117 |
self::$overflowed = true;
|
118 |
$record = array('message' => 'Incomplete logs, chrome header size limit reached', 'context' => array(), 'level' => \DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Logger::WARNING, 'level_name' => \DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Logger::getLevelName(\DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Logger::WARNING), 'channel' => 'monolog', 'datetime' => new \DateTime(), 'extra' => array());
|
119 |
self::$json['rows'][count(self::$json['rows']) - 1] = $this->getFormatter()->format($record);
|
120 |
+
$json = \DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Utils::jsonEncode(self::$json, null, true);
|
121 |
$data = base64_encode(utf8_encode($json));
|
122 |
}
|
123 |
if (trim($data) !== '') {
|
@@ -11,6 +11,7 @@
|
|
11 |
namespace DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Handler;
|
12 |
|
13 |
use DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Logger;
|
|
|
14 |
/**
|
15 |
* Logs to Cube.
|
16 |
*
|
@@ -98,9 +99,9 @@ class CubeHandler extends \DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Handler\
|
|
98 |
$data['data'] = $record['context'];
|
99 |
$data['data']['level'] = $record['level'];
|
100 |
if ($this->scheme === 'http') {
|
101 |
-
$this->writeHttp(
|
102 |
} else {
|
103 |
-
$this->writeUdp(
|
104 |
}
|
105 |
}
|
106 |
private function writeUdp($data)
|
11 |
namespace DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Handler;
|
12 |
|
13 |
use DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Logger;
|
14 |
+
use DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Utils;
|
15 |
/**
|
16 |
* Logs to Cube.
|
17 |
*
|
99 |
$data['data'] = $record['context'];
|
100 |
$data['data']['level'] = $record['level'];
|
101 |
if ($this->scheme === 'http') {
|
102 |
+
$this->writeHttp(\DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Utils::jsonEncode($data));
|
103 |
} else {
|
104 |
+
$this->writeUdp(\DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Utils::jsonEncode($data));
|
105 |
}
|
106 |
}
|
107 |
private function writeUdp($data)
|
@@ -11,6 +11,7 @@
|
|
11 |
namespace DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Handler;
|
12 |
|
13 |
use DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Logger;
|
|
|
14 |
/**
|
15 |
* Simple handler wrapper that filters records based on a list of levels
|
16 |
*
|
@@ -40,7 +41,7 @@ class FilterHandler extends \DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Handle
|
|
40 |
*/
|
41 |
protected $bubble;
|
42 |
/**
|
43 |
-
* @param callable|HandlerInterface $handler Handler or factory callable($record, $
|
44 |
* @param int|array $minLevelOrList A list of levels to accept or a minimum level if maxLevel is provided
|
45 |
* @param int $maxLevel Maximum level to accept, only used if $minLevelOrList is not an array
|
46 |
* @param bool $bubble Whether the messages that are handled can bubble up the stack or not
|
@@ -93,19 +94,12 @@ class FilterHandler extends \DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Handle
|
|
93 |
if (!$this->isHandling($record)) {
|
94 |
return false;
|
95 |
}
|
96 |
-
// The same logic as in FingersCrossedHandler
|
97 |
-
if (!$this->handler instanceof HandlerInterface) {
|
98 |
-
$this->handler = call_user_func($this->handler, $record, $this);
|
99 |
-
if (!$this->handler instanceof HandlerInterface) {
|
100 |
-
throw new \RuntimeException("The factory callable should return a HandlerInterface");
|
101 |
-
}
|
102 |
-
}
|
103 |
if ($this->processors) {
|
104 |
foreach ($this->processors as $processor) {
|
105 |
$record = call_user_func($processor, $record);
|
106 |
}
|
107 |
}
|
108 |
-
$this->
|
109 |
return false === $this->bubble;
|
110 |
}
|
111 |
/**
|
@@ -119,6 +113,38 @@ class FilterHandler extends \DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Handle
|
|
119 |
$filtered[] = $record;
|
120 |
}
|
121 |
}
|
122 |
-
$this->
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
123 |
}
|
124 |
}
|
11 |
namespace DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Handler;
|
12 |
|
13 |
use DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Logger;
|
14 |
+
use DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Formatter\FormatterInterface;
|
15 |
/**
|
16 |
* Simple handler wrapper that filters records based on a list of levels
|
17 |
*
|
41 |
*/
|
42 |
protected $bubble;
|
43 |
/**
|
44 |
+
* @param callable|HandlerInterface $handler Handler or factory callable($record|null, $filterHandler).
|
45 |
* @param int|array $minLevelOrList A list of levels to accept or a minimum level if maxLevel is provided
|
46 |
* @param int $maxLevel Maximum level to accept, only used if $minLevelOrList is not an array
|
47 |
* @param bool $bubble Whether the messages that are handled can bubble up the stack or not
|
94 |
if (!$this->isHandling($record)) {
|
95 |
return false;
|
96 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
97 |
if ($this->processors) {
|
98 |
foreach ($this->processors as $processor) {
|
99 |
$record = call_user_func($processor, $record);
|
100 |
}
|
101 |
}
|
102 |
+
$this->getHandler($record)->handle($record);
|
103 |
return false === $this->bubble;
|
104 |
}
|
105 |
/**
|
113 |
$filtered[] = $record;
|
114 |
}
|
115 |
}
|
116 |
+
$this->getHandler($filtered[count($filtered) - 1])->handleBatch($filtered);
|
117 |
+
}
|
118 |
+
/**
|
119 |
+
* Return the nested handler
|
120 |
+
*
|
121 |
+
* If the handler was provided as a factory callable, this will trigger the handler's instantiation.
|
122 |
+
*
|
123 |
+
* @return HandlerInterface
|
124 |
+
*/
|
125 |
+
public function getHandler(array $record = null)
|
126 |
+
{
|
127 |
+
if (!$this->handler instanceof HandlerInterface) {
|
128 |
+
$this->handler = call_user_func($this->handler, $record, $this);
|
129 |
+
if (!$this->handler instanceof HandlerInterface) {
|
130 |
+
throw new \RuntimeException("The factory callable should return a HandlerInterface");
|
131 |
+
}
|
132 |
+
}
|
133 |
+
return $this->handler;
|
134 |
+
}
|
135 |
+
/**
|
136 |
+
* {@inheritdoc}
|
137 |
+
*/
|
138 |
+
public function setFormatter(\DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Formatter\FormatterInterface $formatter)
|
139 |
+
{
|
140 |
+
$this->getHandler()->setFormatter($formatter);
|
141 |
+
return $this;
|
142 |
+
}
|
143 |
+
/**
|
144 |
+
* {@inheritdoc}
|
145 |
+
*/
|
146 |
+
public function getFormatter()
|
147 |
+
{
|
148 |
+
return $this->getHandler()->getFormatter();
|
149 |
}
|
150 |
}
|
@@ -14,6 +14,7 @@ use DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Handler\FingersCrossed\ErrorLev
|
|
14 |
use DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Handler\FingersCrossed\ActivationStrategyInterface;
|
15 |
use DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Logger;
|
16 |
use DeliciousBrains\WP_Offload_Media\Gcp\Monolog\ResettableInterface;
|
|
|
17 |
/**
|
18 |
* Buffers all records until a certain level is reached
|
19 |
*
|
@@ -36,7 +37,7 @@ class FingersCrossedHandler extends \DeliciousBrains\WP_Offload_Media\Gcp\Monolo
|
|
36 |
protected $stopBuffering;
|
37 |
protected $passthruLevel;
|
38 |
/**
|
39 |
-
* @param callable|HandlerInterface $handler Handler or factory callable($record, $fingersCrossedHandler).
|
40 |
* @param int|ActivationStrategyInterface $activationStrategy Strategy which determines when this handler takes action
|
41 |
* @param int $bufferSize How many entries should be buffered at most, beyond that the oldest items are removed from the buffer.
|
42 |
* @param bool $bubble Whether the messages that are handled can bubble up the stack or not
|
@@ -79,14 +80,7 @@ class FingersCrossedHandler extends \DeliciousBrains\WP_Offload_Media\Gcp\Monolo
|
|
79 |
if ($this->stopBuffering) {
|
80 |
$this->buffering = false;
|
81 |
}
|
82 |
-
|
83 |
-
$record = end($this->buffer) ?: null;
|
84 |
-
$this->handler = call_user_func($this->handler, $record, $this);
|
85 |
-
if (!$this->handler instanceof HandlerInterface) {
|
86 |
-
throw new \RuntimeException("The factory callable should return a HandlerInterface");
|
87 |
-
}
|
88 |
-
}
|
89 |
-
$this->handler->handleBatch($this->buffer);
|
90 |
$this->buffer = array();
|
91 |
}
|
92 |
/**
|
@@ -108,7 +102,7 @@ class FingersCrossedHandler extends \DeliciousBrains\WP_Offload_Media\Gcp\Monolo
|
|
108 |
$this->activate();
|
109 |
}
|
110 |
} else {
|
111 |
-
$this->
|
112 |
}
|
113 |
return false === $this->bubble;
|
114 |
}
|
@@ -123,8 +117,8 @@ class FingersCrossedHandler extends \DeliciousBrains\WP_Offload_Media\Gcp\Monolo
|
|
123 |
{
|
124 |
$this->flushBuffer();
|
125 |
parent::reset();
|
126 |
-
if ($this->
|
127 |
-
$this->
|
128 |
}
|
129 |
}
|
130 |
/**
|
@@ -148,10 +142,42 @@ class FingersCrossedHandler extends \DeliciousBrains\WP_Offload_Media\Gcp\Monolo
|
|
148 |
return $record['level'] >= $level;
|
149 |
});
|
150 |
if (count($this->buffer) > 0) {
|
151 |
-
$this->
|
152 |
}
|
153 |
}
|
154 |
$this->buffer = array();
|
155 |
$this->buffering = true;
|
156 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
157 |
}
|
14 |
use DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Handler\FingersCrossed\ActivationStrategyInterface;
|
15 |
use DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Logger;
|
16 |
use DeliciousBrains\WP_Offload_Media\Gcp\Monolog\ResettableInterface;
|
17 |
+
use DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Formatter\FormatterInterface;
|
18 |
/**
|
19 |
* Buffers all records until a certain level is reached
|
20 |
*
|
37 |
protected $stopBuffering;
|
38 |
protected $passthruLevel;
|
39 |
/**
|
40 |
+
* @param callable|HandlerInterface $handler Handler or factory callable($record|null, $fingersCrossedHandler).
|
41 |
* @param int|ActivationStrategyInterface $activationStrategy Strategy which determines when this handler takes action
|
42 |
* @param int $bufferSize How many entries should be buffered at most, beyond that the oldest items are removed from the buffer.
|
43 |
* @param bool $bubble Whether the messages that are handled can bubble up the stack or not
|
80 |
if ($this->stopBuffering) {
|
81 |
$this->buffering = false;
|
82 |
}
|
83 |
+
$this->getHandler(end($this->buffer) ?: null)->handleBatch($this->buffer);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
84 |
$this->buffer = array();
|
85 |
}
|
86 |
/**
|
102 |
$this->activate();
|
103 |
}
|
104 |
} else {
|
105 |
+
$this->getHandler($record)->handle($record);
|
106 |
}
|
107 |
return false === $this->bubble;
|
108 |
}
|
117 |
{
|
118 |
$this->flushBuffer();
|
119 |
parent::reset();
|
120 |
+
if ($this->getHandler() instanceof ResettableInterface) {
|
121 |
+
$this->getHandler()->reset();
|
122 |
}
|
123 |
}
|
124 |
/**
|
142 |
return $record['level'] >= $level;
|
143 |
});
|
144 |
if (count($this->buffer) > 0) {
|
145 |
+
$this->getHandler(end($this->buffer) ?: null)->handleBatch($this->buffer);
|
146 |
}
|
147 |
}
|
148 |
$this->buffer = array();
|
149 |
$this->buffering = true;
|
150 |
}
|
151 |
+
/**
|
152 |
+
* Return the nested handler
|
153 |
+
*
|
154 |
+
* If the handler was provided as a factory callable, this will trigger the handler's instantiation.
|
155 |
+
*
|
156 |
+
* @return HandlerInterface
|
157 |
+
*/
|
158 |
+
public function getHandler(array $record = null)
|
159 |
+
{
|
160 |
+
if (!$this->handler instanceof HandlerInterface) {
|
161 |
+
$this->handler = call_user_func($this->handler, $record, $this);
|
162 |
+
if (!$this->handler instanceof HandlerInterface) {
|
163 |
+
throw new \RuntimeException("The factory callable should return a HandlerInterface");
|
164 |
+
}
|
165 |
+
}
|
166 |
+
return $this->handler;
|
167 |
+
}
|
168 |
+
/**
|
169 |
+
* {@inheritdoc}
|
170 |
+
*/
|
171 |
+
public function setFormatter(\DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Formatter\FormatterInterface $formatter)
|
172 |
+
{
|
173 |
+
$this->getHandler()->setFormatter($formatter);
|
174 |
+
return $this;
|
175 |
+
}
|
176 |
+
/**
|
177 |
+
* {@inheritdoc}
|
178 |
+
*/
|
179 |
+
public function getFormatter()
|
180 |
+
{
|
181 |
+
return $this->getHandler()->getFormatter();
|
182 |
+
}
|
183 |
}
|
@@ -11,6 +11,7 @@
|
|
11 |
namespace DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Handler;
|
12 |
|
13 |
use DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Logger;
|
|
|
14 |
use DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Formatter\FlowdockFormatter;
|
15 |
use DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Formatter\FormatterInterface;
|
16 |
/**
|
@@ -93,7 +94,7 @@ class FlowdockHandler extends \DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Hand
|
|
93 |
*/
|
94 |
private function buildContent($record)
|
95 |
{
|
96 |
-
return
|
97 |
}
|
98 |
/**
|
99 |
* Builds the header of the API Call
|
11 |
namespace DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Handler;
|
12 |
|
13 |
use DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Logger;
|
14 |
+
use DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Utils;
|
15 |
use DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Formatter\FlowdockFormatter;
|
16 |
use DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Formatter\FormatterInterface;
|
17 |
/**
|
94 |
*/
|
95 |
private function buildContent($record)
|
96 |
{
|
97 |
+
return \DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Utils::jsonEncode($record['formatted']['flowdock']);
|
98 |
}
|
99 |
/**
|
100 |
* Builds the header of the API Call
|
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
declare (strict_types=1);
|
4 |
+
/*
|
5 |
+
* This file is part of the Monolog package.
|
6 |
+
*
|
7 |
+
* (c) Jordi Boggiano <j.boggiano@seld.be>
|
8 |
+
*
|
9 |
+
* For the full copyright and license information, please view the LICENSE
|
10 |
+
* file that was distributed with this source code.
|
11 |
+
*/
|
12 |
+
namespace DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Handler;
|
13 |
+
|
14 |
+
use DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Formatter\FormatterInterface;
|
15 |
+
/**
|
16 |
+
* Interface to describe loggers that have a formatter
|
17 |
+
*
|
18 |
+
* This interface is present in monolog 1.x to ease forward compatibility.
|
19 |
+
*
|
20 |
+
* @author Jordi Boggiano <j.boggiano@seld.be>
|
21 |
+
*/
|
22 |
+
interface FormattableHandlerInterface
|
23 |
+
{
|
24 |
+
/**
|
25 |
+
* Sets the formatter.
|
26 |
+
*
|
27 |
+
* @param FormatterInterface $formatter
|
28 |
+
* @return HandlerInterface self
|
29 |
+
*/
|
30 |
+
public function setFormatter(\DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Formatter\FormatterInterface $formatter) : HandlerInterface;
|
31 |
+
/**
|
32 |
+
* Gets the formatter.
|
33 |
+
*
|
34 |
+
* @return FormatterInterface
|
35 |
+
*/
|
36 |
+
public function getFormatter() : FormatterInterface;
|
37 |
+
}
|
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
declare (strict_types=1);
|
4 |
+
/*
|
5 |
+
* This file is part of the Monolog package.
|
6 |
+
*
|
7 |
+
* (c) Jordi Boggiano <j.boggiano@seld.be>
|
8 |
+
*
|
9 |
+
* For the full copyright and license information, please view the LICENSE
|
10 |
+
* file that was distributed with this source code.
|
11 |
+
*/
|
12 |
+
namespace DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Handler;
|
13 |
+
|
14 |
+
use DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Formatter\FormatterInterface;
|
15 |
+
use DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Formatter\LineFormatter;
|
16 |
+
/**
|
17 |
+
* Helper trait for implementing FormattableInterface
|
18 |
+
*
|
19 |
+
* This trait is present in monolog 1.x to ease forward compatibility.
|
20 |
+
*
|
21 |
+
* @author Jordi Boggiano <j.boggiano@seld.be>
|
22 |
+
*/
|
23 |
+
trait FormattableHandlerTrait
|
24 |
+
{
|
25 |
+
/**
|
26 |
+
* @var FormatterInterface
|
27 |
+
*/
|
28 |
+
protected $formatter;
|
29 |
+
/**
|
30 |
+
* {@inheritdoc}
|
31 |
+
* @suppress PhanTypeMismatchReturn
|
32 |
+
*/
|
33 |
+
public function setFormatter(\DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Formatter\FormatterInterface $formatter) : HandlerInterface
|
34 |
+
{
|
35 |
+
$this->formatter = $formatter;
|
36 |
+
return $this;
|
37 |
+
}
|
38 |
+
/**
|
39 |
+
* {@inheritdoc}
|
40 |
+
*/
|
41 |
+
public function getFormatter() : FormatterInterface
|
42 |
+
{
|
43 |
+
if (!$this->formatter) {
|
44 |
+
$this->formatter = $this->getDefaultFormatter();
|
45 |
+
}
|
46 |
+
return $this->formatter;
|
47 |
+
}
|
48 |
+
/**
|
49 |
+
* Gets the default formatter.
|
50 |
+
*
|
51 |
+
* Overwrite this if the LineFormatter is not a good default for your handler.
|
52 |
+
*/
|
53 |
+
protected function getDefaultFormatter() : FormatterInterface
|
54 |
+
{
|
55 |
+
return new \DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Formatter\LineFormatter();
|
56 |
+
}
|
57 |
+
}
|
@@ -70,8 +70,9 @@ class GroupHandler extends \DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Handler
|
|
70 |
$processed = array();
|
71 |
foreach ($records as $record) {
|
72 |
foreach ($this->processors as $processor) {
|
73 |
-
$
|
74 |
}
|
|
|
75 |
}
|
76 |
$records = $processed;
|
77 |
}
|
70 |
$processed = array();
|
71 |
foreach ($records as $record) {
|
72 |
foreach ($this->processors as $processor) {
|
73 |
+
$record = call_user_func($processor, $record);
|
74 |
}
|
75 |
+
$processed[] = $record;
|
76 |
}
|
77 |
$records = $processed;
|
78 |
}
|
@@ -84,6 +84,7 @@ class HipChatHandler extends \DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Handl
|
|
84 |
*/
|
85 |
public function __construct($token, $room, $name = 'Monolog', $notify = false, $level = \DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Logger::CRITICAL, $bubble = true, $useSSL = true, $format = 'text', $host = 'api.hipchat.com', $version = self::API_V1)
|
86 |
{
|
|
|
87 |
if ($version == self::API_V1 && !$this->validateStringLength($name, static::MAXIMUM_NAME_LENGTH)) {
|
88 |
throw new \InvalidArgumentException('The supplied name is too long. HipChat\'s v1 API supports names up to 15 UTF-8 characters.');
|
89 |
}
|
84 |
*/
|
85 |
public function __construct($token, $room, $name = 'Monolog', $notify = false, $level = \DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Logger::CRITICAL, $bubble = true, $useSSL = true, $format = 'text', $host = 'api.hipchat.com', $version = self::API_V1)
|
86 |
{
|
87 |
+
@trigger_error('The Monolog\\Handler\\HipChatHandler class is deprecated. You should migrate to Slack and the SlackWebhookHandler / SlackbotHandler, see https://www.atlassian.com/partnerships/slack', E_USER_DEPRECATED);
|
88 |
if ($version == self::API_V1 && !$this->validateStringLength($name, static::MAXIMUM_NAME_LENGTH)) {
|
89 |
throw new \InvalidArgumentException('The supplied name is too long. HipChat\'s v1 API supports names up to 15 UTF-8 characters.');
|
90 |
}
|
@@ -11,6 +11,7 @@
|
|
11 |
namespace DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Handler;
|
12 |
|
13 |
use DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Logger;
|
|
|
14 |
/**
|
15 |
* IFTTTHandler uses cURL to trigger IFTTT Maker actions
|
16 |
*
|
@@ -44,7 +45,7 @@ class IFTTTHandler extends \DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Handler
|
|
44 |
public function write(array $record)
|
45 |
{
|
46 |
$postData = array("value1" => $record["channel"], "value2" => $record["level_name"], "value3" => $record["message"]);
|
47 |
-
$postString =
|
48 |
$ch = curl_init();
|
49 |
curl_setopt($ch, CURLOPT_URL, "https://maker.ifttt.com/trigger/" . $this->eventName . "/with/key/" . $this->secretKey);
|
50 |
curl_setopt($ch, CURLOPT_POST, true);
|
11 |
namespace DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Handler;
|
12 |
|
13 |
use DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Logger;
|
14 |
+
use DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Utils;
|
15 |
/**
|
16 |
* IFTTTHandler uses cURL to trigger IFTTT Maker actions
|
17 |
*
|
45 |
public function write(array $record)
|
46 |
{
|
47 |
$postData = array("value1" => $record["channel"], "value2" => $record["level_name"], "value3" => $record["message"]);
|
48 |
+
$postString = \DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Utils::jsonEncode($postData);
|
49 |
$ch = curl_init();
|
50 |
curl_setopt($ch, CURLOPT_URL, "https://maker.ifttt.com/trigger/" . $this->eventName . "/with/key/" . $this->secretKey);
|
51 |
curl_setopt($ch, CURLOPT_POST, true);
|
@@ -35,7 +35,7 @@ class InsightOpsHandler extends \DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Ha
|
|
35 |
public function __construct($token, $region = 'us', $useSSL = true, $level = \DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Logger::DEBUG, $bubble = true)
|
36 |
{
|
37 |
if ($useSSL && !extension_loaded('openssl')) {
|
38 |
-
throw new \DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Handler\MissingExtensionException('The OpenSSL PHP plugin is required to use SSL encrypted connection for
|
39 |
}
|
40 |
$endpoint = $useSSL ? 'ssl://' . $region . '.data.logs.insight.rapid7.com:443' : $region . '.data.logs.insight.rapid7.com:80';
|
41 |
parent::__construct($endpoint, $level, $bubble);
|
35 |
public function __construct($token, $region = 'us', $useSSL = true, $level = \DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Logger::DEBUG, $bubble = true)
|
36 |
{
|
37 |
if ($useSSL && !extension_loaded('openssl')) {
|
38 |
+
throw new \DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Handler\MissingExtensionException('The OpenSSL PHP plugin is required to use SSL encrypted connection for InsightOpsHandler');
|
39 |
}
|
40 |
$endpoint = $useSSL ? 'ssl://' . $region . '.data.logs.insight.rapid7.com:443' : $region . '.data.logs.insight.rapid7.com:80';
|
41 |
parent::__construct($endpoint, $level, $bubble);
|
@@ -11,6 +11,7 @@
|
|
11 |
namespace DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Handler;
|
12 |
|
13 |
use DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Logger;
|
|
|
14 |
use DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Formatter\NormalizerFormatter;
|
15 |
/**
|
16 |
* Class to record a log on a NewRelic application.
|
@@ -165,7 +166,7 @@ class NewRelicHandler extends \DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Hand
|
|
165 |
if (null === $value || is_scalar($value)) {
|
166 |
newrelic_add_custom_parameter($key, $value);
|
167 |
} else {
|
168 |
-
newrelic_add_custom_parameter($key,
|
169 |
}
|
170 |
}
|
171 |
/**
|
11 |
namespace DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Handler;
|
12 |
|
13 |
use DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Logger;
|
14 |
+
use DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Utils;
|
15 |
use DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Formatter\NormalizerFormatter;
|
16 |
/**
|
17 |
* Class to record a log on a NewRelic application.
|
166 |
if (null === $value || is_scalar($value)) {
|
167 |
newrelic_add_custom_parameter($key, $value);
|
168 |
} else {
|
169 |
+
newrelic_add_custom_parameter($key, \DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Utils::jsonEncode($value, null, true));
|
170 |
}
|
171 |
}
|
172 |
/**
|
@@ -13,6 +13,7 @@ namespace DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Handler;
|
|
13 |
use Exception;
|
14 |
use DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Formatter\LineFormatter;
|
15 |
use DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Logger;
|
|
|
16 |
use DeliciousBrains\WP_Offload_Media\Gcp\PhpConsole\Connector;
|
17 |
use DeliciousBrains\WP_Offload_Media\Gcp\PhpConsole\Handler;
|
18 |
use DeliciousBrains\WP_Offload_Media\Gcp\PhpConsole\Helper;
|
@@ -191,7 +192,7 @@ class PHPConsoleHandler extends \DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Ha
|
|
191 |
$tags = $this->getRecordTags($record);
|
192 |
$message = $record['message'];
|
193 |
if ($record['context']) {
|
194 |
-
$message .= ' ' .
|
195 |
}
|
196 |
$this->connector->getDebugDispatcher()->dispatchDebug($message, $tags, $this->options['classesPartialsTraceIgnore']);
|
197 |
}
|
13 |
use Exception;
|
14 |
use DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Formatter\LineFormatter;
|
15 |
use DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Logger;
|
16 |
+
use DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Utils;
|
17 |
use DeliciousBrains\WP_Offload_Media\Gcp\PhpConsole\Connector;
|
18 |
use DeliciousBrains\WP_Offload_Media\Gcp\PhpConsole\Handler;
|
19 |
use DeliciousBrains\WP_Offload_Media\Gcp\PhpConsole\Helper;
|
192 |
$tags = $this->getRecordTags($record);
|
193 |
$message = $record['message'];
|
194 |
if ($record['context']) {
|
195 |
+
$message .= ' ' . \DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Utils::jsonEncode($this->connector->getDumper()->dump(array_filter($record['context'])), null, true);
|
196 |
}
|
197 |
$this->connector->getDebugDispatcher()->dispatchDebug($message, $tags, $this->options['classesPartialsTraceIgnore']);
|
198 |
}
|
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
declare (strict_types=1);
|
4 |
+
/*
|
5 |
+
* This file is part of the Monolog package.
|
6 |
+
*
|
7 |
+
* (c) Jordi Boggiano <j.boggiano@seld.be>
|
8 |
+
*
|
9 |
+
* For the full copyright and license information, please view the LICENSE
|
10 |
+
* file that was distributed with this source code.
|
11 |
+
*/
|
12 |
+
namespace DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Handler;
|
13 |
+
|
14 |
+
use DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Processor\ProcessorInterface;
|
15 |
+
/**
|
16 |
+
* Interface to describe loggers that have processors
|
17 |
+
*
|
18 |
+
* This interface is present in monolog 1.x to ease forward compatibility.
|
19 |
+
*
|
20 |
+
* @author Jordi Boggiano <j.boggiano@seld.be>
|
21 |
+
*/
|
22 |
+
interface ProcessableHandlerInterface
|
23 |
+
{
|
24 |
+
/**
|
25 |
+
* Adds a processor in the stack.
|
26 |
+
*
|
27 |
+
* @param ProcessorInterface|callable $callback
|
28 |
+
* @return HandlerInterface self
|
29 |
+
*/
|
30 |
+
public function pushProcessor($callback) : HandlerInterface;
|
31 |
+
/**
|
32 |
+
* Removes the processor on top of the stack and returns it.
|
33 |
+
*
|
34 |
+
* @throws \LogicException In case the processor stack is empty
|
35 |
+
* @return callable
|
36 |
+
*/
|
37 |
+
public function popProcessor() : callable;
|
38 |
+
}
|
@@ -0,0 +1,65 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
declare (strict_types=1);
|
4 |
+
/*
|
5 |
+
* This file is part of the Monolog package.
|
6 |
+
*
|
7 |
+
* (c) Jordi Boggiano <j.boggiano@seld.be>
|
8 |
+
*
|
9 |
+
* For the full copyright and license information, please view the LICENSE
|
10 |
+
* file that was distributed with this source code.
|
11 |
+
*/
|
12 |
+
namespace DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Handler;
|
13 |
+
|
14 |
+
use DeliciousBrains\WP_Offload_Media\Gcp\Monolog\ResettableInterface;
|
15 |
+
/**
|
16 |
+
* Helper trait for implementing ProcessableInterface
|
17 |
+
*
|
18 |
+
* This trait is present in monolog 1.x to ease forward compatibility.
|
19 |
+
*
|
20 |
+
* @author Jordi Boggiano <j.boggiano@seld.be>
|
21 |
+
*/
|
22 |
+
trait ProcessableHandlerTrait
|
23 |
+
{
|
24 |
+
/**
|
25 |
+
* @var callable[]
|
26 |
+
*/
|
27 |
+
protected $processors = [];
|
28 |
+
/**
|
29 |
+
* {@inheritdoc}
|
30 |
+
* @suppress PhanTypeMismatchReturn
|
31 |
+
*/
|
32 |
+
public function pushProcessor($callback) : HandlerInterface
|
33 |
+
{
|
34 |
+
array_unshift($this->processors, $callback);
|
35 |
+
return $this;
|
36 |
+
}
|
37 |
+
/**
|
38 |
+
* {@inheritdoc}
|
39 |
+
*/
|
40 |
+
public function popProcessor() : callable
|
41 |
+
{
|
42 |
+
if (!$this->processors) {
|
43 |
+
throw new \LogicException('You tried to pop from an empty processor stack.');
|
44 |
+
}
|
45 |
+
return array_shift($this->processors);
|
46 |
+
}
|
47 |
+
/**
|
48 |
+
* Processes a record.
|
49 |
+
*/
|
50 |
+
protected function processRecord(array $record) : array
|
51 |
+
{
|
52 |
+
foreach ($this->processors as $processor) {
|
53 |
+
$record = $processor($record);
|
54 |
+
}
|
55 |
+
return $record;
|
56 |
+
}
|
57 |
+
protected function resetProcessors() : void
|
58 |
+
{
|
59 |
+
foreach ($this->processors as $processor) {
|
60 |
+
if ($processor instanceof ResettableInterface) {
|
61 |
+
$processor->reset();
|
62 |
+
}
|
63 |
+
}
|
64 |
+
}
|
65 |
+
}
|
@@ -46,6 +46,7 @@ class RavenHandler extends \DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Handler
|
|
46 |
*/
|
47 |
public function __construct(\Raven_Client $ravenClient, $level = \DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Logger::DEBUG, $bubble = true)
|
48 |
{
|
|
|
49 |
parent::__construct($level, $bubble);
|
50 |
$this->ravenClient = $ravenClient;
|
51 |
}
|
46 |
*/
|
47 |
public function __construct(\Raven_Client $ravenClient, $level = \DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Logger::DEBUG, $bubble = true)
|
48 |
{
|
49 |
+
@trigger_error('The Monolog\\Handler\\RavenHandler class is deprecated. You should rather upgrade to the sentry/sentry 2.x and use Sentry\\Monolog\\Handler, see https://github.com/getsentry/sentry-php/blob/master/src/Monolog/Handler.php', E_USER_DEPRECATED);
|
50 |
parent::__construct($level, $bubble);
|
51 |
$this->ravenClient = $ravenClient;
|
52 |
}
|
@@ -10,6 +10,7 @@
|
|
10 |
*/
|
11 |
namespace DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Handler;
|
12 |
|
|
|
13 |
/**
|
14 |
* Sampling handler
|
15 |
*
|
@@ -35,7 +36,7 @@ class SamplingHandler extends \DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Hand
|
|
35 |
*/
|
36 |
protected $factor;
|
37 |
/**
|
38 |
-
* @param callable|HandlerInterface $handler Handler or factory callable($record, $
|
39 |
* @param int $factor Sample factor
|
40 |
*/
|
41 |
public function __construct($handler, $factor)
|
@@ -49,25 +50,50 @@ class SamplingHandler extends \DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Hand
|
|
49 |
}
|
50 |
public function isHandling(array $record)
|
51 |
{
|
52 |
-
return $this->
|
53 |
}
|
54 |
public function handle(array $record)
|
55 |
{
|
56 |
if ($this->isHandling($record) && mt_rand(1, $this->factor) === 1) {
|
57 |
-
// The same logic as in FingersCrossedHandler
|
58 |
-
if (!$this->handler instanceof HandlerInterface) {
|
59 |
-
$this->handler = call_user_func($this->handler, $record, $this);
|
60 |
-
if (!$this->handler instanceof HandlerInterface) {
|
61 |
-
throw new \RuntimeException("The factory callable should return a HandlerInterface");
|
62 |
-
}
|
63 |
-
}
|
64 |
if ($this->processors) {
|
65 |
foreach ($this->processors as $processor) {
|
66 |
$record = call_user_func($processor, $record);
|
67 |
}
|
68 |
}
|
69 |
-
$this->
|
70 |
}
|
71 |
return false === $this->bubble;
|
72 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
73 |
}
|
10 |
*/
|
11 |
namespace DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Handler;
|
12 |
|
13 |
+
use DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Formatter\FormatterInterface;
|
14 |
/**
|
15 |
* Sampling handler
|
16 |
*
|
36 |
*/
|
37 |
protected $factor;
|
38 |
/**
|
39 |
+
* @param callable|HandlerInterface $handler Handler or factory callable($record|null, $samplingHandler).
|
40 |
* @param int $factor Sample factor
|
41 |
*/
|
42 |
public function __construct($handler, $factor)
|
50 |
}
|
51 |
public function isHandling(array $record)
|
52 |
{
|
53 |
+
return $this->getHandler($record)->isHandling($record);
|
54 |
}
|
55 |
public function handle(array $record)
|
56 |
{
|
57 |
if ($this->isHandling($record) && mt_rand(1, $this->factor) === 1) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
58 |
if ($this->processors) {
|
59 |
foreach ($this->processors as $processor) {
|
60 |
$record = call_user_func($processor, $record);
|
61 |
}
|
62 |
}
|
63 |
+
$this->getHandler($record)->handle($record);
|
64 |
}
|
65 |
return false === $this->bubble;
|
66 |
}
|
67 |
+
/**
|
68 |
+
* Return the nested handler
|
69 |
+
*
|
70 |
+
* If the handler was provided as a factory callable, this will trigger the handler's instantiation.
|
71 |
+
*
|
72 |
+
* @return HandlerInterface
|
73 |
+
*/
|
74 |
+
public function getHandler(array $record = null)
|
75 |
+
{
|
76 |
+
if (!$this->handler instanceof HandlerInterface) {
|
77 |
+
$this->handler = call_user_func($this->handler, $record, $this);
|
78 |
+
if (!$this->handler instanceof HandlerInterface) {
|
79 |
+
throw new \RuntimeException("The factory callable should return a HandlerInterface");
|
80 |
+
}
|
81 |
+
}
|
82 |
+
return $this->handler;
|
83 |
+
}
|
84 |
+
/**
|
85 |
+
* {@inheritdoc}
|
86 |
+
*/
|
87 |
+
public function setFormatter(\DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Formatter\FormatterInterface $formatter)
|
88 |
+
{
|
89 |
+
$this->getHandler()->setFormatter($formatter);
|
90 |
+
return $this;
|
91 |
+
}
|
92 |
+
/**
|
93 |
+
* {@inheritdoc}
|
94 |
+
*/
|
95 |
+
public function getFormatter()
|
96 |
+
{
|
97 |
+
return $this->getHandler()->getFormatter();
|
98 |
+
}
|
99 |
}
|
@@ -11,6 +11,7 @@
|
|
11 |
namespace DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Handler\Slack;
|
12 |
|
13 |
use DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Logger;
|
|
|
14 |
use DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Formatter\NormalizerFormatter;
|
15 |
use DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Formatter\FormatterInterface;
|
16 |
/**
|
@@ -164,9 +165,13 @@ class SlackRecord
|
|
164 |
{
|
165 |
$normalized = $this->normalizerFormatter->format($fields);
|
166 |
$prettyPrintFlag = defined('JSON_PRETTY_PRINT') ? JSON_PRETTY_PRINT : 128;
|
|
|
|
|
|
|
|
|
167 |
$hasSecondDimension = count(array_filter($normalized, 'is_array'));
|
168 |
$hasNonNumericKeys = !count(array_filter(array_keys($normalized), 'is_numeric'));
|
169 |
-
return $hasSecondDimension || $hasNonNumericKeys ?
|
170 |
}
|
171 |
/**
|
172 |
* Sets the formatter
|
11 |
namespace DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Handler\Slack;
|
12 |
|
13 |
use DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Logger;
|
14 |
+
use DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Utils;
|
15 |
use DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Formatter\NormalizerFormatter;
|
16 |
use DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Formatter\FormatterInterface;
|
17 |
/**
|
165 |
{
|
166 |
$normalized = $this->normalizerFormatter->format($fields);
|
167 |
$prettyPrintFlag = defined('JSON_PRETTY_PRINT') ? JSON_PRETTY_PRINT : 128;
|
168 |
+
$flags = 0;
|
169 |
+
if (PHP_VERSION_ID >= 50400) {
|
170 |
+
$flags = JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE;
|
171 |
+
}
|
172 |
$hasSecondDimension = count(array_filter($normalized, 'is_array'));
|
173 |
$hasNonNumericKeys = !count(array_filter(array_keys($normalized), 'is_numeric'));
|
174 |
+
return $hasSecondDimension || $hasNonNumericKeys ? \DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Utils::jsonEncode($normalized, $prettyPrintFlag | $flags) : \DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Utils::jsonEncode($normalized, $flags);
|
175 |
}
|
176 |
/**
|
177 |
* Sets the formatter
|
@@ -12,6 +12,7 @@ namespace DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Handler;
|
|
12 |
|
13 |
use DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Formatter\FormatterInterface;
|
14 |
use DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Logger;
|
|
|
15 |
use DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Handler\Slack\SlackRecord;
|
16 |
/**
|
17 |
* Sends notifications through Slack API
|
@@ -94,7 +95,7 @@ class SlackHandler extends \DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Handler
|
|
94 |
$dataArray = $this->slackRecord->getSlackData($record);
|
95 |
$dataArray['token'] = $this->token;
|
96 |
if (!empty($dataArray['attachments'])) {
|
97 |
-
$dataArray['attachments'] =
|
98 |
}
|
99 |
return $dataArray;
|
100 |
}
|
12 |
|
13 |
use DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Formatter\FormatterInterface;
|
14 |
use DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Logger;
|
15 |
+
use DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Utils;
|
16 |
use DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Handler\Slack\SlackRecord;
|
17 |
/**
|
18 |
* Sends notifications through Slack API
|
95 |
$dataArray = $this->slackRecord->getSlackData($record);
|
96 |
$dataArray['token'] = $this->token;
|
97 |
if (!empty($dataArray['attachments'])) {
|
98 |
+
$dataArray['attachments'] = \DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Utils::jsonEncode($dataArray['attachments']);
|
99 |
}
|
100 |
return $dataArray;
|
101 |
}
|
@@ -12,6 +12,7 @@ namespace DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Handler;
|
|
12 |
|
13 |
use DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Formatter\FormatterInterface;
|
14 |
use DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Logger;
|
|
|
15 |
use DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Handler\Slack\SlackRecord;
|
16 |
/**
|
17 |
* Sends notifications through Slack Webhooks
|
@@ -65,7 +66,7 @@ class SlackWebhookHandler extends \DeliciousBrains\WP_Offload_Media\Gcp\Monolog\
|
|
65 |
protected function write(array $record)
|
66 |
{
|
67 |
$postData = $this->slackRecord->getSlackData($record);
|
68 |
-
$postString =
|
69 |
$ch = curl_init();
|
70 |
$options = array(CURLOPT_URL => $this->webhookUrl, CURLOPT_POST => true, CURLOPT_RETURNTRANSFER => true, CURLOPT_HTTPHEADER => array('Content-type: application/json'), CURLOPT_POSTFIELDS => $postString);
|
71 |
if (defined('CURLOPT_SAFE_UPLOAD')) {
|
12 |
|
13 |
use DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Formatter\FormatterInterface;
|
14 |
use DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Logger;
|
15 |
+
use DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Utils;
|
16 |
use DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Handler\Slack\SlackRecord;
|
17 |
/**
|
18 |
* Sends notifications through Slack Webhooks
|
66 |
protected function write(array $record)
|
67 |
{
|
68 |
$postData = $this->slackRecord->getSlackData($record);
|
69 |
+
$postString = \DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Utils::jsonEncode($postData);
|
70 |
$ch = curl_init();
|
71 |
$options = array(CURLOPT_URL => $this->webhookUrl, CURLOPT_POST => true, CURLOPT_RETURNTRANSFER => true, CURLOPT_HTTPHEADER => array('Content-type: application/json'), CURLOPT_POSTFIELDS => $postString);
|
72 |
if (defined('CURLOPT_SAFE_UPLOAD')) {
|
@@ -14,8 +14,11 @@ use DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Logger;
|
|
14 |
/**
|
15 |
* Sends notifications through Slack's Slackbot
|
16 |
*
|
17 |
-
* @author
|
18 |
-
* @see
|
|
|
|
|
|
|
19 |
*/
|
20 |
class SlackbotHandler extends \DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Handler\AbstractProcessingHandler
|
21 |
{
|
@@ -43,6 +46,7 @@ class SlackbotHandler extends \DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Hand
|
|
43 |
*/
|
44 |
public function __construct($slackTeam, $token, $channel, $level = \DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Logger::CRITICAL, $bubble = true)
|
45 |
{
|
|
|
46 |
parent::__construct($level, $bubble);
|
47 |
$this->slackTeam = $slackTeam;
|
48 |
$this->token = $token;
|
14 |
/**
|
15 |
* Sends notifications through Slack's Slackbot
|
16 |
*
|
17 |
+
* @author Haralan Dobrev <hkdobrev@gmail.com>
|
18 |
+
* @see https://slack.com/apps/A0F81R8ET-slackbot
|
19 |
+
* @deprecated According to Slack the API used on this handler it is deprecated.
|
20 |
+
* Therefore this handler will be removed on 2.x
|
21 |
+
* Slack suggests to use webhooks instead. Please contact slack for more information.
|
22 |
*/
|
23 |
class SlackbotHandler extends \DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Handler\AbstractProcessingHandler
|
24 |
{
|
46 |
*/
|
47 |
public function __construct($slackTeam, $token, $channel, $level = \DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Logger::CRITICAL, $bubble = true)
|
48 |
{
|
49 |
+
@trigger_error('SlackbotHandler is deprecated and will be removed on 2.x', E_USER_DEPRECATED);
|
50 |
parent::__construct($level, $bubble);
|
51 |
$this->slackTeam = $slackTeam;
|
52 |
$this->token = $token;
|
@@ -58,6 +58,7 @@ class StreamHandler extends \DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Handle
|
|
58 |
fclose($this->stream);
|
59 |
}
|
60 |
$this->stream = null;
|
|
|
61 |
}
|
62 |
/**
|
63 |
* Return the currently active stream if it is open
|
58 |
fclose($this->stream);
|
59 |
}
|
60 |
$this->stream = null;
|
61 |
+
$this->dirCreated = null;
|
62 |
}
|
63 |
/**
|
64 |
* Return the currently active stream if it is open
|
@@ -16,11 +16,16 @@ use DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Handler\SyslogUdp\UdpSocket;
|
|
16 |
* A Handler for logging to a remote syslogd server.
|
17 |
*
|
18 |
* @author Jesper Skovgaard Nielsen <nulpunkt@gmail.com>
|
|
|
19 |
*/
|
20 |
class SyslogUdpHandler extends \DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Handler\AbstractSyslogHandler
|
21 |
{
|
|
|
|
|
|
|
22 |
protected $socket;
|
23 |
protected $ident;
|
|
|
24 |
/**
|
25 |
* @param string $host
|
26 |
* @param int $port
|
@@ -28,11 +33,13 @@ class SyslogUdpHandler extends \DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Han
|
|
28 |
* @param int $level The minimum logging level at which this handler will be triggered
|
29 |
* @param bool $bubble Whether the messages that are handled can bubble up the stack or not
|
30 |
* @param string $ident Program name or tag for each log message.
|
|
|
31 |
*/
|
32 |
-
public function __construct($host, $port = 514, $facility = LOG_USER, $level = \DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Logger::DEBUG, $bubble = true, $ident = 'php')
|
33 |
{
|
34 |
parent::__construct($facility, $level, $bubble);
|
35 |
$this->ident = $ident;
|
|
|
36 |
$this->socket = new \DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Handler\SyslogUdp\UdpSocket($host, $port ?: 514);
|
37 |
}
|
38 |
protected function write(array $record)
|
@@ -55,7 +62,7 @@ class SyslogUdpHandler extends \DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Han
|
|
55 |
return preg_split('/$\\R?^/m', $message, -1, PREG_SPLIT_NO_EMPTY);
|
56 |
}
|
57 |
/**
|
58 |
-
* Make common syslog header (see rfc5424)
|
59 |
*/
|
60 |
protected function makeCommonSyslogHeader($severity)
|
61 |
{
|
@@ -66,11 +73,16 @@ class SyslogUdpHandler extends \DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Han
|
|
66 |
if (!($hostname = gethostname())) {
|
67 |
$hostname = '-';
|
68 |
}
|
69 |
-
|
|
|
|
|
|
|
|
|
|
|
70 |
}
|
71 |
protected function getDateTime()
|
72 |
{
|
73 |
-
return date(
|
74 |
}
|
75 |
/**
|
76 |
* Inject your own socket, mainly used for testing
|
16 |
* A Handler for logging to a remote syslogd server.
|
17 |
*
|
18 |
* @author Jesper Skovgaard Nielsen <nulpunkt@gmail.com>
|
19 |
+
* @author Dominik Kukacka <dominik.kukacka@gmail.com>
|
20 |
*/
|
21 |
class SyslogUdpHandler extends \DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Handler\AbstractSyslogHandler
|
22 |
{
|
23 |
+
const RFC3164 = 0;
|
24 |
+
const RFC5424 = 1;
|
25 |
+
private $dateFormats = array(self::RFC3164 => 'M d H:i:s', self::RFC5424 => \DateTime::RFC3339);
|
26 |
protected $socket;
|
27 |
protected $ident;
|
28 |
+
protected $rfc;
|
29 |
/**
|
30 |
* @param string $host
|
31 |
* @param int $port
|
33 |
* @param int $level The minimum logging level at which this handler will be triggered
|
34 |
* @param bool $bubble Whether the messages that are handled can bubble up the stack or not
|
35 |
* @param string $ident Program name or tag for each log message.
|
36 |
+
* @param int $rfc RFC to format the message for.
|
37 |
*/
|
38 |
+
public function __construct($host, $port = 514, $facility = LOG_USER, $level = \DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Logger::DEBUG, $bubble = true, $ident = 'php', $rfc = self::RFC5424)
|
39 |
{
|
40 |
parent::__construct($facility, $level, $bubble);
|
41 |
$this->ident = $ident;
|
42 |
+
$this->rfc = $rfc;
|
43 |
$this->socket = new \DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Handler\SyslogUdp\UdpSocket($host, $port ?: 514);
|
44 |
}
|
45 |
protected function write(array $record)
|
62 |
return preg_split('/$\\R?^/m', $message, -1, PREG_SPLIT_NO_EMPTY);
|
63 |
}
|
64 |
/**
|
65 |
+
* Make common syslog header (see rfc5424 or rfc3164)
|
66 |
*/
|
67 |
protected function makeCommonSyslogHeader($severity)
|
68 |
{
|
73 |
if (!($hostname = gethostname())) {
|
74 |
$hostname = '-';
|
75 |
}
|
76 |
+
$date = $this->getDateTime();
|
77 |
+
if ($this->rfc === self::RFC3164) {
|
78 |
+
return "<{$priority}>" . $date . " " . $hostname . " " . $this->ident . "[" . $pid . "]: ";
|
79 |
+
} else {
|
80 |
+
return "<{$priority}>1 " . $date . " " . $hostname . " " . $this->ident . " " . $pid . " - - ";
|
81 |
+
}
|
82 |
}
|
83 |
protected function getDateTime()
|
84 |
{
|
85 |
+
return date($this->dateFormats[$this->rfc]);
|
86 |
}
|
87 |
/**
|
88 |
* Inject your own socket, mainly used for testing
|
@@ -66,6 +66,7 @@ class TestHandler extends \DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Handler\
|
|
66 |
{
|
67 |
protected $records = array();
|
68 |
protected $recordsByLevel = array();
|
|
|
69 |
public function getRecords()
|
70 |
{
|
71 |
return $this->records;
|
@@ -75,6 +76,16 @@ class TestHandler extends \DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Handler\
|
|
75 |
$this->records = array();
|
76 |
$this->recordsByLevel = array();
|
77 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
78 |
public function hasRecords($level)
|
79 |
{
|
80 |
return isset($this->recordsByLevel[$level]);
|
66 |
{
|
67 |
protected $records = array();
|
68 |
protected $recordsByLevel = array();
|
69 |
+
private $skipReset = false;
|
70 |
public function getRecords()
|
71 |
{
|
72 |
return $this->records;
|
76 |
$this->records = array();
|
77 |
$this->recordsByLevel = array();
|
78 |
}
|
79 |
+
public function reset()
|
80 |
+
{
|
81 |
+
if (!$this->skipReset) {
|
82 |
+
$this->clear();
|
83 |
+
}
|
84 |
+
}
|
85 |
+
public function setSkipReset($skipReset)
|
86 |
+
{
|
87 |
+
$this->skipReset = $skipReset;
|
88 |
+
}
|
89 |
public function hasRecords($level)
|
90 |
{
|
91 |
return isset($this->recordsByLevel[$level]);
|
@@ -48,8 +48,9 @@ class WhatFailureGroupHandler extends \DeliciousBrains\WP_Offload_Media\Gcp\Mono
|
|
48 |
$processed = array();
|
49 |
foreach ($records as $record) {
|
50 |
foreach ($this->processors as $processor) {
|
51 |
-
$
|
52 |
}
|
|
|
53 |
}
|
54 |
$records = $processed;
|
55 |
}
|
48 |
$processed = array();
|
49 |
foreach ($records as $record) {
|
50 |
foreach ($this->processors as $processor) {
|
51 |
+
$record = call_user_func($processor, $record);
|
52 |
}
|
53 |
+
$processed[] = $record;
|
54 |
}
|
55 |
$records = $processed;
|
56 |
}
|
@@ -16,6 +16,7 @@ use DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Logger;
|
|
16 |
* Handler sending logs to Zend Monitor
|
17 |
*
|
18 |
* @author Christian Bergau <cbergau86@gmail.com>
|
|
|
19 |
*/
|
20 |
class ZendMonitorHandler extends \DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Handler\AbstractProcessingHandler
|
21 |
{
|
@@ -24,7 +25,7 @@ class ZendMonitorHandler extends \DeliciousBrains\WP_Offload_Media\Gcp\Monolog\H
|
|
24 |
*
|
25 |
* @var array
|
26 |
*/
|
27 |
-
protected $levelMap = array(
|
28 |
/**
|
29 |
* Construct
|
30 |
*
|
@@ -35,8 +36,10 @@ class ZendMonitorHandler extends \DeliciousBrains\WP_Offload_Media\Gcp\Monolog\H
|
|
35 |
public function __construct($level = \DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Logger::DEBUG, $bubble = true)
|
36 |
{
|
37 |
if (!function_exists('zend_monitor_custom_event')) {
|
38 |
-
throw new \DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Handler\MissingExtensionException('You must have Zend Server installed in order to use this handler');
|
39 |
}
|
|
|
|
|
40 |
parent::__construct($level, $bubble);
|
41 |
}
|
42 |
/**
|
@@ -44,18 +47,18 @@ class ZendMonitorHandler extends \DeliciousBrains\WP_Offload_Media\Gcp\Monolog\H
|
|
44 |
*/
|
45 |
protected function write(array $record)
|
46 |
{
|
47 |
-
$this->writeZendMonitorCustomEvent($
|
48 |
}
|
49 |
/**
|
50 |
-
* Write
|
51 |
-
*
|
52 |
-
* @param
|
53 |
-
* @param
|
54 |
-
* @param
|
55 |
*/
|
56 |
-
protected function writeZendMonitorCustomEvent($
|
57 |
{
|
58 |
-
zend_monitor_custom_event($
|
59 |
}
|
60 |
/**
|
61 |
* {@inheritdoc}
|
16 |
* Handler sending logs to Zend Monitor
|
17 |
*
|
18 |
* @author Christian Bergau <cbergau86@gmail.com>
|
19 |
+
* @author Jason Davis <happydude@jasondavis.net>
|
20 |
*/
|
21 |
class ZendMonitorHandler extends \DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Handler\AbstractProcessingHandler
|
22 |
{
|
25 |
*
|
26 |
* @var array
|
27 |
*/
|
28 |
+
protected $levelMap = array();
|
29 |
/**
|
30 |
* Construct
|
31 |
*
|
36 |
public function __construct($level = \DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Logger::DEBUG, $bubble = true)
|
37 |
{
|
38 |
if (!function_exists('zend_monitor_custom_event')) {
|
39 |
+
throw new \DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Handler\MissingExtensionException('You must have Zend Server installed with Zend Monitor enabled in order to use this handler');
|
40 |
}
|
41 |
+
//zend monitor constants are not defined if zend monitor is not enabled.
|
42 |
+
$this->levelMap = array(\DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Logger::DEBUG => \ZEND_MONITOR_EVENT_SEVERITY_INFO, \DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Logger::INFO => \ZEND_MONITOR_EVENT_SEVERITY_INFO, \DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Logger::NOTICE => \ZEND_MONITOR_EVENT_SEVERITY_INFO, \DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Logger::WARNING => \ZEND_MONITOR_EVENT_SEVERITY_WARNING, \DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Logger::ERROR => \ZEND_MONITOR_EVENT_SEVERITY_ERROR, \DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Logger::CRITICAL => \ZEND_MONITOR_EVENT_SEVERITY_ERROR, \DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Logger::ALERT => \ZEND_MONITOR_EVENT_SEVERITY_ERROR, \DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Logger::EMERGENCY => \ZEND_MONITOR_EVENT_SEVERITY_ERROR);
|
43 |
parent::__construct($level, $bubble);
|
44 |
}
|
45 |
/**
|
47 |
*/
|
48 |
protected function write(array $record)
|
49 |
{
|
50 |
+
$this->writeZendMonitorCustomEvent(\DeliciousBrains\WP_Offload_Media\Gcp\Monolog\Logger::getLevelName($record['level']), $record['message'], $record['formatted'], $this->levelMap[$record['level']]);
|
51 |
}
|
52 |
/**
|
53 |
+
* Write to Zend Monitor Events
|
54 |
+
* @param string $type Text displayed in "Class Name (custom)" field
|
55 |
+
* @param string $message Text displayed in "Error String"
|
56 |
+
* @param mixed $formatted Displayed in Custom Variables tab
|
57 |
+
* @param int $severity Set the event severity level (-1,0,1)
|
58 |
*/
|
59 |
+
protected function writeZendMonitorCustomEvent($type, $message, $formatted, $severity)
|
60 |
{
|
61 |
+
zend_monitor_custom_event($type, $message, $formatted, $severity);
|
62 |
}
|
63 |
/**
|
64 |
* {@inheritdoc}
|
@@ -81,7 +81,7 @@ class SignalHandler
|
|
81 |
}
|
82 |
if ($this->previousSignalHandler[$signo] === true || $this->previousSignalHandler[$signo] === SIG_DFL) {
|
83 |
if (extension_loaded('pcntl') && function_exists('pcntl_signal') && function_exists('pcntl_sigprocmask') && function_exists('pcntl_signal_dispatch') && extension_loaded('posix') && function_exists('posix_getpid') && function_exists('posix_kill')) {
|
84 |
-
$restartSyscalls = isset($this->
|
85 |
pcntl_signal($signo, SIG_DFL, $restartSyscalls);
|
86 |
pcntl_sigprocmask(SIG_UNBLOCK, array($signo), $oldset);
|
87 |
posix_kill(posix_getpid(), $signo);
|
81 |
}
|
82 |
if ($this->previousSignalHandler[$signo] === true || $this->previousSignalHandler[$signo] === SIG_DFL) {
|
83 |
if (extension_loaded('pcntl') && function_exists('pcntl_signal') && function_exists('pcntl_sigprocmask') && function_exists('pcntl_signal_dispatch') && extension_loaded('posix') && function_exists('posix_getpid') && function_exists('posix_kill')) {
|
84 |
+
$restartSyscalls = isset($this->signalRestartSyscalls[$signo]) ? $this->signalRestartSyscalls[$signo] : true;
|
85 |
pcntl_signal($signo, SIG_DFL, $restartSyscalls);
|
86 |
pcntl_sigprocmask(SIG_UNBLOCK, array($signo), $oldset);
|
87 |
posix_kill(posix_getpid(), $signo);
|
@@ -20,4 +20,118 @@ class Utils
|
|
20 |
$class = \get_class($object);
|
21 |
return 'c' === $class[0] && 0 === strpos($class, "class@anonymous\0") ? get_parent_class($class) . '@anonymous' : $class;
|
22 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
23 |
}
|
20 |
$class = \get_class($object);
|
21 |
return 'c' === $class[0] && 0 === strpos($class, "class@anonymous\0") ? get_parent_class($class) . '@anonymous' : $class;
|
22 |
}
|
23 |
+
/**
|
24 |
+
* Return the JSON representation of a value
|
25 |
+
*
|
26 |
+
* @param mixed $data
|
27 |
+
* @param int $encodeFlags flags to pass to json encode, defaults to JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE
|
28 |
+
* @param bool $ignoreErrors whether to ignore encoding errors or to throw on error, when ignored and the encoding fails, "null" is returned which is valid json for null
|
29 |
+
* @throws \RuntimeException if encoding fails and errors are not ignored
|
30 |
+
* @return string
|
31 |
+
*/
|
32 |
+
public static function jsonEncode($data, $encodeFlags = null, $ignoreErrors = false)
|
33 |
+
{
|
34 |
+
if (null === $encodeFlags && version_compare(PHP_VERSION, '5.4.0', '>=')) {
|
35 |
+
$encodeFlags = JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE;
|
36 |
+
}
|
37 |
+
if ($ignoreErrors) {
|
38 |
+
$json = @json_encode($data, $encodeFlags);
|
39 |
+
if (false === $json) {
|
40 |
+
return 'null';
|
41 |
+
}
|
42 |
+
return $json;
|
43 |
+
}
|
44 |
+
$json = json_encode($data, $encodeFlags);
|
45 |
+
if (false === $json) {
|
46 |
+
$json = self::handleJsonError(json_last_error(), $data);
|
47 |
+
}
|
48 |
+
return $json;
|
49 |
+
}
|
50 |
+
/**
|
51 |
+
* Handle a json_encode failure.
|
52 |
+
*
|
53 |
+
* If the failure is due to invalid string encoding, try to clean the
|
54 |
+
* input and encode again. If the second encoding attempt fails, the
|
55 |
+
* inital error is not encoding related or the input can't be cleaned then
|
56 |
+
* raise a descriptive exception.
|
57 |
+
*
|
58 |
+
* @param int $code return code of json_last_error function
|
59 |
+
* @param mixed $data data that was meant to be encoded
|
60 |
+
* @param int $encodeFlags flags to pass to json encode, defaults to JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE
|
61 |
+
* @throws \RuntimeException if failure can't be corrected
|
62 |
+
* @return string JSON encoded data after error correction
|
63 |
+
*/
|
64 |
+
public static function handleJsonError($code, $data, $encodeFlags = null)
|
65 |
+
{
|
66 |
+
if ($code !== JSON_ERROR_UTF8) {
|
67 |
+
self::throwEncodeError($code, $data);
|
68 |
+
}
|
69 |
+
if (is_string($data)) {
|
70 |
+
self::detectAndCleanUtf8($data);
|
71 |
+
} elseif (is_array($data)) {
|
72 |
+
array_walk_recursive($data, array('DeliciousBrains\\WP_Offload_Media\\Gcp\\Monolog\\Utils', 'detectAndCleanUtf8'));
|
73 |
+
} else {
|
74 |
+
self::throwEncodeError($code, $data);
|
75 |
+
}
|
76 |
+
if (null === $encodeFlags && version_compare(PHP_VERSION, '5.4.0', '>=')) {
|
77 |
+
$encodeFlags = JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE;
|
78 |
+
}
|
79 |
+
$json = json_encode($data, $encodeFlags);
|
80 |
+
if ($json === false) {
|
81 |
+
self::throwEncodeError(json_last_error(), $data);
|
82 |
+
}
|
83 |
+
return $json;
|
84 |
+
}
|
85 |
+
/**
|
86 |
+
* Throws an exception according to a given code with a customized message
|
87 |
+
*
|
88 |
+
* @param int $code return code of json_last_error function
|
89 |
+
* @param mixed $data data that was meant to be encoded
|
90 |
+
* @throws \RuntimeException
|
91 |
+
*/
|
92 |
+
private static function throwEncodeError($code, $data)
|
93 |
+
{
|
94 |
+
switch ($code) {
|
95 |
+
case JSON_ERROR_DEPTH:
|
96 |
+
$msg = 'Maximum stack depth exceeded';
|
97 |
+
break;
|
98 |
+
case JSON_ERROR_STATE_MISMATCH:
|
99 |
+
$msg = 'Underflow or the modes mismatch';
|
100 |
+
break;
|
101 |
+
case JSON_ERROR_CTRL_CHAR:
|
102 |
+
$msg = 'Unexpected control character found';
|
103 |
+
break;
|
104 |
+
case JSON_ERROR_UTF8:
|
105 |
+
$msg = 'Malformed UTF-8 characters, possibly incorrectly encoded';
|
106 |
+
break;
|
107 |
+
default:
|
108 |
+
$msg = 'Unknown error';
|
109 |
+
}
|
110 |
+
throw new \RuntimeException('JSON encoding failed: ' . $msg . '. Encoding: ' . var_export($data, true));
|
111 |
+
}
|
112 |
+
/**
|
113 |
+
* Detect invalid UTF-8 string characters and convert to valid UTF-8.
|
114 |
+
*
|
115 |
+
* Valid UTF-8 input will be left unmodified, but strings containing
|
116 |
+
* invalid UTF-8 codepoints will be reencoded as UTF-8 with an assumed
|
117 |
+
* original encoding of ISO-8859-15. This conversion may result in
|
118 |
+
* incorrect output if the actual encoding was not ISO-8859-15, but it
|
119 |
+
* will be clean UTF-8 output and will not rely on expensive and fragile
|
120 |
+
* detection algorithms.
|
121 |
+
*
|
122 |
+
* Function converts the input in place in the passed variable so that it
|
123 |
+
* can be used as a callback for array_walk_recursive.
|
124 |
+
*
|
125 |
+
* @param mixed &$data Input to check and convert if needed
|
126 |
+
* @private
|
127 |
+
*/
|
128 |
+
public static function detectAndCleanUtf8(&$data)
|
129 |
+
{
|
130 |
+
if (is_string($data) && !preg_match('//u', $data)) {
|
131 |
+
$data = preg_replace_callback('/[\\x80-\\xFF]+/', function ($m) {
|
132 |
+
return utf8_encode($m[0]);
|
133 |
+
}, $data);
|
134 |
+
$data = str_replace(array('¤', '¦', '¨', '´', '¸', '¼', '½', '¾'), array('€', 'Š', 'š', 'Ž', 'ž', 'Œ', 'œ', 'Ÿ'), $data);
|
135 |
+
}
|
136 |
+
}
|
137 |
}
|
@@ -110,6 +110,8 @@ interface LoggerInterface
|
|
110 |
* @param array $context
|
111 |
*
|
112 |
* @return void
|
|
|
|
|
113 |
*/
|
114 |
public function log($level, $message, array $context = array());
|
115 |
}
|
110 |
* @param array $context
|
111 |
*
|
112 |
* @return void
|
113 |
+
*
|
114 |
+
* @throws \Psr\Log\InvalidArgumentException
|
115 |
*/
|
116 |
public function log($level, $message, array $context = array());
|
117 |
}
|
@@ -127,6 +127,8 @@ trait LoggerTrait
|
|
127 |
* @param array $context
|
128 |
*
|
129 |
* @return void
|
|
|
|
|
130 |
*/
|
131 |
public abstract function log($level, $message, array $context = array());
|
132 |
}
|
127 |
* @param array $context
|
128 |
*
|
129 |
* @return void
|
130 |
+
*
|
131 |
+
* @throws \Psr\Log\InvalidArgumentException
|
132 |
*/
|
133 |
public abstract function log($level, $message, array $context = array());
|
134 |
}
|
@@ -20,6 +20,8 @@ class NullLogger extends \DeliciousBrains\WP_Offload_Media\Gcp\Psr\Log\AbstractL
|
|
20 |
* @param array $context
|
21 |
*
|
22 |
* @return void
|
|
|
|
|
23 |
*/
|
24 |
public function log($level, $message, array $context = array())
|
25 |
{
|
20 |
* @param array $context
|
21 |
*
|
22 |
* @return void
|
23 |
+
*
|
24 |
+
* @throws \Psr\Log\InvalidArgumentException
|
25 |
*/
|
26 |
public function log($level, $message, array $context = array())
|
27 |
{
|
@@ -38,6 +38,12 @@ class Foo
|
|
38 |
if ($this->logger) {
|
39 |
$this->logger->info('Doing work');
|
40 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
41 |
|
42 |
// do something useful
|
43 |
}
|
38 |
if ($this->logger) {
|
39 |
$this->logger->info('Doing work');
|
40 |
}
|
41 |
+
|
42 |
+
try {
|
43 |
+
$this->doSomethingElse();
|
44 |
+
} catch (Exception $exception) {
|
45 |
+
$this->logger->error('Oh no!', array('exception' => $exception));
|
46 |
+
}
|
47 |
|
48 |
// do something useful
|
49 |
}
|
@@ -24,7 +24,7 @@
|
|
24 |
},
|
25 |
"extra": {
|
26 |
"branch-alias": {
|
27 |
-
"dev-master": "1.
|
28 |
}
|
29 |
}
|
30 |
}
|
24 |
},
|
25 |
"extra": {
|
26 |
"branch-alias": {
|
27 |
+
"dev-master": "1.1.x-dev"
|
28 |
}
|
29 |
}
|
30 |
}
|
@@ -14,6 +14,14 @@ This is a simple polyfill for [`getallheaders()`](http://www.php.net/manual/en/f
|
|
14 |
|
15 |
## Install
|
16 |
|
|
|
|
|
17 |
```
|
18 |
composer require ralouphie/getallheaders
|
19 |
```
|
|
|
|
|
|
|
|
|
|
|
|
14 |
|
15 |
## Install
|
16 |
|
17 |
+
For PHP version **`>= 5.6`**:
|
18 |
+
|
19 |
```
|
20 |
composer require ralouphie/getallheaders
|
21 |
```
|
22 |
+
|
23 |
+
For PHP version **`< 5.6`**:
|
24 |
+
|
25 |
+
```
|
26 |
+
composer require ralouphie/getallheaders "^2"
|
27 |
+
```
|
@@ -9,15 +9,20 @@
|
|
9 |
}
|
10 |
],
|
11 |
"require": {
|
12 |
-
"php": ">=5.
|
13 |
},
|
14 |
"require-dev": {
|
15 |
-
"phpunit\/phpunit": "
|
16 |
-
"
|
17 |
},
|
18 |
"autoload": {
|
19 |
"files": [
|
20 |
"src\/getallheaders.php"
|
21 |
]
|
|
|
|
|
|
|
|
|
|
|
22 |
}
|
23 |
}
|
9 |
}
|
10 |
],
|
11 |
"require": {
|
12 |
+
"php": ">=5.6"
|
13 |
},
|
14 |
"require-dev": {
|
15 |
+
"phpunit\/phpunit": "^5 || ^6.5",
|
16 |
+
"php-coveralls\/php-coveralls": "^2.1"
|
17 |
},
|
18 |
"autoload": {
|
19 |
"files": [
|
20 |
"src\/getallheaders.php"
|
21 |
]
|
22 |
+
},
|
23 |
+
"autoload-dev": {
|
24 |
+
"psr-4": {
|
25 |
+
"DeliciousBrains\\WP_Offload_Media\\Gcp\\getallheaders\\Tests\\": "tests\/"
|
26 |
+
}
|
27 |
}
|
28 |
}
|
@@ -1,22 +0,0 @@
|
|
1 |
-
<phpunit
|
2 |
-
bootstrap="vendor/autoload.php"
|
3 |
-
convertErrorsToExceptions="true"
|
4 |
-
convertNoticesToExceptions="true"
|
5 |
-
convertWarningsToExceptions="true"
|
6 |
-
strict="true">
|
7 |
-
|
8 |
-
<testsuite>
|
9 |
-
<directory>./tests</directory>
|
10 |
-
</testsuite>
|
11 |
-
|
12 |
-
<filter>
|
13 |
-
<whitelist>
|
14 |
-
<directory suffix=".php">src</directory>
|
15 |
-
</whitelist>
|
16 |
-
</filter>
|
17 |
-
|
18 |
-
<logging>
|
19 |
-
<log type="coverage-clover" target="build/logs/clover.xml"/>
|
20 |
-
</logging>
|
21 |
-
|
22 |
-
</phpunit>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -4,7 +4,7 @@ Plugin Name: WP Offload Media Lite
|
|
4 |
Plugin URI: http://wordpress.org/extend/plugins/amazon-s3-and-cloudfront/
|
5 |
Description: Automatically copies media uploads to Amazon S3, DigitalOcean Spaces or Google Cloud Storage for storage and delivery. Optionally configure Amazon CloudFront or another CDN for even faster delivery.
|
6 |
Author: Delicious Brains
|
7 |
-
Version: 2.3.
|
8 |
Author URI: https://deliciousbrains.com/
|
9 |
Network: True
|
10 |
Text Domain: amazon-s3-and-cloudfront
|
@@ -26,7 +26,7 @@ Domain Path: /languages/
|
|
26 |
// Then completely rewritten.
|
27 |
*/
|
28 |
|
29 |
-
$GLOBALS['aws_meta']['amazon-s3-and-cloudfront']['version'] = '2.3.
|
30 |
|
31 |
require_once dirname( __FILE__ ) . '/classes/as3cf-compatibility-check.php';
|
32 |
|
4 |
Plugin URI: http://wordpress.org/extend/plugins/amazon-s3-and-cloudfront/
|
5 |
Description: Automatically copies media uploads to Amazon S3, DigitalOcean Spaces or Google Cloud Storage for storage and delivery. Optionally configure Amazon CloudFront or another CDN for even faster delivery.
|
6 |
Author: Delicious Brains
|
7 |
+
Version: 2.3.2
|
8 |
Author URI: https://deliciousbrains.com/
|
9 |
Network: True
|
10 |
Text Domain: amazon-s3-and-cloudfront
|
26 |
// Then completely rewritten.
|
27 |
*/
|
28 |
|
29 |
+
$GLOBALS['aws_meta']['amazon-s3-and-cloudfront']['version'] = '2.3.2';
|
30 |
|
31 |
require_once dirname( __FILE__ ) . '/classes/as3cf-compatibility-check.php';
|
32 |
|