WP Mail SMTP by WPForms - Version 1.8.1

Version Description

  • 2019-12-13 =
  • Fixed: Revert Guzzle version to 6.4.1 because Sendinblue and Gmail mailers may experience issues under certain circumstances while sending emails (not all sites are affected).
  • Fixed: Make compatible the WordPress PhpMailer class inline attachments management with the Sendgrid API.
Download this release

Release Info

Developer slaFFik
Plugin Icon 128x128 WP Mail SMTP by WPForms
Version 1.8.1
Comparing to
See all releases

Code changes from version 1.8.0 to 1.8.1

Files changed (135) hide show
  1. assets/languages/wp-mail-smtp.pot +2 -2
  2. readme.txt +5 -1
  3. src/Providers/Sendgrid/Mailer.php +7 -5
  4. vendor/autoload.php +1 -1
  5. vendor/composer/autoload_psr4.php +0 -1
  6. vendor/composer/autoload_real.php +7 -7
  7. vendor/composer/autoload_static.php +5 -10
  8. vendor/google/apiclient-services/LICENSE +203 -203
  9. vendor/google/apiclient-services/src/Google/Service/Gmail.php +1219 -1219
  10. vendor/google/apiclient-services/src/Google/Service/Gmail/AutoForwarding.php +48 -48
  11. vendor/google/apiclient-services/src/Google/Service/Gmail/BatchDeleteMessagesRequest.php +31 -31
  12. vendor/google/apiclient-services/src/Google/Service/Gmail/BatchModifyMessagesRequest.php +49 -49
  13. vendor/google/apiclient-services/src/Google/Service/Gmail/Delegate.php +39 -39
  14. vendor/google/apiclient-services/src/Google/Service/Gmail/Draft.php +46 -46
  15. vendor/google/apiclient-services/src/Google/Service/Gmail/Filter.php +62 -62
  16. vendor/google/apiclient-services/src/Google/Service/Gmail/FilterAction.php +49 -49
  17. vendor/google/apiclient-services/src/Google/Service/Gmail/FilterCriteria.php +102 -102
  18. vendor/google/apiclient-services/src/Google/Service/Gmail/ForwardingAddress.php +39 -39
  19. vendor/google/apiclient-services/src/Google/Service/Gmail/History.php +111 -111
  20. vendor/google/apiclient-services/src/Google/Service/Gmail/HistoryLabelAdded.php +47 -47
  21. vendor/google/apiclient-services/src/Google/Service/Gmail/HistoryLabelRemoved.php +47 -47
  22. vendor/google/apiclient-services/src/Google/Service/Gmail/HistoryMessageAdded.php +37 -37
  23. vendor/google/apiclient-services/src/Google/Service/Gmail/HistoryMessageDeleted.php +37 -37
  24. vendor/google/apiclient-services/src/Google/Service/Gmail/ImapSettings.php +57 -57
  25. vendor/google/apiclient-services/src/Google/Service/Gmail/Label.php +118 -118
  26. vendor/google/apiclient-services/src/Google/Service/Gmail/LabelColor.php +39 -39
  27. vendor/google/apiclient-services/src/Google/Service/Gmail/LanguageSettings.php +30 -30
  28. vendor/google/apiclient-services/src/Google/Service/Gmail/ListDelegatesResponse.php +38 -38
  29. vendor/google/apiclient-services/src/Google/Service/Gmail/ListDraftsResponse.php +56 -56
  30. vendor/google/apiclient-services/src/Google/Service/Gmail/ListFiltersResponse.php +38 -38
  31. vendor/google/apiclient-services/src/Google/Service/Gmail/ListForwardingAddressesResponse.php +38 -38
  32. vendor/google/apiclient-services/src/Google/Service/Gmail/ListHistoryResponse.php +56 -56
  33. vendor/google/apiclient-services/src/Google/Service/Gmail/ListLabelsResponse.php +38 -38
  34. vendor/google/apiclient-services/src/Google/Service/Gmail/ListMessagesResponse.php +56 -56
  35. vendor/google/apiclient-services/src/Google/Service/Gmail/ListSendAsResponse.php +38 -38
  36. vendor/google/apiclient-services/src/Google/Service/Gmail/ListSmimeInfoResponse.php +38 -38
  37. vendor/google/apiclient-services/src/Google/Service/Gmail/ListThreadsResponse.php +56 -56
  38. vendor/google/apiclient-services/src/Google/Service/Gmail/Message.php +110 -110
  39. vendor/google/apiclient-services/src/Google/Service/Gmail/MessagePart.php +97 -97
  40. vendor/google/apiclient-services/src/Google/Service/Gmail/MessagePartBody.php +48 -48
  41. vendor/google/apiclient-services/src/Google/Service/Gmail/MessagePartHeader.php +39 -39
  42. vendor/google/apiclient-services/src/Google/Service/Gmail/ModifyMessageRequest.php +40 -40
  43. vendor/google/apiclient-services/src/Google/Service/Gmail/ModifyThreadRequest.php +40 -40
  44. vendor/google/apiclient-services/src/Google/Service/Gmail/PopSettings.php +39 -39
  45. vendor/google/apiclient-services/src/Google/Service/Gmail/Profile.php +57 -57
  46. vendor/google/apiclient-services/src/Google/Service/Gmail/Resource/Users.php +71 -71
  47. vendor/google/apiclient-services/src/Google/Service/Gmail/Resource/UsersDrafts.php +130 -130
  48. vendor/google/apiclient-services/src/Google/Service/Gmail/Resource/UsersHistory.php +61 -61
  49. vendor/google/apiclient-services/src/Google/Service/Gmail/Resource/UsersLabels.php +120 -120
  50. vendor/google/apiclient-services/src/Google/Service/Gmail/Resource/UsersMessages.php +229 -229
  51. vendor/google/apiclient-services/src/Google/Service/Gmail/Resource/UsersMessagesAttachments.php +44 -44
  52. vendor/google/apiclient-services/src/Google/Service/Gmail/Resource/UsersSettings.php +184 -184
  53. vendor/google/apiclient-services/src/Google/Service/Gmail/Resource/UsersSettingsDelegates.php +119 -119
  54. vendor/google/apiclient-services/src/Google/Service/Gmail/Resource/UsersSettingsFilters.php +86 -86
  55. vendor/google/apiclient-services/src/Google/Service/Gmail/Resource/UsersSettingsForwardingAddresses.php +97 -97
  56. vendor/google/apiclient-services/src/Google/Service/Gmail/Resource/UsersSettingsSendAs.php +162 -162
  57. vendor/google/apiclient-services/src/Google/Service/Gmail/Resource/UsersSettingsSendAsSmimeInfo.php +115 -115
  58. vendor/google/apiclient-services/src/Google/Service/Gmail/Resource/UsersThreads.php +135 -135
  59. vendor/google/apiclient-services/src/Google/Service/Gmail/SendAs.php +109 -109
  60. vendor/google/apiclient-services/src/Google/Service/Gmail/SmimeInfo.php +84 -84
  61. vendor/google/apiclient-services/src/Google/Service/Gmail/SmtpMsa.php +66 -66
  62. vendor/google/apiclient-services/src/Google/Service/Gmail/Thread.php +65 -65
  63. vendor/google/apiclient-services/src/Google/Service/Gmail/VacationSettings.php +93 -93
  64. vendor/google/apiclient-services/src/Google/Service/Gmail/WatchRequest.php +49 -49
  65. vendor/google/apiclient-services/src/Google/Service/Gmail/WatchResponse.php +39 -39
  66. vendor/guzzlehttp/guzzle/Dockerfile +18 -18
  67. vendor/guzzlehttp/guzzle/LICENSE +19 -19
  68. vendor/guzzlehttp/guzzle/phpstan-baseline.neon +0 -1412
  69. vendor/guzzlehttp/guzzle/src/Client.php +5 -114
  70. vendor/guzzlehttp/guzzle/src/ClientInterface.php +2 -5
  71. vendor/guzzlehttp/guzzle/src/Cookie/CookieJar.php +2 -4
  72. vendor/guzzlehttp/guzzle/src/Cookie/CookieJarInterface.php +3 -3
  73. vendor/guzzlehttp/guzzle/src/Cookie/FileCookieJar.php +91 -91
  74. vendor/guzzlehttp/guzzle/src/Cookie/SessionCookieJar.php +72 -72
  75. vendor/guzzlehttp/guzzle/src/Cookie/SetCookie.php +403 -403
  76. vendor/guzzlehttp/guzzle/src/Exception/BadResponseException.php +27 -27
  77. vendor/guzzlehttp/guzzle/src/Exception/ClientException.php +9 -9
  78. vendor/guzzlehttp/guzzle/src/Exception/ConnectException.php +37 -37
  79. vendor/guzzlehttp/guzzle/src/Exception/GuzzleException.php +23 -23
  80. vendor/guzzlehttp/guzzle/src/Exception/InvalidArgumentException.php +7 -7
  81. vendor/guzzlehttp/guzzle/src/Exception/RequestException.php +30 -5
  82. vendor/guzzlehttp/guzzle/src/Exception/SeekException.php +27 -27
  83. vendor/guzzlehttp/guzzle/src/Exception/ServerException.php +9 -9
  84. vendor/guzzlehttp/guzzle/src/Exception/TooManyRedirectsException.php +6 -6
  85. vendor/guzzlehttp/guzzle/src/Exception/TransferException.php +6 -6
  86. vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php +5 -10
  87. vendor/guzzlehttp/guzzle/src/Handler/CurlFactoryInterface.php +27 -27
  88. vendor/guzzlehttp/guzzle/src/Handler/CurlHandler.php +45 -45
  89. vendor/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php +2 -16
  90. vendor/guzzlehttp/guzzle/src/Handler/EasyHandle.php +92 -92
  91. vendor/guzzlehttp/guzzle/src/Handler/MockHandler.php +1 -6
  92. vendor/guzzlehttp/guzzle/src/Handler/Proxy.php +55 -55
  93. vendor/guzzlehttp/guzzle/src/Handler/StreamHandler.php +1 -1
  94. vendor/guzzlehttp/guzzle/src/HandlerStack.php +1 -5
  95. vendor/guzzlehttp/guzzle/src/MessageFormatter.php +0 -5
  96. vendor/guzzlehttp/guzzle/src/Middleware.php +254 -254
  97. vendor/guzzlehttp/guzzle/src/Pool.php +1 -10
  98. vendor/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php +0 -5
  99. vendor/guzzlehttp/guzzle/src/RedirectMiddleware.php +2 -14
  100. vendor/guzzlehttp/guzzle/src/RequestOptions.php +0 -8
  101. vendor/guzzlehttp/guzzle/src/RetryMiddleware.php +2 -15
  102. vendor/guzzlehttp/guzzle/src/TransferStats.php +6 -6
  103. vendor/guzzlehttp/guzzle/src/UriTemplate.php +237 -237
  104. vendor/guzzlehttp/guzzle/src/functions.php +1 -1
  105. vendor/guzzlehttp/guzzle/src/functions_include.php +6 -6
  106. vendor/monolog/monolog/src/Monolog/Formatter/FluentdFormatter.php +1 -3
  107. vendor/monolog/monolog/src/Monolog/Formatter/HtmlFormatter.php +2 -3
  108. vendor/monolog/monolog/src/Monolog/Formatter/JsonFormatter.php +2 -2
  109. vendor/monolog/monolog/src/Monolog/Formatter/LineFormatter.php +1 -1
  110. vendor/monolog/monolog/src/Monolog/Formatter/MongoDBFormatter.php +1 -1
  111. vendor/monolog/monolog/src/Monolog/Formatter/NormalizerFormatter.php +125 -4
  112. vendor/monolog/monolog/src/Monolog/Handler/BrowserConsoleHandler.php +4 -5
  113. vendor/monolog/monolog/src/Monolog/Handler/BufferHandler.php +0 -19
  114. vendor/monolog/monolog/src/Monolog/Handler/ChromePHPHandler.php +2 -3
  115. vendor/monolog/monolog/src/Monolog/Handler/CubeHandler.php +2 -3
  116. vendor/monolog/monolog/src/Monolog/Handler/FilterHandler.php +11 -41
  117. vendor/monolog/monolog/src/Monolog/Handler/FingersCrossedHandler.php +14 -44
  118. vendor/monolog/monolog/src/Monolog/Handler/FlowdockHandler.php +1 -2
  119. vendor/monolog/monolog/src/Monolog/Handler/IFTTTHandler.php +1 -2
  120. vendor/monolog/monolog/src/Monolog/Handler/NewRelicHandler.php +1 -2
  121. vendor/monolog/monolog/src/Monolog/Handler/PHPConsoleHandler.php +1 -2
  122. vendor/monolog/monolog/src/Monolog/Handler/SamplingHandler.php +11 -42
  123. vendor/monolog/monolog/src/Monolog/Handler/Slack/SlackRecord.php +2 -7
  124. vendor/monolog/monolog/src/Monolog/Handler/SlackHandler.php +1 -2
  125. vendor/monolog/monolog/src/Monolog/Handler/SlackWebhookHandler.php +1 -2
  126. vendor/monolog/monolog/src/Monolog/Utils.php +0 -134
  127. vendor/phpseclib/phpseclib/LICENSE +19 -19
  128. vendor/phpseclib/phpseclib/phpseclib/Crypt/AES.php +126 -126
  129. vendor/phpseclib/phpseclib/phpseclib/Crypt/RSA.php +3201 -3201
  130. vendor/phpseclib/phpseclib/phpseclib/Crypt/Random.php +274 -274
  131. vendor/phpseclib/phpseclib/phpseclib/Crypt/Rijndael.php +936 -936
  132. vendor/phpseclib/phpseclib/phpseclib/bootstrap.php +16 -16
  133. vendor/phpseclib/phpseclib/phpseclib/openssl.cnf +6 -6
  134. vendor/phpseclib/phpseclib/travis/code_coverage_id_rsa +0 -30
  135. wp_mail_smtp.php +2 -2
assets/languages/wp-mail-smtp.pot CHANGED
@@ -1,13 +1,13 @@
1
  msgid ""
2
  msgstr ""
3
- "Project-Id-Version: WP Mail SMTP 1.8.0\n"
4
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/wp-mail-smtp\n"
5
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
6
  "Language-Team: LANGUAGE <LL@li.org>\n"
7
  "MIME-Version: 1.0\n"
8
  "Content-Type: text/plain; charset=UTF-8\n"
9
  "Content-Transfer-Encoding: 8bit\n"
10
- "POT-Creation-Date: 2019-12-12T16:09:57+02:00\n"
11
  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
12
  "X-Generator: WP-CLI 2.2.0\n"
13
  "X-Domain: wp-mail-smtp\n"
1
  msgid ""
2
  msgstr ""
3
+ "Project-Id-Version: WP Mail SMTP 1.8.1\n"
4
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/wp-mail-smtp\n"
5
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
6
  "Language-Team: LANGUAGE <LL@li.org>\n"
7
  "MIME-Version: 1.0\n"
8
  "Content-Type: text/plain; charset=UTF-8\n"
9
  "Content-Transfer-Encoding: 8bit\n"
10
+ "POT-Creation-Date: 2019-12-13T13:37:05+02:00\n"
11
  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
12
  "X-Generator: WP-CLI 2.2.0\n"
13
  "X-Domain: wp-mail-smtp\n"
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: wpforms, jaredatch, smub, slaFFik
3
  Tags: smtp, wp mail smtp, wordpress smtp, gmail smtp, sendgrid smtp, mailgun smtp, mail, mailer, phpmailer, wp_mail, email, mailgun, sengrid, gmail, wp smtp
4
  Requires at least: 4.9
5
  Tested up to: 5.3
6
- Stable tag: 1.8.0
7
  Requires PHP: 5.3
8
 
9
  The most popular WordPress SMTP and PHP Mailer plugin. Trusted by over 1 million sites.
@@ -220,6 +220,10 @@ By all means please contact us to discuss features or options you'd like to see
220
 
221
  == Changelog ==
222
 
 
 
 
 
223
  = 1.8.0 - 2019-12-12 =
224
  * Added: New recommended mailer: Pepipost.
225
  * Added: "Suggest a Mailer" link in a list of mailers to send us your ideas about new ones.
3
  Tags: smtp, wp mail smtp, wordpress smtp, gmail smtp, sendgrid smtp, mailgun smtp, mail, mailer, phpmailer, wp_mail, email, mailgun, sengrid, gmail, wp smtp
4
  Requires at least: 4.9
5
  Tested up to: 5.3
6
+ Stable tag: 1.8.1
7
  Requires PHP: 5.3
8
 
9
  The most popular WordPress SMTP and PHP Mailer plugin. Trusted by over 1 million sites.
220
 
221
  == Changelog ==
222
 
223
+ = 1.8.1 - 2019-12-13 =
224
+ * Fixed: Revert Guzzle version to 6.4.1 because Sendinblue and Gmail mailers may experience issues under certain circumstances while sending emails (not all sites are affected).
225
+ * Fixed: Make compatible the WordPress PhpMailer class inline attachments management with the Sendgrid API.
226
+
227
  = 1.8.0 - 2019-12-12 =
228
  * Added: New recommended mailer: Pepipost.
229
  * Added: "Suggest a Mailer" link in a list of mailers to send us your ideas about new ones.
src/Providers/Sendgrid/Mailer.php CHANGED
@@ -273,12 +273,14 @@ class Mailer extends MailerAbstract {
273
  continue;
274
  }
275
 
 
 
276
  $data[] = array(
277
- 'content' => base64_encode( $file ),
278
- 'type' => $attachment[4],
279
- 'filename' => $attachment[2],
280
- 'disposition' => $attachment[6],
281
- 'content_id' => $attachment[7],
282
  );
283
  }
284
 
273
  continue;
274
  }
275
 
276
+ $filetype = str_replace( ';', '', trim( $attachment[4] ) );
277
+
278
  $data[] = array(
279
+ 'content' => base64_encode( $file ), // string, 1 character.
280
+ 'type' => $filetype, // string, no ;, no CRLF.
281
+ 'filename' => empty( $attachment[2] ) ? 'file-' . wp_hash( microtime() ) . '.' . $filetype : trim( $attachment[2] ), // required string, no CRLF.
282
+ 'disposition' => in_array( $attachment[6], array( 'inline', 'attachment' ), true ) ? $attachment[6] : 'attachment', // either inline or attachment.
283
+ 'content_id' => empty( $attachment[7] ) ? '' : trim( (string) $attachment[7] ), // string, no CRLF.
284
  );
285
  }
286
 
vendor/autoload.php CHANGED
@@ -4,4 +4,4 @@
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
- return ComposerAutoloaderInit84925637ca46a89b245a3fe4d9646ae4::getLoader();
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
+ return ComposerAutoloaderInit4589a9f05a03f0a29add21e0e493a064::getLoader();
vendor/composer/autoload_psr4.php CHANGED
@@ -7,7 +7,6 @@ $baseDir = dirname($vendorDir);
7
 
8
  return array(
9
  'phpseclib\\' => array($vendorDir . '/phpseclib/phpseclib/phpseclib'),
10
- 'Wikimedia\\Composer\\' => array($vendorDir . '/wikimedia/composer-merge-plugin/src'),
11
  'WPMailSMTP\\' => array($baseDir . '/src'),
12
  'SendinBlue\\Client\\' => array($vendorDir . '/sendinblue/api-v3-sdk/lib'),
13
  'Psr\\Log\\' => array($vendorDir . '/psr/log/Psr/Log'),
7
 
8
  return array(
9
  'phpseclib\\' => array($vendorDir . '/phpseclib/phpseclib/phpseclib'),
 
10
  'WPMailSMTP\\' => array($baseDir . '/src'),
11
  'SendinBlue\\Client\\' => array($vendorDir . '/sendinblue/api-v3-sdk/lib'),
12
  'Psr\\Log\\' => array($vendorDir . '/psr/log/Psr/Log'),
vendor/composer/autoload_real.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
- class ComposerAutoloaderInit84925637ca46a89b245a3fe4d9646ae4
6
  {
7
  private static $loader;
8
 
@@ -19,15 +19,15 @@ class ComposerAutoloaderInit84925637ca46a89b245a3fe4d9646ae4
19
  return self::$loader;
20
  }
21
 
22
- spl_autoload_register(array('ComposerAutoloaderInit84925637ca46a89b245a3fe4d9646ae4', 'loadClassLoader'), true, true);
23
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
- spl_autoload_unregister(array('ComposerAutoloaderInit84925637ca46a89b245a3fe4d9646ae4', 'loadClassLoader'));
25
 
26
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
27
  if ($useStaticLoader) {
28
  require_once __DIR__ . '/autoload_static.php';
29
 
30
- call_user_func(\Composer\Autoload\ComposerStaticInit84925637ca46a89b245a3fe4d9646ae4::getInitializer($loader));
31
  } else {
32
  $map = require __DIR__ . '/autoload_namespaces.php';
33
  foreach ($map as $namespace => $path) {
@@ -48,19 +48,19 @@ class ComposerAutoloaderInit84925637ca46a89b245a3fe4d9646ae4
48
  $loader->register(true);
49
 
50
  if ($useStaticLoader) {
51
- $includeFiles = Composer\Autoload\ComposerStaticInit84925637ca46a89b245a3fe4d9646ae4::$files;
52
  } else {
53
  $includeFiles = require __DIR__ . '/autoload_files.php';
54
  }
55
  foreach ($includeFiles as $fileIdentifier => $file) {
56
- composerRequire84925637ca46a89b245a3fe4d9646ae4($fileIdentifier, $file);
57
  }
58
 
59
  return $loader;
60
  }
61
  }
62
 
63
- function composerRequire84925637ca46a89b245a3fe4d9646ae4($fileIdentifier, $file)
64
  {
65
  if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
66
  require $file;
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
+ class ComposerAutoloaderInit4589a9f05a03f0a29add21e0e493a064
6
  {
7
  private static $loader;
8
 
19
  return self::$loader;
20
  }
21
 
22
+ spl_autoload_register(array('ComposerAutoloaderInit4589a9f05a03f0a29add21e0e493a064', 'loadClassLoader'), true, true);
23
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
+ spl_autoload_unregister(array('ComposerAutoloaderInit4589a9f05a03f0a29add21e0e493a064', 'loadClassLoader'));
25
 
26
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
27
  if ($useStaticLoader) {
28
  require_once __DIR__ . '/autoload_static.php';
29
 
30
+ call_user_func(\Composer\Autoload\ComposerStaticInit4589a9f05a03f0a29add21e0e493a064::getInitializer($loader));
31
  } else {
32
  $map = require __DIR__ . '/autoload_namespaces.php';
33
  foreach ($map as $namespace => $path) {
48
  $loader->register(true);
49
 
50
  if ($useStaticLoader) {
51
+ $includeFiles = Composer\Autoload\ComposerStaticInit4589a9f05a03f0a29add21e0e493a064::$files;
52
  } else {
53
  $includeFiles = require __DIR__ . '/autoload_files.php';
54
  }
55
  foreach ($includeFiles as $fileIdentifier => $file) {
56
+ composerRequire4589a9f05a03f0a29add21e0e493a064($fileIdentifier, $file);
57
  }
58
 
59
  return $loader;
60
  }
61
  }
62
 
63
+ function composerRequire4589a9f05a03f0a29add21e0e493a064($fileIdentifier, $file)
64
  {
65
  if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
66
  require $file;
vendor/composer/autoload_static.php CHANGED
@@ -4,7 +4,7 @@
4
 
5
  namespace Composer\Autoload;
6
 
7
- class ComposerStaticInit84925637ca46a89b245a3fe4d9646ae4
8
  {
9
  public static $files = array (
10
  '7b11c4dc42b3b3023073cb14e519683c' => __DIR__ . '/..' . '/ralouphie/getallheaders/src/getallheaders.php',
@@ -21,7 +21,6 @@ class ComposerStaticInit84925637ca46a89b245a3fe4d9646ae4
21
  ),
22
  'W' =>
23
  array (
24
- 'Wikimedia\\Composer\\' => 19,
25
  'WPMailSMTP\\' => 11,
26
  ),
27
  'S' =>
@@ -60,10 +59,6 @@ class ComposerStaticInit84925637ca46a89b245a3fe4d9646ae4
60
  array (
61
  0 => __DIR__ . '/..' . '/phpseclib/phpseclib/phpseclib',
62
  ),
63
- 'Wikimedia\\Composer\\' =>
64
- array (
65
- 0 => __DIR__ . '/..' . '/wikimedia/composer-merge-plugin/src',
66
- ),
67
  'WPMailSMTP\\' =>
68
  array (
69
  0 => __DIR__ . '/../..' . '/src',
@@ -136,10 +131,10 @@ class ComposerStaticInit84925637ca46a89b245a3fe4d9646ae4
136
  public static function getInitializer(ClassLoader $loader)
137
  {
138
  return \Closure::bind(function () use ($loader) {
139
- $loader->prefixLengthsPsr4 = ComposerStaticInit84925637ca46a89b245a3fe4d9646ae4::$prefixLengthsPsr4;
140
- $loader->prefixDirsPsr4 = ComposerStaticInit84925637ca46a89b245a3fe4d9646ae4::$prefixDirsPsr4;
141
- $loader->prefixesPsr0 = ComposerStaticInit84925637ca46a89b245a3fe4d9646ae4::$prefixesPsr0;
142
- $loader->classMap = ComposerStaticInit84925637ca46a89b245a3fe4d9646ae4::$classMap;
143
 
144
  }, null, ClassLoader::class);
145
  }
4
 
5
  namespace Composer\Autoload;
6
 
7
+ class ComposerStaticInit4589a9f05a03f0a29add21e0e493a064
8
  {
9
  public static $files = array (
10
  '7b11c4dc42b3b3023073cb14e519683c' => __DIR__ . '/..' . '/ralouphie/getallheaders/src/getallheaders.php',
21
  ),
22
  'W' =>
23
  array (
 
24
  'WPMailSMTP\\' => 11,
25
  ),
26
  'S' =>
59
  array (
60
  0 => __DIR__ . '/..' . '/phpseclib/phpseclib/phpseclib',
61
  ),
 
 
 
 
62
  'WPMailSMTP\\' =>
63
  array (
64
  0 => __DIR__ . '/../..' . '/src',
131
  public static function getInitializer(ClassLoader $loader)
132
  {
133
  return \Closure::bind(function () use ($loader) {
134
+ $loader->prefixLengthsPsr4 = ComposerStaticInit4589a9f05a03f0a29add21e0e493a064::$prefixLengthsPsr4;
135
+ $loader->prefixDirsPsr4 = ComposerStaticInit4589a9f05a03f0a29add21e0e493a064::$prefixDirsPsr4;
136
+ $loader->prefixesPsr0 = ComposerStaticInit4589a9f05a03f0a29add21e0e493a064::$prefixesPsr0;
137
+ $loader->classMap = ComposerStaticInit4589a9f05a03f0a29add21e0e493a064::$classMap;
138
 
139
  }, null, ClassLoader::class);
140
  }
vendor/google/apiclient-services/LICENSE CHANGED
@@ -1,203 +1,203 @@
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.
202
-
203
-
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.
202
+
203
+
vendor/google/apiclient-services/src/Google/Service/Gmail.php CHANGED
@@ -1,1219 +1,1219 @@
1
- <?php
2
- /*
3
- * Copyright 2014 Google Inc.
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6
- * use this file except in compliance with the License. You may obtain a copy of
7
- * the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
- * License for the specific language governing permissions and limitations under
15
- * the License.
16
- */
17
-
18
- /**
19
- * Service definition for Gmail (v1).
20
- *
21
- * <p>
22
- * Access Gmail mailboxes including sending user email.</p>
23
- *
24
- * <p>
25
- * For more information about this service, see the API
26
- * <a href="https://developers.google.com/gmail/api/" target="_blank">Documentation</a>
27
- * </p>
28
- *
29
- * @author Google, Inc.
30
- */
31
- class Google_Service_Gmail extends Google_Service
32
- {
33
- /** Read, compose, send, and permanently delete all your email from Gmail. */
34
- const MAIL_GOOGLE_COM =
35
- "https://mail.google.com/";
36
- /** Manage drafts and send emails. */
37
- const GMAIL_COMPOSE =
38
- "https://www.googleapis.com/auth/gmail.compose";
39
- /** Insert mail into your mailbox. */
40
- const GMAIL_INSERT =
41
- "https://www.googleapis.com/auth/gmail.insert";
42
- /** Manage mailbox labels. */
43
- const GMAIL_LABELS =
44
- "https://www.googleapis.com/auth/gmail.labels";
45
- /** View your email message metadata such as labels and headers, but not the email body. */
46
- const GMAIL_METADATA =
47
- "https://www.googleapis.com/auth/gmail.metadata";
48
- /** View and modify but not delete your email. */
49
- const GMAIL_MODIFY =
50
- "https://www.googleapis.com/auth/gmail.modify";
51
- /** View your email messages and settings. */
52
- const GMAIL_READONLY =
53
- "https://www.googleapis.com/auth/gmail.readonly";
54
- /** Send email on your behalf. */
55
- const GMAIL_SEND =
56
- "https://www.googleapis.com/auth/gmail.send";
57
- /** Manage your basic mail settings. */
58
- const GMAIL_SETTINGS_BASIC =
59
- "https://www.googleapis.com/auth/gmail.settings.basic";
60
- /** Manage your sensitive mail settings, including who can manage your mail. */
61
- const GMAIL_SETTINGS_SHARING =
62
- "https://www.googleapis.com/auth/gmail.settings.sharing";
63
-
64
- public $users;
65
- public $users_drafts;
66
- public $users_history;
67
- public $users_labels;
68
- public $users_messages;
69
- public $users_messages_attachments;
70
- public $users_settings;
71
- public $users_settings_delegates;
72
- public $users_settings_filters;
73
- public $users_settings_forwardingAddresses;
74
- public $users_settings_sendAs;
75
- public $users_settings_sendAs_smimeInfo;
76
- public $users_threads;
77
-
78
- /**
79
- * Constructs the internal representation of the Gmail service.
80
- *
81
- * @param Google_Client $client The client used to deliver requests.
82
- * @param string $rootUrl The root URL used for requests to the service.
83
- */
84
- public function __construct(Google_Client $client, $rootUrl = null)
85
- {
86
- parent::__construct($client);
87
- $this->rootUrl = $rootUrl ?: 'https://www.googleapis.com/';
88
- $this->servicePath = 'gmail/v1/users/';
89
- $this->batchPath = 'batch/gmail/v1';
90
- $this->version = 'v1';
91
- $this->serviceName = 'gmail';
92
-
93
- $this->users = new Google_Service_Gmail_Resource_Users(
94
- $this,
95
- $this->serviceName,
96
- 'users',
97
- array(
98
- 'methods' => array(
99
- 'getProfile' => array(
100
- 'path' => '{userId}/profile',
101
- 'httpMethod' => 'GET',
102
- 'parameters' => array(
103
- 'userId' => array(
104
- 'location' => 'path',
105
- 'type' => 'string',
106
- 'required' => true,
107
- ),
108
- ),
109
- ),'stop' => array(
110
- 'path' => '{userId}/stop',
111
- 'httpMethod' => 'POST',
112
- 'parameters' => array(
113
- 'userId' => array(
114
- 'location' => 'path',
115
- 'type' => 'string',
116
- 'required' => true,
117
- ),
118
- ),
119
- ),'watch' => array(
120
- 'path' => '{userId}/watch',
121
- 'httpMethod' => 'POST',
122
- 'parameters' => array(
123
- 'userId' => array(
124
- 'location' => 'path',
125
- 'type' => 'string',
126
- 'required' => true,
127
- ),
128
- ),
129
- ),
130
- )
131
- )
132
- );
133
- $this->users_drafts = new Google_Service_Gmail_Resource_UsersDrafts(
134
- $this,
135
- $this->serviceName,
136
- 'drafts',
137
- array(
138
- 'methods' => array(
139
- 'create' => array(
140
- 'path' => '{userId}/drafts',
141
- 'httpMethod' => 'POST',
142
- 'parameters' => array(
143
- 'userId' => array(
144
- 'location' => 'path',
145
- 'type' => 'string',
146
- 'required' => true,
147
- ),
148
- ),
149
- ),'delete' => array(
150
- 'path' => '{userId}/drafts/{id}',
151
- 'httpMethod' => 'DELETE',
152
- 'parameters' => array(
153
- 'userId' => array(
154
- 'location' => 'path',
155
- 'type' => 'string',
156
- 'required' => true,
157
- ),
158
- 'id' => array(
159
- 'location' => 'path',
160
- 'type' => 'string',
161
- 'required' => true,
162
- ),
163
- ),
164
- ),'get' => array(
165
- 'path' => '{userId}/drafts/{id}',
166
- 'httpMethod' => 'GET',
167
- 'parameters' => array(
168
- 'userId' => array(
169
- 'location' => 'path',
170
- 'type' => 'string',
171
- 'required' => true,
172
- ),
173
- 'id' => array(
174
- 'location' => 'path',
175
- 'type' => 'string',
176
- 'required' => true,
177
- ),
178
- 'format' => array(
179
- 'location' => 'query',
180
- 'type' => 'string',
181
- ),
182
- ),
183
- ),'list' => array(
184
- 'path' => '{userId}/drafts',
185
- 'httpMethod' => 'GET',
186
- 'parameters' => array(
187
- 'userId' => array(
188
- 'location' => 'path',
189
- 'type' => 'string',
190
- 'required' => true,
191
- ),
192
- 'includeSpamTrash' => array(
193
- 'location' => 'query',
194
- 'type' => 'boolean',
195
- ),
196
- 'maxResults' => array(
197
- 'location' => 'query',
198
- 'type' => 'integer',
199
- ),
200
- 'pageToken' => array(
201
- 'location' => 'query',
202
- 'type' => 'string',
203
- ),
204
- 'q' => array(
205
- 'location' => 'query',
206
- 'type' => 'string',
207
- ),
208
- ),
209
- ),'send' => array(
210
- 'path' => '{userId}/drafts/send',
211
- 'httpMethod' => 'POST',
212
- 'parameters' => array(
213
- 'userId' => array(
214
- 'location' => 'path',
215
- 'type' => 'string',
216
- 'required' => true,
217
- ),
218
- ),
219
- ),'update' => array(
220
- 'path' => '{userId}/drafts/{id}',
221
- 'httpMethod' => 'PUT',
222
- 'parameters' => array(
223
- 'userId' => array(
224
- 'location' => 'path',
225
- 'type' => 'string',
226
- 'required' => true,
227
- ),
228
- 'id' => array(
229
- 'location' => 'path',
230
- 'type' => 'string',
231
- 'required' => true,
232
- ),
233
- ),
234
- ),
235
- )
236
- )
237
- );
238
- $this->users_history = new Google_Service_Gmail_Resource_UsersHistory(
239
- $this,
240
- $this->serviceName,
241
- 'history',
242
- array(
243
- 'methods' => array(
244
- 'list' => array(
245
- 'path' => '{userId}/history',
246
- 'httpMethod' => 'GET',
247
- 'parameters' => array(
248
- 'userId' => array(
249
- 'location' => 'path',
250
- 'type' => 'string',
251
- 'required' => true,
252
- ),
253
- 'historyTypes' => array(
254
- 'location' => 'query',
255
- 'type' => 'string',
256
- 'repeated' => true,
257
- ),
258
- 'labelId' => array(
259
- 'location' => 'query',
260
- 'type' => 'string',
261
- ),
262
- 'maxResults' => array(
263
- 'location' => 'query',
264
- 'type' => 'integer',
265
- ),
266
- 'pageToken' => array(
267
- 'location' => 'query',
268
- 'type' => 'string',
269
- ),
270
- 'startHistoryId' => array(
271
- 'location' => 'query',
272
- 'type' => 'string',
273
- ),
274
- ),
275
- ),
276
- )
277
- )
278
- );
279
- $this->users_labels = new Google_Service_Gmail_Resource_UsersLabels(
280
- $this,
281
- $this->serviceName,
282
- 'labels',
283
- array(
284
- 'methods' => array(
285
- 'create' => array(
286
- 'path' => '{userId}/labels',
287
- 'httpMethod' => 'POST',
288
- 'parameters' => array(
289
- 'userId' => array(
290
- 'location' => 'path',
291
- 'type' => 'string',
292
- 'required' => true,
293
- ),
294
- ),
295
- ),'delete' => array(
296
- 'path' => '{userId}/labels/{id}',
297
- 'httpMethod' => 'DELETE',
298
- 'parameters' => array(
299
- 'userId' => array(
300
- 'location' => 'path',
301
- 'type' => 'string',
302
- 'required' => true,
303
- ),
304
- 'id' => array(
305
- 'location' => 'path',
306
- 'type' => 'string',
307
- 'required' => true,
308
- ),
309
- ),
310
- ),'get' => array(
311
- 'path' => '{userId}/labels/{id}',
312
- 'httpMethod' => 'GET',
313
- 'parameters' => array(
314
- 'userId' => array(
315
- 'location' => 'path',
316
- 'type' => 'string',
317
- 'required' => true,
318
- ),
319
- 'id' => array(
320
- 'location' => 'path',
321
- 'type' => 'string',
322
- 'required' => true,
323
- ),
324
- ),
325
- ),'list' => array(
326
- 'path' => '{userId}/labels',
327
- 'httpMethod' => 'GET',
328
- 'parameters' => array(
329
- 'userId' => array(
330
- 'location' => 'path',
331
- 'type' => 'string',
332
- 'required' => true,
333
- ),
334
- ),
335
- ),'patch' => array(
336
- 'path' => '{userId}/labels/{id}',
337
- 'httpMethod' => 'PATCH',
338
- 'parameters' => array(
339
- 'userId' => array(
340
- 'location' => 'path',
341
- 'type' => 'string',
342
- 'required' => true,
343
- ),
344
- 'id' => array(
345
- 'location' => 'path',
346
- 'type' => 'string',
347
- 'required' => true,
348
- ),
349
- ),
350
- ),'update' => array(
351
- 'path' => '{userId}/labels/{id}',
352
- 'httpMethod' => 'PUT',
353
- 'parameters' => array(
354
- 'userId' => array(
355
- 'location' => 'path',
356
- 'type' => 'string',
357
- 'required' => true,
358
- ),
359
- 'id' => array(
360
- 'location' => 'path',
361
- 'type' => 'string',
362
- 'required' => true,
363
- ),
364
- ),
365
- ),
366
- )
367
- )
368
- );
369
- $this->users_messages = new Google_Service_Gmail_Resource_UsersMessages(
370
- $this,
371
- $this->serviceName,
372
- 'messages',
373
- array(
374
- 'methods' => array(
375
- 'batchDelete' => array(
376
- 'path' => '{userId}/messages/batchDelete',
377
- 'httpMethod' => 'POST',
378
- 'parameters' => array(
379
- 'userId' => array(
380
- 'location' => 'path',
381
- 'type' => 'string',
382
- 'required' => true,
383
- ),
384
- ),
385
- ),'batchModify' => array(
386
- 'path' => '{userId}/messages/batchModify',
387
- 'httpMethod' => 'POST',
388
- 'parameters' => array(
389
- 'userId' => array(
390
- 'location' => 'path',
391
- 'type' => 'string',
392
- 'required' => true,
393
- ),
394
- ),
395
- ),'delete' => array(
396
- 'path' => '{userId}/messages/{id}',
397
- 'httpMethod' => 'DELETE',
398
- 'parameters' => array(
399
- 'userId' => array(
400
- 'location' => 'path',
401
- 'type' => 'string',
402
- 'required' => true,
403
- ),
404
- 'id' => array(
405
- 'location' => 'path',
406
- 'type' => 'string',
407
- 'required' => true,
408
- ),
409
- ),
410
- ),'get' => array(
411
- 'path' => '{userId}/messages/{id}',
412
- 'httpMethod' => 'GET',
413
- 'parameters' => array(
414
- 'userId' => array(
415
- 'location' => 'path',
416
- 'type' => 'string',
417
- 'required' => true,
418
- ),
419
- 'id' => array(
420
- 'location' => 'path',
421
- 'type' => 'string',
422
- 'required' => true,
423
- ),
424
- 'format' => array(
425
- 'location' => 'query',
426
- 'type' => 'string',
427
- ),
428
- 'metadataHeaders' => array(
429
- 'location' => 'query',
430
- 'type' => 'string',
431
- 'repeated' => true,
432
- ),
433
- ),
434
- ),'import' => array(
435
- 'path' => '{userId}/messages/import',
436
- 'httpMethod' => 'POST',
437
- 'parameters' => array(
438
- 'userId' => array(
439
- 'location' => 'path',
440
- 'type' => 'string',
441
- 'required' => true,
442
- ),
443
- 'deleted' => array(
444
- 'location' => 'query',
445
- 'type' => 'boolean',
446
- ),
447
- 'internalDateSource' => array(
448
- 'location' => 'query',
449
- 'type' => 'string',
450
- ),
451
- 'neverMarkSpam' => array(
452
- 'location' => 'query',
453
- 'type' => 'boolean',
454
- ),
455
- 'processForCalendar' => array(
456
- 'location' => 'query',
457
- 'type' => 'boolean',
458
- ),
459
- ),
460
- ),'insert' => array(
461
- 'path' => '{userId}/messages',
462
- 'httpMethod' => 'POST',
463
- 'parameters' => array(
464
- 'userId' => array(
465
- 'location' => 'path',
466
- 'type' => 'string',
467
- 'required' => true,
468
- ),
469
- 'deleted' => array(
470
- 'location' => 'query',
471
- 'type' => 'boolean',
472
- ),
473
- 'internalDateSource' => array(
474
- 'location' => 'query',
475
- 'type' => 'string',
476
- ),
477
- ),
478
- ),'list' => array(
479
- 'path' => '{userId}/messages',
480
- 'httpMethod' => 'GET',
481
- 'parameters' => array(
482
- 'userId' => array(
483
- 'location' => 'path',
484
- 'type' => 'string',
485
- 'required' => true,
486
- ),
487
- 'includeSpamTrash' => array(
488
- 'location' => 'query',
489
- 'type' => 'boolean',
490
- ),
491
- 'labelIds' => array(
492
- 'location' => 'query',
493
- 'type' => 'string',
494
- 'repeated' => true,
495
- ),
496
- 'maxResults' => array(
497
- 'location' => 'query',
498
- 'type' => 'integer',
499
- ),
500
- 'pageToken' => array(
501
- 'location' => 'query',
502
- 'type' => 'string',
503
- ),
504
- 'q' => array(
505
- 'location' => 'query',
506
- 'type' => 'string',
507
- ),
508
- ),
509
- ),'modify' => array(
510
- 'path' => '{userId}/messages/{id}/modify',
511
- 'httpMethod' => 'POST',
512
- 'parameters' => array(
513
- 'userId' => array(
514
- 'location' => 'path',
515
- 'type' => 'string',
516
- 'required' => true,
517
- ),
518
- 'id' => array(
519
- 'location' => 'path',
520
- 'type' => 'string',
521
- 'required' => true,
522
- ),
523
- ),
524
- ),'send' => array(
525
- 'path' => '{userId}/messages/send',
526
- 'httpMethod' => 'POST',
527
- 'parameters' => array(
528
- 'userId' => array(
529
- 'location' => 'path',
530
- 'type' => 'string',
531
- 'required' => true,
532
- ),
533
- ),
534
- ),'trash' => array(
535
- 'path' => '{userId}/messages/{id}/trash',
536
- 'httpMethod' => 'POST',
537
- 'parameters' => array(
538
- 'userId' => array(
539
- 'location' => 'path',
540
- 'type' => 'string',
541
- 'required' => true,
542
- ),
543
- 'id' => array(
544
- 'location' => 'path',
545
- 'type' => 'string',
546
- 'required' => true,
547
- ),
548
- ),
549
- ),'untrash' => array(
550
- 'path' => '{userId}/messages/{id}/untrash',
551
- 'httpMethod' => 'POST',
552
- 'parameters' => array(
553
- 'userId' => array(
554
- 'location' => 'path',
555
- 'type' => 'string',
556
- 'required' => true,
557
- ),
558
- 'id' => array(
559
- 'location' => 'path',
560
- 'type' => 'string',
561
- 'required' => true,
562
- ),
563
- ),
564
- ),
565
- )
566
- )
567
- );
568
- $this->users_messages_attachments = new Google_Service_Gmail_Resource_UsersMessagesAttachments(
569
- $this,
570
- $this->serviceName,
571
- 'attachments',
572
- array(
573
- 'methods' => array(
574
- 'get' => array(
575
- 'path' => '{userId}/messages/{messageId}/attachments/{id}',
576
- 'httpMethod' => 'GET',
577
- 'parameters' => array(
578
- 'userId' => array(
579
- 'location' => 'path',
580
- 'type' => 'string',
581
- 'required' => true,
582
- ),
583
- 'messageId' => array(
584
- 'location' => 'path',
585
- 'type' => 'string',
586
- 'required' => true,
587
- ),
588
- 'id' => array(
589
- 'location' => 'path',
590
- 'type' => 'string',
591
- 'required' => true,
592
- ),
593
- ),
594
- ),
595
- )
596
- )
597
- );
598
- $this->users_settings = new Google_Service_Gmail_Resource_UsersSettings(
599
- $this,
600
- $this->serviceName,
601
- 'settings',
602
- array(
603
- 'methods' => array(
604
- 'getAutoForwarding' => array(
605
- 'path' => '{userId}/settings/autoForwarding',
606
- 'httpMethod' => 'GET',
607
- 'parameters' => array(
608
- 'userId' => array(
609
- 'location' => 'path',
610
- 'type' => 'string',
611
- 'required' => true,
612
- ),
613
- ),
614
- ),'getImap' => array(
615
- 'path' => '{userId}/settings/imap',
616
- 'httpMethod' => 'GET',
617
- 'parameters' => array(
618
- 'userId' => array(
619
- 'location' => 'path',
620
- 'type' => 'string',
621
- 'required' => true,
622
- ),
623
- ),
624
- ),'getLanguage' => array(
625
- 'path' => '{userId}/settings/language',
626
- 'httpMethod' => 'GET',
627
- 'parameters' => array(
628
- 'userId' => array(
629
- 'location' => 'path',
630
- 'type' => 'string',
631
- 'required' => true,
632
- ),
633
- ),
634
- ),'getPop' => array(
635
- 'path' => '{userId}/settings/pop',
636
- 'httpMethod' => 'GET',
637
- 'parameters' => array(
638
- 'userId' => array(
639
- 'location' => 'path',
640
- 'type' => 'string',
641
- 'required' => true,
642
- ),
643
- ),
644
- ),'getVacation' => array(
645
- 'path' => '{userId}/settings/vacation',
646
- 'httpMethod' => 'GET',
647
- 'parameters' => array(
648
- 'userId' => array(
649
- 'location' => 'path',
650
- 'type' => 'string',
651
- 'required' => true,
652
- ),
653
- ),
654
- ),'updateAutoForwarding' => array(
655
- 'path' => '{userId}/settings/autoForwarding',
656
- 'httpMethod' => 'PUT',
657
- 'parameters' => array(
658
- 'userId' => array(
659
- 'location' => 'path',
660
- 'type' => 'string',
661
- 'required' => true,
662
- ),
663
- ),
664
- ),'updateImap' => array(
665
- 'path' => '{userId}/settings/imap',
666
- 'httpMethod' => 'PUT',
667
- 'parameters' => array(
668
- 'userId' => array(
669
- 'location' => 'path',
670
- 'type' => 'string',
671
- 'required' => true,
672
- ),
673
- ),
674
- ),'updateLanguage' => array(
675
- 'path' => '{userId}/settings/language',
676
- 'httpMethod' => 'PUT',
677
- 'parameters' => array(
678
- 'userId' => array(
679
- 'location' => 'path',
680
- 'type' => 'string',
681
- 'required' => true,
682
- ),
683
- ),
684
- ),'updatePop' => array(
685
- 'path' => '{userId}/settings/pop',
686
- 'httpMethod' => 'PUT',
687
- 'parameters' => array(
688
- 'userId' => array(
689
- 'location' => 'path',
690
- 'type' => 'string',
691
- 'required' => true,
692
- ),
693
- ),
694
- ),'updateVacation' => array(
695
- 'path' => '{userId}/settings/vacation',
696
- 'httpMethod' => 'PUT',
697
- 'parameters' => array(
698
- 'userId' => array(
699
- 'location' => 'path',
700
- 'type' => 'string',
701
- 'required' => true,
702
- ),
703
- ),
704
- ),
705
- )
706
- )
707
- );
708
- $this->users_settings_delegates = new Google_Service_Gmail_Resource_UsersSettingsDelegates(
709
- $this,
710
- $this->serviceName,
711
- 'delegates',
712
- array(
713
- 'methods' => array(
714
- 'create' => array(
715
- 'path' => '{userId}/settings/delegates',
716
- 'httpMethod' => 'POST',
717
- 'parameters' => array(
718
- 'userId' => array(
719
- 'location' => 'path',
720
- 'type' => 'string',
721
- 'required' => true,
722
- ),
723
- ),
724
- ),'delete' => array(
725
- 'path' => '{userId}/settings/delegates/{delegateEmail}',
726
- 'httpMethod' => 'DELETE',
727
- 'parameters' => array(
728
- 'userId' => array(
729
- 'location' => 'path',
730
- 'type' => 'string',
731
- 'required' => true,
732
- ),
733
- 'delegateEmail' => array(
734
- 'location' => 'path',
735
- 'type' => 'string',
736
- 'required' => true,
737
- ),
738
- ),
739
- ),'get' => array(
740
- 'path' => '{userId}/settings/delegates/{delegateEmail}',
741
- 'httpMethod' => 'GET',
742
- 'parameters' => array(
743
- 'userId' => array(
744
- 'location' => 'path',
745
- 'type' => 'string',
746
- 'required' => true,
747
- ),
748
- 'delegateEmail' => array(
749
- 'location' => 'path',
750
- 'type' => 'string',
751
- 'required' => true,
752
- ),
753
- ),
754
- ),'list' => array(
755
- 'path' => '{userId}/settings/delegates',
756
- 'httpMethod' => 'GET',
757
- 'parameters' => array(
758
- 'userId' => array(
759
- 'location' => 'path',
760
- 'type' => 'string',
761
- 'required' => true,
762
- ),
763
- ),
764
- ),
765
- )
766
- )
767
- );
768
- $this->users_settings_filters = new Google_Service_Gmail_Resource_UsersSettingsFilters(
769
- $this,
770
- $this->serviceName,
771
- 'filters',
772
- array(
773
- 'methods' => array(
774
- 'create' => array(
775
- 'path' => '{userId}/settings/filters',
776
- 'httpMethod' => 'POST',
777
- 'parameters' => array(
778
- 'userId' => array(
779
- 'location' => 'path',
780
- 'type' => 'string',
781
- 'required' => true,
782
- ),
783
- ),
784
- ),'delete' => array(
785
- 'path' => '{userId}/settings/filters/{id}',
786
- 'httpMethod' => 'DELETE',
787
- 'parameters' => array(
788
- 'userId' => array(
789
- 'location' => 'path',
790
- 'type' => 'string',
791
- 'required' => true,
792
- ),
793
- 'id' => array(
794
- 'location' => 'path',
795
- 'type' => 'string',
796
- 'required' => true,
797
- ),
798
- ),
799
- ),'get' => array(
800
- 'path' => '{userId}/settings/filters/{id}',
801
- 'httpMethod' => 'GET',
802
- 'parameters' => array(
803
- 'userId' => array(
804
- 'location' => 'path',
805
- 'type' => 'string',
806
- 'required' => true,
807
- ),
808
- 'id' => array(
809
- 'location' => 'path',
810
- 'type' => 'string',
811
- 'required' => true,
812
- ),
813
- ),
814
- ),'list' => array(
815
- 'path' => '{userId}/settings/filters',
816
- 'httpMethod' => 'GET',
817
- 'parameters' => array(
818
- 'userId' => array(
819
- 'location' => 'path',
820
- 'type' => 'string',
821
- 'required' => true,
822
- ),
823
- ),
824
- ),
825
- )
826
- )
827
- );
828
- $this->users_settings_forwardingAddresses = new Google_Service_Gmail_Resource_UsersSettingsForwardingAddresses(
829
- $this,
830
- $this->serviceName,
831
- 'forwardingAddresses',
832
- array(
833
- 'methods' => array(
834
- 'create' => array(
835
- 'path' => '{userId}/settings/forwardingAddresses',
836
- 'httpMethod' => 'POST',
837
- 'parameters' => array(
838
- 'userId' => array(
839
- 'location' => 'path',
840
- 'type' => 'string',
841
- 'required' => true,
842
- ),
843
- ),
844
- ),'delete' => array(
845
- 'path' => '{userId}/settings/forwardingAddresses/{forwardingEmail}',
846
- 'httpMethod' => 'DELETE',
847
- 'parameters' => array(
848
- 'userId' => array(
849
- 'location' => 'path',
850
- 'type' => 'string',
851
- 'required' => true,
852
- ),
853
- 'forwardingEmail' => array(
854
- 'location' => 'path',
855
- 'type' => 'string',
856
- 'required' => true,
857
- ),
858
- ),
859
- ),'get' => array(
860
- 'path' => '{userId}/settings/forwardingAddresses/{forwardingEmail}',
861
- 'httpMethod' => 'GET',
862
- 'parameters' => array(
863
- 'userId' => array(
864
- 'location' => 'path',
865
- 'type' => 'string',
866
- 'required' => true,
867
- ),
868
- 'forwardingEmail' => array(
869
- 'location' => 'path',
870
- 'type' => 'string',
871
- 'required' => true,
872
- ),
873
- ),
874
- ),'list' => array(
875
- 'path' => '{userId}/settings/forwardingAddresses',
876
- 'httpMethod' => 'GET',
877
- 'parameters' => array(
878
- 'userId' => array(
879
- 'location' => 'path',
880
- 'type' => 'string',
881
- 'required' => true,
882
- ),
883
- ),
884
- ),
885
- )
886
- )
887
- );
888
- $this->users_settings_sendAs = new Google_Service_Gmail_Resource_UsersSettingsSendAs(
889
- $this,
890
- $this->serviceName,
891
- 'sendAs',
892
- array(
893
- 'methods' => array(
894
- 'create' => array(
895
- 'path' => '{userId}/settings/sendAs',
896
- 'httpMethod' => 'POST',
897
- 'parameters' => array(
898
- 'userId' => array(
899
- 'location' => 'path',
900
- 'type' => 'string',
901
- 'required' => true,
902
- ),
903
- ),
904
- ),'delete' => array(
905
- 'path' => '{userId}/settings/sendAs/{sendAsEmail}',
906
- 'httpMethod' => 'DELETE',
907
- 'parameters' => array(
908
- 'userId' => array(
909
- 'location' => 'path',
910
- 'type' => 'string',
911
- 'required' => true,
912
- ),
913
- 'sendAsEmail' => array(
914
- 'location' => 'path',
915
- 'type' => 'string',
916
- 'required' => true,
917
- ),
918
- ),
919
- ),'get' => array(
920
- 'path' => '{userId}/settings/sendAs/{sendAsEmail}',
921
- 'httpMethod' => 'GET',
922
- 'parameters' => array(
923
- 'userId' => array(
924
- 'location' => 'path',
925
- 'type' => 'string',
926
- 'required' => true,
927
- ),
928
- 'sendAsEmail' => array(
929
- 'location' => 'path',
930
- 'type' => 'string',
931
- 'required' => true,
932
- ),
933
- ),
934
- ),'list' => array(
935
- 'path' => '{userId}/settings/sendAs',
936
- 'httpMethod' => 'GET',
937
- 'parameters' => array(
938
- 'userId' => array(
939
- 'location' => 'path',
940
- 'type' => 'string',
941
- 'required' => true,
942
- ),
943
- ),
944
- ),'patch' => array(
945
- 'path' => '{userId}/settings/sendAs/{sendAsEmail}',
946
- 'httpMethod' => 'PATCH',
947
- 'parameters' => array(
948
- 'userId' => array(
949
- 'location' => 'path',
950
- 'type' => 'string',
951
- 'required' => true,
952
- ),
953
- 'sendAsEmail' => array(
954
- 'location' => 'path',
955
- 'type' => 'string',
956
- 'required' => true,
957
- ),
958
- ),
959
- ),'update' => array(
960
- 'path' => '{userId}/settings/sendAs/{sendAsEmail}',
961
- 'httpMethod' => 'PUT',
962
- 'parameters' => array(
963
- 'userId' => array(
964
- 'location' => 'path',
965
- 'type' => 'string',
966
- 'required' => true,
967
- ),
968
- 'sendAsEmail' => array(
969
- 'location' => 'path',
970
- 'type' => 'string',
971
- 'required' => true,
972
- ),
973
- ),
974
- ),'verify' => array(
975
- 'path' => '{userId}/settings/sendAs/{sendAsEmail}/verify',
976
- 'httpMethod' => 'POST',
977
- 'parameters' => array(
978
- 'userId' => array(
979
- 'location' => 'path',
980
- 'type' => 'string',
981
- 'required' => true,
982
- ),
983
- 'sendAsEmail' => array(
984
- 'location' => 'path',
985
- 'type' => 'string',
986
- 'required' => true,
987
- ),
988
- ),
989
- ),
990
- )
991
- )
992
- );
993
- $this->users_settings_sendAs_smimeInfo = new Google_Service_Gmail_Resource_UsersSettingsSendAsSmimeInfo(
994
- $this,
995
- $this->serviceName,
996
- 'smimeInfo',
997
- array(
998
- 'methods' => array(
999
- 'delete' => array(
1000
- 'path' => '{userId}/settings/sendAs/{sendAsEmail}/smimeInfo/{id}',
1001
- 'httpMethod' => 'DELETE',
1002
- 'parameters' => array(
1003
- 'userId' => array(
1004
- 'location' => 'path',
1005
- 'type' => 'string',
1006
- 'required' => true,
1007
- ),
1008
- 'sendAsEmail' => array(
1009
- 'location' => 'path',
1010
- 'type' => 'string',
1011
- 'required' => true,
1012
- ),
1013
- 'id' => array(
1014
- 'location' => 'path',
1015
- 'type' => 'string',
1016
- 'required' => true,
1017
- ),
1018
- ),
1019
- ),'get' => array(
1020
- 'path' => '{userId}/settings/sendAs/{sendAsEmail}/smimeInfo/{id}',
1021
- 'httpMethod' => 'GET',
1022
- 'parameters' => array(
1023
- 'userId' => array(
1024
- 'location' => 'path',
1025
- 'type' => 'string',
1026
- 'required' => true,
1027
- ),
1028
- 'sendAsEmail' => array(
1029
- 'location' => 'path',
1030
- 'type' => 'string',
1031
- 'required' => true,
1032
- ),
1033
- 'id' => array(
1034
- 'location' => 'path',
1035
- 'type' => 'string',
1036
- 'required' => true,
1037
- ),
1038
- ),
1039
- ),'insert' => array(
1040
- 'path' => '{userId}/settings/sendAs/{sendAsEmail}/smimeInfo',
1041
- 'httpMethod' => 'POST',
1042
- 'parameters' => array(
1043
- 'userId' => array(
1044
- 'location' => 'path',
1045
- 'type' => 'string',
1046
- 'required' => true,
1047
- ),
1048
- 'sendAsEmail' => array(
1049
- 'location' => 'path',
1050
- 'type' => 'string',
1051
- 'required' => true,
1052
- ),
1053
- ),
1054
- ),'list' => array(
1055
- 'path' => '{userId}/settings/sendAs/{sendAsEmail}/smimeInfo',
1056
- 'httpMethod' => 'GET',
1057
- 'parameters' => array(
1058
- 'userId' => array(
1059
- 'location' => 'path',
1060
- 'type' => 'string',
1061
- 'required' => true,
1062
- ),
1063
- 'sendAsEmail' => array(
1064
- 'location' => 'path',
1065
- 'type' => 'string',
1066
- 'required' => true,
1067
- ),
1068
- ),
1069
- ),'setDefault' => array(
1070
- 'path' => '{userId}/settings/sendAs/{sendAsEmail}/smimeInfo/{id}/setDefault',
1071
- 'httpMethod' => 'POST',
1072
- 'parameters' => array(
1073
- 'userId' => array(
1074
- 'location' => 'path',
1075
- 'type' => 'string',
1076
- 'required' => true,
1077
- ),
1078
- 'sendAsEmail' => array(
1079
- 'location' => 'path',
1080
- 'type' => 'string',
1081
- 'required' => true,
1082
- ),
1083
- 'id' => array(
1084
- 'location' => 'path',
1085
- 'type' => 'string',
1086
- 'required' => true,
1087
- ),
1088
- ),
1089
- ),
1090
- )
1091
- )
1092
- );
1093
- $this->users_threads = new Google_Service_Gmail_Resource_UsersThreads(
1094
- $this,
1095
- $this->serviceName,
1096
- 'threads',
1097
- array(
1098
- 'methods' => array(
1099
- 'delete' => array(
1100
- 'path' => '{userId}/threads/{id}',
1101
- 'httpMethod' => 'DELETE',
1102
- 'parameters' => array(
1103
- 'userId' => array(
1104
- 'location' => 'path',
1105
- 'type' => 'string',
1106
- 'required' => true,
1107
- ),
1108
- 'id' => array(
1109
- 'location' => 'path',
1110
- 'type' => 'string',
1111
- 'required' => true,
1112
- ),
1113
- ),
1114
- ),'get' => array(
1115
- 'path' => '{userId}/threads/{id}',
1116
- 'httpMethod' => 'GET',
1117
- 'parameters' => array(
1118
- 'userId' => array(
1119
- 'location' => 'path',
1120
- 'type' => 'string',
1121
- 'required' => true,
1122
- ),
1123
- 'id' => array(
1124
- 'location' => 'path',
1125
- 'type' => 'string',
1126
- 'required' => true,
1127
- ),
1128
- 'format' => array(
1129
- 'location' => 'query',
1130
- 'type' => 'string',
1131
- ),
1132
- 'metadataHeaders' => array(
1133
- 'location' => 'query',
1134
- 'type' => 'string',
1135
- 'repeated' => true,
1136
- ),
1137
- ),
1138
- ),'list' => array(
1139
- 'path' => '{userId}/threads',
1140
- 'httpMethod' => 'GET',
1141
- 'parameters' => array(
1142
- 'userId' => array(
1143
- 'location' => 'path',
1144
- 'type' => 'string',
1145
- 'required' => true,
1146
- ),
1147
- 'includeSpamTrash' => array(
1148
- 'location' => 'query',
1149
- 'type' => 'boolean',
1150
- ),
1151
- 'labelIds' => array(
1152
- 'location' => 'query',
1153
- 'type' => 'string',
1154
- 'repeated' => true,
1155
- ),
1156
- 'maxResults' => array(
1157
- 'location' => 'query',
1158
- 'type' => 'integer',
1159
- ),
1160
- 'pageToken' => array(
1161
- 'location' => 'query',
1162
- 'type' => 'string',
1163
- ),
1164
- 'q' => array(
1165
- 'location' => 'query',
1166
- 'type' => 'string',
1167
- ),
1168
- ),
1169
- ),'modify' => array(
1170
- 'path' => '{userId}/threads/{id}/modify',
1171
- 'httpMethod' => 'POST',
1172
- 'parameters' => array(
1173
- 'userId' => array(
1174
- 'location' => 'path',
1175
- 'type' => 'string',
1176
- 'required' => true,
1177
- ),
1178
- 'id' => array(
1179
- 'location' => 'path',
1180
- 'type' => 'string',
1181
- 'required' => true,
1182
- ),
1183
- ),
1184
- ),'trash' => array(
1185
- 'path' => '{userId}/threads/{id}/trash',
1186
- 'httpMethod' => 'POST',
1187
- 'parameters' => array(
1188
- 'userId' => array(
1189
- 'location' => 'path',
1190
- 'type' => 'string',
1191
- 'required' => true,
1192
- ),
1193
- 'id' => array(
1194
- 'location' => 'path',
1195
- 'type' => 'string',
1196
- 'required' => true,
1197
- ),
1198
- ),
1199
- ),'untrash' => array(
1200
- 'path' => '{userId}/threads/{id}/untrash',
1201
- 'httpMethod' => 'POST',
1202
- 'parameters' => array(
1203
- 'userId' => array(
1204
- 'location' => 'path',
1205
- 'type' => 'string',
1206
- 'required' => true,
1207
- ),
1208
- 'id' => array(
1209
- 'location' => 'path',
1210
- 'type' => 'string',
1211
- 'required' => true,
1212
- ),
1213
- ),
1214
- ),
1215
- )
1216
- )
1217
- );
1218
- }
1219
- }
1
+ <?php
2
+ /*
3
+ * Copyright 2014 Google Inc.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6
+ * use this file except in compliance with the License. You may obtain a copy of
7
+ * the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
+ * License for the specific language governing permissions and limitations under
15
+ * the License.
16
+ */
17
+
18
+ /**
19
+ * Service definition for Gmail (v1).
20
+ *
21
+ * <p>
22
+ * Access Gmail mailboxes including sending user email.</p>
23
+ *
24
+ * <p>
25
+ * For more information about this service, see the API
26
+ * <a href="https://developers.google.com/gmail/api/" target="_blank">Documentation</a>
27
+ * </p>
28
+ *
29
+ * @author Google, Inc.
30
+ */
31
+ class Google_Service_Gmail extends Google_Service
32
+ {
33
+ /** Read, compose, send, and permanently delete all your email from Gmail. */
34
+ const MAIL_GOOGLE_COM =
35
+ "https://mail.google.com/";
36
+ /** Manage drafts and send emails. */
37
+ const GMAIL_COMPOSE =
38
+ "https://www.googleapis.com/auth/gmail.compose";
39
+ /** Insert mail into your mailbox. */
40
+ const GMAIL_INSERT =
41
+ "https://www.googleapis.com/auth/gmail.insert";
42
+ /** Manage mailbox labels. */
43
+ const GMAIL_LABELS =
44
+ "https://www.googleapis.com/auth/gmail.labels";
45
+ /** View your email message metadata such as labels and headers, but not the email body. */
46
+ const GMAIL_METADATA =
47
+ "https://www.googleapis.com/auth/gmail.metadata";
48
+ /** View and modify but not delete your email. */
49
+ const GMAIL_MODIFY =
50
+ "https://www.googleapis.com/auth/gmail.modify";
51
+ /** View your email messages and settings. */
52
+ const GMAIL_READONLY =
53
+ "https://www.googleapis.com/auth/gmail.readonly";
54
+ /** Send email on your behalf. */
55
+ const GMAIL_SEND =
56
+ "https://www.googleapis.com/auth/gmail.send";
57
+ /** Manage your basic mail settings. */
58
+ const GMAIL_SETTINGS_BASIC =
59
+ "https://www.googleapis.com/auth/gmail.settings.basic";
60
+ /** Manage your sensitive mail settings, including who can manage your mail. */
61
+ const GMAIL_SETTINGS_SHARING =
62
+ "https://www.googleapis.com/auth/gmail.settings.sharing";
63
+
64
+ public $users;
65
+ public $users_drafts;
66
+ public $users_history;
67
+ public $users_labels;
68
+ public $users_messages;
69
+ public $users_messages_attachments;
70
+ public $users_settings;
71
+ public $users_settings_delegates;
72
+ public $users_settings_filters;
73
+ public $users_settings_forwardingAddresses;
74
+ public $users_settings_sendAs;
75
+ public $users_settings_sendAs_smimeInfo;
76
+ public $users_threads;
77
+
78
+ /**
79
+ * Constructs the internal representation of the Gmail service.
80
+ *
81
+ * @param Google_Client $client The client used to deliver requests.
82
+ * @param string $rootUrl The root URL used for requests to the service.
83
+ */
84
+ public function __construct(Google_Client $client, $rootUrl = null)
85
+ {
86
+ parent::__construct($client);
87
+ $this->rootUrl = $rootUrl ?: 'https://www.googleapis.com/';
88
+ $this->servicePath = 'gmail/v1/users/';
89
+ $this->batchPath = 'batch/gmail/v1';
90
+ $this->version = 'v1';
91
+ $this->serviceName = 'gmail';
92
+
93
+ $this->users = new Google_Service_Gmail_Resource_Users(
94
+ $this,
95
+ $this->serviceName,
96
+ 'users',
97
+ array(
98
+ 'methods' => array(
99
+ 'getProfile' => array(
100
+ 'path' => '{userId}/profile',
101
+ 'httpMethod' => 'GET',
102
+ 'parameters' => array(
103
+ 'userId' => array(
104
+ 'location' => 'path',
105
+ 'type' => 'string',
106
+ 'required' => true,
107
+ ),
108
+ ),
109
+ ),'stop' => array(
110
+ 'path' => '{userId}/stop',
111
+ 'httpMethod' => 'POST',
112
+ 'parameters' => array(
113
+ 'userId' => array(
114
+ 'location' => 'path',
115
+ 'type' => 'string',
116
+ 'required' => true,
117
+ ),
118
+ ),
119
+ ),'watch' => array(
120
+ 'path' => '{userId}/watch',
121
+ 'httpMethod' => 'POST',
122
+ 'parameters' => array(
123
+ 'userId' => array(
124
+ 'location' => 'path',
125
+ 'type' => 'string',
126
+ 'required' => true,
127
+ ),
128
+ ),
129
+ ),
130
+ )
131
+ )
132
+ );
133
+ $this->users_drafts = new Google_Service_Gmail_Resource_UsersDrafts(
134
+ $this,
135
+ $this->serviceName,
136
+ 'drafts',
137
+ array(
138
+ 'methods' => array(
139
+ 'create' => array(
140
+ 'path' => '{userId}/drafts',
141
+ 'httpMethod' => 'POST',
142
+ 'parameters' => array(
143
+ 'userId' => array(
144
+ 'location' => 'path',
145
+ 'type' => 'string',
146
+ 'required' => true,
147
+ ),
148
+ ),
149
+ ),'delete' => array(
150
+ 'path' => '{userId}/drafts/{id}',
151
+ 'httpMethod' => 'DELETE',
152
+ 'parameters' => array(
153
+ 'userId' => array(
154
+ 'location' => 'path',
155
+ 'type' => 'string',
156
+ 'required' => true,
157
+ ),
158
+ 'id' => array(
159
+ 'location' => 'path',
160
+ 'type' => 'string',
161
+ 'required' => true,
162
+ ),
163
+ ),
164
+ ),'get' => array(
165
+ 'path' => '{userId}/drafts/{id}',
166
+ 'httpMethod' => 'GET',
167
+ 'parameters' => array(
168
+ 'userId' => array(
169
+ 'location' => 'path',
170
+ 'type' => 'string',
171
+ 'required' => true,
172
+ ),
173
+ 'id' => array(
174
+ 'location' => 'path',
175
+ 'type' => 'string',
176
+ 'required' => true,
177
+ ),
178
+ 'format' => array(
179
+ 'location' => 'query',
180
+ 'type' => 'string',
181
+ ),
182
+ ),
183
+ ),'list' => array(
184
+ 'path' => '{userId}/drafts',
185
+ 'httpMethod' => 'GET',
186
+ 'parameters' => array(
187
+ 'userId' => array(
188
+ 'location' => 'path',
189
+ 'type' => 'string',
190
+ 'required' => true,
191
+ ),
192
+ 'includeSpamTrash' => array(
193
+ 'location' => 'query',
194
+ 'type' => 'boolean',
195
+ ),
196
+ 'maxResults' => array(
197
+ 'location' => 'query',
198
+ 'type' => 'integer',
199
+ ),
200
+ 'pageToken' => array(
201
+ 'location' => 'query',
202
+ 'type' => 'string',
203
+ ),
204
+ 'q' => array(
205
+ 'location' => 'query',
206
+ 'type' => 'string',
207
+ ),
208
+ ),
209
+ ),'send' => array(
210
+ 'path' => '{userId}/drafts/send',
211
+ 'httpMethod' => 'POST',
212
+ 'parameters' => array(
213
+ 'userId' => array(
214
+ 'location' => 'path',
215
+ 'type' => 'string',
216
+ 'required' => true,
217
+ ),
218
+ ),
219
+ ),'update' => array(
220
+ 'path' => '{userId}/drafts/{id}',
221
+ 'httpMethod' => 'PUT',
222
+ 'parameters' => array(
223
+ 'userId' => array(
224
+ 'location' => 'path',
225
+ 'type' => 'string',
226
+ 'required' => true,
227
+ ),
228
+ 'id' => array(
229
+ 'location' => 'path',
230
+ 'type' => 'string',
231
+ 'required' => true,
232
+ ),
233
+ ),
234
+ ),
235
+ )
236
+ )
237
+ );
238
+ $this->users_history = new Google_Service_Gmail_Resource_UsersHistory(
239
+ $this,
240
+ $this->serviceName,
241
+ 'history',
242
+ array(
243
+ 'methods' => array(
244
+ 'list' => array(
245
+ 'path' => '{userId}/history',
246
+ 'httpMethod' => 'GET',
247
+ 'parameters' => array(
248
+ 'userId' => array(
249
+ 'location' => 'path',
250
+ 'type' => 'string',
251
+ 'required' => true,
252
+ ),
253
+ 'historyTypes' => array(
254
+ 'location' => 'query',
255
+ 'type' => 'string',
256
+ 'repeated' => true,
257
+ ),
258
+ 'labelId' => array(
259
+ 'location' => 'query',
260
+ 'type' => 'string',
261
+ ),
262
+ 'maxResults' => array(
263
+ 'location' => 'query',
264
+ 'type' => 'integer',
265
+ ),
266
+ 'pageToken' => array(
267
+ 'location' => 'query',
268
+ 'type' => 'string',
269
+ ),
270
+ 'startHistoryId' => array(
271
+ 'location' => 'query',
272
+ 'type' => 'string',
273
+ ),
274
+ ),
275
+ ),
276
+ )
277
+ )
278
+ );
279
+ $this->users_labels = new Google_Service_Gmail_Resource_UsersLabels(
280
+ $this,
281
+ $this->serviceName,
282
+ 'labels',
283
+ array(
284
+ 'methods' => array(
285
+ 'create' => array(
286
+ 'path' => '{userId}/labels',
287
+ 'httpMethod' => 'POST',
288
+ 'parameters' => array(
289
+ 'userId' => array(
290
+ 'location' => 'path',
291
+ 'type' => 'string',
292
+ 'required' => true,
293
+ ),
294
+ ),
295
+ ),'delete' => array(
296
+ 'path' => '{userId}/labels/{id}',
297
+ 'httpMethod' => 'DELETE',
298
+ 'parameters' => array(
299
+ 'userId' => array(
300
+ 'location' => 'path',
301
+ 'type' => 'string',
302
+ 'required' => true,
303
+ ),
304
+ 'id' => array(
305
+ 'location' => 'path',
306
+ 'type' => 'string',
307
+ 'required' => true,
308
+ ),
309
+ ),
310
+ ),'get' => array(
311
+ 'path' => '{userId}/labels/{id}',
312
+ 'httpMethod' => 'GET',
313
+ 'parameters' => array(
314
+ 'userId' => array(
315
+ 'location' => 'path',
316
+ 'type' => 'string',
317
+ 'required' => true,
318
+ ),
319
+ 'id' => array(
320
+ 'location' => 'path',
321
+ 'type' => 'string',
322
+ 'required' => true,
323
+ ),
324
+ ),
325
+ ),'list' => array(
326
+ 'path' => '{userId}/labels',
327
+ 'httpMethod' => 'GET',
328
+ 'parameters' => array(
329
+ 'userId' => array(
330
+ 'location' => 'path',
331
+ 'type' => 'string',
332
+ 'required' => true,
333
+ ),
334
+ ),
335
+ ),'patch' => array(
336
+ 'path' => '{userId}/labels/{id}',
337
+ 'httpMethod' => 'PATCH',
338
+ 'parameters' => array(
339
+ 'userId' => array(
340
+ 'location' => 'path',
341
+ 'type' => 'string',
342
+ 'required' => true,
343
+ ),
344
+ 'id' => array(
345
+ 'location' => 'path',
346
+ 'type' => 'string',
347
+ 'required' => true,
348
+ ),
349
+ ),
350
+ ),'update' => array(
351
+ 'path' => '{userId}/labels/{id}',
352
+ 'httpMethod' => 'PUT',
353
+ 'parameters' => array(
354
+ 'userId' => array(
355
+ 'location' => 'path',
356
+ 'type' => 'string',
357
+ 'required' => true,
358
+ ),
359
+ 'id' => array(
360
+ 'location' => 'path',
361
+ 'type' => 'string',
362
+ 'required' => true,
363
+ ),
364
+ ),
365
+ ),
366
+ )
367
+ )
368
+ );
369
+ $this->users_messages = new Google_Service_Gmail_Resource_UsersMessages(
370
+ $this,
371
+ $this->serviceName,
372
+ 'messages',
373
+ array(
374
+ 'methods' => array(
375
+ 'batchDelete' => array(
376
+ 'path' => '{userId}/messages/batchDelete',
377
+ 'httpMethod' => 'POST',
378
+ 'parameters' => array(
379
+ 'userId' => array(
380
+ 'location' => 'path',
381
+ 'type' => 'string',
382
+ 'required' => true,
383
+ ),
384
+ ),
385
+ ),'batchModify' => array(
386
+ 'path' => '{userId}/messages/batchModify',
387
+ 'httpMethod' => 'POST',
388
+ 'parameters' => array(
389
+ 'userId' => array(
390
+ 'location' => 'path',
391
+ 'type' => 'string',
392
+ 'required' => true,
393
+ ),
394
+ ),
395
+ ),'delete' => array(
396
+ 'path' => '{userId}/messages/{id}',
397
+ 'httpMethod' => 'DELETE',
398
+ 'parameters' => array(
399
+ 'userId' => array(
400
+ 'location' => 'path',
401
+ 'type' => 'string',
402
+ 'required' => true,
403
+ ),
404
+ 'id' => array(
405
+ 'location' => 'path',
406
+ 'type' => 'string',
407
+ 'required' => true,
408
+ ),
409
+ ),
410
+ ),'get' => array(
411
+ 'path' => '{userId}/messages/{id}',
412
+ 'httpMethod' => 'GET',
413
+ 'parameters' => array(
414
+ 'userId' => array(
415
+ 'location' => 'path',
416
+ 'type' => 'string',
417
+ 'required' => true,
418
+ ),
419
+ 'id' => array(
420
+ 'location' => 'path',
421
+ 'type' => 'string',
422
+ 'required' => true,
423
+ ),
424
+ 'format' => array(
425
+ 'location' => 'query',
426
+ 'type' => 'string',
427
+ ),
428
+ 'metadataHeaders' => array(
429
+ 'location' => 'query',
430
+ 'type' => 'string',
431
+ 'repeated' => true,
432
+ ),
433
+ ),
434
+ ),'import' => array(
435
+ 'path' => '{userId}/messages/import',
436
+ 'httpMethod' => 'POST',
437
+ 'parameters' => array(
438
+ 'userId' => array(
439
+ 'location' => 'path',
440
+ 'type' => 'string',
441
+ 'required' => true,
442
+ ),
443
+ 'deleted' => array(
444
+ 'location' => 'query',
445
+ 'type' => 'boolean',
446
+ ),
447
+ 'internalDateSource' => array(
448
+ 'location' => 'query',
449
+ 'type' => 'string',
450
+ ),
451
+ 'neverMarkSpam' => array(
452
+ 'location' => 'query',
453
+ 'type' => 'boolean',
454
+ ),
455
+ 'processForCalendar' => array(
456
+ 'location' => 'query',
457
+ 'type' => 'boolean',
458
+ ),
459
+ ),
460
+ ),'insert' => array(
461
+ 'path' => '{userId}/messages',
462
+ 'httpMethod' => 'POST',
463
+ 'parameters' => array(
464
+ 'userId' => array(
465
+ 'location' => 'path',
466
+ 'type' => 'string',
467
+ 'required' => true,
468
+ ),
469
+ 'deleted' => array(
470
+ 'location' => 'query',
471
+ 'type' => 'boolean',
472
+ ),
473
+ 'internalDateSource' => array(
474
+ 'location' => 'query',
475
+ 'type' => 'string',
476
+ ),
477
+ ),
478
+ ),'list' => array(
479
+ 'path' => '{userId}/messages',
480
+ 'httpMethod' => 'GET',
481
+ 'parameters' => array(
482
+ 'userId' => array(
483
+ 'location' => 'path',
484
+ 'type' => 'string',
485
+ 'required' => true,
486
+ ),
487
+ 'includeSpamTrash' => array(
488
+ 'location' => 'query',
489
+ 'type' => 'boolean',
490
+ ),
491
+ 'labelIds' => array(
492
+ 'location' => 'query',
493
+ 'type' => 'string',
494
+ 'repeated' => true,
495
+ ),
496
+ 'maxResults' => array(
497
+ 'location' => 'query',
498
+ 'type' => 'integer',
499
+ ),
500
+ 'pageToken' => array(
501
+ 'location' => 'query',
502
+ 'type' => 'string',
503
+ ),
504
+ 'q' => array(
505
+ 'location' => 'query',
506
+ 'type' => 'string',
507
+ ),
508
+ ),
509
+ ),'modify' => array(
510
+ 'path' => '{userId}/messages/{id}/modify',
511
+ 'httpMethod' => 'POST',
512
+ 'parameters' => array(
513
+ 'userId' => array(
514
+ 'location' => 'path',
515
+ 'type' => 'string',
516
+ 'required' => true,
517
+ ),
518
+ 'id' => array(
519
+ 'location' => 'path',
520
+ 'type' => 'string',
521
+ 'required' => true,
522
+ ),
523
+ ),
524
+ ),'send' => array(
525
+ 'path' => '{userId}/messages/send',
526
+ 'httpMethod' => 'POST',
527
+ 'parameters' => array(
528
+ 'userId' => array(
529
+ 'location' => 'path',
530
+ 'type' => 'string',
531
+ 'required' => true,
532
+ ),
533
+ ),
534
+ ),'trash' => array(
535
+ 'path' => '{userId}/messages/{id}/trash',
536
+ 'httpMethod' => 'POST',
537
+ 'parameters' => array(
538
+ 'userId' => array(
539
+ 'location' => 'path',
540
+ 'type' => 'string',
541
+ 'required' => true,
542
+ ),
543
+ 'id' => array(
544
+ 'location' => 'path',
545
+ 'type' => 'string',
546
+ 'required' => true,
547
+ ),
548
+ ),
549
+ ),'untrash' => array(
550
+ 'path' => '{userId}/messages/{id}/untrash',
551
+ 'httpMethod' => 'POST',
552
+ 'parameters' => array(
553
+ 'userId' => array(
554
+ 'location' => 'path',
555
+ 'type' => 'string',
556
+ 'required' => true,
557
+ ),
558
+ 'id' => array(
559
+ 'location' => 'path',
560
+ 'type' => 'string',
561
+ 'required' => true,
562
+ ),
563
+ ),
564
+ ),
565
+ )
566
+ )
567
+ );
568
+ $this->users_messages_attachments = new Google_Service_Gmail_Resource_UsersMessagesAttachments(
569
+ $this,
570
+ $this->serviceName,
571
+ 'attachments',
572
+ array(
573
+ 'methods' => array(
574
+ 'get' => array(
575
+ 'path' => '{userId}/messages/{messageId}/attachments/{id}',
576
+ 'httpMethod' => 'GET',
577
+ 'parameters' => array(
578
+ 'userId' => array(
579
+ 'location' => 'path',
580
+ 'type' => 'string',
581
+ 'required' => true,
582
+ ),
583
+ 'messageId' => array(
584
+ 'location' => 'path',
585
+ 'type' => 'string',
586
+ 'required' => true,
587
+ ),
588
+ 'id' => array(
589
+ 'location' => 'path',
590
+ 'type' => 'string',
591
+ 'required' => true,
592
+ ),
593
+ ),
594
+ ),
595
+ )
596
+ )
597
+ );
598
+ $this->users_settings = new Google_Service_Gmail_Resource_UsersSettings(
599
+ $this,
600
+ $this->serviceName,
601
+ 'settings',
602
+ array(
603
+ 'methods' => array(
604
+ 'getAutoForwarding' => array(
605
+ 'path' => '{userId}/settings/autoForwarding',
606
+ 'httpMethod' => 'GET',
607
+ 'parameters' => array(
608
+ 'userId' => array(
609
+ 'location' => 'path',
610
+ 'type' => 'string',
611
+ 'required' => true,
612
+ ),
613
+ ),
614
+ ),'getImap' => array(
615
+ 'path' => '{userId}/settings/imap',
616
+ 'httpMethod' => 'GET',
617
+ 'parameters' => array(
618
+ 'userId' => array(
619
+ 'location' => 'path',
620
+ 'type' => 'string',
621
+ 'required' => true,
622
+ ),
623
+ ),
624
+ ),'getLanguage' => array(
625
+ 'path' => '{userId}/settings/language',
626
+ 'httpMethod' => 'GET',
627
+ 'parameters' => array(
628
+ 'userId' => array(
629
+ 'location' => 'path',
630
+ 'type' => 'string',
631
+ 'required' => true,
632
+ ),
633
+ ),
634
+ ),'getPop' => array(
635
+ 'path' => '{userId}/settings/pop',
636
+ 'httpMethod' => 'GET',
637
+ 'parameters' => array(
638
+ 'userId' => array(
639
+ 'location' => 'path',
640
+ 'type' => 'string',
641
+ 'required' => true,
642
+ ),
643
+ ),
644
+ ),'getVacation' => array(
645
+ 'path' => '{userId}/settings/vacation',
646
+ 'httpMethod' => 'GET',
647
+ 'parameters' => array(
648
+ 'userId' => array(
649
+ 'location' => 'path',
650
+ 'type' => 'string',
651
+ 'required' => true,
652
+ ),
653
+ ),
654
+ ),'updateAutoForwarding' => array(
655
+ 'path' => '{userId}/settings/autoForwarding',
656
+ 'httpMethod' => 'PUT',
657
+ 'parameters' => array(
658
+ 'userId' => array(
659
+ 'location' => 'path',
660
+ 'type' => 'string',
661
+ 'required' => true,
662
+ ),
663
+ ),
664
+ ),'updateImap' => array(
665
+ 'path' => '{userId}/settings/imap',
666
+ 'httpMethod' => 'PUT',
667
+ 'parameters' => array(
668
+ 'userId' => array(
669
+ 'location' => 'path',
670
+ 'type' => 'string',
671
+ 'required' => true,
672
+ ),
673
+ ),
674
+ ),'updateLanguage' => array(
675
+ 'path' => '{userId}/settings/language',
676
+ 'httpMethod' => 'PUT',
677
+ 'parameters' => array(
678
+ 'userId' => array(
679
+ 'location' => 'path',
680
+ 'type' => 'string',
681
+ 'required' => true,
682
+ ),
683
+ ),
684
+ ),'updatePop' => array(
685
+ 'path' => '{userId}/settings/pop',
686
+ 'httpMethod' => 'PUT',
687
+ 'parameters' => array(
688
+ 'userId' => array(
689
+ 'location' => 'path',
690
+ 'type' => 'string',
691
+ 'required' => true,
692
+ ),
693
+ ),
694
+ ),'updateVacation' => array(
695
+ 'path' => '{userId}/settings/vacation',
696
+ 'httpMethod' => 'PUT',
697
+ 'parameters' => array(
698
+ 'userId' => array(
699
+ 'location' => 'path',
700
+ 'type' => 'string',
701
+ 'required' => true,
702
+ ),
703
+ ),
704
+ ),
705
+ )
706
+ )
707
+ );
708
+ $this->users_settings_delegates = new Google_Service_Gmail_Resource_UsersSettingsDelegates(
709
+ $this,
710
+ $this->serviceName,
711
+ 'delegates',
712
+ array(
713
+ 'methods' => array(
714
+ 'create' => array(
715
+ 'path' => '{userId}/settings/delegates',
716
+ 'httpMethod' => 'POST',
717
+ 'parameters' => array(
718
+ 'userId' => array(
719
+ 'location' => 'path',
720
+ 'type' => 'string',
721
+ 'required' => true,
722
+ ),
723
+ ),
724
+ ),'delete' => array(
725
+ 'path' => '{userId}/settings/delegates/{delegateEmail}',
726
+ 'httpMethod' => 'DELETE',
727
+ 'parameters' => array(
728
+ 'userId' => array(
729
+ 'location' => 'path',
730
+ 'type' => 'string',
731
+ 'required' => true,
732
+ ),
733
+ 'delegateEmail' => array(
734
+ 'location' => 'path',
735
+ 'type' => 'string',
736
+ 'required' => true,
737
+ ),
738
+ ),
739
+ ),'get' => array(
740
+ 'path' => '{userId}/settings/delegates/{delegateEmail}',
741
+ 'httpMethod' => 'GET',
742
+ 'parameters' => array(
743
+ 'userId' => array(
744
+ 'location' => 'path',
745
+ 'type' => 'string',
746
+ 'required' => true,
747
+ ),
748
+ 'delegateEmail' => array(
749
+ 'location' => 'path',
750
+ 'type' => 'string',
751
+ 'required' => true,
752
+ ),
753
+ ),
754
+ ),'list' => array(
755
+ 'path' => '{userId}/settings/delegates',
756
+ 'httpMethod' => 'GET',
757
+ 'parameters' => array(
758
+ 'userId' => array(
759
+ 'location' => 'path',
760
+ 'type' => 'string',
761
+ 'required' => true,
762
+ ),
763
+ ),
764
+ ),
765
+ )
766
+ )
767
+ );
768
+ $this->users_settings_filters = new Google_Service_Gmail_Resource_UsersSettingsFilters(
769
+ $this,
770
+ $this->serviceName,
771
+ 'filters',
772
+ array(
773
+ 'methods' => array(
774
+ 'create' => array(
775
+ 'path' => '{userId}/settings/filters',
776
+ 'httpMethod' => 'POST',
777
+ 'parameters' => array(
778
+ 'userId' => array(
779
+ 'location' => 'path',
780
+ 'type' => 'string',
781
+ 'required' => true,
782
+ ),
783
+ ),
784
+ ),'delete' => array(
785
+ 'path' => '{userId}/settings/filters/{id}',
786
+ 'httpMethod' => 'DELETE',
787
+ 'parameters' => array(
788
+ 'userId' => array(
789
+ 'location' => 'path',
790
+ 'type' => 'string',
791
+ 'required' => true,
792
+ ),
793
+ 'id' => array(
794
+ 'location' => 'path',
795
+ 'type' => 'string',
796
+ 'required' => true,
797
+ ),
798
+ ),
799
+ ),'get' => array(
800
+ 'path' => '{userId}/settings/filters/{id}',
801
+ 'httpMethod' => 'GET',
802
+ 'parameters' => array(
803
+ 'userId' => array(
804
+ 'location' => 'path',
805
+ 'type' => 'string',
806
+ 'required' => true,
807
+ ),
808
+ 'id' => array(
809
+ 'location' => 'path',
810
+ 'type' => 'string',
811
+ 'required' => true,
812
+ ),
813
+ ),
814
+ ),'list' => array(
815
+ 'path' => '{userId}/settings/filters',
816
+ 'httpMethod' => 'GET',
817
+ 'parameters' => array(
818
+ 'userId' => array(
819
+ 'location' => 'path',
820
+ 'type' => 'string',
821
+ 'required' => true,
822
+ ),
823
+ ),
824
+ ),
825
+ )
826
+ )
827
+ );
828
+ $this->users_settings_forwardingAddresses = new Google_Service_Gmail_Resource_UsersSettingsForwardingAddresses(
829
+ $this,
830
+ $this->serviceName,
831
+ 'forwardingAddresses',
832
+ array(
833
+ 'methods' => array(
834
+ 'create' => array(
835
+ 'path' => '{userId}/settings/forwardingAddresses',
836
+ 'httpMethod' => 'POST',
837
+ 'parameters' => array(
838
+ 'userId' => array(
839
+ 'location' => 'path',
840
+ 'type' => 'string',
841
+ 'required' => true,
842
+ ),
843
+ ),
844
+ ),'delete' => array(
845
+ 'path' => '{userId}/settings/forwardingAddresses/{forwardingEmail}',
846
+ 'httpMethod' => 'DELETE',
847
+ 'parameters' => array(
848
+ 'userId' => array(
849
+ 'location' => 'path',
850
+ 'type' => 'string',
851
+ 'required' => true,
852
+ ),
853
+ 'forwardingEmail' => array(
854
+ 'location' => 'path',
855
+ 'type' => 'string',
856
+ 'required' => true,
857
+ ),
858
+ ),
859
+ ),'get' => array(
860
+ 'path' => '{userId}/settings/forwardingAddresses/{forwardingEmail}',
861
+ 'httpMethod' => 'GET',
862
+ 'parameters' => array(
863
+ 'userId' => array(
864
+ 'location' => 'path',
865
+ 'type' => 'string',
866
+ 'required' => true,
867
+ ),
868
+ 'forwardingEmail' => array(
869
+ 'location' => 'path',
870
+ 'type' => 'string',
871
+ 'required' => true,
872
+ ),
873
+ ),
874
+ ),'list' => array(
875
+ 'path' => '{userId}/settings/forwardingAddresses',
876
+ 'httpMethod' => 'GET',
877
+ 'parameters' => array(
878
+ 'userId' => array(
879
+ 'location' => 'path',
880
+ 'type' => 'string',
881
+ 'required' => true,
882
+ ),
883
+ ),
884
+ ),
885
+ )
886
+ )
887
+ );
888
+ $this->users_settings_sendAs = new Google_Service_Gmail_Resource_UsersSettingsSendAs(
889
+ $this,
890
+ $this->serviceName,
891
+ 'sendAs',
892
+ array(
893
+ 'methods' => array(
894
+ 'create' => array(
895
+ 'path' => '{userId}/settings/sendAs',
896
+ 'httpMethod' => 'POST',
897
+ 'parameters' => array(
898
+ 'userId' => array(
899
+ 'location' => 'path',
900
+ 'type' => 'string',
901
+ 'required' => true,
902
+ ),
903
+ ),
904
+ ),'delete' => array(
905
+ 'path' => '{userId}/settings/sendAs/{sendAsEmail}',
906
+ 'httpMethod' => 'DELETE',
907
+ 'parameters' => array(
908
+ 'userId' => array(
909
+ 'location' => 'path',
910
+ 'type' => 'string',
911
+ 'required' => true,
912
+ ),
913
+ 'sendAsEmail' => array(
914
+ 'location' => 'path',
915
+ 'type' => 'string',
916
+ 'required' => true,
917
+ ),
918
+ ),
919
+ ),'get' => array(
920
+ 'path' => '{userId}/settings/sendAs/{sendAsEmail}',
921
+ 'httpMethod' => 'GET',
922
+ 'parameters' => array(
923
+ 'userId' => array(
924
+ 'location' => 'path',
925
+ 'type' => 'string',
926
+ 'required' => true,
927
+ ),
928
+ 'sendAsEmail' => array(
929
+ 'location' => 'path',
930
+ 'type' => 'string',
931
+ 'required' => true,
932
+ ),
933
+ ),
934
+ ),'list' => array(
935
+ 'path' => '{userId}/settings/sendAs',
936
+ 'httpMethod' => 'GET',
937
+ 'parameters' => array(
938
+ 'userId' => array(
939
+ 'location' => 'path',
940
+ 'type' => 'string',
941
+ 'required' => true,
942
+ ),
943
+ ),
944
+ ),'patch' => array(
945
+ 'path' => '{userId}/settings/sendAs/{sendAsEmail}',
946
+ 'httpMethod' => 'PATCH',
947
+ 'parameters' => array(
948
+ 'userId' => array(
949
+ 'location' => 'path',
950
+ 'type' => 'string',
951
+ 'required' => true,
952
+ ),
953
+ 'sendAsEmail' => array(
954
+ 'location' => 'path',
955
+ 'type' => 'string',
956
+ 'required' => true,
957
+ ),
958
+ ),
959
+ ),'update' => array(
960
+ 'path' => '{userId}/settings/sendAs/{sendAsEmail}',
961
+ 'httpMethod' => 'PUT',
962
+ 'parameters' => array(
963
+ 'userId' => array(
964
+ 'location' => 'path',
965
+ 'type' => 'string',
966
+ 'required' => true,
967
+ ),
968
+ 'sendAsEmail' => array(
969
+ 'location' => 'path',
970
+ 'type' => 'string',
971
+ 'required' => true,
972
+ ),
973
+ ),
974
+ ),'verify' => array(
975
+ 'path' => '{userId}/settings/sendAs/{sendAsEmail}/verify',
976
+ 'httpMethod' => 'POST',
977
+ 'parameters' => array(
978
+ 'userId' => array(
979
+ 'location' => 'path',
980
+ 'type' => 'string',
981
+ 'required' => true,
982
+ ),
983
+ 'sendAsEmail' => array(
984
+ 'location' => 'path',
985
+ 'type' => 'string',
986
+ 'required' => true,
987
+ ),
988
+ ),
989
+ ),
990
+ )
991
+ )
992
+ );
993
+ $this->users_settings_sendAs_smimeInfo = new Google_Service_Gmail_Resource_UsersSettingsSendAsSmimeInfo(
994
+ $this,
995
+ $this->serviceName,
996
+ 'smimeInfo',
997
+ array(
998
+ 'methods' => array(
999
+ 'delete' => array(
1000
+ 'path' => '{userId}/settings/sendAs/{sendAsEmail}/smimeInfo/{id}',
1001
+ 'httpMethod' => 'DELETE',
1002
+ 'parameters' => array(
1003
+ 'userId' => array(
1004
+ 'location' => 'path',
1005
+ 'type' => 'string',
1006
+ 'required' => true,
1007
+ ),
1008
+ 'sendAsEmail' => array(
1009
+ 'location' => 'path',
1010
+ 'type' => 'string',
1011
+ 'required' => true,
1012
+ ),
1013
+ 'id' => array(
1014
+ 'location' => 'path',
1015
+ 'type' => 'string',
1016
+ 'required' => true,
1017
+ ),
1018
+ ),
1019
+ ),'get' => array(
1020
+ 'path' => '{userId}/settings/sendAs/{sendAsEmail}/smimeInfo/{id}',
1021
+ 'httpMethod' => 'GET',
1022
+ 'parameters' => array(
1023
+ 'userId' => array(
1024
+ 'location' => 'path',
1025
+ 'type' => 'string',
1026
+ 'required' => true,
1027
+ ),
1028
+ 'sendAsEmail' => array(
1029
+ 'location' => 'path',
1030
+ 'type' => 'string',
1031
+ 'required' => true,
1032
+ ),
1033
+ 'id' => array(
1034
+ 'location' => 'path',
1035
+ 'type' => 'string',
1036
+ 'required' => true,
1037
+ ),
1038
+ ),
1039
+ ),'insert' => array(
1040
+ 'path' => '{userId}/settings/sendAs/{sendAsEmail}/smimeInfo',
1041
+ 'httpMethod' => 'POST',
1042
+ 'parameters' => array(
1043
+ 'userId' => array(
1044
+ 'location' => 'path',
1045
+ 'type' => 'string',
1046
+ 'required' => true,
1047
+ ),
1048
+ 'sendAsEmail' => array(
1049
+ 'location' => 'path',
1050
+ 'type' => 'string',
1051
+ 'required' => true,
1052
+ ),
1053
+ ),
1054
+ ),'list' => array(
1055
+ 'path' => '{userId}/settings/sendAs/{sendAsEmail}/smimeInfo',
1056
+ 'httpMethod' => 'GET',
1057
+ 'parameters' => array(
1058
+ 'userId' => array(
1059
+ 'location' => 'path',
1060
+ 'type' => 'string',
1061
+ 'required' => true,
1062
+ ),
1063
+ 'sendAsEmail' => array(
1064
+ 'location' => 'path',
1065
+ 'type' => 'string',
1066
+ 'required' => true,
1067
+ ),
1068
+ ),
1069
+ ),'setDefault' => array(
1070
+ 'path' => '{userId}/settings/sendAs/{sendAsEmail}/smimeInfo/{id}/setDefault',
1071
+ 'httpMethod' => 'POST',
1072
+ 'parameters' => array(
1073
+ 'userId' => array(
1074
+ 'location' => 'path',
1075
+ 'type' => 'string',
1076
+ 'required' => true,
1077
+ ),
1078
+ 'sendAsEmail' => array(
1079
+ 'location' => 'path',
1080
+ 'type' => 'string',
1081
+ 'required' => true,
1082
+ ),
1083
+ 'id' => array(
1084
+ 'location' => 'path',
1085
+ 'type' => 'string',
1086
+ 'required' => true,
1087
+ ),
1088
+ ),
1089
+ ),
1090
+ )
1091
+ )
1092
+ );
1093
+ $this->users_threads = new Google_Service_Gmail_Resource_UsersThreads(
1094
+ $this,
1095
+ $this->serviceName,
1096
+ 'threads',
1097
+ array(
1098
+ 'methods' => array(
1099
+ 'delete' => array(
1100
+ 'path' => '{userId}/threads/{id}',
1101
+ 'httpMethod' => 'DELETE',
1102
+ 'parameters' => array(
1103
+ 'userId' => array(
1104
+ 'location' => 'path',
1105
+ 'type' => 'string',
1106
+ 'required' => true,
1107
+ ),
1108
+ 'id' => array(
1109
+ 'location' => 'path',
1110
+ 'type' => 'string',
1111
+ 'required' => true,
1112
+ ),
1113
+ ),
1114
+ ),'get' => array(
1115
+ 'path' => '{userId}/threads/{id}',
1116
+ 'httpMethod' => 'GET',
1117
+ 'parameters' => array(
1118
+ 'userId' => array(
1119
+ 'location' => 'path',
1120
+ 'type' => 'string',
1121
+ 'required' => true,
1122
+ ),
1123
+ 'id' => array(
1124
+ 'location' => 'path',
1125
+ 'type' => 'string',
1126
+ 'required' => true,
1127
+ ),
1128
+ 'format' => array(
1129
+ 'location' => 'query',
1130
+ 'type' => 'string',
1131
+ ),
1132
+ 'metadataHeaders' => array(
1133
+ 'location' => 'query',
1134
+ 'type' => 'string',
1135
+ 'repeated' => true,
1136
+ ),
1137
+ ),
1138
+ ),'list' => array(
1139
+ 'path' => '{userId}/threads',
1140
+ 'httpMethod' => 'GET',
1141
+ 'parameters' => array(
1142
+ 'userId' => array(
1143
+ 'location' => 'path',
1144
+ 'type' => 'string',
1145
+ 'required' => true,
1146
+ ),
1147
+ 'includeSpamTrash' => array(
1148
+ 'location' => 'query',
1149
+ 'type' => 'boolean',
1150
+ ),
1151
+ 'labelIds' => array(
1152
+ 'location' => 'query',
1153
+ 'type' => 'string',
1154
+ 'repeated' => true,
1155
+ ),
1156
+ 'maxResults' => array(
1157
+ 'location' => 'query',
1158
+ 'type' => 'integer',
1159
+ ),
1160
+ 'pageToken' => array(
1161
+ 'location' => 'query',
1162
+ 'type' => 'string',
1163
+ ),
1164
+ 'q' => array(
1165
+ 'location' => 'query',
1166
+ 'type' => 'string',
1167
+ ),
1168
+ ),
1169
+ ),'modify' => array(
1170
+ 'path' => '{userId}/threads/{id}/modify',
1171
+ 'httpMethod' => 'POST',
1172
+ 'parameters' => array(
1173
+ 'userId' => array(
1174
+ 'location' => 'path',
1175
+ 'type' => 'string',
1176
+ 'required' => true,
1177
+ ),
1178
+ 'id' => array(
1179
+ 'location' => 'path',
1180
+ 'type' => 'string',
1181
+ 'required' => true,
1182
+ ),
1183
+ ),
1184
+ ),'trash' => array(
1185
+ 'path' => '{userId}/threads/{id}/trash',
1186
+ 'httpMethod' => 'POST',
1187
+ 'parameters' => array(
1188
+ 'userId' => array(
1189
+ 'location' => 'path',
1190
+ 'type' => 'string',
1191
+ 'required' => true,
1192
+ ),
1193
+ 'id' => array(
1194
+ 'location' => 'path',
1195
+ 'type' => 'string',
1196
+ 'required' => true,
1197
+ ),
1198
+ ),
1199
+ ),'untrash' => array(
1200
+ 'path' => '{userId}/threads/{id}/untrash',
1201
+ 'httpMethod' => 'POST',
1202
+ 'parameters' => array(
1203
+ 'userId' => array(
1204
+ 'location' => 'path',
1205
+ 'type' => 'string',
1206
+ 'required' => true,
1207
+ ),
1208
+ 'id' => array(
1209
+ 'location' => 'path',
1210
+ 'type' => 'string',
1211
+ 'required' => true,
1212
+ ),
1213
+ ),
1214
+ ),
1215
+ )
1216
+ )
1217
+ );
1218
+ }
1219
+ }
vendor/google/apiclient-services/src/Google/Service/Gmail/AutoForwarding.php CHANGED
@@ -1,48 +1,48 @@
1
- <?php
2
- /*
3
- * Copyright 2014 Google Inc.
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6
- * use this file except in compliance with the License. You may obtain a copy of
7
- * the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
- * License for the specific language governing permissions and limitations under
15
- * the License.
16
- */
17
-
18
- class Google_Service_Gmail_AutoForwarding extends Google_Model
19
- {
20
- public $disposition;
21
- public $emailAddress;
22
- public $enabled;
23
-
24
- public function setDisposition($disposition)
25
- {
26
- $this->disposition = $disposition;
27
- }
28
- public function getDisposition()
29
- {
30
- return $this->disposition;
31
- }
32
- public function setEmailAddress($emailAddress)
33
- {
34
- $this->emailAddress = $emailAddress;
35
- }
36
- public function getEmailAddress()
37
- {
38
- return $this->emailAddress;
39
- }
40
- public function setEnabled($enabled)
41
- {
42
- $this->enabled = $enabled;
43
- }
44
- public function getEnabled()
45
- {
46
- return $this->enabled;
47
- }
48
- }
1
+ <?php
2
+ /*
3
+ * Copyright 2014 Google Inc.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6
+ * use this file except in compliance with the License. You may obtain a copy of
7
+ * the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
+ * License for the specific language governing permissions and limitations under
15
+ * the License.
16
+ */
17
+
18
+ class Google_Service_Gmail_AutoForwarding extends Google_Model
19
+ {
20
+ public $disposition;
21
+ public $emailAddress;
22
+ public $enabled;
23
+
24
+ public function setDisposition($disposition)
25
+ {
26
+ $this->disposition = $disposition;
27
+ }
28
+ public function getDisposition()
29
+ {
30
+ return $this->disposition;
31
+ }
32
+ public function setEmailAddress($emailAddress)
33
+ {
34
+ $this->emailAddress = $emailAddress;
35
+ }
36
+ public function getEmailAddress()
37
+ {
38
+ return $this->emailAddress;
39
+ }
40
+ public function setEnabled($enabled)
41
+ {
42
+ $this->enabled = $enabled;
43
+ }
44
+ public function getEnabled()
45
+ {
46
+ return $this->enabled;
47
+ }
48
+ }
vendor/google/apiclient-services/src/Google/Service/Gmail/BatchDeleteMessagesRequest.php CHANGED
@@ -1,31 +1,31 @@
1
- <?php
2
- /*
3
- * Copyright 2014 Google Inc.
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6
- * use this file except in compliance with the License. You may obtain a copy of
7
- * the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
- * License for the specific language governing permissions and limitations under
15
- * the License.
16
- */
17
-
18
- class Google_Service_Gmail_BatchDeleteMessagesRequest extends Google_Collection
19
- {
20
- protected $collection_key = 'ids';
21
- public $ids;
22
-
23
- public function setIds($ids)
24
- {
25
- $this->ids = $ids;
26
- }
27
- public function getIds()
28
- {
29
- return $this->ids;
30
- }
31
- }
1
+ <?php
2
+ /*
3
+ * Copyright 2014 Google Inc.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6
+ * use this file except in compliance with the License. You may obtain a copy of
7
+ * the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
+ * License for the specific language governing permissions and limitations under
15
+ * the License.
16
+ */
17
+
18
+ class Google_Service_Gmail_BatchDeleteMessagesRequest extends Google_Collection
19
+ {
20
+ protected $collection_key = 'ids';
21
+ public $ids;
22
+
23
+ public function setIds($ids)
24
+ {
25
+ $this->ids = $ids;
26
+ }
27
+ public function getIds()
28
+ {
29
+ return $this->ids;
30
+ }
31
+ }
vendor/google/apiclient-services/src/Google/Service/Gmail/BatchModifyMessagesRequest.php CHANGED
@@ -1,49 +1,49 @@
1
- <?php
2
- /*
3
- * Copyright 2014 Google Inc.
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6
- * use this file except in compliance with the License. You may obtain a copy of
7
- * the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
- * License for the specific language governing permissions and limitations under
15
- * the License.
16
- */
17
-
18
- class Google_Service_Gmail_BatchModifyMessagesRequest extends Google_Collection
19
- {
20
- protected $collection_key = 'removeLabelIds';
21
- public $addLabelIds;
22
- public $ids;
23
- public $removeLabelIds;
24
-
25
- public function setAddLabelIds($addLabelIds)
26
- {
27
- $this->addLabelIds = $addLabelIds;
28
- }
29
- public function getAddLabelIds()
30
- {
31
- return $this->addLabelIds;
32
- }
33
- public function setIds($ids)
34
- {
35
- $this->ids = $ids;
36
- }
37
- public function getIds()
38
- {
39
- return $this->ids;
40
- }
41
- public function setRemoveLabelIds($removeLabelIds)
42
- {
43
- $this->removeLabelIds = $removeLabelIds;
44
- }
45
- public function getRemoveLabelIds()
46
- {
47
- return $this->removeLabelIds;
48
- }
49
- }
1
+ <?php
2
+ /*
3
+ * Copyright 2014 Google Inc.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6
+ * use this file except in compliance with the License. You may obtain a copy of
7
+ * the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
+ * License for the specific language governing permissions and limitations under
15
+ * the License.
16
+ */
17
+
18
+ class Google_Service_Gmail_BatchModifyMessagesRequest extends Google_Collection
19
+ {
20
+ protected $collection_key = 'removeLabelIds';
21
+ public $addLabelIds;
22
+ public $ids;
23
+ public $removeLabelIds;
24
+
25
+ public function setAddLabelIds($addLabelIds)
26
+ {
27
+ $this->addLabelIds = $addLabelIds;
28
+ }
29
+ public function getAddLabelIds()
30
+ {
31
+ return $this->addLabelIds;
32
+ }
33
+ public function setIds($ids)
34
+ {
35
+ $this->ids = $ids;
36
+ }
37
+ public function getIds()
38
+ {
39
+ return $this->ids;
40
+ }
41
+ public function setRemoveLabelIds($removeLabelIds)
42
+ {
43
+ $this->removeLabelIds = $removeLabelIds;
44
+ }
45
+ public function getRemoveLabelIds()
46
+ {
47
+ return $this->removeLabelIds;
48
+ }
49
+ }
vendor/google/apiclient-services/src/Google/Service/Gmail/Delegate.php CHANGED
@@ -1,39 +1,39 @@
1
- <?php
2
- /*
3
- * Copyright 2014 Google Inc.
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6
- * use this file except in compliance with the License. You may obtain a copy of
7
- * the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
- * License for the specific language governing permissions and limitations under
15
- * the License.
16
- */
17
-
18
- class Google_Service_Gmail_Delegate extends Google_Model
19
- {
20
- public $delegateEmail;
21
- public $verificationStatus;
22
-
23
- public function setDelegateEmail($delegateEmail)
24
- {
25
- $this->delegateEmail = $delegateEmail;
26
- }
27
- public function getDelegateEmail()
28
- {
29
- return $this->delegateEmail;
30
- }
31
- public function setVerificationStatus($verificationStatus)
32
- {
33
- $this->verificationStatus = $verificationStatus;
34
- }
35
- public function getVerificationStatus()
36
- {
37
- return $this->verificationStatus;
38
- }
39
- }
1
+ <?php
2
+ /*
3
+ * Copyright 2014 Google Inc.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6
+ * use this file except in compliance with the License. You may obtain a copy of
7
+ * the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
+ * License for the specific language governing permissions and limitations under
15
+ * the License.
16
+ */
17
+
18
+ class Google_Service_Gmail_Delegate extends Google_Model
19
+ {
20
+ public $delegateEmail;
21
+ public $verificationStatus;
22
+
23
+ public function setDelegateEmail($delegateEmail)
24
+ {
25
+ $this->delegateEmail = $delegateEmail;
26
+ }
27
+ public function getDelegateEmail()
28
+ {
29
+ return $this->delegateEmail;
30
+ }
31
+ public function setVerificationStatus($verificationStatus)
32
+ {
33
+ $this->verificationStatus = $verificationStatus;
34
+ }
35
+ public function getVerificationStatus()
36
+ {
37
+ return $this->verificationStatus;
38
+ }
39
+ }
vendor/google/apiclient-services/src/Google/Service/Gmail/Draft.php CHANGED
@@ -1,46 +1,46 @@
1
- <?php
2
- /*
3
- * Copyright 2014 Google Inc.
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6
- * use this file except in compliance with the License. You may obtain a copy of
7
- * the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
- * License for the specific language governing permissions and limitations under
15
- * the License.
16
- */
17
-
18
- class Google_Service_Gmail_Draft extends Google_Model
19
- {
20
- public $id;
21
- protected $messageType = 'Google_Service_Gmail_Message';
22
- protected $messageDataType = '';
23
-
24
- public function setId($id)
25
- {
26
- $this->id = $id;
27
- }
28
- public function getId()
29
- {
30
- return $this->id;
31
- }
32
- /**
33
- * @param Google_Service_Gmail_Message
34
- */
35
- public function setMessage(Google_Service_Gmail_Message $message)
36
- {
37
- $this->message = $message;
38
- }
39
- /**
40
- * @return Google_Service_Gmail_Message
41
- */
42
- public function getMessage()
43
- {
44
- return $this->message;
45
- }
46
- }
1
+ <?php
2
+ /*
3
+ * Copyright 2014 Google Inc.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6
+ * use this file except in compliance with the License. You may obtain a copy of
7
+ * the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
+ * License for the specific language governing permissions and limitations under
15
+ * the License.
16
+ */
17
+
18
+ class Google_Service_Gmail_Draft extends Google_Model
19
+ {
20
+ public $id;
21
+ protected $messageType = 'Google_Service_Gmail_Message';
22
+ protected $messageDataType = '';
23
+
24
+ public function setId($id)
25
+ {
26
+ $this->id = $id;
27
+ }
28
+ public function getId()
29
+ {
30
+ return $this->id;
31
+ }
32
+ /**
33
+ * @param Google_Service_Gmail_Message
34
+ */
35
+ public function setMessage(Google_Service_Gmail_Message $message)
36
+ {
37
+ $this->message = $message;
38
+ }
39
+ /**
40
+ * @return Google_Service_Gmail_Message
41
+ */
42
+ public function getMessage()
43
+ {
44
+ return $this->message;
45
+ }
46
+ }
vendor/google/apiclient-services/src/Google/Service/Gmail/Filter.php CHANGED
@@ -1,62 +1,62 @@
1
- <?php
2
- /*
3
- * Copyright 2014 Google Inc.
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6
- * use this file except in compliance with the License. You may obtain a copy of
7
- * the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
- * License for the specific language governing permissions and limitations under
15
- * the License.
16
- */
17
-
18
- class Google_Service_Gmail_Filter extends Google_Model
19
- {
20
- protected $actionType = 'Google_Service_Gmail_FilterAction';
21
- protected $actionDataType = '';
22
- protected $criteriaType = 'Google_Service_Gmail_FilterCriteria';
23
- protected $criteriaDataType = '';
24
- public $id;
25
-
26
- /**
27
- * @param Google_Service_Gmail_FilterAction
28
- */
29
- public function setAction(Google_Service_Gmail_FilterAction $action)
30
- {
31
- $this->action = $action;
32
- }
33
- /**
34
- * @return Google_Service_Gmail_FilterAction
35
- */
36
- public function getAction()
37
- {
38
- return $this->action;
39
- }
40
- /**
41
- * @param Google_Service_Gmail_FilterCriteria
42
- */
43
- public function setCriteria(Google_Service_Gmail_FilterCriteria $criteria)
44
- {
45
- $this->criteria = $criteria;
46
- }
47
- /**
48
- * @return Google_Service_Gmail_FilterCriteria
49
- */
50
- public function getCriteria()
51
- {
52
- return $this->criteria;
53
- }
54
- public function setId($id)
55
- {
56
- $this->id = $id;
57
- }
58
- public function getId()
59
- {
60
- return $this->id;
61
- }
62
- }
1
+ <?php
2
+ /*
3
+ * Copyright 2014 Google Inc.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6
+ * use this file except in compliance with the License. You may obtain a copy of
7
+ * the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
+ * License for the specific language governing permissions and limitations under
15
+ * the License.
16
+ */
17
+
18
+ class Google_Service_Gmail_Filter extends Google_Model
19
+ {
20
+ protected $actionType = 'Google_Service_Gmail_FilterAction';
21
+ protected $actionDataType = '';
22
+ protected $criteriaType = 'Google_Service_Gmail_FilterCriteria';
23
+ protected $criteriaDataType = '';
24
+ public $id;
25
+
26
+ /**
27
+ * @param Google_Service_Gmail_FilterAction
28
+ */
29
+ public function setAction(Google_Service_Gmail_FilterAction $action)
30
+ {
31
+ $this->action = $action;
32
+ }
33
+ /**
34
+ * @return Google_Service_Gmail_FilterAction
35
+ */
36
+ public function getAction()
37
+ {
38
+ return $this->action;
39
+ }
40
+ /**
41
+ * @param Google_Service_Gmail_FilterCriteria
42
+ */
43
+ public function setCriteria(Google_Service_Gmail_FilterCriteria $criteria)
44
+ {
45
+ $this->criteria = $criteria;
46
+ }
47
+ /**
48
+ * @return Google_Service_Gmail_FilterCriteria
49
+ */
50
+ public function getCriteria()
51
+ {
52
+ return $this->criteria;
53
+ }
54
+ public function setId($id)
55
+ {
56
+ $this->id = $id;
57
+ }
58
+ public function getId()
59
+ {
60
+ return $this->id;
61
+ }
62
+ }
vendor/google/apiclient-services/src/Google/Service/Gmail/FilterAction.php CHANGED
@@ -1,49 +1,49 @@
1
- <?php
2
- /*
3
- * Copyright 2014 Google Inc.
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6
- * use this file except in compliance with the License. You may obtain a copy of
7
- * the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
- * License for the specific language governing permissions and limitations under
15
- * the License.
16
- */
17
-
18
- class Google_Service_Gmail_FilterAction extends Google_Collection
19
- {
20
- protected $collection_key = 'removeLabelIds';
21
- public $addLabelIds;
22
- public $forward;
23
- public $removeLabelIds;
24
-
25
- public function setAddLabelIds($addLabelIds)
26
- {
27
- $this->addLabelIds = $addLabelIds;
28
- }
29
- public function getAddLabelIds()
30
- {
31
- return $this->addLabelIds;
32
- }
33
- public function setForward($forward)
34
- {
35
- $this->forward = $forward;
36
- }
37
- public function getForward()
38
- {
39
- return $this->forward;
40
- }
41
- public function setRemoveLabelIds($removeLabelIds)
42
- {
43
- $this->removeLabelIds = $removeLabelIds;
44
- }
45
- public function getRemoveLabelIds()
46
- {
47
- return $this->removeLabelIds;
48
- }
49
- }
1
+ <?php
2
+ /*
3
+ * Copyright 2014 Google Inc.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6
+ * use this file except in compliance with the License. You may obtain a copy of
7
+ * the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
+ * License for the specific language governing permissions and limitations under
15
+ * the License.
16
+ */
17
+
18
+ class Google_Service_Gmail_FilterAction extends Google_Collection
19
+ {
20
+ protected $collection_key = 'removeLabelIds';
21
+ public $addLabelIds;
22
+ public $forward;
23
+ public $removeLabelIds;
24
+
25
+ public function setAddLabelIds($addLabelIds)
26
+ {
27
+ $this->addLabelIds = $addLabelIds;
28
+ }
29
+ public function getAddLabelIds()
30
+ {
31
+ return $this->addLabelIds;
32
+ }
33
+ public function setForward($forward)
34
+ {
35
+ $this->forward = $forward;
36
+ }
37
+ public function getForward()
38
+ {
39
+ return $this->forward;
40
+ }
41
+ public function setRemoveLabelIds($removeLabelIds)
42
+ {
43
+ $this->removeLabelIds = $removeLabelIds;
44
+ }
45
+ public function getRemoveLabelIds()
46
+ {
47
+ return $this->removeLabelIds;
48
+ }
49
+ }
vendor/google/apiclient-services/src/Google/Service/Gmail/FilterCriteria.php CHANGED
@@ -1,102 +1,102 @@
1
- <?php
2
- /*
3
- * Copyright 2014 Google Inc.
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6
- * use this file except in compliance with the License. You may obtain a copy of
7
- * the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
- * License for the specific language governing permissions and limitations under
15
- * the License.
16
- */
17
-
18
- class Google_Service_Gmail_FilterCriteria extends Google_Model
19
- {
20
- public $excludeChats;
21
- public $from;
22
- public $hasAttachment;
23
- public $negatedQuery;
24
- public $query;
25
- public $size;
26
- public $sizeComparison;
27
- public $subject;
28
- public $to;
29
-
30
- public function setExcludeChats($excludeChats)
31
- {
32
- $this->excludeChats = $excludeChats;
33
- }
34
- public function getExcludeChats()
35
- {
36
- return $this->excludeChats;
37
- }
38
- public function setFrom($from)
39
- {
40
- $this->from = $from;
41
- }
42
- public function getFrom()
43
- {
44
- return $this->from;
45
- }
46
- public function setHasAttachment($hasAttachment)
47
- {
48
- $this->hasAttachment = $hasAttachment;
49
- }
50
- public function getHasAttachment()
51
- {
52
- return $this->hasAttachment;
53
- }
54
- public function setNegatedQuery($negatedQuery)
55
- {
56
- $this->negatedQuery = $negatedQuery;
57
- }
58
- public function getNegatedQuery()
59
- {
60
- return $this->negatedQuery;
61
- }
62
- public function setQuery($query)
63
- {
64
- $this->query = $query;
65
- }
66
- public function getQuery()
67
- {
68
- return $this->query;
69
- }
70
- public function setSize($size)
71
- {
72
- $this->size = $size;
73
- }
74
- public function getSize()
75
- {
76
- return $this->size;
77
- }
78
- public function setSizeComparison($sizeComparison)
79
- {
80
- $this->sizeComparison = $sizeComparison;
81
- }
82
- public function getSizeComparison()
83
- {
84
- return $this->sizeComparison;
85
- }
86
- public function setSubject($subject)
87
- {
88
- $this->subject = $subject;
89
- }
90
- public function getSubject()
91
- {
92
- return $this->subject;
93
- }
94
- public function setTo($to)
95
- {
96
- $this->to = $to;
97
- }
98
- public function getTo()
99
- {
100
- return $this->to;
101
- }
102
- }
1
+ <?php
2
+ /*
3
+ * Copyright 2014 Google Inc.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6
+ * use this file except in compliance with the License. You may obtain a copy of
7
+ * the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
+ * License for the specific language governing permissions and limitations under
15
+ * the License.
16
+ */
17
+
18
+ class Google_Service_Gmail_FilterCriteria extends Google_Model
19
+ {
20
+ public $excludeChats;
21
+ public $from;
22
+ public $hasAttachment;
23
+ public $negatedQuery;
24
+ public $query;
25
+ public $size;
26
+ public $sizeComparison;
27
+ public $subject;
28
+ public $to;
29
+
30
+ public function setExcludeChats($excludeChats)
31
+ {
32
+ $this->excludeChats = $excludeChats;
33
+ }
34
+ public function getExcludeChats()
35
+ {
36
+ return $this->excludeChats;
37
+ }
38
+ public function setFrom($from)
39
+ {
40
+ $this->from = $from;
41
+ }
42
+ public function getFrom()
43
+ {
44
+ return $this->from;
45
+ }
46
+ public function setHasAttachment($hasAttachment)
47
+ {
48
+ $this->hasAttachment = $hasAttachment;
49
+ }
50
+ public function getHasAttachment()
51
+ {
52
+ return $this->hasAttachment;
53
+ }
54
+ public function setNegatedQuery($negatedQuery)
55
+ {
56
+ $this->negatedQuery = $negatedQuery;
57
+ }
58
+ public function getNegatedQuery()
59
+ {
60
+ return $this->negatedQuery;
61
+ }
62
+ public function setQuery($query)
63
+ {
64
+ $this->query = $query;
65
+ }
66
+ public function getQuery()
67
+ {
68
+ return $this->query;
69
+ }
70
+ public function setSize($size)
71
+ {
72
+ $this->size = $size;
73
+ }
74
+ public function getSize()
75
+ {
76
+ return $this->size;
77
+ }
78
+ public function setSizeComparison($sizeComparison)
79
+ {
80
+ $this->sizeComparison = $sizeComparison;
81
+ }
82
+ public function getSizeComparison()
83
+ {
84
+ return $this->sizeComparison;
85
+ }
86
+ public function setSubject($subject)
87
+ {
88
+ $this->subject = $subject;
89
+ }
90
+ public function getSubject()
91
+ {
92
+ return $this->subject;
93
+ }
94
+ public function setTo($to)
95
+ {
96
+ $this->to = $to;
97
+ }
98
+ public function getTo()
99
+ {
100
+ return $this->to;
101
+ }
102
+ }
vendor/google/apiclient-services/src/Google/Service/Gmail/ForwardingAddress.php CHANGED
@@ -1,39 +1,39 @@
1
- <?php
2
- /*
3
- * Copyright 2014 Google Inc.
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6
- * use this file except in compliance with the License. You may obtain a copy of
7
- * the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
- * License for the specific language governing permissions and limitations under
15
- * the License.
16
- */
17
-
18
- class Google_Service_Gmail_ForwardingAddress extends Google_Model
19
- {
20
- public $forwardingEmail;
21
- public $verificationStatus;
22
-
23
- public function setForwardingEmail($forwardingEmail)
24
- {
25
- $this->forwardingEmail = $forwardingEmail;
26
- }
27
- public function getForwardingEmail()
28
- {
29
- return $this->forwardingEmail;
30
- }
31
- public function setVerificationStatus($verificationStatus)
32
- {
33
- $this->verificationStatus = $verificationStatus;
34
- }
35
- public function getVerificationStatus()
36
- {
37
- return $this->verificationStatus;
38
- }
39
- }
1
+ <?php
2
+ /*
3
+ * Copyright 2014 Google Inc.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6
+ * use this file except in compliance with the License. You may obtain a copy of
7
+ * the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
+ * License for the specific language governing permissions and limitations under
15
+ * the License.
16
+ */
17
+
18
+ class Google_Service_Gmail_ForwardingAddress extends Google_Model
19
+ {
20
+ public $forwardingEmail;
21
+ public $verificationStatus;
22
+
23
+ public function setForwardingEmail($forwardingEmail)
24
+ {
25
+ $this->forwardingEmail = $forwardingEmail;
26
+ }
27
+ public function getForwardingEmail()
28
+ {
29
+ return $this->forwardingEmail;
30
+ }
31
+ public function setVerificationStatus($verificationStatus)
32
+ {
33
+ $this->verificationStatus = $verificationStatus;
34
+ }
35
+ public function getVerificationStatus()
36
+ {
37
+ return $this->verificationStatus;
38
+ }
39
+ }
vendor/google/apiclient-services/src/Google/Service/Gmail/History.php CHANGED
@@ -1,111 +1,111 @@
1
- <?php
2
- /*
3
- * Copyright 2014 Google Inc.
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6
- * use this file except in compliance with the License. You may obtain a copy of
7
- * the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
- * License for the specific language governing permissions and limitations under
15
- * the License.
16
- */
17
-
18
- class Google_Service_Gmail_History extends Google_Collection
19
- {
20
- protected $collection_key = 'messagesDeleted';
21
- public $id;
22
- protected $labelsAddedType = 'Google_Service_Gmail_HistoryLabelAdded';
23
- protected $labelsAddedDataType = 'array';
24
- protected $labelsRemovedType = 'Google_Service_Gmail_HistoryLabelRemoved';
25
- protected $labelsRemovedDataType = 'array';
26
- protected $messagesType = 'Google_Service_Gmail_Message';
27
- protected $messagesDataType = 'array';
28
- protected $messagesAddedType = 'Google_Service_Gmail_HistoryMessageAdded';
29
- protected $messagesAddedDataType = 'array';
30
- protected $messagesDeletedType = 'Google_Service_Gmail_HistoryMessageDeleted';
31
- protected $messagesDeletedDataType = 'array';
32
-
33
- public function setId($id)
34
- {
35
- $this->id = $id;
36
- }
37
- public function getId()
38
- {
39
- return $this->id;
40
- }
41
- /**
42
- * @param Google_Service_Gmail_HistoryLabelAdded
43
- */
44
- public function setLabelsAdded($labelsAdded)
45
- {
46
- $this->labelsAdded = $labelsAdded;
47
- }
48
- /**
49
- * @return Google_Service_Gmail_HistoryLabelAdded
50
- */
51
- public function getLabelsAdded()
52
- {
53
- return $this->labelsAdded;
54
- }
55
- /**
56
- * @param Google_Service_Gmail_HistoryLabelRemoved
57
- */
58
- public function setLabelsRemoved($labelsRemoved)
59
- {
60
- $this->labelsRemoved = $labelsRemoved;
61
- }
62
- /**
63
- * @return Google_Service_Gmail_HistoryLabelRemoved
64
- */
65
- public function getLabelsRemoved()
66
- {
67
- return $this->labelsRemoved;
68
- }
69
- /**
70
- * @param Google_Service_Gmail_Message
71
- */
72
- public function setMessages($messages)
73
- {
74
- $this->messages = $messages;
75
- }
76
- /**
77
- * @return Google_Service_Gmail_Message
78
- */
79
- public function getMessages()
80
- {
81
- return $this->messages;
82
- }
83
- /**
84
- * @param Google_Service_Gmail_HistoryMessageAdded
85
- */
86
- public function setMessagesAdded($messagesAdded)
87
- {
88
- $this->messagesAdded = $messagesAdded;
89
- }
90
- /**
91
- * @return Google_Service_Gmail_HistoryMessageAdded
92
- */
93
- public function getMessagesAdded()
94
- {
95
- return $this->messagesAdded;
96
- }
97
- /**
98
- * @param Google_Service_Gmail_HistoryMessageDeleted
99
- */
100
- public function setMessagesDeleted($messagesDeleted)
101
- {
102
- $this->messagesDeleted = $messagesDeleted;
103
- }
104
- /**
105
- * @return Google_Service_Gmail_HistoryMessageDeleted
106
- */
107
- public function getMessagesDeleted()
108
- {
109
- return $this->messagesDeleted;
110
- }
111
- }
1
+ <?php
2
+ /*
3
+ * Copyright 2014 Google Inc.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6
+ * use this file except in compliance with the License. You may obtain a copy of
7
+ * the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
+ * License for the specific language governing permissions and limitations under
15
+ * the License.
16
+ */
17
+
18
+ class Google_Service_Gmail_History extends Google_Collection
19
+ {
20
+ protected $collection_key = 'messagesDeleted';
21
+ public $id;
22
+ protected $labelsAddedType = 'Google_Service_Gmail_HistoryLabelAdded';
23
+ protected $labelsAddedDataType = 'array';
24
+ protected $labelsRemovedType = 'Google_Service_Gmail_HistoryLabelRemoved';
25
+ protected $labelsRemovedDataType = 'array';
26
+ protected $messagesType = 'Google_Service_Gmail_Message';
27
+ protected $messagesDataType = 'array';
28
+ protected $messagesAddedType = 'Google_Service_Gmail_HistoryMessageAdded';
29
+ protected $messagesAddedDataType = 'array';
30
+ protected $messagesDeletedType = 'Google_Service_Gmail_HistoryMessageDeleted';
31
+ protected $messagesDeletedDataType = 'array';
32
+
33
+ public function setId($id)
34
+ {
35
+ $this->id = $id;
36
+ }
37
+ public function getId()
38
+ {
39
+ return $this->id;
40
+ }
41
+ /**
42
+ * @param Google_Service_Gmail_HistoryLabelAdded
43
+ */
44
+ public function setLabelsAdded($labelsAdded)
45
+ {
46
+ $this->labelsAdded = $labelsAdded;
47
+ }
48
+ /**
49
+ * @return Google_Service_Gmail_HistoryLabelAdded
50
+ */
51
+ public function getLabelsAdded()
52
+ {
53
+ return $this->labelsAdded;
54
+ }
55
+ /**
56
+ * @param Google_Service_Gmail_HistoryLabelRemoved
57
+ */
58
+ public function setLabelsRemoved($labelsRemoved)
59
+ {
60
+ $this->labelsRemoved = $labelsRemoved;
61
+ }
62
+ /**
63
+ * @return Google_Service_Gmail_HistoryLabelRemoved
64
+ */
65
+ public function getLabelsRemoved()
66
+ {
67
+ return $this->labelsRemoved;
68
+ }
69
+ /**
70
+ * @param Google_Service_Gmail_Message
71
+ */
72
+ public function setMessages($messages)
73
+ {
74
+ $this->messages = $messages;
75
+ }
76
+ /**
77
+ * @return Google_Service_Gmail_Message
78
+ */
79
+ public function getMessages()
80
+ {
81
+ return $this->messages;
82
+ }
83
+ /**
84
+ * @param Google_Service_Gmail_HistoryMessageAdded
85
+ */
86
+ public function setMessagesAdded($messagesAdded)
87
+ {
88
+ $this->messagesAdded = $messagesAdded;
89
+ }
90
+ /**
91
+ * @return Google_Service_Gmail_HistoryMessageAdded
92
+ */
93
+ public function getMessagesAdded()
94
+ {
95
+ return $this->messagesAdded;
96
+ }
97
+ /**
98
+ * @param Google_Service_Gmail_HistoryMessageDeleted
99
+ */
100
+ public function setMessagesDeleted($messagesDeleted)
101
+ {
102
+ $this->messagesDeleted = $messagesDeleted;
103
+ }
104
+ /**
105
+ * @return Google_Service_Gmail_HistoryMessageDeleted
106
+ */
107
+ public function getMessagesDeleted()
108
+ {
109
+ return $this->messagesDeleted;
110
+ }
111
+ }
vendor/google/apiclient-services/src/Google/Service/Gmail/HistoryLabelAdded.php CHANGED
@@ -1,47 +1,47 @@
1
- <?php
2
- /*
3
- * Copyright 2014 Google Inc.
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6
- * use this file except in compliance with the License. You may obtain a copy of
7
- * the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
- * License for the specific language governing permissions and limitations under
15
- * the License.
16
- */
17
-
18
- class Google_Service_Gmail_HistoryLabelAdded extends Google_Collection
19
- {
20
- protected $collection_key = 'labelIds';
21
- public $labelIds;
22
- protected $messageType = 'Google_Service_Gmail_Message';
23
- protected $messageDataType = '';
24
-
25
- public function setLabelIds($labelIds)
26
- {
27
- $this->labelIds = $labelIds;
28
- }
29
- public function getLabelIds()
30
- {
31
- return $this->labelIds;
32
- }
33
- /**
34
- * @param Google_Service_Gmail_Message
35
- */
36
- public function setMessage(Google_Service_Gmail_Message $message)
37
- {
38
- $this->message = $message;
39
- }
40
- /**
41
- * @return Google_Service_Gmail_Message
42
- */
43
- public function getMessage()
44
- {
45
- return $this->message;
46
- }
47
- }
1
+ <?php
2
+ /*
3
+ * Copyright 2014 Google Inc.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6
+ * use this file except in compliance with the License. You may obtain a copy of
7
+ * the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
+ * License for the specific language governing permissions and limitations under
15
+ * the License.
16
+ */
17
+
18
+ class Google_Service_Gmail_HistoryLabelAdded extends Google_Collection
19
+ {
20
+ protected $collection_key = 'labelIds';
21
+ public $labelIds;
22
+ protected $messageType = 'Google_Service_Gmail_Message';
23
+ protected $messageDataType = '';
24
+
25
+ public function setLabelIds($labelIds)
26
+ {
27
+ $this->labelIds = $labelIds;
28
+ }
29
+ public function getLabelIds()
30
+ {
31
+ return $this->labelIds;
32
+ }
33
+ /**
34
+ * @param Google_Service_Gmail_Message
35
+ */
36
+ public function setMessage(Google_Service_Gmail_Message $message)
37
+ {
38
+ $this->message = $message;
39
+ }
40
+ /**
41
+ * @return Google_Service_Gmail_Message
42
+ */
43
+ public function getMessage()
44
+ {
45
+ return $this->message;
46
+ }
47
+ }
vendor/google/apiclient-services/src/Google/Service/Gmail/HistoryLabelRemoved.php CHANGED
@@ -1,47 +1,47 @@
1
- <?php
2
- /*
3
- * Copyright 2014 Google Inc.
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6
- * use this file except in compliance with the License. You may obtain a copy of
7
- * the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
- * License for the specific language governing permissions and limitations under
15
- * the License.
16
- */
17
-
18
- class Google_Service_Gmail_HistoryLabelRemoved extends Google_Collection
19
- {
20
- protected $collection_key = 'labelIds';
21
- public $labelIds;
22
- protected $messageType = 'Google_Service_Gmail_Message';
23
- protected $messageDataType = '';
24
-
25
- public function setLabelIds($labelIds)
26
- {
27
- $this->labelIds = $labelIds;
28
- }
29
- public function getLabelIds()
30
- {
31
- return $this->labelIds;
32
- }
33
- /**
34
- * @param Google_Service_Gmail_Message
35
- */
36
- public function setMessage(Google_Service_Gmail_Message $message)
37
- {
38
- $this->message = $message;
39
- }
40
- /**
41
- * @return Google_Service_Gmail_Message
42
- */
43
- public function getMessage()
44
- {
45
- return $this->message;
46
- }
47
- }
1
+ <?php
2
+ /*
3
+ * Copyright 2014 Google Inc.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6
+ * use this file except in compliance with the License. You may obtain a copy of
7
+ * the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
+ * License for the specific language governing permissions and limitations under
15
+ * the License.
16
+ */
17
+
18
+ class Google_Service_Gmail_HistoryLabelRemoved extends Google_Collection
19
+ {
20
+ protected $collection_key = 'labelIds';
21
+ public $labelIds;
22
+ protected $messageType = 'Google_Service_Gmail_Message';
23
+ protected $messageDataType = '';
24
+
25
+ public function setLabelIds($labelIds)
26
+ {
27
+ $this->labelIds = $labelIds;
28
+ }
29
+ public function getLabelIds()
30
+ {
31
+ return $this->labelIds;
32
+ }
33
+ /**
34
+ * @param Google_Service_Gmail_Message
35
+ */
36
+ public function setMessage(Google_Service_Gmail_Message $message)
37
+ {
38
+ $this->message = $message;
39
+ }
40
+ /**
41
+ * @return Google_Service_Gmail_Message
42
+ */
43
+ public function getMessage()
44
+ {
45
+ return $this->message;
46
+ }
47
+ }
vendor/google/apiclient-services/src/Google/Service/Gmail/HistoryMessageAdded.php CHANGED
@@ -1,37 +1,37 @@
1
- <?php
2
- /*
3
- * Copyright 2014 Google Inc.
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6
- * use this file except in compliance with the License. You may obtain a copy of
7
- * the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
- * License for the specific language governing permissions and limitations under
15
- * the License.
16
- */
17
-
18
- class Google_Service_Gmail_HistoryMessageAdded extends Google_Model
19
- {
20
- protected $messageType = 'Google_Service_Gmail_Message';
21
- protected $messageDataType = '';
22
-
23
- /**
24
- * @param Google_Service_Gmail_Message
25
- */
26
- public function setMessage(Google_Service_Gmail_Message $message)
27
- {
28
- $this->message = $message;
29
- }
30
- /**
31
- * @return Google_Service_Gmail_Message
32
- */
33
- public function getMessage()
34
- {
35
- return $this->message;
36
- }
37
- }
1
+ <?php
2
+ /*
3
+ * Copyright 2014 Google Inc.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6
+ * use this file except in compliance with the License. You may obtain a copy of
7
+ * the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
+ * License for the specific language governing permissions and limitations under
15
+ * the License.
16
+ */
17
+
18
+ class Google_Service_Gmail_HistoryMessageAdded extends Google_Model
19
+ {
20
+ protected $messageType = 'Google_Service_Gmail_Message';
21
+ protected $messageDataType = '';
22
+
23
+ /**
24
+ * @param Google_Service_Gmail_Message
25
+ */
26
+ public function setMessage(Google_Service_Gmail_Message $message)
27
+ {
28
+ $this->message = $message;
29
+ }
30
+ /**
31
+ * @return Google_Service_Gmail_Message
32
+ */
33
+ public function getMessage()
34
+ {
35
+ return $this->message;
36
+ }
37
+ }
vendor/google/apiclient-services/src/Google/Service/Gmail/HistoryMessageDeleted.php CHANGED
@@ -1,37 +1,37 @@
1
- <?php
2
- /*
3
- * Copyright 2014 Google Inc.
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6
- * use this file except in compliance with the License. You may obtain a copy of
7
- * the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
- * License for the specific language governing permissions and limitations under
15
- * the License.
16
- */
17
-
18
- class Google_Service_Gmail_HistoryMessageDeleted extends Google_Model
19
- {
20
- protected $messageType = 'Google_Service_Gmail_Message';
21
- protected $messageDataType = '';
22
-
23
- /**
24
- * @param Google_Service_Gmail_Message
25
- */
26
- public function setMessage(Google_Service_Gmail_Message $message)
27
- {
28
- $this->message = $message;
29
- }
30
- /**
31
- * @return Google_Service_Gmail_Message
32
- */
33
- public function getMessage()
34
- {
35
- return $this->message;
36
- }
37
- }
1
+ <?php
2
+ /*
3
+ * Copyright 2014 Google Inc.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6
+ * use this file except in compliance with the License. You may obtain a copy of
7
+ * the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
+ * License for the specific language governing permissions and limitations under
15
+ * the License.
16
+ */
17
+
18
+ class Google_Service_Gmail_HistoryMessageDeleted extends Google_Model
19
+ {
20
+ protected $messageType = 'Google_Service_Gmail_Message';
21
+ protected $messageDataType = '';
22
+
23
+ /**
24
+ * @param Google_Service_Gmail_Message
25
+ */
26
+ public function setMessage(Google_Service_Gmail_Message $message)
27
+ {
28
+ $this->message = $message;
29
+ }
30
+ /**
31
+ * @return Google_Service_Gmail_Message
32
+ */
33
+ public function getMessage()
34
+ {
35
+ return $this->message;
36
+ }
37
+ }
vendor/google/apiclient-services/src/Google/Service/Gmail/ImapSettings.php CHANGED
@@ -1,57 +1,57 @@
1
- <?php
2
- /*
3
- * Copyright 2014 Google Inc.
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6
- * use this file except in compliance with the License. You may obtain a copy of
7
- * the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
- * License for the specific language governing permissions and limitations under
15
- * the License.
16
- */
17
-
18
- class Google_Service_Gmail_ImapSettings extends Google_Model
19
- {
20
- public $autoExpunge;
21
- public $enabled;
22
- public $expungeBehavior;
23
- public $maxFolderSize;
24
-
25
- public function setAutoExpunge($autoExpunge)
26
- {
27
- $this->autoExpunge = $autoExpunge;
28
- }
29
- public function getAutoExpunge()
30
- {
31
- return $this->autoExpunge;
32
- }
33
- public function setEnabled($enabled)
34
- {
35
- $this->enabled = $enabled;
36
- }
37
- public function getEnabled()
38
- {
39
- return $this->enabled;
40
- }
41
- public function setExpungeBehavior($expungeBehavior)
42
- {
43
- $this->expungeBehavior = $expungeBehavior;
44
- }
45
- public function getExpungeBehavior()
46
- {
47
- return $this->expungeBehavior;
48
- }
49
- public function setMaxFolderSize($maxFolderSize)
50
- {
51
- $this->maxFolderSize = $maxFolderSize;
52
- }
53
- public function getMaxFolderSize()
54
- {
55
- return $this->maxFolderSize;
56
- }
57
- }
1
+ <?php
2
+ /*
3
+ * Copyright 2014 Google Inc.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6
+ * use this file except in compliance with the License. You may obtain a copy of
7
+ * the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
+ * License for the specific language governing permissions and limitations under
15
+ * the License.
16
+ */
17
+
18
+ class Google_Service_Gmail_ImapSettings extends Google_Model
19
+ {
20
+ public $autoExpunge;
21
+ public $enabled;
22
+ public $expungeBehavior;
23
+ public $maxFolderSize;
24
+
25
+ public function setAutoExpunge($autoExpunge)
26
+ {
27
+ $this->autoExpunge = $autoExpunge;
28
+ }
29
+ public function getAutoExpunge()
30
+ {
31
+ return $this->autoExpunge;
32
+ }
33
+ public function setEnabled($enabled)
34
+ {
35
+ $this->enabled = $enabled;
36
+ }
37
+ public function getEnabled()
38
+ {
39
+ return $this->enabled;
40
+ }
41
+ public function setExpungeBehavior($expungeBehavior)
42
+ {
43
+ $this->expungeBehavior = $expungeBehavior;
44
+ }
45
+ public function getExpungeBehavior()
46
+ {
47
+ return $this->expungeBehavior;
48
+ }
49
+ public function setMaxFolderSize($maxFolderSize)
50
+ {
51
+ $this->maxFolderSize = $maxFolderSize;
52
+ }
53
+ public function getMaxFolderSize()
54
+ {
55
+ return $this->maxFolderSize;
56
+ }
57
+ }
vendor/google/apiclient-services/src/Google/Service/Gmail/Label.php CHANGED
@@ -1,118 +1,118 @@
1
- <?php
2
- /*
3
- * Copyright 2014 Google Inc.
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6
- * use this file except in compliance with the License. You may obtain a copy of
7
- * the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
- * License for the specific language governing permissions and limitations under
15
- * the License.
16
- */
17
-
18
- class Google_Service_Gmail_Label extends Google_Model
19
- {
20
- protected $colorType = 'Google_Service_Gmail_LabelColor';
21
- protected $colorDataType = '';
22
- public $id;
23
- public $labelListVisibility;
24
- public $messageListVisibility;
25
- public $messagesTotal;
26
- public $messagesUnread;
27
- public $name;
28
- public $threadsTotal;
29
- public $threadsUnread;
30
- public $type;
31
-
32
- /**
33
- * @param Google_Service_Gmail_LabelColor
34
- */
35
- public function setColor(Google_Service_Gmail_LabelColor $color)
36
- {
37
- $this->color = $color;
38
- }
39
- /**
40
- * @return Google_Service_Gmail_LabelColor
41
- */
42
- public function getColor()
43
- {
44
- return $this->color;
45
- }
46
- public function setId($id)
47
- {
48
- $this->id = $id;
49
- }
50
- public function getId()
51
- {
52
- return $this->id;
53
- }
54
- public function setLabelListVisibility($labelListVisibility)
55
- {
56
- $this->labelListVisibility = $labelListVisibility;
57
- }
58
- public function getLabelListVisibility()
59
- {
60
- return $this->labelListVisibility;
61
- }
62
- public function setMessageListVisibility($messageListVisibility)
63
- {
64
- $this->messageListVisibility = $messageListVisibility;
65
- }
66
- public function getMessageListVisibility()
67
- {
68
- return $this->messageListVisibility;
69
- }
70
- public function setMessagesTotal($messagesTotal)
71
- {
72
- $this->messagesTotal = $messagesTotal;
73
- }
74
- public function getMessagesTotal()
75
- {
76
- return $this->messagesTotal;
77
- }
78
- public function setMessagesUnread($messagesUnread)
79
- {
80
- $this->messagesUnread = $messagesUnread;
81
- }
82
- public function getMessagesUnread()
83
- {
84
- return $this->messagesUnread;
85
- }
86
- public function setName($name)
87
- {
88
- $this->name = $name;
89
- }
90
- public function getName()
91
- {
92
- return $this->name;
93
- }
94
- public function setThreadsTotal($threadsTotal)
95
- {
96
- $this->threadsTotal = $threadsTotal;
97
- }
98
- public function getThreadsTotal()
99
- {
100
- return $this->threadsTotal;
101
- }
102
- public function setThreadsUnread($threadsUnread)
103
- {
104
- $this->threadsUnread = $threadsUnread;
105
- }
106
- public function getThreadsUnread()
107
- {
108
- return $this->threadsUnread;
109
- }
110
- public function setType($type)
111
- {
112
- $this->type = $type;
113
- }
114
- public function getType()
115
- {
116
- return $this->type;
117
- }
118
- }
1
+ <?php
2
+ /*
3
+ * Copyright 2014 Google Inc.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6
+ * use this file except in compliance with the License. You may obtain a copy of
7
+ * the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
+ * License for the specific language governing permissions and limitations under
15
+ * the License.
16
+ */
17
+
18
+ class Google_Service_Gmail_Label extends Google_Model
19
+ {
20
+ protected $colorType = 'Google_Service_Gmail_LabelColor';
21
+ protected $colorDataType = '';
22
+ public $id;
23
+ public $labelListVisibility;
24
+ public $messageListVisibility;
25
+ public $messagesTotal;
26
+ public $messagesUnread;
27
+ public $name;
28
+ public $threadsTotal;
29
+ public $threadsUnread;
30
+ public $type;
31
+
32
+ /**
33
+ * @param Google_Service_Gmail_LabelColor
34
+ */
35
+ public function setColor(Google_Service_Gmail_LabelColor $color)
36
+ {
37
+ $this->color = $color;
38
+ }
39
+ /**
40
+ * @return Google_Service_Gmail_LabelColor
41
+ */
42
+ public function getColor()
43
+ {
44
+ return $this->color;
45
+ }
46
+ public function setId($id)
47
+ {
48
+ $this->id = $id;
49
+ }
50
+ public function getId()
51
+ {
52
+ return $this->id;
53
+ }
54
+ public function setLabelListVisibility($labelListVisibility)
55
+ {
56
+ $this->labelListVisibility = $labelListVisibility;
57
+ }
58
+ public function getLabelListVisibility()
59
+ {
60
+ return $this->labelListVisibility;
61
+ }
62
+ public function setMessageListVisibility($messageListVisibility)
63
+ {
64
+ $this->messageListVisibility = $messageListVisibility;
65
+ }
66
+ public function getMessageListVisibility()
67
+ {
68
+ return $this->messageListVisibility;
69
+ }
70
+ public function setMessagesTotal($messagesTotal)
71
+ {
72
+ $this->messagesTotal = $messagesTotal;
73
+ }
74
+ public function getMessagesTotal()
75
+ {
76
+ return $this->messagesTotal;
77
+ }
78
+ public function setMessagesUnread($messagesUnread)
79
+ {
80
+ $this->messagesUnread = $messagesUnread;
81
+ }
82
+ public function getMessagesUnread()
83
+ {
84
+ return $this->messagesUnread;
85
+ }
86
+ public function setName($name)
87
+ {
88
+ $this->name = $name;
89
+ }
90
+ public function getName()
91
+ {
92
+ return $this->name;
93
+ }
94
+ public function setThreadsTotal($threadsTotal)
95
+ {
96
+ $this->threadsTotal = $threadsTotal;
97
+ }
98
+ public function getThreadsTotal()
99
+ {
100
+ return $this->threadsTotal;
101
+ }
102
+ public function setThreadsUnread($threadsUnread)
103
+ {
104
+ $this->threadsUnread = $threadsUnread;
105
+ }
106
+ public function getThreadsUnread()
107
+ {
108
+ return $this->threadsUnread;
109
+ }
110
+ public function setType($type)
111
+ {
112
+ $this->type = $type;
113
+ }
114
+ public function getType()
115
+ {
116
+ return $this->type;
117
+ }
118
+ }
vendor/google/apiclient-services/src/Google/Service/Gmail/LabelColor.php CHANGED
@@ -1,39 +1,39 @@
1
- <?php
2
- /*
3
- * Copyright 2014 Google Inc.
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6
- * use this file except in compliance with the License. You may obtain a copy of
7
- * the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
- * License for the specific language governing permissions and limitations under
15
- * the License.
16
- */
17
-
18
- class Google_Service_Gmail_LabelColor extends Google_Model
19
- {
20
- public $backgroundColor;
21
- public $textColor;
22
-
23
- public function setBackgroundColor($backgroundColor)
24
- {
25
- $this->backgroundColor = $backgroundColor;
26
- }
27
- public function getBackgroundColor()
28
- {
29
- return $this->backgroundColor;
30
- }
31
- public function setTextColor($textColor)
32
- {
33
- $this->textColor = $textColor;
34
- }
35
- public function getTextColor()
36
- {
37
- return $this->textColor;
38
- }
39
- }
1
+ <?php
2
+ /*
3
+ * Copyright 2014 Google Inc.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6
+ * use this file except in compliance with the License. You may obtain a copy of
7
+ * the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
+ * License for the specific language governing permissions and limitations under
15
+ * the License.
16
+ */
17
+
18
+ class Google_Service_Gmail_LabelColor extends Google_Model
19
+ {
20
+ public $backgroundColor;
21
+ public $textColor;
22
+
23
+ public function setBackgroundColor($backgroundColor)
24
+ {
25
+ $this->backgroundColor = $backgroundColor;
26
+ }
27
+ public function getBackgroundColor()
28
+ {
29
+ return $this->backgroundColor;
30
+ }
31
+ public function setTextColor($textColor)
32
+ {
33
+ $this->textColor = $textColor;
34
+ }
35
+ public function getTextColor()
36
+ {
37
+ return $this->textColor;
38
+ }
39
+ }
vendor/google/apiclient-services/src/Google/Service/Gmail/LanguageSettings.php CHANGED
@@ -1,30 +1,30 @@
1
- <?php
2
- /*
3
- * Copyright 2014 Google Inc.
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6
- * use this file except in compliance with the License. You may obtain a copy of
7
- * the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
- * License for the specific language governing permissions and limitations under
15
- * the License.
16
- */
17
-
18
- class Google_Service_Gmail_LanguageSettings extends Google_Model
19
- {
20
- public $displayLanguage;
21
-
22
- public function setDisplayLanguage($displayLanguage)
23
- {
24
- $this->displayLanguage = $displayLanguage;
25
- }
26
- public function getDisplayLanguage()
27
- {
28
- return $this->displayLanguage;
29
- }
30
- }
1
+ <?php
2
+ /*
3
+ * Copyright 2014 Google Inc.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6
+ * use this file except in compliance with the License. You may obtain a copy of
7
+ * the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
+ * License for the specific language governing permissions and limitations under
15
+ * the License.
16
+ */
17
+
18
+ class Google_Service_Gmail_LanguageSettings extends Google_Model
19
+ {
20
+ public $displayLanguage;
21
+
22
+ public function setDisplayLanguage($displayLanguage)
23
+ {
24
+ $this->displayLanguage = $displayLanguage;
25
+ }
26
+ public function getDisplayLanguage()
27
+ {
28
+ return $this->displayLanguage;
29
+ }
30
+ }
vendor/google/apiclient-services/src/Google/Service/Gmail/ListDelegatesResponse.php CHANGED
@@ -1,38 +1,38 @@
1
- <?php
2
- /*
3
- * Copyright 2014 Google Inc.
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6
- * use this file except in compliance with the License. You may obtain a copy of
7
- * the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
- * License for the specific language governing permissions and limitations under
15
- * the License.
16
- */
17
-
18
- class Google_Service_Gmail_ListDelegatesResponse extends Google_Collection
19
- {
20
- protected $collection_key = 'delegates';
21
- protected $delegatesType = 'Google_Service_Gmail_Delegate';
22
- protected $delegatesDataType = 'array';
23
-
24
- /**
25
- * @param Google_Service_Gmail_Delegate
26
- */
27
- public function setDelegates($delegates)
28
- {
29
- $this->delegates = $delegates;
30
- }
31
- /**
32
- * @return Google_Service_Gmail_Delegate
33
- */
34
- public function getDelegates()
35
- {
36
- return $this->delegates;
37
- }
38
- }
1
+ <?php
2
+ /*
3
+ * Copyright 2014 Google Inc.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6
+ * use this file except in compliance with the License. You may obtain a copy of
7
+ * the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
+ * License for the specific language governing permissions and limitations under
15
+ * the License.
16
+ */
17
+
18
+ class Google_Service_Gmail_ListDelegatesResponse extends Google_Collection
19
+ {
20
+ protected $collection_key = 'delegates';
21
+ protected $delegatesType = 'Google_Service_Gmail_Delegate';
22
+ protected $delegatesDataType = 'array';
23
+
24
+ /**
25
+ * @param Google_Service_Gmail_Delegate
26
+ */
27
+ public function setDelegates($delegates)
28
+ {
29
+ $this->delegates = $delegates;
30
+ }
31
+ /**
32
+ * @return Google_Service_Gmail_Delegate
33
+ */
34
+ public function getDelegates()
35
+ {
36
+ return $this->delegates;
37
+ }
38
+ }
vendor/google/apiclient-services/src/Google/Service/Gmail/ListDraftsResponse.php CHANGED
@@ -1,56 +1,56 @@
1
- <?php
2
- /*
3
- * Copyright 2014 Google Inc.
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6
- * use this file except in compliance with the License. You may obtain a copy of
7
- * the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
- * License for the specific language governing permissions and limitations under
15
- * the License.
16
- */
17
-
18
- class Google_Service_Gmail_ListDraftsResponse extends Google_Collection
19
- {
20
- protected $collection_key = 'drafts';
21
- protected $draftsType = 'Google_Service_Gmail_Draft';
22
- protected $draftsDataType = 'array';
23
- public $nextPageToken;
24
- public $resultSizeEstimate;
25
-
26
- /**
27
- * @param Google_Service_Gmail_Draft
28
- */
29
- public function setDrafts($drafts)
30
- {
31
- $this->drafts = $drafts;
32
- }
33
- /**
34
- * @return Google_Service_Gmail_Draft
35
- */
36
- public function getDrafts()
37
- {
38
- return $this->drafts;
39
- }
40
- public function setNextPageToken($nextPageToken)
41
- {
42
- $this->nextPageToken = $nextPageToken;
43
- }
44
- public function getNextPageToken()
45
- {
46
- return $this->nextPageToken;
47
- }
48
- public function setResultSizeEstimate($resultSizeEstimate)
49
- {
50
- $this->resultSizeEstimate = $resultSizeEstimate;
51
- }
52
- public function getResultSizeEstimate()
53
- {
54
- return $this->resultSizeEstimate;
55
- }
56
- }
1
+ <?php
2
+ /*
3
+ * Copyright 2014 Google Inc.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6
+ * use this file except in compliance with the License. You may obtain a copy of
7
+ * the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
+ * License for the specific language governing permissions and limitations under
15
+ * the License.
16
+ */
17
+
18
+ class Google_Service_Gmail_ListDraftsResponse extends Google_Collection
19
+ {
20
+ protected $collection_key = 'drafts';
21
+ protected $draftsType = 'Google_Service_Gmail_Draft';
22
+ protected $draftsDataType = 'array';
23
+ public $nextPageToken;
24
+ public $resultSizeEstimate;
25
+
26
+ /**
27
+ * @param Google_Service_Gmail_Draft
28
+ */
29
+ public function setDrafts($drafts)
30
+ {
31
+ $this->drafts = $drafts;
32
+ }
33
+ /**
34
+ * @return Google_Service_Gmail_Draft
35
+ */
36
+ public function getDrafts()
37
+ {
38
+ return $this->drafts;
39
+ }
40
+ public function setNextPageToken($nextPageToken)
41
+ {
42
+ $this->nextPageToken = $nextPageToken;
43
+ }
44
+ public function getNextPageToken()
45
+ {
46
+ return $this->nextPageToken;
47
+ }
48
+ public function setResultSizeEstimate($resultSizeEstimate)
49
+ {
50
+ $this->resultSizeEstimate = $resultSizeEstimate;
51
+ }
52
+ public function getResultSizeEstimate()
53
+ {
54
+ return $this->resultSizeEstimate;
55
+ }
56
+ }
vendor/google/apiclient-services/src/Google/Service/Gmail/ListFiltersResponse.php CHANGED
@@ -1,38 +1,38 @@
1
- <?php
2
- /*
3
- * Copyright 2014 Google Inc.
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6
- * use this file except in compliance with the License. You may obtain a copy of
7
- * the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
- * License for the specific language governing permissions and limitations under
15
- * the License.
16
- */
17
-
18
- class Google_Service_Gmail_ListFiltersResponse extends Google_Collection
19
- {
20
- protected $collection_key = 'filter';
21
- protected $filterType = 'Google_Service_Gmail_Filter';
22
- protected $filterDataType = 'array';
23
-
24
- /**
25
- * @param Google_Service_Gmail_Filter
26
- */
27
- public function setFilter($filter)
28
- {
29
- $this->filter = $filter;
30
- }
31
- /**
32
- * @return Google_Service_Gmail_Filter
33
- */
34
- public function getFilter()
35
- {
36
- return $this->filter;
37
- }
38
- }
1
+ <?php
2
+ /*
3
+ * Copyright 2014 Google Inc.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6
+ * use this file except in compliance with the License. You may obtain a copy of
7
+ * the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
+ * License for the specific language governing permissions and limitations under
15
+ * the License.
16
+ */
17
+
18
+ class Google_Service_Gmail_ListFiltersResponse extends Google_Collection
19
+ {
20
+ protected $collection_key = 'filter';
21
+ protected $filterType = 'Google_Service_Gmail_Filter';
22
+ protected $filterDataType = 'array';
23
+
24
+ /**
25
+ * @param Google_Service_Gmail_Filter
26
+ */
27
+ public function setFilter($filter)
28
+ {
29
+ $this->filter = $filter;
30
+ }
31
+ /**
32
+ * @return Google_Service_Gmail_Filter
33
+ */
34
+ public function getFilter()
35
+ {
36
+ return $this->filter;
37
+ }
38
+ }
vendor/google/apiclient-services/src/Google/Service/Gmail/ListForwardingAddressesResponse.php CHANGED
@@ -1,38 +1,38 @@
1
- <?php
2
- /*
3
- * Copyright 2014 Google Inc.
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6
- * use this file except in compliance with the License. You may obtain a copy of
7
- * the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
- * License for the specific language governing permissions and limitations under
15
- * the License.
16
- */
17
-
18
- class Google_Service_Gmail_ListForwardingAddressesResponse extends Google_Collection
19
- {
20
- protected $collection_key = 'forwardingAddresses';
21
- protected $forwardingAddressesType = 'Google_Service_Gmail_ForwardingAddress';
22
- protected $forwardingAddressesDataType = 'array';
23
-
24
- /**
25
- * @param Google_Service_Gmail_ForwardingAddress
26
- */
27
- public function setForwardingAddresses($forwardingAddresses)
28
- {
29
- $this->forwardingAddresses = $forwardingAddresses;
30
- }
31
- /**
32
- * @return Google_Service_Gmail_ForwardingAddress
33
- */
34
- public function getForwardingAddresses()
35
- {
36
- return $this->forwardingAddresses;
37
- }
38
- }
1
+ <?php
2
+ /*
3
+ * Copyright 2014 Google Inc.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6
+ * use this file except in compliance with the License. You may obtain a copy of
7
+ * the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
+ * License for the specific language governing permissions and limitations under
15
+ * the License.
16
+ */
17
+
18
+ class Google_Service_Gmail_ListForwardingAddressesResponse extends Google_Collection
19
+ {
20
+ protected $collection_key = 'forwardingAddresses';
21
+ protected $forwardingAddressesType = 'Google_Service_Gmail_ForwardingAddress';
22
+ protected $forwardingAddressesDataType = 'array';
23
+
24
+ /**
25
+ * @param Google_Service_Gmail_ForwardingAddress
26
+ */
27
+ public function setForwardingAddresses($forwardingAddresses)
28
+ {
29
+ $this->forwardingAddresses = $forwardingAddresses;
30
+ }
31
+ /**
32
+ * @return Google_Service_Gmail_ForwardingAddress
33
+ */
34
+ public function getForwardingAddresses()
35
+ {
36
+ return $this->forwardingAddresses;
37
+ }
38
+ }
vendor/google/apiclient-services/src/Google/Service/Gmail/ListHistoryResponse.php CHANGED
@@ -1,56 +1,56 @@
1
- <?php
2
- /*
3
- * Copyright 2014 Google Inc.
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6
- * use this file except in compliance with the License. You may obtain a copy of
7
- * the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
- * License for the specific language governing permissions and limitations under
15
- * the License.
16
- */
17
-
18
- class Google_Service_Gmail_ListHistoryResponse extends Google_Collection
19
- {
20
- protected $collection_key = 'history';
21
- protected $historyType = 'Google_Service_Gmail_History';
22
- protected $historyDataType = 'array';
23
- public $historyId;
24
- public $nextPageToken;
25
-
26
- /**
27
- * @param Google_Service_Gmail_History
28
- */
29
- public function setHistory($history)
30
- {
31
- $this->history = $history;
32
- }
33
- /**
34
- * @return Google_Service_Gmail_History
35
- */
36
- public function getHistory()
37
- {
38
- return $this->history;
39
- }
40
- public function setHistoryId($historyId)
41
- {
42
- $this->historyId = $historyId;
43
- }
44
- public function getHistoryId()
45
- {
46
- return $this->historyId;
47
- }
48
- public function setNextPageToken($nextPageToken)
49
- {
50
- $this->nextPageToken = $nextPageToken;
51
- }
52
- public function getNextPageToken()
53
- {
54
- return $this->nextPageToken;
55
- }
56
- }
1
+ <?php
2
+ /*
3
+ * Copyright 2014 Google Inc.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6
+ * use this file except in compliance with the License. You may obtain a copy of
7
+ * the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
+ * License for the specific language governing permissions and limitations under
15
+ * the License.
16
+ */
17
+
18
+ class Google_Service_Gmail_ListHistoryResponse extends Google_Collection
19
+ {
20
+ protected $collection_key = 'history';
21
+ protected $historyType = 'Google_Service_Gmail_History';
22
+ protected $historyDataType = 'array';
23
+ public $historyId;
24
+ public $nextPageToken;
25
+
26
+ /**
27
+ * @param Google_Service_Gmail_History
28
+ */
29
+ public function setHistory($history)
30
+ {
31
+ $this->history = $history;
32
+ }
33
+ /**
34
+ * @return Google_Service_Gmail_History
35
+ */
36
+ public function getHistory()
37
+ {
38
+ return $this->history;
39
+ }
40
+ public function setHistoryId($historyId)
41
+ {
42
+ $this->historyId = $historyId;
43
+ }
44
+ public function getHistoryId()
45
+ {
46
+ return $this->historyId;
47
+ }
48
+ public function setNextPageToken($nextPageToken)
49
+ {
50
+ $this->nextPageToken = $nextPageToken;
51
+ }
52
+ public function getNextPageToken()
53
+ {
54
+ return $this->nextPageToken;
55
+ }
56
+ }
vendor/google/apiclient-services/src/Google/Service/Gmail/ListLabelsResponse.php CHANGED
@@ -1,38 +1,38 @@
1
- <?php
2
- /*
3
- * Copyright 2014 Google Inc.
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6
- * use this file except in compliance with the License. You may obtain a copy of
7
- * the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
- * License for the specific language governing permissions and limitations under
15
- * the License.
16
- */
17
-
18
- class Google_Service_Gmail_ListLabelsResponse extends Google_Collection
19
- {
20
- protected $collection_key = 'labels';
21
- protected $labelsType = 'Google_Service_Gmail_Label';
22
- protected $labelsDataType = 'array';
23
-
24
- /**
25
- * @param Google_Service_Gmail_Label
26
- */
27
- public function setLabels($labels)
28
- {
29
- $this->labels = $labels;
30
- }
31
- /**
32
- * @return Google_Service_Gmail_Label
33
- */
34
- public function getLabels()
35
- {
36
- return $this->labels;
37
- }
38
- }
1
+ <?php
2
+ /*
3
+ * Copyright 2014 Google Inc.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6
+ * use this file except in compliance with the License. You may obtain a copy of
7
+ * the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
+ * License for the specific language governing permissions and limitations under
15
+ * the License.
16
+ */
17
+
18
+ class Google_Service_Gmail_ListLabelsResponse extends Google_Collection
19
+ {
20
+ protected $collection_key = 'labels';
21
+ protected $labelsType = 'Google_Service_Gmail_Label';
22
+ protected $labelsDataType = 'array';
23
+
24
+ /**
25
+ * @param Google_Service_Gmail_Label
26
+ */
27
+ public function setLabels($labels)
28
+ {
29
+ $this->labels = $labels;
30
+ }
31
+ /**
32
+ * @return Google_Service_Gmail_Label
33
+ */
34
+ public function getLabels()
35
+ {
36
+ return $this->labels;
37
+ }
38
+ }
vendor/google/apiclient-services/src/Google/Service/Gmail/ListMessagesResponse.php CHANGED
@@ -1,56 +1,56 @@
1
- <?php
2
- /*
3
- * Copyright 2014 Google Inc.
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6
- * use this file except in compliance with the License. You may obtain a copy of
7
- * the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
- * License for the specific language governing permissions and limitations under
15
- * the License.
16
- */
17
-
18
- class Google_Service_Gmail_ListMessagesResponse extends Google_Collection
19
- {
20
- protected $collection_key = 'messages';
21
- protected $messagesType = 'Google_Service_Gmail_Message';
22
- protected $messagesDataType = 'array';
23
- public $nextPageToken;
24
- public $resultSizeEstimate;
25
-
26
- /**
27
- * @param Google_Service_Gmail_Message
28
- */
29
- public function setMessages($messages)
30
- {
31
- $this->messages = $messages;
32
- }
33
- /**
34
- * @return Google_Service_Gmail_Message
35
- */
36
- public function getMessages()
37
- {
38
- return $this->messages;
39
- }
40
- public function setNextPageToken($nextPageToken)
41
- {
42
- $this->nextPageToken = $nextPageToken;
43
- }
44
- public function getNextPageToken()
45
- {
46
- return $this->nextPageToken;
47
- }
48
- public function setResultSizeEstimate($resultSizeEstimate)
49
- {
50
- $this->resultSizeEstimate = $resultSizeEstimate;
51
- }
52
- public function getResultSizeEstimate()
53
- {
54
- return $this->resultSizeEstimate;
55
- }
56
- }
1
+ <?php
2
+ /*
3
+ * Copyright 2014 Google Inc.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6
+ * use this file except in compliance with the License. You may obtain a copy of
7
+ * the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
+ * License for the specific language governing permissions and limitations under
15
+ * the License.
16
+ */
17
+
18
+ class Google_Service_Gmail_ListMessagesResponse extends Google_Collection
19
+ {
20
+ protected $collection_key = 'messages';
21
+ protected $messagesType = 'Google_Service_Gmail_Message';
22
+ protected $messagesDataType = 'array';
23
+ public $nextPageToken;
24
+ public $resultSizeEstimate;
25
+
26
+ /**
27
+ * @param Google_Service_Gmail_Message
28
+ */
29
+ public function setMessages($messages)
30
+ {
31
+ $this->messages = $messages;
32
+ }
33
+ /**
34
+ * @return Google_Service_Gmail_Message
35
+ */
36
+ public function getMessages()
37
+ {
38
+ return $this->messages;
39
+ }
40
+ public function setNextPageToken($nextPageToken)
41
+ {
42
+ $this->nextPageToken = $nextPageToken;
43
+ }
44
+ public function getNextPageToken()
45
+ {
46
+ return $this->nextPageToken;
47
+ }
48
+ public function setResultSizeEstimate($resultSizeEstimate)
49
+ {
50
+ $this->resultSizeEstimate = $resultSizeEstimate;
51
+ }
52
+ public function getResultSizeEstimate()
53
+ {
54
+ return $this->resultSizeEstimate;
55
+ }
56
+ }
vendor/google/apiclient-services/src/Google/Service/Gmail/ListSendAsResponse.php CHANGED
@@ -1,38 +1,38 @@
1
- <?php
2
- /*
3
- * Copyright 2014 Google Inc.
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6
- * use this file except in compliance with the License. You may obtain a copy of
7
- * the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
- * License for the specific language governing permissions and limitations under
15
- * the License.
16
- */
17
-
18
- class Google_Service_Gmail_ListSendAsResponse extends Google_Collection
19
- {
20
- protected $collection_key = 'sendAs';
21
- protected $sendAsType = 'Google_Service_Gmail_SendAs';
22
- protected $sendAsDataType = 'array';
23
-
24
- /**
25
- * @param Google_Service_Gmail_SendAs
26
- */
27
- public function setSendAs($sendAs)
28
- {
29
- $this->sendAs = $sendAs;
30
- }
31
- /**
32
- * @return Google_Service_Gmail_SendAs
33
- */
34
- public function getSendAs()
35
- {
36
- return $this->sendAs;
37
- }
38
- }
1
+ <?php
2
+ /*
3
+ * Copyright 2014 Google Inc.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6
+ * use this file except in compliance with the License. You may obtain a copy of
7
+ * the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
+ * License for the specific language governing permissions and limitations under
15
+ * the License.
16
+ */
17
+
18
+ class Google_Service_Gmail_ListSendAsResponse extends Google_Collection
19
+ {
20
+ protected $collection_key = 'sendAs';
21
+ protected $sendAsType = 'Google_Service_Gmail_SendAs';
22
+ protected $sendAsDataType = 'array';
23
+
24
+ /**
25
+ * @param Google_Service_Gmail_SendAs
26
+ */
27
+ public function setSendAs($sendAs)
28
+ {
29
+ $this->sendAs = $sendAs;
30
+ }
31
+ /**
32
+ * @return Google_Service_Gmail_SendAs
33
+ */
34
+ public function getSendAs()
35
+ {
36
+ return $this->sendAs;
37
+ }
38
+ }
vendor/google/apiclient-services/src/Google/Service/Gmail/ListSmimeInfoResponse.php CHANGED
@@ -1,38 +1,38 @@
1
- <?php
2
- /*
3
- * Copyright 2014 Google Inc.
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6
- * use this file except in compliance with the License. You may obtain a copy of
7
- * the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
- * License for the specific language governing permissions and limitations under
15
- * the License.
16
- */
17
-
18
- class Google_Service_Gmail_ListSmimeInfoResponse extends Google_Collection
19
- {
20
- protected $collection_key = 'smimeInfo';
21
- protected $smimeInfoType = 'Google_Service_Gmail_SmimeInfo';
22
- protected $smimeInfoDataType = 'array';
23
-
24
- /**
25
- * @param Google_Service_Gmail_SmimeInfo
26
- */
27
- public function setSmimeInfo($smimeInfo)
28
- {
29
- $this->smimeInfo = $smimeInfo;
30
- }
31
- /**
32
- * @return Google_Service_Gmail_SmimeInfo
33
- */
34
- public function getSmimeInfo()
35
- {
36
- return $this->smimeInfo;
37
- }
38
- }
1
+ <?php
2
+ /*
3
+ * Copyright 2014 Google Inc.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6
+ * use this file except in compliance with the License. You may obtain a copy of
7
+ * the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
+ * License for the specific language governing permissions and limitations under
15
+ * the License.
16
+ */
17
+
18
+ class Google_Service_Gmail_ListSmimeInfoResponse extends Google_Collection
19
+ {
20
+ protected $collection_key = 'smimeInfo';
21
+ protected $smimeInfoType = 'Google_Service_Gmail_SmimeInfo';
22
+ protected $smimeInfoDataType = 'array';
23
+
24
+ /**
25
+ * @param Google_Service_Gmail_SmimeInfo
26
+ */
27
+ public function setSmimeInfo($smimeInfo)
28
+ {
29
+ $this->smimeInfo = $smimeInfo;
30
+ }
31
+ /**
32
+ * @return Google_Service_Gmail_SmimeInfo
33
+ */
34
+ public function getSmimeInfo()
35
+ {
36
+ return $this->smimeInfo;
37
+ }
38
+ }
vendor/google/apiclient-services/src/Google/Service/Gmail/ListThreadsResponse.php CHANGED
@@ -1,56 +1,56 @@
1
- <?php
2
- /*
3
- * Copyright 2014 Google Inc.
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6
- * use this file except in compliance with the License. You may obtain a copy of
7
- * the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
- * License for the specific language governing permissions and limitations under
15
- * the License.
16
- */
17
-
18
- class Google_Service_Gmail_ListThreadsResponse extends Google_Collection
19
- {
20
- protected $collection_key = 'threads';
21
- public $nextPageToken;
22
- public $resultSizeEstimate;
23
- protected $threadsType = 'Google_Service_Gmail_Thread';
24
- protected $threadsDataType = 'array';
25
-
26
- public function setNextPageToken($nextPageToken)
27
- {
28
- $this->nextPageToken = $nextPageToken;
29
- }
30
- public function getNextPageToken()
31
- {
32
- return $this->nextPageToken;
33
- }
34
- public function setResultSizeEstimate($resultSizeEstimate)
35
- {
36
- $this->resultSizeEstimate = $resultSizeEstimate;
37
- }
38
- public function getResultSizeEstimate()
39
- {
40
- return $this->resultSizeEstimate;
41
- }
42
- /**
43
- * @param Google_Service_Gmail_Thread
44
- */
45
- public function setThreads($threads)
46
- {
47
- $this->threads = $threads;
48
- }
49
- /**
50
- * @return Google_Service_Gmail_Thread
51
- */
52
- public function getThreads()
53
- {
54
- return $this->threads;
55
- }
56
- }
1
+ <?php
2
+ /*
3
+ * Copyright 2014 Google Inc.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6
+ * use this file except in compliance with the License. You may obtain a copy of
7
+ * the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
+ * License for the specific language governing permissions and limitations under
15
+ * the License.
16
+ */
17
+
18
+ class Google_Service_Gmail_ListThreadsResponse extends Google_Collection
19
+ {
20
+ protected $collection_key = 'threads';
21
+ public $nextPageToken;
22
+ public $resultSizeEstimate;
23
+ protected $threadsType = 'Google_Service_Gmail_Thread';
24
+ protected $threadsDataType = 'array';
25
+
26
+ public function setNextPageToken($nextPageToken)
27
+ {
28
+ $this->nextPageToken = $nextPageToken;
29
+ }
30
+ public function getNextPageToken()
31
+ {
32
+ return $this->nextPageToken;
33
+ }
34
+ public function setResultSizeEstimate($resultSizeEstimate)
35
+ {
36
+ $this->resultSizeEstimate = $resultSizeEstimate;
37
+ }
38
+ public function getResultSizeEstimate()
39
+ {
40
+ return $this->resultSizeEstimate;
41
+ }
42
+ /**
43
+ * @param Google_Service_Gmail_Thread
44
+ */
45
+ public function setThreads($threads)
46
+ {
47
+ $this->threads = $threads;
48
+ }
49
+ /**
50
+ * @return Google_Service_Gmail_Thread
51
+ */
52
+ public function getThreads()
53
+ {
54
+ return $this->threads;
55
+ }
56
+ }
vendor/google/apiclient-services/src/Google/Service/Gmail/Message.php CHANGED
@@ -1,110 +1,110 @@
1
- <?php
2
- /*
3
- * Copyright 2014 Google Inc.
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6
- * use this file except in compliance with the License. You may obtain a copy of
7
- * the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
- * License for the specific language governing permissions and limitations under
15
- * the License.
16
- */
17
-
18
- class Google_Service_Gmail_Message extends Google_Collection
19
- {
20
- protected $collection_key = 'labelIds';
21
- public $historyId;
22
- public $id;
23
- public $internalDate;
24
- public $labelIds;
25
- protected $payloadType = 'Google_Service_Gmail_MessagePart';
26
- protected $payloadDataType = '';
27
- public $raw;
28
- public $sizeEstimate;
29
- public $snippet;
30
- public $threadId;
31
-
32
- public function setHistoryId($historyId)
33
- {
34
- $this->historyId = $historyId;
35
- }
36
- public function getHistoryId()
37
- {
38
- return $this->historyId;
39
- }
40
- public function setId($id)
41
- {
42
- $this->id = $id;
43
- }
44
- public function getId()
45
- {
46
- return $this->id;
47
- }
48
- public function setInternalDate($internalDate)
49
- {
50
- $this->internalDate = $internalDate;
51
- }
52
- public function getInternalDate()
53
- {
54
- return $this->internalDate;
55
- }
56
- public function setLabelIds($labelIds)
57
- {
58
- $this->labelIds = $labelIds;
59
- }
60
- public function getLabelIds()
61
- {
62
- return $this->labelIds;
63
- }
64
- /**
65
- * @param Google_Service_Gmail_MessagePart
66
- */
67
- public function setPayload(Google_Service_Gmail_MessagePart $payload)
68
- {
69
- $this->payload = $payload;
70
- }
71
- /**
72
- * @return Google_Service_Gmail_MessagePart
73
- */
74
- public function getPayload()
75
- {
76
- return $this->payload;
77
- }
78
- public function setRaw($raw)
79
- {
80
- $this->raw = $raw;
81
- }
82
- public function getRaw()
83
- {
84
- return $this->raw;
85
- }
86
- public function setSizeEstimate($sizeEstimate)
87
- {
88
- $this->sizeEstimate = $sizeEstimate;
89
- }
90
- public function getSizeEstimate()
91
- {
92
- return $this->sizeEstimate;
93
- }
94
- public function setSnippet($snippet)
95
- {
96
- $this->snippet = $snippet;
97
- }
98
- public function getSnippet()
99
- {
100
- return $this->snippet;
101
- }
102
- public function setThreadId($threadId)
103
- {
104
- $this->threadId = $threadId;
105
- }
106
- public function getThreadId()
107
- {
108
- return $this->threadId;
109
- }
110
- }
1
+ <?php
2
+ /*
3
+ * Copyright 2014 Google Inc.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6
+ * use this file except in compliance with the License. You may obtain a copy of
7
+ * the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
+ * License for the specific language governing permissions and limitations under
15
+ * the License.
16
+ */
17
+
18
+ class Google_Service_Gmail_Message extends Google_Collection
19
+ {
20
+ protected $collection_key = 'labelIds';
21
+ public $historyId;
22
+ public $id;
23
+ public $internalDate;
24
+ public $labelIds;
25
+ protected $payloadType = 'Google_Service_Gmail_MessagePart';
26
+ protected $payloadDataType = '';
27
+ public $raw;
28
+ public $sizeEstimate;
29
+ public $snippet;
30
+ public $threadId;
31
+
32
+ public function setHistoryId($historyId)
33
+ {
34
+ $this->historyId = $historyId;
35
+ }
36
+ public function getHistoryId()
37
+ {
38
+ return $this->historyId;
39
+ }
40
+ public function setId($id)
41
+ {
42
+ $this->id = $id;
43
+ }
44
+ public function getId()
45
+ {
46
+ return $this->id;
47
+ }
48
+ public function setInternalDate($internalDate)
49
+ {
50
+ $this->internalDate = $internalDate;
51
+ }
52
+ public function getInternalDate()
53
+ {
54
+ return $this->internalDate;
55
+ }
56
+ public function setLabelIds($labelIds)
57
+ {
58
+ $this->labelIds = $labelIds;
59
+ }
60
+ public function getLabelIds()
61
+ {
62
+ return $this->labelIds;
63
+ }
64
+ /**
65
+ * @param Google_Service_Gmail_MessagePart
66
+ */
67
+ public function setPayload(Google_Service_Gmail_MessagePart $payload)
68
+ {
69
+ $this->payload = $payload;
70
+ }
71
+ /**
72
+ * @return Google_Service_Gmail_MessagePart
73
+ */
74
+ public function getPayload()
75
+ {
76
+ return $this->payload;
77
+ }
78
+ public function setRaw($raw)
79
+ {
80
+ $this->raw = $raw;
81
+ }
82
+ public function getRaw()
83
+ {
84
+ return $this->raw;
85
+ }
86
+ public function setSizeEstimate($sizeEstimate)
87
+ {
88
+ $this->sizeEstimate = $sizeEstimate;
89
+ }
90
+ public function getSizeEstimate()
91
+ {
92
+ return $this->sizeEstimate;
93
+ }
94
+ public function setSnippet($snippet)
95
+ {
96
+ $this->snippet = $snippet;
97
+ }
98
+ public function getSnippet()
99
+ {
100
+ return $this->snippet;
101
+ }
102
+ public function setThreadId($threadId)
103
+ {
104
+ $this->threadId = $threadId;
105
+ }
106
+ public function getThreadId()
107
+ {
108
+ return $this->threadId;
109
+ }
110
+ }
vendor/google/apiclient-services/src/Google/Service/Gmail/MessagePart.php CHANGED
@@ -1,97 +1,97 @@
1
- <?php
2
- /*
3
- * Copyright 2014 Google Inc.
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6
- * use this file except in compliance with the License. You may obtain a copy of
7
- * the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
- * License for the specific language governing permissions and limitations under
15
- * the License.
16
- */
17
-
18
- class Google_Service_Gmail_MessagePart extends Google_Collection
19
- {
20
- protected $collection_key = 'parts';
21
- protected $bodyType = 'Google_Service_Gmail_MessagePartBody';
22
- protected $bodyDataType = '';
23
- public $filename;
24
- protected $headersType = 'Google_Service_Gmail_MessagePartHeader';
25
- protected $headersDataType = 'array';
26
- public $mimeType;
27
- public $partId;
28
- protected $partsType = 'Google_Service_Gmail_MessagePart';
29
- protected $partsDataType = 'array';
30
-
31
- /**
32
- * @param Google_Service_Gmail_MessagePartBody
33
- */
34
- public function setBody(Google_Service_Gmail_MessagePartBody $body)
35
- {
36
- $this->body = $body;
37
- }
38
- /**
39
- * @return Google_Service_Gmail_MessagePartBody
40
- */
41
- public function getBody()
42
- {
43
- return $this->body;
44
- }
45
- public function setFilename($filename)
46
- {
47
- $this->filename = $filename;
48
- }
49
- public function getFilename()
50
- {
51
- return $this->filename;
52
- }
53
- /**
54
- * @param Google_Service_Gmail_MessagePartHeader
55
- */
56
- public function setHeaders($headers)
57
- {
58
- $this->headers = $headers;
59
- }
60
- /**
61
- * @return Google_Service_Gmail_MessagePartHeader
62
- */
63
- public function getHeaders()
64
- {
65
- return $this->headers;
66
- }
67
- public function setMimeType($mimeType)
68
- {
69
- $this->mimeType = $mimeType;
70
- }
71
- public function getMimeType()
72
- {
73
- return $this->mimeType;
74
- }
75
- public function setPartId($partId)
76
- {
77
- $this->partId = $partId;
78
- }
79
- public function getPartId()
80
- {
81
- return $this->partId;
82
- }
83
- /**
84
- * @param Google_Service_Gmail_MessagePart
85
- */
86
- public function setParts($parts)
87
- {
88
- $this->parts = $parts;
89
- }
90
- /**
91
- * @return Google_Service_Gmail_MessagePart
92
- */
93
- public function getParts()
94
- {
95
- return $this->parts;
96
- }
97
- }
1
+ <?php
2
+ /*
3
+ * Copyright 2014 Google Inc.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6
+ * use this file except in compliance with the License. You may obtain a copy of
7
+ * the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
+ * License for the specific language governing permissions and limitations under
15
+ * the License.
16
+ */
17
+
18
+ class Google_Service_Gmail_MessagePart extends Google_Collection
19
+ {
20
+ protected $collection_key = 'parts';
21
+ protected $bodyType = 'Google_Service_Gmail_MessagePartBody';
22
+ protected $bodyDataType = '';
23
+ public $filename;
24
+ protected $headersType = 'Google_Service_Gmail_MessagePartHeader';
25
+ protected $headersDataType = 'array';
26
+ public $mimeType;
27
+ public $partId;
28
+ protected $partsType = 'Google_Service_Gmail_MessagePart';
29
+ protected $partsDataType = 'array';
30
+
31
+ /**
32
+ * @param Google_Service_Gmail_MessagePartBody
33
+ */
34
+ public function setBody(Google_Service_Gmail_MessagePartBody $body)
35
+ {
36
+ $this->body = $body;
37
+ }
38
+ /**
39
+ * @return Google_Service_Gmail_MessagePartBody
40
+ */
41
+ public function getBody()
42
+ {
43
+ return $this->body;
44
+ }
45
+ public function setFilename($filename)
46
+ {
47
+ $this->filename = $filename;
48
+ }
49
+ public function getFilename()
50
+ {
51
+ return $this->filename;
52
+ }
53
+ /**
54
+ * @param Google_Service_Gmail_MessagePartHeader
55
+ */
56
+ public function setHeaders($headers)
57
+ {
58
+ $this->headers = $headers;
59
+ }
60
+ /**
61
+ * @return Google_Service_Gmail_MessagePartHeader
62
+ */
63
+ public function getHeaders()
64
+ {
65
+ return $this->headers;
66
+ }
67
+ public function setMimeType($mimeType)
68
+ {
69
+ $this->mimeType = $mimeType;
70
+ }
71
+ public function getMimeType()
72
+ {
73
+ return $this->mimeType;
74
+ }
75
+ public function setPartId($partId)
76
+ {
77
+ $this->partId = $partId;
78
+ }
79
+ public function getPartId()
80
+ {
81
+ return $this->partId;
82
+ }
83
+ /**
84
+ * @param Google_Service_Gmail_MessagePart
85
+ */
86
+ public function setParts($parts)
87
+ {
88
+ $this->parts = $parts;
89
+ }
90
+ /**
91
+ * @return Google_Service_Gmail_MessagePart
92
+ */
93
+ public function getParts()
94
+ {
95
+ return $this->parts;
96
+ }
97
+ }
vendor/google/apiclient-services/src/Google/Service/Gmail/MessagePartBody.php CHANGED
@@ -1,48 +1,48 @@
1
- <?php
2
- /*
3
- * Copyright 2014 Google Inc.
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6
- * use this file except in compliance with the License. You may obtain a copy of
7
- * the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
- * License for the specific language governing permissions and limitations under
15
- * the License.
16
- */
17
-
18
- class Google_Service_Gmail_MessagePartBody extends Google_Model
19
- {
20
- public $attachmentId;
21
- public $data;
22
- public $size;
23
-
24
- public function setAttachmentId($attachmentId)
25
- {
26
- $this->attachmentId = $attachmentId;
27
- }
28
- public function getAttachmentId()
29
- {
30
- return $this->attachmentId;
31
- }
32
- public function setData($data)
33
- {
34
- $this->data = $data;
35
- }
36
- public function getData()
37
- {
38
- return $this->data;
39
- }
40
- public function setSize($size)
41
- {
42
- $this->size = $size;
43
- }
44
- public function getSize()
45
- {
46
- return $this->size;
47
- }
48
- }
1
+ <?php
2
+ /*
3
+ * Copyright 2014 Google Inc.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6
+ * use this file except in compliance with the License. You may obtain a copy of
7
+ * the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
+ * License for the specific language governing permissions and limitations under
15
+ * the License.
16
+ */
17
+
18
+ class Google_Service_Gmail_MessagePartBody extends Google_Model
19
+ {
20
+ public $attachmentId;
21
+ public $data;
22
+ public $size;
23
+
24
+ public function setAttachmentId($attachmentId)
25
+ {
26
+ $this->attachmentId = $attachmentId;
27
+ }
28
+ public function getAttachmentId()
29
+ {
30
+ return $this->attachmentId;
31
+ }
32
+ public function setData($data)
33
+ {
34
+ $this->data = $data;
35
+ }
36
+ public function getData()
37
+ {
38
+ return $this->data;
39
+ }
40
+ public function setSize($size)
41
+ {
42
+ $this->size = $size;
43
+ }
44
+ public function getSize()
45
+ {
46
+ return $this->size;
47
+ }
48
+ }
vendor/google/apiclient-services/src/Google/Service/Gmail/MessagePartHeader.php CHANGED
@@ -1,39 +1,39 @@
1
- <?php
2
- /*
3
- * Copyright 2014 Google Inc.
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6
- * use this file except in compliance with the License. You may obtain a copy of
7
- * the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
- * License for the specific language governing permissions and limitations under
15
- * the License.
16
- */
17
-
18
- class Google_Service_Gmail_MessagePartHeader extends Google_Model
19
- {
20
- public $name;
21
- public $value;
22
-
23
- public function setName($name)
24
- {
25
- $this->name = $name;
26
- }
27
- public function getName()
28
- {
29
- return $this->name;
30
- }
31
- public function setValue($value)
32
- {
33
- $this->value = $value;
34
- }
35
- public function getValue()
36
- {
37
- return $this->value;
38
- }
39
- }
1
+ <?php
2
+ /*
3
+ * Copyright 2014 Google Inc.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6
+ * use this file except in compliance with the License. You may obtain a copy of
7
+ * the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
+ * License for the specific language governing permissions and limitations under
15
+ * the License.
16
+ */
17
+
18
+ class Google_Service_Gmail_MessagePartHeader extends Google_Model
19
+ {
20
+ public $name;
21
+ public $value;
22
+
23
+ public function setName($name)
24
+ {
25
+ $this->name = $name;
26
+ }
27
+ public function getName()
28
+ {
29
+ return $this->name;
30
+ }
31
+ public function setValue($value)
32
+ {
33
+ $this->value = $value;
34
+ }
35
+ public function getValue()
36
+ {
37
+ return $this->value;
38
+ }
39
+ }
vendor/google/apiclient-services/src/Google/Service/Gmail/ModifyMessageRequest.php CHANGED
@@ -1,40 +1,40 @@
1
- <?php
2
- /*
3
- * Copyright 2014 Google Inc.
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6
- * use this file except in compliance with the License. You may obtain a copy of
7
- * the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
- * License for the specific language governing permissions and limitations under
15
- * the License.
16
- */
17
-
18
- class Google_Service_Gmail_ModifyMessageRequest extends Google_Collection
19
- {
20
- protected $collection_key = 'removeLabelIds';
21
- public $addLabelIds;
22
- public $removeLabelIds;
23
-
24
- public function setAddLabelIds($addLabelIds)
25
- {
26
- $this->addLabelIds = $addLabelIds;
27
- }
28
- public function getAddLabelIds()
29
- {
30
- return $this->addLabelIds;
31
- }
32
- public function setRemoveLabelIds($removeLabelIds)
33
- {
34
- $this->removeLabelIds = $removeLabelIds;
35
- }
36
- public function getRemoveLabelIds()
37
- {
38
- return $this->removeLabelIds;
39
- }
40
- }
1
+ <?php
2
+ /*
3
+ * Copyright 2014 Google Inc.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6
+ * use this file except in compliance with the License. You may obtain a copy of
7
+ * the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
+ * License for the specific language governing permissions and limitations under
15
+ * the License.
16
+ */
17
+
18
+ class Google_Service_Gmail_ModifyMessageRequest extends Google_Collection
19
+ {
20
+ protected $collection_key = 'removeLabelIds';
21
+ public $addLabelIds;
22
+ public $removeLabelIds;
23
+
24
+ public function setAddLabelIds($addLabelIds)
25
+ {
26
+ $this->addLabelIds = $addLabelIds;
27
+ }
28
+ public function getAddLabelIds()
29
+ {
30
+ return $this->addLabelIds;
31
+ }
32
+ public function setRemoveLabelIds($removeLabelIds)
33
+ {
34
+ $this->removeLabelIds = $removeLabelIds;
35
+ }
36
+ public function getRemoveLabelIds()
37
+ {
38
+ return $this->removeLabelIds;
39
+ }
40
+ }
vendor/google/apiclient-services/src/Google/Service/Gmail/ModifyThreadRequest.php CHANGED
@@ -1,40 +1,40 @@
1
- <?php
2
- /*
3
- * Copyright 2014 Google Inc.
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6
- * use this file except in compliance with the License. You may obtain a copy of
7
- * the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
- * License for the specific language governing permissions and limitations under
15
- * the License.
16
- */
17
-
18
- class Google_Service_Gmail_ModifyThreadRequest extends Google_Collection
19
- {
20
- protected $collection_key = 'removeLabelIds';
21
- public $addLabelIds;
22
- public $removeLabelIds;
23
-
24
- public function setAddLabelIds($addLabelIds)
25
- {
26
- $this->addLabelIds = $addLabelIds;
27
- }
28
- public function getAddLabelIds()
29
- {
30
- return $this->addLabelIds;
31
- }
32
- public function setRemoveLabelIds($removeLabelIds)
33
- {
34
- $this->removeLabelIds = $removeLabelIds;
35
- }
36
- public function getRemoveLabelIds()
37
- {
38
- return $this->removeLabelIds;
39
- }
40
- }
1
+ <?php
2
+ /*
3
+ * Copyright 2014 Google Inc.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6
+ * use this file except in compliance with the License. You may obtain a copy of
7
+ * the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
+ * License for the specific language governing permissions and limitations under
15
+ * the License.
16
+ */
17
+
18
+ class Google_Service_Gmail_ModifyThreadRequest extends Google_Collection
19
+ {
20
+ protected $collection_key = 'removeLabelIds';
21
+ public $addLabelIds;
22
+ public $removeLabelIds;
23
+
24
+ public function setAddLabelIds($addLabelIds)
25
+ {
26
+ $this->addLabelIds = $addLabelIds;
27
+ }
28
+ public function getAddLabelIds()
29
+ {
30
+ return $this->addLabelIds;
31
+ }
32
+ public function setRemoveLabelIds($removeLabelIds)
33
+ {
34
+ $this->removeLabelIds = $removeLabelIds;
35
+ }
36
+ public function getRemoveLabelIds()
37
+ {
38
+ return $this->removeLabelIds;
39
+ }
40
+ }
vendor/google/apiclient-services/src/Google/Service/Gmail/PopSettings.php CHANGED
@@ -1,39 +1,39 @@
1
- <?php
2
- /*
3
- * Copyright 2014 Google Inc.
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6
- * use this file except in compliance with the License. You may obtain a copy of
7
- * the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
- * License for the specific language governing permissions and limitations under
15
- * the License.
16
- */
17
-
18
- class Google_Service_Gmail_PopSettings extends Google_Model
19
- {
20
- public $accessWindow;
21
- public $disposition;
22
-
23
- public function setAccessWindow($accessWindow)
24
- {
25
- $this->accessWindow = $accessWindow;
26
- }
27
- public function getAccessWindow()
28
- {
29
- return $this->accessWindow;
30
- }
31
- public function setDisposition($disposition)
32
- {
33
- $this->disposition = $disposition;
34
- }
35
- public function getDisposition()
36
- {
37
- return $this->disposition;
38
- }
39
- }
1
+ <?php
2
+ /*
3
+ * Copyright 2014 Google Inc.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6
+ * use this file except in compliance with the License. You may obtain a copy of
7
+ * the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
+ * License for the specific language governing permissions and limitations under
15
+ * the License.
16
+ */
17
+
18
+ class Google_Service_Gmail_PopSettings extends Google_Model
19
+ {
20
+ public $accessWindow;
21
+ public $disposition;
22
+
23
+ public function setAccessWindow($accessWindow)
24
+ {
25
+ $this->accessWindow = $accessWindow;
26
+ }
27
+ public function getAccessWindow()
28
+ {
29
+ return $this->accessWindow;
30
+ }
31
+ public function setDisposition($disposition)
32
+ {
33
+ $this->disposition = $disposition;
34
+ }
35
+ public function getDisposition()
36
+ {
37
+ return $this->disposition;
38
+ }
39
+ }
vendor/google/apiclient-services/src/Google/Service/Gmail/Profile.php CHANGED
@@ -1,57 +1,57 @@
1
- <?php
2
- /*
3
- * Copyright 2014 Google Inc.
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6
- * use this file except in compliance with the License. You may obtain a copy of
7
- * the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
- * License for the specific language governing permissions and limitations under
15
- * the License.
16
- */
17
-
18
- class Google_Service_Gmail_Profile extends Google_Model
19
- {
20
- public $emailAddress;
21
- public $historyId;
22
- public $messagesTotal;
23
- public $threadsTotal;
24
-
25
- public function setEmailAddress($emailAddress)
26
- {
27
- $this->emailAddress = $emailAddress;
28
- }
29
- public function getEmailAddress()
30
- {
31
- return $this->emailAddress;
32
- }
33
- public function setHistoryId($historyId)
34
- {
35
- $this->historyId = $historyId;
36
- }
37
- public function getHistoryId()
38
- {
39
- return $this->historyId;
40
- }
41
- public function setMessagesTotal($messagesTotal)
42
- {
43
- $this->messagesTotal = $messagesTotal;
44
- }
45
- public function getMessagesTotal()
46
- {
47
- return $this->messagesTotal;
48
- }
49
- public function setThreadsTotal($threadsTotal)
50
- {
51
- $this->threadsTotal = $threadsTotal;
52
- }
53
- public function getThreadsTotal()
54
- {
55
- return $this->threadsTotal;
56
- }
57
- }
1
+ <?php
2
+ /*
3
+ * Copyright 2014 Google Inc.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6
+ * use this file except in compliance with the License. You may obtain a copy of
7
+ * the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
+ * License for the specific language governing permissions and limitations under
15
+ * the License.
16
+ */
17
+
18
+ class Google_Service_Gmail_Profile extends Google_Model
19
+ {
20
+ public $emailAddress;
21
+ public $historyId;
22
+ public $messagesTotal;
23
+ public $threadsTotal;
24
+
25
+ public function setEmailAddress($emailAddress)
26
+ {
27
+ $this->emailAddress = $emailAddress;
28
+ }
29
+ public function getEmailAddress()
30
+ {
31
+ return $this->emailAddress;
32
+ }
33
+ public function setHistoryId($historyId)
34
+ {
35
+ $this->historyId = $historyId;
36
+ }
37
+ public function getHistoryId()
38
+ {
39
+ return $this->historyId;
40
+ }
41
+ public function setMessagesTotal($messagesTotal)
42
+ {
43
+ $this->messagesTotal = $messagesTotal;
44
+ }
45
+ public function getMessagesTotal()
46
+ {
47
+ return $this->messagesTotal;
48
+ }
49
+ public function setThreadsTotal($threadsTotal)
50
+ {
51
+ $this->threadsTotal = $threadsTotal;
52
+ }
53
+ public function getThreadsTotal()
54
+ {
55
+ return $this->threadsTotal;
56
+ }
57
+ }
vendor/google/apiclient-services/src/Google/Service/Gmail/Resource/Users.php CHANGED
@@ -1,71 +1,71 @@
1
- <?php
2
- /*
3
- * Copyright 2014 Google Inc.
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6
- * use this file except in compliance with the License. You may obtain a copy of
7
- * the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
- * License for the specific language governing permissions and limitations under
15
- * the License.
16
- */
17
-
18
- /**
19
- * The "users" collection of methods.
20
- * Typical usage is:
21
- * <code>
22
- * $gmailService = new Google_Service_Gmail(...);
23
- * $users = $gmailService->users;
24
- * </code>
25
- */
26
- class Google_Service_Gmail_Resource_Users extends Google_Service_Resource
27
- {
28
- /**
29
- * Gets the current user's Gmail profile. (users.getProfile)
30
- *
31
- * @param string $userId The user's email address. The special value me can be
32
- * used to indicate the authenticated user.
33
- * @param array $optParams Optional parameters.
34
- * @return Google_Service_Gmail_Profile
35
- */
36
- public function getProfile($userId, $optParams = array())
37
- {
38
- $params = array('userId' => $userId);
39
- $params = array_merge($params, $optParams);
40
- return $this->call('getProfile', array($params), "Google_Service_Gmail_Profile");
41
- }
42
- /**
43
- * Stop receiving push notifications for the given user mailbox. (users.stop)
44
- *
45
- * @param string $userId The user's email address. The special value me can be
46
- * used to indicate the authenticated user.
47
- * @param array $optParams Optional parameters.
48
- */
49
- public function stop($userId, $optParams = array())
50
- {
51
- $params = array('userId' => $userId);
52
- $params = array_merge($params, $optParams);
53
- return $this->call('stop', array($params));
54
- }
55
- /**
56
- * Set up or update a push notification watch on the given user mailbox.
57
- * (users.watch)
58
- *
59
- * @param string $userId The user's email address. The special value me can be
60
- * used to indicate the authenticated user.
61
- * @param Google_Service_Gmail_WatchRequest $postBody
62
- * @param array $optParams Optional parameters.
63
- * @return Google_Service_Gmail_WatchResponse
64
- */
65
- public function watch($userId, Google_Service_Gmail_WatchRequest $postBody, $optParams = array())
66
- {
67
- $params = array('userId' => $userId, 'postBody' => $postBody);
68
- $params = array_merge($params, $optParams);
69
- return $this->call('watch', array($params), "Google_Service_Gmail_WatchResponse");
70
- }
71
- }
1
+ <?php
2
+ /*
3
+ * Copyright 2014 Google Inc.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6
+ * use this file except in compliance with the License. You may obtain a copy of
7
+ * the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
+ * License for the specific language governing permissions and limitations under
15
+ * the License.
16
+ */
17
+
18
+ /**
19
+ * The "users" collection of methods.
20
+ * Typical usage is:
21
+ * <code>
22
+ * $gmailService = new Google_Service_Gmail(...);
23
+ * $users = $gmailService->users;
24
+ * </code>
25
+ */
26
+ class Google_Service_Gmail_Resource_Users extends Google_Service_Resource
27
+ {
28
+ /**
29
+ * Gets the current user's Gmail profile. (users.getProfile)
30
+ *
31
+ * @param string $userId The user's email address. The special value me can be
32
+ * used to indicate the authenticated user.
33
+ * @param array $optParams Optional parameters.
34
+ * @return Google_Service_Gmail_Profile
35
+ */
36
+ public function getProfile($userId, $optParams = array())
37
+ {
38
+ $params = array('userId' => $userId);
39
+ $params = array_merge($params, $optParams);
40
+ return $this->call('getProfile', array($params), "Google_Service_Gmail_Profile");
41
+ }
42
+ /**
43
+ * Stop receiving push notifications for the given user mailbox. (users.stop)
44
+ *
45
+ * @param string $userId The user's email address. The special value me can be
46
+ * used to indicate the authenticated user.
47
+ * @param array $optParams Optional parameters.
48
+ */
49
+ public function stop($userId, $optParams = array())
50
+ {
51
+ $params = array('userId' => $userId);
52
+ $params = array_merge($params, $optParams);
53
+ return $this->call('stop', array($params));
54
+ }
55
+ /**
56
+ * Set up or update a push notification watch on the given user mailbox.
57
+ * (users.watch)
58
+ *
59
+ * @param string $userId The user's email address. The special value me can be
60
+ * used to indicate the authenticated user.
61
+ * @param Google_Service_Gmail_WatchRequest $postBody
62
+ * @param array $optParams Optional parameters.
63
+ * @return Google_Service_Gmail_WatchResponse
64
+ */
65
+ public function watch($userId, Google_Service_Gmail_WatchRequest $postBody, $optParams = array())
66
+ {
67
+ $params = array('userId' => $userId, 'postBody' => $postBody);
68
+ $params = array_merge($params, $optParams);
69
+ return $this->call('watch', array($params), "Google_Service_Gmail_WatchResponse");
70
+ }
71
+ }
vendor/google/apiclient-services/src/Google/Service/Gmail/Resource/UsersDrafts.php CHANGED
@@ -1,130 +1,130 @@
1
- <?php
2
- /*
3
- * Copyright 2014 Google Inc.
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6
- * use this file except in compliance with the License. You may obtain a copy of
7
- * the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
- * License for the specific language governing permissions and limitations under
15
- * the License.
16
- */
17
-
18
- /**
19
- * The "drafts" collection of methods.
20
- * Typical usage is:
21
- * <code>
22
- * $gmailService = new Google_Service_Gmail(...);
23
- * $drafts = $gmailService->drafts;
24
- * </code>
25
- */
26
- class Google_Service_Gmail_Resource_UsersDrafts extends Google_Service_Resource
27
- {
28
- /**
29
- * Creates a new draft with the DRAFT label. (drafts.create)
30
- *
31
- * @param string $userId The user's email address. The special value me can be
32
- * used to indicate the authenticated user.
33
- * @param Google_Service_Gmail_Draft $postBody
34
- * @param array $optParams Optional parameters.
35
- * @return Google_Service_Gmail_Draft
36
- */
37
- public function create($userId, Google_Service_Gmail_Draft $postBody, $optParams = array())
38
- {
39
- $params = array('userId' => $userId, 'postBody' => $postBody);
40
- $params = array_merge($params, $optParams);
41
- return $this->call('create', array($params), "Google_Service_Gmail_Draft");
42
- }
43
- /**
44
- * Immediately and permanently deletes the specified draft. Does not simply
45
- * trash it. (drafts.delete)
46
- *
47
- * @param string $userId The user's email address. The special value me can be
48
- * used to indicate the authenticated user.
49
- * @param string $id The ID of the draft to delete.
50
- * @param array $optParams Optional parameters.
51
- */
52
- public function delete($userId, $id, $optParams = array())
53
- {
54
- $params = array('userId' => $userId, 'id' => $id);
55
- $params = array_merge($params, $optParams);
56
- return $this->call('delete', array($params));
57
- }
58
- /**
59
- * Gets the specified draft. (drafts.get)
60
- *
61
- * @param string $userId The user's email address. The special value me can be
62
- * used to indicate the authenticated user.
63
- * @param string $id The ID of the draft to retrieve.
64
- * @param array $optParams Optional parameters.
65
- *
66
- * @opt_param string format The format to return the draft in.
67
- * @return Google_Service_Gmail_Draft
68
- */
69
- public function get($userId, $id, $optParams = array())
70
- {
71
- $params = array('userId' => $userId, 'id' => $id);
72
- $params = array_merge($params, $optParams);
73
- return $this->call('get', array($params), "Google_Service_Gmail_Draft");
74
- }
75
- /**
76
- * Lists the drafts in the user's mailbox. (drafts.listUsersDrafts)
77
- *
78
- * @param string $userId The user's email address. The special value me can be
79
- * used to indicate the authenticated user.
80
- * @param array $optParams Optional parameters.
81
- *
82
- * @opt_param bool includeSpamTrash Include drafts from SPAM and TRASH in the
83
- * results.
84
- * @opt_param string maxResults Maximum number of drafts to return.
85
- * @opt_param string pageToken Page token to retrieve a specific page of results
86
- * in the list.
87
- * @opt_param string q Only return draft messages matching the specified query.
88
- * Supports the same query format as the Gmail search box. For example,
89
- * "from:someuser@example.com rfc822msgid: is:unread".
90
- * @return Google_Service_Gmail_ListDraftsResponse
91
- */
92
- public function listUsersDrafts($userId, $optParams = array())
93
- {
94
- $params = array('userId' => $userId);
95
- $params = array_merge($params, $optParams);
96
- return $this->call('list', array($params), "Google_Service_Gmail_ListDraftsResponse");
97
- }
98
- /**
99
- * Sends the specified, existing draft to the recipients in the To, Cc, and Bcc
100
- * headers. (drafts.send)
101
- *
102
- * @param string $userId The user's email address. The special value me can be
103
- * used to indicate the authenticated user.
104
- * @param Google_Service_Gmail_Draft $postBody
105
- * @param array $optParams Optional parameters.
106
- * @return Google_Service_Gmail_Message
107
- */
108
- public function send($userId, Google_Service_Gmail_Draft $postBody, $optParams = array())
109
- {
110
- $params = array('userId' => $userId, 'postBody' => $postBody);
111
- $params = array_merge($params, $optParams);
112
- return $this->call('send', array($params), "Google_Service_Gmail_Message");
113
- }
114
- /**
115
- * Replaces a draft's content. (drafts.update)
116
- *
117
- * @param string $userId The user's email address. The special value me can be
118
- * used to indicate the authenticated user.
119
- * @param string $id The ID of the draft to update.
120
- * @param Google_Service_Gmail_Draft $postBody
121
- * @param array $optParams Optional parameters.
122
- * @return Google_Service_Gmail_Draft
123
- */
124
- public function update($userId, $id, Google_Service_Gmail_Draft $postBody, $optParams = array())
125
- {
126
- $params = array('userId' => $userId, 'id' => $id, 'postBody' => $postBody);
127
- $params = array_merge($params, $optParams);
128
- return $this->call('update', array($params), "Google_Service_Gmail_Draft");
129
- }
130
- }
1
+ <?php
2
+ /*
3
+ * Copyright 2014 Google Inc.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6
+ * use this file except in compliance with the License. You may obtain a copy of
7
+ * the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
+ * License for the specific language governing permissions and limitations under
15
+ * the License.
16
+ */
17
+
18
+ /**
19
+ * The "drafts" collection of methods.
20
+ * Typical usage is:
21
+ * <code>
22
+ * $gmailService = new Google_Service_Gmail(...);
23
+ * $drafts = $gmailService->drafts;
24
+ * </code>
25
+ */
26
+ class Google_Service_Gmail_Resource_UsersDrafts extends Google_Service_Resource
27
+ {
28
+ /**
29
+ * Creates a new draft with the DRAFT label. (drafts.create)
30
+ *
31
+ * @param string $userId The user's email address. The special value me can be
32
+ * used to indicate the authenticated user.
33
+ * @param Google_Service_Gmail_Draft $postBody
34
+ * @param array $optParams Optional parameters.
35
+ * @return Google_Service_Gmail_Draft
36
+ */
37
+ public function create($userId, Google_Service_Gmail_Draft $postBody, $optParams = array())
38
+ {
39
+ $params = array('userId' => $userId, 'postBody' => $postBody);
40
+ $params = array_merge($params, $optParams);
41
+ return $this->call('create', array($params), "Google_Service_Gmail_Draft");
42
+ }
43
+ /**
44
+ * Immediately and permanently deletes the specified draft. Does not simply
45
+ * trash it. (drafts.delete)
46
+ *
47
+ * @param string $userId The user's email address. The special value me can be
48
+ * used to indicate the authenticated user.
49
+ * @param string $id The ID of the draft to delete.
50
+ * @param array $optParams Optional parameters.
51
+ */
52
+ public function delete($userId, $id, $optParams = array())
53
+ {
54
+ $params = array('userId' => $userId, 'id' => $id);
55
+ $params = array_merge($params, $optParams);
56
+ return $this->call('delete', array($params));
57
+ }
58
+ /**
59
+ * Gets the specified draft. (drafts.get)
60
+ *
61
+ * @param string $userId The user's email address. The special value me can be
62
+ * used to indicate the authenticated user.
63
+ * @param string $id The ID of the draft to retrieve.
64
+ * @param array $optParams Optional parameters.
65
+ *
66
+ * @opt_param string format The format to return the draft in.
67
+ * @return Google_Service_Gmail_Draft
68
+ */
69
+ public function get($userId, $id, $optParams = array())
70
+ {
71
+ $params = array('userId' => $userId, 'id' => $id);
72
+ $params = array_merge($params, $optParams);
73
+ return $this->call('get', array($params), "Google_Service_Gmail_Draft");
74
+ }
75
+ /**
76
+ * Lists the drafts in the user's mailbox. (drafts.listUsersDrafts)
77
+ *
78
+ * @param string $userId The user's email address. The special value me can be
79
+ * used to indicate the authenticated user.
80
+ * @param array $optParams Optional parameters.
81
+ *
82
+ * @opt_param bool includeSpamTrash Include drafts from SPAM and TRASH in the
83
+ * results.
84
+ * @opt_param string maxResults Maximum number of drafts to return.
85
+ * @opt_param string pageToken Page token to retrieve a specific page of results
86
+ * in the list.
87
+ * @opt_param string q Only return draft messages matching the specified query.
88
+ * Supports the same query format as the Gmail search box. For example,
89
+ * "from:someuser@example.com rfc822msgid: is:unread".
90
+ * @return Google_Service_Gmail_ListDraftsResponse
91
+ */
92
+ public function listUsersDrafts($userId, $optParams = array())
93
+ {
94
+ $params = array('userId' => $userId);
95
+ $params = array_merge($params, $optParams);
96
+ return $this->call('list', array($params), "Google_Service_Gmail_ListDraftsResponse");
97
+ }
98
+ /**
99
+ * Sends the specified, existing draft to the recipients in the To, Cc, and Bcc
100
+ * headers. (drafts.send)
101
+ *
102
+ * @param string $userId The user's email address. The special value me can be
103
+ * used to indicate the authenticated user.
104
+ * @param Google_Service_Gmail_Draft $postBody
105
+ * @param array $optParams Optional parameters.
106
+ * @return Google_Service_Gmail_Message
107
+ */
108
+ public function send($userId, Google_Service_Gmail_Draft $postBody, $optParams = array())
109
+ {
110
+ $params = array('userId' => $userId, 'postBody' => $postBody);
111
+ $params = array_merge($params, $optParams);
112
+ return $this->call('send', array($params), "Google_Service_Gmail_Message");
113
+ }
114
+ /**
115
+ * Replaces a draft's content. (drafts.update)
116
+ *
117
+ * @param string $userId The user's email address. The special value me can be
118
+ * used to indicate the authenticated user.
119
+ * @param string $id The ID of the draft to update.
120
+ * @param Google_Service_Gmail_Draft $postBody
121
+ * @param array $optParams Optional parameters.
122
+ * @return Google_Service_Gmail_Draft
123
+ */
124
+ public function update($userId, $id, Google_Service_Gmail_Draft $postBody, $optParams = array())
125
+ {
126
+ $params = array('userId' => $userId, 'id' => $id, 'postBody' => $postBody);
127
+ $params = array_merge($params, $optParams);
128
+ return $this->call('update', array($params), "Google_Service_Gmail_Draft");
129
+ }
130
+ }
vendor/google/apiclient-services/src/Google/Service/Gmail/Resource/UsersHistory.php CHANGED
@@ -1,61 +1,61 @@
1
- <?php
2
- /*
3
- * Copyright 2014 Google Inc.
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6
- * use this file except in compliance with the License. You may obtain a copy of
7
- * the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
- * License for the specific language governing permissions and limitations under
15
- * the License.
16
- */
17
-
18
- /**
19
- * The "history" collection of methods.
20
- * Typical usage is:
21
- * <code>
22
- * $gmailService = new Google_Service_Gmail(...);
23
- * $history = $gmailService->history;
24
- * </code>
25
- */
26
- class Google_Service_Gmail_Resource_UsersHistory extends Google_Service_Resource
27
- {
28
- /**
29
- * Lists the history of all changes to the given mailbox. History results are
30
- * returned in chronological order (increasing historyId).
31
- * (history.listUsersHistory)
32
- *
33
- * @param string $userId The user's email address. The special value me can be
34
- * used to indicate the authenticated user.
35
- * @param array $optParams Optional parameters.
36
- *
37
- * @opt_param string historyTypes History types to be returned by the function
38
- * @opt_param string labelId Only return messages with a label matching the ID.
39
- * @opt_param string maxResults The maximum number of history records to return.
40
- * @opt_param string pageToken Page token to retrieve a specific page of results
41
- * in the list.
42
- * @opt_param string startHistoryId Required. Returns history records after the
43
- * specified startHistoryId. The supplied startHistoryId should be obtained from
44
- * the historyId of a message, thread, or previous list response. History IDs
45
- * increase chronologically but are not contiguous with random gaps in between
46
- * valid IDs. Supplying an invalid or out of date startHistoryId typically
47
- * returns an HTTP 404 error code. A historyId is typically valid for at least a
48
- * week, but in some rare circumstances may be valid for only a few hours. If
49
- * you receive an HTTP 404 error response, your application should perform a
50
- * full sync. If you receive no nextPageToken in the response, there are no
51
- * updates to retrieve and you can store the returned historyId for a future
52
- * request.
53
- * @return Google_Service_Gmail_ListHistoryResponse
54
- */
55
- public function listUsersHistory($userId, $optParams = array())
56
- {
57
- $params = array('userId' => $userId);
58
- $params = array_merge($params, $optParams);
59
- return $this->call('list', array($params), "Google_Service_Gmail_ListHistoryResponse");
60
- }
61
- }
1
+ <?php
2
+ /*
3
+ * Copyright 2014 Google Inc.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6
+ * use this file except in compliance with the License. You may obtain a copy of
7
+ * the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
+ * License for the specific language governing permissions and limitations under
15
+ * the License.
16
+ */
17
+
18
+ /**
19
+ * The "history" collection of methods.
20
+ * Typical usage is:
21
+ * <code>
22
+ * $gmailService = new Google_Service_Gmail(...);
23
+ * $history = $gmailService->history;
24
+ * </code>
25
+ */
26
+ class Google_Service_Gmail_Resource_UsersHistory extends Google_Service_Resource
27
+ {
28
+ /**
29
+ * Lists the history of all changes to the given mailbox. History results are
30
+ * returned in chronological order (increasing historyId).
31
+ * (history.listUsersHistory)
32
+ *
33
+ * @param string $userId The user's email address. The special value me can be
34
+ * used to indicate the authenticated user.
35
+ * @param array $optParams Optional parameters.
36
+ *
37
+ * @opt_param string historyTypes History types to be returned by the function
38
+ * @opt_param string labelId Only return messages with a label matching the ID.
39
+ * @opt_param string maxResults The maximum number of history records to return.
40
+ * @opt_param string pageToken Page token to retrieve a specific page of results
41
+ * in the list.
42
+ * @opt_param string startHistoryId Required. Returns history records after the
43
+ * specified startHistoryId. The supplied startHistoryId should be obtained from
44
+ * the historyId of a message, thread, or previous list response. History IDs
45
+ * increase chronologically but are not contiguous with random gaps in between
46
+ * valid IDs. Supplying an invalid or out of date startHistoryId typically
47
+ * returns an HTTP 404 error code. A historyId is typically valid for at least a
48
+ * week, but in some rare circumstances may be valid for only a few hours. If
49
+ * you receive an HTTP 404 error response, your application should perform a
50
+ * full sync. If you receive no nextPageToken in the response, there are no
51
+ * updates to retrieve and you can store the returned historyId for a future
52
+ * request.
53
+ * @return Google_Service_Gmail_ListHistoryResponse
54
+ */
55
+ public function listUsersHistory($userId, $optParams = array())
56
+ {
57
+ $params = array('userId' => $userId);
58
+ $params = array_merge($params, $optParams);
59
+ return $this->call('list', array($params), "Google_Service_Gmail_ListHistoryResponse");
60
+ }
61
+ }
vendor/google/apiclient-services/src/Google/Service/Gmail/Resource/UsersLabels.php CHANGED
@@ -1,120 +1,120 @@
1
- <?php
2
- /*
3
- * Copyright 2014 Google Inc.
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6
- * use this file except in compliance with the License. You may obtain a copy of
7
- * the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
- * License for the specific language governing permissions and limitations under
15
- * the License.
16
- */
17
-
18
- /**
19
- * The "labels" collection of methods.
20
- * Typical usage is:
21
- * <code>
22
- * $gmailService = new Google_Service_Gmail(...);
23
- * $labels = $gmailService->labels;
24
- * </code>
25
- */
26
- class Google_Service_Gmail_Resource_UsersLabels extends Google_Service_Resource
27
- {
28
- /**
29
- * Creates a new label. (labels.create)
30
- *
31
- * @param string $userId The user's email address. The special value me can be
32
- * used to indicate the authenticated user.
33
- * @param Google_Service_Gmail_Label $postBody
34
- * @param array $optParams Optional parameters.
35
- * @return Google_Service_Gmail_Label
36
- */
37
- public function create($userId, Google_Service_Gmail_Label $postBody, $optParams = array())
38
- {
39
- $params = array('userId' => $userId, 'postBody' => $postBody);
40
- $params = array_merge($params, $optParams);
41
- return $this->call('create', array($params), "Google_Service_Gmail_Label");
42
- }
43
- /**
44
- * Immediately and permanently deletes the specified label and removes it from
45
- * any messages and threads that it is applied to. (labels.delete)
46
- *
47
- * @param string $userId The user's email address. The special value me can be
48
- * used to indicate the authenticated user.
49
- * @param string $id The ID of the label to delete.
50
- * @param array $optParams Optional parameters.
51
- */
52
- public function delete($userId, $id, $optParams = array())
53
- {
54
- $params = array('userId' => $userId, 'id' => $id);
55
- $params = array_merge($params, $optParams);
56
- return $this->call('delete', array($params));
57
- }
58
- /**
59
- * Gets the specified label. (labels.get)
60
- *
61
- * @param string $userId The user's email address. The special value me can be
62
- * used to indicate the authenticated user.
63
- * @param string $id The ID of the label to retrieve.
64
- * @param array $optParams Optional parameters.
65
- * @return Google_Service_Gmail_Label
66
- */
67
- public function get($userId, $id, $optParams = array())
68
- {
69
- $params = array('userId' => $userId, 'id' => $id);
70
- $params = array_merge($params, $optParams);
71
- return $this->call('get', array($params), "Google_Service_Gmail_Label");
72
- }
73
- /**
74
- * Lists all labels in the user's mailbox. (labels.listUsersLabels)
75
- *
76
- * @param string $userId The user's email address. The special value me can be
77
- * used to indicate the authenticated user.
78
- * @param array $optParams Optional parameters.
79
- * @return Google_Service_Gmail_ListLabelsResponse
80
- */
81
- public function listUsersLabels($userId, $optParams = array())
82
- {
83
- $params = array('userId' => $userId);
84
- $params = array_merge($params, $optParams);
85
- return $this->call('list', array($params), "Google_Service_Gmail_ListLabelsResponse");
86
- }
87
- /**
88
- * Updates the specified label. This method supports patch semantics.
89
- * (labels.patch)
90
- *
91
- * @param string $userId The user's email address. The special value me can be
92
- * used to indicate the authenticated user.
93
- * @param string $id The ID of the label to update.
94
- * @param Google_Service_Gmail_Label $postBody
95
- * @param array $optParams Optional parameters.
96
- * @return Google_Service_Gmail_Label
97
- */
98
- public function patch($userId, $id, Google_Service_Gmail_Label $postBody, $optParams = array())
99
- {
100
- $params = array('userId' => $userId, 'id' => $id, 'postBody' => $postBody);
101
- $params = array_merge($params, $optParams);
102
- return $this->call('patch', array($params), "Google_Service_Gmail_Label");
103
- }
104
- /**
105
- * Updates the specified label. (labels.update)
106
- *
107
- * @param string $userId The user's email address. The special value me can be
108
- * used to indicate the authenticated user.
109
- * @param string $id The ID of the label to update.
110
- * @param Google_Service_Gmail_Label $postBody
111
- * @param array $optParams Optional parameters.
112
- * @return Google_Service_Gmail_Label
113
- */
114
- public function update($userId, $id, Google_Service_Gmail_Label $postBody, $optParams = array())
115
- {
116
- $params = array('userId' => $userId, 'id' => $id, 'postBody' => $postBody);
117
- $params = array_merge($params, $optParams);
118
- return $this->call('update', array($params), "Google_Service_Gmail_Label");
119
- }
120
- }
1
+ <?php
2
+ /*
3
+ * Copyright 2014 Google Inc.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6
+ * use this file except in compliance with the License. You may obtain a copy of
7
+ * the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
+ * License for the specific language governing permissions and limitations under
15
+ * the License.
16
+ */
17
+
18
+ /**
19
+ * The "labels" collection of methods.
20
+ * Typical usage is:
21
+ * <code>
22
+ * $gmailService = new Google_Service_Gmail(...);
23
+ * $labels = $gmailService->labels;
24
+ * </code>
25
+ */
26
+ class Google_Service_Gmail_Resource_UsersLabels extends Google_Service_Resource
27
+ {
28
+ /**
29
+ * Creates a new label. (labels.create)
30
+ *
31
+ * @param string $userId The user's email address. The special value me can be
32
+ * used to indicate the authenticated user.
33
+ * @param Google_Service_Gmail_Label $postBody
34
+ * @param array $optParams Optional parameters.
35
+ * @return Google_Service_Gmail_Label
36
+ */
37
+ public function create($userId, Google_Service_Gmail_Label $postBody, $optParams = array())
38
+ {
39
+ $params = array('userId' => $userId, 'postBody' => $postBody);
40
+ $params = array_merge($params, $optParams);
41
+ return $this->call('create', array($params), "Google_Service_Gmail_Label");
42
+ }
43
+ /**
44
+ * Immediately and permanently deletes the specified label and removes it from
45
+ * any messages and threads that it is applied to. (labels.delete)
46
+ *
47
+ * @param string $userId The user's email address. The special value me can be
48
+ * used to indicate the authenticated user.
49
+ * @param string $id The ID of the label to delete.
50
+ * @param array $optParams Optional parameters.
51
+ */
52
+ public function delete($userId, $id, $optParams = array())
53
+ {
54
+ $params = array('userId' => $userId, 'id' => $id);
55
+ $params = array_merge($params, $optParams);
56
+ return $this->call('delete', array($params));
57
+ }
58
+ /**
59
+ * Gets the specified label. (labels.get)
60
+ *
61
+ * @param string $userId The user's email address. The special value me can be
62
+ * used to indicate the authenticated user.
63
+ * @param string $id The ID of the label to retrieve.
64
+ * @param array $optParams Optional parameters.
65
+ * @return Google_Service_Gmail_Label
66
+ */
67
+ public function get($userId, $id, $optParams = array())
68
+ {
69
+ $params = array('userId' => $userId, 'id' => $id);
70
+ $params = array_merge($params, $optParams);
71
+ return $this->call('get', array($params), "Google_Service_Gmail_Label");
72
+ }
73
+ /**
74
+ * Lists all labels in the user's mailbox. (labels.listUsersLabels)
75
+ *
76
+ * @param string $userId The user's email address. The special value me can be
77
+ * used to indicate the authenticated user.
78
+ * @param array $optParams Optional parameters.
79
+ * @return Google_Service_Gmail_ListLabelsResponse
80
+ */
81
+ public function listUsersLabels($userId, $optParams = array())
82
+ {
83
+ $params = array('userId' => $userId);
84
+ $params = array_merge($params, $optParams);
85
+ return $this->call('list', array($params), "Google_Service_Gmail_ListLabelsResponse");
86
+ }
87
+ /**
88
+ * Updates the specified label. This method supports patch semantics.
89
+ * (labels.patch)
90
+ *
91
+ * @param string $userId The user's email address. The special value me can be
92
+ * used to indicate the authenticated user.
93
+ * @param string $id The ID of the label to update.
94
+ * @param Google_Service_Gmail_Label $postBody
95
+ * @param array $optParams Optional parameters.
96
+ * @return Google_Service_Gmail_Label
97
+ */
98
+ public function patch($userId, $id, Google_Service_Gmail_Label $postBody, $optParams = array())
99
+ {
100
+ $params = array('userId' => $userId, 'id' => $id, 'postBody' => $postBody);
101
+ $params = array_merge($params, $optParams);
102
+ return $this->call('patch', array($params), "Google_Service_Gmail_Label");
103
+ }
104
+ /**
105
+ * Updates the specified label. (labels.update)
106
+ *
107
+ * @param string $userId The user's email address. The special value me can be
108
+ * used to indicate the authenticated user.
109
+ * @param string $id The ID of the label to update.
110
+ * @param Google_Service_Gmail_Label $postBody
111
+ * @param array $optParams Optional parameters.
112
+ * @return Google_Service_Gmail_Label
113
+ */
114
+ public function update($userId, $id, Google_Service_Gmail_Label $postBody, $optParams = array())
115
+ {
116
+ $params = array('userId' => $userId, 'id' => $id, 'postBody' => $postBody);
117
+ $params = array_merge($params, $optParams);
118
+ return $this->call('update', array($params), "Google_Service_Gmail_Label");
119
+ }
120
+ }
vendor/google/apiclient-services/src/Google/Service/Gmail/Resource/UsersMessages.php CHANGED
@@ -1,229 +1,229 @@
1
- <?php
2
- /*
3
- * Copyright 2014 Google Inc.
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6
- * use this file except in compliance with the License. You may obtain a copy of
7
- * the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
- * License for the specific language governing permissions and limitations under
15
- * the License.
16
- */
17
-
18
- /**
19
- * The "messages" collection of methods.
20
- * Typical usage is:
21
- * <code>
22
- * $gmailService = new Google_Service_Gmail(...);
23
- * $messages = $gmailService->messages;
24
- * </code>
25
- */
26
- class Google_Service_Gmail_Resource_UsersMessages extends Google_Service_Resource
27
- {
28
- /**
29
- * Deletes many messages by message ID. Provides no guarantees that messages
30
- * were not already deleted or even existed at all. (messages.batchDelete)
31
- *
32
- * @param string $userId The user's email address. The special value me can be
33
- * used to indicate the authenticated user.
34
- * @param Google_Service_Gmail_BatchDeleteMessagesRequest $postBody
35
- * @param array $optParams Optional parameters.
36
- */
37
- public function batchDelete($userId, Google_Service_Gmail_BatchDeleteMessagesRequest $postBody, $optParams = array())
38
- {
39
- $params = array('userId' => $userId, 'postBody' => $postBody);
40
- $params = array_merge($params, $optParams);
41
- return $this->call('batchDelete', array($params));
42
- }
43
- /**
44
- * Modifies the labels on the specified messages. (messages.batchModify)
45
- *
46
- * @param string $userId The user's email address. The special value me can be
47
- * used to indicate the authenticated user.
48
- * @param Google_Service_Gmail_BatchModifyMessagesRequest $postBody
49
- * @param array $optParams Optional parameters.
50
- */
51
- public function batchModify($userId, Google_Service_Gmail_BatchModifyMessagesRequest $postBody, $optParams = array())
52
- {
53
- $params = array('userId' => $userId, 'postBody' => $postBody);
54
- $params = array_merge($params, $optParams);
55
- return $this->call('batchModify', array($params));
56
- }
57
- /**
58
- * Immediately and permanently deletes the specified message. This operation
59
- * cannot be undone. Prefer messages.trash instead. (messages.delete)
60
- *
61
- * @param string $userId The user's email address. The special value me can be
62
- * used to indicate the authenticated user.
63
- * @param string $id The ID of the message to delete.
64
- * @param array $optParams Optional parameters.
65
- */
66
- public function delete($userId, $id, $optParams = array())
67
- {
68
- $params = array('userId' => $userId, 'id' => $id);
69
- $params = array_merge($params, $optParams);
70
- return $this->call('delete', array($params));
71
- }
72
- /**
73
- * Gets the specified message. (messages.get)
74
- *
75
- * @param string $userId The user's email address. The special value me can be
76
- * used to indicate the authenticated user.
77
- * @param string $id The ID of the message to retrieve.
78
- * @param array $optParams Optional parameters.
79
- *
80
- * @opt_param string format The format to return the message in.
81
- * @opt_param string metadataHeaders When given and format is METADATA, only
82
- * include headers specified.
83
- * @return Google_Service_Gmail_Message
84
- */
85
- public function get($userId, $id, $optParams = array())
86
- {
87
- $params = array('userId' => $userId, 'id' => $id);
88
- $params = array_merge($params, $optParams);
89
- return $this->call('get', array($params), "Google_Service_Gmail_Message");
90
- }
91
- /**
92
- * Imports a message into only this user's mailbox, with standard email delivery
93
- * scanning and classification similar to receiving via SMTP. Does not send a
94
- * message. (messages.import)
95
- *
96
- * @param string $userId The user's email address. The special value me can be
97
- * used to indicate the authenticated user.
98
- * @param Google_Service_Gmail_Message $postBody
99
- * @param array $optParams Optional parameters.
100
- *
101
- * @opt_param bool deleted Mark the email as permanently deleted (not TRASH) and
102
- * only visible in Google Vault to a Vault administrator. Only used for G Suite
103
- * accounts.
104
- * @opt_param string internalDateSource Source for Gmail's internal date of the
105
- * message.
106
- * @opt_param bool neverMarkSpam Ignore the Gmail spam classifier decision and
107
- * never mark this email as SPAM in the mailbox.
108
- * @opt_param bool processForCalendar Process calendar invites in the email and
109
- * add any extracted meetings to the Google Calendar for this user.
110
- * @return Google_Service_Gmail_Message
111
- */
112
- public function import($userId, Google_Service_Gmail_Message $postBody, $optParams = array())
113
- {
114
- $params = array('userId' => $userId, 'postBody' => $postBody);
115
- $params = array_merge($params, $optParams);
116
- return $this->call('import', array($params), "Google_Service_Gmail_Message");
117
- }
118
- /**
119
- * Directly inserts a message into only this user's mailbox similar to IMAP
120
- * APPEND, bypassing most scanning and classification. Does not send a message.
121
- * (messages.insert)
122
- *
123
- * @param string $userId The user's email address. The special value me can be
124
- * used to indicate the authenticated user.
125
- * @param Google_Service_Gmail_Message $postBody
126
- * @param array $optParams Optional parameters.
127
- *
128
- * @opt_param bool deleted Mark the email as permanently deleted (not TRASH) and
129
- * only visible in Google Vault to a Vault administrator. Only used for G Suite
130
- * accounts.
131
- * @opt_param string internalDateSource Source for Gmail's internal date of the
132
- * message.
133
- * @return Google_Service_Gmail_Message
134
- */
135
- public function insert($userId, Google_Service_Gmail_Message $postBody, $optParams = array())
136
- {
137
- $params = array('userId' => $userId, 'postBody' => $postBody);
138
- $params = array_merge($params, $optParams);
139
- return $this->call('insert', array($params), "Google_Service_Gmail_Message");
140
- }
141
- /**
142
- * Lists the messages in the user's mailbox. (messages.listUsersMessages)
143
- *
144
- * @param string $userId The user's email address. The special value me can be
145
- * used to indicate the authenticated user.
146
- * @param array $optParams Optional parameters.
147
- *
148
- * @opt_param bool includeSpamTrash Include messages from SPAM and TRASH in the
149
- * results.
150
- * @opt_param string labelIds Only return messages with labels that match all of
151
- * the specified label IDs.
152
- * @opt_param string maxResults Maximum number of messages to return.
153
- * @opt_param string pageToken Page token to retrieve a specific page of results
154
- * in the list.
155
- * @opt_param string q Only return messages matching the specified query.
156
- * Supports the same query format as the Gmail search box. For example,
157
- * "from:someuser@example.com rfc822msgid: is:unread". Parameter cannot be used
158
- * when accessing the api using the gmail.metadata scope.
159
- * @return Google_Service_Gmail_ListMessagesResponse
160
- */
161
- public function listUsersMessages($userId, $optParams = array())
162
- {
163
- $params = array('userId' => $userId);
164
- $params = array_merge($params, $optParams);
165
- return $this->call('list', array($params), "Google_Service_Gmail_ListMessagesResponse");
166
- }
167
- /**
168
- * Modifies the labels on the specified message. (messages.modify)
169
- *
170
- * @param string $userId The user's email address. The special value me can be
171
- * used to indicate the authenticated user.
172
- * @param string $id The ID of the message to modify.
173
- * @param Google_Service_Gmail_ModifyMessageRequest $postBody
174
- * @param array $optParams Optional parameters.
175
- * @return Google_Service_Gmail_Message
176
- */
177
- public function modify($userId, $id, Google_Service_Gmail_ModifyMessageRequest $postBody, $optParams = array())
178
- {
179
- $params = array('userId' => $userId, 'id' => $id, 'postBody' => $postBody);
180
- $params = array_merge($params, $optParams);
181
- return $this->call('modify', array($params), "Google_Service_Gmail_Message");
182
- }
183
- /**
184
- * Sends the specified message to the recipients in the To, Cc, and Bcc headers.
185
- * (messages.send)
186
- *
187
- * @param string $userId The user's email address. The special value me can be
188
- * used to indicate the authenticated user.
189
- * @param Google_Service_Gmail_Message $postBody
190
- * @param array $optParams Optional parameters.
191
- * @return Google_Service_Gmail_Message
192
- */
193
- public function send($userId, Google_Service_Gmail_Message $postBody, $optParams = array())
194
- {
195
- $params = array('userId' => $userId, 'postBody' => $postBody);
196
- $params = array_merge($params, $optParams);
197
- return $this->call('send', array($params), "Google_Service_Gmail_Message");
198
- }
199
- /**
200
- * Moves the specified message to the trash. (messages.trash)
201
- *
202
- * @param string $userId The user's email address. The special value me can be
203
- * used to indicate the authenticated user.
204
- * @param string $id The ID of the message to Trash.
205
- * @param array $optParams Optional parameters.
206
- * @return Google_Service_Gmail_Message
207
- */
208
- public function trash($userId, $id, $optParams = array())
209
- {
210
- $params = array('userId' => $userId, 'id' => $id);
211
- $params = array_merge($params, $optParams);
212
- return $this->call('trash', array($params), "Google_Service_Gmail_Message");
213
- }
214
- /**
215
- * Removes the specified message from the trash. (messages.untrash)
216
- *
217
- * @param string $userId The user's email address. The special value me can be
218
- * used to indicate the authenticated user.
219
- * @param string $id The ID of the message to remove from Trash.
220
- * @param array $optParams Optional parameters.
221
- * @return Google_Service_Gmail_Message
222
- */
223
- public function untrash($userId, $id, $optParams = array())
224
- {
225
- $params = array('userId' => $userId, 'id' => $id);
226
- $params = array_merge($params, $optParams);
227
- return $this->call('untrash', array($params), "Google_Service_Gmail_Message");
228
- }
229
- }
1
+ <?php
2
+ /*
3
+ * Copyright 2014 Google Inc.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6
+ * use this file except in compliance with the License. You may obtain a copy of
7
+ * the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
+ * License for the specific language governing permissions and limitations under
15
+ * the License.
16
+ */
17
+
18
+ /**
19
+ * The "messages" collection of methods.
20
+ * Typical usage is:
21
+ * <code>
22
+ * $gmailService = new Google_Service_Gmail(...);
23
+ * $messages = $gmailService->messages;
24
+ * </code>
25
+ */
26
+ class Google_Service_Gmail_Resource_UsersMessages extends Google_Service_Resource
27
+ {
28
+ /**
29
+ * Deletes many messages by message ID. Provides no guarantees that messages
30
+ * were not already deleted or even existed at all. (messages.batchDelete)
31
+ *
32
+ * @param string $userId The user's email address. The special value me can be
33
+ * used to indicate the authenticated user.
34
+ * @param Google_Service_Gmail_BatchDeleteMessagesRequest $postBody
35
+ * @param array $optParams Optional parameters.
36
+ */
37
+ public function batchDelete($userId, Google_Service_Gmail_BatchDeleteMessagesRequest $postBody, $optParams = array())
38
+ {
39
+ $params = array('userId' => $userId, 'postBody' => $postBody);
40
+ $params = array_merge($params, $optParams);
41
+ return $this->call('batchDelete', array($params));
42
+ }
43
+ /**
44
+ * Modifies the labels on the specified messages. (messages.batchModify)
45
+ *
46
+ * @param string $userId The user's email address. The special value me can be
47
+ * used to indicate the authenticated user.
48
+ * @param Google_Service_Gmail_BatchModifyMessagesRequest $postBody
49
+ * @param array $optParams Optional parameters.
50
+ */
51
+ public function batchModify($userId, Google_Service_Gmail_BatchModifyMessagesRequest $postBody, $optParams = array())
52
+ {
53
+ $params = array('userId' => $userId, 'postBody' => $postBody);
54
+ $params = array_merge($params, $optParams);
55
+ return $this->call('batchModify', array($params));
56
+ }
57
+ /**
58
+ * Immediately and permanently deletes the specified message. This operation
59
+ * cannot be undone. Prefer messages.trash instead. (messages.delete)
60
+ *
61
+ * @param string $userId The user's email address. The special value me can be
62
+ * used to indicate the authenticated user.
63
+ * @param string $id The ID of the message to delete.
64
+ * @param array $optParams Optional parameters.
65
+ */
66
+ public function delete($userId, $id, $optParams = array())
67
+ {
68
+ $params = array('userId' => $userId, 'id' => $id);
69
+ $params = array_merge($params, $optParams);
70
+ return $this->call('delete', array($params));
71
+ }
72
+ /**
73
+ * Gets the specified message. (messages.get)
74
+ *
75
+ * @param string $userId The user's email address. The special value me can be
76
+ * used to indicate the authenticated user.
77
+ * @param string $id The ID of the message to retrieve.
78
+ * @param array $optParams Optional parameters.
79
+ *
80
+ * @opt_param string format The format to return the message in.
81
+ * @opt_param string metadataHeaders When given and format is METADATA, only
82
+ * include headers specified.
83
+ * @return Google_Service_Gmail_Message
84
+ */
85
+ public function get($userId, $id, $optParams = array())
86
+ {
87
+ $params = array('userId' => $userId, 'id' => $id);
88
+ $params = array_merge($params, $optParams);
89
+ return $this->call('get', array($params), "Google_Service_Gmail_Message");
90
+ }
91
+ /**
92
+ * Imports a message into only this user's mailbox, with standard email delivery
93
+ * scanning and classification similar to receiving via SMTP. Does not send a
94
+ * message. (messages.import)
95
+ *
96
+ * @param string $userId The user's email address. The special value me can be
97
+ * used to indicate the authenticated user.
98
+ * @param Google_Service_Gmail_Message $postBody
99
+ * @param array $optParams Optional parameters.
100
+ *
101
+ * @opt_param bool deleted Mark the email as permanently deleted (not TRASH) and
102
+ * only visible in Google Vault to a Vault administrator. Only used for G Suite
103
+ * accounts.
104
+ * @opt_param string internalDateSource Source for Gmail's internal date of the
105
+ * message.
106
+ * @opt_param bool neverMarkSpam Ignore the Gmail spam classifier decision and
107
+ * never mark this email as SPAM in the mailbox.
108
+ * @opt_param bool processForCalendar Process calendar invites in the email and
109
+ * add any extracted meetings to the Google Calendar for this user.
110
+ * @return Google_Service_Gmail_Message
111
+ */
112
+ public function import($userId, Google_Service_Gmail_Message $postBody, $optParams = array())
113
+ {
114
+ $params = array('userId' => $userId, 'postBody' => $postBody);
115
+ $params = array_merge($params, $optParams);
116
+ return $this->call('import', array($params), "Google_Service_Gmail_Message");
117
+ }
118
+ /**
119
+ * Directly inserts a message into only this user's mailbox similar to IMAP
120
+ * APPEND, bypassing most scanning and classification. Does not send a message.
121
+ * (messages.insert)
122
+ *
123
+ * @param string $userId The user's email address. The special value me can be
124
+ * used to indicate the authenticated user.
125
+ * @param Google_Service_Gmail_Message $postBody
126
+ * @param array $optParams Optional parameters.
127
+ *
128
+ * @opt_param bool deleted Mark the email as permanently deleted (not TRASH) and
129
+ * only visible in Google Vault to a Vault administrator. Only used for G Suite
130
+ * accounts.
131
+ * @opt_param string internalDateSource Source for Gmail's internal date of the
132
+ * message.
133
+ * @return Google_Service_Gmail_Message
134
+ */
135
+ public function insert($userId, Google_Service_Gmail_Message $postBody, $optParams = array())
136
+ {
137
+ $params = array('userId' => $userId, 'postBody' => $postBody);
138
+ $params = array_merge($params, $optParams);
139
+ return $this->call('insert', array($params), "Google_Service_Gmail_Message");
140
+ }
141
+ /**
142
+ * Lists the messages in the user's mailbox. (messages.listUsersMessages)
143
+ *
144
+ * @param string $userId The user's email address. The special value me can be
145
+ * used to indicate the authenticated user.
146
+ * @param array $optParams Optional parameters.
147
+ *
148
+ * @opt_param bool includeSpamTrash Include messages from SPAM and TRASH in the
149
+ * results.
150
+ * @opt_param string labelIds Only return messages with labels that match all of
151
+ * the specified label IDs.
152
+ * @opt_param string maxResults Maximum number of messages to return.
153
+ * @opt_param string pageToken Page token to retrieve a specific page of results
154
+ * in the list.
155
+ * @opt_param string q Only return messages matching the specified query.
156
+ * Supports the same query format as the Gmail search box. For example,
157
+ * "from:someuser@example.com rfc822msgid: is:unread". Parameter cannot be used
158
+ * when accessing the api using the gmail.metadata scope.
159
+ * @return Google_Service_Gmail_ListMessagesResponse
160
+ */
161
+ public function listUsersMessages($userId, $optParams = array())
162
+ {
163
+ $params = array('userId' => $userId);
164
+ $params = array_merge($params, $optParams);
165
+ return $this->call('list', array($params), "Google_Service_Gmail_ListMessagesResponse");
166
+ }
167
+ /**
168
+ * Modifies the labels on the specified message. (messages.modify)
169
+ *
170
+ * @param string $userId The user's email address. The special value me can be
171
+ * used to indicate the authenticated user.
172
+ * @param string $id The ID of the message to modify.
173
+ * @param Google_Service_Gmail_ModifyMessageRequest $postBody
174
+ * @param array $optParams Optional parameters.
175
+ * @return Google_Service_Gmail_Message
176
+ */
177
+ public function modify($userId, $id, Google_Service_Gmail_ModifyMessageRequest $postBody, $optParams = array())
178
+ {
179
+ $params = array('userId' => $userId, 'id' => $id, 'postBody' => $postBody);
180
+ $params = array_merge($params, $optParams);
181
+ return $this->call('modify', array($params), "Google_Service_Gmail_Message");
182
+ }
183
+ /**
184
+ * Sends the specified message to the recipients in the To, Cc, and Bcc headers.
185
+ * (messages.send)
186
+ *
187
+ * @param string $userId The user's email address. The special value me can be
188
+ * used to indicate the authenticated user.
189
+ * @param Google_Service_Gmail_Message $postBody
190
+ * @param array $optParams Optional parameters.
191
+ * @return Google_Service_Gmail_Message
192
+ */
193
+ public function send($userId, Google_Service_Gmail_Message $postBody, $optParams = array())
194
+ {
195
+ $params = array('userId' => $userId, 'postBody' => $postBody);
196
+ $params = array_merge($params, $optParams);
197
+ return $this->call('send', array($params), "Google_Service_Gmail_Message");
198
+ }
199
+ /**
200
+ * Moves the specified message to the trash. (messages.trash)
201
+ *
202
+ * @param string $userId The user's email address. The special value me can be
203
+ * used to indicate the authenticated user.
204
+ * @param string $id The ID of the message to Trash.
205
+ * @param array $optParams Optional parameters.
206
+ * @return Google_Service_Gmail_Message
207
+ */
208
+ public function trash($userId, $id, $optParams = array())
209
+ {
210
+ $params = array('userId' => $userId, 'id' => $id);
211
+ $params = array_merge($params, $optParams);
212
+ return $this->call('trash', array($params), "Google_Service_Gmail_Message");
213
+ }
214
+ /**
215
+ * Removes the specified message from the trash. (messages.untrash)
216
+ *
217
+ * @param string $userId The user's email address. The special value me can be
218
+ * used to indicate the authenticated user.
219
+ * @param string $id The ID of the message to remove from Trash.
220
+ * @param array $optParams Optional parameters.
221
+ * @return Google_Service_Gmail_Message
222
+ */
223
+ public function untrash($userId, $id, $optParams = array())
224
+ {
225
+ $params = array('userId' => $userId, 'id' => $id);
226
+ $params = array_merge($params, $optParams);
227
+ return $this->call('untrash', array($params), "Google_Service_Gmail_Message");
228
+ }
229
+ }
vendor/google/apiclient-services/src/Google/Service/Gmail/Resource/UsersMessagesAttachments.php CHANGED
@@ -1,44 +1,44 @@
1
- <?php
2
- /*
3
- * Copyright 2014 Google Inc.
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6
- * use this file except in compliance with the License. You may obtain a copy of
7
- * the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
- * License for the specific language governing permissions and limitations under
15
- * the License.
16
- */
17
-
18
- /**
19
- * The "attachments" collection of methods.
20
- * Typical usage is:
21
- * <code>
22
- * $gmailService = new Google_Service_Gmail(...);
23
- * $attachments = $gmailService->attachments;
24
- * </code>
25
- */
26
- class Google_Service_Gmail_Resource_UsersMessagesAttachments extends Google_Service_Resource
27
- {
28
- /**
29
- * Gets the specified message attachment. (attachments.get)
30
- *
31
- * @param string $userId The user's email address. The special value me can be
32
- * used to indicate the authenticated user.
33
- * @param string $messageId The ID of the message containing the attachment.
34
- * @param string $id The ID of the attachment.
35
- * @param array $optParams Optional parameters.
36
- * @return Google_Service_Gmail_MessagePartBody
37
- */
38
- public function get($userId, $messageId, $id, $optParams = array())
39
- {
40
- $params = array('userId' => $userId, 'messageId' => $messageId, 'id' => $id);
41
- $params = array_merge($params, $optParams);
42
- return $this->call('get', array($params), "Google_Service_Gmail_MessagePartBody");
43
- }
44
- }
1
+ <?php
2
+ /*
3
+ * Copyright 2014 Google Inc.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6
+ * use this file except in compliance with the License. You may obtain a copy of
7
+ * the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
+ * License for the specific language governing permissions and limitations under
15
+ * the License.
16
+ */
17
+
18
+ /**
19
+ * The "attachments" collection of methods.
20
+ * Typical usage is:
21
+ * <code>
22
+ * $gmailService = new Google_Service_Gmail(...);
23
+ * $attachments = $gmailService->attachments;
24
+ * </code>
25
+ */
26
+ class Google_Service_Gmail_Resource_UsersMessagesAttachments extends Google_Service_Resource
27
+ {
28
+ /**
29
+ * Gets the specified message attachment. (attachments.get)
30
+ *
31
+ * @param string $userId The user's email address. The special value me can be
32
+ * used to indicate the authenticated user.
33
+ * @param string $messageId The ID of the message containing the attachment.
34
+ * @param string $id The ID of the attachment.
35
+ * @param array $optParams Optional parameters.
36
+ * @return Google_Service_Gmail_MessagePartBody
37
+ */
38
+ public function get($userId, $messageId, $id, $optParams = array())
39
+ {
40
+ $params = array('userId' => $userId, 'messageId' => $messageId, 'id' => $id);
41
+ $params = array_merge($params, $optParams);
42
+ return $this->call('get', array($params), "Google_Service_Gmail_MessagePartBody");
43
+ }
44
+ }
vendor/google/apiclient-services/src/Google/Service/Gmail/Resource/UsersSettings.php CHANGED
@@ -1,184 +1,184 @@
1
- <?php
2
- /*
3
- * Copyright 2014 Google Inc.
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6
- * use this file except in compliance with the License. You may obtain a copy of
7
- * the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
- * License for the specific language governing permissions and limitations under
15
- * the License.
16
- */
17
-
18
- /**
19
- * The "settings" collection of methods.
20
- * Typical usage is:
21
- * <code>
22
- * $gmailService = new Google_Service_Gmail(...);
23
- * $settings = $gmailService->settings;
24
- * </code>
25
- */
26
- class Google_Service_Gmail_Resource_UsersSettings extends Google_Service_Resource
27
- {
28
- /**
29
- * Gets the auto-forwarding setting for the specified account.
30
- * (settings.getAutoForwarding)
31
- *
32
- * @param string $userId User's email address. The special value "me" can be
33
- * used to indicate the authenticated user.
34
- * @param array $optParams Optional parameters.
35
- * @return Google_Service_Gmail_AutoForwarding
36
- */
37
- public function getAutoForwarding($userId, $optParams = array())
38
- {
39
- $params = array('userId' => $userId);
40
- $params = array_merge($params, $optParams);
41
- return $this->call('getAutoForwarding', array($params), "Google_Service_Gmail_AutoForwarding");
42
- }
43
- /**
44
- * Gets IMAP settings. (settings.getImap)
45
- *
46
- * @param string $userId User's email address. The special value "me" can be
47
- * used to indicate the authenticated user.
48
- * @param array $optParams Optional parameters.
49
- * @return Google_Service_Gmail_ImapSettings
50
- */
51
- public function getImap($userId, $optParams = array())
52
- {
53
- $params = array('userId' => $userId);
54
- $params = array_merge($params, $optParams);
55
- return $this->call('getImap', array($params), "Google_Service_Gmail_ImapSettings");
56
- }
57
- /**
58
- * Gets language settings. (settings.getLanguage)
59
- *
60
- * @param string $userId User's email address. The special value "me" can be
61
- * used to indicate the authenticated user.
62
- * @param array $optParams Optional parameters.
63
- * @return Google_Service_Gmail_LanguageSettings
64
- */
65
- public function getLanguage($userId, $optParams = array())
66
- {
67
- $params = array('userId' => $userId);
68
- $params = array_merge($params, $optParams);
69
- return $this->call('getLanguage', array($params), "Google_Service_Gmail_LanguageSettings");
70
- }
71
- /**
72
- * Gets POP settings. (settings.getPop)
73
- *
74
- * @param string $userId User's email address. The special value "me" can be
75
- * used to indicate the authenticated user.
76
- * @param array $optParams Optional parameters.
77
- * @return Google_Service_Gmail_PopSettings
78
- */
79
- public function getPop($userId, $optParams = array())
80
- {
81
- $params = array('userId' => $userId);
82
- $params = array_merge($params, $optParams);
83
- return $this->call('getPop', array($params), "Google_Service_Gmail_PopSettings");
84
- }
85
- /**
86
- * Gets vacation responder settings. (settings.getVacation)
87
- *
88
- * @param string $userId User's email address. The special value "me" can be
89
- * used to indicate the authenticated user.
90
- * @param array $optParams Optional parameters.
91
- * @return Google_Service_Gmail_VacationSettings
92
- */
93
- public function getVacation($userId, $optParams = array())
94
- {
95
- $params = array('userId' => $userId);
96
- $params = array_merge($params, $optParams);
97
- return $this->call('getVacation', array($params), "Google_Service_Gmail_VacationSettings");
98
- }
99
- /**
100
- * Updates the auto-forwarding setting for the specified account. A verified
101
- * forwarding address must be specified when auto-forwarding is enabled.
102
- *
103
- * This method is only available to service account clients that have been
104
- * delegated domain-wide authority. (settings.updateAutoForwarding)
105
- *
106
- * @param string $userId User's email address. The special value "me" can be
107
- * used to indicate the authenticated user.
108
- * @param Google_Service_Gmail_AutoForwarding $postBody
109
- * @param array $optParams Optional parameters.
110
- * @return Google_Service_Gmail_AutoForwarding
111
- */
112
- public function updateAutoForwarding($userId, Google_Service_Gmail_AutoForwarding $postBody, $optParams = array())
113
- {
114
- $params = array('userId' => $userId, 'postBody' => $postBody);
115
- $params = array_merge($params, $optParams);
116
- return $this->call('updateAutoForwarding', array($params), "Google_Service_Gmail_AutoForwarding");
117
- }
118
- /**
119
- * Updates IMAP settings. (settings.updateImap)
120
- *
121
- * @param string $userId User's email address. The special value "me" can be
122
- * used to indicate the authenticated user.
123
- * @param Google_Service_Gmail_ImapSettings $postBody
124
- * @param array $optParams Optional parameters.
125
- * @return Google_Service_Gmail_ImapSettings
126
- */
127
- public function updateImap($userId, Google_Service_Gmail_ImapSettings $postBody, $optParams = array())
128
- {
129
- $params = array('userId' => $userId, 'postBody' => $postBody);
130
- $params = array_merge($params, $optParams);
131
- return $this->call('updateImap', array($params), "Google_Service_Gmail_ImapSettings");
132
- }
133
- /**
134
- * Updates language settings.
135
- *
136
- * If successful, the return object contains the displayLanguage that was saved
137
- * for the user, which may differ from the value passed into the request. This
138
- * is because the requested displayLanguage may not be directly supported by
139
- * Gmail but have a close variant that is, and so the variant may be chosen and
140
- * saved instead. (settings.updateLanguage)
141
- *
142
- * @param string $userId User's email address. The special value "me" can be
143
- * used to indicate the authenticated user.
144
- * @param Google_Service_Gmail_LanguageSettings $postBody
145
- * @param array $optParams Optional parameters.
146
- * @return Google_Service_Gmail_LanguageSettings
147
- */
148
- public function updateLanguage($userId, Google_Service_Gmail_LanguageSettings $postBody, $optParams = array())
149
- {
150
- $params = array('userId' => $userId, 'postBody' => $postBody);
151
- $params = array_merge($params, $optParams);
152
- return $this->call('updateLanguage', array($params), "Google_Service_Gmail_LanguageSettings");
153
- }
154
- /**
155
- * Updates POP settings. (settings.updatePop)
156
- *
157
- * @param string $userId User's email address. The special value "me" can be
158
- * used to indicate the authenticated user.
159
- * @param Google_Service_Gmail_PopSettings $postBody
160
- * @param array $optParams Optional parameters.
161
- * @return Google_Service_Gmail_PopSettings
162
- */
163
- public function updatePop($userId, Google_Service_Gmail_PopSettings $postBody, $optParams = array())
164
- {
165
- $params = array('userId' => $userId, 'postBody' => $postBody);
166
- $params = array_merge($params, $optParams);
167
- return $this->call('updatePop', array($params), "Google_Service_Gmail_PopSettings");
168
- }
169
- /**
170
- * Updates vacation responder settings. (settings.updateVacation)
171
- *
172
- * @param string $userId User's email address. The special value "me" can be
173
- * used to indicate the authenticated user.
174
- * @param Google_Service_Gmail_VacationSettings $postBody
175
- * @param array $optParams Optional parameters.
176
- * @return Google_Service_Gmail_VacationSettings
177
- */
178
- public function updateVacation($userId, Google_Service_Gmail_VacationSettings $postBody, $optParams = array())
179
- {
180
- $params = array('userId' => $userId, 'postBody' => $postBody);
181
- $params = array_merge($params, $optParams);
182
- return $this->call('updateVacation', array($params), "Google_Service_Gmail_VacationSettings");
183
- }
184
- }
1
+ <?php
2
+ /*
3
+ * Copyright 2014 Google Inc.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6
+ * use this file except in compliance with the License. You may obtain a copy of
7
+ * the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
+ * License for the specific language governing permissions and limitations under
15
+ * the License.
16
+ */
17
+
18
+ /**
19
+ * The "settings" collection of methods.
20
+ * Typical usage is:
21
+ * <code>
22
+ * $gmailService = new Google_Service_Gmail(...);
23
+ * $settings = $gmailService->settings;
24
+ * </code>
25
+ */
26
+ class Google_Service_Gmail_Resource_UsersSettings extends Google_Service_Resource
27
+ {
28
+ /**
29
+ * Gets the auto-forwarding setting for the specified account.
30
+ * (settings.getAutoForwarding)
31
+ *
32
+ * @param string $userId User's email address. The special value "me" can be
33
+ * used to indicate the authenticated user.
34
+ * @param array $optParams Optional parameters.
35
+ * @return Google_Service_Gmail_AutoForwarding
36
+ */
37
+ public function getAutoForwarding($userId, $optParams = array())
38
+ {
39
+ $params = array('userId' => $userId);
40
+ $params = array_merge($params, $optParams);
41
+ return $this->call('getAutoForwarding', array($params), "Google_Service_Gmail_AutoForwarding");
42
+ }
43
+ /**
44
+ * Gets IMAP settings. (settings.getImap)
45
+ *
46
+ * @param string $userId User's email address. The special value "me" can be
47
+ * used to indicate the authenticated user.
48
+ * @param array $optParams Optional parameters.
49
+ * @return Google_Service_Gmail_ImapSettings
50
+ */
51
+ public function getImap($userId, $optParams = array())
52
+ {
53
+ $params = array('userId' => $userId);
54
+ $params = array_merge($params, $optParams);
55
+ return $this->call('getImap', array($params), "Google_Service_Gmail_ImapSettings");
56
+ }
57
+ /**
58
+ * Gets language settings. (settings.getLanguage)
59
+ *
60
+ * @param string $userId User's email address. The special value "me" can be
61
+ * used to indicate the authenticated user.
62
+ * @param array $optParams Optional parameters.
63
+ * @return Google_Service_Gmail_LanguageSettings
64
+ */
65
+ public function getLanguage($userId, $optParams = array())
66
+ {
67
+ $params = array('userId' => $userId);
68
+ $params = array_merge($params, $optParams);
69
+ return $this->call('getLanguage', array($params), "Google_Service_Gmail_LanguageSettings");
70
+ }
71
+ /**
72
+ * Gets POP settings. (settings.getPop)
73
+ *
74
+ * @param string $userId User's email address. The special value "me" can be
75
+ * used to indicate the authenticated user.
76
+ * @param array $optParams Optional parameters.
77
+ * @return Google_Service_Gmail_PopSettings
78
+ */
79
+ public function getPop($userId, $optParams = array())
80
+ {
81
+ $params = array('userId' => $userId);
82
+ $params = array_merge($params, $optParams);
83
+ return $this->call('getPop', array($params), "Google_Service_Gmail_PopSettings");
84
+ }
85
+ /**
86
+ * Gets vacation responder settings. (settings.getVacation)
87
+ *
88
+ * @param string $userId User's email address. The special value "me" can be
89
+ * used to indicate the authenticated user.
90
+ * @param array $optParams Optional parameters.
91
+ * @return Google_Service_Gmail_VacationSettings
92
+ */
93
+ public function getVacation($userId, $optParams = array())
94
+ {
95
+ $params = array('userId' => $userId);
96
+ $params = array_merge($params, $optParams);
97
+ return $this->call('getVacation', array($params), "Google_Service_Gmail_VacationSettings");
98
+ }
99
+ /**
100
+ * Updates the auto-forwarding setting for the specified account. A verified
101
+ * forwarding address must be specified when auto-forwarding is enabled.
102
+ *
103
+ * This method is only available to service account clients that have been
104
+ * delegated domain-wide authority. (settings.updateAutoForwarding)
105
+ *
106
+ * @param string $userId User's email address. The special value "me" can be
107
+ * used to indicate the authenticated user.
108
+ * @param Google_Service_Gmail_AutoForwarding $postBody
109
+ * @param array $optParams Optional parameters.
110
+ * @return Google_Service_Gmail_AutoForwarding
111
+ */
112
+ public function updateAutoForwarding($userId, Google_Service_Gmail_AutoForwarding $postBody, $optParams = array())
113
+ {
114
+ $params = array('userId' => $userId, 'postBody' => $postBody);
115
+ $params = array_merge($params, $optParams);
116
+ return $this->call('updateAutoForwarding', array($params), "Google_Service_Gmail_AutoForwarding");
117
+ }
118
+ /**
119
+ * Updates IMAP settings. (settings.updateImap)
120
+ *
121
+ * @param string $userId User's email address. The special value "me" can be
122
+ * used to indicate the authenticated user.
123
+ * @param Google_Service_Gmail_ImapSettings $postBody
124
+ * @param array $optParams Optional parameters.
125
+ * @return Google_Service_Gmail_ImapSettings
126
+ */
127
+ public function updateImap($userId, Google_Service_Gmail_ImapSettings $postBody, $optParams = array())
128
+ {
129
+ $params = array('userId' => $userId, 'postBody' => $postBody);
130
+ $params = array_merge($params, $optParams);
131
+ return $this->call('updateImap', array($params), "Google_Service_Gmail_ImapSettings");
132
+ }
133
+ /**
134
+ * Updates language settings.
135
+ *
136
+ * If successful, the return object contains the displayLanguage that was saved
137
+ * for the user, which may differ from the value passed into the request. This
138
+ * is because the requested displayLanguage may not be directly supported by
139
+ * Gmail but have a close variant that is, and so the variant may be chosen and
140
+ * saved instead. (settings.updateLanguage)
141
+ *
142
+ * @param string $userId User's email address. The special value "me" can be
143
+ * used to indicate the authenticated user.
144
+ * @param Google_Service_Gmail_LanguageSettings $postBody
145
+ * @param array $optParams Optional parameters.
146
+ * @return Google_Service_Gmail_LanguageSettings
147
+ */
148
+ public function updateLanguage($userId, Google_Service_Gmail_LanguageSettings $postBody, $optParams = array())
149
+ {
150
+ $params = array('userId' => $userId, 'postBody' => $postBody);
151
+ $params = array_merge($params, $optParams);
152
+ return $this->call('updateLanguage', array($params), "Google_Service_Gmail_LanguageSettings");
153
+ }
154
+ /**
155
+ * Updates POP settings. (settings.updatePop)
156
+ *
157
+ * @param string $userId User's email address. The special value "me" can be
158
+ * used to indicate the authenticated user.
159
+ * @param Google_Service_Gmail_PopSettings $postBody
160
+ * @param array $optParams Optional parameters.
161
+ * @return Google_Service_Gmail_PopSettings
162
+ */
163
+ public function updatePop($userId, Google_Service_Gmail_PopSettings $postBody, $optParams = array())
164
+ {
165
+ $params = array('userId' => $userId, 'postBody' => $postBody);
166
+ $params = array_merge($params, $optParams);
167
+ return $this->call('updatePop', array($params), "Google_Service_Gmail_PopSettings");
168
+ }
169
+ /**
170
+ * Updates vacation responder settings. (settings.updateVacation)
171
+ *
172
+ * @param string $userId User's email address. The special value "me" can be
173
+ * used to indicate the authenticated user.
174
+ * @param Google_Service_Gmail_VacationSettings $postBody
175
+ * @param array $optParams Optional parameters.
176
+ * @return Google_Service_Gmail_VacationSettings
177
+ */
178
+ public function updateVacation($userId, Google_Service_Gmail_VacationSettings $postBody, $optParams = array())
179
+ {
180
+ $params = array('userId' => $userId, 'postBody' => $postBody);
181
+ $params = array_merge($params, $optParams);
182
+ return $this->call('updateVacation', array($params), "Google_Service_Gmail_VacationSettings");
183
+ }
184
+ }
vendor/google/apiclient-services/src/Google/Service/Gmail/Resource/UsersSettingsDelegates.php CHANGED
@@ -1,119 +1,119 @@
1
- <?php
2
- /*
3
- * Copyright 2014 Google Inc.
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6
- * use this file except in compliance with the License. You may obtain a copy of
7
- * the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
- * License for the specific language governing permissions and limitations under
15
- * the License.
16
- */
17
-
18
- /**
19
- * The "delegates" collection of methods.
20
- * Typical usage is:
21
- * <code>
22
- * $gmailService = new Google_Service_Gmail(...);
23
- * $delegates = $gmailService->delegates;
24
- * </code>
25
- */
26
- class Google_Service_Gmail_Resource_UsersSettingsDelegates extends Google_Service_Resource
27
- {
28
- /**
29
- * Adds a delegate with its verification status set directly to accepted,
30
- * without sending any verification email. The delegate user must be a member of
31
- * the same G Suite organization as the delegator user.
32
- *
33
- * Gmail imposes limtations on the number of delegates and delegators each user
34
- * in a G Suite organization can have. These limits depend on your organization,
35
- * but in general each user can have up to 25 delegates and up to 10 delegators.
36
- *
37
- * Note that a delegate user must be referred to by their primary email address,
38
- * and not an email alias.
39
- *
40
- * Also note that when a new delegate is created, there may be up to a one
41
- * minute delay before the new delegate is available for use.
42
- *
43
- * This method is only available to service account clients that have been
44
- * delegated domain-wide authority. (delegates.create)
45
- *
46
- * @param string $userId User's email address. The special value "me" can be
47
- * used to indicate the authenticated user.
48
- * @param Google_Service_Gmail_Delegate $postBody
49
- * @param array $optParams Optional parameters.
50
- * @return Google_Service_Gmail_Delegate
51
- */
52
- public function create($userId, Google_Service_Gmail_Delegate $postBody, $optParams = array())
53
- {
54
- $params = array('userId' => $userId, 'postBody' => $postBody);
55
- $params = array_merge($params, $optParams);
56
- return $this->call('create', array($params), "Google_Service_Gmail_Delegate");
57
- }
58
- /**
59
- * Removes the specified delegate (which can be of any verification status), and
60
- * revokes any verification that may have been required for using it.
61
- *
62
- * Note that a delegate user must be referred to by their primary email address,
63
- * and not an email alias.
64
- *
65
- * This method is only available to service account clients that have been
66
- * delegated domain-wide authority. (delegates.delete)
67
- *
68
- * @param string $userId User's email address. The special value "me" can be
69
- * used to indicate the authenticated user.
70
- * @param string $delegateEmail The email address of the user to be removed as a
71
- * delegate.
72
- * @param array $optParams Optional parameters.
73
- */
74
- public function delete($userId, $delegateEmail, $optParams = array())
75
- {
76
- $params = array('userId' => $userId, 'delegateEmail' => $delegateEmail);
77
- $params = array_merge($params, $optParams);
78
- return $this->call('delete', array($params));
79
- }
80
- /**
81
- * Gets the specified delegate.
82
- *
83
- * Note that a delegate user must be referred to by their primary email address,
84
- * and not an email alias.
85
- *
86
- * This method is only available to service account clients that have been
87
- * delegated domain-wide authority. (delegates.get)
88
- *
89
- * @param string $userId User's email address. The special value "me" can be
90
- * used to indicate the authenticated user.
91
- * @param string $delegateEmail The email address of the user whose delegate
92
- * relationship is to be retrieved.
93
- * @param array $optParams Optional parameters.
94
- * @return Google_Service_Gmail_Delegate
95
- */
96
- public function get($userId, $delegateEmail, $optParams = array())
97
- {
98
- $params = array('userId' => $userId, 'delegateEmail' => $delegateEmail);
99
- $params = array_merge($params, $optParams);
100
- return $this->call('get', array($params), "Google_Service_Gmail_Delegate");
101
- }
102
- /**
103
- * Lists the delegates for the specified account.
104
- *
105
- * This method is only available to service account clients that have been
106
- * delegated domain-wide authority. (delegates.listUsersSettingsDelegates)
107
- *
108
- * @param string $userId User's email address. The special value "me" can be
109
- * used to indicate the authenticated user.
110
- * @param array $optParams Optional parameters.
111
- * @return Google_Service_Gmail_ListDelegatesResponse
112
- */
113
- public function listUsersSettingsDelegates($userId, $optParams = array())
114
- {
115
- $params = array('userId' => $userId);
116
- $params = array_merge($params, $optParams);
117
- return $this->call('list', array($params), "Google_Service_Gmail_ListDelegatesResponse");
118
- }
119
- }
1
+ <?php
2
+ /*
3
+ * Copyright 2014 Google Inc.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6
+ * use this file except in compliance with the License. You may obtain a copy of
7
+ * the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
+ * License for the specific language governing permissions and limitations under
15
+ * the License.
16
+ */
17
+
18
+ /**
19
+ * The "delegates" collection of methods.
20
+ * Typical usage is:
21
+ * <code>
22
+ * $gmailService = new Google_Service_Gmail(...);
23
+ * $delegates = $gmailService->delegates;
24
+ * </code>
25
+ */
26
+ class Google_Service_Gmail_Resource_UsersSettingsDelegates extends Google_Service_Resource
27
+ {
28
+ /**
29
+ * Adds a delegate with its verification status set directly to accepted,
30
+ * without sending any verification email. The delegate user must be a member of
31
+ * the same G Suite organization as the delegator user.
32
+ *
33
+ * Gmail imposes limtations on the number of delegates and delegators each user
34
+ * in a G Suite organization can have. These limits depend on your organization,
35
+ * but in general each user can have up to 25 delegates and up to 10 delegators.
36
+ *
37
+ * Note that a delegate user must be referred to by their primary email address,
38
+ * and not an email alias.
39
+ *
40
+ * Also note that when a new delegate is created, there may be up to a one
41
+ * minute delay before the new delegate is available for use.
42
+ *
43
+ * This method is only available to service account clients that have been
44
+ * delegated domain-wide authority. (delegates.create)
45
+ *
46
+ * @param string $userId User's email address. The special value "me" can be
47
+ * used to indicate the authenticated user.
48
+ * @param Google_Service_Gmail_Delegate $postBody
49
+ * @param array $optParams Optional parameters.
50
+ * @return Google_Service_Gmail_Delegate
51
+ */
52
+ public function create($userId, Google_Service_Gmail_Delegate $postBody, $optParams = array())
53
+ {
54
+ $params = array('userId' => $userId, 'postBody' => $postBody);
55
+ $params = array_merge($params, $optParams);
56
+ return $this->call('create', array($params), "Google_Service_Gmail_Delegate");
57
+ }
58
+ /**
59
+ * Removes the specified delegate (which can be of any verification status), and
60
+ * revokes any verification that may have been required for using it.
61
+ *
62
+ * Note that a delegate user must be referred to by their primary email address,
63
+ * and not an email alias.
64
+ *
65
+ * This method is only available to service account clients that have been
66
+ * delegated domain-wide authority. (delegates.delete)
67
+ *
68
+ * @param string $userId User's email address. The special value "me" can be
69
+ * used to indicate the authenticated user.
70
+ * @param string $delegateEmail The email address of the user to be removed as a
71
+ * delegate.
72
+ * @param array $optParams Optional parameters.
73
+ */
74
+ public function delete($userId, $delegateEmail, $optParams = array())
75
+ {
76
+ $params = array('userId' => $userId, 'delegateEmail' => $delegateEmail);
77
+ $params = array_merge($params, $optParams);
78
+ return $this->call('delete', array($params));
79
+ }
80
+ /**
81
+ * Gets the specified delegate.
82
+ *
83
+ * Note that a delegate user must be referred to by their primary email address,
84
+ * and not an email alias.
85
+ *
86
+ * This method is only available to service account clients that have been
87
+ * delegated domain-wide authority. (delegates.get)
88
+ *
89
+ * @param string $userId User's email address. The special value "me" can be
90
+ * used to indicate the authenticated user.
91
+ * @param string $delegateEmail The email address of the user whose delegate
92
+ * relationship is to be retrieved.
93
+ * @param array $optParams Optional parameters.
94
+ * @return Google_Service_Gmail_Delegate
95
+ */
96
+ public function get($userId, $delegateEmail, $optParams = array())
97
+ {
98
+ $params = array('userId' => $userId, 'delegateEmail' => $delegateEmail);
99
+ $params = array_merge($params, $optParams);
100
+ return $this->call('get', array($params), "Google_Service_Gmail_Delegate");
101
+ }
102
+ /**
103
+ * Lists the delegates for the specified account.
104
+ *
105
+ * This method is only available to service account clients that have been
106
+ * delegated domain-wide authority. (delegates.listUsersSettingsDelegates)
107
+ *
108
+ * @param string $userId User's email address. The special value "me" can be
109
+ * used to indicate the authenticated user.
110
+ * @param array $optParams Optional parameters.
111
+ * @return Google_Service_Gmail_ListDelegatesResponse
112
+ */
113
+ public function listUsersSettingsDelegates($userId, $optParams = array())
114
+ {
115
+ $params = array('userId' => $userId);
116
+ $params = array_merge($params, $optParams);
117
+ return $this->call('list', array($params), "Google_Service_Gmail_ListDelegatesResponse");
118
+ }
119
+ }
vendor/google/apiclient-services/src/Google/Service/Gmail/Resource/UsersSettingsFilters.php CHANGED
@@ -1,86 +1,86 @@
1
- <?php
2
- /*
3
- * Copyright 2014 Google Inc.
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6
- * use this file except in compliance with the License. You may obtain a copy of
7
- * the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
- * License for the specific language governing permissions and limitations under
15
- * the License.
16
- */
17
-
18
- /**
19
- * The "filters" collection of methods.
20
- * Typical usage is:
21
- * <code>
22
- * $gmailService = new Google_Service_Gmail(...);
23
- * $filters = $gmailService->filters;
24
- * </code>
25
- */
26
- class Google_Service_Gmail_Resource_UsersSettingsFilters extends Google_Service_Resource
27
- {
28
- /**
29
- * Creates a filter. (filters.create)
30
- *
31
- * @param string $userId User's email address. The special value "me" can be
32
- * used to indicate the authenticated user.
33
- * @param Google_Service_Gmail_Filter $postBody
34
- * @param array $optParams Optional parameters.
35
- * @return Google_Service_Gmail_Filter
36
- */
37
- public function create($userId, Google_Service_Gmail_Filter $postBody, $optParams = array())
38
- {
39
- $params = array('userId' => $userId, 'postBody' => $postBody);
40
- $params = array_merge($params, $optParams);
41
- return $this->call('create', array($params), "Google_Service_Gmail_Filter");
42
- }
43
- /**
44
- * Deletes a filter. (filters.delete)
45
- *
46
- * @param string $userId User's email address. The special value "me" can be
47
- * used to indicate the authenticated user.
48
- * @param string $id The ID of the filter to be deleted.
49
- * @param array $optParams Optional parameters.
50
- */
51
- public function delete($userId, $id, $optParams = array())
52
- {
53
- $params = array('userId' => $userId, 'id' => $id);
54
- $params = array_merge($params, $optParams);
55
- return $this->call('delete', array($params));
56
- }
57
- /**
58
- * Gets a filter. (filters.get)
59
- *
60
- * @param string $userId User's email address. The special value "me" can be
61
- * used to indicate the authenticated user.
62
- * @param string $id The ID of the filter to be fetched.
63
- * @param array $optParams Optional parameters.
64
- * @return Google_Service_Gmail_Filter
65
- */
66
- public function get($userId, $id, $optParams = array())
67
- {
68
- $params = array('userId' => $userId, 'id' => $id);
69
- $params = array_merge($params, $optParams);
70
- return $this->call('get', array($params), "Google_Service_Gmail_Filter");
71
- }
72
- /**
73
- * Lists the message filters of a Gmail user. (filters.listUsersSettingsFilters)
74
- *
75
- * @param string $userId User's email address. The special value "me" can be
76
- * used to indicate the authenticated user.
77
- * @param array $optParams Optional parameters.
78
- * @return Google_Service_Gmail_ListFiltersResponse
79
- */
80
- public function listUsersSettingsFilters($userId, $optParams = array())
81
- {
82
- $params = array('userId' => $userId);
83
- $params = array_merge($params, $optParams);
84
- return $this->call('list', array($params), "Google_Service_Gmail_ListFiltersResponse");
85
- }
86
- }
1
+ <?php
2
+ /*
3
+ * Copyright 2014 Google Inc.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6
+ * use this file except in compliance with the License. You may obtain a copy of
7
+ * the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
+ * License for the specific language governing permissions and limitations under
15
+ * the License.
16
+ */
17
+
18
+ /**
19
+ * The "filters" collection of methods.
20
+ * Typical usage is:
21
+ * <code>
22
+ * $gmailService = new Google_Service_Gmail(...);
23
+ * $filters = $gmailService->filters;
24
+ * </code>
25
+ */
26
+ class Google_Service_Gmail_Resource_UsersSettingsFilters extends Google_Service_Resource
27
+ {
28
+ /**
29
+ * Creates a filter. (filters.create)
30
+ *
31
+ * @param string $userId User's email address. The special value "me" can be
32
+ * used to indicate the authenticated user.
33
+ * @param Google_Service_Gmail_Filter $postBody
34
+ * @param array $optParams Optional parameters.
35
+ * @return Google_Service_Gmail_Filter
36
+ */
37
+ public function create($userId, Google_Service_Gmail_Filter $postBody, $optParams = array())
38
+ {
39
+ $params = array('userId' => $userId, 'postBody' => $postBody);
40
+ $params = array_merge($params, $optParams);
41
+ return $this->call('create', array($params), "Google_Service_Gmail_Filter");
42
+ }
43
+ /**
44
+ * Deletes a filter. (filters.delete)
45
+ *
46
+ * @param string $userId User's email address. The special value "me" can be
47
+ * used to indicate the authenticated user.
48
+ * @param string $id The ID of the filter to be deleted.
49
+ * @param array $optParams Optional parameters.
50
+ */
51
+ public function delete($userId, $id, $optParams = array())
52
+ {
53
+ $params = array('userId' => $userId, 'id' => $id);
54
+ $params = array_merge($params, $optParams);
55
+ return $this->call('delete', array($params));
56
+ }
57
+ /**
58
+ * Gets a filter. (filters.get)
59
+ *
60
+ * @param string $userId User's email address. The special value "me" can be
61
+ * used to indicate the authenticated user.
62
+ * @param string $id The ID of the filter to be fetched.
63
+ * @param array $optParams Optional parameters.
64
+ * @return Google_Service_Gmail_Filter
65
+ */
66
+ public function get($userId, $id, $optParams = array())
67
+ {
68
+ $params = array('userId' => $userId, 'id' => $id);
69
+ $params = array_merge($params, $optParams);
70
+ return $this->call('get', array($params), "Google_Service_Gmail_Filter");
71
+ }
72
+ /**
73
+ * Lists the message filters of a Gmail user. (filters.listUsersSettingsFilters)
74
+ *
75
+ * @param string $userId User's email address. The special value "me" can be
76
+ * used to indicate the authenticated user.
77
+ * @param array $optParams Optional parameters.
78
+ * @return Google_Service_Gmail_ListFiltersResponse
79
+ */
80
+ public function listUsersSettingsFilters($userId, $optParams = array())
81
+ {
82
+ $params = array('userId' => $userId);
83
+ $params = array_merge($params, $optParams);
84
+ return $this->call('list', array($params), "Google_Service_Gmail_ListFiltersResponse");
85
+ }
86
+ }
vendor/google/apiclient-services/src/Google/Service/Gmail/Resource/UsersSettingsForwardingAddresses.php CHANGED
@@ -1,97 +1,97 @@
1
- <?php
2
- /*
3
- * Copyright 2014 Google Inc.
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6
- * use this file except in compliance with the License. You may obtain a copy of
7
- * the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
- * License for the specific language governing permissions and limitations under
15
- * the License.
16
- */
17
-
18
- /**
19
- * The "forwardingAddresses" collection of methods.
20
- * Typical usage is:
21
- * <code>
22
- * $gmailService = new Google_Service_Gmail(...);
23
- * $forwardingAddresses = $gmailService->forwardingAddresses;
24
- * </code>
25
- */
26
- class Google_Service_Gmail_Resource_UsersSettingsForwardingAddresses extends Google_Service_Resource
27
- {
28
- /**
29
- * Creates a forwarding address. If ownership verification is required, a
30
- * message will be sent to the recipient and the resource's verification status
31
- * will be set to pending; otherwise, the resource will be created with
32
- * verification status set to accepted.
33
- *
34
- * This method is only available to service account clients that have been
35
- * delegated domain-wide authority. (forwardingAddresses.create)
36
- *
37
- * @param string $userId User's email address. The special value "me" can be
38
- * used to indicate the authenticated user.
39
- * @param Google_Service_Gmail_ForwardingAddress $postBody
40
- * @param array $optParams Optional parameters.
41
- * @return Google_Service_Gmail_ForwardingAddress
42
- */
43
- public function create($userId, Google_Service_Gmail_ForwardingAddress $postBody, $optParams = array())
44
- {
45
- $params = array('userId' => $userId, 'postBody' => $postBody);
46
- $params = array_merge($params, $optParams);
47
- return $this->call('create', array($params), "Google_Service_Gmail_ForwardingAddress");
48
- }
49
- /**
50
- * Deletes the specified forwarding address and revokes any verification that
51
- * may have been required.
52
- *
53
- * This method is only available to service account clients that have been
54
- * delegated domain-wide authority. (forwardingAddresses.delete)
55
- *
56
- * @param string $userId User's email address. The special value "me" can be
57
- * used to indicate the authenticated user.
58
- * @param string $forwardingEmail The forwarding address to be deleted.
59
- * @param array $optParams Optional parameters.
60
- */
61
- public function delete($userId, $forwardingEmail, $optParams = array())
62
- {
63
- $params = array('userId' => $userId, 'forwardingEmail' => $forwardingEmail);
64
- $params = array_merge($params, $optParams);
65
- return $this->call('delete', array($params));
66
- }
67
- /**
68
- * Gets the specified forwarding address. (forwardingAddresses.get)
69
- *
70
- * @param string $userId User's email address. The special value "me" can be
71
- * used to indicate the authenticated user.
72
- * @param string $forwardingEmail The forwarding address to be retrieved.
73
- * @param array $optParams Optional parameters.
74
- * @return Google_Service_Gmail_ForwardingAddress
75
- */
76
- public function get($userId, $forwardingEmail, $optParams = array())
77
- {
78
- $params = array('userId' => $userId, 'forwardingEmail' => $forwardingEmail);
79
- $params = array_merge($params, $optParams);
80
- return $this->call('get', array($params), "Google_Service_Gmail_ForwardingAddress");
81
- }
82
- /**
83
- * Lists the forwarding addresses for the specified account.
84
- * (forwardingAddresses.listUsersSettingsForwardingAddresses)
85
- *
86
- * @param string $userId User's email address. The special value "me" can be
87
- * used to indicate the authenticated user.
88
- * @param array $optParams Optional parameters.
89
- * @return Google_Service_Gmail_ListForwardingAddressesResponse
90
- */
91
- public function listUsersSettingsForwardingAddresses($userId, $optParams = array())
92
- {
93
- $params = array('userId' => $userId);
94
- $params = array_merge($params, $optParams);
95
- return $this->call('list', array($params), "Google_Service_Gmail_ListForwardingAddressesResponse");
96
- }
97
- }
1
+ <?php
2
+ /*
3
+ * Copyright 2014 Google Inc.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6
+ * use this file except in compliance with the License. You may obtain a copy of
7
+ * the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
+ * License for the specific language governing permissions and limitations under
15
+ * the License.
16
+ */
17
+
18
+ /**
19
+ * The "forwardingAddresses" collection of methods.
20
+ * Typical usage is:
21
+ * <code>
22
+ * $gmailService = new Google_Service_Gmail(...);
23
+ * $forwardingAddresses = $gmailService->forwardingAddresses;
24
+ * </code>
25
+ */
26
+ class Google_Service_Gmail_Resource_UsersSettingsForwardingAddresses extends Google_Service_Resource
27
+ {
28
+ /**
29
+ * Creates a forwarding address. If ownership verification is required, a
30
+ * message will be sent to the recipient and the resource's verification status
31
+ * will be set to pending; otherwise, the resource will be created with
32
+ * verification status set to accepted.
33
+ *
34
+ * This method is only available to service account clients that have been
35
+ * delegated domain-wide authority. (forwardingAddresses.create)
36
+ *
37
+ * @param string $userId User's email address. The special value "me" can be
38
+ * used to indicate the authenticated user.
39
+ * @param Google_Service_Gmail_ForwardingAddress $postBody
40
+ * @param array $optParams Optional parameters.
41
+ * @return Google_Service_Gmail_ForwardingAddress
42
+ */
43
+ public function create($userId, Google_Service_Gmail_ForwardingAddress $postBody, $optParams = array())
44
+ {
45
+ $params = array('userId' => $userId, 'postBody' => $postBody);
46
+ $params = array_merge($params, $optParams);
47
+ return $this->call('create', array($params), "Google_Service_Gmail_ForwardingAddress");
48
+ }
49
+ /**
50
+ * Deletes the specified forwarding address and revokes any verification that
51
+ * may have been required.
52
+ *
53
+ * This method is only available to service account clients that have been
54
+ * delegated domain-wide authority. (forwardingAddresses.delete)
55
+ *
56
+ * @param string $userId User's email address. The special value "me" can be
57
+ * used to indicate the authenticated user.
58
+ * @param string $forwardingEmail The forwarding address to be deleted.
59
+ * @param array $optParams Optional parameters.
60
+ */
61
+ public function delete($userId, $forwardingEmail, $optParams = array())
62
+ {
63
+ $params = array('userId' => $userId, 'forwardingEmail' => $forwardingEmail);
64
+ $params = array_merge($params, $optParams);
65
+ return $this->call('delete', array($params));
66
+ }
67
+ /**
68
+ * Gets the specified forwarding address. (forwardingAddresses.get)
69
+ *
70
+ * @param string $userId User's email address. The special value "me" can be
71
+ * used to indicate the authenticated user.
72
+ * @param string $forwardingEmail The forwarding address to be retrieved.
73
+ * @param array $optParams Optional parameters.
74
+ * @return Google_Service_Gmail_ForwardingAddress
75
+ */
76
+ public function get($userId, $forwardingEmail, $optParams = array())
77
+ {
78
+ $params = array('userId' => $userId, 'forwardingEmail' => $forwardingEmail);
79
+ $params = array_merge($params, $optParams);
80
+ return $this->call('get', array($params), "Google_Service_Gmail_ForwardingAddress");
81
+ }
82
+ /**
83
+ * Lists the forwarding addresses for the specified account.
84
+ * (forwardingAddresses.listUsersSettingsForwardingAddresses)
85
+ *
86
+ * @param string $userId User's email address. The special value "me" can be
87
+ * used to indicate the authenticated user.
88
+ * @param array $optParams Optional parameters.
89
+ * @return Google_Service_Gmail_ListForwardingAddressesResponse
90
+ */
91
+ public function listUsersSettingsForwardingAddresses($userId, $optParams = array())
92
+ {
93
+ $params = array('userId' => $userId);
94
+ $params = array_merge($params, $optParams);
95
+ return $this->call('list', array($params), "Google_Service_Gmail_ListForwardingAddressesResponse");
96
+ }
97
+ }
vendor/google/apiclient-services/src/Google/Service/Gmail/Resource/UsersSettingsSendAs.php CHANGED
@@ -1,162 +1,162 @@
1
- <?php
2
- /*
3
- * Copyright 2014 Google Inc.
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6
- * use this file except in compliance with the License. You may obtain a copy of
7
- * the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
- * License for the specific language governing permissions and limitations under
15
- * the License.
16
- */
17
-
18
- /**
19
- * The "sendAs" collection of methods.
20
- * Typical usage is:
21
- * <code>
22
- * $gmailService = new Google_Service_Gmail(...);
23
- * $sendAs = $gmailService->sendAs;
24
- * </code>
25
- */
26
- class Google_Service_Gmail_Resource_UsersSettingsSendAs extends Google_Service_Resource
27
- {
28
- /**
29
- * Creates a custom "from" send-as alias. If an SMTP MSA is specified, Gmail
30
- * will attempt to connect to the SMTP service to validate the configuration
31
- * before creating the alias. If ownership verification is required for the
32
- * alias, a message will be sent to the email address and the resource's
33
- * verification status will be set to pending; otherwise, the resource will be
34
- * created with verification status set to accepted. If a signature is provided,
35
- * Gmail will sanitize the HTML before saving it with the alias.
36
- *
37
- * This method is only available to service account clients that have been
38
- * delegated domain-wide authority. (sendAs.create)
39
- *
40
- * @param string $userId User's email address. The special value "me" can be
41
- * used to indicate the authenticated user.
42
- * @param Google_Service_Gmail_SendAs $postBody
43
- * @param array $optParams Optional parameters.
44
- * @return Google_Service_Gmail_SendAs
45
- */
46
- public function create($userId, Google_Service_Gmail_SendAs $postBody, $optParams = array())
47
- {
48
- $params = array('userId' => $userId, 'postBody' => $postBody);
49
- $params = array_merge($params, $optParams);
50
- return $this->call('create', array($params), "Google_Service_Gmail_SendAs");
51
- }
52
- /**
53
- * Deletes the specified send-as alias. Revokes any verification that may have
54
- * been required for using it.
55
- *
56
- * This method is only available to service account clients that have been
57
- * delegated domain-wide authority. (sendAs.delete)
58
- *
59
- * @param string $userId User's email address. The special value "me" can be
60
- * used to indicate the authenticated user.
61
- * @param string $sendAsEmail The send-as alias to be deleted.
62
- * @param array $optParams Optional parameters.
63
- */
64
- public function delete($userId, $sendAsEmail, $optParams = array())
65
- {
66
- $params = array('userId' => $userId, 'sendAsEmail' => $sendAsEmail);
67
- $params = array_merge($params, $optParams);
68
- return $this->call('delete', array($params));
69
- }
70
- /**
71
- * Gets the specified send-as alias. Fails with an HTTP 404 error if the
72
- * specified address is not a member of the collection. (sendAs.get)
73
- *
74
- * @param string $userId User's email address. The special value "me" can be
75
- * used to indicate the authenticated user.
76
- * @param string $sendAsEmail The send-as alias to be retrieved.
77
- * @param array $optParams Optional parameters.
78
- * @return Google_Service_Gmail_SendAs
79
- */
80
- public function get($userId, $sendAsEmail, $optParams = array())
81
- {
82
- $params = array('userId' => $userId, 'sendAsEmail' => $sendAsEmail);
83
- $params = array_merge($params, $optParams);
84
- return $this->call('get', array($params), "Google_Service_Gmail_SendAs");
85
- }
86
- /**
87
- * Lists the send-as aliases for the specified account. The result includes the
88
- * primary send-as address associated with the account as well as any custom
89
- * "from" aliases. (sendAs.listUsersSettingsSendAs)
90
- *
91
- * @param string $userId User's email address. The special value "me" can be
92
- * used to indicate the authenticated user.
93
- * @param array $optParams Optional parameters.
94
- * @return Google_Service_Gmail_ListSendAsResponse
95
- */
96
- public function listUsersSettingsSendAs($userId, $optParams = array())
97
- {
98
- $params = array('userId' => $userId);
99
- $params = array_merge($params, $optParams);
100
- return $this->call('list', array($params), "Google_Service_Gmail_ListSendAsResponse");
101
- }
102
- /**
103
- * Updates a send-as alias. If a signature is provided, Gmail will sanitize the
104
- * HTML before saving it with the alias.
105
- *
106
- * Addresses other than the primary address for the account can only be updated
107
- * by service account clients that have been delegated domain-wide authority.
108
- * This method supports patch semantics. (sendAs.patch)
109
- *
110
- * @param string $userId User's email address. The special value "me" can be
111
- * used to indicate the authenticated user.
112
- * @param string $sendAsEmail The send-as alias to be updated.
113
- * @param Google_Service_Gmail_SendAs $postBody
114
- * @param array $optParams Optional parameters.
115
- * @return Google_Service_Gmail_SendAs
116
- */
117
- public function patch($userId, $sendAsEmail, Google_Service_Gmail_SendAs $postBody, $optParams = array())
118
- {
119
- $params = array('userId' => $userId, 'sendAsEmail' => $sendAsEmail, 'postBody' => $postBody);
120
- $params = array_merge($params, $optParams);
121
- return $this->call('patch', array($params), "Google_Service_Gmail_SendAs");
122
- }
123
- /**
124
- * Updates a send-as alias. If a signature is provided, Gmail will sanitize the
125
- * HTML before saving it with the alias.
126
- *
127
- * Addresses other than the primary address for the account can only be updated
128
- * by service account clients that have been delegated domain-wide authority.
129
- * (sendAs.update)
130
- *
131
- * @param string $userId User's email address. The special value "me" can be
132
- * used to indicate the authenticated user.
133
- * @param string $sendAsEmail The send-as alias to be updated.
134
- * @param Google_Service_Gmail_SendAs $postBody
135
- * @param array $optParams Optional parameters.
136
- * @return Google_Service_Gmail_SendAs
137
- */
138
- public function update($userId, $sendAsEmail, Google_Service_Gmail_SendAs $postBody, $optParams = array())
139
- {
140
- $params = array('userId' => $userId, 'sendAsEmail' => $sendAsEmail, 'postBody' => $postBody);
141
- $params = array_merge($params, $optParams);
142
- return $this->call('update', array($params), "Google_Service_Gmail_SendAs");
143
- }
144
- /**
145
- * Sends a verification email to the specified send-as alias address. The
146
- * verification status must be pending.
147
- *
148
- * This method is only available to service account clients that have been
149
- * delegated domain-wide authority. (sendAs.verify)
150
- *
151
- * @param string $userId User's email address. The special value "me" can be
152
- * used to indicate the authenticated user.
153
- * @param string $sendAsEmail The send-as alias to be verified.
154
- * @param array $optParams Optional parameters.
155
- */
156
- public function verify($userId, $sendAsEmail, $optParams = array())
157
- {
158
- $params = array('userId' => $userId, 'sendAsEmail' => $sendAsEmail);
159
- $params = array_merge($params, $optParams);
160
- return $this->call('verify', array($params));
161
- }
162
- }
1
+ <?php
2
+ /*
3
+ * Copyright 2014 Google Inc.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6
+ * use this file except in compliance with the License. You may obtain a copy of
7
+ * the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
+ * License for the specific language governing permissions and limitations under
15
+ * the License.
16
+ */
17
+
18
+ /**
19
+ * The "sendAs" collection of methods.
20
+ * Typical usage is:
21
+ * <code>
22
+ * $gmailService = new Google_Service_Gmail(...);
23
+ * $sendAs = $gmailService->sendAs;
24
+ * </code>
25
+ */
26
+ class Google_Service_Gmail_Resource_UsersSettingsSendAs extends Google_Service_Resource
27
+ {
28
+ /**
29
+ * Creates a custom "from" send-as alias. If an SMTP MSA is specified, Gmail
30
+ * will attempt to connect to the SMTP service to validate the configuration
31
+ * before creating the alias. If ownership verification is required for the
32
+ * alias, a message will be sent to the email address and the resource's
33
+ * verification status will be set to pending; otherwise, the resource will be
34
+ * created with verification status set to accepted. If a signature is provided,
35
+ * Gmail will sanitize the HTML before saving it with the alias.
36
+ *
37
+ * This method is only available to service account clients that have been
38
+ * delegated domain-wide authority. (sendAs.create)
39
+ *
40
+ * @param string $userId User's email address. The special value "me" can be
41
+ * used to indicate the authenticated user.
42
+ * @param Google_Service_Gmail_SendAs $postBody
43
+ * @param array $optParams Optional parameters.
44
+ * @return Google_Service_Gmail_SendAs
45
+ */
46
+ public function create($userId, Google_Service_Gmail_SendAs $postBody, $optParams = array())
47
+ {
48
+ $params = array('userId' => $userId, 'postBody' => $postBody);
49
+ $params = array_merge($params, $optParams);
50
+ return $this->call('create', array($params), "Google_Service_Gmail_SendAs");
51
+ }
52
+ /**
53
+ * Deletes the specified send-as alias. Revokes any verification that may have
54
+ * been required for using it.
55
+ *
56
+ * This method is only available to service account clients that have been
57
+ * delegated domain-wide authority. (sendAs.delete)
58
+ *
59
+ * @param string $userId User's email address. The special value "me" can be
60
+ * used to indicate the authenticated user.
61
+ * @param string $sendAsEmail The send-as alias to be deleted.
62
+ * @param array $optParams Optional parameters.
63
+ */
64
+ public function delete($userId, $sendAsEmail, $optParams = array())
65
+ {
66
+ $params = array('userId' => $userId, 'sendAsEmail' => $sendAsEmail);
67
+ $params = array_merge($params, $optParams);
68
+ return $this->call('delete', array($params));
69
+ }
70
+ /**
71
+ * Gets the specified send-as alias. Fails with an HTTP 404 error if the
72
+ * specified address is not a member of the collection. (sendAs.get)
73
+ *
74
+ * @param string $userId User's email address. The special value "me" can be
75
+ * used to indicate the authenticated user.
76
+ * @param string $sendAsEmail The send-as alias to be retrieved.
77
+ * @param array $optParams Optional parameters.
78
+ * @return Google_Service_Gmail_SendAs
79
+ */
80
+ public function get($userId, $sendAsEmail, $optParams = array())
81
+ {
82
+ $params = array('userId' => $userId, 'sendAsEmail' => $sendAsEmail);
83
+ $params = array_merge($params, $optParams);
84
+ return $this->call('get', array($params), "Google_Service_Gmail_SendAs");
85
+ }
86
+ /**
87
+ * Lists the send-as aliases for the specified account. The result includes the
88
+ * primary send-as address associated with the account as well as any custom
89
+ * "from" aliases. (sendAs.listUsersSettingsSendAs)
90
+ *
91
+ * @param string $userId User's email address. The special value "me" can be
92
+ * used to indicate the authenticated user.
93
+ * @param array $optParams Optional parameters.
94
+ * @return Google_Service_Gmail_ListSendAsResponse
95
+ */
96
+ public function listUsersSettingsSendAs($userId, $optParams = array())
97
+ {
98
+ $params = array('userId' => $userId);
99
+ $params = array_merge($params, $optParams);
100
+ return $this->call('list', array($params), "Google_Service_Gmail_ListSendAsResponse");
101
+ }
102
+ /**
103
+ * Updates a send-as alias. If a signature is provided, Gmail will sanitize the
104
+ * HTML before saving it with the alias.
105
+ *
106
+ * Addresses other than the primary address for the account can only be updated
107
+ * by service account clients that have been delegated domain-wide authority.
108
+ * This method supports patch semantics. (sendAs.patch)
109
+ *
110
+ * @param string $userId User's email address. The special value "me" can be
111
+ * used to indicate the authenticated user.
112
+ * @param string $sendAsEmail The send-as alias to be updated.
113
+ * @param Google_Service_Gmail_SendAs $postBody
114
+ * @param array $optParams Optional parameters.
115
+ * @return Google_Service_Gmail_SendAs
116
+ */
117
+ public function patch($userId, $sendAsEmail, Google_Service_Gmail_SendAs $postBody, $optParams = array())
118
+ {
119
+ $params = array('userId' => $userId, 'sendAsEmail' => $sendAsEmail, 'postBody' => $postBody);
120
+ $params = array_merge($params, $optParams);
121
+ return $this->call('patch', array($params), "Google_Service_Gmail_SendAs");
122
+ }
123
+ /**
124
+ * Updates a send-as alias. If a signature is provided, Gmail will sanitize the
125
+ * HTML before saving it with the alias.
126
+ *
127
+ * Addresses other than the primary address for the account can only be updated
128
+ * by service account clients that have been delegated domain-wide authority.
129
+ * (sendAs.update)
130
+ *
131
+ * @param string $userId User's email address. The special value "me" can be
132
+ * used to indicate the authenticated user.
133
+ * @param string $sendAsEmail The send-as alias to be updated.
134
+ * @param Google_Service_Gmail_SendAs $postBody
135
+ * @param array $optParams Optional parameters.
136
+ * @return Google_Service_Gmail_SendAs
137
+ */
138
+ public function update($userId, $sendAsEmail, Google_Service_Gmail_SendAs $postBody, $optParams = array())
139
+ {
140
+ $params = array('userId' => $userId, 'sendAsEmail' => $sendAsEmail, 'postBody' => $postBody);
141
+ $params = array_merge($params, $optParams);
142
+ return $this->call('update', array($params), "Google_Service_Gmail_SendAs");
143
+ }
144
+ /**
145
+ * Sends a verification email to the specified send-as alias address. The
146
+ * verification status must be pending.
147
+ *
148
+ * This method is only available to service account clients that have been
149
+ * delegated domain-wide authority. (sendAs.verify)
150
+ *
151
+ * @param string $userId User's email address. The special value "me" can be
152
+ * used to indicate the authenticated user.
153
+ * @param string $sendAsEmail The send-as alias to be verified.
154
+ * @param array $optParams Optional parameters.
155
+ */
156
+ public function verify($userId, $sendAsEmail, $optParams = array())
157
+ {
158
+ $params = array('userId' => $userId, 'sendAsEmail' => $sendAsEmail);
159
+ $params = array_merge($params, $optParams);
160
+ return $this->call('verify', array($params));
161
+ }
162
+ }
vendor/google/apiclient-services/src/Google/Service/Gmail/Resource/UsersSettingsSendAsSmimeInfo.php CHANGED
@@ -1,115 +1,115 @@
1
- <?php
2
- /*
3
- * Copyright 2014 Google Inc.
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6
- * use this file except in compliance with the License. You may obtain a copy of
7
- * the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
- * License for the specific language governing permissions and limitations under
15
- * the License.
16
- */
17
-
18
- /**
19
- * The "smimeInfo" collection of methods.
20
- * Typical usage is:
21
- * <code>
22
- * $gmailService = new Google_Service_Gmail(...);
23
- * $smimeInfo = $gmailService->smimeInfo;
24
- * </code>
25
- */
26
- class Google_Service_Gmail_Resource_UsersSettingsSendAsSmimeInfo extends Google_Service_Resource
27
- {
28
- /**
29
- * Deletes the specified S/MIME config for the specified send-as alias.
30
- * (smimeInfo.delete)
31
- *
32
- * @param string $userId The user's email address. The special value me can be
33
- * used to indicate the authenticated user.
34
- * @param string $sendAsEmail The email address that appears in the "From:"
35
- * header for mail sent using this alias.
36
- * @param string $id The immutable ID for the SmimeInfo.
37
- * @param array $optParams Optional parameters.
38
- */
39
- public function delete($userId, $sendAsEmail, $id, $optParams = array())
40
- {
41
- $params = array('userId' => $userId, 'sendAsEmail' => $sendAsEmail, 'id' => $id);
42
- $params = array_merge($params, $optParams);
43
- return $this->call('delete', array($params));
44
- }
45
- /**
46
- * Gets the specified S/MIME config for the specified send-as alias.
47
- * (smimeInfo.get)
48
- *
49
- * @param string $userId The user's email address. The special value me can be
50
- * used to indicate the authenticated user.
51
- * @param string $sendAsEmail The email address that appears in the "From:"
52
- * header for mail sent using this alias.
53
- * @param string $id The immutable ID for the SmimeInfo.
54
- * @param array $optParams Optional parameters.
55
- * @return Google_Service_Gmail_SmimeInfo
56
- */
57
- public function get($userId, $sendAsEmail, $id, $optParams = array())
58
- {
59
- $params = array('userId' => $userId, 'sendAsEmail' => $sendAsEmail, 'id' => $id);
60
- $params = array_merge($params, $optParams);
61
- return $this->call('get', array($params), "Google_Service_Gmail_SmimeInfo");
62
- }
63
- /**
64
- * Insert (upload) the given S/MIME config for the specified send-as alias. Note
65
- * that pkcs12 format is required for the key. (smimeInfo.insert)
66
- *
67
- * @param string $userId The user's email address. The special value me can be
68
- * used to indicate the authenticated user.
69
- * @param string $sendAsEmail The email address that appears in the "From:"
70
- * header for mail sent using this alias.
71
- * @param Google_Service_Gmail_SmimeInfo $postBody
72
- * @param array $optParams Optional parameters.
73
- * @return Google_Service_Gmail_SmimeInfo
74
- */
75
- public function insert($userId, $sendAsEmail, Google_Service_Gmail_SmimeInfo $postBody, $optParams = array())
76
- {
77
- $params = array('userId' => $userId, 'sendAsEmail' => $sendAsEmail, 'postBody' => $postBody);
78
- $params = array_merge($params, $optParams);
79
- return $this->call('insert', array($params), "Google_Service_Gmail_SmimeInfo");
80
- }
81
- /**
82
- * Lists S/MIME configs for the specified send-as alias.
83
- * (smimeInfo.listUsersSettingsSendAsSmimeInfo)
84
- *
85
- * @param string $userId The user's email address. The special value me can be
86
- * used to indicate the authenticated user.
87
- * @param string $sendAsEmail The email address that appears in the "From:"
88
- * header for mail sent using this alias.
89
- * @param array $optParams Optional parameters.
90
- * @return Google_Service_Gmail_ListSmimeInfoResponse
91
- */
92
- public function listUsersSettingsSendAsSmimeInfo($userId, $sendAsEmail, $optParams = array())
93
- {
94
- $params = array('userId' => $userId, 'sendAsEmail' => $sendAsEmail);
95
- $params = array_merge($params, $optParams);
96
- return $this->call('list', array($params), "Google_Service_Gmail_ListSmimeInfoResponse");
97
- }
98
- /**
99
- * Sets the default S/MIME config for the specified send-as alias.
100
- * (smimeInfo.setDefault)
101
- *
102
- * @param string $userId The user's email address. The special value me can be
103
- * used to indicate the authenticated user.
104
- * @param string $sendAsEmail The email address that appears in the "From:"
105
- * header for mail sent using this alias.
106
- * @param string $id The immutable ID for the SmimeInfo.
107
- * @param array $optParams Optional parameters.
108
- */
109
- public function setDefault($userId, $sendAsEmail, $id, $optParams = array())
110
- {
111
- $params = array('userId' => $userId, 'sendAsEmail' => $sendAsEmail, 'id' => $id);
112
- $params = array_merge($params, $optParams);
113
- return $this->call('setDefault', array($params));
114
- }
115
- }
1
+ <?php
2
+ /*
3
+ * Copyright 2014 Google Inc.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6
+ * use this file except in compliance with the License. You may obtain a copy of
7
+ * the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
+ * License for the specific language governing permissions and limitations under
15
+ * the License.
16
+ */
17
+
18
+ /**
19
+ * The "smimeInfo" collection of methods.
20
+ * Typical usage is:
21
+ * <code>
22
+ * $gmailService = new Google_Service_Gmail(...);
23
+ * $smimeInfo = $gmailService->smimeInfo;
24
+ * </code>
25
+ */
26
+ class Google_Service_Gmail_Resource_UsersSettingsSendAsSmimeInfo extends Google_Service_Resource
27
+ {
28
+ /**
29
+ * Deletes the specified S/MIME config for the specified send-as alias.
30
+ * (smimeInfo.delete)
31
+ *
32
+ * @param string $userId The user's email address. The special value me can be
33
+ * used to indicate the authenticated user.
34
+ * @param string $sendAsEmail The email address that appears in the "From:"
35
+ * header for mail sent using this alias.
36
+ * @param string $id The immutable ID for the SmimeInfo.
37
+ * @param array $optParams Optional parameters.
38
+ */
39
+ public function delete($userId, $sendAsEmail, $id, $optParams = array())
40
+ {
41
+ $params = array('userId' => $userId, 'sendAsEmail' => $sendAsEmail, 'id' => $id);
42
+ $params = array_merge($params, $optParams);
43
+ return $this->call('delete', array($params));
44
+ }
45
+ /**
46
+ * Gets the specified S/MIME config for the specified send-as alias.
47
+ * (smimeInfo.get)
48
+ *
49
+ * @param string $userId The user's email address. The special value me can be
50
+ * used to indicate the authenticated user.
51
+ * @param string $sendAsEmail The email address that appears in the "From:"
52
+ * header for mail sent using this alias.
53
+ * @param string $id The immutable ID for the SmimeInfo.
54
+ * @param array $optParams Optional parameters.
55
+ * @return Google_Service_Gmail_SmimeInfo
56
+ */
57
+ public function get($userId, $sendAsEmail, $id, $optParams = array())
58
+ {
59
+ $params = array('userId' => $userId, 'sendAsEmail' => $sendAsEmail, 'id' => $id);
60
+ $params = array_merge($params, $optParams);
61
+ return $this->call('get', array($params), "Google_Service_Gmail_SmimeInfo");
62
+ }
63
+ /**
64
+ * Insert (upload) the given S/MIME config for the specified send-as alias. Note
65
+ * that pkcs12 format is required for the key. (smimeInfo.insert)
66
+ *
67
+ * @param string $userId The user's email address. The special value me can be
68
+ * used to indicate the authenticated user.
69
+ * @param string $sendAsEmail The email address that appears in the "From:"
70
+ * header for mail sent using this alias.
71
+ * @param Google_Service_Gmail_SmimeInfo $postBody
72
+ * @param array $optParams Optional parameters.
73
+ * @return Google_Service_Gmail_SmimeInfo
74
+ */
75
+ public function insert($userId, $sendAsEmail, Google_Service_Gmail_SmimeInfo $postBody, $optParams = array())
76
+ {
77
+ $params = array('userId' => $userId, 'sendAsEmail' => $sendAsEmail, 'postBody' => $postBody);
78
+ $params = array_merge($params, $optParams);
79
+ return $this->call('insert', array($params), "Google_Service_Gmail_SmimeInfo");
80
+ }
81
+ /**
82
+ * Lists S/MIME configs for the specified send-as alias.
83
+ * (smimeInfo.listUsersSettingsSendAsSmimeInfo)
84
+ *
85
+ * @param string $userId The user's email address. The special value me can be
86
+ * used to indicate the authenticated user.
87
+ * @param string $sendAsEmail The email address that appears in the "From:"
88
+ * header for mail sent using this alias.
89
+ * @param array $optParams Optional parameters.
90
+ * @return Google_Service_Gmail_ListSmimeInfoResponse
91
+ */
92
+ public function listUsersSettingsSendAsSmimeInfo($userId, $sendAsEmail, $optParams = array())
93
+ {
94
+ $params = array('userId' => $userId, 'sendAsEmail' => $sendAsEmail);
95
+ $params = array_merge($params, $optParams);
96
+ return $this->call('list', array($params), "Google_Service_Gmail_ListSmimeInfoResponse");
97
+ }
98
+ /**
99
+ * Sets the default S/MIME config for the specified send-as alias.
100
+ * (smimeInfo.setDefault)
101
+ *
102
+ * @param string $userId The user's email address. The special value me can be
103
+ * used to indicate the authenticated user.
104
+ * @param string $sendAsEmail The email address that appears in the "From:"
105
+ * header for mail sent using this alias.
106
+ * @param string $id The immutable ID for the SmimeInfo.
107
+ * @param array $optParams Optional parameters.
108
+ */
109
+ public function setDefault($userId, $sendAsEmail, $id, $optParams = array())
110
+ {
111
+ $params = array('userId' => $userId, 'sendAsEmail' => $sendAsEmail, 'id' => $id);
112
+ $params = array_merge($params, $optParams);
113
+ return $this->call('setDefault', array($params));
114
+ }
115
+ }
vendor/google/apiclient-services/src/Google/Service/Gmail/Resource/UsersThreads.php CHANGED
@@ -1,135 +1,135 @@
1
- <?php
2
- /*
3
- * Copyright 2014 Google Inc.
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6
- * use this file except in compliance with the License. You may obtain a copy of
7
- * the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
- * License for the specific language governing permissions and limitations under
15
- * the License.
16
- */
17
-
18
- /**
19
- * The "threads" collection of methods.
20
- * Typical usage is:
21
- * <code>
22
- * $gmailService = new Google_Service_Gmail(...);
23
- * $threads = $gmailService->threads;
24
- * </code>
25
- */
26
- class Google_Service_Gmail_Resource_UsersThreads extends Google_Service_Resource
27
- {
28
- /**
29
- * Immediately and permanently deletes the specified thread. This operation
30
- * cannot be undone. Prefer threads.trash instead. (threads.delete)
31
- *
32
- * @param string $userId The user's email address. The special value me can be
33
- * used to indicate the authenticated user.
34
- * @param string $id ID of the Thread to delete.
35
- * @param array $optParams Optional parameters.
36
- */
37
- public function delete($userId, $id, $optParams = array())
38
- {
39
- $params = array('userId' => $userId, 'id' => $id);
40
- $params = array_merge($params, $optParams);
41
- return $this->call('delete', array($params));
42
- }
43
- /**
44
- * Gets the specified thread. (threads.get)
45
- *
46
- * @param string $userId The user's email address. The special value me can be
47
- * used to indicate the authenticated user.
48
- * @param string $id The ID of the thread to retrieve.
49
- * @param array $optParams Optional parameters.
50
- *
51
- * @opt_param string format The format to return the messages in.
52
- * @opt_param string metadataHeaders When given and format is METADATA, only
53
- * include headers specified.
54
- * @return Google_Service_Gmail_Thread
55
- */
56
- public function get($userId, $id, $optParams = array())
57
- {
58
- $params = array('userId' => $userId, 'id' => $id);
59
- $params = array_merge($params, $optParams);
60
- return $this->call('get', array($params), "Google_Service_Gmail_Thread");
61
- }
62
- /**
63
- * Lists the threads in the user's mailbox. (threads.listUsersThreads)
64
- *
65
- * @param string $userId The user's email address. The special value me can be
66
- * used to indicate the authenticated user.
67
- * @param array $optParams Optional parameters.
68
- *
69
- * @opt_param bool includeSpamTrash Include threads from SPAM and TRASH in the
70
- * results.
71
- * @opt_param string labelIds Only return threads with labels that match all of
72
- * the specified label IDs.
73
- * @opt_param string maxResults Maximum number of threads to return.
74
- * @opt_param string pageToken Page token to retrieve a specific page of results
75
- * in the list.
76
- * @opt_param string q Only return threads matching the specified query.
77
- * Supports the same query format as the Gmail search box. For example,
78
- * "from:someuser@example.com rfc822msgid: is:unread". Parameter cannot be used
79
- * when accessing the api using the gmail.metadata scope.
80
- * @return Google_Service_Gmail_ListThreadsResponse
81
- */
82
- public function listUsersThreads($userId, $optParams = array())
83
- {
84
- $params = array('userId' => $userId);
85
- $params = array_merge($params, $optParams);
86
- return $this->call('list', array($params), "Google_Service_Gmail_ListThreadsResponse");
87
- }
88
- /**
89
- * Modifies the labels applied to the thread. This applies to all messages in
90
- * the thread. (threads.modify)
91
- *
92
- * @param string $userId The user's email address. The special value me can be
93
- * used to indicate the authenticated user.
94
- * @param string $id The ID of the thread to modify.
95
- * @param Google_Service_Gmail_ModifyThreadRequest $postBody
96
- * @param array $optParams Optional parameters.
97
- * @return Google_Service_Gmail_Thread
98
- */
99
- public function modify($userId, $id, Google_Service_Gmail_ModifyThreadRequest $postBody, $optParams = array())
100
- {
101
- $params = array('userId' => $userId, 'id' => $id, 'postBody' => $postBody);
102
- $params = array_merge($params, $optParams);
103
- return $this->call('modify', array($params), "Google_Service_Gmail_Thread");
104
- }
105
- /**
106
- * Moves the specified thread to the trash. (threads.trash)
107
- *
108
- * @param string $userId The user's email address. The special value me can be
109
- * used to indicate the authenticated user.
110
- * @param string $id The ID of the thread to Trash.
111
- * @param array $optParams Optional parameters.
112
- * @return Google_Service_Gmail_Thread
113
- */
114
- public function trash($userId, $id, $optParams = array())
115
- {
116
- $params = array('userId' => $userId, 'id' => $id);
117
- $params = array_merge($params, $optParams);
118
- return $this->call('trash', array($params), "Google_Service_Gmail_Thread");
119
- }
120
- /**
121
- * Removes the specified thread from the trash. (threads.untrash)
122
- *
123
- * @param string $userId The user's email address. The special value me can be
124
- * used to indicate the authenticated user.
125
- * @param string $id The ID of the thread to remove from Trash.
126
- * @param array $optParams Optional parameters.
127
- * @return Google_Service_Gmail_Thread
128
- */
129
- public function untrash($userId, $id, $optParams = array())
130
- {
131
- $params = array('userId' => $userId, 'id' => $id);
132
- $params = array_merge($params, $optParams);
133
- return $this->call('untrash', array($params), "Google_Service_Gmail_Thread");
134
- }
135
- }
1
+ <?php
2
+ /*
3
+ * Copyright 2014 Google Inc.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6
+ * use this file except in compliance with the License. You may obtain a copy of
7
+ * the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
+ * License for the specific language governing permissions and limitations under
15
+ * the License.
16
+ */
17
+
18
+ /**
19
+ * The "threads" collection of methods.
20
+ * Typical usage is:
21
+ * <code>
22
+ * $gmailService = new Google_Service_Gmail(...);
23
+ * $threads = $gmailService->threads;
24
+ * </code>
25
+ */
26
+ class Google_Service_Gmail_Resource_UsersThreads extends Google_Service_Resource
27
+ {
28
+ /**
29
+ * Immediately and permanently deletes the specified thread. This operation
30
+ * cannot be undone. Prefer threads.trash instead. (threads.delete)
31
+ *
32
+ * @param string $userId The user's email address. The special value me can be
33
+ * used to indicate the authenticated user.
34
+ * @param string $id ID of the Thread to delete.
35
+ * @param array $optParams Optional parameters.
36
+ */
37
+ public function delete($userId, $id, $optParams = array())
38
+ {
39
+ $params = array('userId' => $userId, 'id' => $id);
40
+ $params = array_merge($params, $optParams);
41
+ return $this->call('delete', array($params));
42
+ }
43
+ /**
44
+ * Gets the specified thread. (threads.get)
45
+ *
46
+ * @param string $userId The user's email address. The special value me can be
47
+ * used to indicate the authenticated user.
48
+ * @param string $id The ID of the thread to retrieve.
49
+ * @param array $optParams Optional parameters.
50
+ *
51
+ * @opt_param string format The format to return the messages in.
52
+ * @opt_param string metadataHeaders When given and format is METADATA, only
53
+ * include headers specified.
54
+ * @return Google_Service_Gmail_Thread
55
+ */
56
+ public function get($userId, $id, $optParams = array())
57
+ {
58
+ $params = array('userId' => $userId, 'id' => $id);
59
+ $params = array_merge($params, $optParams);
60
+ return $this->call('get', array($params), "Google_Service_Gmail_Thread");
61
+ }
62
+ /**
63
+ * Lists the threads in the user's mailbox. (threads.listUsersThreads)
64
+ *
65
+ * @param string $userId The user's email address. The special value me can be
66
+ * used to indicate the authenticated user.
67
+ * @param array $optParams Optional parameters.
68
+ *
69
+ * @opt_param bool includeSpamTrash Include threads from SPAM and TRASH in the
70
+ * results.
71
+ * @opt_param string labelIds Only return threads with labels that match all of
72
+ * the specified label IDs.
73
+ * @opt_param string maxResults Maximum number of threads to return.
74
+ * @opt_param string pageToken Page token to retrieve a specific page of results
75
+ * in the list.
76
+ * @opt_param string q Only return threads matching the specified query.
77
+ * Supports the same query format as the Gmail search box. For example,
78
+ * "from:someuser@example.com rfc822msgid: is:unread". Parameter cannot be used
79
+ * when accessing the api using the gmail.metadata scope.
80
+ * @return Google_Service_Gmail_ListThreadsResponse
81
+ */
82
+ public function listUsersThreads($userId, $optParams = array())
83
+ {
84
+ $params = array('userId' => $userId);
85
+ $params = array_merge($params, $optParams);
86
+ return $this->call('list', array($params), "Google_Service_Gmail_ListThreadsResponse");
87
+ }
88
+ /**
89
+ * Modifies the labels applied to the thread. This applies to all messages in
90
+ * the thread. (threads.modify)
91
+ *
92
+ * @param string $userId The user's email address. The special value me can be
93
+ * used to indicate the authenticated user.
94
+ * @param string $id The ID of the thread to modify.
95
+ * @param Google_Service_Gmail_ModifyThreadRequest $postBody
96
+ * @param array $optParams Optional parameters.
97
+ * @return Google_Service_Gmail_Thread
98
+ */
99
+ public function modify($userId, $id, Google_Service_Gmail_ModifyThreadRequest $postBody, $optParams = array())
100
+ {
101
+ $params = array('userId' => $userId, 'id' => $id, 'postBody' => $postBody);
102
+ $params = array_merge($params, $optParams);
103
+ return $this->call('modify', array($params), "Google_Service_Gmail_Thread");
104
+ }
105
+ /**
106
+ * Moves the specified thread to the trash. (threads.trash)
107
+ *
108
+ * @param string $userId The user's email address. The special value me can be
109
+ * used to indicate the authenticated user.
110
+ * @param string $id The ID of the thread to Trash.
111
+ * @param array $optParams Optional parameters.
112
+ * @return Google_Service_Gmail_Thread
113
+ */
114
+ public function trash($userId, $id, $optParams = array())
115
+ {
116
+ $params = array('userId' => $userId, 'id' => $id);
117
+ $params = array_merge($params, $optParams);
118
+ return $this->call('trash', array($params), "Google_Service_Gmail_Thread");
119
+ }
120
+ /**
121
+ * Removes the specified thread from the trash. (threads.untrash)
122
+ *
123
+ * @param string $userId The user's email address. The special value me can be
124
+ * used to indicate the authenticated user.
125
+ * @param string $id The ID of the thread to remove from Trash.
126
+ * @param array $optParams Optional parameters.
127
+ * @return Google_Service_Gmail_Thread
128
+ */
129
+ public function untrash($userId, $id, $optParams = array())
130
+ {
131
+ $params = array('userId' => $userId, 'id' => $id);
132
+ $params = array_merge($params, $optParams);
133
+ return $this->call('untrash', array($params), "Google_Service_Gmail_Thread");
134
+ }
135
+ }
vendor/google/apiclient-services/src/Google/Service/Gmail/SendAs.php CHANGED
@@ -1,109 +1,109 @@
1
- <?php
2
- /*
3
- * Copyright 2014 Google Inc.
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6
- * use this file except in compliance with the License. You may obtain a copy of
7
- * the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
- * License for the specific language governing permissions and limitations under
15
- * the License.
16
- */
17
-
18
- class Google_Service_Gmail_SendAs extends Google_Model
19
- {
20
- public $displayName;
21
- public $isDefault;
22
- public $isPrimary;
23
- public $replyToAddress;
24
- public $sendAsEmail;
25
- public $signature;
26
- protected $smtpMsaType = 'Google_Service_Gmail_SmtpMsa';
27
- protected $smtpMsaDataType = '';
28
- public $treatAsAlias;
29
- public $verificationStatus;
30
-
31
- public function setDisplayName($displayName)
32
- {
33
- $this->displayName = $displayName;
34
- }
35
- public function getDisplayName()
36
- {
37
- return $this->displayName;
38
- }
39
- public function setIsDefault($isDefault)
40
- {
41
- $this->isDefault = $isDefault;
42
- }
43
- public function getIsDefault()
44
- {
45
- return $this->isDefault;
46
- }
47
- public function setIsPrimary($isPrimary)
48
- {
49
- $this->isPrimary = $isPrimary;
50
- }
51
- public function getIsPrimary()
52
- {
53
- return $this->isPrimary;
54
- }
55
- public function setReplyToAddress($replyToAddress)
56
- {
57
- $this->replyToAddress = $replyToAddress;
58
- }
59
- public function getReplyToAddress()
60
- {
61
- return $this->replyToAddress;
62
- }
63
- public function setSendAsEmail($sendAsEmail)
64
- {
65
- $this->sendAsEmail = $sendAsEmail;
66
- }
67
- public function getSendAsEmail()
68
- {
69
- return $this->sendAsEmail;
70
- }
71
- public function setSignature($signature)
72
- {
73
- $this->signature = $signature;
74
- }
75
- public function getSignature()
76
- {
77
- return $this->signature;
78
- }
79
- /**
80
- * @param Google_Service_Gmail_SmtpMsa
81
- */
82
- public function setSmtpMsa(Google_Service_Gmail_SmtpMsa $smtpMsa)
83
- {
84
- $this->smtpMsa = $smtpMsa;
85
- }
86
- /**
87
- * @return Google_Service_Gmail_SmtpMsa
88
- */
89
- public function getSmtpMsa()
90
- {
91
- return $this->smtpMsa;
92
- }
93
- public function setTreatAsAlias($treatAsAlias)
94
- {
95
- $this->treatAsAlias = $treatAsAlias;
96
- }
97
- public function getTreatAsAlias()
98
- {
99
- return $this->treatAsAlias;
100
- }
101
- public function setVerificationStatus($verificationStatus)
102
- {
103
- $this->verificationStatus = $verificationStatus;
104
- }
105
- public function getVerificationStatus()
106
- {
107
- return $this->verificationStatus;
108
- }
109
- }
1
+ <?php
2
+ /*
3
+ * Copyright 2014 Google Inc.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6
+ * use this file except in compliance with the License. You may obtain a copy of
7
+ * the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
+ * License for the specific language governing permissions and limitations under
15
+ * the License.
16
+ */
17
+
18
+ class Google_Service_Gmail_SendAs extends Google_Model
19
+ {
20
+ public $displayName;
21
+ public $isDefault;
22
+ public $isPrimary;
23
+ public $replyToAddress;
24
+ public $sendAsEmail;
25
+ public $signature;
26
+ protected $smtpMsaType = 'Google_Service_Gmail_SmtpMsa';
27
+ protected $smtpMsaDataType = '';
28
+ public $treatAsAlias;
29
+ public $verificationStatus;
30
+
31
+ public function setDisplayName($displayName)
32
+ {
33
+ $this->displayName = $displayName;
34
+ }
35
+ public function getDisplayName()
36
+ {
37
+ return $this->displayName;
38
+ }
39
+ public function setIsDefault($isDefault)
40
+ {
41
+ $this->isDefault = $isDefault;
42
+ }
43
+ public function getIsDefault()
44
+ {
45
+ return $this->isDefault;
46
+ }
47
+ public function setIsPrimary($isPrimary)
48
+ {
49
+ $this->isPrimary = $isPrimary;
50
+ }
51
+ public function getIsPrimary()
52
+ {
53
+ return $this->isPrimary;
54
+ }
55
+ public function setReplyToAddress($replyToAddress)
56
+ {
57
+ $this->replyToAddress = $replyToAddress;
58
+ }
59
+ public function getReplyToAddress()
60
+ {
61
+ return $this->replyToAddress;
62
+ }
63
+ public function setSendAsEmail($sendAsEmail)
64
+ {
65
+ $this->sendAsEmail = $sendAsEmail;
66
+ }
67
+ public function getSendAsEmail()
68
+ {
69
+ return $this->sendAsEmail;
70
+ }
71
+ public function setSignature($signature)
72
+ {
73
+ $this->signature = $signature;
74
+ }
75
+ public function getSignature()
76
+ {
77
+ return $this->signature;
78
+ }
79
+ /**
80
+ * @param Google_Service_Gmail_SmtpMsa
81
+ */
82
+ public function setSmtpMsa(Google_Service_Gmail_SmtpMsa $smtpMsa)
83
+ {
84
+ $this->smtpMsa = $smtpMsa;
85
+ }
86
+ /**
87
+ * @return Google_Service_Gmail_SmtpMsa
88
+ */
89
+ public function getSmtpMsa()
90
+ {
91
+ return $this->smtpMsa;
92
+ }
93
+ public function setTreatAsAlias($treatAsAlias)
94
+ {
95
+ $this->treatAsAlias = $treatAsAlias;
96
+ }
97
+ public function getTreatAsAlias()
98
+ {
99
+ return $this->treatAsAlias;
100
+ }
101
+ public function setVerificationStatus($verificationStatus)
102
+ {
103
+ $this->verificationStatus = $verificationStatus;
104
+ }
105
+ public function getVerificationStatus()
106
+ {
107
+ return $this->verificationStatus;
108
+ }
109
+ }
vendor/google/apiclient-services/src/Google/Service/Gmail/SmimeInfo.php CHANGED
@@ -1,84 +1,84 @@
1
- <?php
2
- /*
3
- * Copyright 2014 Google Inc.
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6
- * use this file except in compliance with the License. You may obtain a copy of
7
- * the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
- * License for the specific language governing permissions and limitations under
15
- * the License.
16
- */
17
-
18
- class Google_Service_Gmail_SmimeInfo extends Google_Model
19
- {
20
- public $encryptedKeyPassword;
21
- public $expiration;
22
- public $id;
23
- public $isDefault;
24
- public $issuerCn;
25
- public $pem;
26
- public $pkcs12;
27
-
28
- public function setEncryptedKeyPassword($encryptedKeyPassword)
29
- {
30
- $this->encryptedKeyPassword = $encryptedKeyPassword;
31
- }
32
- public function getEncryptedKeyPassword()
33
- {
34
- return $this->encryptedKeyPassword;
35
- }
36
- public function setExpiration($expiration)
37
- {
38
- $this->expiration = $expiration;
39
- }
40
- public function getExpiration()
41
- {
42
- return $this->expiration;
43
- }
44
- public function setId($id)
45
- {
46
- $this->id = $id;
47
- }
48
- public function getId()
49
- {
50
- return $this->id;
51
- }
52
- public function setIsDefault($isDefault)
53
- {
54
- $this->isDefault = $isDefault;
55
- }
56
- public function getIsDefault()
57
- {
58
- return $this->isDefault;
59
- }
60
- public function setIssuerCn($issuerCn)
61
- {
62
- $this->issuerCn = $issuerCn;
63
- }
64
- public function getIssuerCn()
65
- {
66
- return $this->issuerCn;
67
- }
68
- public function setPem($pem)
69
- {
70
- $this->pem = $pem;
71
- }
72
- public function getPem()
73
- {
74
- return $this->pem;
75
- }
76
- public function setPkcs12($pkcs12)
77
- {
78
- $this->pkcs12 = $pkcs12;
79
- }
80
- public function getPkcs12()
81
- {
82
- return $this->pkcs12;
83
- }
84
- }
1
+ <?php
2
+ /*
3
+ * Copyright 2014 Google Inc.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6
+ * use this file except in compliance with the License. You may obtain a copy of
7
+ * the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
+ * License for the specific language governing permissions and limitations under
15
+ * the License.
16
+ */
17
+
18
+ class Google_Service_Gmail_SmimeInfo extends Google_Model
19
+ {
20
+ public $encryptedKeyPassword;
21
+ public $expiration;
22
+ public $id;
23
+ public $isDefault;
24
+ public $issuerCn;
25
+ public $pem;
26
+ public $pkcs12;
27
+
28
+ public function setEncryptedKeyPassword($encryptedKeyPassword)
29
+ {
30
+ $this->encryptedKeyPassword = $encryptedKeyPassword;
31
+ }
32
+ public function getEncryptedKeyPassword()
33
+ {
34
+ return $this->encryptedKeyPassword;
35
+ }
36
+ public function setExpiration($expiration)
37
+ {
38
+ $this->expiration = $expiration;
39
+ }
40
+ public function getExpiration()
41
+ {
42
+ return $this->expiration;
43
+ }
44
+ public function setId($id)
45
+ {
46
+ $this->id = $id;
47
+ }
48
+ public function getId()
49
+ {
50
+ return $this->id;
51
+ }
52
+ public function setIsDefault($isDefault)
53
+ {
54
+ $this->isDefault = $isDefault;
55
+ }
56
+ public function getIsDefault()
57
+ {
58
+ return $this->isDefault;
59
+ }
60
+ public function setIssuerCn($issuerCn)
61
+ {
62
+ $this->issuerCn = $issuerCn;
63
+ }
64
+ public function getIssuerCn()
65
+ {
66
+ return $this->issuerCn;
67
+ }
68
+ public function setPem($pem)
69
+ {
70
+ $this->pem = $pem;
71
+ }
72
+ public function getPem()
73
+ {
74
+ return $this->pem;
75
+ }
76
+ public function setPkcs12($pkcs12)
77
+ {
78
+ $this->pkcs12 = $pkcs12;
79
+ }
80
+ public function getPkcs12()
81
+ {
82
+ return $this->pkcs12;
83
+ }
84
+ }
vendor/google/apiclient-services/src/Google/Service/Gmail/SmtpMsa.php CHANGED
@@ -1,66 +1,66 @@
1
- <?php
2
- /*
3
- * Copyright 2014 Google Inc.
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6
- * use this file except in compliance with the License. You may obtain a copy of
7
- * the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
- * License for the specific language governing permissions and limitations under
15
- * the License.
16
- */
17
-
18
- class Google_Service_Gmail_SmtpMsa extends Google_Model
19
- {
20
- public $host;
21
- public $password;
22
- public $port;
23
- public $securityMode;
24
- public $username;
25
-
26
- public function setHost($host)
27
- {
28
- $this->host = $host;
29
- }
30
- public function getHost()
31
- {
32
- return $this->host;
33
- }
34
- public function setPassword($password)
35
- {
36
- $this->password = $password;
37
- }
38
- public function getPassword()
39
- {
40
- return $this->password;
41
- }
42
- public function setPort($port)
43
- {
44
- $this->port = $port;
45
- }
46
- public function getPort()
47
- {
48
- return $this->port;
49
- }
50
- public function setSecurityMode($securityMode)
51
- {
52
- $this->securityMode = $securityMode;
53
- }
54
- public function getSecurityMode()
55
- {
56
- return $this->securityMode;
57
- }
58
- public function setUsername($username)
59
- {
60
- $this->username = $username;
61
- }
62
- public function getUsername()
63
- {
64
- return $this->username;
65
- }
66
- }
1
+ <?php
2
+ /*
3
+ * Copyright 2014 Google Inc.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6
+ * use this file except in compliance with the License. You may obtain a copy of
7
+ * the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
+ * License for the specific language governing permissions and limitations under
15
+ * the License.
16
+ */
17
+
18
+ class Google_Service_Gmail_SmtpMsa extends Google_Model
19
+ {
20
+ public $host;
21
+ public $password;
22
+ public $port;
23
+ public $securityMode;
24
+ public $username;
25
+
26
+ public function setHost($host)
27
+ {
28
+ $this->host = $host;
29
+ }
30
+ public function getHost()
31
+ {
32
+ return $this->host;
33
+ }
34
+ public function setPassword($password)
35
+ {
36
+ $this->password = $password;
37
+ }
38
+ public function getPassword()
39
+ {
40
+ return $this->password;
41
+ }
42
+ public function setPort($port)
43
+ {
44
+ $this->port = $port;
45
+ }
46
+ public function getPort()
47
+ {
48
+ return $this->port;
49
+ }
50
+ public function setSecurityMode($securityMode)
51
+ {
52
+ $this->securityMode = $securityMode;
53
+ }
54
+ public function getSecurityMode()
55
+ {
56
+ return $this->securityMode;
57
+ }
58
+ public function setUsername($username)
59
+ {
60
+ $this->username = $username;
61
+ }
62
+ public function getUsername()
63
+ {
64
+ return $this->username;
65
+ }
66
+ }
vendor/google/apiclient-services/src/Google/Service/Gmail/Thread.php CHANGED
@@ -1,65 +1,65 @@
1
- <?php
2
- /*
3
- * Copyright 2014 Google Inc.
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6
- * use this file except in compliance with the License. You may obtain a copy of
7
- * the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
- * License for the specific language governing permissions and limitations under
15
- * the License.
16
- */
17
-
18
- class Google_Service_Gmail_Thread extends Google_Collection
19
- {
20
- protected $collection_key = 'messages';
21
- public $historyId;
22
- public $id;
23
- protected $messagesType = 'Google_Service_Gmail_Message';
24
- protected $messagesDataType = 'array';
25
- public $snippet;
26
-
27
- public function setHistoryId($historyId)
28
- {
29
- $this->historyId = $historyId;
30
- }
31
- public function getHistoryId()
32
- {
33
- return $this->historyId;
34
- }
35
- public function setId($id)
36
- {
37
- $this->id = $id;
38
- }
39
- public function getId()
40
- {
41
- return $this->id;
42
- }
43
- /**
44
- * @param Google_Service_Gmail_Message
45
- */
46
- public function setMessages($messages)
47
- {
48
- $this->messages = $messages;
49
- }
50
- /**
51
- * @return Google_Service_Gmail_Message
52
- */
53
- public function getMessages()
54
- {
55
- return $this->messages;
56
- }
57
- public function setSnippet($snippet)
58
- {
59
- $this->snippet = $snippet;
60
- }
61
- public function getSnippet()
62
- {
63
- return $this->snippet;
64
- }
65
- }
1
+ <?php
2
+ /*
3
+ * Copyright 2014 Google Inc.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6
+ * use this file except in compliance with the License. You may obtain a copy of
7
+ * the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
+ * License for the specific language governing permissions and limitations under
15
+ * the License.
16
+ */
17
+
18
+ class Google_Service_Gmail_Thread extends Google_Collection
19
+ {
20
+ protected $collection_key = 'messages';
21
+ public $historyId;
22
+ public $id;
23
+ protected $messagesType = 'Google_Service_Gmail_Message';
24
+ protected $messagesDataType = 'array';
25
+ public $snippet;
26
+
27
+ public function setHistoryId($historyId)
28
+ {
29
+ $this->historyId = $historyId;
30
+ }
31
+ public function getHistoryId()
32
+ {
33
+ return $this->historyId;
34
+ }
35
+ public function setId($id)
36
+ {
37
+ $this->id = $id;
38
+ }
39
+ public function getId()
40
+ {
41
+ return $this->id;
42
+ }
43
+ /**
44
+ * @param Google_Service_Gmail_Message
45
+ */
46
+ public function setMessages($messages)
47
+ {
48
+ $this->messages = $messages;
49
+ }
50
+ /**
51
+ * @return Google_Service_Gmail_Message
52
+ */
53
+ public function getMessages()
54
+ {
55
+ return $this->messages;
56
+ }
57
+ public function setSnippet($snippet)
58
+ {
59
+ $this->snippet = $snippet;
60
+ }
61
+ public function getSnippet()
62
+ {
63
+ return $this->snippet;
64
+ }
65
+ }
vendor/google/apiclient-services/src/Google/Service/Gmail/VacationSettings.php CHANGED
@@ -1,93 +1,93 @@
1
- <?php
2
- /*
3
- * Copyright 2014 Google Inc.
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6
- * use this file except in compliance with the License. You may obtain a copy of
7
- * the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
- * License for the specific language governing permissions and limitations under
15
- * the License.
16
- */
17
-
18
- class Google_Service_Gmail_VacationSettings extends Google_Model
19
- {
20
- public $enableAutoReply;
21
- public $endTime;
22
- public $responseBodyHtml;
23
- public $responseBodyPlainText;
24
- public $responseSubject;
25
- public $restrictToContacts;
26
- public $restrictToDomain;
27
- public $startTime;
28
-
29
- public function setEnableAutoReply($enableAutoReply)
30
- {
31
- $this->enableAutoReply = $enableAutoReply;
32
- }
33
- public function getEnableAutoReply()
34
- {
35
- return $this->enableAutoReply;
36
- }
37
- public function setEndTime($endTime)
38
- {
39
- $this->endTime = $endTime;
40
- }
41
- public function getEndTime()
42
- {
43
- return $this->endTime;
44
- }
45
- public function setResponseBodyHtml($responseBodyHtml)
46
- {
47
- $this->responseBodyHtml = $responseBodyHtml;
48
- }
49
- public function getResponseBodyHtml()
50
- {
51
- return $this->responseBodyHtml;
52
- }
53
- public function setResponseBodyPlainText($responseBodyPlainText)
54
- {
55
- $this->responseBodyPlainText = $responseBodyPlainText;
56
- }
57
- public function getResponseBodyPlainText()
58
- {
59
- return $this->responseBodyPlainText;
60
- }
61
- public function setResponseSubject($responseSubject)
62
- {
63
- $this->responseSubject = $responseSubject;
64
- }
65
- public function getResponseSubject()
66
- {
67
- return $this->responseSubject;
68
- }
69
- public function setRestrictToContacts($restrictToContacts)
70
- {
71
- $this->restrictToContacts = $restrictToContacts;
72
- }
73
- public function getRestrictToContacts()
74
- {
75
- return $this->restrictToContacts;
76
- }
77
- public function setRestrictToDomain($restrictToDomain)
78
- {
79
- $this->restrictToDomain = $restrictToDomain;
80
- }
81
- public function getRestrictToDomain()
82
- {
83
- return $this->restrictToDomain;
84
- }
85
- public function setStartTime($startTime)
86
- {
87
- $this->startTime = $startTime;
88
- }
89
- public function getStartTime()
90
- {
91
- return $this->startTime;
92
- }
93
- }
1
+ <?php
2
+ /*
3
+ * Copyright 2014 Google Inc.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6
+ * use this file except in compliance with the License. You may obtain a copy of
7
+ * the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
+ * License for the specific language governing permissions and limitations under
15
+ * the License.
16
+ */
17
+
18
+ class Google_Service_Gmail_VacationSettings extends Google_Model
19
+ {
20
+ public $enableAutoReply;
21
+ public $endTime;
22
+ public $responseBodyHtml;
23
+ public $responseBodyPlainText;
24
+ public $responseSubject;
25
+ public $restrictToContacts;
26
+ public $restrictToDomain;
27
+ public $startTime;
28
+
29
+ public function setEnableAutoReply($enableAutoReply)
30
+ {
31
+ $this->enableAutoReply = $enableAutoReply;
32
+ }
33
+ public function getEnableAutoReply()
34
+ {
35
+ return $this->enableAutoReply;
36
+ }
37
+ public function setEndTime($endTime)
38
+ {
39
+ $this->endTime = $endTime;
40
+ }
41
+ public function getEndTime()
42
+ {
43
+ return $this->endTime;
44
+ }
45
+ public function setResponseBodyHtml($responseBodyHtml)
46
+ {
47
+ $this->responseBodyHtml = $responseBodyHtml;
48
+ }
49
+ public function getResponseBodyHtml()
50
+ {
51
+ return $this->responseBodyHtml;
52
+ }
53
+ public function setResponseBodyPlainText($responseBodyPlainText)
54
+ {
55
+ $this->responseBodyPlainText = $responseBodyPlainText;
56
+ }
57
+ public function getResponseBodyPlainText()
58
+ {
59
+ return $this->responseBodyPlainText;
60
+ }
61
+ public function setResponseSubject($responseSubject)
62
+ {
63
+ $this->responseSubject = $responseSubject;
64
+ }
65
+ public function getResponseSubject()
66
+ {
67
+ return $this->responseSubject;
68
+ }
69
+ public function setRestrictToContacts($restrictToContacts)
70
+ {
71
+ $this->restrictToContacts = $restrictToContacts;
72
+ }
73
+ public function getRestrictToContacts()
74
+ {
75
+ return $this->restrictToContacts;
76
+ }
77
+ public function setRestrictToDomain($restrictToDomain)
78
+ {
79
+ $this->restrictToDomain = $restrictToDomain;
80
+ }
81
+ public function getRestrictToDomain()
82
+ {
83
+ return $this->restrictToDomain;
84
+ }
85
+ public function setStartTime($startTime)
86
+ {
87
+ $this->startTime = $startTime;
88
+ }
89
+ public function getStartTime()
90
+ {
91
+ return $this->startTime;
92
+ }
93
+ }
vendor/google/apiclient-services/src/Google/Service/Gmail/WatchRequest.php CHANGED
@@ -1,49 +1,49 @@
1
- <?php
2
- /*
3
- * Copyright 2014 Google Inc.
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6
- * use this file except in compliance with the License. You may obtain a copy of
7
- * the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
- * License for the specific language governing permissions and limitations under
15
- * the License.
16
- */
17
-
18
- class Google_Service_Gmail_WatchRequest extends Google_Collection
19
- {
20
- protected $collection_key = 'labelIds';
21
- public $labelFilterAction;
22
- public $labelIds;
23
- public $topicName;
24
-
25
- public function setLabelFilterAction($labelFilterAction)
26
- {
27
- $this->labelFilterAction = $labelFilterAction;
28
- }
29
- public function getLabelFilterAction()
30
- {
31
- return $this->labelFilterAction;
32
- }
33
- public function setLabelIds($labelIds)
34
- {
35
- $this->labelIds = $labelIds;
36
- }
37
- public function getLabelIds()
38
- {
39
- return $this->labelIds;
40
- }
41
- public function setTopicName($topicName)
42
- {
43
- $this->topicName = $topicName;
44
- }
45
- public function getTopicName()
46
- {
47
- return $this->topicName;
48
- }
49
- }
1
+ <?php
2
+ /*
3
+ * Copyright 2014 Google Inc.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6
+ * use this file except in compliance with the License. You may obtain a copy of
7
+ * the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
+ * License for the specific language governing permissions and limitations under
15
+ * the License.
16
+ */
17
+
18
+ class Google_Service_Gmail_WatchRequest extends Google_Collection
19
+ {
20
+ protected $collection_key = 'labelIds';
21
+ public $labelFilterAction;
22
+ public $labelIds;
23
+ public $topicName;
24
+
25
+ public function setLabelFilterAction($labelFilterAction)
26
+ {
27
+ $this->labelFilterAction = $labelFilterAction;
28
+ }
29
+ public function getLabelFilterAction()
30
+ {
31
+ return $this->labelFilterAction;
32
+ }
33
+ public function setLabelIds($labelIds)
34
+ {
35
+ $this->labelIds = $labelIds;
36
+ }
37
+ public function getLabelIds()
38
+ {
39
+ return $this->labelIds;
40
+ }
41
+ public function setTopicName($topicName)
42
+ {
43
+ $this->topicName = $topicName;
44
+ }
45
+ public function getTopicName()
46
+ {
47
+ return $this->topicName;
48
+ }
49
+ }
vendor/google/apiclient-services/src/Google/Service/Gmail/WatchResponse.php CHANGED
@@ -1,39 +1,39 @@
1
- <?php
2
- /*
3
- * Copyright 2014 Google Inc.
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6
- * use this file except in compliance with the License. You may obtain a copy of
7
- * the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
- * License for the specific language governing permissions and limitations under
15
- * the License.
16
- */
17
-
18
- class Google_Service_Gmail_WatchResponse extends Google_Model
19
- {
20
- public $expiration;
21
- public $historyId;
22
-
23
- public function setExpiration($expiration)
24
- {
25
- $this->expiration = $expiration;
26
- }
27
- public function getExpiration()
28
- {
29
- return $this->expiration;
30
- }
31
- public function setHistoryId($historyId)
32
- {
33
- $this->historyId = $historyId;
34
- }
35
- public function getHistoryId()
36
- {
37
- return $this->historyId;
38
- }
39
- }
1
+ <?php
2
+ /*
3
+ * Copyright 2014 Google Inc.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6
+ * use this file except in compliance with the License. You may obtain a copy of
7
+ * the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
+ * License for the specific language governing permissions and limitations under
15
+ * the License.
16
+ */
17
+
18
+ class Google_Service_Gmail_WatchResponse extends Google_Model
19
+ {
20
+ public $expiration;
21
+ public $historyId;
22
+
23
+ public function setExpiration($expiration)
24
+ {
25
+ $this->expiration = $expiration;
26
+ }
27
+ public function getExpiration()
28
+ {
29
+ return $this->expiration;
30
+ }
31
+ public function setHistoryId($historyId)
32
+ {
33
+ $this->historyId = $historyId;
34
+ }
35
+ public function getHistoryId()
36
+ {
37
+ return $this->historyId;
38
+ }
39
+ }
vendor/guzzlehttp/guzzle/Dockerfile CHANGED
@@ -1,18 +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
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
vendor/guzzlehttp/guzzle/LICENSE CHANGED
@@ -1,19 +1,19 @@
1
- Copyright (c) 2011-2018 Michael Dowling, https://github.com/mtdowling <mtdowling@gmail.com>
2
-
3
- Permission is hereby granted, free of charge, to any person obtaining a copy
4
- of this software and associated documentation files (the "Software"), to deal
5
- in the Software without restriction, including without limitation the rights
6
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
- copies of the Software, and to permit persons to whom the Software is
8
- furnished to do so, subject to the following conditions:
9
-
10
- The above copyright notice and this permission notice shall be included in
11
- all copies or substantial portions of the Software.
12
-
13
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
- THE SOFTWARE.
1
+ Copyright (c) 2011-2018 Michael Dowling, https://github.com/mtdowling <mtdowling@gmail.com>
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy
4
+ of this software and associated documentation files (the "Software"), to deal
5
+ in the Software without restriction, including without limitation the rights
6
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
+ copies of the Software, and to permit persons to whom the Software is
8
+ furnished to do so, subject to the following conditions:
9
+
10
+ The above copyright notice and this permission notice shall be included in
11
+ all copies or substantial portions of the Software.
12
+
13
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
+ THE SOFTWARE.
vendor/guzzlehttp/guzzle/phpstan-baseline.neon DELETED
@@ -1,1412 +0,0 @@
1
- parameters:
2
- ignoreErrors:
3
- -
4
- message: "#^Property GuzzleHttp\\\\Client\\:\\:\\$config type has no value type specified in iterable type array\\.$#"
5
- count: 1
6
- path: src/Client.php
7
-
8
- -
9
- message: "#^Method GuzzleHttp\\\\Client\\:\\:__construct\\(\\) has parameter \\$config with no value type specified in iterable type array\\.$#"
10
- count: 1
11
- path: src/Client.php
12
-
13
- -
14
- message: "#^Method GuzzleHttp\\\\Client\\:\\:__call\\(\\) has parameter \\$args with no value type specified in iterable type array\\.$#"
15
- count: 1
16
- path: src/Client.php
17
-
18
- -
19
- message: "#^Method GuzzleHttp\\\\Client\\:\\:__call\\(\\) should return GuzzleHttp\\\\Promise\\\\PromiseInterface but returns GuzzleHttp\\\\PromiseInterface\\|Psr\\\\Http\\\\Message\\\\ResponseInterface\\.$#"
20
- count: 1
21
- path: src/Client.php
22
-
23
- -
24
- message: "#^Method GuzzleHttp\\\\Client\\:\\:sendAsync\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#"
25
- count: 1
26
- path: src/Client.php
27
-
28
- -
29
- message: "#^Return typehint of method GuzzleHttp\\\\Client\\:\\:sendAsync\\(\\) has invalid type GuzzleHttp\\\\PromiseInterface\\.$#"
30
- count: 1
31
- path: src/Client.php
32
-
33
- -
34
- message: "#^Method GuzzleHttp\\\\Client\\:\\:sendAsync\\(\\) should return GuzzleHttp\\\\PromiseInterface but returns GuzzleHttp\\\\Promise\\\\PromiseInterface\\.$#"
35
- count: 1
36
- path: src/Client.php
37
-
38
- -
39
- message: "#^Method GuzzleHttp\\\\Client\\:\\:send\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#"
40
- count: 1
41
- path: src/Client.php
42
-
43
- -
44
- message: "#^PHPDoc tag @throws with type GuzzleHttp\\\\GuzzleException is not subtype of Throwable$#"
45
- count: 2
46
- path: src/Client.php
47
-
48
- -
49
- message: "#^Call to method wait\\(\\) on an unknown class GuzzleHttp\\\\PromiseInterface\\.$#"
50
- count: 2
51
- path: src/Client.php
52
-
53
- -
54
- message: "#^Method GuzzleHttp\\\\Client\\:\\:requestAsync\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#"
55
- count: 1
56
- path: src/Client.php
57
-
58
- -
59
- message: "#^Return typehint of method GuzzleHttp\\\\Client\\:\\:requestAsync\\(\\) has invalid type GuzzleHttp\\\\PromiseInterface\\.$#"
60
- count: 1
61
- path: src/Client.php
62
-
63
- -
64
- message: "#^Method GuzzleHttp\\\\Client\\:\\:requestAsync\\(\\) should return GuzzleHttp\\\\PromiseInterface but returns GuzzleHttp\\\\Promise\\\\PromiseInterface\\.$#"
65
- count: 1
66
- path: src/Client.php
67
-
68
- -
69
- message: "#^Method GuzzleHttp\\\\Client\\:\\:request\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#"
70
- count: 1
71
- path: src/Client.php
72
-
73
- -
74
- message: "#^Method GuzzleHttp\\\\Client\\:\\:buildUri\\(\\) has parameter \\$config with no value type specified in iterable type array\\.$#"
75
- count: 1
76
- path: src/Client.php
77
-
78
- -
79
- message: "#^Method GuzzleHttp\\\\Client\\:\\:configureDefaults\\(\\) has parameter \\$config with no value type specified in iterable type array\\.$#"
80
- count: 1
81
- path: src/Client.php
82
-
83
- -
84
- message: "#^Parameter \\#1 \\$str of function strtolower expects string, int\\|string given\\.$#"
85
- count: 1
86
- path: src/Client.php
87
-
88
- -
89
- message: "#^Method GuzzleHttp\\\\Client\\:\\:prepareDefaults\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#"
90
- count: 1
91
- path: src/Client.php
92
-
93
- -
94
- message: "#^Method GuzzleHttp\\\\Client\\:\\:prepareDefaults\\(\\) return type has no value type specified in iterable type array\\.$#"
95
- count: 1
96
- path: src/Client.php
97
-
98
- -
99
- message: "#^Method GuzzleHttp\\\\Client\\:\\:transfer\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#"
100
- count: 1
101
- path: src/Client.php
102
-
103
- -
104
- message: "#^Method GuzzleHttp\\\\Client\\:\\:applyOptions\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#"
105
- count: 1
106
- path: src/Client.php
107
-
108
- -
109
- message: "#^Parameter \\#2 \\$prefix of function http_build_query expects string, null given\\.$#"
110
- count: 1
111
- path: src/Client.php
112
-
113
- -
114
- message: "#^Method GuzzleHttp\\\\ClientInterface\\:\\:send\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#"
115
- count: 1
116
- path: src/ClientInterface.php
117
-
118
- -
119
- message: "#^Method GuzzleHttp\\\\ClientInterface\\:\\:sendAsync\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#"
120
- count: 1
121
- path: src/ClientInterface.php
122
-
123
- -
124
- message: "#^Method GuzzleHttp\\\\ClientInterface\\:\\:request\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#"
125
- count: 1
126
- path: src/ClientInterface.php
127
-
128
- -
129
- message: "#^Method GuzzleHttp\\\\ClientInterface\\:\\:requestAsync\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#"
130
- count: 1
131
- path: src/ClientInterface.php
132
-
133
- -
134
- message: "#^Method GuzzleHttp\\\\Cookie\\\\CookieJar\\:\\:__construct\\(\\) has parameter \\$cookieArray with no value type specified in iterable type array\\.$#"
135
- count: 1
136
- path: src/Cookie/CookieJar.php
137
-
138
- -
139
- message: "#^Method GuzzleHttp\\\\Cookie\\\\CookieJar\\:\\:fromArray\\(\\) has parameter \\$cookies with no value type specified in iterable type array\\.$#"
140
- count: 1
141
- path: src/Cookie/CookieJar.php
142
-
143
- -
144
- message: "#^Method GuzzleHttp\\\\Cookie\\\\CookieJar\\:\\:fromArray\\(\\) return type has no value type specified in iterable type GuzzleHttp\\\\Cookie\\\\CookieJar\\.$#"
145
- count: 1
146
- path: src/Cookie/CookieJar.php
147
-
148
- -
149
- message: "#^Method GuzzleHttp\\\\Cookie\\\\CookieJar\\:\\:getCookieValue\\(\\) has no return typehint specified\\.$#"
150
- count: 1
151
- path: src/Cookie/CookieJar.php
152
-
153
- -
154
- message: "#^Method GuzzleHttp\\\\Cookie\\\\CookieJar\\:\\:getCookieValue\\(\\) has parameter \\$value with no typehint specified\\.$#"
155
- count: 1
156
- path: src/Cookie/CookieJar.php
157
-
158
- -
159
- message: "#^Result of \\|\\| is always false\\.$#"
160
- count: 1
161
- path: src/Cookie/CookieJar.php
162
-
163
- -
164
- message: "#^Strict comparison using \\=\\=\\= between string and null will always evaluate to false\\.$#"
165
- count: 2
166
- path: src/Cookie/CookieJar.php
167
-
168
- -
169
- message: "#^Method GuzzleHttp\\\\Cookie\\\\CookieJar\\:\\:toArray\\(\\) return type has no value type specified in iterable type array\\.$#"
170
- count: 1
171
- path: src/Cookie/CookieJar.php
172
-
173
- -
174
- message: "#^Call to an undefined method Traversable\\<mixed, mixed\\>\\:\\:getArrayCopy\\(\\)\\.$#"
175
- count: 1
176
- path: src/Cookie/CookieJar.php
177
-
178
- -
179
- message: "#^Method GuzzleHttp\\\\Cookie\\\\CookieJar\\:\\:clear\\(\\) return type has no value type specified in iterable type GuzzleHttp\\\\Cookie\\\\CookieJarInterface\\.$#"
180
- count: 1
181
- path: src/Cookie/CookieJar.php
182
-
183
- -
184
- message: "#^Method GuzzleHttp\\\\Cookie\\\\CookieJar\\:\\:clear\\(\\) should return GuzzleHttp\\\\Cookie\\\\CookieJarInterface but return statement is missing\\.$#"
185
- count: 1
186
- path: src/Cookie/CookieJar.php
187
-
188
- -
189
- message: "#^Method GuzzleHttp\\\\Cookie\\\\CookieJar\\:\\:clear\\(\\) should return GuzzleHttp\\\\Cookie\\\\CookieJarInterface but empty return statement found\\.$#"
190
- count: 1
191
- path: src/Cookie/CookieJar.php
192
-
193
- -
194
- message: "#^Method GuzzleHttp\\\\Cookie\\\\CookieJar\\:\\:clearSessionCookies\\(\\) has no return typehint specified\\.$#"
195
- count: 1
196
- path: src/Cookie/CookieJar.php
197
-
198
- -
199
- message: "#^Method GuzzleHttp\\\\Cookie\\\\CookieJar\\:\\:count\\(\\) has no return typehint specified\\.$#"
200
- count: 1
201
- path: src/Cookie/CookieJar.php
202
-
203
- -
204
- message: "#^Method GuzzleHttp\\\\Cookie\\\\CookieJar\\:\\:getIterator\\(\\) return type has no value type specified in iterable type Traversable\\<mixed, mixed\\>\\.$#"
205
- count: 1
206
- path: src/Cookie/CookieJar.php
207
-
208
- -
209
- message: "#^Method GuzzleHttp\\\\Cookie\\\\CookieJar\\:\\:extractCookies\\(\\) has no return typehint specified\\.$#"
210
- count: 1
211
- path: src/Cookie/CookieJar.php
212
-
213
- -
214
- message: "#^Parameter \\#3 \\$length of function substr expects int, int\\|false given\\.$#"
215
- count: 1
216
- path: src/Cookie/CookieJar.php
217
-
218
- -
219
- message: "#^Method GuzzleHttp\\\\Cookie\\\\CookieJar\\:\\:removeCookieIfEmpty\\(\\) has no return typehint specified\\.$#"
220
- count: 1
221
- path: src/Cookie/CookieJar.php
222
-
223
- -
224
- message: "#^Interface GuzzleHttp\\\\Cookie\\\\CookieJarInterface extends generic interface IteratorAggregate but does not specify its types\\: TKey, TValue$#"
225
- count: 1
226
- path: src/Cookie/CookieJarInterface.php
227
-
228
- -
229
- message: "#^Method GuzzleHttp\\\\Cookie\\\\CookieJarInterface\\:\\:extractCookies\\(\\) has no return typehint specified\\.$#"
230
- count: 1
231
- path: src/Cookie/CookieJarInterface.php
232
-
233
- -
234
- message: "#^Method GuzzleHttp\\\\Cookie\\\\CookieJarInterface\\:\\:clear\\(\\) return type has no value type specified in iterable type GuzzleHttp\\\\Cookie\\\\CookieJarInterface\\.$#"
235
- count: 1
236
- path: src/Cookie/CookieJarInterface.php
237
-
238
- -
239
- message: "#^Method GuzzleHttp\\\\Cookie\\\\CookieJarInterface\\:\\:clearSessionCookies\\(\\) has no return typehint specified\\.$#"
240
- count: 1
241
- path: src/Cookie/CookieJarInterface.php
242
-
243
- -
244
- message: "#^Method GuzzleHttp\\\\Cookie\\\\CookieJarInterface\\:\\:toArray\\(\\) return type has no value type specified in iterable type array\\.$#"
245
- count: 1
246
- path: src/Cookie/CookieJarInterface.php
247
-
248
- -
249
- message: "#^Method GuzzleHttp\\\\Cookie\\\\FileCookieJar\\:\\:save\\(\\) has no return typehint specified\\.$#"
250
- count: 1
251
- path: src/Cookie/FileCookieJar.php
252
-
253
- -
254
- message: "#^Method GuzzleHttp\\\\Cookie\\\\FileCookieJar\\:\\:load\\(\\) has no return typehint specified\\.$#"
255
- count: 1
256
- path: src/Cookie/FileCookieJar.php
257
-
258
- -
259
- message: "#^Method GuzzleHttp\\\\Cookie\\\\SessionCookieJar\\:\\:save\\(\\) has no return typehint specified\\.$#"
260
- count: 1
261
- path: src/Cookie/SessionCookieJar.php
262
-
263
- -
264
- message: "#^Method GuzzleHttp\\\\Cookie\\\\SessionCookieJar\\:\\:load\\(\\) has no return typehint specified\\.$#"
265
- count: 1
266
- path: src/Cookie/SessionCookieJar.php
267
-
268
- -
269
- message: "#^Property GuzzleHttp\\\\Cookie\\\\SetCookie\\:\\:\\$defaults type has no value type specified in iterable type array\\.$#"
270
- count: 1
271
- path: src/Cookie/SetCookie.php
272
-
273
- -
274
- message: "#^Property GuzzleHttp\\\\Cookie\\\\SetCookie\\:\\:\\$data type has no value type specified in iterable type array\\.$#"
275
- count: 1
276
- path: src/Cookie/SetCookie.php
277
-
278
- -
279
- message: "#^Method GuzzleHttp\\\\Cookie\\\\SetCookie\\:\\:__construct\\(\\) has parameter \\$data with no value type specified in iterable type array\\.$#"
280
- count: 1
281
- path: src/Cookie/SetCookie.php
282
-
283
- -
284
- message: "#^Property GuzzleHttp\\\\Cookie\\\\SetCookie\\:\\:\\$data \\(array\\) does not accept array\\|null\\.$#"
285
- count: 1
286
- path: src/Cookie/SetCookie.php
287
-
288
- -
289
- message: "#^Parameter \\#1 \\$timestamp of method GuzzleHttp\\\\Cookie\\\\SetCookie\\:\\:setExpires\\(\\) expects int, mixed given\\.$#"
290
- count: 1
291
- path: src/Cookie/SetCookie.php
292
-
293
- -
294
- message: "#^Method GuzzleHttp\\\\Cookie\\\\SetCookie\\:\\:toArray\\(\\) has no return typehint specified\\.$#"
295
- count: 1
296
- path: src/Cookie/SetCookie.php
297
-
298
- -
299
- message: "#^Method GuzzleHttp\\\\Cookie\\\\SetCookie\\:\\:setName\\(\\) has no return typehint specified\\.$#"
300
- count: 1
301
- path: src/Cookie/SetCookie.php
302
-
303
- -
304
- message: "#^Method GuzzleHttp\\\\Cookie\\\\SetCookie\\:\\:setValue\\(\\) has no return typehint specified\\.$#"
305
- count: 1
306
- path: src/Cookie/SetCookie.php
307
-
308
- -
309
- message: "#^Method GuzzleHttp\\\\Cookie\\\\SetCookie\\:\\:setDomain\\(\\) has no return typehint specified\\.$#"
310
- count: 1
311
- path: src/Cookie/SetCookie.php
312
-
313
- -
314
- message: "#^Method GuzzleHttp\\\\Cookie\\\\SetCookie\\:\\:setPath\\(\\) has no return typehint specified\\.$#"
315
- count: 1
316
- path: src/Cookie/SetCookie.php
317
-
318
- -
319
- message: "#^Method GuzzleHttp\\\\Cookie\\\\SetCookie\\:\\:setMaxAge\\(\\) has no return typehint specified\\.$#"
320
- count: 1
321
- path: src/Cookie/SetCookie.php
322
-
323
- -
324
- message: "#^Method GuzzleHttp\\\\Cookie\\\\SetCookie\\:\\:setExpires\\(\\) has no return typehint specified\\.$#"
325
- count: 1
326
- path: src/Cookie/SetCookie.php
327
-
328
- -
329
- message: "#^Else branch is unreachable because ternary operator condition is always true\\.$#"
330
- count: 1
331
- path: src/Cookie/SetCookie.php
332
-
333
- -
334
- message: "#^Method GuzzleHttp\\\\Cookie\\\\SetCookie\\:\\:setSecure\\(\\) has no return typehint specified\\.$#"
335
- count: 1
336
- path: src/Cookie/SetCookie.php
337
-
338
- -
339
- message: "#^Method GuzzleHttp\\\\Cookie\\\\SetCookie\\:\\:setDiscard\\(\\) has no return typehint specified\\.$#"
340
- count: 1
341
- path: src/Cookie/SetCookie.php
342
-
343
- -
344
- message: "#^Method GuzzleHttp\\\\Cookie\\\\SetCookie\\:\\:setHttpOnly\\(\\) has no return typehint specified\\.$#"
345
- count: 1
346
- path: src/Cookie/SetCookie.php
347
-
348
- -
349
- message: "#^Parameter \\#1 \\$str of function ltrim expects string, string\\|null given\\.$#"
350
- count: 1
351
- path: src/Cookie/SetCookie.php
352
-
353
- -
354
- message: "#^Method GuzzleHttp\\\\Exception\\\\BadResponseException\\:\\:__construct\\(\\) has parameter \\$handlerContext with no value type specified in iterable type array\\.$#"
355
- count: 1
356
- path: src/Exception/BadResponseException.php
357
-
358
- -
359
- message: "#^Method GuzzleHttp\\\\Exception\\\\BadResponseException\\:\\:__construct\\(\\) has parameter \\$message with no typehint specified\\.$#"
360
- count: 1
361
- path: src/Exception/BadResponseException.php
362
-
363
- -
364
- message: "#^Method GuzzleHttp\\\\Exception\\\\ConnectException\\:\\:__construct\\(\\) has parameter \\$handlerContext with no value type specified in iterable type array\\.$#"
365
- count: 1
366
- path: src/Exception/ConnectException.php
367
-
368
- -
369
- message: "#^Method GuzzleHttp\\\\Exception\\\\ConnectException\\:\\:__construct\\(\\) has parameter \\$message with no typehint specified\\.$#"
370
- count: 1
371
- path: src/Exception/ConnectException.php
372
-
373
- -
374
- message: "#^Property GuzzleHttp\\\\Exception\\\\RequestException\\:\\:\\$handlerContext type has no value type specified in iterable type array\\.$#"
375
- count: 1
376
- path: src/Exception/RequestException.php
377
-
378
- -
379
- message: "#^Method GuzzleHttp\\\\Exception\\\\RequestException\\:\\:__construct\\(\\) has parameter \\$handlerContext with no value type specified in iterable type array\\.$#"
380
- count: 1
381
- path: src/Exception/RequestException.php
382
-
383
- -
384
- message: "#^Method GuzzleHttp\\\\Exception\\\\RequestException\\:\\:__construct\\(\\) has parameter \\$message with no typehint specified\\.$#"
385
- count: 1
386
- path: src/Exception/RequestException.php
387
-
388
- -
389
- message: "#^Method GuzzleHttp\\\\Exception\\\\RequestException\\:\\:create\\(\\) has parameter \\$ctx with no value type specified in iterable type array\\.$#"
390
- count: 1
391
- path: src/Exception/RequestException.php
392
-
393
- -
394
- message: "#^Method GuzzleHttp\\\\Exception\\\\RequestException\\:\\:getHandlerContext\\(\\) return type has no value type specified in iterable type array\\.$#"
395
- count: 1
396
- path: src/Exception/RequestException.php
397
-
398
- -
399
- message: "#^Property GuzzleHttp\\\\Exception\\\\SeekException\\:\\:\\$stream has no typehint specified\\.$#"
400
- count: 1
401
- path: src/Exception/SeekException.php
402
-
403
- -
404
- message: "#^Method GuzzleHttp\\\\Exception\\\\SeekException\\:\\:__construct\\(\\) has parameter \\$msg with no typehint specified\\.$#"
405
- count: 1
406
- path: src/Exception/SeekException.php
407
-
408
- -
409
- message: "#^Method GuzzleHttp\\\\Exception\\\\SeekException\\:\\:__construct\\(\\) has parameter \\$pos with no typehint specified\\.$#"
410
- count: 1
411
- path: src/Exception/SeekException.php
412
-
413
- -
414
- message: "#^Property GuzzleHttp\\\\Handler\\\\CurlFactory\\:\\:\\$handles type has no value type specified in iterable type array\\.$#"
415
- count: 1
416
- path: src/Handler/CurlFactory.php
417
-
418
- -
419
- message: "#^Method GuzzleHttp\\\\Handler\\\\CurlFactory\\:\\:create\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#"
420
- count: 1
421
- path: src/Handler/CurlFactory.php
422
-
423
- -
424
- message: "#^Method GuzzleHttp\\\\Handler\\\\CurlFactory\\:\\:release\\(\\) has no return typehint specified\\.$#"
425
- count: 1
426
- path: src/Handler/CurlFactory.php
427
-
428
- -
429
- message: "#^Negated boolean expression is always false\\.$#"
430
- count: 1
431
- path: src/Handler/CurlFactory.php
432
-
433
- -
434
- message: "#^Method GuzzleHttp\\\\Handler\\\\CurlFactory\\:\\:invokeStats\\(\\) has no return typehint specified\\.$#"
435
- count: 1
436
- path: src/Handler/CurlFactory.php
437
-
438
- -
439
- message: "#^Method GuzzleHttp\\\\Handler\\\\CurlFactory\\:\\:finishError\\(\\) has no return typehint specified\\.$#"
440
- count: 1
441
- path: src/Handler/CurlFactory.php
442
-
443
- -
444
- message: "#^Method GuzzleHttp\\\\Handler\\\\CurlFactory\\:\\:createRejection\\(\\) has no return typehint specified\\.$#"
445
- count: 1
446
- path: src/Handler/CurlFactory.php
447
-
448
- -
449
- message: "#^Method GuzzleHttp\\\\Handler\\\\CurlFactory\\:\\:createRejection\\(\\) has parameter \\$ctx with no value type specified in iterable type array\\.$#"
450
- count: 1
451
- path: src/Handler/CurlFactory.php
452
-
453
- -
454
- message: "#^If condition is always true\\.$#"
455
- count: 1
456
- path: src/Handler/CurlFactory.php
457
-
458
- -
459
- message: "#^Unreachable statement \\- code above always terminates\\.$#"
460
- count: 1
461
- path: src/Handler/CurlFactory.php
462
-
463
- -
464
- message: "#^Method GuzzleHttp\\\\Handler\\\\CurlFactory\\:\\:getDefaultConf\\(\\) has no return typehint specified\\.$#"
465
- count: 1
466
- path: src/Handler/CurlFactory.php
467
-
468
- -
469
- message: "#^Method GuzzleHttp\\\\Handler\\\\CurlFactory\\:\\:applyMethod\\(\\) has no return typehint specified\\.$#"
470
- count: 1
471
- path: src/Handler/CurlFactory.php
472
-
473
- -
474
- message: "#^Method GuzzleHttp\\\\Handler\\\\CurlFactory\\:\\:applyMethod\\(\\) has parameter \\$conf with no value type specified in iterable type array\\.$#"
475
- count: 1
476
- path: src/Handler/CurlFactory.php
477
-
478
- -
479
- message: "#^Method GuzzleHttp\\\\Handler\\\\CurlFactory\\:\\:applyBody\\(\\) has no return typehint specified\\.$#"
480
- count: 1
481
- path: src/Handler/CurlFactory.php
482
-
483
- -
484
- message: "#^Method GuzzleHttp\\\\Handler\\\\CurlFactory\\:\\:applyBody\\(\\) has parameter \\$conf with no value type specified in iterable type array\\.$#"
485
- count: 1
486
- path: src/Handler/CurlFactory.php
487
-
488
- -
489
- message: "#^Method GuzzleHttp\\\\Handler\\\\CurlFactory\\:\\:applyBody\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#"
490
- count: 1
491
- path: src/Handler/CurlFactory.php
492
-
493
- -
494
- message: "#^Method GuzzleHttp\\\\Handler\\\\CurlFactory\\:\\:applyHeaders\\(\\) has no return typehint specified\\.$#"
495
- count: 1
496
- path: src/Handler/CurlFactory.php
497
-
498
- -
499
- message: "#^Method GuzzleHttp\\\\Handler\\\\CurlFactory\\:\\:applyHeaders\\(\\) has parameter \\$conf with no value type specified in iterable type array\\.$#"
500
- count: 1
501
- path: src/Handler/CurlFactory.php
502
-
503
- -
504
- message: "#^Method GuzzleHttp\\\\Handler\\\\CurlFactory\\:\\:removeHeader\\(\\) has no return typehint specified\\.$#"
505
- count: 1
506
- path: src/Handler/CurlFactory.php
507
-
508
- -
509
- message: "#^Method GuzzleHttp\\\\Handler\\\\CurlFactory\\:\\:removeHeader\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#"
510
- count: 1
511
- path: src/Handler/CurlFactory.php
512
-
513
- -
514
- message: "#^Parameter \\#1 \\$str1 of function strcasecmp expects string, int\\|string given\\.$#"
515
- count: 1
516
- path: src/Handler/CurlFactory.php
517
-
518
- -
519
- message: "#^Method GuzzleHttp\\\\Handler\\\\CurlFactory\\:\\:applyHandlerOptions\\(\\) has no return typehint specified\\.$#"
520
- count: 1
521
- path: src/Handler/CurlFactory.php
522
-
523
- -
524
- message: "#^Method GuzzleHttp\\\\Handler\\\\CurlFactory\\:\\:applyHandlerOptions\\(\\) has parameter \\$conf with no value type specified in iterable type array\\.$#"
525
- count: 1
526
- path: src/Handler/CurlFactory.php
527
-
528
- -
529
- message: "#^Method GuzzleHttp\\\\Handler\\\\CurlFactory\\:\\:retryFailedRewind\\(\\) has no return typehint specified\\.$#"
530
- count: 1
531
- path: src/Handler/CurlFactory.php
532
-
533
- -
534
- message: "#^Method GuzzleHttp\\\\Handler\\\\CurlFactory\\:\\:retryFailedRewind\\(\\) has parameter \\$ctx with no value type specified in iterable type array\\.$#"
535
- count: 1
536
- path: src/Handler/CurlFactory.php
537
-
538
- -
539
- message: "#^Method GuzzleHttp\\\\Handler\\\\CurlFactory\\:\\:createHeaderFn\\(\\) has no return typehint specified\\.$#"
540
- count: 1
541
- path: src/Handler/CurlFactory.php
542
-
543
- -
544
- message: "#^Method GuzzleHttp\\\\Handler\\\\CurlFactoryInterface\\:\\:create\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#"
545
- count: 1
546
- path: src/Handler/CurlFactoryInterface.php
547
-
548
- -
549
- message: "#^Method GuzzleHttp\\\\Handler\\\\CurlFactoryInterface\\:\\:release\\(\\) has no return typehint specified\\.$#"
550
- count: 1
551
- path: src/Handler/CurlFactoryInterface.php
552
-
553
- -
554
- message: "#^Method GuzzleHttp\\\\Handler\\\\CurlHandler\\:\\:__construct\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#"
555
- count: 1
556
- path: src/Handler/CurlHandler.php
557
-
558
- -
559
- message: "#^Method GuzzleHttp\\\\Handler\\\\CurlHandler\\:\\:__invoke\\(\\) has no return typehint specified\\.$#"
560
- count: 1
561
- path: src/Handler/CurlHandler.php
562
-
563
- -
564
- message: "#^Method GuzzleHttp\\\\Handler\\\\CurlHandler\\:\\:__invoke\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#"
565
- count: 1
566
- path: src/Handler/CurlHandler.php
567
-
568
- -
569
- message: "#^Property GuzzleHttp\\\\Handler\\\\CurlMultiHandler\\:\\:\\$selectTimeout has no typehint specified\\.$#"
570
- count: 1
571
- path: src/Handler/CurlMultiHandler.php
572
-
573
- -
574
- message: "#^Property GuzzleHttp\\\\Handler\\\\CurlMultiHandler\\:\\:\\$active has no typehint specified\\.$#"
575
- count: 1
576
- path: src/Handler/CurlMultiHandler.php
577
-
578
- -
579
- message: "#^Property GuzzleHttp\\\\Handler\\\\CurlMultiHandler\\:\\:\\$handles has no typehint specified\\.$#"
580
- count: 1
581
- path: src/Handler/CurlMultiHandler.php
582
-
583
- -
584
- message: "#^Property GuzzleHttp\\\\Handler\\\\CurlMultiHandler\\:\\:\\$delays has no typehint specified\\.$#"
585
- count: 1
586
- path: src/Handler/CurlMultiHandler.php
587
-
588
- -
589
- message: "#^Property GuzzleHttp\\\\Handler\\\\CurlMultiHandler\\:\\:\\$options has no typehint specified\\.$#"
590
- count: 1
591
- path: src/Handler/CurlMultiHandler.php
592
-
593
- -
594
- message: "#^Method GuzzleHttp\\\\Handler\\\\CurlMultiHandler\\:\\:__construct\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#"
595
- count: 1
596
- path: src/Handler/CurlMultiHandler.php
597
-
598
- -
599
- message: "#^Method GuzzleHttp\\\\Handler\\\\CurlMultiHandler\\:\\:__get\\(\\) has no return typehint specified\\.$#"
600
- count: 1
601
- path: src/Handler/CurlMultiHandler.php
602
-
603
- -
604
- message: "#^Method GuzzleHttp\\\\Handler\\\\CurlMultiHandler\\:\\:__get\\(\\) has parameter \\$name with no typehint specified\\.$#"
605
- count: 1
606
- path: src/Handler/CurlMultiHandler.php
607
-
608
- -
609
- message: "#^Property GuzzleHttp\\\\Handler\\\\CurlMultiHandler\\:\\:\\$_mh \\(resource\\) does not accept resource\\|false\\.$#"
610
- count: 1
611
- path: src/Handler/CurlMultiHandler.php
612
-
613
- -
614
- message: "#^Parameter \\#1 \\$mh of function curl_multi_setopt expects resource, resource\\|false given\\.$#"
615
- count: 1
616
- path: src/Handler/CurlMultiHandler.php
617
-
618
- -
619
- message: "#^Method GuzzleHttp\\\\Handler\\\\CurlMultiHandler\\:\\:__invoke\\(\\) has no return typehint specified\\.$#"
620
- count: 1
621
- path: src/Handler/CurlMultiHandler.php
622
-
623
- -
624
- message: "#^Method GuzzleHttp\\\\Handler\\\\CurlMultiHandler\\:\\:__invoke\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#"
625
- count: 1
626
- path: src/Handler/CurlMultiHandler.php
627
-
628
- -
629
- message: "#^Method GuzzleHttp\\\\Handler\\\\CurlMultiHandler\\:\\:tick\\(\\) has no return typehint specified\\.$#"
630
- count: 1
631
- path: src/Handler/CurlMultiHandler.php
632
-
633
- -
634
- message: "#^Method GuzzleHttp\\\\Handler\\\\CurlMultiHandler\\:\\:execute\\(\\) has no return typehint specified\\.$#"
635
- count: 1
636
- path: src/Handler/CurlMultiHandler.php
637
-
638
- -
639
- message: "#^Method GuzzleHttp\\\\Handler\\\\CurlMultiHandler\\:\\:addRequest\\(\\) has no return typehint specified\\.$#"
640
- count: 1
641
- path: src/Handler/CurlMultiHandler.php
642
-
643
- -
644
- message: "#^Method GuzzleHttp\\\\Handler\\\\CurlMultiHandler\\:\\:addRequest\\(\\) has parameter \\$entry with no value type specified in iterable type array\\.$#"
645
- count: 1
646
- path: src/Handler/CurlMultiHandler.php
647
-
648
- -
649
- message: "#^Method GuzzleHttp\\\\Handler\\\\CurlMultiHandler\\:\\:processMessages\\(\\) has no return typehint specified\\.$#"
650
- count: 1
651
- path: src/Handler/CurlMultiHandler.php
652
-
653
- -
654
- message: "#^Method GuzzleHttp\\\\Handler\\\\CurlMultiHandler\\:\\:timeToNext\\(\\) has no return typehint specified\\.$#"
655
- count: 1
656
- path: src/Handler/CurlMultiHandler.php
657
-
658
- -
659
- message: "#^Property GuzzleHttp\\\\Handler\\\\EasyHandle\\:\\:\\$headers type has no value type specified in iterable type array\\.$#"
660
- count: 1
661
- path: src/Handler/EasyHandle.php
662
-
663
- -
664
- message: "#^Property GuzzleHttp\\\\Handler\\\\EasyHandle\\:\\:\\$options type has no value type specified in iterable type array\\.$#"
665
- count: 1
666
- path: src/Handler/EasyHandle.php
667
-
668
- -
669
- message: "#^Method GuzzleHttp\\\\Handler\\\\EasyHandle\\:\\:createResponse\\(\\) has no return typehint specified\\.$#"
670
- count: 1
671
- path: src/Handler/EasyHandle.php
672
-
673
- -
674
- message: "#^Parameter \\#1 \\$status of class GuzzleHttp\\\\Psr7\\\\Response constructor expects int, string given\\.$#"
675
- count: 1
676
- path: src/Handler/EasyHandle.php
677
-
678
- -
679
- message: "#^Method GuzzleHttp\\\\Handler\\\\EasyHandle\\:\\:__get\\(\\) has no return typehint specified\\.$#"
680
- count: 1
681
- path: src/Handler/EasyHandle.php
682
-
683
- -
684
- message: "#^Method GuzzleHttp\\\\Handler\\\\EasyHandle\\:\\:__get\\(\\) has parameter \\$name with no typehint specified\\.$#"
685
- count: 1
686
- path: src/Handler/EasyHandle.php
687
-
688
- -
689
- message: "#^Property GuzzleHttp\\\\Handler\\\\MockHandler\\:\\:\\$queue has no typehint specified\\.$#"
690
- count: 1
691
- path: src/Handler/MockHandler.php
692
-
693
- -
694
- message: "#^Property GuzzleHttp\\\\Handler\\\\MockHandler\\:\\:\\$lastRequest has no typehint specified\\.$#"
695
- count: 1
696
- path: src/Handler/MockHandler.php
697
-
698
- -
699
- message: "#^Property GuzzleHttp\\\\Handler\\\\MockHandler\\:\\:\\$lastOptions has no typehint specified\\.$#"
700
- count: 1
701
- path: src/Handler/MockHandler.php
702
-
703
- -
704
- message: "#^Property GuzzleHttp\\\\Handler\\\\MockHandler\\:\\:\\$onFulfilled has no typehint specified\\.$#"
705
- count: 1
706
- path: src/Handler/MockHandler.php
707
-
708
- -
709
- message: "#^Property GuzzleHttp\\\\Handler\\\\MockHandler\\:\\:\\$onRejected has no typehint specified\\.$#"
710
- count: 1
711
- path: src/Handler/MockHandler.php
712
-
713
- -
714
- message: "#^Method GuzzleHttp\\\\Handler\\\\MockHandler\\:\\:createWithMiddleware\\(\\) has parameter \\$queue with no value type specified in iterable type array\\.$#"
715
- count: 1
716
- path: src/Handler/MockHandler.php
717
-
718
- -
719
- message: "#^Method GuzzleHttp\\\\Handler\\\\MockHandler\\:\\:__construct\\(\\) has parameter \\$queue with no value type specified in iterable type array\\.$#"
720
- count: 1
721
- path: src/Handler/MockHandler.php
722
-
723
- -
724
- message: "#^Parameter \\#2 \\$parameters of function call_user_func_array expects array\\<int, mixed\\>, array given\\.$#"
725
- count: 1
726
- path: src/Handler/MockHandler.php
727
-
728
- -
729
- message: "#^Method GuzzleHttp\\\\Handler\\\\MockHandler\\:\\:__invoke\\(\\) has no return typehint specified\\.$#"
730
- count: 1
731
- path: src/Handler/MockHandler.php
732
-
733
- -
734
- message: "#^Method GuzzleHttp\\\\Handler\\\\MockHandler\\:\\:__invoke\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#"
735
- count: 1
736
- path: src/Handler/MockHandler.php
737
-
738
- -
739
- message: "#^Binary operation \"\\*\" between float\\|int\\|string and 1000 results in an error\\.$#"
740
- count: 1
741
- path: src/Handler/MockHandler.php
742
-
743
- -
744
- message: "#^Method GuzzleHttp\\\\Handler\\\\MockHandler\\:\\:append\\(\\) has no return typehint specified\\.$#"
745
- count: 1
746
- path: src/Handler/MockHandler.php
747
-
748
- -
749
- message: "#^Method GuzzleHttp\\\\Handler\\\\MockHandler\\:\\:getLastOptions\\(\\) return type has no value type specified in iterable type array\\.$#"
750
- count: 1
751
- path: src/Handler/MockHandler.php
752
-
753
- -
754
- message: "#^Method GuzzleHttp\\\\Handler\\\\MockHandler\\:\\:reset\\(\\) has no return typehint specified\\.$#"
755
- count: 1
756
- path: src/Handler/MockHandler.php
757
-
758
- -
759
- message: "#^Method GuzzleHttp\\\\Handler\\\\MockHandler\\:\\:invokeStats\\(\\) has no return typehint specified\\.$#"
760
- count: 1
761
- path: src/Handler/MockHandler.php
762
-
763
- -
764
- message: "#^Method GuzzleHttp\\\\Handler\\\\MockHandler\\:\\:invokeStats\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#"
765
- count: 1
766
- path: src/Handler/MockHandler.php
767
-
768
- -
769
- message: "#^Method GuzzleHttp\\\\Handler\\\\MockHandler\\:\\:invokeStats\\(\\) has parameter \\$reason with no typehint specified\\.$#"
770
- count: 1
771
- path: src/Handler/MockHandler.php
772
-
773
- -
774
- message: "#^Property GuzzleHttp\\\\Handler\\\\StreamHandler\\:\\:\\$lastHeaders has no typehint specified\\.$#"
775
- count: 1
776
- path: src/Handler/StreamHandler.php
777
-
778
- -
779
- message: "#^Method GuzzleHttp\\\\Handler\\\\StreamHandler\\:\\:__invoke\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#"
780
- count: 1
781
- path: src/Handler/StreamHandler.php
782
-
783
- -
784
- message: "#^Method GuzzleHttp\\\\Handler\\\\StreamHandler\\:\\:invokeStats\\(\\) has no return typehint specified\\.$#"
785
- count: 1
786
- path: src/Handler/StreamHandler.php
787
-
788
- -
789
- message: "#^Method GuzzleHttp\\\\Handler\\\\StreamHandler\\:\\:invokeStats\\(\\) has parameter \\$error with no typehint specified\\.$#"
790
- count: 1
791
- path: src/Handler/StreamHandler.php
792
-
793
- -
794
- message: "#^Method GuzzleHttp\\\\Handler\\\\StreamHandler\\:\\:invokeStats\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#"
795
- count: 1
796
- path: src/Handler/StreamHandler.php
797
-
798
- -
799
- message: "#^Method GuzzleHttp\\\\Handler\\\\StreamHandler\\:\\:invokeStats\\(\\) has parameter \\$startTime with no typehint specified\\.$#"
800
- count: 1
801
- path: src/Handler/StreamHandler.php
802
-
803
- -
804
- message: "#^Method GuzzleHttp\\\\Handler\\\\StreamHandler\\:\\:createResponse\\(\\) has no return typehint specified\\.$#"
805
- count: 1
806
- path: src/Handler/StreamHandler.php
807
-
808
- -
809
- message: "#^Method GuzzleHttp\\\\Handler\\\\StreamHandler\\:\\:createResponse\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#"
810
- count: 1
811
- path: src/Handler/StreamHandler.php
812
-
813
- -
814
- message: "#^Method GuzzleHttp\\\\Handler\\\\StreamHandler\\:\\:createResponse\\(\\) has parameter \\$startTime with no typehint specified\\.$#"
815
- count: 1
816
- path: src/Handler/StreamHandler.php
817
-
818
- -
819
- message: "#^Method GuzzleHttp\\\\Handler\\\\StreamHandler\\:\\:createResponse\\(\\) has parameter \\$stream with no typehint specified\\.$#"
820
- count: 1
821
- path: src/Handler/StreamHandler.php
822
-
823
- -
824
- message: "#^Parameter \\#1 \\$status of class GuzzleHttp\\\\Psr7\\\\Response constructor expects int, string given\\.$#"
825
- count: 1
826
- path: src/Handler/StreamHandler.php
827
-
828
- -
829
- message: "#^Method GuzzleHttp\\\\Handler\\\\StreamHandler\\:\\:createSink\\(\\) has no return typehint specified\\.$#"
830
- count: 1
831
- path: src/Handler/StreamHandler.php
832
-
833
- -
834
- message: "#^Method GuzzleHttp\\\\Handler\\\\StreamHandler\\:\\:createSink\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#"
835
- count: 1
836
- path: src/Handler/StreamHandler.php
837
-
838
- -
839
- message: "#^Method GuzzleHttp\\\\Handler\\\\StreamHandler\\:\\:checkDecode\\(\\) has no return typehint specified\\.$#"
840
- count: 1
841
- path: src/Handler/StreamHandler.php
842
-
843
- -
844
- message: "#^Method GuzzleHttp\\\\Handler\\\\StreamHandler\\:\\:checkDecode\\(\\) has parameter \\$headers with no value type specified in iterable type array\\.$#"
845
- count: 1
846
- path: src/Handler/StreamHandler.php
847
-
848
- -
849
- message: "#^Method GuzzleHttp\\\\Handler\\\\StreamHandler\\:\\:checkDecode\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#"
850
- count: 1
851
- path: src/Handler/StreamHandler.php
852
-
853
- -
854
- message: "#^Method GuzzleHttp\\\\Handler\\\\StreamHandler\\:\\:checkDecode\\(\\) has parameter \\$stream with no typehint specified\\.$#"
855
- count: 1
856
- path: src/Handler/StreamHandler.php
857
-
858
- -
859
- message: "#^Argument of an invalid type array\\<int, array\\<string, int\\|string\\>\\>\\|null supplied for foreach, only iterables are supported\\.$#"
860
- count: 1
861
- path: src/Handler/StreamHandler.php
862
-
863
- -
864
- message: "#^Method GuzzleHttp\\\\Handler\\\\StreamHandler\\:\\:createStream\\(\\) has no return typehint specified\\.$#"
865
- count: 1
866
- path: src/Handler/StreamHandler.php
867
-
868
- -
869
- message: "#^Method GuzzleHttp\\\\Handler\\\\StreamHandler\\:\\:createStream\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#"
870
- count: 1
871
- path: src/Handler/StreamHandler.php
872
-
873
- -
874
- message: "#^Parameter \\#3 \\$use_include_path of function fopen expects bool, null given\\.$#"
875
- count: 1
876
- path: src/Handler/StreamHandler.php
877
-
878
- -
879
- message: "#^Parameter \\#1 \\$stream of function stream_set_timeout expects resource, resource\\|false given\\.$#"
880
- count: 1
881
- path: src/Handler/StreamHandler.php
882
-
883
- -
884
- message: "#^Method GuzzleHttp\\\\Handler\\\\StreamHandler\\:\\:resolveHost\\(\\) has no return typehint specified\\.$#"
885
- count: 1
886
- path: src/Handler/StreamHandler.php
887
-
888
- -
889
- message: "#^Method GuzzleHttp\\\\Handler\\\\StreamHandler\\:\\:resolveHost\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#"
890
- count: 1
891
- path: src/Handler/StreamHandler.php
892
-
893
- -
894
- message: "#^Cannot access offset 0 on array\\|false\\.$#"
895
- count: 2
896
- path: src/Handler/StreamHandler.php
897
-
898
- -
899
- message: "#^Method GuzzleHttp\\\\Handler\\\\StreamHandler\\:\\:getDefaultContext\\(\\) has no return typehint specified\\.$#"
900
- count: 1
901
- path: src/Handler/StreamHandler.php
902
-
903
- -
904
- message: "#^Method GuzzleHttp\\\\Handler\\\\StreamHandler\\:\\:add_proxy\\(\\) has no return typehint specified\\.$#"
905
- count: 1
906
- path: src/Handler/StreamHandler.php
907
-
908
- -
909
- message: "#^Method GuzzleHttp\\\\Handler\\\\StreamHandler\\:\\:add_proxy\\(\\) has parameter \\$options with no typehint specified\\.$#"
910
- count: 1
911
- path: src/Handler/StreamHandler.php
912
-
913
- -
914
- message: "#^Method GuzzleHttp\\\\Handler\\\\StreamHandler\\:\\:add_proxy\\(\\) has parameter \\$params with no typehint specified\\.$#"
915
- count: 1
916
- path: src/Handler/StreamHandler.php
917
-
918
- -
919
- message: "#^Method GuzzleHttp\\\\Handler\\\\StreamHandler\\:\\:add_proxy\\(\\) has parameter \\$value with no typehint specified\\.$#"
920
- count: 1
921
- path: src/Handler/StreamHandler.php
922
-
923
- -
924
- message: "#^Method GuzzleHttp\\\\Handler\\\\StreamHandler\\:\\:add_timeout\\(\\) has no return typehint specified\\.$#"
925
- count: 1
926
- path: src/Handler/StreamHandler.php
927
-
928
- -
929
- message: "#^Method GuzzleHttp\\\\Handler\\\\StreamHandler\\:\\:add_timeout\\(\\) has parameter \\$options with no typehint specified\\.$#"
930
- count: 1
931
- path: src/Handler/StreamHandler.php
932
-
933
- -
934
- message: "#^Method GuzzleHttp\\\\Handler\\\\StreamHandler\\:\\:add_timeout\\(\\) has parameter \\$params with no typehint specified\\.$#"
935
- count: 1
936
- path: src/Handler/StreamHandler.php
937
-
938
- -
939
- message: "#^Method GuzzleHttp\\\\Handler\\\\StreamHandler\\:\\:add_timeout\\(\\) has parameter \\$value with no typehint specified\\.$#"
940
- count: 1
941
- path: src/Handler/StreamHandler.php
942
-
943
- -
944
- message: "#^Method GuzzleHttp\\\\Handler\\\\StreamHandler\\:\\:add_verify\\(\\) has no return typehint specified\\.$#"
945
- count: 1
946
- path: src/Handler/StreamHandler.php
947
-
948
- -
949
- message: "#^Method GuzzleHttp\\\\Handler\\\\StreamHandler\\:\\:add_verify\\(\\) has parameter \\$options with no typehint specified\\.$#"
950
- count: 1
951
- path: src/Handler/StreamHandler.php
952
-
953
- -
954
- message: "#^Method GuzzleHttp\\\\Handler\\\\StreamHandler\\:\\:add_verify\\(\\) has parameter \\$params with no typehint specified\\.$#"
955
- count: 1
956
- path: src/Handler/StreamHandler.php
957
-
958
- -
959
- message: "#^Method GuzzleHttp\\\\Handler\\\\StreamHandler\\:\\:add_verify\\(\\) has parameter \\$value with no typehint specified\\.$#"
960
- count: 1
961
- path: src/Handler/StreamHandler.php
962
-
963
- -
964
- message: "#^Method GuzzleHttp\\\\Handler\\\\StreamHandler\\:\\:add_cert\\(\\) has no return typehint specified\\.$#"
965
- count: 1
966
- path: src/Handler/StreamHandler.php
967
-
968
- -
969
- message: "#^Method GuzzleHttp\\\\Handler\\\\StreamHandler\\:\\:add_cert\\(\\) has parameter \\$options with no typehint specified\\.$#"
970
- count: 1
971
- path: src/Handler/StreamHandler.php
972
-
973
- -
974
- message: "#^Method GuzzleHttp\\\\Handler\\\\StreamHandler\\:\\:add_cert\\(\\) has parameter \\$params with no typehint specified\\.$#"
975
- count: 1
976
- path: src/Handler/StreamHandler.php
977
-
978
- -
979
- message: "#^Method GuzzleHttp\\\\Handler\\\\StreamHandler\\:\\:add_cert\\(\\) has parameter \\$value with no typehint specified\\.$#"
980
- count: 1
981
- path: src/Handler/StreamHandler.php
982
-
983
- -
984
- message: "#^Method GuzzleHttp\\\\Handler\\\\StreamHandler\\:\\:add_progress\\(\\) has no return typehint specified\\.$#"
985
- count: 1
986
- path: src/Handler/StreamHandler.php
987
-
988
- -
989
- message: "#^Method GuzzleHttp\\\\Handler\\\\StreamHandler\\:\\:add_progress\\(\\) has parameter \\$options with no typehint specified\\.$#"
990
- count: 1
991
- path: src/Handler/StreamHandler.php
992
-
993
- -
994
- message: "#^Method GuzzleHttp\\\\Handler\\\\StreamHandler\\:\\:add_progress\\(\\) has parameter \\$params with no typehint specified\\.$#"
995
- count: 1
996
- path: src/Handler/StreamHandler.php
997
-
998
- -
999
- message: "#^Method GuzzleHttp\\\\Handler\\\\StreamHandler\\:\\:add_progress\\(\\) has parameter \\$value with no typehint specified\\.$#"
1000
- count: 1
1001
- path: src/Handler/StreamHandler.php
1002
-
1003
- -
1004
- message: "#^Method GuzzleHttp\\\\Handler\\\\StreamHandler\\:\\:add_debug\\(\\) has no return typehint specified\\.$#"
1005
- count: 1
1006
- path: src/Handler/StreamHandler.php
1007
-
1008
- -
1009
- message: "#^Method GuzzleHttp\\\\Handler\\\\StreamHandler\\:\\:add_debug\\(\\) has parameter \\$options with no typehint specified\\.$#"
1010
- count: 1
1011
- path: src/Handler/StreamHandler.php
1012
-
1013
- -
1014
- message: "#^Method GuzzleHttp\\\\Handler\\\\StreamHandler\\:\\:add_debug\\(\\) has parameter \\$params with no typehint specified\\.$#"
1015
- count: 1
1016
- path: src/Handler/StreamHandler.php
1017
-
1018
- -
1019
- message: "#^Method GuzzleHttp\\\\Handler\\\\StreamHandler\\:\\:add_debug\\(\\) has parameter \\$value with no typehint specified\\.$#"
1020
- count: 1
1021
- path: src/Handler/StreamHandler.php
1022
-
1023
- -
1024
- message: "#^Method GuzzleHttp\\\\Handler\\\\StreamHandler\\:\\:addNotification\\(\\) has no return typehint specified\\.$#"
1025
- count: 1
1026
- path: src/Handler/StreamHandler.php
1027
-
1028
- -
1029
- message: "#^Method GuzzleHttp\\\\Handler\\\\StreamHandler\\:\\:addNotification\\(\\) has parameter \\$params with no value type specified in iterable type array\\.$#"
1030
- count: 1
1031
- path: src/Handler/StreamHandler.php
1032
-
1033
- -
1034
- message: "#^Method GuzzleHttp\\\\Handler\\\\StreamHandler\\:\\:callArray\\(\\) has no return typehint specified\\.$#"
1035
- count: 1
1036
- path: src/Handler/StreamHandler.php
1037
-
1038
- -
1039
- message: "#^Method GuzzleHttp\\\\Handler\\\\StreamHandler\\:\\:callArray\\(\\) has parameter \\$functions with no value type specified in iterable type array\\.$#"
1040
- count: 1
1041
- path: src/Handler/StreamHandler.php
1042
-
1043
- -
1044
- message: "#^Property GuzzleHttp\\\\HandlerStack\\:\\:\\$stack type has no value type specified in iterable type array\\.$#"
1045
- count: 1
1046
- path: src/HandlerStack.php
1047
-
1048
- -
1049
- message: "#^Method GuzzleHttp\\\\HandlerStack\\:\\:__invoke\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#"
1050
- count: 1
1051
- path: src/HandlerStack.php
1052
-
1053
- -
1054
- message: "#^Method GuzzleHttp\\\\HandlerStack\\:\\:setHandler\\(\\) has no return typehint specified\\.$#"
1055
- count: 1
1056
- path: src/HandlerStack.php
1057
-
1058
- -
1059
- message: "#^Method GuzzleHttp\\\\HandlerStack\\:\\:unshift\\(\\) has no return typehint specified\\.$#"
1060
- count: 1
1061
- path: src/HandlerStack.php
1062
-
1063
- -
1064
- message: "#^Method GuzzleHttp\\\\HandlerStack\\:\\:push\\(\\) has no return typehint specified\\.$#"
1065
- count: 1
1066
- path: src/HandlerStack.php
1067
-
1068
- -
1069
- message: "#^Method GuzzleHttp\\\\HandlerStack\\:\\:before\\(\\) has no return typehint specified\\.$#"
1070
- count: 1
1071
- path: src/HandlerStack.php
1072
-
1073
- -
1074
- message: "#^Method GuzzleHttp\\\\HandlerStack\\:\\:after\\(\\) has no return typehint specified\\.$#"
1075
- count: 1
1076
- path: src/HandlerStack.php
1077
-
1078
- -
1079
- message: "#^Method GuzzleHttp\\\\HandlerStack\\:\\:remove\\(\\) has no return typehint specified\\.$#"
1080
- count: 1
1081
- path: src/HandlerStack.php
1082
-
1083
- -
1084
- message: "#^Method GuzzleHttp\\\\HandlerStack\\:\\:splice\\(\\) has no return typehint specified\\.$#"
1085
- count: 1
1086
- path: src/HandlerStack.php
1087
-
1088
- -
1089
- message: "#^Method GuzzleHttp\\\\HandlerStack\\:\\:debugCallable\\(\\) has parameter \\$fn with no value type specified in iterable type array\\.$#"
1090
- count: 1
1091
- path: src/HandlerStack.php
1092
-
1093
- -
1094
- message: "#^Parameter \\#1 \\$obj of function spl_object_hash expects object, callable given\\.$#"
1095
- count: 1
1096
- path: src/HandlerStack.php
1097
-
1098
- -
1099
- message: "#^Method GuzzleHttp\\\\MessageFormatter\\:\\:format\\(\\) should return string but returns string\\|null\\.$#"
1100
- count: 1
1101
- path: src/MessageFormatter.php
1102
-
1103
- -
1104
- message: "#^Method GuzzleHttp\\\\Middleware\\:\\:history\\(\\) has parameter \\$container with generic interface ArrayAccess but does not specify its types\\: TKey, TValue$#"
1105
- count: 1
1106
- path: src/Middleware.php
1107
-
1108
- -
1109
- message: "#^Method GuzzleHttp\\\\Middleware\\:\\:history\\(\\) has parameter \\$container with no value type specified in iterable type array\\.$#"
1110
- count: 1
1111
- path: src/Middleware.php
1112
-
1113
- -
1114
- message: "#^Result of && is always false\\.$#"
1115
- count: 1
1116
- path: src/Middleware.php
1117
-
1118
- -
1119
- message: "#^Method GuzzleHttp\\\\Pool\\:\\:__construct\\(\\) has parameter \\$config with no value type specified in iterable type array\\.$#"
1120
- count: 1
1121
- path: src/Pool.php
1122
-
1123
- -
1124
- message: "#^Method GuzzleHttp\\\\Pool\\:\\:__construct\\(\\) has parameter \\$requests with no value type specified in iterable type array\\|Iterator\\.$#"
1125
- count: 1
1126
- path: src/Pool.php
1127
-
1128
- -
1129
- message: "#^Return typehint of method GuzzleHttp\\\\Pool\\:\\:promise\\(\\) has invalid type GuzzleHttp\\\\GuzzleHttp\\\\Promise\\\\Promise\\.$#"
1130
- count: 1
1131
- path: src/Pool.php
1132
-
1133
- -
1134
- message: "#^Method GuzzleHttp\\\\Pool\\:\\:promise\\(\\) should return GuzzleHttp\\\\GuzzleHttp\\\\Promise\\\\Promise but returns GuzzleHttp\\\\Promise\\\\PromiseInterface\\.$#"
1135
- count: 1
1136
- path: src/Pool.php
1137
-
1138
- -
1139
- message: "#^Method GuzzleHttp\\\\Pool\\:\\:batch\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#"
1140
- count: 1
1141
- path: src/Pool.php
1142
-
1143
- -
1144
- message: "#^Method GuzzleHttp\\\\Pool\\:\\:batch\\(\\) has parameter \\$requests with no value type specified in iterable type array\\|Iterator\\.$#"
1145
- count: 1
1146
- path: src/Pool.php
1147
-
1148
- -
1149
- message: "#^Method GuzzleHttp\\\\Pool\\:\\:batch\\(\\) return type has no value type specified in iterable type array\\.$#"
1150
- count: 1
1151
- path: src/Pool.php
1152
-
1153
- -
1154
- message: "#^Unsafe usage of new static\\(\\)\\.$#"
1155
- count: 1
1156
- path: src/Pool.php
1157
-
1158
- -
1159
- message: "#^Call to method wait\\(\\) on an unknown class GuzzleHttp\\\\GuzzleHttp\\\\Promise\\\\Promise\\.$#"
1160
- count: 1
1161
- path: src/Pool.php
1162
-
1163
- -
1164
- message: "#^Method GuzzleHttp\\\\Pool\\:\\:cmpCallback\\(\\) has parameter \\$name with no typehint specified\\.$#"
1165
- count: 1
1166
- path: src/Pool.php
1167
-
1168
- -
1169
- message: "#^Method GuzzleHttp\\\\Pool\\:\\:cmpCallback\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#"
1170
- count: 1
1171
- path: src/Pool.php
1172
-
1173
- -
1174
- message: "#^Method GuzzleHttp\\\\Pool\\:\\:cmpCallback\\(\\) has parameter \\$results with no value type specified in iterable type array\\.$#"
1175
- count: 1
1176
- path: src/Pool.php
1177
-
1178
- -
1179
- message: "#^Method GuzzleHttp\\\\PrepareBodyMiddleware\\:\\:__invoke\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#"
1180
- count: 1
1181
- path: src/PrepareBodyMiddleware.php
1182
-
1183
- -
1184
- message: "#^Method GuzzleHttp\\\\PrepareBodyMiddleware\\:\\:addExpectHeader\\(\\) has parameter \\$modify with no value type specified in iterable type array\\.$#"
1185
- count: 1
1186
- path: src/PrepareBodyMiddleware.php
1187
-
1188
- -
1189
- message: "#^Method GuzzleHttp\\\\PrepareBodyMiddleware\\:\\:addExpectHeader\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#"
1190
- count: 1
1191
- path: src/PrepareBodyMiddleware.php
1192
-
1193
- -
1194
- message: "#^Property GuzzleHttp\\\\RedirectMiddleware\\:\\:\\$defaultSettings has no typehint specified\\.$#"
1195
- count: 1
1196
- path: src/RedirectMiddleware.php
1197
-
1198
- -
1199
- message: "#^Method GuzzleHttp\\\\RedirectMiddleware\\:\\:__invoke\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#"
1200
- count: 1
1201
- path: src/RedirectMiddleware.php
1202
-
1203
- -
1204
- message: "#^Method GuzzleHttp\\\\RedirectMiddleware\\:\\:checkRedirect\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#"
1205
- count: 1
1206
- path: src/RedirectMiddleware.php
1207
-
1208
- -
1209
- message: "#^Parameter \\#1 \\$str of function substr expects string, int given\\.$#"
1210
- count: 1
1211
- path: src/RedirectMiddleware.php
1212
-
1213
- -
1214
- message: "#^Parameter \\#1 \\$promise of method GuzzleHttp\\\\RedirectMiddleware\\:\\:withTracking\\(\\) expects GuzzleHttp\\\\Promise\\\\PromiseInterface, GuzzleHttp\\\\Promise\\\\PromiseInterface\\|Psr\\\\Http\\\\Message\\\\ResponseInterface given\\.$#"
1215
- count: 1
1216
- path: src/RedirectMiddleware.php
1217
-
1218
- -
1219
- message: "#^Method GuzzleHttp\\\\RedirectMiddleware\\:\\:withTracking\\(\\) has parameter \\$statusCode with no typehint specified\\.$#"
1220
- count: 1
1221
- path: src/RedirectMiddleware.php
1222
-
1223
- -
1224
- message: "#^Method GuzzleHttp\\\\RedirectMiddleware\\:\\:withTracking\\(\\) has parameter \\$uri with no typehint specified\\.$#"
1225
- count: 1
1226
- path: src/RedirectMiddleware.php
1227
-
1228
- -
1229
- message: "#^Parameter \\#2 \\$value of method Psr\\\\Http\\\\Message\\\\MessageInterface\\:\\:withHeader\\(\\) expects array\\<string\\>\\|string, array given\\.$#"
1230
- count: 2
1231
- path: src/RedirectMiddleware.php
1232
-
1233
- -
1234
- message: "#^Method GuzzleHttp\\\\RedirectMiddleware\\:\\:guardMax\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#"
1235
- count: 1
1236
- path: src/RedirectMiddleware.php
1237
-
1238
- -
1239
- message: "#^Method GuzzleHttp\\\\RedirectMiddleware\\:\\:modifyRequest\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#"
1240
- count: 1
1241
- path: src/RedirectMiddleware.php
1242
-
1243
- -
1244
- message: "#^Method GuzzleHttp\\\\RedirectMiddleware\\:\\:redirectUri\\(\\) has parameter \\$protocols with no value type specified in iterable type array\\.$#"
1245
- count: 1
1246
- path: src/RedirectMiddleware.php
1247
-
1248
- -
1249
- message: "#^Method GuzzleHttp\\\\RetryMiddleware\\:\\:__invoke\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#"
1250
- count: 1
1251
- path: src/RetryMiddleware.php
1252
-
1253
- -
1254
- message: "#^Method GuzzleHttp\\\\RetryMiddleware\\:\\:onFulfilled\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#"
1255
- count: 1
1256
- path: src/RetryMiddleware.php
1257
-
1258
- -
1259
- message: "#^Method GuzzleHttp\\\\RetryMiddleware\\:\\:onRejected\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#"
1260
- count: 1
1261
- path: src/RetryMiddleware.php
1262
-
1263
- -
1264
- message: "#^Method GuzzleHttp\\\\RetryMiddleware\\:\\:doRetry\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#"
1265
- count: 1
1266
- path: src/RetryMiddleware.php
1267
-
1268
- -
1269
- message: "#^Method GuzzleHttp\\\\RetryMiddleware\\:\\:doRetry\\(\\) should return GuzzleHttp\\\\RetryMiddleware but returns GuzzleHttp\\\\Promise\\\\PromiseInterface\\.$#"
1270
- count: 1
1271
- path: src/RetryMiddleware.php
1272
-
1273
- -
1274
- message: "#^Property GuzzleHttp\\\\TransferStats\\:\\:\\$request has no typehint specified\\.$#"
1275
- count: 1
1276
- path: src/TransferStats.php
1277
-
1278
- -
1279
- message: "#^Property GuzzleHttp\\\\TransferStats\\:\\:\\$response has no typehint specified\\.$#"
1280
- count: 1
1281
- path: src/TransferStats.php
1282
-
1283
- -
1284
- message: "#^Property GuzzleHttp\\\\TransferStats\\:\\:\\$transferTime has no typehint specified\\.$#"
1285
- count: 1
1286
- path: src/TransferStats.php
1287
-
1288
- -
1289
- message: "#^Property GuzzleHttp\\\\TransferStats\\:\\:\\$handlerStats has no typehint specified\\.$#"
1290
- count: 1
1291
- path: src/TransferStats.php
1292
-
1293
- -
1294
- message: "#^Property GuzzleHttp\\\\TransferStats\\:\\:\\$handlerErrorData has no typehint specified\\.$#"
1295
- count: 1
1296
- path: src/TransferStats.php
1297
-
1298
- -
1299
- message: "#^Method GuzzleHttp\\\\TransferStats\\:\\:__construct\\(\\) has parameter \\$handlerStats with no value type specified in iterable type array\\.$#"
1300
- count: 1
1301
- path: src/TransferStats.php
1302
-
1303
- -
1304
- message: "#^Method GuzzleHttp\\\\TransferStats\\:\\:getHandlerStats\\(\\) return type has no value type specified in iterable type array\\.$#"
1305
- count: 1
1306
- path: src/TransferStats.php
1307
-
1308
- -
1309
- message: "#^Property GuzzleHttp\\\\UriTemplate\\:\\:\\$variables type has no value type specified in iterable type array\\.$#"
1310
- count: 1
1311
- path: src/UriTemplate.php
1312
-
1313
- -
1314
- message: "#^Property GuzzleHttp\\\\UriTemplate\\:\\:\\$operatorHash type has no value type specified in iterable type array\\.$#"
1315
- count: 1
1316
- path: src/UriTemplate.php
1317
-
1318
- -
1319
- message: "#^Property GuzzleHttp\\\\UriTemplate\\:\\:\\$delims type has no value type specified in iterable type array\\.$#"
1320
- count: 1
1321
- path: src/UriTemplate.php
1322
-
1323
- -
1324
- message: "#^Property GuzzleHttp\\\\UriTemplate\\:\\:\\$delimsPct type has no value type specified in iterable type array\\.$#"
1325
- count: 1
1326
- path: src/UriTemplate.php
1327
-
1328
- -
1329
- message: "#^Method GuzzleHttp\\\\UriTemplate\\:\\:expand\\(\\) has no return typehint specified\\.$#"
1330
- count: 1
1331
- path: src/UriTemplate.php
1332
-
1333
- -
1334
- message: "#^Method GuzzleHttp\\\\UriTemplate\\:\\:expand\\(\\) has parameter \\$template with no typehint specified\\.$#"
1335
- count: 1
1336
- path: src/UriTemplate.php
1337
-
1338
- -
1339
- message: "#^Method GuzzleHttp\\\\UriTemplate\\:\\:expand\\(\\) has parameter \\$variables with no value type specified in iterable type array\\.$#"
1340
- count: 1
1341
- path: src/UriTemplate.php
1342
-
1343
- -
1344
- message: "#^Method GuzzleHttp\\\\UriTemplate\\:\\:parseExpression\\(\\) return type has no value type specified in iterable type array\\.$#"
1345
- count: 1
1346
- path: src/UriTemplate.php
1347
-
1348
- -
1349
- message: "#^Method GuzzleHttp\\\\UriTemplate\\:\\:expandMatch\\(\\) has parameter \\$matches with no value type specified in iterable type array\\.$#"
1350
- count: 1
1351
- path: src/UriTemplate.php
1352
-
1353
- -
1354
- message: "#^Method GuzzleHttp\\\\UriTemplate\\:\\:isAssoc\\(\\) has parameter \\$array with no value type specified in iterable type array\\.$#"
1355
- count: 1
1356
- path: src/UriTemplate.php
1357
-
1358
- -
1359
- message: "#^Function GuzzleHttp\\\\uri_template\\(\\) has parameter \\$variables with no value type specified in iterable type array\\.$#"
1360
- count: 1
1361
- path: src/functions.php
1362
-
1363
- -
1364
- message: "#^Function uri_template not found\\.$#"
1365
- count: 1
1366
- path: src/functions.php
1367
-
1368
- -
1369
- message: "#^Parameter \\#1 \\$str of function rtrim expects string, string\\|false given\\.$#"
1370
- count: 1
1371
- path: src/functions.php
1372
-
1373
- -
1374
- message: "#^Function GuzzleHttp\\\\headers_from_lines\\(\\) has parameter \\$lines with no value type specified in iterable type iterable\\.$#"
1375
- count: 1
1376
- path: src/functions.php
1377
-
1378
- -
1379
- message: "#^Function GuzzleHttp\\\\headers_from_lines\\(\\) return type has no value type specified in iterable type array\\.$#"
1380
- count: 1
1381
- path: src/functions.php
1382
-
1383
- -
1384
- message: "#^Function GuzzleHttp\\\\debug_resource\\(\\) should return resource but returns resource\\|false\\.$#"
1385
- count: 1
1386
- path: src/functions.php
1387
-
1388
- -
1389
- message: "#^Function GuzzleHttp\\\\normalize_header_keys\\(\\) has parameter \\$headers with no value type specified in iterable type array\\.$#"
1390
- count: 1
1391
- path: src/functions.php
1392
-
1393
- -
1394
- message: "#^Function GuzzleHttp\\\\normalize_header_keys\\(\\) return type has no value type specified in iterable type array\\.$#"
1395
- count: 1
1396
- path: src/functions.php
1397
-
1398
- -
1399
- message: "#^Function GuzzleHttp\\\\is_host_in_noproxy\\(\\) has parameter \\$noProxyArray with no value type specified in iterable type array\\.$#"
1400
- count: 1
1401
- path: src/functions.php
1402
-
1403
- -
1404
- message: "#^Cannot access offset 0 on array\\<int, string\\>\\|false\\.$#"
1405
- count: 1
1406
- path: src/functions.php
1407
-
1408
- -
1409
- message: "#^Function GuzzleHttp\\\\json_encode\\(\\) should return string but returns string\\|false\\.$#"
1410
- count: 1
1411
- path: src/functions.php
1412
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/guzzlehttp/guzzle/src/Client.php CHANGED
@@ -2,12 +2,11 @@
2
  namespace GuzzleHttp;
3
 
4
  use GuzzleHttp\Cookie\CookieJar;
5
- use GuzzleHttp\Exception\InvalidArgumentException;
6
  use GuzzleHttp\Promise;
7
  use GuzzleHttp\Psr7;
 
8
  use Psr\Http\Message\RequestInterface;
9
  use Psr\Http\Message\ResponseInterface;
10
- use Psr\Http\Message\UriInterface;
11
 
12
  /**
13
  * @method ResponseInterface get(string|UriInterface $uri, array $options = [])
@@ -76,12 +75,6 @@ class Client implements ClientInterface
76
  $this->configureDefaults($config);
77
  }
78
 
79
- /**
80
- * @param string $method
81
- * @param array $args
82
- *
83
- * @return Promise\PromiseInterface
84
- */
85
  public function __call($method, $args)
86
  {
87
  if (count($args) < 1) {
@@ -96,14 +89,6 @@ class Client implements ClientInterface
96
  : $this->request($method, $uri, $opts);
97
  }
98
 
99
- /**
100
- * Asynchronously send an HTTP request.
101
- *
102
- * @param array $options Request options to apply to the given
103
- * request and to the transfer. See \GuzzleHttp\RequestOptions.
104
- *
105
- * @return PromiseInterface
106
- */
107
  public function sendAsync(RequestInterface $request, array $options = [])
108
  {
109
  // Merge the base URI into the request URI if needed.
@@ -115,35 +100,12 @@ class Client implements ClientInterface
115
  );
116
  }
117
 
118
- /**
119
- * Send an HTTP request.
120
- *
121
- * @param array $options Request options to apply to the given
122
- * request and to the transfer. See \GuzzleHttp\RequestOptions.
123
- *
124
- * @return ResponseInterface
125
- * @throws GuzzleException
126
- */
127
  public function send(RequestInterface $request, array $options = [])
128
  {
129
  $options[RequestOptions::SYNCHRONOUS] = true;
130
  return $this->sendAsync($request, $options)->wait();
131
  }
132
 
133
- /**
134
- * Create and send an asynchronous HTTP request.
135
- *
136
- * Use an absolute path to override the base path of the client, or a
137
- * relative path to append to the base path of the client. The URL can
138
- * contain the query string as well. Use an array to provide a URL
139
- * template and additional variables to use in the URL template expansion.
140
- *
141
- * @param string $method HTTP method
142
- * @param string|UriInterface $uri URI object or string.
143
- * @param array $options Request options to apply. See \GuzzleHttp\RequestOptions.
144
- *
145
- * @return PromiseInterface
146
- */
147
  public function requestAsync($method, $uri = '', array $options = [])
148
  {
149
  $options = $this->prepareDefaults($options);
@@ -163,37 +125,12 @@ class Client implements ClientInterface
163
  return $this->transfer($request, $options);
164
  }
165
 
166
- /**
167
- * Create and send an HTTP request.
168
- *
169
- * Use an absolute path to override the base path of the client, or a
170
- * relative path to append to the base path of the client. The URL can
171
- * contain the query string as well.
172
- *
173
- * @param string $method HTTP method.
174
- * @param string|UriInterface $uri URI object or string.
175
- * @param array $options Request options to apply. See \GuzzleHttp\RequestOptions.
176
- *
177
- * @return ResponseInterface
178
- * @throws GuzzleException
179
- */
180
  public function request($method, $uri = '', array $options = [])
181
  {
182
  $options[RequestOptions::SYNCHRONOUS] = true;
183
  return $this->requestAsync($method, $uri, $options)->wait();
184
  }
185
 
186
- /**
187
- * Get a client configuration option.
188
- *
189
- * These options include default request options of the client, a "handler"
190
- * (if utilized by the concrete client), and a "base_uri" if utilized by
191
- * the concrete client.
192
- *
193
- * @param string|null $option The config option to retrieve.
194
- *
195
- * @return mixed
196
- */
197
  public function getConfig($option = null)
198
  {
199
  return $option === null
@@ -201,11 +138,6 @@ class Client implements ClientInterface
201
  : (isset($this->config[$option]) ? $this->config[$option] : null);
202
  }
203
 
204
- /**
205
- * @param string|null $uri
206
- *
207
- * @return UriInterface
208
- */
209
  private function buildUri($uri, array $config)
210
  {
211
  // for BC we accept null which would otherwise fail in uri_for
@@ -215,38 +147,6 @@ class Client implements ClientInterface
215
  $uri = Psr7\UriResolver::resolve(Psr7\uri_for($config['base_uri']), $uri);
216
  }
217
 
218
- if ($uri->getHost() && isset($config['idn_conversion']) && ($config['idn_conversion'] !== false)) {
219
- $idnOptions = ($config['idn_conversion'] === true) ? IDNA_DEFAULT : $config['idn_conversion'];
220
-
221
- $asciiHost = idn_to_ascii($uri->getHost(), $idnOptions, INTL_IDNA_VARIANT_UTS46, $info);
222
- if ($asciiHost === false) {
223
- $errorBitSet = isset($info['errors']) ? $info['errors'] : 0;
224
-
225
- $errorConstants = array_filter(array_keys(get_defined_constants()), function ($name) {
226
- return substr($name, 0, 11) === 'IDNA_ERROR_';
227
- });
228
-
229
- $errors = [];
230
- foreach ($errorConstants as $errorConstant) {
231
- if ($errorBitSet & constant($errorConstant)) {
232
- $errors[] = $errorConstant;
233
- }
234
- }
235
-
236
- $errorMessage = 'IDN conversion failed';
237
- if ($errors) {
238
- $errorMessage .= ' (errors: ' . implode(', ', $errors) . ')';
239
- }
240
-
241
- throw new InvalidArgumentException($errorMessage);
242
- } else {
243
- if ($uri->getHost() !== $asciiHost) {
244
- // Replace URI only if the ASCII version is different
245
- $uri = $uri->withHost($asciiHost);
246
- }
247
- }
248
- }
249
-
250
  return $uri->getScheme() === '' && $uri->getHost() !== '' ? $uri->withScheme('http') : $uri;
251
  }
252
 
@@ -254,7 +154,6 @@ class Client implements ClientInterface
254
  * Configures the default options for a client.
255
  *
256
  * @param array $config
257
- * @return void
258
  */
259
  private function configureDefaults(array $config)
260
  {
@@ -266,15 +165,12 @@ class Client implements ClientInterface
266
  'cookies' => false
267
  ];
268
 
269
- // idn_to_ascii() is a part of ext-intl and might be not available
270
- $defaults['idn_conversion'] = function_exists('idn_to_ascii');
271
-
272
  // Use the standard Linux HTTP_PROXY and HTTPS_PROXY if set.
273
 
274
  // We can only trust the HTTP_PROXY environment variable in a CLI
275
  // process due to the fact that PHP has no reliable mechanism to
276
  // get environment variables that start with "HTTP_".
277
- if (php_sapi_name() === 'cli' && getenv('HTTP_PROXY')) {
278
  $defaults['proxy']['http'] = getenv('HTTP_PROXY');
279
  }
280
 
@@ -329,7 +225,7 @@ class Client implements ClientInterface
329
  if (array_key_exists('headers', $options)) {
330
  // Allows default headers to be unset.
331
  if ($options['headers'] === null) {
332
- $defaults['_conditional'] = [];
333
  unset($options['headers']);
334
  } elseif (!is_array($options['headers'])) {
335
  throw new \InvalidArgumentException('headers must be an array');
@@ -355,7 +251,8 @@ class Client implements ClientInterface
355
  * The URI of the request is not modified and the request options are used
356
  * as-is without merging in default options.
357
  *
358
- * @param array $options See \GuzzleHttp\RequestOptions.
 
359
  *
360
  * @return Promise\PromiseInterface
361
  */
@@ -374,7 +271,6 @@ class Client implements ClientInterface
374
  }
375
 
376
  $request = $this->applyOptions($request, $options);
377
- /** @var HandlerStack $handler */
378
  $handler = $options['handler'];
379
 
380
  try {
@@ -515,11 +411,6 @@ class Client implements ClientInterface
515
  return $request;
516
  }
517
 
518
- /**
519
- * Throw Exception with pre-set message.
520
- * @return void
521
- * @throws InvalidArgumentException Invalid body.
522
- */
523
  private function invalidBody()
524
  {
525
  throw new \InvalidArgumentException('Passing in the "body" request '
2
  namespace GuzzleHttp;
3
 
4
  use GuzzleHttp\Cookie\CookieJar;
 
5
  use GuzzleHttp\Promise;
6
  use GuzzleHttp\Psr7;
7
+ use Psr\Http\Message\UriInterface;
8
  use Psr\Http\Message\RequestInterface;
9
  use Psr\Http\Message\ResponseInterface;
 
10
 
11
  /**
12
  * @method ResponseInterface get(string|UriInterface $uri, array $options = [])
75
  $this->configureDefaults($config);
76
  }
77
 
 
 
 
 
 
 
78
  public function __call($method, $args)
79
  {
80
  if (count($args) < 1) {
89
  : $this->request($method, $uri, $opts);
90
  }
91
 
 
 
 
 
 
 
 
 
92
  public function sendAsync(RequestInterface $request, array $options = [])
93
  {
94
  // Merge the base URI into the request URI if needed.
100
  );
101
  }
102
 
 
 
 
 
 
 
 
 
 
103
  public function send(RequestInterface $request, array $options = [])
104
  {
105
  $options[RequestOptions::SYNCHRONOUS] = true;
106
  return $this->sendAsync($request, $options)->wait();
107
  }
108
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
109
  public function requestAsync($method, $uri = '', array $options = [])
110
  {
111
  $options = $this->prepareDefaults($options);
125
  return $this->transfer($request, $options);
126
  }
127
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
128
  public function request($method, $uri = '', array $options = [])
129
  {
130
  $options[RequestOptions::SYNCHRONOUS] = true;
131
  return $this->requestAsync($method, $uri, $options)->wait();
132
  }
133
 
 
 
 
 
 
 
 
 
 
 
 
134
  public function getConfig($option = null)
135
  {
136
  return $option === null
138
  : (isset($this->config[$option]) ? $this->config[$option] : null);
139
  }
140
 
 
 
 
 
 
141
  private function buildUri($uri, array $config)
142
  {
143
  // for BC we accept null which would otherwise fail in uri_for
147
  $uri = Psr7\UriResolver::resolve(Psr7\uri_for($config['base_uri']), $uri);
148
  }
149
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
150
  return $uri->getScheme() === '' && $uri->getHost() !== '' ? $uri->withScheme('http') : $uri;
151
  }
152
 
154
  * Configures the default options for a client.
155
  *
156
  * @param array $config
 
157
  */
158
  private function configureDefaults(array $config)
159
  {
165
  'cookies' => false
166
  ];
167
 
 
 
 
168
  // Use the standard Linux HTTP_PROXY and HTTPS_PROXY if set.
169
 
170
  // We can only trust the HTTP_PROXY environment variable in a CLI
171
  // process due to the fact that PHP has no reliable mechanism to
172
  // get environment variables that start with "HTTP_".
173
+ if (php_sapi_name() == 'cli' && getenv('HTTP_PROXY')) {
174
  $defaults['proxy']['http'] = getenv('HTTP_PROXY');
175
  }
176
 
225
  if (array_key_exists('headers', $options)) {
226
  // Allows default headers to be unset.
227
  if ($options['headers'] === null) {
228
+ $defaults['_conditional'] = null;
229
  unset($options['headers']);
230
  } elseif (!is_array($options['headers'])) {
231
  throw new \InvalidArgumentException('headers must be an array');
251
  * The URI of the request is not modified and the request options are used
252
  * as-is without merging in default options.
253
  *
254
+ * @param RequestInterface $request
255
+ * @param array $options
256
  *
257
  * @return Promise\PromiseInterface
258
  */
271
  }
272
 
273
  $request = $this->applyOptions($request, $options);
 
274
  $handler = $options['handler'];
275
 
276
  try {
411
  return $request;
412
  }
413
 
 
 
 
 
 
414
  private function invalidBody()
415
  {
416
  throw new \InvalidArgumentException('Passing in the "body" request '
vendor/guzzlehttp/guzzle/src/ClientInterface.php CHANGED
@@ -1,8 +1,8 @@
1
  <?php
2
  namespace GuzzleHttp;
3
 
4
- use GuzzleHttp\Exception\GuzzleException;
5
  use GuzzleHttp\Promise\PromiseInterface;
 
6
  use Psr\Http\Message\RequestInterface;
7
  use Psr\Http\Message\ResponseInterface;
8
  use Psr\Http\Message\UriInterface;
@@ -12,10 +12,7 @@ use Psr\Http\Message\UriInterface;
12
  */
13
  interface ClientInterface
14
  {
15
- /**
16
- * @deprecated Will be removed in Guzzle 7.0.0
17
- */
18
- const VERSION = '6.5.0';
19
 
20
  /**
21
  * Send an HTTP request.
1
  <?php
2
  namespace GuzzleHttp;
3
 
 
4
  use GuzzleHttp\Promise\PromiseInterface;
5
+ use GuzzleHttp\Exception\GuzzleException;
6
  use Psr\Http\Message\RequestInterface;
7
  use Psr\Http\Message\ResponseInterface;
8
  use Psr\Http\Message\UriInterface;
12
  */
13
  interface ClientInterface
14
  {
15
+ const VERSION = '6.4.1';
 
 
 
16
 
17
  /**
18
  * Send an HTTP request.
vendor/guzzlehttp/guzzle/src/Cookie/CookieJar.php CHANGED
@@ -94,8 +94,8 @@ class CookieJar implements CookieJarInterface
94
  */
95
  public function getCookieByName($name)
96
  {
97
- // don't allow a non string name
98
- if ($name === null || !is_scalar($name)) {
99
  return null;
100
  }
101
  foreach ($this->cookies as $cookie) {
@@ -103,8 +103,6 @@ class CookieJar implements CookieJarInterface
103
  return $cookie;
104
  }
105
  }
106
-
107
- return null;
108
  }
109
 
110
  public function toArray()
94
  */
95
  public function getCookieByName($name)
96
  {
97
+ // don't allow a null name
98
+ if ($name === null) {
99
  return null;
100
  }
101
  foreach ($this->cookies as $cookie) {
103
  return $cookie;
104
  }
105
  }
 
 
106
  }
107
 
108
  public function toArray()
vendor/guzzlehttp/guzzle/src/Cookie/CookieJarInterface.php CHANGED
@@ -58,9 +58,9 @@ interface CookieJarInterface extends \Countable, \IteratorAggregate
58
  * arguments, then the cookie with the specified name, path and domain is
59
  * removed.
60
  *
61
- * @param string|null $domain Clears cookies matching a domain
62
- * @param string|null $path Clears cookies matching a domain and path
63
- * @param string|null $name Clears cookies matching a domain, path, and name
64
  *
65
  * @return CookieJarInterface
66
  */
58
  * arguments, then the cookie with the specified name, path and domain is
59
  * removed.
60
  *
61
+ * @param string $domain Clears cookies matching a domain
62
+ * @param string $path Clears cookies matching a domain and path
63
+ * @param string $name Clears cookies matching a domain, path, and name
64
  *
65
  * @return CookieJarInterface
66
  */
vendor/guzzlehttp/guzzle/src/Cookie/FileCookieJar.php CHANGED
@@ -1,91 +1,91 @@
1
- <?php
2
- namespace GuzzleHttp\Cookie;
3
-
4
- /**
5
- * Persists non-session cookies using a JSON formatted file
6
- */
7
- class FileCookieJar extends CookieJar
8
- {
9
- /** @var string filename */
10
- private $filename;
11
-
12
- /** @var bool Control whether to persist session cookies or not. */
13
- private $storeSessionCookies;
14
-
15
- /**
16
- * Create a new FileCookieJar object
17
- *
18
- * @param string $cookieFile File to store the cookie data
19
- * @param bool $storeSessionCookies Set to true to store session cookies
20
- * in the cookie jar.
21
- *
22
- * @throws \RuntimeException if the file cannot be found or created
23
- */
24
- public function __construct($cookieFile, $storeSessionCookies = false)
25
- {
26
- parent::__construct();
27
- $this->filename = $cookieFile;
28
- $this->storeSessionCookies = $storeSessionCookies;
29
-
30
- if (file_exists($cookieFile)) {
31
- $this->load($cookieFile);
32
- }
33
- }
34
-
35
- /**
36
- * Saves the file when shutting down
37
- */
38
- public function __destruct()
39
- {
40
- $this->save($this->filename);
41
- }
42
-
43
- /**
44
- * Saves the cookies to a file.
45
- *
46
- * @param string $filename File to save
47
- * @throws \RuntimeException if the file cannot be found or created
48
- */
49
- public function save($filename)
50
- {
51
- $json = [];
52
- foreach ($this as $cookie) {
53
- /** @var SetCookie $cookie */
54
- if (CookieJar::shouldPersist($cookie, $this->storeSessionCookies)) {
55
- $json[] = $cookie->toArray();
56
- }
57
- }
58
-
59
- $jsonStr = \GuzzleHttp\json_encode($json);
60
- if (false === file_put_contents($filename, $jsonStr, LOCK_EX)) {
61
- throw new \RuntimeException("Unable to save file {$filename}");
62
- }
63
- }
64
-
65
- /**
66
- * Load cookies from a JSON formatted file.
67
- *
68
- * Old cookies are kept unless overwritten by newly loaded ones.
69
- *
70
- * @param string $filename Cookie file to load.
71
- * @throws \RuntimeException if the file cannot be loaded.
72
- */
73
- public function load($filename)
74
- {
75
- $json = file_get_contents($filename);
76
- if (false === $json) {
77
- throw new \RuntimeException("Unable to load file {$filename}");
78
- } elseif ($json === '') {
79
- return;
80
- }
81
-
82
- $data = \GuzzleHttp\json_decode($json, true);
83
- if (is_array($data)) {
84
- foreach (json_decode($json, true) as $cookie) {
85
- $this->setCookie(new SetCookie($cookie));
86
- }
87
- } elseif (strlen($data)) {
88
- throw new \RuntimeException("Invalid cookie file: {$filename}");
89
- }
90
- }
91
- }
1
+ <?php
2
+ namespace GuzzleHttp\Cookie;
3
+
4
+ /**
5
+ * Persists non-session cookies using a JSON formatted file
6
+ */
7
+ class FileCookieJar extends CookieJar
8
+ {
9
+ /** @var string filename */
10
+ private $filename;
11
+
12
+ /** @var bool Control whether to persist session cookies or not. */
13
+ private $storeSessionCookies;
14
+
15
+ /**
16
+ * Create a new FileCookieJar object
17
+ *
18
+ * @param string $cookieFile File to store the cookie data
19
+ * @param bool $storeSessionCookies Set to true to store session cookies
20
+ * in the cookie jar.
21
+ *
22
+ * @throws \RuntimeException if the file cannot be found or created
23
+ */
24
+ public function __construct($cookieFile, $storeSessionCookies = false)
25
+ {
26
+ parent::__construct();
27
+ $this->filename = $cookieFile;
28
+ $this->storeSessionCookies = $storeSessionCookies;
29
+
30
+ if (file_exists($cookieFile)) {
31
+ $this->load($cookieFile);
32
+ }
33
+ }
34
+
35
+ /**
36
+ * Saves the file when shutting down
37
+ */
38
+ public function __destruct()
39
+ {
40
+ $this->save($this->filename);
41
+ }
42
+
43
+ /**
44
+ * Saves the cookies to a file.
45
+ *
46
+ * @param string $filename File to save
47
+ * @throws \RuntimeException if the file cannot be found or created
48
+ */
49
+ public function save($filename)
50
+ {
51
+ $json = [];
52
+ foreach ($this as $cookie) {
53
+ /** @var SetCookie $cookie */
54
+ if (CookieJar::shouldPersist($cookie, $this->storeSessionCookies)) {
55
+ $json[] = $cookie->toArray();
56
+ }
57
+ }
58
+
59
+ $jsonStr = \GuzzleHttp\json_encode($json);
60
+ if (false === file_put_contents($filename, $jsonStr, LOCK_EX)) {
61
+ throw new \RuntimeException("Unable to save file {$filename}");
62
+ }
63
+ }
64
+
65
+ /**
66
+ * Load cookies from a JSON formatted file.
67
+ *
68
+ * Old cookies are kept unless overwritten by newly loaded ones.
69
+ *
70
+ * @param string $filename Cookie file to load.
71
+ * @throws \RuntimeException if the file cannot be loaded.
72
+ */
73
+ public function load($filename)
74
+ {
75
+ $json = file_get_contents($filename);
76
+ if (false === $json) {
77
+ throw new \RuntimeException("Unable to load file {$filename}");
78
+ } elseif ($json === '') {
79
+ return;
80
+ }
81
+
82
+ $data = \GuzzleHttp\json_decode($json, true);
83
+ if (is_array($data)) {
84
+ foreach (json_decode($json, true) as $cookie) {
85
+ $this->setCookie(new SetCookie($cookie));
86
+ }
87
+ } elseif (strlen($data)) {
88
+ throw new \RuntimeException("Invalid cookie file: {$filename}");
89
+ }
90
+ }
91
+ }
vendor/guzzlehttp/guzzle/src/Cookie/SessionCookieJar.php CHANGED
@@ -1,72 +1,72 @@
1
- <?php
2
- namespace GuzzleHttp\Cookie;
3
-
4
- /**
5
- * Persists cookies in the client session
6
- */
7
- class SessionCookieJar extends CookieJar
8
- {
9
- /** @var string session key */
10
- private $sessionKey;
11
-
12
- /** @var bool Control whether to persist session cookies or not. */
13
- private $storeSessionCookies;
14
-
15
- /**
16
- * Create a new SessionCookieJar object
17
- *
18
- * @param string $sessionKey Session key name to store the cookie
19
- * data in session
20
- * @param bool $storeSessionCookies Set to true to store session cookies
21
- * in the cookie jar.
22
- */
23
- public function __construct($sessionKey, $storeSessionCookies = false)
24
- {
25
- parent::__construct();
26
- $this->sessionKey = $sessionKey;
27
- $this->storeSessionCookies = $storeSessionCookies;
28
- $this->load();
29
- }
30
-
31
- /**
32
- * Saves cookies to session when shutting down
33
- */
34
- public function __destruct()
35
- {
36
- $this->save();
37
- }
38
-
39
- /**
40
- * Save cookies to the client session
41
- */
42
- public function save()
43
- {
44
- $json = [];
45
- foreach ($this as $cookie) {
46
- /** @var SetCookie $cookie */
47
- if (CookieJar::shouldPersist($cookie, $this->storeSessionCookies)) {
48
- $json[] = $cookie->toArray();
49
- }
50
- }
51
-
52
- $_SESSION[$this->sessionKey] = json_encode($json);
53
- }
54
-
55
- /**
56
- * Load the contents of the client session into the data array
57
- */
58
- protected function load()
59
- {
60
- if (!isset($_SESSION[$this->sessionKey])) {
61
- return;
62
- }
63
- $data = json_decode($_SESSION[$this->sessionKey], true);
64
- if (is_array($data)) {
65
- foreach ($data as $cookie) {
66
- $this->setCookie(new SetCookie($cookie));
67
- }
68
- } elseif (strlen($data)) {
69
- throw new \RuntimeException("Invalid cookie data");
70
- }
71
- }
72
- }
1
+ <?php
2
+ namespace GuzzleHttp\Cookie;
3
+
4
+ /**
5
+ * Persists cookies in the client session
6
+ */
7
+ class SessionCookieJar extends CookieJar
8
+ {
9
+ /** @var string session key */
10
+ private $sessionKey;
11
+
12
+ /** @var bool Control whether to persist session cookies or not. */
13
+ private $storeSessionCookies;
14
+
15
+ /**
16
+ * Create a new SessionCookieJar object
17
+ *
18
+ * @param string $sessionKey Session key name to store the cookie
19
+ * data in session
20
+ * @param bool $storeSessionCookies Set to true to store session cookies
21
+ * in the cookie jar.
22
+ */
23
+ public function __construct($sessionKey, $storeSessionCookies = false)
24
+ {
25
+ parent::__construct();
26
+ $this->sessionKey = $sessionKey;
27
+ $this->storeSessionCookies = $storeSessionCookies;
28
+ $this->load();
29
+ }
30
+
31
+ /**
32
+ * Saves cookies to session when shutting down
33
+ */
34
+ public function __destruct()
35
+ {
36
+ $this->save();
37
+ }
38
+
39
+ /**
40
+ * Save cookies to the client session
41
+ */
42
+ public function save()
43
+ {
44
+ $json = [];
45
+ foreach ($this as $cookie) {
46
+ /** @var SetCookie $cookie */
47
+ if (CookieJar::shouldPersist($cookie, $this->storeSessionCookies)) {
48
+ $json[] = $cookie->toArray();
49
+ }
50
+ }
51
+
52
+ $_SESSION[$this->sessionKey] = json_encode($json);
53
+ }
54
+
55
+ /**
56
+ * Load the contents of the client session into the data array
57
+ */
58
+ protected function load()
59
+ {
60
+ if (!isset($_SESSION[$this->sessionKey])) {
61
+ return;
62
+ }
63
+ $data = json_decode($_SESSION[$this->sessionKey], true);
64
+ if (is_array($data)) {
65
+ foreach ($data as $cookie) {
66
+ $this->setCookie(new SetCookie($cookie));
67
+ }
68
+ } elseif (strlen($data)) {
69
+ throw new \RuntimeException("Invalid cookie data");
70
+ }
71
+ }
72
+ }
vendor/guzzlehttp/guzzle/src/Cookie/SetCookie.php CHANGED
@@ -1,403 +1,403 @@
1
- <?php
2
- namespace GuzzleHttp\Cookie;
3
-
4
- /**
5
- * Set-Cookie object
6
- */
7
- class SetCookie
8
- {
9
- /** @var array */
10
- private static $defaults = [
11
- 'Name' => null,
12
- 'Value' => null,
13
- 'Domain' => null,
14
- 'Path' => '/',
15
- 'Max-Age' => null,
16
- 'Expires' => null,
17
- 'Secure' => false,
18
- 'Discard' => false,
19
- 'HttpOnly' => false
20
- ];
21
-
22
- /** @var array Cookie data */
23
- private $data;
24
-
25
- /**
26
- * Create a new SetCookie object from a string
27
- *
28
- * @param string $cookie Set-Cookie header string
29
- *
30
- * @return self
31
- */
32
- public static function fromString($cookie)
33
- {
34
- // Create the default return array
35
- $data = self::$defaults;
36
- // Explode the cookie string using a series of semicolons
37
- $pieces = array_filter(array_map('trim', explode(';', $cookie)));
38
- // The name of the cookie (first kvp) must exist and include an equal sign.
39
- if (empty($pieces[0]) || !strpos($pieces[0], '=')) {
40
- return new self($data);
41
- }
42
-
43
- // Add the cookie pieces into the parsed data array
44
- foreach ($pieces as $part) {
45
- $cookieParts = explode('=', $part, 2);
46
- $key = trim($cookieParts[0]);
47
- $value = isset($cookieParts[1])
48
- ? trim($cookieParts[1], " \n\r\t\0\x0B")
49
- : true;
50
-
51
- // Only check for non-cookies when cookies have been found
52
- if (empty($data['Name'])) {
53
- $data['Name'] = $key;
54
- $data['Value'] = $value;
55
- } else {
56
- foreach (array_keys(self::$defaults) as $search) {
57
- if (!strcasecmp($search, $key)) {
58
- $data[$search] = $value;
59
- continue 2;
60
- }
61
- }
62
- $data[$key] = $value;
63
- }
64
- }
65
-
66
- return new self($data);
67
- }
68
-
69
- /**
70
- * @param array $data Array of cookie data provided by a Cookie parser
71
- */
72
- public function __construct(array $data = [])
73
- {
74
- $this->data = array_replace(self::$defaults, $data);
75
- // Extract the Expires value and turn it into a UNIX timestamp if needed
76
- if (!$this->getExpires() && $this->getMaxAge()) {
77
- // Calculate the Expires date
78
- $this->setExpires(time() + $this->getMaxAge());
79
- } elseif ($this->getExpires() && !is_numeric($this->getExpires())) {
80
- $this->setExpires($this->getExpires());
81
- }
82
- }
83
-
84
- public function __toString()
85
- {
86
- $str = $this->data['Name'] . '=' . $this->data['Value'] . '; ';
87
- foreach ($this->data as $k => $v) {
88
- if ($k !== 'Name' && $k !== 'Value' && $v !== null && $v !== false) {
89
- if ($k === 'Expires') {
90
- $str .= 'Expires=' . gmdate('D, d M Y H:i:s \G\M\T', $v) . '; ';
91
- } else {
92
- $str .= ($v === true ? $k : "{$k}={$v}") . '; ';
93
- }
94
- }
95
- }
96
-
97
- return rtrim($str, '; ');
98
- }
99
-
100
- public function toArray()
101
- {
102
- return $this->data;
103
- }
104
-
105
- /**
106
- * Get the cookie name
107
- *
108
- * @return string
109
- */
110
- public function getName()
111
- {
112
- return $this->data['Name'];
113
- }
114
-
115
- /**
116
- * Set the cookie name
117
- *
118
- * @param string $name Cookie name
119
- */
120
- public function setName($name)
121
- {
122
- $this->data['Name'] = $name;
123
- }
124
-
125
- /**
126
- * Get the cookie value
127
- *
128
- * @return string
129
- */
130
- public function getValue()
131
- {
132
- return $this->data['Value'];
133
- }
134
-
135
- /**
136
- * Set the cookie value
137
- *
138
- * @param string $value Cookie value
139
- */
140
- public function setValue($value)
141
- {
142
- $this->data['Value'] = $value;
143
- }
144
-
145
- /**
146
- * Get the domain
147
- *
148
- * @return string|null
149
- */
150
- public function getDomain()
151
- {
152
- return $this->data['Domain'];
153
- }
154
-
155
- /**
156
- * Set the domain of the cookie
157
- *
158
- * @param string $domain
159
- */
160
- public function setDomain($domain)
161
- {
162
- $this->data['Domain'] = $domain;
163
- }
164
-
165
- /**
166
- * Get the path
167
- *
168
- * @return string
169
- */
170
- public function getPath()
171
- {
172
- return $this->data['Path'];
173
- }
174
-
175
- /**
176
- * Set the path of the cookie
177
- *
178
- * @param string $path Path of the cookie
179
- */
180
- public function setPath($path)
181
- {
182
- $this->data['Path'] = $path;
183
- }
184
-
185
- /**
186
- * Maximum lifetime of the cookie in seconds
187
- *
188
- * @return int|null
189
- */
190
- public function getMaxAge()
191
- {
192
- return $this->data['Max-Age'];
193
- }
194
-
195
- /**
196
- * Set the max-age of the cookie
197
- *
198
- * @param int $maxAge Max age of the cookie in seconds
199
- */
200
- public function setMaxAge($maxAge)
201
- {
202
- $this->data['Max-Age'] = $maxAge;
203
- }
204
-
205
- /**
206
- * The UNIX timestamp when the cookie Expires
207
- *
208
- * @return mixed
209
- */
210
- public function getExpires()
211
- {
212
- return $this->data['Expires'];
213
- }
214
-
215
- /**
216
- * Set the unix timestamp for which the cookie will expire
217
- *
218
- * @param int $timestamp Unix timestamp
219
- */
220
- public function setExpires($timestamp)
221
- {
222
- $this->data['Expires'] = is_numeric($timestamp)
223
- ? (int) $timestamp
224
- : strtotime($timestamp);
225
- }
226
-
227
- /**
228
- * Get whether or not this is a secure cookie
229
- *
230
- * @return bool|null
231
- */
232
- public function getSecure()
233
- {
234
- return $this->data['Secure'];
235
- }
236
-
237
- /**
238
- * Set whether or not the cookie is secure
239
- *
240
- * @param bool $secure Set to true or false if secure
241
- */
242
- public function setSecure($secure)
243
- {
244
- $this->data['Secure'] = $secure;
245
- }
246
-
247
- /**
248
- * Get whether or not this is a session cookie
249
- *
250
- * @return bool|null
251
- */
252
- public function getDiscard()
253
- {
254
- return $this->data['Discard'];
255
- }
256
-
257
- /**
258
- * Set whether or not this is a session cookie
259
- *
260
- * @param bool $discard Set to true or false if this is a session cookie
261
- */
262
- public function setDiscard($discard)
263
- {
264
- $this->data['Discard'] = $discard;
265
- }
266
-
267
- /**
268
- * Get whether or not this is an HTTP only cookie
269
- *
270
- * @return bool
271
- */
272
- public function getHttpOnly()
273
- {
274
- return $this->data['HttpOnly'];
275
- }
276
-
277
- /**
278
- * Set whether or not this is an HTTP only cookie
279
- *
280
- * @param bool $httpOnly Set to true or false if this is HTTP only
281
- */
282
- public function setHttpOnly($httpOnly)
283
- {
284
- $this->data['HttpOnly'] = $httpOnly;
285
- }
286
-
287
- /**
288
- * Check if the cookie matches a path value.
289
- *
290
- * A request-path path-matches a given cookie-path if at least one of
291
- * the following conditions holds:
292
- *
293
- * - The cookie-path and the request-path are identical.
294
- * - The cookie-path is a prefix of the request-path, and the last
295
- * character of the cookie-path is %x2F ("/").
296
- * - The cookie-path is a prefix of the request-path, and the first
297
- * character of the request-path that is not included in the cookie-
298
- * path is a %x2F ("/") character.
299
- *
300
- * @param string $requestPath Path to check against
301
- *
302
- * @return bool
303
- */
304
- public function matchesPath($requestPath)
305
- {
306
- $cookiePath = $this->getPath();
307
-
308
- // Match on exact matches or when path is the default empty "/"
309
- if ($cookiePath === '/' || $cookiePath == $requestPath) {
310
- return true;
311
- }
312
-
313
- // Ensure that the cookie-path is a prefix of the request path.
314
- if (0 !== strpos($requestPath, $cookiePath)) {
315
- return false;
316
- }
317
-
318
- // Match if the last character of the cookie-path is "/"
319
- if (substr($cookiePath, -1, 1) === '/') {
320
- return true;
321
- }
322
-
323
- // Match if the first character not included in cookie path is "/"
324
- return substr($requestPath, strlen($cookiePath), 1) === '/';
325
- }
326
-
327
- /**
328
- * Check if the cookie matches a domain value
329
- *
330
- * @param string $domain Domain to check against
331
- *
332
- * @return bool
333
- */
334
- public function matchesDomain($domain)
335
- {
336
- // Remove the leading '.' as per spec in RFC 6265.
337
- // http://tools.ietf.org/html/rfc6265#section-5.2.3
338
- $cookieDomain = ltrim($this->getDomain(), '.');
339
-
340
- // Domain not set or exact match.
341
- if (!$cookieDomain || !strcasecmp($domain, $cookieDomain)) {
342
- return true;
343
- }
344
-
345
- // Matching the subdomain according to RFC 6265.
346
- // http://tools.ietf.org/html/rfc6265#section-5.1.3
347
- if (filter_var($domain, FILTER_VALIDATE_IP)) {
348
- return false;
349
- }
350
-
351
- return (bool) preg_match('/\.' . preg_quote($cookieDomain, '/') . '$/', $domain);
352
- }
353
-
354
- /**
355
- * Check if the cookie is expired
356
- *
357
- * @return bool
358
- */
359
- public function isExpired()
360
- {
361
- return $this->getExpires() !== null && time() > $this->getExpires();
362
- }
363
-
364
- /**
365
- * Check if the cookie is valid according to RFC 6265
366
- *
367
- * @return bool|string Returns true if valid or an error message if invalid
368
- */
369
- public function validate()
370
- {
371
- // Names must not be empty, but can be 0
372
- $name = $this->getName();
373
- if (empty($name) && !is_numeric($name)) {
374
- return 'The cookie name must not be empty';
375
- }
376
-
377
- // Check if any of the invalid characters are present in the cookie name
378
- if (preg_match(
379
- '/[\x00-\x20\x22\x28-\x29\x2c\x2f\x3a-\x40\x5c\x7b\x7d\x7f]/',
380
- $name
381
- )) {
382
- return 'Cookie name must not contain invalid characters: ASCII '
383
- . 'Control characters (0-31;127), space, tab and the '
384
- . 'following characters: ()<>@,;:\"/?={}';
385
- }
386
-
387
- // Value must not be empty, but can be 0
388
- $value = $this->getValue();
389
- if (empty($value) && !is_numeric($value)) {
390
- return 'The cookie value must not be empty';
391
- }
392
-
393
- // Domains must not be empty, but can be 0
394
- // A "0" is not a valid internet domain, but may be used as server name
395
- // in a private network.
396
- $domain = $this->getDomain();
397
- if (empty($domain) && !is_numeric($domain)) {
398
- return 'The cookie domain must not be empty';
399
- }
400
-
401
- return true;
402
- }
403
- }
1
+ <?php
2
+ namespace GuzzleHttp\Cookie;
3
+
4
+ /**
5
+ * Set-Cookie object
6
+ */
7
+ class SetCookie
8
+ {
9
+ /** @var array */
10
+ private static $defaults = [
11
+ 'Name' => null,
12
+ 'Value' => null,
13
+ 'Domain' => null,
14
+ 'Path' => '/',
15
+ 'Max-Age' => null,
16
+ 'Expires' => null,
17
+ 'Secure' => false,
18
+ 'Discard' => false,
19
+ 'HttpOnly' => false
20
+ ];
21
+
22
+ /** @var array Cookie data */
23
+ private $data;
24
+
25
+ /**
26
+ * Create a new SetCookie object from a string
27
+ *
28
+ * @param string $cookie Set-Cookie header string
29
+ *
30
+ * @return self
31
+ */
32
+ public static function fromString($cookie)
33
+ {
34
+ // Create the default return array
35
+ $data = self::$defaults;
36
+ // Explode the cookie string using a series of semicolons
37
+ $pieces = array_filter(array_map('trim', explode(';', $cookie)));
38
+ // The name of the cookie (first kvp) must exist and include an equal sign.
39
+ if (empty($pieces[0]) || !strpos($pieces[0], '=')) {
40
+ return new self($data);
41
+ }
42
+
43
+ // Add the cookie pieces into the parsed data array
44
+ foreach ($pieces as $part) {
45
+ $cookieParts = explode('=', $part, 2);
46
+ $key = trim($cookieParts[0]);
47
+ $value = isset($cookieParts[1])
48
+ ? trim($cookieParts[1], " \n\r\t\0\x0B")
49
+ : true;
50
+
51
+ // Only check for non-cookies when cookies have been found
52
+ if (empty($data['Name'])) {
53
+ $data['Name'] = $key;
54
+ $data['Value'] = $value;
55
+ } else {
56
+ foreach (array_keys(self::$defaults) as $search) {
57
+ if (!strcasecmp($search, $key)) {
58
+ $data[$search] = $value;
59
+ continue 2;
60
+ }
61
+ }
62
+ $data[$key] = $value;
63
+ }
64
+ }
65
+
66
+ return new self($data);
67
+ }
68
+
69
+ /**
70
+ * @param array $data Array of cookie data provided by a Cookie parser
71
+ */
72
+ public function __construct(array $data = [])
73
+ {
74
+ $this->data = array_replace(self::$defaults, $data);
75
+ // Extract the Expires value and turn it into a UNIX timestamp if needed
76
+ if (!$this->getExpires() && $this->getMaxAge()) {
77
+ // Calculate the Expires date
78
+ $this->setExpires(time() + $this->getMaxAge());
79
+ } elseif ($this->getExpires() && !is_numeric($this->getExpires())) {
80
+ $this->setExpires($this->getExpires());
81
+ }
82
+ }
83
+
84
+ public function __toString()
85
+ {
86
+ $str = $this->data['Name'] . '=' . $this->data['Value'] . '; ';
87
+ foreach ($this->data as $k => $v) {
88
+ if ($k !== 'Name' && $k !== 'Value' && $v !== null && $v !== false) {
89
+ if ($k === 'Expires') {
90
+ $str .= 'Expires=' . gmdate('D, d M Y H:i:s \G\M\T', $v) . '; ';
91
+ } else {
92
+ $str .= ($v === true ? $k : "{$k}={$v}") . '; ';
93
+ }
94
+ }
95
+ }
96
+
97
+ return rtrim($str, '; ');
98
+ }
99
+
100
+ public function toArray()
101
+ {
102
+ return $this->data;
103
+ }
104
+
105
+ /**
106
+ * Get the cookie name
107
+ *
108
+ * @return string
109
+ */
110
+ public function getName()
111
+ {
112
+ return $this->data['Name'];
113
+ }
114
+
115
+ /**
116
+ * Set the cookie name
117
+ *
118
+ * @param string $name Cookie name
119
+ */
120
+ public function setName($name)
121
+ {
122
+ $this->data['Name'] = $name;
123
+ }
124
+
125
+ /**
126
+ * Get the cookie value
127
+ *
128
+ * @return string
129
+ */
130
+ public function getValue()
131
+ {
132
+ return $this->data['Value'];
133
+ }
134
+
135
+ /**
136
+ * Set the cookie value
137
+ *
138
+ * @param string $value Cookie value
139
+ */
140
+ public function setValue($value)
141
+ {
142
+ $this->data['Value'] = $value;
143
+ }
144
+
145
+ /**
146
+ * Get the domain
147
+ *
148
+ * @return string|null
149
+ */
150
+ public function getDomain()
151
+ {
152
+ return $this->data['Domain'];
153
+ }
154
+
155
+ /**
156
+ * Set the domain of the cookie
157
+ *
158
+ * @param string $domain
159
+ */
160
+ public function setDomain($domain)
161
+ {
162
+ $this->data['Domain'] = $domain;
163
+ }
164
+
165
+ /**
166
+ * Get the path
167
+ *
168
+ * @return string
169
+ */
170
+ public function getPath()
171
+ {
172
+ return $this->data['Path'];
173
+ }
174
+
175
+ /**
176
+ * Set the path of the cookie
177
+ *
178
+ * @param string $path Path of the cookie
179
+ */
180
+ public function setPath($path)
181
+ {
182
+ $this->data['Path'] = $path;
183
+ }
184
+
185
+ /**
186
+ * Maximum lifetime of the cookie in seconds
187
+ *
188
+ * @return int|null
189
+ */
190
+ public function getMaxAge()
191
+ {
192
+ return $this->data['Max-Age'];
193
+ }
194
+
195
+ /**
196
+ * Set the max-age of the cookie
197
+ *
198
+ * @param int $maxAge Max age of the cookie in seconds
199
+ */
200
+ public function setMaxAge($maxAge)
201
+ {
202
+ $this->data['Max-Age'] = $maxAge;
203
+ }
204
+
205
+ /**
206
+ * The UNIX timestamp when the cookie Expires
207
+ *
208
+ * @return mixed
209
+ */
210
+ public function getExpires()
211
+ {
212
+ return $this->data['Expires'];
213
+ }
214
+
215
+ /**
216
+ * Set the unix timestamp for which the cookie will expire
217
+ *
218
+ * @param int $timestamp Unix timestamp
219
+ */
220
+ public function setExpires($timestamp)
221
+ {
222
+ $this->data['Expires'] = is_numeric($timestamp)
223
+ ? (int) $timestamp
224
+ : strtotime($timestamp);
225
+ }
226
+
227
+ /**
228
+ * Get whether or not this is a secure cookie
229
+ *
230
+ * @return bool|null
231
+ */
232
+ public function getSecure()
233
+ {
234
+ return $this->data['Secure'];
235
+ }
236
+
237
+ /**
238
+ * Set whether or not the cookie is secure
239
+ *
240
+ * @param bool $secure Set to true or false if secure
241
+ */
242
+ public function setSecure($secure)
243
+ {
244
+ $this->data['Secure'] = $secure;
245
+ }
246
+
247
+ /**
248
+ * Get whether or not this is a session cookie
249
+ *
250
+ * @return bool|null
251
+ */
252
+ public function getDiscard()
253
+ {
254
+ return $this->data['Discard'];
255
+ }
256
+
257
+ /**
258
+ * Set whether or not this is a session cookie
259
+ *
260
+ * @param bool $discard Set to true or false if this is a session cookie
261
+ */
262
+ public function setDiscard($discard)
263
+ {
264
+ $this->data['Discard'] = $discard;
265
+ }
266
+
267
+ /**
268
+ * Get whether or not this is an HTTP only cookie
269
+ *
270
+ * @return bool
271
+ */
272
+ public function getHttpOnly()
273
+ {
274
+ return $this->data['HttpOnly'];
275
+ }
276
+
277
+ /**
278
+ * Set whether or not this is an HTTP only cookie
279
+ *
280
+ * @param bool $httpOnly Set to true or false if this is HTTP only
281
+ */
282
+ public function setHttpOnly($httpOnly)
283
+ {
284
+ $this->data['HttpOnly'] = $httpOnly;
285
+ }
286
+
287
+ /**
288
+ * Check if the cookie matches a path value.
289
+ *
290
+ * A request-path path-matches a given cookie-path if at least one of
291
+ * the following conditions holds:
292
+ *
293
+ * - The cookie-path and the request-path are identical.
294
+ * - The cookie-path is a prefix of the request-path, and the last
295
+ * character of the cookie-path is %x2F ("/").
296
+ * - The cookie-path is a prefix of the request-path, and the first
297
+ * character of the request-path that is not included in the cookie-
298
+ * path is a %x2F ("/") character.
299
+ *
300
+ * @param string $requestPath Path to check against
301
+ *
302
+ * @return bool
303
+ */
304
+ public function matchesPath($requestPath)
305
+ {
306
+ $cookiePath = $this->getPath();
307
+
308
+ // Match on exact matches or when path is the default empty "/"
309
+ if ($cookiePath === '/' || $cookiePath == $requestPath) {
310
+ return true;
311
+ }
312
+
313
+ // Ensure that the cookie-path is a prefix of the request path.
314
+ if (0 !== strpos($requestPath, $cookiePath)) {
315
+ return false;
316
+ }
317
+
318
+ // Match if the last character of the cookie-path is "/"
319
+ if (substr($cookiePath, -1, 1) === '/') {
320
+ return true;
321
+ }
322
+
323
+ // Match if the first character not included in cookie path is "/"
324
+ return substr($requestPath, strlen($cookiePath), 1) === '/';
325
+ }
326
+
327
+ /**
328
+ * Check if the cookie matches a domain value
329
+ *
330
+ * @param string $domain Domain to check against
331
+ *
332
+ * @return bool
333
+ */
334
+ public function matchesDomain($domain)
335
+ {
336
+ // Remove the leading '.' as per spec in RFC 6265.
337
+ // http://tools.ietf.org/html/rfc6265#section-5.2.3
338
+ $cookieDomain = ltrim($this->getDomain(), '.');
339
+
340
+ // Domain not set or exact match.
341
+ if (!$cookieDomain || !strcasecmp($domain, $cookieDomain)) {
342
+ return true;
343
+ }
344
+
345
+ // Matching the subdomain according to RFC 6265.
346
+ // http://tools.ietf.org/html/rfc6265#section-5.1.3
347
+ if (filter_var($domain, FILTER_VALIDATE_IP)) {
348
+ return false;
349
+ }
350
+
351
+ return (bool) preg_match('/\.' . preg_quote($cookieDomain, '/') . '$/', $domain);
352
+ }
353
+
354
+ /**
355
+ * Check if the cookie is expired
356
+ *
357
+ * @return bool
358
+ */
359
+ public function isExpired()
360
+ {
361
+ return $this->getExpires() !== null && time() > $this->getExpires();
362
+ }
363
+
364
+ /**
365
+ * Check if the cookie is valid according to RFC 6265
366
+ *
367
+ * @return bool|string Returns true if valid or an error message if invalid
368
+ */
369
+ public function validate()
370
+ {
371
+ // Names must not be empty, but can be 0
372
+ $name = $this->getName();
373
+ if (empty($name) && !is_numeric($name)) {
374
+ return 'The cookie name must not be empty';
375
+ }
376
+
377
+ // Check if any of the invalid characters are present in the cookie name
378
+ if (preg_match(
379
+ '/[\x00-\x20\x22\x28-\x29\x2c\x2f\x3a-\x40\x5c\x7b\x7d\x7f]/',
380
+ $name
381
+ )) {
382
+ return 'Cookie name must not contain invalid characters: ASCII '
383
+ . 'Control characters (0-31;127), space, tab and the '
384
+ . 'following characters: ()<>@,;:\"/?={}';
385
+ }
386
+
387
+ // Value must not be empty, but can be 0
388
+ $value = $this->getValue();
389
+ if (empty($value) && !is_numeric($value)) {
390
+ return 'The cookie value must not be empty';
391
+ }
392
+
393
+ // Domains must not be empty, but can be 0
394
+ // A "0" is not a valid internet domain, but may be used as server name
395
+ // in a private network.
396
+ $domain = $this->getDomain();
397
+ if (empty($domain) && !is_numeric($domain)) {
398
+ return 'The cookie domain must not be empty';
399
+ }
400
+
401
+ return true;
402
+ }
403
+ }
vendor/guzzlehttp/guzzle/src/Exception/BadResponseException.php CHANGED
@@ -1,27 +1,27 @@
1
- <?php
2
- namespace GuzzleHttp\Exception;
3
-
4
- use Psr\Http\Message\RequestInterface;
5
- use Psr\Http\Message\ResponseInterface;
6
-
7
- /**
8
- * Exception when an HTTP error occurs (4xx or 5xx error)
9
- */
10
- class BadResponseException extends RequestException
11
- {
12
- public function __construct(
13
- $message,
14
- RequestInterface $request,
15
- ResponseInterface $response = null,
16
- \Exception $previous = null,
17
- array $handlerContext = []
18
- ) {
19
- if (null === $response) {
20
- @trigger_error(
21
- 'Instantiating the ' . __CLASS__ . ' class without a Response is deprecated since version 6.3 and will be removed in 7.0.',
22
- E_USER_DEPRECATED
23
- );
24
- }
25
- parent::__construct($message, $request, $response, $previous, $handlerContext);
26
- }
27
- }
1
+ <?php
2
+ namespace GuzzleHttp\Exception;
3
+
4
+ use Psr\Http\Message\RequestInterface;
5
+ use Psr\Http\Message\ResponseInterface;
6
+
7
+ /**
8
+ * Exception when an HTTP error occurs (4xx or 5xx error)
9
+ */
10
+ class BadResponseException extends RequestException
11
+ {
12
+ public function __construct(
13
+ $message,
14
+ RequestInterface $request,
15
+ ResponseInterface $response = null,
16
+ \Exception $previous = null,
17
+ array $handlerContext = []
18
+ ) {
19
+ if (null === $response) {
20
+ @trigger_error(
21
+ 'Instantiating the ' . __CLASS__ . ' class without a Response is deprecated since version 6.3 and will be removed in 7.0.',
22
+ E_USER_DEPRECATED
23
+ );
24
+ }
25
+ parent::__construct($message, $request, $response, $previous, $handlerContext);
26
+ }
27
+ }
vendor/guzzlehttp/guzzle/src/Exception/ClientException.php CHANGED
@@ -1,9 +1,9 @@
1
- <?php
2
- namespace GuzzleHttp\Exception;
3
-
4
- /**
5
- * Exception when a client error is encountered (4xx codes)
6
- */
7
- class ClientException extends BadResponseException
8
- {
9
- }
1
+ <?php
2
+ namespace GuzzleHttp\Exception;
3
+
4
+ /**
5
+ * Exception when a client error is encountered (4xx codes)
6
+ */
7
+ class ClientException extends BadResponseException
8
+ {
9
+ }
vendor/guzzlehttp/guzzle/src/Exception/ConnectException.php CHANGED
@@ -1,37 +1,37 @@
1
- <?php
2
- namespace GuzzleHttp\Exception;
3
-
4
- use Psr\Http\Message\RequestInterface;
5
-
6
- /**
7
- * Exception thrown when a connection cannot be established.
8
- *
9
- * Note that no response is present for a ConnectException
10
- */
11
- class ConnectException extends RequestException
12
- {
13
- public function __construct(
14
- $message,
15
- RequestInterface $request,
16
- \Exception $previous = null,
17
- array $handlerContext = []
18
- ) {
19
- parent::__construct($message, $request, null, $previous, $handlerContext);
20
- }
21
-
22
- /**
23
- * @return null
24
- */
25
- public function getResponse()
26
- {
27
- return null;
28
- }
29
-
30
- /**
31
- * @return bool
32
- */
33
- public function hasResponse()
34
- {
35
- return false;
36
- }
37
- }
1
+ <?php
2
+ namespace GuzzleHttp\Exception;
3
+
4
+ use Psr\Http\Message\RequestInterface;
5
+
6
+ /**
7
+ * Exception thrown when a connection cannot be established.
8
+ *
9
+ * Note that no response is present for a ConnectException
10
+ */
11
+ class ConnectException extends RequestException
12
+ {
13
+ public function __construct(
14
+ $message,
15
+ RequestInterface $request,
16
+ \Exception $previous = null,
17
+ array $handlerContext = []
18
+ ) {
19
+ parent::__construct($message, $request, null, $previous, $handlerContext);
20
+ }
21
+
22
+ /**
23
+ * @return null
24
+ */
25
+ public function getResponse()
26
+ {
27
+ return null;
28
+ }
29
+
30
+ /**
31
+ * @return bool
32
+ */
33
+ public function hasResponse()
34
+ {
35
+ return false;
36
+ }
37
+ }
vendor/guzzlehttp/guzzle/src/Exception/GuzzleException.php CHANGED
@@ -1,23 +1,23 @@
1
- <?php
2
- namespace GuzzleHttp\Exception;
3
-
4
- use Throwable;
5
-
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
- }
1
+ <?php
2
+ namespace GuzzleHttp\Exception;
3
+
4
+ use Throwable;
5
+
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
+ }
vendor/guzzlehttp/guzzle/src/Exception/InvalidArgumentException.php CHANGED
@@ -1,7 +1,7 @@
1
- <?php
2
-
3
- namespace GuzzleHttp\Exception;
4
-
5
- final class InvalidArgumentException extends \InvalidArgumentException implements GuzzleException
6
- {
7
- }
1
+ <?php
2
+
3
+ namespace GuzzleHttp\Exception;
4
+
5
+ final class InvalidArgumentException extends \InvalidArgumentException implements GuzzleException
6
+ {
7
+ }
vendor/guzzlehttp/guzzle/src/Exception/RequestException.php CHANGED
@@ -1,9 +1,9 @@
1
  <?php
2
  namespace GuzzleHttp\Exception;
3
 
4
- use GuzzleHttp\Promise\PromiseInterface;
5
  use Psr\Http\Message\RequestInterface;
6
  use Psr\Http\Message\ResponseInterface;
 
7
  use Psr\Http\Message\UriInterface;
8
 
9
  /**
@@ -14,7 +14,7 @@ class RequestException extends TransferException
14
  /** @var RequestInterface */
15
  private $request;
16
 
17
- /** @var ResponseInterface|null */
18
  private $response;
19
 
20
  /** @var array */
@@ -124,17 +124,42 @@ class RequestException extends TransferException
124
  */
125
  public static function getResponseBodySummary(ResponseInterface $response)
126
  {
127
- return \GuzzleHttp\Psr7\get_message_body_summary($response);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
128
  }
129
 
130
  /**
131
- * Obfuscates URI if there is a username and a password present
132
  *
133
  * @param UriInterface $uri
134
  *
135
  * @return UriInterface
136
  */
137
- private static function obfuscateUri(UriInterface $uri)
138
  {
139
  $userInfo = $uri->getUserInfo();
140
 
1
  <?php
2
  namespace GuzzleHttp\Exception;
3
 
 
4
  use Psr\Http\Message\RequestInterface;
5
  use Psr\Http\Message\ResponseInterface;
6
+ use GuzzleHttp\Promise\PromiseInterface;
7
  use Psr\Http\Message\UriInterface;
8
 
9
  /**
14
  /** @var RequestInterface */
15
  private $request;
16
 
17
+ /** @var ResponseInterface */
18
  private $response;
19
 
20
  /** @var array */
124
  */
125
  public static function getResponseBodySummary(ResponseInterface $response)
126
  {
127
+ $body = $response->getBody();
128
+
129
+ if (!$body->isSeekable() || !$body->isReadable()) {
130
+ return null;
131
+ }
132
+
133
+ $size = $body->getSize();
134
+
135
+ if ($size === 0) {
136
+ return null;
137
+ }
138
+
139
+ $summary = $body->read(120);
140
+ $body->rewind();
141
+
142
+ if ($size > 120) {
143
+ $summary .= ' (truncated...)';
144
+ }
145
+
146
+ // Matches any printable character, including unicode characters:
147
+ // letters, marks, numbers, punctuation, spacing, and separators.
148
+ if (preg_match('/[^\pL\pM\pN\pP\pS\pZ\n\r\t]/', $summary)) {
149
+ return null;
150
+ }
151
+
152
+ return $summary;
153
  }
154
 
155
  /**
156
+ * Obfuscates URI if there is an username and a password present
157
  *
158
  * @param UriInterface $uri
159
  *
160
  * @return UriInterface
161
  */
162
+ private static function obfuscateUri($uri)
163
  {
164
  $userInfo = $uri->getUserInfo();
165
 
vendor/guzzlehttp/guzzle/src/Exception/SeekException.php CHANGED
@@ -1,27 +1,27 @@
1
- <?php
2
- namespace GuzzleHttp\Exception;
3
-
4
- use Psr\Http\Message\StreamInterface;
5
-
6
- /**
7
- * Exception thrown when a seek fails on a stream.
8
- */
9
- class SeekException extends \RuntimeException implements GuzzleException
10
- {
11
- private $stream;
12
-
13
- public function __construct(StreamInterface $stream, $pos = 0, $msg = '')
14
- {
15
- $this->stream = $stream;
16
- $msg = $msg ?: 'Could not seek the stream to position ' . $pos;
17
- parent::__construct($msg);
18
- }
19
-
20
- /**
21
- * @return StreamInterface
22
- */
23
- public function getStream()
24
- {
25
- return $this->stream;
26
- }
27
- }
1
+ <?php
2
+ namespace GuzzleHttp\Exception;
3
+
4
+ use Psr\Http\Message\StreamInterface;
5
+
6
+ /**
7
+ * Exception thrown when a seek fails on a stream.
8
+ */
9
+ class SeekException extends \RuntimeException implements GuzzleException
10
+ {
11
+ private $stream;
12
+
13
+ public function __construct(StreamInterface $stream, $pos = 0, $msg = '')
14
+ {
15
+ $this->stream = $stream;
16
+ $msg = $msg ?: 'Could not seek the stream to position ' . $pos;
17
+ parent::__construct($msg);
18
+ }
19
+
20
+ /**
21
+ * @return StreamInterface
22
+ */
23
+ public function getStream()
24
+ {
25
+ return $this->stream;
26
+ }
27
+ }
vendor/guzzlehttp/guzzle/src/Exception/ServerException.php CHANGED
@@ -1,9 +1,9 @@
1
- <?php
2
- namespace GuzzleHttp\Exception;
3
-
4
- /**
5
- * Exception when a server error is encountered (5xx codes)
6
- */
7
- class ServerException extends BadResponseException
8
- {
9
- }
1
+ <?php
2
+ namespace GuzzleHttp\Exception;
3
+
4
+ /**
5
+ * Exception when a server error is encountered (5xx codes)
6
+ */
7
+ class ServerException extends BadResponseException
8
+ {
9
+ }
vendor/guzzlehttp/guzzle/src/Exception/TooManyRedirectsException.php CHANGED
@@ -1,6 +1,6 @@
1
- <?php
2
- namespace GuzzleHttp\Exception;
3
-
4
- class TooManyRedirectsException extends RequestException
5
- {
6
- }
1
+ <?php
2
+ namespace GuzzleHttp\Exception;
3
+
4
+ class TooManyRedirectsException extends RequestException
5
+ {
6
+ }
vendor/guzzlehttp/guzzle/src/Exception/TransferException.php CHANGED
@@ -1,6 +1,6 @@
1
- <?php
2
- namespace GuzzleHttp\Exception;
3
-
4
- class TransferException extends \RuntimeException implements GuzzleException
5
- {
6
- }
1
+ <?php
2
+ namespace GuzzleHttp\Exception;
3
+
4
+ class TransferException extends \RuntimeException implements GuzzleException
5
+ {
6
+ }
vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php CHANGED
@@ -1,8 +1,8 @@
1
  <?php
2
  namespace GuzzleHttp\Handler;
3
 
4
- use GuzzleHttp\Exception\ConnectException;
5
  use GuzzleHttp\Exception\RequestException;
 
6
  use GuzzleHttp\Promise\FulfilledPromise;
7
  use GuzzleHttp\Psr7;
8
  use GuzzleHttp\Psr7\LazyOpenStream;
@@ -454,16 +454,11 @@ class CurlFactory implements CurlFactoryInterface
454
  }
455
 
456
  if (isset($options['ssl_key'])) {
457
- if (is_array($options['ssl_key'])) {
458
- if (count($options['ssl_key']) === 2) {
459
- list($sslKey, $conf[CURLOPT_SSLKEYPASSWD]) = $options['ssl_key'];
460
- } else {
461
- list($sslKey) = $options['ssl_key'];
462
- }
463
  }
464
-
465
- $sslKey = isset($sslKey) ? $sslKey: $options['ssl_key'];
466
-
467
  if (!file_exists($sslKey)) {
468
  throw new \InvalidArgumentException(
469
  "SSL private key not found: {$sslKey}"
1
  <?php
2
  namespace GuzzleHttp\Handler;
3
 
 
4
  use GuzzleHttp\Exception\RequestException;
5
+ use GuzzleHttp\Exception\ConnectException;
6
  use GuzzleHttp\Promise\FulfilledPromise;
7
  use GuzzleHttp\Psr7;
8
  use GuzzleHttp\Psr7\LazyOpenStream;
454
  }
455
 
456
  if (isset($options['ssl_key'])) {
457
+ $sslKey = $options['ssl_key'];
458
+ if (is_array($sslKey)) {
459
+ $conf[CURLOPT_SSLKEYPASSWD] = $sslKey[1];
460
+ $sslKey = $sslKey[0];
 
 
461
  }
 
 
 
462
  if (!file_exists($sslKey)) {
463
  throw new \InvalidArgumentException(
464
  "SSL private key not found: {$sslKey}"
vendor/guzzlehttp/guzzle/src/Handler/CurlFactoryInterface.php CHANGED
@@ -1,27 +1,27 @@
1
- <?php
2
- namespace GuzzleHttp\Handler;
3
-
4
- use Psr\Http\Message\RequestInterface;
5
-
6
- interface CurlFactoryInterface
7
- {
8
- /**
9
- * Creates a cURL handle resource.
10
- *
11
- * @param RequestInterface $request Request
12
- * @param array $options Transfer options
13
- *
14
- * @return EasyHandle
15
- * @throws \RuntimeException when an option cannot be applied
16
- */
17
- public function create(RequestInterface $request, array $options);
18
-
19
- /**
20
- * Release an easy handle, allowing it to be reused or closed.
21
- *
22
- * This function must call unset on the easy handle's "handle" property.
23
- *
24
- * @param EasyHandle $easy
25
- */
26
- public function release(EasyHandle $easy);
27
- }
1
+ <?php
2
+ namespace GuzzleHttp\Handler;
3
+
4
+ use Psr\Http\Message\RequestInterface;
5
+
6
+ interface CurlFactoryInterface
7
+ {
8
+ /**
9
+ * Creates a cURL handle resource.
10
+ *
11
+ * @param RequestInterface $request Request
12
+ * @param array $options Transfer options
13
+ *
14
+ * @return EasyHandle
15
+ * @throws \RuntimeException when an option cannot be applied
16
+ */
17
+ public function create(RequestInterface $request, array $options);
18
+
19
+ /**
20
+ * Release an easy handle, allowing it to be reused or closed.
21
+ *
22
+ * This function must call unset on the easy handle's "handle" property.
23
+ *
24
+ * @param EasyHandle $easy
25
+ */
26
+ public function release(EasyHandle $easy);
27
+ }
vendor/guzzlehttp/guzzle/src/Handler/CurlHandler.php CHANGED
@@ -1,45 +1,45 @@
1
- <?php
2
- namespace GuzzleHttp\Handler;
3
-
4
- use GuzzleHttp\Psr7;
5
- use Psr\Http\Message\RequestInterface;
6
-
7
- /**
8
- * HTTP handler that uses cURL easy handles as a transport layer.
9
- *
10
- * When using the CurlHandler, custom curl options can be specified as an
11
- * associative array of curl option constants mapping to values in the
12
- * **curl** key of the "client" key of the request.
13
- */
14
- class CurlHandler
15
- {
16
- /** @var CurlFactoryInterface */
17
- private $factory;
18
-
19
- /**
20
- * Accepts an associative array of options:
21
- *
22
- * - factory: Optional curl factory used to create cURL handles.
23
- *
24
- * @param array $options Array of options to use with the handler
25
- */
26
- public function __construct(array $options = [])
27
- {
28
- $this->factory = isset($options['handle_factory'])
29
- ? $options['handle_factory']
30
- : new CurlFactory(3);
31
- }
32
-
33
- public function __invoke(RequestInterface $request, array $options)
34
- {
35
- if (isset($options['delay'])) {
36
- usleep($options['delay'] * 1000);
37
- }
38
-
39
- $easy = $this->factory->create($request, $options);
40
- curl_exec($easy->handle);
41
- $easy->errno = curl_errno($easy->handle);
42
-
43
- return CurlFactory::finish($this, $easy, $this->factory);
44
- }
45
- }
1
+ <?php
2
+ namespace GuzzleHttp\Handler;
3
+
4
+ use GuzzleHttp\Psr7;
5
+ use Psr\Http\Message\RequestInterface;
6
+
7
+ /**
8
+ * HTTP handler that uses cURL easy handles as a transport layer.
9
+ *
10
+ * When using the CurlHandler, custom curl options can be specified as an
11
+ * associative array of curl option constants mapping to values in the
12
+ * **curl** key of the "client" key of the request.
13
+ */
14
+ class CurlHandler
15
+ {
16
+ /** @var CurlFactoryInterface */
17
+ private $factory;
18
+
19
+ /**
20
+ * Accepts an associative array of options:
21
+ *
22
+ * - factory: Optional curl factory used to create cURL handles.
23
+ *
24
+ * @param array $options Array of options to use with the handler
25
+ */
26
+ public function __construct(array $options = [])
27
+ {
28
+ $this->factory = isset($options['handle_factory'])
29
+ ? $options['handle_factory']
30
+ : new CurlFactory(3);
31
+ }
32
+
33
+ public function __invoke(RequestInterface $request, array $options)
34
+ {
35
+ if (isset($options['delay'])) {
36
+ usleep($options['delay'] * 1000);
37
+ }
38
+
39
+ $easy = $this->factory->create($request, $options);
40
+ curl_exec($easy->handle);
41
+ $easy->errno = curl_errno($easy->handle);
42
+
43
+ return CurlFactory::finish($this, $easy, $this->factory);
44
+ }
45
+ }
vendor/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php CHANGED
@@ -1,9 +1,9 @@
1
  <?php
2
  namespace GuzzleHttp\Handler;
3
 
4
- use GuzzleHttp\Exception\InvalidArgumentException;
5
  use GuzzleHttp\Promise as P;
6
  use GuzzleHttp\Promise\Promise;
 
7
  use Psr\Http\Message\RequestInterface;
8
 
9
  /**
@@ -23,7 +23,6 @@ class CurlMultiHandler
23
  private $active;
24
  private $handles = [];
25
  private $delays = [];
26
- private $options = [];
27
 
28
  /**
29
  * This handler accepts the following options:
@@ -31,8 +30,6 @@ class CurlMultiHandler
31
  * - handle_factory: An optional factory used to create curl handles
32
  * - select_timeout: Optional timeout (in seconds) to block before timing
33
  * out while selecting curl handles. Defaults to 1 second.
34
- * - options: An associative array of CURLMOPT_* options and
35
- * corresponding values for curl_multi_setopt()
36
  *
37
  * @param array $options
38
  */
@@ -48,23 +45,12 @@ class CurlMultiHandler
48
  } else {
49
  $this->selectTimeout = 1;
50
  }
51
-
52
- $this->options = isset($options['options']) ? $options['options'] : [];
53
  }
54
 
55
  public function __get($name)
56
  {
57
  if ($name === '_mh') {
58
- $this->_mh = curl_multi_init();
59
-
60
- foreach ($this->options as $option => $value) {
61
- // A warning is raised in case of a wrong option.
62
- curl_multi_setopt($this->_mh, $option, $value);
63
- }
64
-
65
- // Further calls to _mh will return the value directly, without entering the
66
- // __get() method at all.
67
- return $this->_mh;
68
  }
69
 
70
  throw new \BadMethodCallException();
1
  <?php
2
  namespace GuzzleHttp\Handler;
3
 
 
4
  use GuzzleHttp\Promise as P;
5
  use GuzzleHttp\Promise\Promise;
6
+ use GuzzleHttp\Psr7;
7
  use Psr\Http\Message\RequestInterface;
8
 
9
  /**
23
  private $active;
24
  private $handles = [];
25
  private $delays = [];
 
26
 
27
  /**
28
  * This handler accepts the following options:
30
  * - handle_factory: An optional factory used to create curl handles
31
  * - select_timeout: Optional timeout (in seconds) to block before timing
32
  * out while selecting curl handles. Defaults to 1 second.
 
 
33
  *
34
  * @param array $options
35
  */
45
  } else {
46
  $this->selectTimeout = 1;
47
  }
 
 
48
  }
49
 
50
  public function __get($name)
51
  {
52
  if ($name === '_mh') {
53
+ return $this->_mh = curl_multi_init();
 
 
 
 
 
 
 
 
 
54
  }
55
 
56
  throw new \BadMethodCallException();
vendor/guzzlehttp/guzzle/src/Handler/EasyHandle.php CHANGED
@@ -1,92 +1,92 @@
1
- <?php
2
- namespace GuzzleHttp\Handler;
3
-
4
- use GuzzleHttp\Psr7\Response;
5
- use Psr\Http\Message\RequestInterface;
6
- use Psr\Http\Message\ResponseInterface;
7
- use Psr\Http\Message\StreamInterface;
8
-
9
- /**
10
- * Represents a cURL easy handle and the data it populates.
11
- *
12
- * @internal
13
- */
14
- final class EasyHandle
15
- {
16
- /** @var resource cURL resource */
17
- public $handle;
18
-
19
- /** @var StreamInterface Where data is being written */
20
- public $sink;
21
-
22
- /** @var array Received HTTP headers so far */
23
- public $headers = [];
24
-
25
- /** @var ResponseInterface Received response (if any) */
26
- public $response;
27
-
28
- /** @var RequestInterface Request being sent */
29
- public $request;
30
-
31
- /** @var array Request options */
32
- public $options = [];
33
-
34
- /** @var int cURL error number (if any) */
35
- public $errno = 0;
36
-
37
- /** @var \Exception Exception during on_headers (if any) */
38
- public $onHeadersException;
39
-
40
- /**
41
- * Attach a response to the easy handle based on the received headers.
42
- *
43
- * @throws \RuntimeException if no headers have been received.
44
- */
45
- public function createResponse()
46
- {
47
- if (empty($this->headers)) {
48
- throw new \RuntimeException('No headers have been received');
49
- }
50
-
51
- // HTTP-version SP status-code SP reason-phrase
52
- $startLine = explode(' ', array_shift($this->headers), 3);
53
- $headers = \GuzzleHttp\headers_from_lines($this->headers);
54
- $normalizedKeys = \GuzzleHttp\normalize_header_keys($headers);
55
-
56
- if (!empty($this->options['decode_content'])
57
- && isset($normalizedKeys['content-encoding'])
58
- ) {
59
- $headers['x-encoded-content-encoding']
60
- = $headers[$normalizedKeys['content-encoding']];
61
- unset($headers[$normalizedKeys['content-encoding']]);
62
- if (isset($normalizedKeys['content-length'])) {
63
- $headers['x-encoded-content-length']
64
- = $headers[$normalizedKeys['content-length']];
65
-
66
- $bodyLength = (int) $this->sink->getSize();
67
- if ($bodyLength) {
68
- $headers[$normalizedKeys['content-length']] = $bodyLength;
69
- } else {
70
- unset($headers[$normalizedKeys['content-length']]);
71
- }
72
- }
73
- }
74
-
75
- // Attach a response to the easy handle with the parsed headers.
76
- $this->response = new Response(
77
- $startLine[1],
78
- $headers,
79
- $this->sink,
80
- substr($startLine[0], 5),
81
- isset($startLine[2]) ? (string) $startLine[2] : null
82
- );
83
- }
84
-
85
- public function __get($name)
86
- {
87
- $msg = $name === 'handle'
88
- ? 'The EasyHandle has been released'
89
- : 'Invalid property: ' . $name;
90
- throw new \BadMethodCallException($msg);
91
- }
92
- }
1
+ <?php
2
+ namespace GuzzleHttp\Handler;
3
+
4
+ use GuzzleHttp\Psr7\Response;
5
+ use Psr\Http\Message\RequestInterface;
6
+ use Psr\Http\Message\ResponseInterface;
7
+ use Psr\Http\Message\StreamInterface;
8
+
9
+ /**
10
+ * Represents a cURL easy handle and the data it populates.
11
+ *
12
+ * @internal
13
+ */
14
+ final class EasyHandle
15
+ {
16
+ /** @var resource cURL resource */
17
+ public $handle;
18
+
19
+ /** @var StreamInterface Where data is being written */
20
+ public $sink;
21
+
22
+ /** @var array Received HTTP headers so far */
23
+ public $headers = [];
24
+
25
+ /** @var ResponseInterface Received response (if any) */
26
+ public $response;
27
+
28
+ /** @var RequestInterface Request being sent */
29
+ public $request;
30
+
31
+ /** @var array Request options */
32
+ public $options = [];
33
+
34
+ /** @var int cURL error number (if any) */
35
+ public $errno = 0;
36
+
37
+ /** @var \Exception Exception during on_headers (if any) */
38
+ public $onHeadersException;
39
+
40
+ /**
41
+ * Attach a response to the easy handle based on the received headers.
42
+ *
43
+ * @throws \RuntimeException if no headers have been received.
44
+ */
45
+ public function createResponse()
46
+ {
47
+ if (empty($this->headers)) {
48
+ throw new \RuntimeException('No headers have been received');
49
+ }
50
+
51
+ // HTTP-version SP status-code SP reason-phrase
52
+ $startLine = explode(' ', array_shift($this->headers), 3);
53
+ $headers = \GuzzleHttp\headers_from_lines($this->headers);
54
+ $normalizedKeys = \GuzzleHttp\normalize_header_keys($headers);
55
+
56
+ if (!empty($this->options['decode_content'])
57
+ && isset($normalizedKeys['content-encoding'])
58
+ ) {
59
+ $headers['x-encoded-content-encoding']
60
+ = $headers[$normalizedKeys['content-encoding']];
61
+ unset($headers[$normalizedKeys['content-encoding']]);
62
+ if (isset($normalizedKeys['content-length'])) {
63
+ $headers['x-encoded-content-length']
64
+ = $headers[$normalizedKeys['content-length']];
65
+
66
+ $bodyLength = (int) $this->sink->getSize();
67
+ if ($bodyLength) {
68
+ $headers[$normalizedKeys['content-length']] = $bodyLength;
69
+ } else {
70
+ unset($headers[$normalizedKeys['content-length']]);
71
+ }
72
+ }
73
+ }
74
+
75
+ // Attach a response to the easy handle with the parsed headers.
76
+ $this->response = new Response(
77
+ $startLine[1],
78
+ $headers,
79
+ $this->sink,
80
+ substr($startLine[0], 5),
81
+ isset($startLine[2]) ? (string) $startLine[2] : null
82
+ );
83
+ }
84
+
85
+ public function __get($name)
86
+ {
87
+ $msg = $name === 'handle'
88
+ ? 'The EasyHandle has been released'
89
+ : 'Invalid property: ' . $name;
90
+ throw new \BadMethodCallException($msg);
91
+ }
92
+ }
vendor/guzzlehttp/guzzle/src/Handler/MockHandler.php CHANGED
@@ -66,7 +66,7 @@ class MockHandler implements \Countable
66
  throw new \OutOfBoundsException('Mock queue is empty');
67
  }
68
 
69
- if (isset($options['delay']) && is_numeric($options['delay'])) {
70
  usleep($options['delay'] * 1000);
71
  }
72
 
@@ -175,11 +175,6 @@ class MockHandler implements \Countable
175
  return count($this->queue);
176
  }
177
 
178
- public function reset()
179
- {
180
- $this->queue = [];
181
- }
182
-
183
  private function invokeStats(
184
  RequestInterface $request,
185
  array $options,
66
  throw new \OutOfBoundsException('Mock queue is empty');
67
  }
68
 
69
+ if (isset($options['delay'])) {
70
  usleep($options['delay'] * 1000);
71
  }
72
 
175
  return count($this->queue);
176
  }
177
 
 
 
 
 
 
178
  private function invokeStats(
179
  RequestInterface $request,
180
  array $options,
vendor/guzzlehttp/guzzle/src/Handler/Proxy.php CHANGED
@@ -1,55 +1,55 @@
1
- <?php
2
- namespace GuzzleHttp\Handler;
3
-
4
- use GuzzleHttp\RequestOptions;
5
- use Psr\Http\Message\RequestInterface;
6
-
7
- /**
8
- * Provides basic proxies for handlers.
9
- */
10
- class Proxy
11
- {
12
- /**
13
- * Sends synchronous requests to a specific handler while sending all other
14
- * requests to another handler.
15
- *
16
- * @param callable $default Handler used for normal responses
17
- * @param callable $sync Handler used for synchronous responses.
18
- *
19
- * @return callable Returns the composed handler.
20
- */
21
- public static function wrapSync(
22
- callable $default,
23
- callable $sync
24
- ) {
25
- return function (RequestInterface $request, array $options) use ($default, $sync) {
26
- return empty($options[RequestOptions::SYNCHRONOUS])
27
- ? $default($request, $options)
28
- : $sync($request, $options);
29
- };
30
- }
31
-
32
- /**
33
- * Sends streaming requests to a streaming compatible handler while sending
34
- * all other requests to a default handler.
35
- *
36
- * This, for example, could be useful for taking advantage of the
37
- * performance benefits of curl while still supporting true streaming
38
- * through the StreamHandler.
39
- *
40
- * @param callable $default Handler used for non-streaming responses
41
- * @param callable $streaming Handler used for streaming responses
42
- *
43
- * @return callable Returns the composed handler.
44
- */
45
- public static function wrapStreaming(
46
- callable $default,
47
- callable $streaming
48
- ) {
49
- return function (RequestInterface $request, array $options) use ($default, $streaming) {
50
- return empty($options['stream'])
51
- ? $default($request, $options)
52
- : $streaming($request, $options);
53
- };
54
- }
55
- }
1
+ <?php
2
+ namespace GuzzleHttp\Handler;
3
+
4
+ use GuzzleHttp\RequestOptions;
5
+ use Psr\Http\Message\RequestInterface;
6
+
7
+ /**
8
+ * Provides basic proxies for handlers.
9
+ */
10
+ class Proxy
11
+ {
12
+ /**
13
+ * Sends synchronous requests to a specific handler while sending all other
14
+ * requests to another handler.
15
+ *
16
+ * @param callable $default Handler used for normal responses
17
+ * @param callable $sync Handler used for synchronous responses.
18
+ *
19
+ * @return callable Returns the composed handler.
20
+ */
21
+ public static function wrapSync(
22
+ callable $default,
23
+ callable $sync
24
+ ) {
25
+ return function (RequestInterface $request, array $options) use ($default, $sync) {
26
+ return empty($options[RequestOptions::SYNCHRONOUS])
27
+ ? $default($request, $options)
28
+ : $sync($request, $options);
29
+ };
30
+ }
31
+
32
+ /**
33
+ * Sends streaming requests to a streaming compatible handler while sending
34
+ * all other requests to a default handler.
35
+ *
36
+ * This, for example, could be useful for taking advantage of the
37
+ * performance benefits of curl while still supporting true streaming
38
+ * through the StreamHandler.
39
+ *
40
+ * @param callable $default Handler used for non-streaming responses
41
+ * @param callable $streaming Handler used for streaming responses
42
+ *
43
+ * @return callable Returns the composed handler.
44
+ */
45
+ public static function wrapStreaming(
46
+ callable $default,
47
+ callable $streaming
48
+ ) {
49
+ return function (RequestInterface $request, array $options) use ($default, $streaming) {
50
+ return empty($options['stream'])
51
+ ? $default($request, $options)
52
+ : $streaming($request, $options);
53
+ };
54
+ }
55
+ }
vendor/guzzlehttp/guzzle/src/Handler/StreamHandler.php CHANGED
@@ -1,8 +1,8 @@
1
  <?php
2
  namespace GuzzleHttp\Handler;
3
 
4
- use GuzzleHttp\Exception\ConnectException;
5
  use GuzzleHttp\Exception\RequestException;
 
6
  use GuzzleHttp\Promise\FulfilledPromise;
7
  use GuzzleHttp\Promise\PromiseInterface;
8
  use GuzzleHttp\Psr7;
1
  <?php
2
  namespace GuzzleHttp\Handler;
3
 
 
4
  use GuzzleHttp\Exception\RequestException;
5
+ use GuzzleHttp\Exception\ConnectException;
6
  use GuzzleHttp\Promise\FulfilledPromise;
7
  use GuzzleHttp\Promise\PromiseInterface;
8
  use GuzzleHttp\Psr7;
vendor/guzzlehttp/guzzle/src/HandlerStack.php CHANGED
@@ -1,9 +1,7 @@
1
  <?php
2
  namespace GuzzleHttp;
3
 
4
- use GuzzleHttp\Promise\PromiseInterface;
5
  use Psr\Http\Message\RequestInterface;
6
- use Psr\Http\Message\ResponseInterface;
7
 
8
  /**
9
  * Creates a composed Guzzle handler function by stacking middlewares on top of
@@ -11,7 +9,7 @@ use Psr\Http\Message\ResponseInterface;
11
  */
12
  class HandlerStack
13
  {
14
- /** @var callable|null */
15
  private $handler;
16
 
17
  /** @var array */
@@ -61,8 +59,6 @@ class HandlerStack
61
  *
62
  * @param RequestInterface $request
63
  * @param array $options
64
- *
65
- * @return ResponseInterface|PromiseInterface
66
  */
67
  public function __invoke(RequestInterface $request, array $options)
68
  {
1
  <?php
2
  namespace GuzzleHttp;
3
 
 
4
  use Psr\Http\Message\RequestInterface;
 
5
 
6
  /**
7
  * Creates a composed Guzzle handler function by stacking middlewares on top of
9
  */
10
  class HandlerStack
11
  {
12
+ /** @var callable */
13
  private $handler;
14
 
15
  /** @var array */
59
  *
60
  * @param RequestInterface $request
61
  * @param array $options
 
 
62
  */
63
  public function __invoke(RequestInterface $request, array $options)
64
  {
vendor/guzzlehttp/guzzle/src/MessageFormatter.php CHANGED
@@ -168,11 +168,6 @@ class MessageFormatter
168
  );
169
  }
170
 
171
- /**
172
- * Get headers from message as string
173
- *
174
- * @return string
175
- */
176
  private function headers(MessageInterface $message)
177
  {
178
  $result = '';
168
  );
169
  }
170
 
 
 
 
 
 
171
  private function headers(MessageInterface $message)
172
  {
173
  $result = '';
vendor/guzzlehttp/guzzle/src/Middleware.php CHANGED
@@ -1,254 +1,254 @@
1
- <?php
2
- namespace GuzzleHttp;
3
-
4
- use GuzzleHttp\Cookie\CookieJarInterface;
5
- use GuzzleHttp\Exception\RequestException;
6
- use GuzzleHttp\Promise\RejectedPromise;
7
- use GuzzleHttp\Psr7;
8
- use Psr\Http\Message\ResponseInterface;
9
- use Psr\Log\LoggerInterface;
10
-
11
- /**
12
- * Functions used to create and wrap handlers with handler middleware.
13
- */
14
- final class Middleware
15
- {
16
- /**
17
- * Middleware that adds cookies to requests.
18
- *
19
- * The options array must be set to a CookieJarInterface in order to use
20
- * cookies. This is typically handled for you by a client.
21
- *
22
- * @return callable Returns a function that accepts the next handler.
23
- */
24
- public static function cookies()
25
- {
26
- return function (callable $handler) {
27
- return function ($request, array $options) use ($handler) {
28
- if (empty($options['cookies'])) {
29
- return $handler($request, $options);
30
- } elseif (!($options['cookies'] instanceof CookieJarInterface)) {
31
- throw new \InvalidArgumentException('cookies must be an instance of GuzzleHttp\Cookie\CookieJarInterface');
32
- }
33
- $cookieJar = $options['cookies'];
34
- $request = $cookieJar->withCookieHeader($request);
35
- return $handler($request, $options)
36
- ->then(
37
- function ($response) use ($cookieJar, $request) {
38
- $cookieJar->extractCookies($request, $response);
39
- return $response;
40
- }
41
- );
42
- };
43
- };
44
- }
45
-
46
- /**
47
- * Middleware that throws exceptions for 4xx or 5xx responses when the
48
- * "http_error" request option is set to true.
49
- *
50
- * @return callable Returns a function that accepts the next handler.
51
- */
52
- public static function httpErrors()
53
- {
54
- return function (callable $handler) {
55
- return function ($request, array $options) use ($handler) {
56
- if (empty($options['http_errors'])) {
57
- return $handler($request, $options);
58
- }
59
- return $handler($request, $options)->then(
60
- function (ResponseInterface $response) use ($request) {
61
- $code = $response->getStatusCode();
62
- if ($code < 400) {
63
- return $response;
64
- }
65
- throw RequestException::create($request, $response);
66
- }
67
- );
68
- };
69
- };
70
- }
71
-
72
- /**
73
- * Middleware that pushes history data to an ArrayAccess container.
74
- *
75
- * @param array|\ArrayAccess $container Container to hold the history (by reference).
76
- *
77
- * @return callable Returns a function that accepts the next handler.
78
- * @throws \InvalidArgumentException if container is not an array or ArrayAccess.
79
- */
80
- public static function history(&$container)
81
- {
82
- if (!is_array($container) && !$container instanceof \ArrayAccess) {
83
- throw new \InvalidArgumentException('history container must be an array or object implementing ArrayAccess');
84
- }
85
-
86
- return function (callable $handler) use (&$container) {
87
- return function ($request, array $options) use ($handler, &$container) {
88
- return $handler($request, $options)->then(
89
- function ($value) use ($request, &$container, $options) {
90
- $container[] = [
91
- 'request' => $request,
92
- 'response' => $value,
93
- 'error' => null,
94
- 'options' => $options
95
- ];
96
- return $value;
97
- },
98
- function ($reason) use ($request, &$container, $options) {
99
- $container[] = [
100
- 'request' => $request,
101
- 'response' => null,
102
- 'error' => $reason,
103
- 'options' => $options
104
- ];
105
- return \GuzzleHttp\Promise\rejection_for($reason);
106
- }
107
- );
108
- };
109
- };
110
- }
111
-
112
- /**
113
- * Middleware that invokes a callback before and after sending a request.
114
- *
115
- * The provided listener cannot modify or alter the response. It simply
116
- * "taps" into the chain to be notified before returning the promise. The
117
- * before listener accepts a request and options array, and the after
118
- * listener accepts a request, options array, and response promise.
119
- *
120
- * @param callable $before Function to invoke before forwarding the request.
121
- * @param callable $after Function invoked after forwarding.
122
- *
123
- * @return callable Returns a function that accepts the next handler.
124
- */
125
- public static function tap(callable $before = null, callable $after = null)
126
- {
127
- return function (callable $handler) use ($before, $after) {
128
- return function ($request, array $options) use ($handler, $before, $after) {
129
- if ($before) {
130
- $before($request, $options);
131
- }
132
- $response = $handler($request, $options);
133
- if ($after) {
134
- $after($request, $options, $response);
135
- }
136
- return $response;
137
- };
138
- };
139
- }
140
-
141
- /**
142
- * Middleware that handles request redirects.
143
- *
144
- * @return callable Returns a function that accepts the next handler.
145
- */
146
- public static function redirect()
147
- {
148
- return function (callable $handler) {
149
- return new RedirectMiddleware($handler);
150
- };
151
- }
152
-
153
- /**
154
- * Middleware that retries requests based on the boolean result of
155
- * invoking the provided "decider" function.
156
- *
157
- * If no delay function is provided, a simple implementation of exponential
158
- * backoff will be utilized.
159
- *
160
- * @param callable $decider Function that accepts the number of retries,
161
- * a request, [response], and [exception] and
162
- * returns true if the request is to be retried.
163
- * @param callable $delay Function that accepts the number of retries and
164
- * returns the number of milliseconds to delay.
165
- *
166
- * @return callable Returns a function that accepts the next handler.
167
- */
168
- public static function retry(callable $decider, callable $delay = null)
169
- {
170
- return function (callable $handler) use ($decider, $delay) {
171
- return new RetryMiddleware($decider, $handler, $delay);
172
- };
173
- }
174
-
175
- /**
176
- * Middleware that logs requests, responses, and errors using a message
177
- * formatter.
178
- *
179
- * @param LoggerInterface $logger Logs messages.
180
- * @param MessageFormatter $formatter Formatter used to create message strings.
181
- * @param string $logLevel Level at which to log requests.
182
- *
183
- * @return callable Returns a function that accepts the next handler.
184
- */
185
- public static function log(LoggerInterface $logger, MessageFormatter $formatter, $logLevel = 'info' /* \Psr\Log\LogLevel::INFO */)
186
- {
187
- return function (callable $handler) use ($logger, $formatter, $logLevel) {
188
- return function ($request, array $options) use ($handler, $logger, $formatter, $logLevel) {
189
- return $handler($request, $options)->then(
190
- function ($response) use ($logger, $request, $formatter, $logLevel) {
191
- $message = $formatter->format($request, $response);
192
- $logger->log($logLevel, $message);
193
- return $response;
194
- },
195
- function ($reason) use ($logger, $request, $formatter) {
196
- $response = $reason instanceof RequestException
197
- ? $reason->getResponse()
198
- : null;
199
- $message = $formatter->format($request, $response, $reason);
200
- $logger->notice($message);
201
- return \GuzzleHttp\Promise\rejection_for($reason);
202
- }
203
- );
204
- };
205
- };
206
- }
207
-
208
- /**
209
- * This middleware adds a default content-type if possible, a default
210
- * content-length or transfer-encoding header, and the expect header.
211
- *
212
- * @return callable
213
- */
214
- public static function prepareBody()
215
- {
216
- return function (callable $handler) {
217
- return new PrepareBodyMiddleware($handler);
218
- };
219
- }
220
-
221
- /**
222
- * Middleware that applies a map function to the request before passing to
223
- * the next handler.
224
- *
225
- * @param callable $fn Function that accepts a RequestInterface and returns
226
- * a RequestInterface.
227
- * @return callable
228
- */
229
- public static function mapRequest(callable $fn)
230
- {
231
- return function (callable $handler) use ($fn) {
232
- return function ($request, array $options) use ($handler, $fn) {
233
- return $handler($fn($request), $options);
234
- };
235
- };
236
- }
237
-
238
- /**
239
- * Middleware that applies a map function to the resolved promise's
240
- * response.
241
- *
242
- * @param callable $fn Function that accepts a ResponseInterface and
243
- * returns a ResponseInterface.
244
- * @return callable
245
- */
246
- public static function mapResponse(callable $fn)
247
- {
248
- return function (callable $handler) use ($fn) {
249
- return function ($request, array $options) use ($handler, $fn) {
250
- return $handler($request, $options)->then($fn);
251
- };
252
- };
253
- }
254
- }
1
+ <?php
2
+ namespace GuzzleHttp;
3
+
4
+ use GuzzleHttp\Cookie\CookieJarInterface;
5
+ use GuzzleHttp\Exception\RequestException;
6
+ use GuzzleHttp\Promise\RejectedPromise;
7
+ use GuzzleHttp\Psr7;
8
+ use Psr\Http\Message\ResponseInterface;
9
+ use Psr\Log\LoggerInterface;
10
+
11
+ /**
12
+ * Functions used to create and wrap handlers with handler middleware.
13
+ */
14
+ final class Middleware
15
+ {
16
+ /**
17
+ * Middleware that adds cookies to requests.
18
+ *
19
+ * The options array must be set to a CookieJarInterface in order to use
20
+ * cookies. This is typically handled for you by a client.
21
+ *
22
+ * @return callable Returns a function that accepts the next handler.
23
+ */
24
+ public static function cookies()
25
+ {
26
+ return function (callable $handler) {
27
+ return function ($request, array $options) use ($handler) {
28
+ if (empty($options['cookies'])) {
29
+ return $handler($request, $options);
30
+ } elseif (!($options['cookies'] instanceof CookieJarInterface)) {
31
+ throw new \InvalidArgumentException('cookies must be an instance of GuzzleHttp\Cookie\CookieJarInterface');
32
+ }
33
+ $cookieJar = $options['cookies'];
34
+ $request = $cookieJar->withCookieHeader($request);
35
+ return $handler($request, $options)
36
+ ->then(
37
+ function ($response) use ($cookieJar, $request) {
38
+ $cookieJar->extractCookies($request, $response);
39
+ return $response;
40
+ }
41
+ );
42
+ };
43
+ };
44
+ }
45
+
46
+ /**
47
+ * Middleware that throws exceptions for 4xx or 5xx responses when the
48
+ * "http_error" request option is set to true.
49
+ *
50
+ * @return callable Returns a function that accepts the next handler.
51
+ */
52
+ public static function httpErrors()
53
+ {
54
+ return function (callable $handler) {
55
+ return function ($request, array $options) use ($handler) {
56
+ if (empty($options['http_errors'])) {
57
+ return $handler($request, $options);
58
+ }
59
+ return $handler($request, $options)->then(
60
+ function (ResponseInterface $response) use ($request) {
61
+ $code = $response->getStatusCode();
62
+ if ($code < 400) {
63
+ return $response;
64
+ }
65
+ throw RequestException::create($request, $response);
66
+ }
67
+ );
68
+ };
69
+ };
70
+ }
71
+
72
+ /**
73
+ * Middleware that pushes history data to an ArrayAccess container.
74
+ *
75
+ * @param array|\ArrayAccess $container Container to hold the history (by reference).
76
+ *
77
+ * @return callable Returns a function that accepts the next handler.
78
+ * @throws \InvalidArgumentException if container is not an array or ArrayAccess.
79
+ */
80
+ public static function history(&$container)
81
+ {
82
+ if (!is_array($container) && !$container instanceof \ArrayAccess) {
83
+ throw new \InvalidArgumentException('history container must be an array or object implementing ArrayAccess');
84
+ }
85
+
86
+ return function (callable $handler) use (&$container) {
87
+ return function ($request, array $options) use ($handler, &$container) {
88
+ return $handler($request, $options)->then(
89
+ function ($value) use ($request, &$container, $options) {
90
+ $container[] = [
91
+ 'request' => $request,
92
+ 'response' => $value,
93
+ 'error' => null,
94
+ 'options' => $options
95
+ ];
96
+ return $value;
97
+ },
98
+ function ($reason) use ($request, &$container, $options) {
99
+ $container[] = [
100
+ 'request' => $request,
101
+ 'response' => null,
102
+ 'error' => $reason,
103
+ 'options' => $options
104
+ ];
105
+ return \GuzzleHttp\Promise\rejection_for($reason);
106
+ }
107
+ );
108
+ };
109
+ };
110
+ }
111
+
112
+ /**
113
+ * Middleware that invokes a callback before and after sending a request.
114
+ *
115
+ * The provided listener cannot modify or alter the response. It simply
116
+ * "taps" into the chain to be notified before returning the promise. The
117
+ * before listener accepts a request and options array, and the after
118
+ * listener accepts a request, options array, and response promise.
119
+ *
120
+ * @param callable $before Function to invoke before forwarding the request.
121
+ * @param callable $after Function invoked after forwarding.
122
+ *
123
+ * @return callable Returns a function that accepts the next handler.
124
+ */
125
+ public static function tap(callable $before = null, callable $after = null)
126
+ {
127
+ return function (callable $handler) use ($before, $after) {
128
+ return function ($request, array $options) use ($handler, $before, $after) {
129
+ if ($before) {
130
+ $before($request, $options);
131
+ }
132
+ $response = $handler($request, $options);
133
+ if ($after) {
134
+ $after($request, $options, $response);
135
+ }
136
+ return $response;
137
+ };
138
+ };
139
+ }
140
+
141
+ /**
142
+ * Middleware that handles request redirects.
143
+ *
144
+ * @return callable Returns a function that accepts the next handler.
145
+ */
146
+ public static function redirect()
147
+ {
148
+ return function (callable $handler) {
149
+ return new RedirectMiddleware($handler);
150
+ };
151
+ }
152
+
153
+ /**
154
+ * Middleware that retries requests based on the boolean result of
155
+ * invoking the provided "decider" function.
156
+ *
157
+ * If no delay function is provided, a simple implementation of exponential
158
+ * backoff will be utilized.
159
+ *
160
+ * @param callable $decider Function that accepts the number of retries,
161
+ * a request, [response], and [exception] and
162
+ * returns true if the request is to be retried.
163
+ * @param callable $delay Function that accepts the number of retries and
164
+ * returns the number of milliseconds to delay.
165
+ *
166
+ * @return callable Returns a function that accepts the next handler.
167
+ */
168
+ public static function retry(callable $decider, callable $delay = null)
169
+ {
170
+ return function (callable $handler) use ($decider, $delay) {
171
+ return new RetryMiddleware($decider, $handler, $delay);
172
+ };
173
+ }
174
+
175
+ /**
176
+ * Middleware that logs requests, responses, and errors using a message
177
+ * formatter.
178
+ *
179
+ * @param LoggerInterface $logger Logs messages.
180
+ * @param MessageFormatter $formatter Formatter used to create message strings.
181
+ * @param string $logLevel Level at which to log requests.
182
+ *
183
+ * @return callable Returns a function that accepts the next handler.
184
+ */
185
+ public static function log(LoggerInterface $logger, MessageFormatter $formatter, $logLevel = 'info' /* \Psr\Log\LogLevel::INFO */)
186
+ {
187
+ return function (callable $handler) use ($logger, $formatter, $logLevel) {
188
+ return function ($request, array $options) use ($handler, $logger, $formatter, $logLevel) {
189
+ return $handler($request, $options)->then(
190
+ function ($response) use ($logger, $request, $formatter, $logLevel) {
191
+ $message = $formatter->format($request, $response);
192
+ $logger->log($logLevel, $message);
193
+ return $response;
194
+ },
195
+ function ($reason) use ($logger, $request, $formatter) {
196
+ $response = $reason instanceof RequestException
197
+ ? $reason->getResponse()
198
+ : null;
199
+ $message = $formatter->format($request, $response, $reason);
200
+ $logger->notice($message);
201
+ return \GuzzleHttp\Promise\rejection_for($reason);
202
+ }
203
+ );
204
+ };
205
+ };
206
+ }
207
+
208
+ /**
209
+ * This middleware adds a default content-type if possible, a default
210
+ * content-length or transfer-encoding header, and the expect header.
211
+ *
212
+ * @return callable
213
+ */
214
+ public static function prepareBody()
215
+ {
216
+ return function (callable $handler) {
217
+ return new PrepareBodyMiddleware($handler);
218
+ };
219
+ }
220
+
221
+ /**
222
+ * Middleware that applies a map function to the request before passing to
223
+ * the next handler.
224
+ *
225
+ * @param callable $fn Function that accepts a RequestInterface and returns
226
+ * a RequestInterface.
227
+ * @return callable
228
+ */
229
+ public static function mapRequest(callable $fn)
230
+ {
231
+ return function (callable $handler) use ($fn) {
232
+ return function ($request, array $options) use ($handler, $fn) {
233
+ return $handler($fn($request), $options);
234
+ };
235
+ };
236
+ }
237
+
238
+ /**
239
+ * Middleware that applies a map function to the resolved promise's
240
+ * response.
241
+ *
242
+ * @param callable $fn Function that accepts a ResponseInterface and
243
+ * returns a ResponseInterface.
244
+ * @return callable
245
+ */
246
+ public static function mapResponse(callable $fn)
247
+ {
248
+ return function (callable $handler) use ($fn) {
249
+ return function ($request, array $options) use ($handler, $fn) {
250
+ return $handler($request, $options)->then($fn);
251
+ };
252
+ };
253
+ }
254
+ }
vendor/guzzlehttp/guzzle/src/Pool.php CHANGED
@@ -1,9 +1,9 @@
1
  <?php
2
  namespace GuzzleHttp;
3
 
4
- use GuzzleHttp\Promise\EachPromise;
5
  use GuzzleHttp\Promise\PromisorInterface;
6
  use Psr\Http\Message\RequestInterface;
 
7
 
8
  /**
9
  * Sends an iterator of requests concurrently using a capped pool size.
@@ -69,10 +69,6 @@ class Pool implements PromisorInterface
69
  $this->each = new EachPromise($requests(), $config);
70
  }
71
 
72
- /**
73
- * Get promise
74
- * @return GuzzleHttp\Promise\Promise
75
- */
76
  public function promise()
77
  {
78
  return $this->each->promise();
@@ -110,11 +106,6 @@ class Pool implements PromisorInterface
110
  return $res;
111
  }
112
 
113
- /**
114
- * Execute callback(s)
115
- *
116
- * @return void
117
- */
118
  private static function cmpCallback(array &$options, $name, array &$results)
119
  {
120
  if (!isset($options[$name])) {
1
  <?php
2
  namespace GuzzleHttp;
3
 
 
4
  use GuzzleHttp\Promise\PromisorInterface;
5
  use Psr\Http\Message\RequestInterface;
6
+ use GuzzleHttp\Promise\EachPromise;
7
 
8
  /**
9
  * Sends an iterator of requests concurrently using a capped pool size.
69
  $this->each = new EachPromise($requests(), $config);
70
  }
71
 
 
 
 
 
72
  public function promise()
73
  {
74
  return $this->each->promise();
106
  return $res;
107
  }
108
 
 
 
 
 
 
109
  private static function cmpCallback(array &$options, $name, array &$results)
110
  {
111
  if (!isset($options[$name])) {
vendor/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php CHANGED
@@ -66,11 +66,6 @@ class PrepareBodyMiddleware
66
  return $fn(Psr7\modify_request($request, $modify), $options);
67
  }
68
 
69
- /**
70
- * Add expect header
71
- *
72
- * @return void
73
- */
74
  private function addExpectHeader(
75
  RequestInterface $request,
76
  array $options,
66
  return $fn(Psr7\modify_request($request, $modify), $options);
67
  }
68
 
 
 
 
 
 
69
  private function addExpectHeader(
70
  RequestInterface $request,
71
  array $options,
vendor/guzzlehttp/guzzle/src/RedirectMiddleware.php CHANGED
@@ -76,7 +76,7 @@ class RedirectMiddleware
76
  /**
77
  * @param RequestInterface $request
78
  * @param array $options
79
- * @param ResponseInterface $response
80
  *
81
  * @return ResponseInterface|PromiseInterface
82
  */
@@ -118,11 +118,6 @@ class RedirectMiddleware
118
  return $promise;
119
  }
120
 
121
- /**
122
- * Enable tracking on promise.
123
- *
124
- * @return PromiseInterface
125
- */
126
  private function withTracking(PromiseInterface $promise, $uri, $statusCode)
127
  {
128
  return $promise->then(
@@ -140,13 +135,6 @@ class RedirectMiddleware
140
  );
141
  }
142
 
143
- /**
144
- * Check for too many redirects
145
- *
146
- * @return void
147
- *
148
- * @throws TooManyRedirectsException Too many redirects.
149
- */
150
  private function guardMax(RequestInterface $request, array &$options)
151
  {
152
  $current = isset($options['__redirect_count'])
@@ -184,7 +172,7 @@ class RedirectMiddleware
184
  // would do.
185
  $statusCode = $response->getStatusCode();
186
  if ($statusCode == 303 ||
187
- ($statusCode <= 302 && !$options['allow_redirects']['strict'])
188
  ) {
189
  $modify['method'] = 'GET';
190
  $modify['body'] = '';
76
  /**
77
  * @param RequestInterface $request
78
  * @param array $options
79
+ * @param ResponseInterface|PromiseInterface $response
80
  *
81
  * @return ResponseInterface|PromiseInterface
82
  */
118
  return $promise;
119
  }
120
 
 
 
 
 
 
121
  private function withTracking(PromiseInterface $promise, $uri, $statusCode)
122
  {
123
  return $promise->then(
135
  );
136
  }
137
 
 
 
 
 
 
 
 
138
  private function guardMax(RequestInterface $request, array &$options)
139
  {
140
  $current = isset($options['__redirect_count'])
172
  // would do.
173
  $statusCode = $response->getStatusCode();
174
  if ($statusCode == 303 ||
175
+ ($statusCode <= 302 && $request->getBody() && !$options['allow_redirects']['strict'])
176
  ) {
177
  $modify['method'] = 'GET';
178
  $modify['body'] = '';
vendor/guzzlehttp/guzzle/src/RequestOptions.php CHANGED
@@ -132,14 +132,6 @@ final class RequestOptions
132
  */
133
  const HTTP_ERRORS = 'http_errors';
134
 
135
- /**
136
- * idn: (bool|int, default=true) A combination of IDNA_* constants for
137
- * idn_to_ascii() PHP's function (see "options" parameter). Set to false to
138
- * disable IDN support completely, or to true to use the default
139
- * configuration (IDNA_DEFAULT constant).
140
- */
141
- const IDN_CONVERSION = 'idn_conversion';
142
-
143
  /**
144
  * json: (mixed) Adds JSON data to a request. The provided value is JSON
145
  * encoded and a Content-Type header of application/json will be added to
132
  */
133
  const HTTP_ERRORS = 'http_errors';
134
 
 
 
 
 
 
 
 
 
135
  /**
136
  * json: (mixed) Adds JSON data to a request. The provided value is JSON
137
  * encoded and a Content-Type header of application/json will be added to
vendor/guzzlehttp/guzzle/src/RetryMiddleware.php CHANGED
@@ -47,11 +47,11 @@ class RetryMiddleware
47
  *
48
  * @param int $retries
49
  *
50
- * @return int milliseconds.
51
  */
52
  public static function exponentialDelay($retries)
53
  {
54
- return (int) pow(2, $retries - 1) * 1000;
55
  }
56
 
57
  /**
@@ -74,11 +74,6 @@ class RetryMiddleware
74
  );
75
  }
76
 
77
- /**
78
- * Execute fulfilled closure
79
- *
80
- * @return mixed
81
- */
82
  private function onFulfilled(RequestInterface $req, array $options)
83
  {
84
  return function ($value) use ($req, $options) {
@@ -95,11 +90,6 @@ class RetryMiddleware
95
  };
96
  }
97
 
98
- /**
99
- * Execute rejected closure
100
- *
101
- * @return callable
102
- */
103
  private function onRejected(RequestInterface $req, array $options)
104
  {
105
  return function ($reason) use ($req, $options) {
@@ -116,9 +106,6 @@ class RetryMiddleware
116
  };
117
  }
118
 
119
- /**
120
- * @return self
121
- */
122
  private function doRetry(RequestInterface $request, array $options, ResponseInterface $response = null)
123
  {
124
  $options['delay'] = call_user_func($this->delay, ++$options['retries'], $response);
47
  *
48
  * @param int $retries
49
  *
50
+ * @return int
51
  */
52
  public static function exponentialDelay($retries)
53
  {
54
+ return (int) pow(2, $retries - 1);
55
  }
56
 
57
  /**
74
  );
75
  }
76
 
 
 
 
 
 
77
  private function onFulfilled(RequestInterface $req, array $options)
78
  {
79
  return function ($value) use ($req, $options) {
90
  };
91
  }
92
 
 
 
 
 
 
93
  private function onRejected(RequestInterface $req, array $options)
94
  {
95
  return function ($reason) use ($req, $options) {
106
  };
107
  }
108
 
 
 
 
109
  private function doRetry(RequestInterface $request, array $options, ResponseInterface $response = null)
110
  {
111
  $options['delay'] = call_user_func($this->delay, ++$options['retries'], $response);
vendor/guzzlehttp/guzzle/src/TransferStats.php CHANGED
@@ -18,11 +18,11 @@ final class TransferStats
18
  private $handlerErrorData;
19
 
20
  /**
21
- * @param RequestInterface $request Request that was sent.
22
- * @param ResponseInterface|null $response Response received (if any)
23
- * @param float|null $transferTime Total handler transfer time.
24
- * @param mixed $handlerErrorData Handler error data.
25
- * @param array $handlerStats Handler specific stats.
26
  */
27
  public function __construct(
28
  RequestInterface $request,
@@ -93,7 +93,7 @@ final class TransferStats
93
  /**
94
  * Get the estimated time the request was being transferred by the handler.
95
  *
96
- * @return float|null Time in seconds.
97
  */
98
  public function getTransferTime()
99
  {
18
  private $handlerErrorData;
19
 
20
  /**
21
+ * @param RequestInterface $request Request that was sent.
22
+ * @param ResponseInterface $response Response received (if any)
23
+ * @param float|null $transferTime Total handler transfer time.
24
+ * @param mixed $handlerErrorData Handler error data.
25
+ * @param array $handlerStats Handler specific stats.
26
  */
27
  public function __construct(
28
  RequestInterface $request,
93
  /**
94
  * Get the estimated time the request was being transferred by the handler.
95
  *
96
+ * @return float Time in seconds.
97
  */
98
  public function getTransferTime()
99
  {
vendor/guzzlehttp/guzzle/src/UriTemplate.php CHANGED
@@ -1,237 +1,237 @@
1
- <?php
2
- namespace GuzzleHttp;
3
-
4
- /**
5
- * Expands URI templates. Userland implementation of PECL uri_template.
6
- *
7
- * @link http://tools.ietf.org/html/rfc6570
8
- */
9
- class UriTemplate
10
- {
11
- /** @var string URI template */
12
- private $template;
13
-
14
- /** @var array Variables to use in the template expansion */
15
- private $variables;
16
-
17
- /** @var array Hash for quick operator lookups */
18
- private static $operatorHash = [
19
- '' => ['prefix' => '', 'joiner' => ',', 'query' => false],
20
- '+' => ['prefix' => '', 'joiner' => ',', 'query' => false],
21
- '#' => ['prefix' => '#', 'joiner' => ',', 'query' => false],
22
- '.' => ['prefix' => '.', 'joiner' => '.', 'query' => false],
23
- '/' => ['prefix' => '/', 'joiner' => '/', 'query' => false],
24
- ';' => ['prefix' => ';', 'joiner' => ';', 'query' => true],
25
- '?' => ['prefix' => '?', 'joiner' => '&', 'query' => true],
26
- '&' => ['prefix' => '&', 'joiner' => '&', 'query' => true]
27
- ];
28
-
29
- /** @var array Delimiters */
30
- private static $delims = [':', '/', '?', '#', '[', ']', '@', '!', '$',
31
- '&', '\'', '(', ')', '*', '+', ',', ';', '='];
32
-
33
- /** @var array Percent encoded delimiters */
34
- private static $delimsPct = ['%3A', '%2F', '%3F', '%23', '%5B', '%5D',
35
- '%40', '%21', '%24', '%26', '%27', '%28', '%29', '%2A', '%2B', '%2C',
36
- '%3B', '%3D'];
37
-
38
- public function expand($template, array $variables)
39
- {
40
- if (false === strpos($template, '{')) {
41
- return $template;
42
- }
43
-
44
- $this->template = $template;
45
- $this->variables = $variables;
46
-
47
- return preg_replace_callback(
48
- '/\{([^\}]+)\}/',
49
- [$this, 'expandMatch'],
50
- $this->template
51
- );
52
- }
53
-
54
- /**
55
- * Parse an expression into parts
56
- *
57
- * @param string $expression Expression to parse
58
- *
59
- * @return array Returns an associative array of parts
60
- */
61
- private function parseExpression($expression)
62
- {
63
- $result = [];
64
-
65
- if (isset(self::$operatorHash[$expression[0]])) {
66
- $result['operator'] = $expression[0];
67
- $expression = substr($expression, 1);
68
- } else {
69
- $result['operator'] = '';
70
- }
71
-
72
- foreach (explode(',', $expression) as $value) {
73
- $value = trim($value);
74
- $varspec = [];
75
- if ($colonPos = strpos($value, ':')) {
76
- $varspec['value'] = substr($value, 0, $colonPos);
77
- $varspec['modifier'] = ':';
78
- $varspec['position'] = (int) substr($value, $colonPos + 1);
79
- } elseif (substr($value, -1) === '*') {
80
- $varspec['modifier'] = '*';
81
- $varspec['value'] = substr($value, 0, -1);
82
- } else {
83
- $varspec['value'] = (string) $value;
84
- $varspec['modifier'] = '';
85
- }
86
- $result['values'][] = $varspec;
87
- }
88
-
89
- return $result;
90
- }
91
-
92
- /**
93
- * Process an expansion
94
- *
95
- * @param array $matches Matches met in the preg_replace_callback
96
- *
97
- * @return string Returns the replacement string
98
- */
99
- private function expandMatch(array $matches)
100
- {
101
- static $rfc1738to3986 = ['+' => '%20', '%7e' => '~'];
102
-
103
- $replacements = [];
104
- $parsed = self::parseExpression($matches[1]);
105
- $prefix = self::$operatorHash[$parsed['operator']]['prefix'];
106
- $joiner = self::$operatorHash[$parsed['operator']]['joiner'];
107
- $useQuery = self::$operatorHash[$parsed['operator']]['query'];
108
-
109
- foreach ($parsed['values'] as $value) {
110
- if (!isset($this->variables[$value['value']])) {
111
- continue;
112
- }
113
-
114
- $variable = $this->variables[$value['value']];
115
- $actuallyUseQuery = $useQuery;
116
- $expanded = '';
117
-
118
- if (is_array($variable)) {
119
- $isAssoc = $this->isAssoc($variable);
120
- $kvp = [];
121
- foreach ($variable as $key => $var) {
122
- if ($isAssoc) {
123
- $key = rawurlencode($key);
124
- $isNestedArray = is_array($var);
125
- } else {
126
- $isNestedArray = false;
127
- }
128
-
129
- if (!$isNestedArray) {
130
- $var = rawurlencode($var);
131
- if ($parsed['operator'] === '+' ||
132
- $parsed['operator'] === '#'
133
- ) {
134
- $var = $this->decodeReserved($var);
135
- }
136
- }
137
-
138
- if ($value['modifier'] === '*') {
139
- if ($isAssoc) {
140
- if ($isNestedArray) {
141
- // Nested arrays must allow for deeply nested
142
- // structures.
143
- $var = strtr(
144
- http_build_query([$key => $var]),
145
- $rfc1738to3986
146
- );
147
- } else {
148
- $var = $key . '=' . $var;
149
- }
150
- } elseif ($key > 0 && $actuallyUseQuery) {
151
- $var = $value['value'] . '=' . $var;
152
- }
153
- }
154
-
155
- $kvp[$key] = $var;
156
- }
157
-
158
- if (empty($variable)) {
159
- $actuallyUseQuery = false;
160
- } elseif ($value['modifier'] === '*') {
161
- $expanded = implode($joiner, $kvp);
162
- if ($isAssoc) {
163
- // Don't prepend the value name when using the explode
164
- // modifier with an associative array.
165
- $actuallyUseQuery = false;
166
- }
167
- } else {
168
- if ($isAssoc) {
169
- // When an associative array is encountered and the
170
- // explode modifier is not set, then the result must be
171
- // a comma separated list of keys followed by their
172
- // respective values.
173
- foreach ($kvp as $k => &$v) {
174
- $v = $k . ',' . $v;
175
- }
176
- }
177
- $expanded = implode(',', $kvp);
178
- }
179
- } else {
180
- if ($value['modifier'] === ':') {
181
- $variable = substr($variable, 0, $value['position']);
182
- }
183
- $expanded = rawurlencode($variable);
184
- if ($parsed['operator'] === '+' || $parsed['operator'] === '#') {
185
- $expanded = $this->decodeReserved($expanded);
186
- }
187
- }
188
-
189
- if ($actuallyUseQuery) {
190
- if (!$expanded && $joiner !== '&') {
191
- $expanded = $value['value'];
192
- } else {
193
- $expanded = $value['value'] . '=' . $expanded;
194
- }
195
- }
196
-
197
- $replacements[] = $expanded;
198
- }
199
-
200
- $ret = implode($joiner, $replacements);
201
- if ($ret && $prefix) {
202
- return $prefix . $ret;
203
- }
204
-
205
- return $ret;
206
- }
207
-
208
- /**
209
- * Determines if an array is associative.
210
- *
211
- * This makes the assumption that input arrays are sequences or hashes.
212
- * This assumption is a tradeoff for accuracy in favor of speed, but it
213
- * should work in almost every case where input is supplied for a URI
214
- * template.
215
- *
216
- * @param array $array Array to check
217
- *
218
- * @return bool
219
- */
220
- private function isAssoc(array $array)
221
- {
222
- return $array && array_keys($array)[0] !== 0;
223
- }
224
-
225
- /**
226
- * Removes percent encoding on reserved characters (used with + and #
227
- * modifiers).
228
- *
229
- * @param string $string String to fix
230
- *
231
- * @return string
232
- */
233
- private function decodeReserved($string)
234
- {
235
- return str_replace(self::$delimsPct, self::$delims, $string);
236
- }
237
- }
1
+ <?php
2
+ namespace GuzzleHttp;
3
+
4
+ /**
5
+ * Expands URI templates. Userland implementation of PECL uri_template.
6
+ *
7
+ * @link http://tools.ietf.org/html/rfc6570
8
+ */
9
+ class UriTemplate
10
+ {
11
+ /** @var string URI template */
12
+ private $template;
13
+
14
+ /** @var array Variables to use in the template expansion */
15
+ private $variables;
16
+
17
+ /** @var array Hash for quick operator lookups */
18
+ private static $operatorHash = [
19
+ '' => ['prefix' => '', 'joiner' => ',', 'query' => false],
20
+ '+' => ['prefix' => '', 'joiner' => ',', 'query' => false],
21
+ '#' => ['prefix' => '#', 'joiner' => ',', 'query' => false],
22
+ '.' => ['prefix' => '.', 'joiner' => '.', 'query' => false],
23
+ '/' => ['prefix' => '/', 'joiner' => '/', 'query' => false],
24
+ ';' => ['prefix' => ';', 'joiner' => ';', 'query' => true],
25
+ '?' => ['prefix' => '?', 'joiner' => '&', 'query' => true],
26
+ '&' => ['prefix' => '&', 'joiner' => '&', 'query' => true]
27
+ ];
28
+
29
+ /** @var array Delimiters */
30
+ private static $delims = [':', '/', '?', '#', '[', ']', '@', '!', '$',
31
+ '&', '\'', '(', ')', '*', '+', ',', ';', '='];
32
+
33
+ /** @var array Percent encoded delimiters */
34
+ private static $delimsPct = ['%3A', '%2F', '%3F', '%23', '%5B', '%5D',
35
+ '%40', '%21', '%24', '%26', '%27', '%28', '%29', '%2A', '%2B', '%2C',
36
+ '%3B', '%3D'];
37
+
38
+ public function expand($template, array $variables)
39
+ {
40
+ if (false === strpos($template, '{')) {
41
+ return $template;
42
+ }
43
+
44
+ $this->template = $template;
45
+ $this->variables = $variables;
46
+
47
+ return preg_replace_callback(
48
+ '/\{([^\}]+)\}/',
49
+ [$this, 'expandMatch'],
50
+ $this->template
51
+ );
52
+ }
53
+
54
+ /**
55
+ * Parse an expression into parts
56
+ *
57
+ * @param string $expression Expression to parse
58
+ *
59
+ * @return array Returns an associative array of parts
60
+ */
61
+ private function parseExpression($expression)
62
+ {
63
+ $result = [];
64
+
65
+ if (isset(self::$operatorHash[$expression[0]])) {
66
+ $result['operator'] = $expression[0];
67
+ $expression = substr($expression, 1);
68
+ } else {
69
+ $result['operator'] = '';
70
+ }
71
+
72
+ foreach (explode(',', $expression) as $value) {
73
+ $value = trim($value);
74
+ $varspec = [];
75
+ if ($colonPos = strpos($value, ':')) {
76
+ $varspec['value'] = substr($value, 0, $colonPos);
77
+ $varspec['modifier'] = ':';
78
+ $varspec['position'] = (int) substr($value, $colonPos + 1);
79
+ } elseif (substr($value, -1) === '*') {
80
+ $varspec['modifier'] = '*';
81
+ $varspec['value'] = substr($value, 0, -1);
82
+ } else {
83
+ $varspec['value'] = (string) $value;
84
+ $varspec['modifier'] = '';
85
+ }
86
+ $result['values'][] = $varspec;
87
+ }
88
+
89
+ return $result;
90
+ }
91
+
92
+ /**
93
+ * Process an expansion
94
+ *
95
+ * @param array $matches Matches met in the preg_replace_callback
96
+ *
97
+ * @return string Returns the replacement string
98
+ */
99
+ private function expandMatch(array $matches)
100
+ {
101
+ static $rfc1738to3986 = ['+' => '%20', '%7e' => '~'];
102
+
103
+ $replacements = [];
104
+ $parsed = self::parseExpression($matches[1]);
105
+ $prefix = self::$operatorHash[$parsed['operator']]['prefix'];
106
+ $joiner = self::$operatorHash[$parsed['operator']]['joiner'];
107
+ $useQuery = self::$operatorHash[$parsed['operator']]['query'];
108
+
109
+ foreach ($parsed['values'] as $value) {
110
+ if (!isset($this->variables[$value['value']])) {
111
+ continue;
112
+ }
113
+
114
+ $variable = $this->variables[$value['value']];
115
+ $actuallyUseQuery = $useQuery;
116
+ $expanded = '';
117
+
118
+ if (is_array($variable)) {
119
+ $isAssoc = $this->isAssoc($variable);
120
+ $kvp = [];
121
+ foreach ($variable as $key => $var) {
122
+ if ($isAssoc) {
123
+ $key = rawurlencode($key);
124
+ $isNestedArray = is_array($var);
125
+ } else {
126
+ $isNestedArray = false;
127
+ }
128
+
129
+ if (!$isNestedArray) {
130
+ $var = rawurlencode($var);
131
+ if ($parsed['operator'] === '+' ||
132
+ $parsed['operator'] === '#'
133
+ ) {
134
+ $var = $this->decodeReserved($var);
135
+ }
136
+ }
137
+
138
+ if ($value['modifier'] === '*') {
139
+ if ($isAssoc) {
140
+ if ($isNestedArray) {
141
+ // Nested arrays must allow for deeply nested
142
+ // structures.
143
+ $var = strtr(
144
+ http_build_query([$key => $var]),
145
+ $rfc1738to3986
146
+ );
147
+ } else {
148
+ $var = $key . '=' . $var;
149
+ }
150
+ } elseif ($key > 0 && $actuallyUseQuery) {
151
+ $var = $value['value'] . '=' . $var;
152
+ }
153
+ }
154
+
155
+ $kvp[$key] = $var;
156
+ }
157
+
158
+ if (empty($variable)) {
159
+ $actuallyUseQuery = false;
160
+ } elseif ($value['modifier'] === '*') {
161
+ $expanded = implode($joiner, $kvp);
162
+ if ($isAssoc) {
163
+ // Don't prepend the value name when using the explode
164
+ // modifier with an associative array.
165
+ $actuallyUseQuery = false;
166
+ }
167
+ } else {
168
+ if ($isAssoc) {
169
+ // When an associative array is encountered and the
170
+ // explode modifier is not set, then the result must be
171
+ // a comma separated list of keys followed by their
172
+ // respective values.
173
+ foreach ($kvp as $k => &$v) {
174
+ $v = $k . ',' . $v;
175
+ }
176
+ }
177
+ $expanded = implode(',', $kvp);
178
+ }
179
+ } else {
180
+ if ($value['modifier'] === ':') {
181
+ $variable = substr($variable, 0, $value['position']);
182
+ }
183
+ $expanded = rawurlencode($variable);
184
+ if ($parsed['operator'] === '+' || $parsed['operator'] === '#') {
185
+ $expanded = $this->decodeReserved($expanded);
186
+ }
187
+ }
188
+
189
+ if ($actuallyUseQuery) {
190
+ if (!$expanded && $joiner !== '&') {
191
+ $expanded = $value['value'];
192
+ } else {
193
+ $expanded = $value['value'] . '=' . $expanded;
194
+ }
195
+ }
196
+
197
+ $replacements[] = $expanded;
198
+ }
199
+
200
+ $ret = implode($joiner, $replacements);
201
+ if ($ret && $prefix) {
202
+ return $prefix . $ret;
203
+ }
204
+
205
+ return $ret;
206
+ }
207
+
208
+ /**
209
+ * Determines if an array is associative.
210
+ *
211
+ * This makes the assumption that input arrays are sequences or hashes.
212
+ * This assumption is a tradeoff for accuracy in favor of speed, but it
213
+ * should work in almost every case where input is supplied for a URI
214
+ * template.
215
+ *
216
+ * @param array $array Array to check
217
+ *
218
+ * @return bool
219
+ */
220
+ private function isAssoc(array $array)
221
+ {
222
+ return $array && array_keys($array)[0] !== 0;
223
+ }
224
+
225
+ /**
226
+ * Removes percent encoding on reserved characters (used with + and #
227
+ * modifiers).
228
+ *
229
+ * @param string $string String to fix
230
+ *
231
+ * @return string
232
+ */
233
+ private function decodeReserved($string)
234
+ {
235
+ return str_replace(self::$delimsPct, self::$delims, $string);
236
+ }
237
+ }
vendor/guzzlehttp/guzzle/src/functions.php CHANGED
@@ -56,7 +56,7 @@ function describe_type($input)
56
  /**
57
  * Parses an array of header lines into an associative array of headers.
58
  *
59
- * @param iterable $lines Header lines array of strings in the following
60
  * format: "Name: Value"
61
  * @return array
62
  */
56
  /**
57
  * Parses an array of header lines into an associative array of headers.
58
  *
59
+ * @param array $lines Header lines array of strings in the following
60
  * format: "Name: Value"
61
  * @return array
62
  */
vendor/guzzlehttp/guzzle/src/functions_include.php CHANGED
@@ -1,6 +1,6 @@
1
- <?php
2
-
3
- // Don't redefine the functions if included multiple times.
4
- if (!function_exists('GuzzleHttp\uri_template')) {
5
- require __DIR__ . '/functions.php';
6
- }
1
+ <?php
2
+
3
+ // Don't redefine the functions if included multiple times.
4
+ if (!function_exists('GuzzleHttp\uri_template')) {
5
+ require __DIR__ . '/functions.php';
6
+ }
vendor/monolog/monolog/src/Monolog/Formatter/FluentdFormatter.php CHANGED
@@ -11,8 +11,6 @@
11
 
12
  namespace Monolog\Formatter;
13
 
14
- use Monolog\Utils;
15
-
16
  /**
17
  * Class FluentdFormatter
18
  *
@@ -73,7 +71,7 @@ class FluentdFormatter implements FormatterInterface
73
  $message['level_name'] = $record['level_name'];
74
  }
75
 
76
- return Utils::jsonEncode(array($tag, $record['datetime']->getTimestamp(), $message));
77
  }
78
 
79
  public function formatBatch(array $records)
11
 
12
  namespace Monolog\Formatter;
13
 
 
 
14
  /**
15
  * Class FluentdFormatter
16
  *
71
  $message['level_name'] = $record['level_name'];
72
  }
73
 
74
+ return json_encode(array($tag, $record['datetime']->getTimestamp(), $message));
75
  }
76
 
77
  public function formatBatch(array $records)
vendor/monolog/monolog/src/Monolog/Formatter/HtmlFormatter.php CHANGED
@@ -11,7 +11,6 @@
11
  namespace Monolog\Formatter;
12
 
13
  use Monolog\Logger;
14
- use Monolog\Utils;
15
 
16
  /**
17
  * Formats incoming records into an HTML table
@@ -134,9 +133,9 @@ class HtmlFormatter extends NormalizerFormatter
134
 
135
  $data = $this->normalize($data);
136
  if (version_compare(PHP_VERSION, '5.4.0', '>=')) {
137
- return Utils::jsonEncode($data, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE, true);
138
  }
139
 
140
- return str_replace('\\/', '/', Utils::jsonEncode($data, null, true));
141
  }
142
  }
11
  namespace Monolog\Formatter;
12
 
13
  use Monolog\Logger;
 
14
 
15
  /**
16
  * Formats incoming records into an HTML table
133
 
134
  $data = $this->normalize($data);
135
  if (version_compare(PHP_VERSION, '5.4.0', '>=')) {
136
+ return json_encode($data, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);
137
  }
138
 
139
+ return str_replace('\\/', '/', json_encode($data));
140
  }
141
  }
vendor/monolog/monolog/src/Monolog/Formatter/JsonFormatter.php CHANGED
@@ -145,7 +145,7 @@ class JsonFormatter extends NormalizerFormatter
145
  return 'Over 9 levels deep, aborting normalization';
146
  }
147
 
148
- if (is_array($data)) {
149
  $normalized = array();
150
 
151
  $count = 1;
@@ -186,7 +186,7 @@ class JsonFormatter extends NormalizerFormatter
186
  $data = array(
187
  'class' => Utils::getClass($e),
188
  'message' => $e->getMessage(),
189
- 'code' => (int) $e->getCode(),
190
  'file' => $e->getFile().':'.$e->getLine(),
191
  );
192
 
145
  return 'Over 9 levels deep, aborting normalization';
146
  }
147
 
148
+ if (is_array($data) || $data instanceof \Traversable) {
149
  $normalized = array();
150
 
151
  $count = 1;
186
  $data = array(
187
  'class' => Utils::getClass($e),
188
  'message' => $e->getMessage(),
189
+ 'code' => $e->getCode(),
190
  'file' => $e->getFile().':'.$e->getLine(),
191
  );
192
 
vendor/monolog/monolog/src/Monolog/Formatter/LineFormatter.php CHANGED
@@ -163,7 +163,7 @@ class LineFormatter extends NormalizerFormatter
163
  return $this->toJson($data, true);
164
  }
165
 
166
- return str_replace('\\/', '/', $this->toJson($data, true));
167
  }
168
 
169
  protected function replaceNewlines($str)
163
  return $this->toJson($data, true);
164
  }
165
 
166
+ return str_replace('\\/', '/', @json_encode($data));
167
  }
168
 
169
  protected function replaceNewlines($str)
vendor/monolog/monolog/src/Monolog/Formatter/MongoDBFormatter.php CHANGED
@@ -87,7 +87,7 @@ class MongoDBFormatter implements FormatterInterface
87
  $formattedException = array(
88
  'class' => Utils::getClass($exception),
89
  'message' => $exception->getMessage(),
90
- 'code' => (int) $exception->getCode(),
91
  'file' => $exception->getFile() . ':' . $exception->getLine(),
92
  );
93
 
87
  $formattedException = array(
88
  'class' => Utils::getClass($exception),
89
  'message' => $exception->getMessage(),
90
+ 'code' => $exception->getCode(),
91
  'file' => $exception->getFile() . ':' . $exception->getLine(),
92
  );
93
 
vendor/monolog/monolog/src/Monolog/Formatter/NormalizerFormatter.php CHANGED
@@ -129,7 +129,7 @@ class NormalizerFormatter implements FormatterInterface
129
  $data = array(
130
  'class' => Utils::getClass($e),
131
  'message' => $e->getMessage(),
132
- 'code' => (int) $e->getCode(),
133
  'file' => $e->getFile().':'.$e->getLine(),
134
  );
135
 
@@ -142,8 +142,8 @@ class NormalizerFormatter implements FormatterInterface
142
  $data['faultactor'] = $e->faultactor;
143
  }
144
 
145
- if (isset($e->detail) && (is_string($e->detail) || is_object($e->detail) || is_array($e->detail))) {
146
- $data['detail'] = is_string($e->detail) ? $e->detail : reset($e->detail);
147
  }
148
  }
149
 
@@ -171,6 +171,127 @@ class NormalizerFormatter implements FormatterInterface
171
  */
172
  protected function toJson($data, $ignoreErrors = false)
173
  {
174
- return Utils::jsonEncode($data, null, $ignoreErrors);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
175
  }
176
  }
129
  $data = array(
130
  'class' => Utils::getClass($e),
131
  'message' => $e->getMessage(),
132
+ 'code' => $e->getCode(),
133
  'file' => $e->getFile().':'.$e->getLine(),
134
  );
135
 
142
  $data['faultactor'] = $e->faultactor;
143
  }
144
 
145
+ if (isset($e->detail)) {
146
+ $data['detail'] = $e->detail;
147
  }
148
  }
149
 
171
  */
172
  protected function toJson($data, $ignoreErrors = false)
173
  {
174
+ // suppress json_encode errors since it's twitchy with some inputs
175
+ if ($ignoreErrors) {
176
+ return @$this->jsonEncode($data);
177
+ }
178
+
179
+ $json = $this->jsonEncode($data);
180
+
181
+ if ($json === false) {
182
+ $json = $this->handleJsonError(json_last_error(), $data);
183
+ }
184
+
185
+ return $json;
186
+ }
187
+
188
+ /**
189
+ * @param mixed $data
190
+ * @return string JSON encoded data or null on failure
191
+ */
192
+ private function jsonEncode($data)
193
+ {
194
+ if (version_compare(PHP_VERSION, '5.4.0', '>=')) {
195
+ return json_encode($data, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);
196
+ }
197
+
198
+ return json_encode($data);
199
+ }
200
+
201
+ /**
202
+ * Handle a json_encode failure.
203
+ *
204
+ * If the failure is due to invalid string encoding, try to clean the
205
+ * input and encode again. If the second encoding attempt fails, the
206
+ * inital error is not encoding related or the input can't be cleaned then
207
+ * raise a descriptive exception.
208
+ *
209
+ * @param int $code return code of json_last_error function
210
+ * @param mixed $data data that was meant to be encoded
211
+ * @throws \RuntimeException if failure can't be corrected
212
+ * @return string JSON encoded data after error correction
213
+ */
214
+ private function handleJsonError($code, $data)
215
+ {
216
+ if ($code !== JSON_ERROR_UTF8) {
217
+ $this->throwEncodeError($code, $data);
218
+ }
219
+
220
+ if (is_string($data)) {
221
+ $this->detectAndCleanUtf8($data);
222
+ } elseif (is_array($data)) {
223
+ array_walk_recursive($data, array($this, 'detectAndCleanUtf8'));
224
+ } else {
225
+ $this->throwEncodeError($code, $data);
226
+ }
227
+
228
+ $json = $this->jsonEncode($data);
229
+
230
+ if ($json === false) {
231
+ $this->throwEncodeError(json_last_error(), $data);
232
+ }
233
+
234
+ return $json;
235
+ }
236
+
237
+ /**
238
+ * Throws an exception according to a given code with a customized message
239
+ *
240
+ * @param int $code return code of json_last_error function
241
+ * @param mixed $data data that was meant to be encoded
242
+ * @throws \RuntimeException
243
+ */
244
+ private function throwEncodeError($code, $data)
245
+ {
246
+ switch ($code) {
247
+ case JSON_ERROR_DEPTH:
248
+ $msg = 'Maximum stack depth exceeded';
249
+ break;
250
+ case JSON_ERROR_STATE_MISMATCH:
251
+ $msg = 'Underflow or the modes mismatch';
252
+ break;
253
+ case JSON_ERROR_CTRL_CHAR:
254
+ $msg = 'Unexpected control character found';
255
+ break;
256
+ case JSON_ERROR_UTF8:
257
+ $msg = 'Malformed UTF-8 characters, possibly incorrectly encoded';
258
+ break;
259
+ default:
260
+ $msg = 'Unknown error';
261
+ }
262
+
263
+ throw new \RuntimeException('JSON encoding failed: '.$msg.'. Encoding: '.var_export($data, true));
264
+ }
265
+
266
+ /**
267
+ * Detect invalid UTF-8 string characters and convert to valid UTF-8.
268
+ *
269
+ * Valid UTF-8 input will be left unmodified, but strings containing
270
+ * invalid UTF-8 codepoints will be reencoded as UTF-8 with an assumed
271
+ * original encoding of ISO-8859-15. This conversion may result in
272
+ * incorrect output if the actual encoding was not ISO-8859-15, but it
273
+ * will be clean UTF-8 output and will not rely on expensive and fragile
274
+ * detection algorithms.
275
+ *
276
+ * Function converts the input in place in the passed variable so that it
277
+ * can be used as a callback for array_walk_recursive.
278
+ *
279
+ * @param mixed &$data Input to check and convert if needed
280
+ * @private
281
+ */
282
+ public function detectAndCleanUtf8(&$data)
283
+ {
284
+ if (is_string($data) && !preg_match('//u', $data)) {
285
+ $data = preg_replace_callback(
286
+ '/[\x80-\xFF]+/',
287
+ function ($m) { return utf8_encode($m[0]); },
288
+ $data
289
+ );
290
+ $data = str_replace(
291
+ array('¤', '¦', '¨', '´', '¸', '¼', '½', '¾'),
292
+ array('€', 'Š', 'š', 'Ž', 'ž', 'Œ', 'œ', 'Ÿ'),
293
+ $data
294
+ );
295
+ }
296
  }
297
  }
vendor/monolog/monolog/src/Monolog/Handler/BrowserConsoleHandler.php CHANGED
@@ -164,22 +164,21 @@ class BrowserConsoleHandler extends AbstractProcessingHandler
164
 
165
  private static function handleStyles($formatted)
166
  {
167
- $args = array();
168
  $format = '%c' . $formatted;
169
  preg_match_all('/\[\[(.*?)\]\]\{([^}]*)\}/s', $format, $matches, PREG_OFFSET_CAPTURE | PREG_SET_ORDER);
170
 
171
  foreach (array_reverse($matches) as $match) {
172
- $args[] = '"font-weight: normal"';
173
  $args[] = static::quote(static::handleCustomStyles($match[2][0], $match[1][0]));
 
174
 
175
  $pos = $match[0][1];
176
  $format = substr($format, 0, $pos) . '%c' . $match[1][0] . '%c' . substr($format, $pos + strlen($match[0][0]));
177
  }
178
 
179
- $args[] = static::quote('font-weight: normal');
180
- $args[] = static::quote($format);
181
 
182
- return array_reverse($args);
183
  }
184
 
185
  private static function handleCustomStyles($style, $string)
164
 
165
  private static function handleStyles($formatted)
166
  {
167
+ $args = array(static::quote('font-weight: normal'));
168
  $format = '%c' . $formatted;
169
  preg_match_all('/\[\[(.*?)\]\]\{([^}]*)\}/s', $format, $matches, PREG_OFFSET_CAPTURE | PREG_SET_ORDER);
170
 
171
  foreach (array_reverse($matches) as $match) {
 
172
  $args[] = static::quote(static::handleCustomStyles($match[2][0], $match[1][0]));
173
+ $args[] = '"font-weight: normal"';
174
 
175
  $pos = $match[0][1];
176
  $format = substr($format, 0, $pos) . '%c' . $match[1][0] . '%c' . substr($format, $pos + strlen($match[0][0]));
177
  }
178
 
179
+ array_unshift($args, static::quote($format));
 
180
 
181
+ return $args;
182
  }
183
 
184
  private static function handleCustomStyles($style, $string)
vendor/monolog/monolog/src/Monolog/Handler/BufferHandler.php CHANGED
@@ -13,7 +13,6 @@ namespace Monolog\Handler;
13
 
14
  use Monolog\Logger;
15
  use Monolog\ResettableInterface;
16
- use Monolog\Formatter\FormatterInterface;
17
 
18
  /**
19
  * Buffers all records until closing the handler and then pass them as batch.
@@ -127,22 +126,4 @@ class BufferHandler extends AbstractHandler
127
  $this->handler->reset();
128
  }
129
  }
130
-
131
- /**
132
- * {@inheritdoc}
133
- */
134
- public function setFormatter(FormatterInterface $formatter)
135
- {
136
- $this->handler->setFormatter($formatter);
137
-
138
- return $this;
139
- }
140
-
141
- /**
142
- * {@inheritdoc}
143
- */
144
- public function getFormatter()
145
- {
146
- return $this->handler->getFormatter();
147
- }
148
  }
13
 
14
  use Monolog\Logger;
15
  use Monolog\ResettableInterface;
 
16
 
17
  /**
18
  * Buffers all records until closing the handler and then pass them as batch.
126
  $this->handler->reset();
127
  }
128
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
129
  }
vendor/monolog/monolog/src/Monolog/Handler/ChromePHPHandler.php CHANGED
@@ -13,7 +13,6 @@ namespace Monolog\Handler;
13
 
14
  use Monolog\Formatter\ChromePHPFormatter;
15
  use Monolog\Logger;
16
- use Monolog\Utils;
17
 
18
  /**
19
  * Handler sending logs to the ChromePHP extension (http://www.chromephp.com/)
@@ -135,7 +134,7 @@ class ChromePHPHandler extends AbstractProcessingHandler
135
  self::$json['request_uri'] = isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : '';
136
  }
137
 
138
- $json = Utils::jsonEncode(self::$json, null, true);
139
  $data = base64_encode(utf8_encode($json));
140
  if (strlen($data) > 3 * 1024) {
141
  self::$overflowed = true;
@@ -150,7 +149,7 @@ class ChromePHPHandler extends AbstractProcessingHandler
150
  'extra' => array(),
151
  );
152
  self::$json['rows'][count(self::$json['rows']) - 1] = $this->getFormatter()->format($record);
153
- $json = Utils::jsonEncode(self::$json, null, true);
154
  $data = base64_encode(utf8_encode($json));
155
  }
156
 
13
 
14
  use Monolog\Formatter\ChromePHPFormatter;
15
  use Monolog\Logger;
 
16
 
17
  /**
18
  * Handler sending logs to the ChromePHP extension (http://www.chromephp.com/)
134
  self::$json['request_uri'] = isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : '';
135
  }
136
 
137
+ $json = @json_encode(self::$json);
138
  $data = base64_encode(utf8_encode($json));
139
  if (strlen($data) > 3 * 1024) {
140
  self::$overflowed = true;
149
  'extra' => array(),
150
  );
151
  self::$json['rows'][count(self::$json['rows']) - 1] = $this->getFormatter()->format($record);
152
+ $json = @json_encode(self::$json);
153
  $data = base64_encode(utf8_encode($json));
154
  }
155
 
vendor/monolog/monolog/src/Monolog/Handler/CubeHandler.php CHANGED
@@ -12,7 +12,6 @@
12
  namespace Monolog\Handler;
13
 
14
  use Monolog\Logger;
15
- use Monolog\Utils;
16
 
17
  /**
18
  * Logs to Cube.
@@ -120,9 +119,9 @@ class CubeHandler extends AbstractProcessingHandler
120
  $data['data']['level'] = $record['level'];
121
 
122
  if ($this->scheme === 'http') {
123
- $this->writeHttp(Utils::jsonEncode($data));
124
  } else {
125
- $this->writeUdp(Utils::jsonEncode($data));
126
  }
127
  }
128
 
12
  namespace Monolog\Handler;
13
 
14
  use Monolog\Logger;
 
15
 
16
  /**
17
  * Logs to Cube.
119
  $data['data']['level'] = $record['level'];
120
 
121
  if ($this->scheme === 'http') {
122
+ $this->writeHttp(json_encode($data));
123
  } else {
124
+ $this->writeUdp(json_encode($data));
125
  }
126
  }
127
 
vendor/monolog/monolog/src/Monolog/Handler/FilterHandler.php CHANGED
@@ -12,7 +12,6 @@
12
  namespace Monolog\Handler;
13
 
14
  use Monolog\Logger;
15
- use Monolog\Formatter\FormatterInterface;
16
 
17
  /**
18
  * Simple handler wrapper that filters records based on a list of levels
@@ -46,7 +45,7 @@ class FilterHandler extends AbstractHandler
46
  protected $bubble;
47
 
48
  /**
49
- * @param callable|HandlerInterface $handler Handler or factory callable($record|null, $filterHandler).
50
  * @param int|array $minLevelOrList A list of levels to accept or a minimum level if maxLevel is provided
51
  * @param int $maxLevel Maximum level to accept, only used if $minLevelOrList is not an array
52
  * @param bool $bubble Whether the messages that are handled can bubble up the stack or not
@@ -105,13 +104,21 @@ class FilterHandler extends AbstractHandler
105
  return false;
106
  }
107
 
 
 
 
 
 
 
 
 
108
  if ($this->processors) {
109
  foreach ($this->processors as $processor) {
110
  $record = call_user_func($processor, $record);
111
  }
112
  }
113
 
114
- $this->getHandler($record)->handle($record);
115
 
116
  return false === $this->bubble;
117
  }
@@ -128,43 +135,6 @@ class FilterHandler extends AbstractHandler
128
  }
129
  }
130
 
131
- $this->getHandler($filtered[count($filtered) - 1])->handleBatch($filtered);
132
- }
133
-
134
- /**
135
- * Return the nested handler
136
- *
137
- * If the handler was provided as a factory callable, this will trigger the handler's instantiation.
138
- *
139
- * @return HandlerInterface
140
- */
141
- public function getHandler(array $record = null)
142
- {
143
- if (!$this->handler instanceof HandlerInterface) {
144
- $this->handler = call_user_func($this->handler, $record, $this);
145
- if (!$this->handler instanceof HandlerInterface) {
146
- throw new \RuntimeException("The factory callable should return a HandlerInterface");
147
- }
148
- }
149
-
150
- return $this->handler;
151
- }
152
-
153
- /**
154
- * {@inheritdoc}
155
- */
156
- public function setFormatter(FormatterInterface $formatter)
157
- {
158
- $this->getHandler()->setFormatter($formatter);
159
-
160
- return $this;
161
- }
162
-
163
- /**
164
- * {@inheritdoc}
165
- */
166
- public function getFormatter()
167
- {
168
- return $this->getHandler()->getFormatter();
169
  }
170
  }
12
  namespace Monolog\Handler;
13
 
14
  use Monolog\Logger;
 
15
 
16
  /**
17
  * Simple handler wrapper that filters records based on a list of levels
45
  protected $bubble;
46
 
47
  /**
48
+ * @param callable|HandlerInterface $handler Handler or factory callable($record, $this).
49
  * @param int|array $minLevelOrList A list of levels to accept or a minimum level if maxLevel is provided
50
  * @param int $maxLevel Maximum level to accept, only used if $minLevelOrList is not an array
51
  * @param bool $bubble Whether the messages that are handled can bubble up the stack or not
104
  return false;
105
  }
106
 
107
+ // The same logic as in FingersCrossedHandler
108
+ if (!$this->handler instanceof HandlerInterface) {
109
+ $this->handler = call_user_func($this->handler, $record, $this);
110
+ if (!$this->handler instanceof HandlerInterface) {
111
+ throw new \RuntimeException("The factory callable should return a HandlerInterface");
112
+ }
113
+ }
114
+
115
  if ($this->processors) {
116
  foreach ($this->processors as $processor) {
117
  $record = call_user_func($processor, $record);
118
  }
119
  }
120
 
121
+ $this->handler->handle($record);
122
 
123
  return false === $this->bubble;
124
  }
135
  }
136
  }
137
 
138
+ $this->handler->handleBatch($filtered);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
139
  }
140
  }
vendor/monolog/monolog/src/Monolog/Handler/FingersCrossedHandler.php CHANGED
@@ -15,7 +15,6 @@ use Monolog\Handler\FingersCrossed\ErrorLevelActivationStrategy;
15
  use Monolog\Handler\FingersCrossed\ActivationStrategyInterface;
16
  use Monolog\Logger;
17
  use Monolog\ResettableInterface;
18
- use Monolog\Formatter\FormatterInterface;
19
 
20
  /**
21
  * Buffers all records until a certain level is reached
@@ -40,7 +39,7 @@ class FingersCrossedHandler extends AbstractHandler
40
  protected $passthruLevel;
41
 
42
  /**
43
- * @param callable|HandlerInterface $handler Handler or factory callable($record|null, $fingersCrossedHandler).
44
  * @param int|ActivationStrategyInterface $activationStrategy Strategy which determines when this handler takes action
45
  * @param int $bufferSize How many entries should be buffered at most, beyond that the oldest items are removed from the buffer.
46
  * @param bool $bubble Whether the messages that are handled can bubble up the stack or not
@@ -89,7 +88,15 @@ class FingersCrossedHandler extends AbstractHandler
89
  if ($this->stopBuffering) {
90
  $this->buffering = false;
91
  }
92
- $this->getHandler(end($this->buffer) ?: null)->handleBatch($this->buffer);
 
 
 
 
 
 
 
 
93
  $this->buffer = array();
94
  }
95
 
@@ -113,7 +120,7 @@ class FingersCrossedHandler extends AbstractHandler
113
  $this->activate();
114
  }
115
  } else {
116
- $this->getHandler($record)->handle($record);
117
  }
118
 
119
  return false === $this->bubble;
@@ -133,8 +140,8 @@ class FingersCrossedHandler extends AbstractHandler
133
 
134
  parent::reset();
135
 
136
- if ($this->getHandler() instanceof ResettableInterface) {
137
- $this->getHandler()->reset();
138
  }
139
  }
140
 
@@ -160,48 +167,11 @@ class FingersCrossedHandler extends AbstractHandler
160
  return $record['level'] >= $level;
161
  });
162
  if (count($this->buffer) > 0) {
163
- $this->getHandler(end($this->buffer) ?: null)->handleBatch($this->buffer);
164
  }
165
  }
166
 
167
  $this->buffer = array();
168
  $this->buffering = true;
169
  }
170
-
171
- /**
172
- * Return the nested handler
173
- *
174
- * If the handler was provided as a factory callable, this will trigger the handler's instantiation.
175
- *
176
- * @return HandlerInterface
177
- */
178
- public function getHandler(array $record = null)
179
- {
180
- if (!$this->handler instanceof HandlerInterface) {
181
- $this->handler = call_user_func($this->handler, $record, $this);
182
- if (!$this->handler instanceof HandlerInterface) {
183
- throw new \RuntimeException("The factory callable should return a HandlerInterface");
184
- }
185
- }
186
-
187
- return $this->handler;
188
- }
189
-
190
- /**
191
- * {@inheritdoc}
192
- */
193
- public function setFormatter(FormatterInterface $formatter)
194
- {
195
- $this->getHandler()->setFormatter($formatter);
196
-
197
- return $this;
198
- }
199
-
200
- /**
201
- * {@inheritdoc}
202
- */
203
- public function getFormatter()
204
- {
205
- return $this->getHandler()->getFormatter();
206
- }
207
  }
15
  use Monolog\Handler\FingersCrossed\ActivationStrategyInterface;
16
  use Monolog\Logger;
17
  use Monolog\ResettableInterface;
 
18
 
19
  /**
20
  * Buffers all records until a certain level is reached
39
  protected $passthruLevel;
40
 
41
  /**
42
+ * @param callable|HandlerInterface $handler Handler or factory callable($record, $fingersCrossedHandler).
43
  * @param int|ActivationStrategyInterface $activationStrategy Strategy which determines when this handler takes action
44
  * @param int $bufferSize How many entries should be buffered at most, beyond that the oldest items are removed from the buffer.
45
  * @param bool $bubble Whether the messages that are handled can bubble up the stack or not
88
  if ($this->stopBuffering) {
89
  $this->buffering = false;
90
  }
91
+ if (!$this->handler instanceof HandlerInterface) {
92
+ $record = end($this->buffer) ?: null;
93
+
94
+ $this->handler = call_user_func($this->handler, $record, $this);
95
+ if (!$this->handler instanceof HandlerInterface) {
96
+ throw new \RuntimeException("The factory callable should return a HandlerInterface");
97
+ }
98
+ }
99
+ $this->handler->handleBatch($this->buffer);
100
  $this->buffer = array();
101
  }
102
 
120
  $this->activate();
121
  }
122
  } else {
123
+ $this->handler->handle($record);
124
  }
125
 
126
  return false === $this->bubble;
140
 
141
  parent::reset();
142
 
143
+ if ($this->handler instanceof ResettableInterface) {
144
+ $this->handler->reset();
145
  }
146
  }
147
 
167
  return $record['level'] >= $level;
168
  });
169
  if (count($this->buffer) > 0) {
170
+ $this->handler->handleBatch($this->buffer);
171
  }
172
  }
173
 
174
  $this->buffer = array();
175
  $this->buffering = true;
176
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
177
  }
vendor/monolog/monolog/src/Monolog/Handler/FlowdockHandler.php CHANGED
@@ -12,7 +12,6 @@
12
  namespace Monolog\Handler;
13
 
14
  use Monolog\Logger;
15
- use Monolog\Utils;
16
  use Monolog\Formatter\FlowdockFormatter;
17
  use Monolog\Formatter\FormatterInterface;
18
 
@@ -106,7 +105,7 @@ class FlowdockHandler extends SocketHandler
106
  */
107
  private function buildContent($record)
108
  {
109
- return Utils::jsonEncode($record['formatted']['flowdock']);
110
  }
111
 
112
  /**
12
  namespace Monolog\Handler;
13
 
14
  use Monolog\Logger;
 
15
  use Monolog\Formatter\FlowdockFormatter;
16
  use Monolog\Formatter\FormatterInterface;
17
 
105
  */
106
  private function buildContent($record)
107
  {
108
+ return json_encode($record['formatted']['flowdock']);
109
  }
110
 
111
  /**
vendor/monolog/monolog/src/Monolog/Handler/IFTTTHandler.php CHANGED
@@ -12,7 +12,6 @@
12
  namespace Monolog\Handler;
13
 
14
  use Monolog\Logger;
15
- use Monolog\Utils;
16
 
17
  /**
18
  * IFTTTHandler uses cURL to trigger IFTTT Maker actions
@@ -54,7 +53,7 @@ class IFTTTHandler extends AbstractProcessingHandler
54
  "value2" => $record["level_name"],
55
  "value3" => $record["message"],
56
  );
57
- $postString = Utils::jsonEncode($postData);
58
 
59
  $ch = curl_init();
60
  curl_setopt($ch, CURLOPT_URL, "https://maker.ifttt.com/trigger/" . $this->eventName . "/with/key/" . $this->secretKey);
12
  namespace Monolog\Handler;
13
 
14
  use Monolog\Logger;
 
15
 
16
  /**
17
  * IFTTTHandler uses cURL to trigger IFTTT Maker actions
53
  "value2" => $record["level_name"],
54
  "value3" => $record["message"],
55
  );
56
+ $postString = json_encode($postData);
57
 
58
  $ch = curl_init();
59
  curl_setopt($ch, CURLOPT_URL, "https://maker.ifttt.com/trigger/" . $this->eventName . "/with/key/" . $this->secretKey);
vendor/monolog/monolog/src/Monolog/Handler/NewRelicHandler.php CHANGED
@@ -12,7 +12,6 @@
12
  namespace Monolog\Handler;
13
 
14
  use Monolog\Logger;
15
- use Monolog\Utils;
16
  use Monolog\Formatter\NormalizerFormatter;
17
 
18
  /**
@@ -191,7 +190,7 @@ class NewRelicHandler extends AbstractProcessingHandler
191
  if (null === $value || is_scalar($value)) {
192
  newrelic_add_custom_parameter($key, $value);
193
  } else {
194
- newrelic_add_custom_parameter($key, Utils::jsonEncode($value, null, true));
195
  }
196
  }
197
 
12
  namespace Monolog\Handler;
13
 
14
  use Monolog\Logger;
 
15
  use Monolog\Formatter\NormalizerFormatter;
16
 
17
  /**
190
  if (null === $value || is_scalar($value)) {
191
  newrelic_add_custom_parameter($key, $value);
192
  } else {
193
+ newrelic_add_custom_parameter($key, @json_encode($value));
194
  }
195
  }
196
 
vendor/monolog/monolog/src/Monolog/Handler/PHPConsoleHandler.php CHANGED
@@ -14,7 +14,6 @@ namespace Monolog\Handler;
14
  use Exception;
15
  use Monolog\Formatter\LineFormatter;
16
  use Monolog\Logger;
17
- use Monolog\Utils;
18
  use PhpConsole\Connector;
19
  use PhpConsole\Handler;
20
  use PhpConsole\Helper;
@@ -189,7 +188,7 @@ class PHPConsoleHandler extends AbstractProcessingHandler
189
  $tags = $this->getRecordTags($record);
190
  $message = $record['message'];
191
  if ($record['context']) {
192
- $message .= ' ' . Utils::jsonEncode($this->connector->getDumper()->dump(array_filter($record['context'])), null, true);
193
  }
194
  $this->connector->getDebugDispatcher()->dispatchDebug($message, $tags, $this->options['classesPartialsTraceIgnore']);
195
  }
14
  use Exception;
15
  use Monolog\Formatter\LineFormatter;
16
  use Monolog\Logger;
 
17
  use PhpConsole\Connector;
18
  use PhpConsole\Handler;
19
  use PhpConsole\Helper;
188
  $tags = $this->getRecordTags($record);
189
  $message = $record['message'];
190
  if ($record['context']) {
191
+ $message .= ' ' . json_encode($this->connector->getDumper()->dump(array_filter($record['context'])));
192
  }
193
  $this->connector->getDebugDispatcher()->dispatchDebug($message, $tags, $this->options['classesPartialsTraceIgnore']);
194
  }
vendor/monolog/monolog/src/Monolog/Handler/SamplingHandler.php CHANGED
@@ -11,8 +11,6 @@
11
 
12
  namespace Monolog\Handler;
13
 
14
- use Monolog\Formatter\FormatterInterface;
15
-
16
  /**
17
  * Sampling handler
18
  *
@@ -40,7 +38,7 @@ class SamplingHandler extends AbstractHandler
40
  protected $factor;
41
 
42
  /**
43
- * @param callable|HandlerInterface $handler Handler or factory callable($record|null, $samplingHandler).
44
  * @param int $factor Sample factor
45
  */
46
  public function __construct($handler, $factor)
@@ -56,58 +54,29 @@ class SamplingHandler extends AbstractHandler
56
 
57
  public function isHandling(array $record)
58
  {
59
- return $this->getHandler($record)->isHandling($record);
60
  }
61
 
62
  public function handle(array $record)
63
  {
64
  if ($this->isHandling($record) && mt_rand(1, $this->factor) === 1) {
 
 
 
 
 
 
 
 
65
  if ($this->processors) {
66
  foreach ($this->processors as $processor) {
67
  $record = call_user_func($processor, $record);
68
  }
69
  }
70
 
71
- $this->getHandler($record)->handle($record);
72
  }
73
 
74
  return false === $this->bubble;
75
  }
76
-
77
- /**
78
- * Return the nested handler
79
- *
80
- * If the handler was provided as a factory callable, this will trigger the handler's instantiation.
81
- *
82
- * @return HandlerInterface
83
- */
84
- public function getHandler(array $record = null)
85
- {
86
- if (!$this->handler instanceof HandlerInterface) {
87
- $this->handler = call_user_func($this->handler, $record, $this);
88
- if (!$this->handler instanceof HandlerInterface) {
89
- throw new \RuntimeException("The factory callable should return a HandlerInterface");
90
- }
91
- }
92
-
93
- return $this->handler;
94
- }
95
-
96
- /**
97
- * {@inheritdoc}
98
- */
99
- public function setFormatter(FormatterInterface $formatter)
100
- {
101
- $this->getHandler()->setFormatter($formatter);
102
-
103
- return $this;
104
- }
105
-
106
- /**
107
- * {@inheritdoc}
108
- */
109
- public function getFormatter()
110
- {
111
- return $this->getHandler()->getFormatter();
112
- }
113
  }
11
 
12
  namespace Monolog\Handler;
13
 
 
 
14
  /**
15
  * Sampling handler
16
  *
38
  protected $factor;
39
 
40
  /**
41
+ * @param callable|HandlerInterface $handler Handler or factory callable($record, $fingersCrossedHandler).
42
  * @param int $factor Sample factor
43
  */
44
  public function __construct($handler, $factor)
54
 
55
  public function isHandling(array $record)
56
  {
57
+ return $this->handler->isHandling($record);
58
  }
59
 
60
  public function handle(array $record)
61
  {
62
  if ($this->isHandling($record) && mt_rand(1, $this->factor) === 1) {
63
+ // The same logic as in FingersCrossedHandler
64
+ if (!$this->handler instanceof HandlerInterface) {
65
+ $this->handler = call_user_func($this->handler, $record, $this);
66
+ if (!$this->handler instanceof HandlerInterface) {
67
+ throw new \RuntimeException("The factory callable should return a HandlerInterface");
68
+ }
69
+ }
70
+
71
  if ($this->processors) {
72
  foreach ($this->processors as $processor) {
73
  $record = call_user_func($processor, $record);
74
  }
75
  }
76
 
77
+ $this->handler->handle($record);
78
  }
79
 
80
  return false === $this->bubble;
81
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
82
  }
vendor/monolog/monolog/src/Monolog/Handler/Slack/SlackRecord.php CHANGED
@@ -12,7 +12,6 @@
12
  namespace Monolog\Handler\Slack;
13
 
14
  use Monolog\Logger;
15
- use Monolog\Utils;
16
  use Monolog\Formatter\NormalizerFormatter;
17
  use Monolog\Formatter\FormatterInterface;
18
 
@@ -208,17 +207,13 @@ class SlackRecord
208
  {
209
  $normalized = $this->normalizerFormatter->format($fields);
210
  $prettyPrintFlag = defined('JSON_PRETTY_PRINT') ? JSON_PRETTY_PRINT : 128;
211
- $flags = 0;
212
- if (PHP_VERSION_ID >= 50400) {
213
- $flags = JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE;
214
- }
215
 
216
  $hasSecondDimension = count(array_filter($normalized, 'is_array'));
217
  $hasNonNumericKeys = !count(array_filter(array_keys($normalized), 'is_numeric'));
218
 
219
  return $hasSecondDimension || $hasNonNumericKeys
220
- ? Utils::jsonEncode($normalized, $prettyPrintFlag | $flags)
221
- : Utils::jsonEncode($normalized, $flags);
222
  }
223
 
224
  /**
12
  namespace Monolog\Handler\Slack;
13
 
14
  use Monolog\Logger;
 
15
  use Monolog\Formatter\NormalizerFormatter;
16
  use Monolog\Formatter\FormatterInterface;
17
 
207
  {
208
  $normalized = $this->normalizerFormatter->format($fields);
209
  $prettyPrintFlag = defined('JSON_PRETTY_PRINT') ? JSON_PRETTY_PRINT : 128;
 
 
 
 
210
 
211
  $hasSecondDimension = count(array_filter($normalized, 'is_array'));
212
  $hasNonNumericKeys = !count(array_filter(array_keys($normalized), 'is_numeric'));
213
 
214
  return $hasSecondDimension || $hasNonNumericKeys
215
+ ? json_encode($normalized, $prettyPrintFlag)
216
+ : json_encode($normalized);
217
  }
218
 
219
  /**
vendor/monolog/monolog/src/Monolog/Handler/SlackHandler.php CHANGED
@@ -13,7 +13,6 @@ namespace Monolog\Handler;
13
 
14
  use Monolog\Formatter\FormatterInterface;
15
  use Monolog\Logger;
16
- use Monolog\Utils;
17
  use Monolog\Handler\Slack\SlackRecord;
18
 
19
  /**
@@ -119,7 +118,7 @@ class SlackHandler extends SocketHandler
119
  $dataArray['token'] = $this->token;
120
 
121
  if (!empty($dataArray['attachments'])) {
122
- $dataArray['attachments'] = Utils::jsonEncode($dataArray['attachments']);
123
  }
124
 
125
  return $dataArray;
13
 
14
  use Monolog\Formatter\FormatterInterface;
15
  use Monolog\Logger;
 
16
  use Monolog\Handler\Slack\SlackRecord;
17
 
18
  /**
118
  $dataArray['token'] = $this->token;
119
 
120
  if (!empty($dataArray['attachments'])) {
121
+ $dataArray['attachments'] = json_encode($dataArray['attachments']);
122
  }
123
 
124
  return $dataArray;
vendor/monolog/monolog/src/Monolog/Handler/SlackWebhookHandler.php CHANGED
@@ -13,7 +13,6 @@ namespace Monolog\Handler;
13
 
14
  use Monolog\Formatter\FormatterInterface;
15
  use Monolog\Logger;
16
- use Monolog\Utils;
17
  use Monolog\Handler\Slack\SlackRecord;
18
 
19
  /**
@@ -84,7 +83,7 @@ class SlackWebhookHandler extends AbstractProcessingHandler
84
  protected function write(array $record)
85
  {
86
  $postData = $this->slackRecord->getSlackData($record);
87
- $postString = Utils::jsonEncode($postData);
88
 
89
  $ch = curl_init();
90
  $options = array(
13
 
14
  use Monolog\Formatter\FormatterInterface;
15
  use Monolog\Logger;
 
16
  use Monolog\Handler\Slack\SlackRecord;
17
 
18
  /**
83
  protected function write(array $record)
84
  {
85
  $postData = $this->slackRecord->getSlackData($record);
86
+ $postString = json_encode($postData);
87
 
88
  $ch = curl_init();
89
  $options = array(
vendor/monolog/monolog/src/Monolog/Utils.php CHANGED
@@ -22,138 +22,4 @@ class Utils
22
 
23
  return 'c' === $class[0] && 0 === strpos($class, "class@anonymous\0") ? get_parent_class($class).'@anonymous' : $class;
24
  }
25
-
26
- /**
27
- * Return the JSON representation of a value
28
- *
29
- * @param mixed $data
30
- * @param int $encodeFlags flags to pass to json encode, defaults to JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE
31
- * @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
32
- * @throws \RuntimeException if encoding fails and errors are not ignored
33
- * @return string
34
- */
35
- public static function jsonEncode($data, $encodeFlags = null, $ignoreErrors = false)
36
- {
37
- if (null === $encodeFlags && version_compare(PHP_VERSION, '5.4.0', '>=')) {
38
- $encodeFlags = JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE;
39
- }
40
-
41
- if ($ignoreErrors) {
42
- $json = @json_encode($data, $encodeFlags);
43
- if (false === $json) {
44
- return 'null';
45
- }
46
-
47
- return $json;
48
- }
49
-
50
- $json = json_encode($data, $encodeFlags);
51
- if (false === $json) {
52
- $json = self::handleJsonError(json_last_error(), $data);
53
- }
54
-
55
- return $json;
56
- }
57
-
58
- /**
59
- * Handle a json_encode failure.
60
- *
61
- * If the failure is due to invalid string encoding, try to clean the
62
- * input and encode again. If the second encoding attempt fails, the
63
- * inital error is not encoding related or the input can't be cleaned then
64
- * raise a descriptive exception.
65
- *
66
- * @param int $code return code of json_last_error function
67
- * @param mixed $data data that was meant to be encoded
68
- * @param int $encodeFlags flags to pass to json encode, defaults to JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE
69
- * @throws \RuntimeException if failure can't be corrected
70
- * @return string JSON encoded data after error correction
71
- */
72
- public static function handleJsonError($code, $data, $encodeFlags = null)
73
- {
74
- if ($code !== JSON_ERROR_UTF8) {
75
- self::throwEncodeError($code, $data);
76
- }
77
-
78
- if (is_string($data)) {
79
- self::detectAndCleanUtf8($data);
80
- } elseif (is_array($data)) {
81
- array_walk_recursive($data, array('Monolog\Utils', 'detectAndCleanUtf8'));
82
- } else {
83
- self::throwEncodeError($code, $data);
84
- }
85
-
86
- if (null === $encodeFlags && version_compare(PHP_VERSION, '5.4.0', '>=')) {
87
- $encodeFlags = JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE;
88
- }
89
-
90
- $json = json_encode($data, $encodeFlags);
91
-
92
- if ($json === false) {
93
- self::throwEncodeError(json_last_error(), $data);
94
- }
95
-
96
- return $json;
97
- }
98
-
99
- /**
100
- * Throws an exception according to a given code with a customized message
101
- *
102
- * @param int $code return code of json_last_error function
103
- * @param mixed $data data that was meant to be encoded
104
- * @throws \RuntimeException
105
- */
106
- private static function throwEncodeError($code, $data)
107
- {
108
- switch ($code) {
109
- case JSON_ERROR_DEPTH:
110
- $msg = 'Maximum stack depth exceeded';
111
- break;
112
- case JSON_ERROR_STATE_MISMATCH:
113
- $msg = 'Underflow or the modes mismatch';
114
- break;
115
- case JSON_ERROR_CTRL_CHAR:
116
- $msg = 'Unexpected control character found';
117
- break;
118
- case JSON_ERROR_UTF8:
119
- $msg = 'Malformed UTF-8 characters, possibly incorrectly encoded';
120
- break;
121
- default:
122
- $msg = 'Unknown error';
123
- }
124
-
125
- throw new \RuntimeException('JSON encoding failed: '.$msg.'. Encoding: '.var_export($data, true));
126
- }
127
-
128
- /**
129
- * Detect invalid UTF-8 string characters and convert to valid UTF-8.
130
- *
131
- * Valid UTF-8 input will be left unmodified, but strings containing
132
- * invalid UTF-8 codepoints will be reencoded as UTF-8 with an assumed
133
- * original encoding of ISO-8859-15. This conversion may result in
134
- * incorrect output if the actual encoding was not ISO-8859-15, but it
135
- * will be clean UTF-8 output and will not rely on expensive and fragile
136
- * detection algorithms.
137
- *
138
- * Function converts the input in place in the passed variable so that it
139
- * can be used as a callback for array_walk_recursive.
140
- *
141
- * @param mixed &$data Input to check and convert if needed
142
- * @private
143
- */
144
- public static function detectAndCleanUtf8(&$data)
145
- {
146
- if (is_string($data) && !preg_match('//u', $data)) {
147
- $data = preg_replace_callback(
148
- '/[\x80-\xFF]+/',
149
- function ($m) { return utf8_encode($m[0]); },
150
- $data
151
- );
152
- $data = str_replace(
153
- array('¤', '¦', '¨', '´', '¸', '¼', '½', '¾'),
154
- array('€', 'Š', 'š', 'Ž', 'ž', 'Œ', 'œ', 'Ÿ'),
155
- $data
156
- );
157
- }
158
- }
159
  }
22
 
23
  return 'c' === $class[0] && 0 === strpos($class, "class@anonymous\0") ? get_parent_class($class).'@anonymous' : $class;
24
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
25
  }
vendor/phpseclib/phpseclib/LICENSE CHANGED
@@ -1,20 +1,20 @@
1
- Copyright (c) 2011-2019 TerraFrost and other contributors
2
-
3
- Permission is hereby granted, free of charge, to any person obtaining
4
- a copy of this software and associated documentation files (the
5
- "Software"), to deal in the Software without restriction, including
6
- without limitation the rights to use, copy, modify, merge, publish,
7
- distribute, sublicense, and/or sell copies of the Software, and to
8
- permit persons to whom the Software is furnished to do so, subject to
9
- the following conditions:
10
-
11
- The above copyright notice and this permission notice shall be
12
- included in all copies or substantial portions of the Software.
13
-
14
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
  WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1
+ Copyright (c) 2011-2019 TerraFrost and other contributors
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
  WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
vendor/phpseclib/phpseclib/phpseclib/Crypt/AES.php CHANGED
@@ -1,126 +1,126 @@
1
- <?php
2
-
3
- /**
4
- * Pure-PHP implementation of AES.
5
- *
6
- * Uses mcrypt, if available/possible, and an internal implementation, otherwise.
7
- *
8
- * PHP version 5
9
- *
10
- * NOTE: Since AES.php is (for compatibility and phpseclib-historical reasons) virtually
11
- * just a wrapper to Rijndael.php you may consider using Rijndael.php instead of
12
- * to save one include_once().
13
- *
14
- * If {@link self::setKeyLength() setKeyLength()} isn't called, it'll be calculated from
15
- * {@link self::setKey() setKey()}. ie. if the key is 128-bits, the key length will be 128-bits. If it's 136-bits
16
- * it'll be null-padded to 192-bits and 192 bits will be the key length until {@link self::setKey() setKey()}
17
- * is called, again, at which point, it'll be recalculated.
18
- *
19
- * Since \phpseclib\Crypt\AES extends \phpseclib\Crypt\Rijndael, some functions are available to be called that, in the context of AES, don't
20
- * make a whole lot of sense. {@link self::setBlockLength() setBlockLength()}, for instance. Calling that function,
21
- * however possible, won't do anything (AES has a fixed block length whereas Rijndael has a variable one).
22
- *
23
- * Here's a short example of how to use this library:
24
- * <code>
25
- * <?php
26
- * include 'vendor/autoload.php';
27
- *
28
- * $aes = new \phpseclib\Crypt\AES();
29
- *
30
- * $aes->setKey('abcdefghijklmnop');
31
- *
32
- * $size = 10 * 1024;
33
- * $plaintext = '';
34
- * for ($i = 0; $i < $size; $i++) {
35
- * $plaintext.= 'a';
36
- * }
37
- *
38
- * echo $aes->decrypt($aes->encrypt($plaintext));
39
- * ?>
40
- * </code>
41
- *
42
- * @category Crypt
43
- * @package AES
44
- * @author Jim Wigginton <terrafrost@php.net>
45
- * @copyright 2008 Jim Wigginton
46
- * @license http://www.opensource.org/licenses/mit-license.html MIT License
47
- * @link http://phpseclib.sourceforge.net
48
- */
49
-
50
- namespace phpseclib\Crypt;
51
-
52
- /**
53
- * Pure-PHP implementation of AES.
54
- *
55
- * @package AES
56
- * @author Jim Wigginton <terrafrost@php.net>
57
- * @access public
58
- */
59
- class AES extends Rijndael
60
- {
61
- /**
62
- * Dummy function
63
- *
64
- * Since \phpseclib\Crypt\AES extends \phpseclib\Crypt\Rijndael, this function is, technically, available, but it doesn't do anything.
65
- *
66
- * @see \phpseclib\Crypt\Rijndael::setBlockLength()
67
- * @access public
68
- * @param int $length
69
- */
70
- function setBlockLength($length)
71
- {
72
- return;
73
- }
74
-
75
- /**
76
- * Sets the key length
77
- *
78
- * Valid key lengths are 128, 192, and 256. If the length is less than 128, it will be rounded up to
79
- * 128. If the length is greater than 128 and invalid, it will be rounded down to the closest valid amount.
80
- *
81
- * @see \phpseclib\Crypt\Rijndael:setKeyLength()
82
- * @access public
83
- * @param int $length
84
- */
85
- function setKeyLength($length)
86
- {
87
- switch ($length) {
88
- case 160:
89
- $length = 192;
90
- break;
91
- case 224:
92
- $length = 256;
93
- }
94
- parent::setKeyLength($length);
95
- }
96
-
97
- /**
98
- * Sets the key.
99
- *
100
- * Rijndael supports five different key lengths, AES only supports three.
101
- *
102
- * @see \phpseclib\Crypt\Rijndael:setKey()
103
- * @see setKeyLength()
104
- * @access public
105
- * @param string $key
106
- */
107
- function setKey($key)
108
- {
109
- parent::setKey($key);
110
-
111
- if (!$this->explicit_key_length) {
112
- $length = strlen($key);
113
- switch (true) {
114
- case $length <= 16:
115
- $this->key_length = 16;
116
- break;
117
- case $length <= 24:
118
- $this->key_length = 24;
119
- break;
120
- default:
121
- $this->key_length = 32;
122
- }
123
- $this->_setEngine();
124
- }
125
- }
126
- }
1
+ <?php
2
+
3
+ /**
4
+ * Pure-PHP implementation of AES.
5
+ *
6
+ * Uses mcrypt, if available/possible, and an internal implementation, otherwise.
7
+ *
8
+ * PHP version 5
9
+ *
10
+ * NOTE: Since AES.php is (for compatibility and phpseclib-historical reasons) virtually
11
+ * just a wrapper to Rijndael.php you may consider using Rijndael.php instead of
12
+ * to save one include_once().
13
+ *
14
+ * If {@link self::setKeyLength() setKeyLength()} isn't called, it'll be calculated from
15
+ * {@link self::setKey() setKey()}. ie. if the key is 128-bits, the key length will be 128-bits. If it's 136-bits
16
+ * it'll be null-padded to 192-bits and 192 bits will be the key length until {@link self::setKey() setKey()}
17
+ * is called, again, at which point, it'll be recalculated.
18
+ *
19
+ * Since \phpseclib\Crypt\AES extends \phpseclib\Crypt\Rijndael, some functions are available to be called that, in the context of AES, don't
20
+ * make a whole lot of sense. {@link self::setBlockLength() setBlockLength()}, for instance. Calling that function,
21
+ * however possible, won't do anything (AES has a fixed block length whereas Rijndael has a variable one).
22
+ *
23
+ * Here's a short example of how to use this library:
24
+ * <code>
25
+ * <?php
26
+ * include 'vendor/autoload.php';
27
+ *
28
+ * $aes = new \phpseclib\Crypt\AES();
29
+ *
30
+ * $aes->setKey('abcdefghijklmnop');
31
+ *
32
+ * $size = 10 * 1024;
33
+ * $plaintext = '';
34
+ * for ($i = 0; $i < $size; $i++) {
35
+ * $plaintext.= 'a';
36
+ * }
37
+ *
38
+ * echo $aes->decrypt($aes->encrypt($plaintext));
39
+ * ?>
40
+ * </code>
41
+ *
42
+ * @category Crypt
43
+ * @package AES
44
+ * @author Jim Wigginton <terrafrost@php.net>
45
+ * @copyright 2008 Jim Wigginton
46
+ * @license http://www.opensource.org/licenses/mit-license.html MIT License
47
+ * @link http://phpseclib.sourceforge.net
48
+ */
49
+
50
+ namespace phpseclib\Crypt;
51
+
52
+ /**
53
+ * Pure-PHP implementation of AES.
54
+ *
55
+ * @package AES
56
+ * @author Jim Wigginton <terrafrost@php.net>
57
+ * @access public
58
+ */
59
+ class AES extends Rijndael
60
+ {
61
+ /**
62
+ * Dummy function
63
+ *
64
+ * Since \phpseclib\Crypt\AES extends \phpseclib\Crypt\Rijndael, this function is, technically, available, but it doesn't do anything.
65
+ *
66
+ * @see \phpseclib\Crypt\Rijndael::setBlockLength()
67
+ * @access public
68
+ * @param int $length
69
+ */
70
+ function setBlockLength($length)
71
+ {
72
+ return;
73
+ }
74
+
75
+ /**
76
+ * Sets the key length
77
+ *
78
+ * Valid key lengths are 128, 192, and 256. If the length is less than 128, it will be rounded up to
79
+ * 128. If the length is greater than 128 and invalid, it will be rounded down to the closest valid amount.
80
+ *
81
+ * @see \phpseclib\Crypt\Rijndael:setKeyLength()
82
+ * @access public
83
+ * @param int $length
84
+ */
85
+ function setKeyLength($length)
86
+ {
87
+ switch ($length) {
88
+ case 160:
89
+ $length = 192;
90
+ break;
91
+ case 224:
92
+ $length = 256;
93
+ }
94
+ parent::setKeyLength($length);
95
+ }
96
+
97
+ /**
98
+ * Sets the key.
99
+ *
100
+ * Rijndael supports five different key lengths, AES only supports three.
101
+ *
102
+ * @see \phpseclib\Crypt\Rijndael:setKey()
103
+ * @see setKeyLength()
104
+ * @access public
105
+ * @param string $key
106
+ */
107
+ function setKey($key)
108
+ {
109
+ parent::setKey($key);
110
+
111
+ if (!$this->explicit_key_length) {
112
+ $length = strlen($key);
113
+ switch (true) {
114
+ case $length <= 16:
115
+ $this->key_length = 16;
116
+ break;
117
+ case $length <= 24:
118
+ $this->key_length = 24;
119
+ break;
120
+ default:
121
+ $this->key_length = 32;
122
+ }
123
+ $this->_setEngine();
124
+ }
125
+ }
126
+ }
vendor/phpseclib/phpseclib/phpseclib/Crypt/RSA.php CHANGED
@@ -1,3201 +1,3201 @@
1
- <?php
2
-
3
- /**
4
- * Pure-PHP PKCS#1 (v2.1) compliant implementation of RSA.
5
- *
6
- * PHP version 5
7
- *
8
- * Here's an example of how to encrypt and decrypt text with this library:
9
- * <code>
10
- * <?php
11
- * include 'vendor/autoload.php';
12
- *
13
- * $rsa = new \phpseclib\Crypt\RSA();
14
- * extract($rsa->createKey());
15
- *
16
- * $plaintext = 'terrafrost';
17
- *
18
- * $rsa->loadKey($privatekey);
19
- * $ciphertext = $rsa->encrypt($plaintext);
20
- *
21
- * $rsa->loadKey($publickey);
22
- * echo $rsa->decrypt($ciphertext);
23
- * ?>
24
- * </code>
25
- *
26
- * Here's an example of how to create signatures and verify signatures with this library:
27
- * <code>
28
- * <?php
29
- * include 'vendor/autoload.php';
30
- *
31
- * $rsa = new \phpseclib\Crypt\RSA();
32
- * extract($rsa->createKey());
33
- *
34
- * $plaintext = 'terrafrost';
35
- *
36
- * $rsa->loadKey($privatekey);
37
- * $signature = $rsa->sign($plaintext);
38
- *
39
- * $rsa->loadKey($publickey);
40
- * echo $rsa->verify($plaintext, $signature) ? 'verified' : 'unverified';
41
- * ?>
42
- * </code>
43
- *
44
- * @category Crypt
45
- * @package RSA
46
- * @author Jim Wigginton <terrafrost@php.net>
47
- * @copyright 2009 Jim Wigginton
48
- * @license http://www.opensource.org/licenses/mit-license.html MIT License
49
- * @link http://phpseclib.sourceforge.net
50
- */
51
-
52
- namespace phpseclib\Crypt;
53
-
54
- use phpseclib\Math\BigInteger;
55
-
56
- /**
57
- * Pure-PHP PKCS#1 compliant implementation of RSA.
58
- *
59
- * @package RSA
60
- * @author Jim Wigginton <terrafrost@php.net>
61
- * @access public
62
- */
63
- class RSA
64
- {
65
- /**#@+
66
- * @access public
67
- * @see self::encrypt()
68
- * @see self::decrypt()
69
- */
70
- /**
71
- * Use {@link http://en.wikipedia.org/wiki/Optimal_Asymmetric_Encryption_Padding Optimal Asymmetric Encryption Padding}
72
- * (OAEP) for encryption / decryption.
73
- *
74
- * Uses sha1 by default.
75
- *
76
- * @see self::setHash()
77
- * @see self::setMGFHash()
78
- */
79
- const ENCRYPTION_OAEP = 1;
80
- /**
81
- * Use PKCS#1 padding.
82
- *
83
- * Although self::ENCRYPTION_OAEP offers more security, including PKCS#1 padding is necessary for purposes of backwards
84
- * compatibility with protocols (like SSH-1) written before OAEP's introduction.
85
- */
86
- const ENCRYPTION_PKCS1 = 2;
87
- /**
88
- * Do not use any padding
89
- *
90
- * Although this method is not recommended it can none-the-less sometimes be useful if you're trying to decrypt some legacy
91
- * stuff, if you're trying to diagnose why an encrypted message isn't decrypting, etc.
92
- */
93
- const ENCRYPTION_NONE = 3;
94
- /**#@-*/
95
-
96
- /**#@+
97
- * @access public
98
- * @see self::sign()
99
- * @see self::verify()
100
- * @see self::setHash()
101
- */
102
- /**
103
- * Use the Probabilistic Signature Scheme for signing
104
- *
105
- * Uses sha1 by default.
106
- *
107
- * @see self::setSaltLength()
108
- * @see self::setMGFHash()
109
- */
110
- const SIGNATURE_PSS = 1;
111
- /**
112
- * Use the PKCS#1 scheme by default.
113
- *
114
- * Although self::SIGNATURE_PSS offers more security, including PKCS#1 signing is necessary for purposes of backwards
115
- * compatibility with protocols (like SSH-2) written before PSS's introduction.
116
- */
117
- const SIGNATURE_PKCS1 = 2;
118
- /**#@-*/
119
-
120
- /**#@+
121
- * @access private
122
- * @see \phpseclib\Crypt\RSA::createKey()
123
- */
124
- /**
125
- * ASN1 Integer
126
- */
127
- const ASN1_INTEGER = 2;
128
- /**
129
- * ASN1 Bit String
130
- */
131
- const ASN1_BITSTRING = 3;
132
- /**
133
- * ASN1 Octet String
134
- */
135
- const ASN1_OCTETSTRING = 4;
136
- /**
137
- * ASN1 Object Identifier
138
- */
139
- const ASN1_OBJECT = 6;
140
- /**
141
- * ASN1 Sequence (with the constucted bit set)
142
- */
143
- const ASN1_SEQUENCE = 48;
144
- /**#@-*/
145
-
146
- /**#@+
147
- * @access private
148
- * @see \phpseclib\Crypt\RSA::__construct()
149
- */
150
- /**
151
- * To use the pure-PHP implementation
152
- */
153
- const MODE_INTERNAL = 1;
154
- /**
155
- * To use the OpenSSL library
156
- *
157
- * (if enabled; otherwise, the internal implementation will be used)
158
- */
159
- const MODE_OPENSSL = 2;
160
- /**#@-*/
161
-
162
- /**#@+
163
- * @access public
164
- * @see \phpseclib\Crypt\RSA::createKey()
165
- * @see \phpseclib\Crypt\RSA::setPrivateKeyFormat()
166
- */
167
- /**
168
- * PKCS#1 formatted private key
169
- *
170
- * Used by OpenSSH
171
- */
172
- const PRIVATE_FORMAT_PKCS1 = 0;
173
- /**
174
- * PuTTY formatted private key
175
- */
176
- const PRIVATE_FORMAT_PUTTY = 1;
177
- /**
178
- * XML formatted private key
179
- */
180
- const PRIVATE_FORMAT_XML = 2;
181
- /**
182
- * PKCS#8 formatted private key
183
- */
184
- const PRIVATE_FORMAT_PKCS8 = 8;
185
- /**
186
- * OpenSSH formatted private key
187
- */
188
- const PRIVATE_FORMAT_OPENSSH = 9;
189
- /**#@-*/
190
-
191
- /**#@+
192
- * @access public
193
- * @see \phpseclib\Crypt\RSA::createKey()
194
- * @see \phpseclib\Crypt\RSA::setPublicKeyFormat()
195
- */
196
- /**
197
- * Raw public key
198
- *
199
- * An array containing two \phpseclib\Math\BigInteger objects.
200
- *
201
- * The exponent can be indexed with any of the following:
202
- *
203
- * 0, e, exponent, publicExponent
204
- *
205
- * The modulus can be indexed with any of the following:
206
- *
207
- * 1, n, modulo, modulus
208
- */
209
- const PUBLIC_FORMAT_RAW = 3;
210
- /**
211
- * PKCS#1 formatted public key (raw)
212
- *
213
- * Used by File/X509.php
214
- *
215
- * Has the following header:
216
- *
217
- * -----BEGIN RSA PUBLIC KEY-----
218
- *
219
- * Analogous to ssh-keygen's pem format (as specified by -m)
220
- */
221
- const PUBLIC_FORMAT_PKCS1 = 4;
222
- const PUBLIC_FORMAT_PKCS1_RAW = 4;
223
- /**
224
- * XML formatted public key
225
- */
226
- const PUBLIC_FORMAT_XML = 5;
227
- /**
228
- * OpenSSH formatted public key
229
- *
230
- * Place in $HOME/.ssh/authorized_keys
231
- */
232
- const PUBLIC_FORMAT_OPENSSH = 6;
233
- /**
234
- * PKCS#1 formatted public key (encapsulated)
235
- *
236
- * Used by PHP's openssl_public_encrypt() and openssl's rsautl (when -pubin is set)
237
- *
238
- * Has the following header:
239
- *
240
- * -----BEGIN PUBLIC KEY-----
241
- *
242
- * Analogous to ssh-keygen's pkcs8 format (as specified by -m). Although PKCS8
243
- * is specific to private keys it's basically creating a DER-encoded wrapper
244
- * for keys. This just extends that same concept to public keys (much like ssh-keygen)
245
- */
246
- const PUBLIC_FORMAT_PKCS8 = 7;
247
- /**#@-*/
248
-
249
- /**
250
- * Precomputed Zero
251
- *
252
- * @var \phpseclib\Math\BigInteger
253
- * @access private
254
- */
255
- var $zero;
256
-
257
- /**
258
- * Precomputed One
259
- *
260
- * @var \phpseclib\Math\BigInteger
261
- * @access private
262
- */
263
- var $one;
264
-
265
- /**
266
- * Private Key Format
267
- *
268
- * @var int
269
- * @access private
270
- */
271
- var $privateKeyFormat = self::PRIVATE_FORMAT_PKCS1;
272
-
273
- /**
274
- * Public Key Format
275
- *
276
- * @var int
277
- * @access public
278
- */
279
- var $publicKeyFormat = self::PUBLIC_FORMAT_PKCS8;
280
-
281
- /**
282
- * Modulus (ie. n)
283
- *
284
- * @var \phpseclib\Math\BigInteger
285
- * @access private
286
- */
287
- var $modulus;
288
-
289
- /**
290
- * Modulus length
291
- *
292
- * @var \phpseclib\Math\BigInteger
293
- * @access private
294
- */
295
- var $k;
296
-
297
- /**
298
- * Exponent (ie. e or d)
299
- *
300
- * @var \phpseclib\Math\BigInteger
301
- * @access private
302
- */
303
- var $exponent;
304
-
305
- /**
306
- * Primes for Chinese Remainder Theorem (ie. p and q)
307
- *
308
- * @var array
309
- * @access private
310
- */
311
- var $primes;
312
-
313
- /**
314
- * Exponents for Chinese Remainder Theorem (ie. dP and dQ)
315
- *
316
- * @var array
317
- * @access private
318
- */
319
- var $exponents;
320
-
321
- /**
322
- * Coefficients for Chinese Remainder Theorem (ie. qInv)
323
- *
324
- * @var array
325
- * @access private
326
- */
327
- var $coefficients;
328
-
329
- /**
330
- * Hash name
331
- *
332
- * @var string
333
- * @access private
334
- */
335
- var $hashName;
336
-
337
- /**
338
- * Hash function
339
- *
340
- * @var \phpseclib\Crypt\Hash
341
- * @access private
342
- */
343
- var $hash;
344
-
345
- /**
346
- * Length of hash function output
347
- *
348
- * @var int
349
- * @access private
350
- */
351
- var $hLen;
352
-
353
- /**
354
- * Length of salt
355
- *
356
- * @var int
357
- * @access private
358
- */
359
- var $sLen;
360
-
361
- /**
362
- * Hash function for the Mask Generation Function
363
- *
364
- * @var \phpseclib\Crypt\Hash
365
- * @access private
366
- */
367
- var $mgfHash;
368
-
369
- /**
370
- * Length of MGF hash function output
371
- *
372
- * @var int
373
- * @access private
374
- */
375
- var $mgfHLen;
376
-
377
- /**
378
- * Encryption mode
379
- *
380
- * @var int
381
- * @access private
382
- */
383
- var $encryptionMode = self::ENCRYPTION_OAEP;
384
-
385
- /**
386
- * Signature mode
387
- *
388
- * @var int
389
- * @access private
390
- */
391
- var $signatureMode = self::SIGNATURE_PSS;
392
-
393
- /**
394
- * Public Exponent
395
- *
396
- * @var mixed
397
- * @access private
398
- */
399
- var $publicExponent = false;
400
-
401
- /**
402
- * Password
403
- *
404
- * @var string
405
- * @access private
406
- */
407
- var $password = false;
408
-
409
- /**
410
- * Components
411
- *
412
- * For use with parsing XML formatted keys. PHP's XML Parser functions use utilized - instead of PHP's DOM functions -
413
- * because PHP's XML Parser functions work on PHP4 whereas PHP's DOM functions - although surperior - don't.
414
- *
415
- * @see self::_start_element_handler()
416
- * @var array
417
- * @access private
418
- */
419
- var $components = array();
420
-
421
- /**
422
- * Current String
423
- *
424
- * For use with parsing XML formatted keys.
425
- *
426
- * @see self::_character_handler()
427
- * @see self::_stop_element_handler()
428
- * @var mixed
429
- * @access private
430
- */
431
- var $current;
432
-
433
- /**
434
- * OpenSSL configuration file name.
435
- *
436
- * Set to null to use system configuration file.
437
- * @see self::createKey()
438
- * @var mixed
439
- * @Access public
440
- */
441
- var $configFile;
442
-
443
- /**
444
- * Public key comment field.
445
- *
446
- * @var string
447
- * @access private
448
- */
449
- var $comment = 'phpseclib-generated-key';
450
-
451
- /**
452
- * The constructor
453
- *
454
- * If you want to make use of the openssl extension, you'll need to set the mode manually, yourself. The reason
455
- * \phpseclib\Crypt\RSA doesn't do it is because OpenSSL doesn't fail gracefully. openssl_pkey_new(), in particular, requires
456
- * openssl.cnf be present somewhere and, unfortunately, the only real way to find out is too late.
457
- *
458
- * @return \phpseclib\Crypt\RSA
459
- * @access public
460
- */
461
- function __construct()
462
- {
463
- $this->configFile = dirname(__FILE__) . '/../openssl.cnf';
464
-
465
- if (!defined('CRYPT_RSA_MODE')) {
466
- switch (true) {
467
- // Math/BigInteger's openssl requirements are a little less stringent than Crypt/RSA's. in particular,
468
- // Math/BigInteger doesn't require an openssl.cfg file whereas Crypt/RSA does. so if Math/BigInteger
469
- // can't use OpenSSL it can be pretty trivially assumed, then, that Crypt/RSA can't either.
470
- case defined('MATH_BIGINTEGER_OPENSSL_DISABLE'):
471
- define('CRYPT_RSA_MODE', self::MODE_INTERNAL);
472
- break;
473
- case extension_loaded('openssl') && file_exists($this->configFile):
474
- // some versions of XAMPP have mismatched versions of OpenSSL which causes it not to work
475
- $versions = array();
476
-
477
- // avoid generating errors (even with suppression) when phpinfo() is disabled (common in production systems)
478
- if (strpos(ini_get('disable_functions'), 'phpinfo') === false) {
479
- ob_start();
480
- @phpinfo();
481
- $content = ob_get_contents();
482
- ob_end_clean();
483
-
484
- preg_match_all('#OpenSSL (Header|Library) Version(.*)#im', $content, $matches);
485
-
486
- if (!empty($matches[1])) {
487
- for ($i = 0; $i < count($matches[1]); $i++) {
488
- $fullVersion = trim(str_replace('=>', '', strip_tags($matches[2][$i])));
489
-
490
- // Remove letter part in OpenSSL version
491
- if (!preg_match('/(\d+\.\d+\.\d+)/i', $fullVersion, $m)) {
492
- $versions[$matches[1][$i]] = $fullVersion;
493
- } else {
494
- $versions[$matches[1][$i]] = $m[0];
495
- }
496
- }
497
- }
498
- }
499
-
500
- // it doesn't appear that OpenSSL versions were reported upon until PHP 5.3+
501
- switch (true) {
502
- case !isset($versions['Header']):
503
- case !isset($versions['Library']):
504
- case $versions['Header'] == $versions['Library']:
505
- case version_compare($versions['Header'], '1.0.0') >= 0 && version_compare($versions['Library'], '1.0.0') >= 0:
506
- define('CRYPT_RSA_MODE', self::MODE_OPENSSL);
507
- break;
508
- default:
509
- define('CRYPT_RSA_MODE', self::MODE_INTERNAL);
510
- define('MATH_BIGINTEGER_OPENSSL_DISABLE', true);
511
- }
512
- break;
513
- default:
514
- define('CRYPT_RSA_MODE', self::MODE_INTERNAL);
515
- }
516
- }
517
-
518
- $this->zero = new BigInteger();
519
- $this->one = new BigInteger(1);
520
-
521
- $this->hash = new Hash('sha1');
522
- $this->hLen = $this->hash->getLength();
523
- $this->hashName = 'sha1';
524
- $this->mgfHash = new Hash('sha1');
525
- $this->mgfHLen = $this->mgfHash->getLength();
526
- }
527
-
528
- /**
529
- * Create public / private key pair
530
- *
531
- * Returns an array with the following three elements:
532
- * - 'privatekey': The private key.
533
- * - 'publickey': The public key.
534
- * - 'partialkey': A partially computed key (if the execution time exceeded $timeout).
535
- * Will need to be passed back to \phpseclib\Crypt\RSA::createKey() as the third parameter for further processing.
536
- *
537
- * @access public
538
- * @param int $bits
539
- * @param int $timeout
540
- * @param array $p
541
- */
542
- function createKey($bits = 1024, $timeout = false, $partial = array())
543
- {
544
- if (!defined('CRYPT_RSA_EXPONENT')) {
545
- // http://en.wikipedia.org/wiki/65537_%28number%29
546
- define('CRYPT_RSA_EXPONENT', '65537');
547
- }
548
- // per <http://cseweb.ucsd.edu/~hovav/dist/survey.pdf#page=5>, this number ought not result in primes smaller
549
- // than 256 bits. as a consequence if the key you're trying to create is 1024 bits and you've set CRYPT_RSA_SMALLEST_PRIME
550
- // to 384 bits then you're going to get a 384 bit prime and a 640 bit prime (384 + 1024 % 384). at least if
551
- // CRYPT_RSA_MODE is set to self::MODE_INTERNAL. if CRYPT_RSA_MODE is set to self::MODE_OPENSSL then
552
- // CRYPT_RSA_SMALLEST_PRIME is ignored (ie. multi-prime RSA support is more intended as a way to speed up RSA key
553
- // generation when there's a chance neither gmp nor OpenSSL are installed)
554
- if (!defined('CRYPT_RSA_SMALLEST_PRIME')) {
555
- define('CRYPT_RSA_SMALLEST_PRIME', 4096);
556
- }
557
-
558
- // OpenSSL uses 65537 as the exponent and requires RSA keys be 384 bits minimum
559
- if (CRYPT_RSA_MODE == self::MODE_OPENSSL && $bits >= 384 && CRYPT_RSA_EXPONENT == 65537) {
560
- $config = array();
561
- if (isset($this->configFile)) {
562
- $config['config'] = $this->configFile;
563
- }
564
- $rsa = openssl_pkey_new(array('private_key_bits' => $bits) + $config);
565
- openssl_pkey_export($rsa, $privatekey, null, $config);
566
- $publickey = openssl_pkey_get_details($rsa);
567
- $publickey = $publickey['key'];
568
-
569
- $privatekey = call_user_func_array(array($this, '_convertPrivateKey'), array_values($this->_parseKey($privatekey, self::PRIVATE_FORMAT_PKCS1)));
570
- $publickey = call_user_func_array(array($this, '_convertPublicKey'), array_values($this->_parseKey($publickey, self::PUBLIC_FORMAT_PKCS1)));
571
-
572
- // clear the buffer of error strings stemming from a minimalistic openssl.cnf
573
- while (openssl_error_string() !== false) {
574
- }
575
-
576
- return array(
577
- 'privatekey' => $privatekey,
578
- 'publickey' => $publickey,
579
- 'partialkey' => false
580
- );
581
- }
582
-
583
- static $e;
584
- if (!isset($e)) {
585
- $e = new BigInteger(CRYPT_RSA_EXPONENT);
586
- }
587
-
588
- extract($this->_generateMinMax($bits));
589
- $absoluteMin = $min;
590
- $temp = $bits >> 1; // divide by two to see how many bits P and Q would be
591
- if ($temp > CRYPT_RSA_SMALLEST_PRIME) {
592
- $num_primes = floor($bits / CRYPT_RSA_SMALLEST_PRIME);
593
- $temp = CRYPT_RSA_SMALLEST_PRIME;
594
- } else {
595
- $num_primes = 2;
596
- }
597
- extract($this->_generateMinMax($temp + $bits % $temp));
598
- $finalMax = $max;
599
- extract($this->_generateMinMax($temp));
600
-
601
- $generator = new BigInteger();
602
-
603
- $n = $this->one->copy();
604
- if (!empty($partial)) {
605
- extract(unserialize($partial));
606
- } else {
607
- $exponents = $coefficients = $primes = array();
608
- $lcm = array(
609
- 'top' => $this->one->copy(),
610
- 'bottom' => false
611
- );
612
- }
613
-
614
- $start = time();
615
- $i0 = count($primes) + 1;
616
-
617
- do {
618
- for ($i = $i0; $i <= $num_primes; $i++) {
619
- if ($timeout !== false) {
620
- $timeout-= time() - $start;
621
- $start = time();
622
- if ($timeout <= 0) {
623
- return array(
624
- 'privatekey' => '',
625
- 'publickey' => '',
626
- 'partialkey' => serialize(array(
627
- 'primes' => $primes,
628
- 'coefficients' => $coefficients,
629
- 'lcm' => $lcm,
630
- 'exponents' => $exponents
631
- ))
632
- );
633
- }
634
- }
635
-
636
- if ($i == $num_primes) {
637
- list($min, $temp) = $absoluteMin->divide($n);
638
- if (!$temp->equals($this->zero)) {
639
- $min = $min->add($this->one); // ie. ceil()
640
- }
641
- $primes[$i] = $generator->randomPrime($min, $finalMax, $timeout);
642
- } else {
643
- $primes[$i] = $generator->randomPrime($min, $max, $timeout);
644
- }
645
-
646
- if ($primes[$i] === false) { // if we've reached the timeout
647
- if (count($primes) > 1) {
648
- $partialkey = '';
649
- } else {
650
- array_pop($primes);
651
- $partialkey = serialize(array(
652
- 'primes' => $primes,
653
- 'coefficients' => $coefficients,
654
- 'lcm' => $lcm,
655
- 'exponents' => $exponents
656
- ));
657
- }
658
-
659
- return array(
660
- 'privatekey' => '',
661
- 'publickey' => '',
662
- 'partialkey' => $partialkey
663
- );
664
- }
665
-
666
- // the first coefficient is calculated differently from the rest
667
- // ie. instead of being $primes[1]->modInverse($primes[2]), it's $primes[2]->modInverse($primes[1])
668
- if ($i > 2) {
669
- $coefficients[$i] = $n->modInverse($primes[$i]);
670
- }
671
-
672
- $n = $n->multiply($primes[$i]);
673
-
674
- $temp = $primes[$i]->subtract($this->one);
675
-
676
- // textbook RSA implementations use Euler's totient function instead of the least common multiple.
677
- // see http://en.wikipedia.org/wiki/Euler%27s_totient_function
678
- $lcm['top'] = $lcm['top']->multiply($temp);
679
- $lcm['bottom'] = $lcm['bottom'] === false ? $temp : $lcm['bottom']->gcd($temp);
680
-
681
- $exponents[$i] = $e->modInverse($temp);
682
- }
683
-
684
- list($temp) = $lcm['top']->divide($lcm['bottom']);
685
- $gcd = $temp->gcd($e);
686
- $i0 = 1;
687
- } while (!$gcd->equals($this->one));
688
-
689
- $d = $e->modInverse($temp);
690
-
691
- $coefficients[2] = $primes[2]->modInverse($primes[1]);
692
-
693
- // from <http://tools.ietf.org/html/rfc3447#appendix-A.1.2>:
694
- // RSAPrivateKey ::= SEQUENCE {
695
- // version Version,
696
- // modulus INTEGER, -- n
697
- // publicExponent INTEGER, -- e
698
- // privateExponent INTEGER, -- d
699
- // prime1 INTEGER, -- p
700
- // prime2 INTEGER, -- q
701
- // exponent1 INTEGER, -- d mod (p-1)
702
- // exponent2 INTEGER, -- d mod (q-1)
703
- // coefficient INTEGER, -- (inverse of q) mod p
704
- // otherPrimeInfos OtherPrimeInfos OPTIONAL
705
- // }
706
-
707
- return array(
708
- 'privatekey' => $this->_convertPrivateKey($n, $e, $d, $primes, $exponents, $coefficients),
709
- 'publickey' => $this->_convertPublicKey($n, $e),
710
- 'partialkey' => false
711
- );
712
- }
713
-
714
- /**
715
- * Convert a private key to the appropriate format.
716
- *
717
- * @access private
718
- * @see self::setPrivateKeyFormat()
719
- * @param string $RSAPrivateKey
720
- * @return string
721
- */
722
- function _convertPrivateKey($n, $e, $d, $primes, $exponents, $coefficients)
723
- {
724
- $signed = $this->privateKeyFormat != self::PRIVATE_FORMAT_XML;
725
- $num_primes = count($primes);
726
- $raw = array(
727
- 'version' => $num_primes == 2 ? chr(0) : chr(1), // two-prime vs. multi
728
- 'modulus' => $n->toBytes($signed),
729
- 'publicExponent' => $e->toBytes($signed),
730
- 'privateExponent' => $d->toBytes($signed),
731
- 'prime1' => $primes[1]->toBytes($signed),
732
- 'prime2' => $primes[2]->toBytes($signed),
733
- 'exponent1' => $exponents[1]->toBytes($signed),
734
- 'exponent2' => $exponents[2]->toBytes($signed),
735
- 'coefficient' => $coefficients[2]->toBytes($signed)
736
- );
737
-
738
- // if the format in question does not support multi-prime rsa and multi-prime rsa was used,
739
- // call _convertPublicKey() instead.
740
- switch ($this->privateKeyFormat) {
741
- case self::PRIVATE_FORMAT_XML:
742
- if ($num_primes != 2) {
743
- return false;
744
- }
745
- return "<RSAKeyValue>\r\n" .
746
- ' <Modulus>' . base64_encode($raw['modulus']) . "</Modulus>\r\n" .
747
- ' <Exponent>' . base64_encode($raw['publicExponent']) . "</Exponent>\r\n" .
748
- ' <P>' . base64_encode($raw['prime1']) . "</P>\r\n" .
749
- ' <Q>' . base64_encode($raw['prime2']) . "</Q>\r\n" .
750
- ' <DP>' . base64_encode($raw['exponent1']) . "</DP>\r\n" .
751
- ' <DQ>' . base64_encode($raw['exponent2']) . "</DQ>\r\n" .
752
- ' <InverseQ>' . base64_encode($raw['coefficient']) . "</InverseQ>\r\n" .
753
- ' <D>' . base64_encode($raw['privateExponent']) . "</D>\r\n" .
754
- '</RSAKeyValue>';
755
- break;
756
- case self::PRIVATE_FORMAT_PUTTY:
757
- if ($num_primes != 2) {
758
- return false;
759
- }
760
- $key = "PuTTY-User-Key-File-2: ssh-rsa\r\nEncryption: ";
761
- $encryption = (!empty($this->password) || is_string($this->password)) ? 'aes256-cbc' : 'none';
762
- $key.= $encryption;
763
- $key.= "\r\nComment: " . $this->comment . "\r\n";
764
- $public = pack(
765
- 'Na*Na*Na*',
766
- strlen('ssh-rsa'),
767
- 'ssh-rsa',
768
- strlen($raw['publicExponent']),
769
- $raw['publicExponent'],
770
- strlen($raw['modulus']),
771
- $raw['modulus']
772
- );
773
- $source = pack(
774
- 'Na*Na*Na*Na*',
775
- strlen('ssh-rsa'),
776
- 'ssh-rsa',
777
- strlen($encryption),
778
- $encryption,
779
- strlen($this->comment),
780
- $this->comment,
781
- strlen($public),
782
- $public
783
- );
784
- $public = base64_encode($public);
785
- $key.= "Public-Lines: " . ((strlen($public) + 63) >> 6) . "\r\n";
786
- $key.= chunk_split($public, 64);
787
- $private = pack(
788
- 'Na*Na*Na*Na*',
789
- strlen($raw['privateExponent']),
790
- $raw['privateExponent'],
791
- strlen($raw['prime1']),
792
- $raw['prime1'],
793
- strlen($raw['prime2']),
794
- $raw['prime2'],
795
- strlen($raw['coefficient']),
796
- $raw['coefficient']
797
- );
798
- if (empty($this->password) && !is_string($this->password)) {
799
- $source.= pack('Na*', strlen($private), $private);
800
- $hashkey = 'putty-private-key-file-mac-key';
801
- } else {
802
- $private.= Random::string(16 - (strlen($private) & 15));
803
- $source.= pack('Na*', strlen($private), $private);
804
- $sequence = 0;
805
- $symkey = '';
806
- while (strlen($symkey) < 32) {
807
- $temp = pack('Na*', $sequence++, $this->password);
808
- $symkey.= pack('H*', sha1($temp));
809
- }
810
- $symkey = substr($symkey, 0, 32);
811
- $crypto = new AES();
812
-
813
- $crypto->setKey($symkey);
814
- $crypto->disablePadding();
815
- $private = $crypto->encrypt($private);
816
- $hashkey = 'putty-private-key-file-mac-key' . $this->password;
817
- }
818
-
819
- $private = base64_encode($private);
820
- $key.= 'Private-Lines: ' . ((strlen($private) + 63) >> 6) . "\r\n";
821
- $key.= chunk_split($private, 64);
822
- $hash = new Hash('sha1');
823
- $hash->setKey(pack('H*', sha1($hashkey)));
824
- $key.= 'Private-MAC: ' . bin2hex($hash->hash($source)) . "\r\n";
825
-
826
- return $key;
827
- case self::PRIVATE_FORMAT_OPENSSH:
828
- if ($num_primes != 2) {
829
- return false;
830
- }
831
- $publicKey = pack('Na*Na*Na*', strlen('ssh-rsa'), 'ssh-rsa', strlen($raw['publicExponent']), $raw['publicExponent'], strlen($raw['modulus']), $raw['modulus']);
832
- $privateKey = pack(
833
- 'Na*Na*Na*Na*Na*Na*Na*',
834
- strlen('ssh-rsa'),
835
- 'ssh-rsa',
836
- strlen($raw['modulus']),
837
- $raw['modulus'],
838
- strlen($raw['publicExponent']),
839
- $raw['publicExponent'],
840
- strlen($raw['privateExponent']),
841
- $raw['privateExponent'],
842
- strlen($raw['coefficient']),
843
- $raw['coefficient'],
844
- strlen($raw['prime1']),
845
- $raw['prime1'],
846
- strlen($raw['prime2']),
847
- $raw['prime2']
848
- );
849
- $checkint = Random::string(4);
850
- $paddedKey = pack(
851
- 'a*Na*',
852
- $checkint . $checkint . $privateKey,
853
- strlen($this->comment),
854
- $this->comment
855
- );
856
- $paddingLength = (7 * strlen($paddedKey)) % 8;
857
- for ($i = 1; $i <= $paddingLength; $i++) {
858
- $paddedKey.= chr($i);
859
- }
860
- $key = pack(
861
- 'Na*Na*Na*NNa*Na*',
862
- strlen('none'),
863
- 'none',
864
- strlen('none'),
865
- 'none',
866
- 0,
867
- '',
868
- 1,
869
- strlen($publicKey),
870
- $publicKey,
871
- strlen($paddedKey),
872
- $paddedKey
873
- );
874
- $key = "openssh-key-v1\0$key";
875
-
876
- return "-----BEGIN OPENSSH PRIVATE KEY-----\r\n" .
877
- chunk_split(base64_encode($key), 70) .
878
- "-----END OPENSSH PRIVATE KEY-----";
879
- default: // eg. self::PRIVATE_FORMAT_PKCS1
880
- $components = array();
881
- foreach ($raw as $name => $value) {
882
- $components[$name] = pack('Ca*a*', self::ASN1_INTEGER, $this->_encodeLength(strlen($value)), $value);
883
- }
884
-
885
- $RSAPrivateKey = implode('', $components);
886
-
887
- if ($num_primes > 2) {
888
- $OtherPrimeInfos = '';
889
- for ($i = 3; $i <= $num_primes; $i++) {
890
- // OtherPrimeInfos ::= SEQUENCE SIZE(1..MAX) OF OtherPrimeInfo
891
- //
892
- // OtherPrimeInfo ::= SEQUENCE {
893
- // prime INTEGER, -- ri
894
- // exponent INTEGER, -- di
895
- // coefficient INTEGER -- ti
896
- // }
897
- $OtherPrimeInfo = pack('Ca*a*', self::ASN1_INTEGER, $this->_encodeLength(strlen($primes[$i]->toBytes(true))), $primes[$i]->toBytes(true));
898
- $OtherPrimeInfo.= pack('Ca*a*', self::ASN1_INTEGER, $this->_encodeLength(strlen($exponents[$i]->toBytes(true))), $exponents[$i]->toBytes(true));
899
- $OtherPrimeInfo.= pack('Ca*a*', self::ASN1_INTEGER, $this->_encodeLength(strlen($coefficients[$i]->toBytes(true))), $coefficients[$i]->toBytes(true));
900
- $OtherPrimeInfos.= pack('Ca*a*', self::ASN1_SEQUENCE, $this->_encodeLength(strlen($OtherPrimeInfo)), $OtherPrimeInfo);
901
- }
902
- $RSAPrivateKey.= pack('Ca*a*', self::ASN1_SEQUENCE, $this->_encodeLength(strlen($OtherPrimeInfos)), $OtherPrimeInfos);
903
- }
904
-
905
- $RSAPrivateKey = pack('Ca*a*', self::ASN1_SEQUENCE, $this->_encodeLength(strlen($RSAPrivateKey)), $RSAPrivateKey);
906
-
907
- if ($this->privateKeyFormat == self::PRIVATE_FORMAT_PKCS8) {
908
- $rsaOID = pack('H*', '300d06092a864886f70d0101010500'); // hex version of MA0GCSqGSIb3DQEBAQUA
909
- $RSAPrivateKey = pack(
910
- 'Ca*a*Ca*a*',
911
- self::ASN1_INTEGER,
912
- "\01\00",
913
- $rsaOID,
914
- 4,
915
- $this->_encodeLength(strlen($RSAPrivateKey)),
916
- $RSAPrivateKey
917
- );
918
- $RSAPrivateKey = pack('Ca*a*', self::ASN1_SEQUENCE, $this->_encodeLength(strlen($RSAPrivateKey)), $RSAPrivateKey);
919
- if (!empty($this->password) || is_string($this->password)) {
920
- $salt = Random::string(8);
921
- $iterationCount = 2048;
922
-
923
- $crypto = new DES();
924
- $crypto->setPassword($this->password, 'pbkdf1', 'md5', $salt, $iterationCount);
925
- $RSAPrivateKey = $crypto->encrypt($RSAPrivateKey);
926
-
927
- $parameters = pack(
928
- 'Ca*a*Ca*N',
929
- self::ASN1_OCTETSTRING,
930
- $this->_encodeLength(strlen($salt)),
931
- $salt,
932
- self::ASN1_INTEGER,
933
- $this->_encodeLength(4),
934
- $iterationCount
935
- );
936
- $pbeWithMD5AndDES_CBC = "\x2a\x86\x48\x86\xf7\x0d\x01\x05\x03";
937
-
938
- $encryptionAlgorithm = pack(
939
- 'Ca*a*Ca*a*',
940
- self::ASN1_OBJECT,
941
- $this->_encodeLength(strlen($pbeWithMD5AndDES_CBC)),
942
- $pbeWithMD5AndDES_CBC,
943
- self::ASN1_SEQUENCE,
944
- $this->_encodeLength(strlen($parameters)),
945
- $parameters
946
- );
947
-
948
- $RSAPrivateKey = pack(
949
- 'Ca*a*Ca*a*',
950
- self::ASN1_SEQUENCE,
951
- $this->_encodeLength(strlen($encryptionAlgorithm)),
952
- $encryptionAlgorithm,
953
- self::ASN1_OCTETSTRING,
954
- $this->_encodeLength(strlen($RSAPrivateKey)),
955
- $RSAPrivateKey
956
- );
957
-
958
- $RSAPrivateKey = pack('Ca*a*', self::ASN1_SEQUENCE, $this->_encodeLength(strlen($RSAPrivateKey)), $RSAPrivateKey);
959
-
960
- $RSAPrivateKey = "-----BEGIN ENCRYPTED PRIVATE KEY-----\r\n" .
961
- chunk_split(base64_encode($RSAPrivateKey), 64) .
962
- '-----END ENCRYPTED PRIVATE KEY-----';
963
- } else {
964
- $RSAPrivateKey = "-----BEGIN PRIVATE KEY-----\r\n" .
965
- chunk_split(base64_encode($RSAPrivateKey), 64) .
966
- '-----END PRIVATE KEY-----';
967
- }
968
- return $RSAPrivateKey;
969
- }
970
-
971
- if (!empty($this->password) || is_string($this->password)) {
972
- $iv = Random::string(8);
973
- $symkey = pack('H*', md5($this->password . $iv)); // symkey is short for symmetric key
974
- $symkey.= substr(pack('H*', md5($symkey . $this->password . $iv)), 0, 8);
975
- $des = new TripleDES();
976
- $des->setKey($symkey);
977
- $des->setIV($iv);
978
- $iv = strtoupper(bin2hex($iv));
979
- $RSAPrivateKey = "-----BEGIN RSA PRIVATE KEY-----\r\n" .
980
- "Proc-Type: 4,ENCRYPTED\r\n" .
981
- "DEK-Info: DES-EDE3-CBC,$iv\r\n" .
982
- "\r\n" .
983
- chunk_split(base64_encode($des->encrypt($RSAPrivateKey)), 64) .
984
- '-----END RSA PRIVATE KEY-----';
985
- } else {
986
- $RSAPrivateKey = "-----BEGIN RSA PRIVATE KEY-----\r\n" .
987
- chunk_split(base64_encode($RSAPrivateKey), 64) .
988
- '-----END RSA PRIVATE KEY-----';
989
- }
990
-
991
- return $RSAPrivateKey;
992
- }
993
- }
994
-
995
- /**
996
- * Convert a public key to the appropriate format
997
- *
998
- * @access private
999
- * @see self::setPublicKeyFormat()
1000
- * @param string $RSAPrivateKey
1001
- * @return string
1002
- */
1003
- function _convertPublicKey($n, $e)
1004
- {
1005
- $signed = $this->publicKeyFormat != self::PUBLIC_FORMAT_XML;
1006
-
1007
- $modulus = $n->toBytes($signed);
1008
- $publicExponent = $e->toBytes($signed);
1009
-
1010
- switch ($this->publicKeyFormat) {
1011
- case self::PUBLIC_FORMAT_RAW:
1012
- return array('e' => $e->copy(), 'n' => $n->copy());
1013
- case self::PUBLIC_FORMAT_XML:
1014
- return "<RSAKeyValue>\r\n" .
1015
- ' <Modulus>' . base64_encode($modulus) . "</Modulus>\r\n" .
1016
- ' <Exponent>' . base64_encode($publicExponent) . "</Exponent>\r\n" .
1017
- '</RSAKeyValue>';
1018
- break;
1019
- case self::PUBLIC_FORMAT_OPENSSH:
1020
- // from <http://tools.ietf.org/html/rfc4253#page-15>:
1021
- // string "ssh-rsa"
1022
- // mpint e
1023
- // mpint n
1024
- $RSAPublicKey = pack('Na*Na*Na*', strlen('ssh-rsa'), 'ssh-rsa', strlen($publicExponent), $publicExponent, strlen($modulus), $modulus);
1025
- $RSAPublicKey = 'ssh-rsa ' . base64_encode($RSAPublicKey) . ' ' . $this->comment;
1026
-
1027
- return $RSAPublicKey;
1028
- default: // eg. self::PUBLIC_FORMAT_PKCS1_RAW or self::PUBLIC_FORMAT_PKCS1
1029
- // from <http://tools.ietf.org/html/rfc3447#appendix-A.1.1>:
1030
- // RSAPublicKey ::= SEQUENCE {
1031
- // modulus INTEGER, -- n
1032
- // publicExponent INTEGER -- e
1033
- // }
1034
- $components = array(
1035
- 'modulus' => pack('Ca*a*', self::ASN1_INTEGER, $this->_encodeLength(strlen($modulus)), $modulus),
1036
- 'publicExponent' => pack('Ca*a*', self::ASN1_INTEGER, $this->_encodeLength(strlen($publicExponent)), $publicExponent)
1037
- );
1038
-
1039
- $RSAPublicKey = pack(
1040
- 'Ca*a*a*',
1041
- self::ASN1_SEQUENCE,
1042
- $this->_encodeLength(strlen($components['modulus']) + strlen($components['publicExponent'])),
1043
- $components['modulus'],
1044
- $components['publicExponent']
1045
- );
1046
-
1047
- if ($this->publicKeyFormat == self::PUBLIC_FORMAT_PKCS1_RAW) {
1048
- $RSAPublicKey = "-----BEGIN RSA PUBLIC KEY-----\r\n" .
1049
- chunk_split(base64_encode($RSAPublicKey), 64) .
1050
- '-----END RSA PUBLIC KEY-----';
1051
- } else {
1052
- // sequence(oid(1.2.840.113549.1.1.1), null)) = rsaEncryption.
1053
- $rsaOID = pack('H*', '300d06092a864886f70d0101010500'); // hex version of MA0GCSqGSIb3DQEBAQUA
1054
- $RSAPublicKey = chr(0) . $RSAPublicKey;
1055
- $RSAPublicKey = chr(3) . $this->_encodeLength(strlen($RSAPublicKey)) . $RSAPublicKey;
1056
-
1057
- $RSAPublicKey = pack(
1058
- 'Ca*a*',
1059
- self::ASN1_SEQUENCE,
1060
- $this->_encodeLength(strlen($rsaOID . $RSAPublicKey)),
1061
- $rsaOID . $RSAPublicKey
1062
- );
1063
-
1064
- $RSAPublicKey = "-----BEGIN PUBLIC KEY-----\r\n" .
1065
- chunk_split(base64_encode($RSAPublicKey), 64) .
1066
- '-----END PUBLIC KEY-----';
1067
- }
1068
-
1069
- return $RSAPublicKey;
1070
- }
1071
- }
1072
-
1073
- /**
1074
- * Break a public or private key down into its constituant components
1075
- *
1076
- * @access private
1077
- * @see self::_convertPublicKey()
1078
- * @see self::_convertPrivateKey()
1079
- * @param string|array $key
1080
- * @param int $type
1081
- * @return array|bool
1082
- */
1083
- function _parseKey($key, $type)
1084
- {
1085
- if ($type != self::PUBLIC_FORMAT_RAW && !is_string($key)) {
1086
- return false;
1087
- }
1088
-
1089
- switch ($type) {
1090
- case self::PUBLIC_FORMAT_RAW:
1091
- if (!is_array($key)) {
1092
- return false;
1093
- }
1094
- $components = array();
1095
- switch (true) {
1096
- case isset($key['e']):
1097
- $components['publicExponent'] = $key['e']->copy();
1098
- break;
1099
- case isset($key['exponent']):
1100
- $components['publicExponent'] = $key['exponent']->copy();
1101
- break;
1102
- case isset($key['publicExponent']):
1103
- $components['publicExponent'] = $key['publicExponent']->copy();
1104
- break;
1105
- case isset($key[0]):
1106
- $components['publicExponent'] = $key[0]->copy();
1107
- }
1108
- switch (true) {
1109
- case isset($key['n']):
1110
- $components['modulus'] = $key['n']->copy();
1111
- break;
1112
- case isset($key['modulo']):
1113
- $components['modulus'] = $key['modulo']->copy();
1114
- break;
1115
- case isset($key['modulus']):
1116
- $components['modulus'] = $key['modulus']->copy();
1117
- break;
1118
- case isset($key[1]):
1119
- $components['modulus'] = $key[1]->copy();
1120
- }
1121
- return isset($components['modulus']) && isset($components['publicExponent']) ? $components : false;
1122
- case self::PRIVATE_FORMAT_PKCS1:
1123
- case self::PRIVATE_FORMAT_PKCS8:
1124
- case self::PUBLIC_FORMAT_PKCS1:
1125
- /* Although PKCS#1 proposes a format that public and private keys can use, encrypting them is
1126
- "outside the scope" of PKCS#1. PKCS#1 then refers you to PKCS#12 and PKCS#15 if you're wanting to
1127
- protect private keys, however, that's not what OpenSSL* does. OpenSSL protects private keys by adding
1128
- two new "fields" to the key - DEK-Info and Proc-Type. These fields are discussed here:
1129
-
1130
- http://tools.ietf.org/html/rfc1421#section-4.6.1.1
1131
- http://tools.ietf.org/html/rfc1421#section-4.6.1.3
1132
-
1133
- DES-EDE3-CBC as an algorithm, however, is not discussed anywhere, near as I can tell.
1134
- DES-CBC and DES-EDE are discussed in RFC1423, however, DES-EDE3-CBC isn't, nor is its key derivation
1135
- function. As is, the definitive authority on this encoding scheme isn't the IETF but rather OpenSSL's
1136
- own implementation. ie. the implementation *is* the standard and any bugs that may exist in that
1137
- implementation are part of the standard, as well.
1138
-
1139
- * OpenSSL is the de facto standard. It's utilized by OpenSSH and other projects */
1140
- if (preg_match('#DEK-Info: (.+),(.+)#', $key, $matches)) {
1141
- $iv = pack('H*', trim($matches[2]));
1142
- $symkey = pack('H*', md5($this->password . substr($iv, 0, 8))); // symkey is short for symmetric key
1143
- $symkey.= pack('H*', md5($symkey . $this->password . substr($iv, 0, 8)));
1144
- // remove the Proc-Type / DEK-Info sections as they're no longer needed
1145
- $key = preg_replace('#^(?:Proc-Type|DEK-Info): .*#m', '', $key);
1146
- $ciphertext = $this->_extractBER($key);
1147
- if ($ciphertext === false) {
1148
- $ciphertext = $key;
1149
- }
1150
- switch ($matches[1]) {
1151
- case 'AES-256-CBC':
1152
- $crypto = new AES();
1153
- break;
1154
- case 'AES-128-CBC':
1155
- $symkey = substr($symkey, 0, 16);
1156
- $crypto = new AES();
1157
- break;
1158
- case 'DES-EDE3-CFB':
1159
- $crypto = new TripleDES(Base::MODE_CFB);
1160
- break;
1161
- case 'DES-EDE3-CBC':
1162
- $symkey = substr($symkey, 0, 24);
1163
- $crypto = new TripleDES();
1164
- break;
1165
- case 'DES-CBC':
1166
- $crypto = new DES();
1167
- break;
1168
- default:
1169
- return false;
1170
- }
1171
- $crypto->setKey($symkey);
1172
- $crypto->setIV($iv);
1173
- $decoded = $crypto->decrypt($ciphertext);
1174
- } else {
1175
- $decoded = $this->_extractBER($key);
1176
- }
1177
-
1178
- if ($decoded !== false) {
1179
- $key = $decoded;
1180
- }
1181
-
1182
- $components = array();
1183
-
1184
- if (ord($this->_string_shift($key)) != self::ASN1_SEQUENCE) {
1185
- return false;
1186
- }
1187
- if ($this->_decodeLength($key) != strlen($key)) {
1188
- return false;
1189
- }
1190
-
1191
- $tag = ord($this->_string_shift($key));
1192
- /* intended for keys for which OpenSSL's asn1parse returns the following:
1193
-
1194
- 0:d=0 hl=4 l= 631 cons: SEQUENCE
1195
- 4:d=1 hl=2 l= 1 prim: INTEGER :00
1196
- 7:d=1 hl=2 l= 13 cons: SEQUENCE
1197
- 9:d=2 hl=2 l= 9 prim: OBJECT :rsaEncryption
1198
- 20:d=2 hl=2 l= 0 prim: NULL
1199
- 22:d=1 hl=4 l= 609 prim: OCTET STRING
1200
-
1201
- ie. PKCS8 keys*/
1202
-
1203
- if ($tag == self::ASN1_INTEGER && substr($key, 0, 3) == "\x01\x00\x30") {
1204
- $this->_string_shift($key, 3);
1205
- $tag = self::ASN1_SEQUENCE;
1206
- }
1207
-
1208
- if ($tag == self::ASN1_SEQUENCE) {
1209
- $temp = $this->_string_shift($key, $this->_decodeLength($key));
1210
- if (ord($this->_string_shift($temp)) != self::ASN1_OBJECT) {
1211
- return false;
1212
- }
1213
- $length = $this->_decodeLength($temp);
1214
- switch ($this->_string_shift($temp, $length)) {
1215
- case "\x2a\x86\x48\x86\xf7\x0d\x01\x01\x01": // rsaEncryption
1216
- break;
1217
- case "\x2a\x86\x48\x86\xf7\x0d\x01\x05\x03": // pbeWithMD5AndDES-CBC
1218
- /*
1219
- PBEParameter ::= SEQUENCE {
1220
- salt OCTET STRING (SIZE(8)),
1221
- iterationCount INTEGER }
1222
- */
1223
- if (ord($this->_string_shift($temp)) != self::ASN1_SEQUENCE) {
1224
- return false;
1225
- }
1226
- if ($this->_decodeLength($temp) != strlen($temp)) {
1227
- return false;
1228
- }
1229
- $this->_string_shift($temp); // assume it's an octet string
1230
- $salt = $this->_string_shift($temp, $this->_decodeLength($temp));
1231
- if (ord($this->_string_shift($temp)) != self::ASN1_INTEGER) {
1232
- return false;
1233
- }
1234
- $this->_decodeLength($temp);
1235
- list(, $iterationCount) = unpack('N', str_pad($temp, 4, chr(0), STR_PAD_LEFT));
1236
- $this->_string_shift($key); // assume it's an octet string
1237
- $length = $this->_decodeLength($key);
1238
- if (strlen($key) != $length) {
1239
- return false;
1240
- }
1241
-
1242
- $crypto = new DES();
1243
- $crypto->setPassword($this->password, 'pbkdf1', 'md5', $salt, $iterationCount);
1244
- $key = $crypto->decrypt($key);
1245
- if ($key === false) {
1246
- return false;
1247
- }
1248
- return $this->_parseKey($key, self::PRIVATE_FORMAT_PKCS1);
1249
- default:
1250
- return false;
1251
- }
1252
- /* intended for keys for which OpenSSL's asn1parse returns the following:
1253
-
1254
- 0:d=0 hl=4 l= 290 cons: SEQUENCE
1255
- 4:d=1 hl=2 l= 13 cons: SEQUENCE
1256
- 6:d=2 hl=2 l= 9 prim: OBJECT :rsaEncryption
1257
- 17:d=2 hl=2 l= 0 prim: NULL
1258
- 19:d=1 hl=4 l= 271 prim: BIT STRING */
1259
- $tag = ord($this->_string_shift($key)); // skip over the BIT STRING / OCTET STRING tag
1260
- $this->_decodeLength($key); // skip over the BIT STRING / OCTET STRING length
1261
- // "The initial octet shall encode, as an unsigned binary integer wtih bit 1 as the least significant bit, the number of
1262
- // unused bits in the final subsequent octet. The number shall be in the range zero to seven."
1263
- // -- http://www.itu.int/ITU-T/studygroups/com17/languages/X.690-0207.pdf (section 8.6.2.2)
1264
- if ($tag == self::ASN1_BITSTRING) {
1265
- $this->_string_shift($key);
1266
- }
1267
- if (ord($this->_string_shift($key)) != self::ASN1_SEQUENCE) {
1268
- return false;
1269
- }
1270
- if ($this->_decodeLength($key) != strlen($key)) {
1271
- return false;
1272
- }
1273
- $tag = ord($this->_string_shift($key));
1274
- }
1275
- if ($tag != self::ASN1_INTEGER) {
1276
- return false;
1277
- }
1278
-
1279
- $length = $this->_decodeLength($key);
1280
- $temp = $this->_string_shift($key, $length);
1281
- if (strlen($temp) != 1 || ord($temp) > 2) {
1282
- $components['modulus'] = new BigInteger($temp, 256);
1283
- $this->_string_shift($key); // skip over self::ASN1_INTEGER
1284
- $length = $this->_decodeLength($key);
1285
- $components[$type == self::PUBLIC_FORMAT_PKCS1 ? 'publicExponent' : 'privateExponent'] = new BigInteger($this->_string_shift($key, $length), 256);
1286
-
1287
- return $components;
1288
- }
1289
- if (ord($this->_string_shift($key)) != self::ASN1_INTEGER) {
1290
- return false;
1291
- }
1292
- $length = $this->_decodeLength($key);
1293
- $components['modulus'] = new BigInteger($this->_string_shift($key, $length), 256);
1294
- $this->_string_shift($key);
1295
- $length = $this->_decodeLength($key);
1296
- $components['publicExponent'] = new BigInteger($this->_string_shift($key, $length), 256);
1297
- $this->_string_shift($key);
1298
- $length = $this->_decodeLength($key);
1299
- $components['privateExponent'] = new BigInteger($this->_string_shift($key, $length), 256);
1300
- $this->_string_shift($key);
1301
- $length = $this->_decodeLength($key);
1302
- $components['primes'] = array(1 => new BigInteger($this->_string_shift($key, $length), 256));
1303
- $this->_string_shift($key);
1304
- $length = $this->_decodeLength($key);
1305
- $components['primes'][] = new BigInteger($this->_string_shift($key, $length), 256);
1306
- $this->_string_shift($key);
1307
- $length = $this->_decodeLength($key);
1308
- $components['exponents'] = array(1 => new BigInteger($this->_string_shift($key, $length), 256));
1309
- $this->_string_shift($key);
1310
- $length = $this->_decodeLength($key);
1311
- $components['exponents'][] = new BigInteger($this->_string_shift($key, $length), 256);
1312
- $this->_string_shift($key);
1313
- $length = $this->_decodeLength($key);
1314
- $components['coefficients'] = array(2 => new BigInteger($this->_string_shift($key, $length), 256));
1315
-
1316
- if (!empty($key)) {
1317
- if (ord($this->_string_shift($key)) != self::ASN1_SEQUENCE) {
1318
- return false;
1319
- }
1320
- $this->_decodeLength($key);
1321
- while (!empty($key)) {
1322
- if (ord($this->_string_shift($key)) != self::ASN1_SEQUENCE) {
1323
- return false;
1324
- }
1325
- $this->_decodeLength($key);
1326
- $key = substr($key, 1);
1327
- $length = $this->_decodeLength($key);
1328
- $components['primes'][] = new BigInteger($this->_string_shift($key, $length), 256);
1329
- $this->_string_shift($key);
1330
- $length = $this->_decodeLength($key);
1331
- $components['exponents'][] = new BigInteger($this->_string_shift($key, $length), 256);
1332
- $this->_string_shift($key);
1333
- $length = $this->_decodeLength($key);
1334
- $components['coefficients'][] = new BigInteger($this->_string_shift($key, $length), 256);
1335
- }
1336
- }
1337
-
1338
- return $components;
1339
- case self::PUBLIC_FORMAT_OPENSSH:
1340
- $parts = explode(' ', $key, 3);
1341
-
1342
- $key = isset($parts[1]) ? base64_decode($parts[1]) : false;
1343
- if ($key === false) {
1344
- return false;
1345
- }
1346
-
1347
- $comment = isset($parts[2]) ? $parts[2] : false;
1348
-
1349
- $cleanup = substr($key, 0, 11) == "\0\0\0\7ssh-rsa";
1350
-
1351
- if (strlen($key) <= 4) {
1352
- return false;
1353
- }
1354
- extract(unpack('Nlength', $this->_string_shift($key, 4)));
1355
- $publicExponent = new BigInteger($this->_string_shift($key, $length), -256);
1356
- if (strlen($key) <= 4) {
1357
- return false;
1358
- }
1359
- extract(unpack('Nlength', $this->_string_shift($key, 4)));
1360
- $modulus = new BigInteger($this->_string_shift($key, $length), -256);
1361
-
1362
- if ($cleanup && strlen($key)) {
1363
- if (strlen($key) <= 4) {
1364
- return false;
1365
- }
1366
- extract(unpack('Nlength', $this->_string_shift($key, 4)));
1367
- $realModulus = new BigInteger($this->_string_shift($key, $length), -256);
1368
- return strlen($key) ? false : array(
1369
- 'modulus' => $realModulus,
1370
- 'publicExponent' => $modulus,
1371
- 'comment' => $comment
1372
- );
1373
- } else {
1374
- return strlen($key) ? false : array(
1375
- 'modulus' => $modulus,
1376
- 'publicExponent' => $publicExponent,
1377
- 'comment' => $comment
1378
- );
1379
- }
1380
- // http://www.w3.org/TR/xmldsig-core/#sec-RSAKeyValue
1381
- // http://en.wikipedia.org/wiki/XML_Signature
1382
- case self::PRIVATE_FORMAT_XML:
1383
- case self::PUBLIC_FORMAT_XML:
1384
- $this->components = array();
1385
-
1386
- $xml = xml_parser_create('UTF-8');
1387
- xml_set_object($xml, $this);
1388
- xml_set_element_handler($xml, '_start_element_handler', '_stop_element_handler');
1389
- xml_set_character_data_handler($xml, '_data_handler');
1390
- // add <xml></xml> to account for "dangling" tags like <BitStrength>...</BitStrength> that are sometimes added
1391
- if (!xml_parse($xml, '<xml>' . $key . '</xml>')) {
1392
- xml_parser_free($xml);
1393
- unset($xml);
1394
- return false;
1395
- }
1396
-
1397
- xml_parser_free($xml);
1398
- unset($xml);
1399
-
1400
- return isset($this->components['modulus']) && isset($this->components['publicExponent']) ? $this->components : false;
1401
- // from PuTTY's SSHPUBK.C
1402
- case self::PRIVATE_FORMAT_PUTTY:
1403
- $components = array();
1404
- $key = preg_split('#\r\n|\r|\n#', $key);
1405
- $type = trim(preg_replace('#PuTTY-User-Key-File-2: (.+)#', '$1', $key[0]));
1406
- if ($type != 'ssh-rsa') {
1407
- return false;
1408
- }
1409
- $encryption = trim(preg_replace('#Encryption: (.+)#', '$1', $key[1]));
1410
- $comment = trim(preg_replace('#Comment: (.+)#', '$1', $key[2]));
1411
-
1412
- $publicLength = trim(preg_replace('#Public-Lines: (\d+)#', '$1', $key[3]));
1413
- $public = base64_decode(implode('', array_map('trim', array_slice($key, 4, $publicLength))));
1414
- $public = substr($public, 11);
1415
- extract(unpack('Nlength', $this->_string_shift($public, 4)));
1416
- $components['publicExponent'] = new BigInteger($this->_string_shift($public, $length), -256);
1417
- extract(unpack('Nlength', $this->_string_shift($public, 4)));
1418
- $components['modulus'] = new BigInteger($this->_string_shift($public, $length), -256);
1419
-
1420
- $privateLength = trim(preg_replace('#Private-Lines: (\d+)#', '$1', $key[$publicLength + 4]));
1421
- $private = base64_decode(implode('', array_map('trim', array_slice($key, $publicLength + 5, $privateLength))));
1422
-
1423
- switch ($encryption) {
1424
- case 'aes256-cbc':
1425
- $symkey = '';
1426
- $sequence = 0;
1427
- while (strlen($symkey) < 32) {
1428
- $temp = pack('Na*', $sequence++, $this->password);
1429
- $symkey.= pack('H*', sha1($temp));
1430
- }
1431
- $symkey = substr($symkey, 0, 32);
1432
- $crypto = new AES();
1433
- }
1434
-
1435
- if ($encryption != 'none') {
1436
- $crypto->setKey($symkey);
1437
- $crypto->disablePadding();
1438
- $private = $crypto->decrypt($private);
1439
- if ($private === false) {
1440
- return false;
1441
- }
1442
- }
1443
-
1444
- extract(unpack('Nlength', $this->_string_shift($private, 4)));
1445
- if (strlen($private) < $length) {
1446
- return false;
1447
- }
1448
- $components['privateExponent'] = new BigInteger($this->_string_shift($private, $length), -256);
1449
- extract(unpack('Nlength', $this->_string_shift($private, 4)));
1450
- if (strlen($private) < $length) {
1451
- return false;
1452
- }
1453
- $components['primes'] = array(1 => new BigInteger($this->_string_shift($private, $length), -256));
1454
- extract(unpack('Nlength', $this->_string_shift($private, 4)));
1455
- if (strlen($private) < $length) {
1456
- return false;
1457
- }
1458
- $components['primes'][] = new BigInteger($this->_string_shift($private, $length), -256);
1459
-
1460
- $temp = $components['primes'][1]->subtract($this->one);
1461
- $components['exponents'] = array(1 => $components['publicExponent']->modInverse($temp));
1462
- $temp = $components['primes'][2]->subtract($this->one);
1463
- $components['exponents'][] = $components['publicExponent']->modInverse($temp);
1464
-
1465
- extract(unpack('Nlength', $this->_string_shift($private, 4)));
1466
- if (strlen($private) < $length) {
1467
- return false;
1468
- }
1469
- $components['coefficients'] = array(2 => new BigInteger($this->_string_shift($private, $length), -256));
1470
-
1471
- return $components;
1472
- case self::PRIVATE_FORMAT_OPENSSH:
1473
- $components = array();
1474
- $decoded = $this->_extractBER($key);
1475
- $magic = $this->_string_shift($decoded, 15);
1476
- if ($magic !== "openssh-key-v1\0") {
1477
- return false;
1478
- }
1479
- $options = $this->_string_shift($decoded, 24);
1480
- // \0\0\0\4none = ciphername
1481
- // \0\0\0\4none = kdfname
1482
- // \0\0\0\0 = kdfoptions
1483
- // \0\0\0\1 = numkeys
1484
- if ($options != "\0\0\0\4none\0\0\0\4none\0\0\0\0\0\0\0\1") {
1485
- return false;
1486
- }
1487
- extract(unpack('Nlength', $this->_string_shift($decoded, 4)));
1488
- if (strlen($decoded) < $length) {
1489
- return false;
1490
- }
1491
- $publicKey = $this->_string_shift($decoded, $length);
1492
- extract(unpack('Nlength', $this->_string_shift($decoded, 4)));
1493
- if (strlen($decoded) < $length) {
1494
- return false;
1495
- }
1496
- $paddedKey = $this->_string_shift($decoded, $length);
1497
-
1498
- if ($this->_string_shift($publicKey, 11) !== "\0\0\0\7ssh-rsa") {
1499
- return false;
1500
- }
1501
-
1502
- $checkint1 = $this->_string_shift($paddedKey, 4);
1503
- $checkint2 = $this->_string_shift($paddedKey, 4);
1504
- if (strlen($checkint1) != 4 || $checkint1 !== $checkint2) {
1505
- return false;
1506
- }
1507
-
1508
- if ($this->_string_shift($paddedKey, 11) !== "\0\0\0\7ssh-rsa") {
1509
- return false;
1510
- }
1511
-
1512
- $values = array(
1513
- &$components['modulus'],
1514
- &$components['publicExponent'],
1515
- &$components['privateExponent'],
1516
- &$components['coefficients'][2],
1517
- &$components['primes'][1],
1518
- &$components['primes'][2]
1519
- );
1520
-
1521
- foreach ($values as &$value) {
1522
- extract(unpack('Nlength', $this->_string_shift($paddedKey, 4)));
1523
- if (strlen($paddedKey) < $length) {
1524
- return false;
1525
- }
1526
- $value = new BigInteger($this->_string_shift($paddedKey, $length), -256);
1527
- }
1528
-
1529
- extract(unpack('Nlength', $this->_string_shift($paddedKey, 4)));
1530
- if (strlen($paddedKey) < $length) {
1531
- return false;
1532
- }
1533
- $components['comment'] = $this->_string_shift($decoded, $length);
1534
-
1535
- $temp = $components['primes'][1]->subtract($this->one);
1536
- $components['exponents'] = array(1 => $components['publicExponent']->modInverse($temp));
1537
- $temp = $components['primes'][2]->subtract($this->one);
1538
- $components['exponents'][] = $components['publicExponent']->modInverse($temp);
1539
-
1540
- return $components;
1541
- }
1542
- }
1543
-
1544
- /**
1545
- * Returns the key size
1546
- *
1547
- * More specifically, this returns the size of the modulo in bits.
1548
- *
1549
- * @access public
1550
- * @return int
1551
- */
1552
- function getSize()
1553
- {
1554
- return !isset($this->modulus) ? 0 : strlen($this->modulus->toBits());
1555
- }
1556
-
1557
- /**
1558
- * Start Element Handler
1559
- *
1560
- * Called by xml_set_element_handler()
1561
- *
1562
- * @access private
1563
- * @param resource $parser
1564
- * @param string $name
1565
- * @param array $attribs
1566
- */
1567
- function _start_element_handler($parser, $name, $attribs)
1568
- {
1569
- //$name = strtoupper($name);
1570
- switch ($name) {
1571
- case 'MODULUS':
1572
- $this->current = &$this->components['modulus'];
1573
- break;
1574
- case 'EXPONENT':
1575
- $this->current = &$this->components['publicExponent'];
1576
- break;
1577
- case 'P':
1578
- $this->current = &$this->components['primes'][1];
1579
- break;
1580
- case 'Q':
1581
- $this->current = &$this->components['primes'][2];
1582
- break;
1583
- case 'DP':
1584
- $this->current = &$this->components['exponents'][1];
1585
- break;
1586
- case 'DQ':
1587
- $this->current = &$this->components['exponents'][2];
1588
- break;
1589
- case 'INVERSEQ':
1590
- $this->current = &$this->components['coefficients'][2];
1591
- break;
1592
- case 'D':
1593
- $this->current = &$this->components['privateExponent'];
1594
- }
1595
- $this->current = '';
1596
- }
1597
-
1598
- /**
1599
- * Stop Element Handler
1600
- *
1601
- * Called by xml_set_element_handler()
1602
- *
1603
- * @access private
1604
- * @param resource $parser
1605
- * @param string $name
1606
- */
1607
- function _stop_element_handler($parser, $name)
1608
- {
1609
- if (isset($this->current)) {
1610
- $this->current = new BigInteger(base64_decode($this->current), 256);
1611
- unset($this->current);
1612
- }
1613
- }
1614
-
1615
- /**
1616
- * Data Handler
1617
- *
1618
- * Called by xml_set_character_data_handler()
1619
- *
1620
- * @access private
1621
- * @param resource $parser
1622
- * @param string $data
1623
- */
1624
- function _data_handler($parser, $data)
1625
- {
1626
- if (!isset($this->current) || is_object($this->current)) {
1627
- return;
1628
- }
1629
- $this->current.= trim($data);
1630
- }
1631
-
1632
- /**
1633
- * Loads a public or private key
1634
- *
1635
- * Returns true on success and false on failure (ie. an incorrect password was provided or the key was malformed)
1636
- *
1637
- * @access public
1638
- * @param string|RSA|array $key
1639
- * @param bool|int $type optional
1640
- * @return bool
1641
- */
1642
- function loadKey($key, $type = false)
1643
- {
1644
- if ($key instanceof RSA) {
1645
- $this->privateKeyFormat = $key->privateKeyFormat;
1646
- $this->publicKeyFormat = $key->publicKeyFormat;
1647
- $this->k = $key->k;
1648
- $this->hLen = $key->hLen;
1649
- $this->sLen = $key->sLen;
1650
- $this->mgfHLen = $key->mgfHLen;
1651
- $this->encryptionMode = $key->encryptionMode;
1652
- $this->signatureMode = $key->signatureMode;
1653
- $this->password = $key->password;
1654
- $this->configFile = $key->configFile;
1655
- $this->comment = $key->comment;
1656
-
1657
- if (is_object($key->hash)) {
1658
- $this->hash = new Hash($key->hash->getHash());
1659
- }
1660
- if (is_object($key->mgfHash)) {
1661
- $this->mgfHash = new Hash($key->mgfHash->getHash());
1662
- }
1663
-
1664
- if (is_object($key->modulus)) {
1665
- $this->modulus = $key->modulus->copy();
1666
- }
1667
- if (is_object($key->exponent)) {
1668
- $this->exponent = $key->exponent->copy();
1669
- }
1670
- if (is_object($key->publicExponent)) {
1671
- $this->publicExponent = $key->publicExponent->copy();
1672
- }
1673
-
1674
- $this->primes = array();
1675
- $this->exponents = array();
1676
- $this->coefficients = array();
1677
-
1678
- foreach ($this->primes as $prime) {
1679
- $this->primes[] = $prime->copy();
1680
- }
1681
- foreach ($this->exponents as $exponent) {
1682
- $this->exponents[] = $exponent->copy();
1683
- }
1684
- foreach ($this->coefficients as $coefficient) {
1685
- $this->coefficients[] = $coefficient->copy();
1686
- }
1687
-
1688
- return true;
1689
- }
1690
-
1691
- if ($type === false) {
1692
- $types = array(
1693
- self::PUBLIC_FORMAT_RAW,
1694
- self::PRIVATE_FORMAT_PKCS1,
1695
- self::PRIVATE_FORMAT_XML,
1696
- self::PRIVATE_FORMAT_PUTTY,
1697
- self::PUBLIC_FORMAT_OPENSSH,
1698
- self::PRIVATE_FORMAT_OPENSSH
1699
- );
1700
- foreach ($types as $type) {
1701
- $components = $this->_parseKey($key, $type);
1702
- if ($components !== false) {
1703
- break;
1704
- }
1705
- }
1706
- } else {
1707
- $components = $this->_parseKey($key, $type);
1708
- }
1709
-
1710
- if ($components === false) {
1711
- $this->comment = null;
1712
- $this->modulus = null;
1713
- $this->k = null;
1714
- $this->exponent = null;
1715
- $this->primes = null;
1716
- $this->exponents = null;
1717
- $this->coefficients = null;
1718
- $this->publicExponent = null;
1719
-
1720
- return false;
1721
- }
1722
-
1723
- if (isset($components['comment']) && $components['comment'] !== false) {
1724
- $this->comment = $components['comment'];
1725
- }
1726
- $this->modulus = $components['modulus'];
1727
- $this->k = strlen($this->modulus->toBytes());
1728
- $this->exponent = isset($components['privateExponent']) ? $components['privateExponent'] : $components['publicExponent'];
1729
- if (isset($components['primes'])) {
1730
- $this->primes = $components['primes'];
1731
- $this->exponents = $components['exponents'];
1732
- $this->coefficients = $components['coefficients'];
1733
- $this->publicExponent = $components['publicExponent'];
1734
- } else {
1735
- $this->primes = array();
1736
- $this->exponents = array();
1737
- $this->coefficients = array();
1738
- $this->publicExponent = false;
1739
- }
1740
-
1741
- switch ($type) {
1742
- case self::PUBLIC_FORMAT_OPENSSH:
1743
- case self::PUBLIC_FORMAT_RAW:
1744
- $this->setPublicKey();
1745
- break;
1746
- case self::PRIVATE_FORMAT_PKCS1:
1747
- switch (true) {
1748
- case strpos($key, '-BEGIN PUBLIC KEY-') !== false:
1749
- case strpos($key, '-BEGIN RSA PUBLIC KEY-') !== false:
1750
- $this->setPublicKey();
1751
- }
1752
- }
1753
-
1754
- return true;
1755
- }
1756
-
1757
- /**
1758
- * Sets the password
1759
- *
1760
- * Private keys can be encrypted with a password. To unset the password, pass in the empty string or false.
1761
- * Or rather, pass in $password such that empty($password) && !is_string($password) is true.
1762
- *
1763
- * @see self::createKey()
1764
- * @see self::loadKey()
1765
- * @access public
1766
- * @param string $password
1767
- */
1768
- function setPassword($password = false)
1769
- {
1770
- $this->password = $password;
1771
- }
1772
-
1773
- /**
1774
- * Defines the public key
1775
- *
1776
- * Some private key formats define the public exponent and some don't. Those that don't define it are problematic when
1777
- * used in certain contexts. For example, in SSH-2, RSA authentication works by sending the public key along with a
1778
- * message signed by the private key to the server. The SSH-2 server looks the public key up in an index of public keys
1779
- * and if it's present then proceeds to verify the signature. Problem is, if your private key doesn't include the public
1780
- * exponent this won't work unless you manually add the public exponent. phpseclib tries to guess if the key being used
1781
- * is the public key but in the event that it guesses incorrectly you might still want to explicitly set the key as being
1782
- * public.
1783
- *
1784
- * Do note that when a new key is loaded the index will be cleared.
1785
- *
1786
- * Returns true on success, false on failure
1787
- *
1788
- * @see self::getPublicKey()
1789
- * @access public
1790
- * @param string $key optional
1791
- * @param int $type optional
1792
- * @return bool
1793
- */
1794
- function setPublicKey($key = false, $type = false)
1795
- {
1796
- // if a public key has already been loaded return false
1797
- if (!empty($this->publicExponent)) {
1798
- return false;
1799
- }
1800
-
1801
- if ($key === false && !empty($this->modulus)) {
1802
- $this->publicExponent = $this->exponent;
1803
- return true;
1804
- }
1805
-
1806
- if ($type === false) {
1807
- $types = array(
1808
- self::PUBLIC_FORMAT_RAW,
1809
- self::PUBLIC_FORMAT_PKCS1,
1810
- self::PUBLIC_FORMAT_XML,
1811
- self::PUBLIC_FORMAT_OPENSSH
1812
- );
1813
- foreach ($types as $type) {
1814
- $components = $this->_parseKey($key, $type);
1815
- if ($components !== false) {
1816
- break;
1817
- }
1818
- }
1819
- } else {
1820
- $components = $this->_parseKey($key, $type);
1821
- }
1822
-
1823
- if ($components === false) {
1824
- return false;
1825
- }
1826
-
1827
- if (empty($this->modulus) || !$this->modulus->equals($components['modulus'])) {
1828
- $this->modulus = $components['modulus'];
1829
- $this->exponent = $this->publicExponent = $components['publicExponent'];
1830
- return true;
1831
- }
1832
-
1833
- $this->publicExponent = $components['publicExponent'];
1834
-
1835
- return true;
1836
- }
1837
-
1838
- /**
1839
- * Defines the private key
1840
- *
1841
- * If phpseclib guessed a private key was a public key and loaded it as such it might be desirable to force
1842
- * phpseclib to treat the key as a private key. This function will do that.
1843
- *
1844
- * Do note that when a new key is loaded the index will be cleared.
1845
- *
1846
- * Returns true on success, false on failure
1847
- *
1848
- * @see self::getPublicKey()
1849
- * @access public
1850
- * @param string $key optional
1851
- * @param int $type optional
1852
- * @return bool
1853
- */
1854
- function setPrivateKey($key = false, $type = false)
1855
- {
1856
- if ($key === false && !empty($this->publicExponent)) {
1857
- $this->publicExponent = false;
1858
- return true;
1859
- }
1860
-
1861
- $rsa = new RSA();
1862
- if (!$rsa->loadKey($key, $type)) {
1863
- return false;
1864
- }
1865
- $rsa->publicExponent = false;
1866
-
1867
- // don't overwrite the old key if the new key is invalid
1868
- $this->loadKey($rsa);
1869
- return true;
1870
- }
1871
-
1872
- /**
1873
- * Returns the public key
1874
- *
1875
- * The public key is only returned under two circumstances - if the private key had the public key embedded within it
1876
- * or if the public key was set via setPublicKey(). If the currently loaded key is supposed to be the public key this
1877
- * function won't return it since this library, for the most part, doesn't distinguish between public and private keys.
1878
- *
1879
- * @see self::getPublicKey()
1880
- * @access public
1881
- * @param string $key
1882
- * @param int $type optional
1883
- */
1884
- function getPublicKey($type = self::PUBLIC_FORMAT_PKCS8)
1885
- {
1886
- if (empty($this->modulus) || empty($this->publicExponent)) {
1887
- return false;
1888
- }
1889
-
1890
- $oldFormat = $this->publicKeyFormat;
1891
- $this->publicKeyFormat = $type;
1892
- $temp = $this->_convertPublicKey($this->modulus, $this->publicExponent);
1893
- $this->publicKeyFormat = $oldFormat;
1894
- return $temp;
1895
- }
1896
-
1897
- /**
1898
- * Returns the public key's fingerprint
1899
- *
1900
- * The public key's fingerprint is returned, which is equivalent to running `ssh-keygen -lf rsa.pub`. If there is
1901
- * no public key currently loaded, false is returned.
1902
- * Example output (md5): "c1:b1:30:29:d7:b8:de:6c:97:77:10:d7:46:41:63:87" (as specified by RFC 4716)
1903
- *
1904
- * @access public
1905
- * @param string $algorithm The hashing algorithm to be used. Valid options are 'md5' and 'sha256'. False is returned
1906
- * for invalid values.
1907
- * @return mixed
1908
- */
1909
- function getPublicKeyFingerprint($algorithm = 'md5')
1910
- {
1911
- if (empty($this->modulus) || empty($this->publicExponent)) {
1912
- return false;
1913
- }
1914
-
1915
- $modulus = $this->modulus->toBytes(true);
1916
- $publicExponent = $this->publicExponent->toBytes(true);
1917
-
1918
- $RSAPublicKey = pack('Na*Na*Na*', strlen('ssh-rsa'), 'ssh-rsa', strlen($publicExponent), $publicExponent, strlen($modulus), $modulus);
1919
-
1920
- switch ($algorithm) {
1921
- case 'sha256':
1922
- $hash = new Hash('sha256');
1923
- $base = base64_encode($hash->hash($RSAPublicKey));
1924
- return substr($base, 0, strlen($base) - 1);
1925
- case 'md5':
1926
- return substr(chunk_split(md5($RSAPublicKey), 2, ':'), 0, -1);
1927
- default:
1928
- return false;
1929
- }
1930
- }
1931
-
1932
- /**
1933
- * Returns the private key
1934
- *
1935
- * The private key is only returned if the currently loaded key contains the constituent prime numbers.
1936
- *
1937
- * @see self::getPublicKey()
1938
- * @access public
1939
- * @param string $key
1940
- * @param int $type optional
1941
- * @return mixed
1942
- */
1943
- function getPrivateKey($type = self::PUBLIC_FORMAT_PKCS1)
1944
- {
1945
- if (empty($this->primes)) {
1946
- return false;
1947
- }
1948
-
1949
- $oldFormat = $this->privateKeyFormat;
1950
- $this->privateKeyFormat = $type;
1951
- $temp = $this->_convertPrivateKey($this->modulus, $this->publicExponent, $this->exponent, $this->primes, $this->exponents, $this->coefficients);
1952
- $this->privateKeyFormat = $oldFormat;
1953
- return $temp;
1954
- }
1955
-
1956
- /**
1957
- * Returns a minimalistic private key
1958
- *
1959
- * Returns the private key without the prime number constituants. Structurally identical to a public key that
1960
- * hasn't been set as the public key
1961
- *
1962
- * @see self::getPrivateKey()
1963
- * @access private
1964
- * @param string $key
1965
- * @param int $type optional
1966
- */
1967
- function _getPrivatePublicKey($mode = self::PUBLIC_FORMAT_PKCS8)
1968
- {
1969
- if (empty($this->modulus) || empty($this->exponent)) {
1970
- return false;
1971
- }
1972
-
1973
- $oldFormat = $this->publicKeyFormat;
1974
- $this->publicKeyFormat = $mode;
1975
- $temp = $this->_convertPublicKey($this->modulus, $this->exponent);
1976
- $this->publicKeyFormat = $oldFormat;
1977
- return $temp;
1978
- }
1979
-
1980
- /**
1981
- * __toString() magic method
1982
- *
1983
- * @access public
1984
- * @return string
1985
- */
1986
- function __toString()
1987
- {
1988
- $key = $this->getPrivateKey($this->privateKeyFormat);
1989
- if ($key !== false) {
1990
- return $key;
1991
- }
1992
- $key = $this->_getPrivatePublicKey($this->publicKeyFormat);
1993
- return $key !== false ? $key : '';
1994
- }
1995
-
1996
- /**
1997
- * __clone() magic method
1998
- *
1999
- * @access public
2000
- * @return Crypt_RSA
2001
- */
2002
- function __clone()
2003
- {
2004
- $key = new RSA();
2005
- $key->loadKey($this);
2006
- return $key;
2007
- }
2008
-
2009
- /**
2010
- * Generates the smallest and largest numbers requiring $bits bits
2011
- *
2012
- * @access private
2013
- * @param int $bits
2014
- * @return array
2015
- */
2016
- function _generateMinMax($bits)
2017
- {
2018
- $bytes = $bits >> 3;
2019
- $min = str_repeat(chr(0), $bytes);
2020
- $max = str_repeat(chr(0xFF), $bytes);
2021
- $msb = $bits & 7;
2022
- if ($msb) {
2023
- $min = chr(1 << ($msb - 1)) . $min;
2024
- $max = chr((1 << $msb) - 1) . $max;
2025
- } else {
2026
- $min[0] = chr(0x80);
2027
- }
2028
-
2029
- return array(
2030
- 'min' => new BigInteger($min, 256),
2031
- 'max' => new BigInteger($max, 256)
2032
- );
2033
- }
2034
-
2035
- /**
2036
- * DER-decode the length
2037
- *
2038
- * DER supports lengths up to (2**8)**127, however, we'll only support lengths up to (2**8)**4. See
2039
- * {@link http://itu.int/ITU-T/studygroups/com17/languages/X.690-0207.pdf#p=13 X.690 paragraph 8.1.3} for more information.
2040
- *
2041
- * @access private
2042
- * @param string $string
2043
- * @return int
2044
- */
2045
- function _decodeLength(&$string)
2046
- {
2047
- $length = ord($this->_string_shift($string));
2048
- if ($length & 0x80) { // definite length, long form
2049
- $length&= 0x7F;
2050
- $temp = $this->_string_shift($string, $length);
2051
- list(, $length) = unpack('N', substr(str_pad($temp, 4, chr(0), STR_PAD_LEFT), -4));
2052
- }
2053
- return $length;
2054
- }
2055
-
2056
- /**
2057
- * DER-encode the length
2058
- *
2059
- * DER supports lengths up to (2**8)**127, however, we'll only support lengths up to (2**8)**4. See
2060
- * {@link http://itu.int/ITU-T/studygroups/com17/languages/X.690-0207.pdf#p=13 X.690 paragraph 8.1.3} for more information.
2061
- *
2062
- * @access private
2063
- * @param int $length
2064
- * @return string
2065
- */
2066
- function _encodeLength($length)
2067
- {
2068
- if ($length <= 0x7F) {
2069
- return chr($length);
2070
- }
2071
-
2072
- $temp = ltrim(pack('N', $length), chr(0));
2073
- return pack('Ca*', 0x80 | strlen($temp), $temp);
2074
- }
2075
-
2076
- /**
2077
- * String Shift
2078
- *
2079
- * Inspired by array_shift
2080
- *
2081
- * @param string $string
2082
- * @param int $index
2083
- * @return string
2084
- * @access private
2085
- */
2086
- function _string_shift(&$string, $index = 1)
2087
- {
2088
- $substr = substr($string, 0, $index);
2089
- $string = substr($string, $index);
2090
- return $substr;
2091
- }
2092
-
2093
- /**
2094
- * Determines the private key format
2095
- *
2096
- * @see self::createKey()
2097
- * @access public
2098
- * @param int $format
2099
- */
2100
- function setPrivateKeyFormat($format)
2101
- {
2102
- $this->privateKeyFormat = $format;
2103
- }
2104
-
2105
- /**
2106
- * Determines the public key format
2107
- *
2108
- * @see self::createKey()
2109
- * @access public
2110
- * @param int $format
2111
- */
2112
- function setPublicKeyFormat($format)
2113
- {
2114
- $this->publicKeyFormat = $format;
2115
- }
2116
-
2117
- /**
2118
- * Determines which hashing function should be used
2119
- *
2120
- * Used with signature production / verification and (if the encryption mode is self::ENCRYPTION_OAEP) encryption and
2121
- * decryption. If $hash isn't supported, sha1 is used.
2122
- *
2123
- * @access public
2124
- * @param string $hash
2125
- */
2126
- function setHash($hash)
2127
- {
2128
- // \phpseclib\Crypt\Hash supports algorithms that PKCS#1 doesn't support. md5-96 and sha1-96, for example.
2129
- switch ($hash) {
2130
- case 'md2':
2131
- case 'md5':
2132
- case 'sha1':
2133
- case 'sha256':
2134
- case 'sha384':
2135
- case 'sha512':
2136
- $this->hash = new Hash($hash);
2137
- $this->hashName = $hash;
2138
- break;
2139
- default:
2140
- $this->hash = new Hash('sha1');
2141
- $this->hashName = 'sha1';
2142
- }
2143
- $this->hLen = $this->hash->getLength();
2144
- }
2145
-
2146
- /**
2147
- * Determines which hashing function should be used for the mask generation function
2148
- *
2149
- * The mask generation function is used by self::ENCRYPTION_OAEP and self::SIGNATURE_PSS and although it's
2150
- * best if Hash and MGFHash are set to the same thing this is not a requirement.
2151
- *
2152
- * @access public
2153
- * @param string $hash
2154
- */
2155
- function setMGFHash($hash)
2156
- {
2157
- // \phpseclib\Crypt\Hash supports algorithms that PKCS#1 doesn't support. md5-96 and sha1-96, for example.
2158
- switch ($hash) {
2159
- case 'md2':
2160
- case 'md5':
2161
- case 'sha1':
2162
- case 'sha256':
2163
- case 'sha384':
2164
- case 'sha512':
2165
- $this->mgfHash = new Hash($hash);
2166
- break;
2167
- default:
2168
- $this->mgfHash = new Hash('sha1');
2169
- }
2170
- $this->mgfHLen = $this->mgfHash->getLength();
2171
- }
2172
-
2173
- /**
2174
- * Determines the salt length
2175
- *
2176
- * To quote from {@link http://tools.ietf.org/html/rfc3447#page-38 RFC3447#page-38}:
2177
- *
2178
- * Typical salt lengths in octets are hLen (the length of the output
2179
- * of the hash function Hash) and 0.
2180
- *
2181
- * @access public
2182
- * @param int $format
2183
- */
2184
- function setSaltLength($sLen)
2185
- {
2186
- $this->sLen = $sLen;
2187
- }
2188
-
2189
- /**
2190
- * Integer-to-Octet-String primitive
2191
- *
2192
- * See {@link http://tools.ietf.org/html/rfc3447#section-4.1 RFC3447#section-4.1}.
2193
- *
2194
- * @access private
2195
- * @param \phpseclib\Math\BigInteger $x
2196
- * @param int $xLen
2197
- * @return string
2198
- */
2199
- function _i2osp($x, $xLen)
2200
- {
2201
- $x = $x->toBytes();
2202
- if (strlen($x) > $xLen) {
2203
- user_error('Integer too large');
2204
- return false;
2205
- }
2206
- return str_pad($x, $xLen, chr(0), STR_PAD_LEFT);
2207
- }
2208
-
2209
- /**
2210
- * Octet-String-to-Integer primitive
2211
- *
2212
- * See {@link http://tools.ietf.org/html/rfc3447#section-4.2 RFC3447#section-4.2}.
2213
- *
2214
- * @access private
2215
- * @param string $x
2216
- * @return \phpseclib\Math\BigInteger
2217
- */
2218
- function _os2ip($x)
2219
- {
2220
- return new BigInteger($x, 256);
2221
- }
2222
-
2223
- /**
2224
- * Exponentiate with or without Chinese Remainder Theorem
2225
- *
2226
- * See {@link http://tools.ietf.org/html/rfc3447#section-5.1.1 RFC3447#section-5.1.2}.
2227
- *
2228
- * @access private
2229
- * @param \phpseclib\Math\BigInteger $x
2230
- * @return \phpseclib\Math\BigInteger
2231
- */
2232
- function _exponentiate($x)
2233
- {
2234
- switch (true) {
2235
- case empty($this->primes):
2236
- case $this->primes[1]->equals($this->zero):
2237
- case empty($this->coefficients):
2238
- case $this->coefficients[2]->equals($this->zero):
2239
- case empty($this->exponents):
2240
- case $this->exponents[1]->equals($this->zero):
2241
- return $x->modPow($this->exponent, $this->modulus);
2242
- }
2243
-
2244
- $num_primes = count($this->primes);
2245
-
2246
- if (defined('CRYPT_RSA_DISABLE_BLINDING')) {
2247
- $m_i = array(
2248
- 1 => $x->modPow($this->exponents[1], $this->primes[1]),
2249
- 2 => $x->modPow($this->exponents[2], $this->primes[2])
2250
- );
2251
- $h = $m_i[1]->subtract($m_i[2]);
2252
- $h = $h->multiply($this->coefficients[2]);
2253
- list(, $h) = $h->divide($this->primes[1]);
2254
- $m = $m_i[2]->add($h->multiply($this->primes[2]));
2255
-
2256
- $r = $this->primes[1];
2257
- for ($i = 3; $i <= $num_primes; $i++) {
2258
- $m_i = $x->modPow($this->exponents[$i], $this->primes[$i]);
2259
-
2260
- $r = $r->multiply($this->primes[$i - 1]);
2261
-
2262
- $h = $m_i->subtract($m);
2263
- $h = $h->multiply($this->coefficients[$i]);
2264
- list(, $h) = $h->divide($this->primes[$i]);
2265
-
2266
- $m = $m->add($r->multiply($h));
2267
- }
2268
- } else {
2269
- $smallest = $this->primes[1];
2270
- for ($i = 2; $i <= $num_primes; $i++) {
2271
- if ($smallest->compare($this->primes[$i]) > 0) {
2272
- $smallest = $this->primes[$i];
2273
- }
2274
- }
2275
-
2276
- $one = new BigInteger(1);
2277
-
2278
- $r = $one->random($one, $smallest->subtract($one));
2279
-
2280
- $m_i = array(
2281
- 1 => $this->_blind($x, $r, 1),
2282
- 2 => $this->_blind($x, $r, 2)
2283
- );
2284
- $h = $m_i[1]->subtract($m_i[2]);
2285
- $h = $h->multiply($this->coefficients[2]);
2286
- list(, $h) = $h->divide($this->primes[1]);
2287
- $m = $m_i[2]->add($h->multiply($this->primes[2]));
2288
-
2289
- $r = $this->primes[1];
2290
- for ($i = 3; $i <= $num_primes; $i++) {
2291
- $m_i = $this->_blind($x, $r, $i);
2292
-
2293
- $r = $r->multiply($this->primes[$i - 1]);
2294
-
2295
- $h = $m_i->subtract($m);
2296
- $h = $h->multiply($this->coefficients[$i]);
2297
- list(, $h) = $h->divide($this->primes[$i]);
2298
-
2299
- $m = $m->add($r->multiply($h));
2300
- }
2301
- }
2302
-
2303
- return $m;
2304
- }
2305
-
2306
- /**
2307
- * Performs RSA Blinding
2308
- *
2309
- * Protects against timing attacks by employing RSA Blinding.
2310
- * Returns $x->modPow($this->exponents[$i], $this->primes[$i])
2311
- *
2312
- * @access private
2313
- * @param \phpseclib\Math\BigInteger $x
2314
- * @param \phpseclib\Math\BigInteger $r
2315
- * @param int $i
2316
- * @return \phpseclib\Math\BigInteger
2317
- */
2318
- function _blind($x, $r, $i)
2319
- {
2320
- $x = $x->multiply($r->modPow($this->publicExponent, $this->primes[$i]));
2321
- $x = $x->modPow($this->exponents[$i], $this->primes[$i]);
2322
-
2323
- $r = $r->modInverse($this->primes[$i]);
2324
- $x = $x->multiply($r);
2325
- list(, $x) = $x->divide($this->primes[$i]);
2326
-
2327
- return $x;
2328
- }
2329
-
2330
- /**
2331
- * Performs blinded RSA equality testing
2332
- *
2333
- * Protects against a particular type of timing attack described.
2334
- *
2335
- * See {@link http://codahale.com/a-lesson-in-timing-attacks/ A Lesson In Timing Attacks (or, Don't use MessageDigest.isEquals)}
2336
- *
2337
- * Thanks for the heads up singpolyma!
2338
- *
2339
- * @access private
2340
- * @param string $x
2341
- * @param string $y
2342
- * @return bool
2343
- */
2344
- function _equals($x, $y)
2345
- {
2346
- if (function_exists('hash_equals')) {
2347
- return hash_equals($x, $y);
2348
- }
2349
-
2350
- if (strlen($x) != strlen($y)) {
2351
- return false;
2352
- }
2353
-
2354
- $result = "\0";
2355
- $x^= $y;
2356
- for ($i = 0; $i < strlen($x); $i++) {
2357
- $result|= $x[$i];
2358
- }
2359
-
2360
- return $result === "\0";
2361
- }
2362
-
2363
- /**
2364
- * RSAEP
2365
- *
2366
- * See {@link http://tools.ietf.org/html/rfc3447#section-5.1.1 RFC3447#section-5.1.1}.
2367
- *
2368
- * @access private
2369
- * @param \phpseclib\Math\BigInteger $m
2370
- * @return \phpseclib\Math\BigInteger
2371
- */
2372
- function _rsaep($m)
2373
- {
2374
- if ($m->compare($this->zero) < 0 || $m->compare($this->modulus) > 0) {
2375
- user_error('Message representative out of range');
2376
- return false;
2377
- }
2378
- return $this->_exponentiate($m);
2379
- }
2380
-
2381
- /**
2382
- * RSADP
2383
- *
2384
- * See {@link http://tools.ietf.org/html/rfc3447#section-5.1.2 RFC3447#section-5.1.2}.
2385
- *
2386
- * @access private
2387
- * @param \phpseclib\Math\BigInteger $c
2388
- * @return \phpseclib\Math\BigInteger
2389
- */
2390
- function _rsadp($c)
2391
- {
2392
- if ($c->compare($this->zero) < 0 || $c->compare($this->modulus) > 0) {
2393
- user_error('Ciphertext representative out of range');
2394
- return false;
2395
- }
2396
- return $this->_exponentiate($c);
2397
- }
2398
-
2399
- /**
2400
- * RSASP1
2401
- *
2402
- * See {@link http://tools.ietf.org/html/rfc3447#section-5.2.1 RFC3447#section-5.2.1}.
2403
- *
2404
- * @access private
2405
- * @param \phpseclib\Math\BigInteger $m
2406
- * @return \phpseclib\Math\BigInteger
2407
- */
2408
- function _rsasp1($m)
2409
- {
2410
- if ($m->compare($this->zero) < 0 || $m->compare($this->modulus) > 0) {
2411
- user_error('Message representative out of range');
2412
- return false;
2413
- }
2414
- return $this->_exponentiate($m);
2415
- }
2416
-
2417
- /**
2418
- * RSAVP1
2419
- *
2420
- * See {@link http://tools.ietf.org/html/rfc3447#section-5.2.2 RFC3447#section-5.2.2}.
2421
- *
2422
- * @access private
2423
- * @param \phpseclib\Math\BigInteger $s
2424
- * @return \phpseclib\Math\BigInteger
2425
- */
2426
- function _rsavp1($s)
2427
- {
2428
- if ($s->compare($this->zero) < 0 || $s->compare($this->modulus) > 0) {
2429
- user_error('Signature representative out of range');
2430
- return false;
2431
- }
2432
- return $this->_exponentiate($s);
2433
- }
2434
-
2435
- /**
2436
- * MGF1
2437
- *
2438
- * See {@link http://tools.ietf.org/html/rfc3447#appendix-B.2.1 RFC3447#appendix-B.2.1}.
2439
- *
2440
- * @access private
2441
- * @param string $mgfSeed
2442
- * @param int $mgfLen
2443
- * @return string
2444
- */
2445
- function _mgf1($mgfSeed, $maskLen)
2446
- {
2447
- // if $maskLen would yield strings larger than 4GB, PKCS#1 suggests a "Mask too long" error be output.
2448
-
2449
- $t = '';
2450
- $count = ceil($maskLen / $this->mgfHLen);
2451
- for ($i = 0; $i < $count; $i++) {
2452
- $c = pack('N', $i);
2453
- $t.= $this->mgfHash->hash($mgfSeed . $c);
2454
- }
2455
-
2456
- return substr($t, 0, $maskLen);
2457
- }
2458
-
2459
- /**
2460
- * RSAES-OAEP-ENCRYPT
2461
- *
2462
- * See {@link http://tools.ietf.org/html/rfc3447#section-7.1.1 RFC3447#section-7.1.1} and
2463
- * {http://en.wikipedia.org/wiki/Optimal_Asymmetric_Encryption_Padding OAES}.
2464
- *
2465
- * @access private
2466
- * @param string $m
2467
- * @param string $l
2468
- * @return string
2469
- */
2470
- function _rsaes_oaep_encrypt($m, $l = '')
2471
- {
2472
- $mLen = strlen($m);
2473
-
2474
- // Length checking
2475
-
2476
- // if $l is larger than two million terrabytes and you're using sha1, PKCS#1 suggests a "Label too long" error
2477
- // be output.
2478
-
2479
- if ($mLen > $this->k - 2 * $this->hLen - 2) {
2480
- user_error('Message too long');
2481
- return false;
2482
- }
2483
-
2484
- // EME-OAEP encoding
2485
-
2486
- $lHash = $this->hash->hash($l);
2487
- $ps = str_repeat(chr(0), $this->k - $mLen - 2 * $this->hLen - 2);
2488
- $db = $lHash . $ps . chr(1) . $m;
2489
- $seed = Random::string($this->hLen);
2490
- $dbMask = $this->_mgf1($seed, $this->k - $this->hLen - 1);
2491
- $maskedDB = $db ^ $dbMask;
2492
- $seedMask = $this->_mgf1($maskedDB, $this->hLen);
2493
- $maskedSeed = $seed ^ $seedMask;
2494
- $em = chr(0) . $maskedSeed . $maskedDB;
2495
-
2496
- // RSA encryption
2497
-
2498
- $m = $this->_os2ip($em);
2499
- $c = $this->_rsaep($m);
2500
- $c = $this->_i2osp($c, $this->k);
2501
-
2502
- // Output the ciphertext C
2503
-
2504
- return $c;
2505
- }
2506
-
2507
- /**
2508
- * RSAES-OAEP-DECRYPT
2509
- *
2510
- * See {@link http://tools.ietf.org/html/rfc3447#section-7.1.2 RFC3447#section-7.1.2}. The fact that the error
2511
- * messages aren't distinguishable from one another hinders debugging, but, to quote from RFC3447#section-7.1.2:
2512
- *
2513
- * Note. Care must be taken to ensure that an opponent cannot
2514
- * distinguish the different error conditions in Step 3.g, whether by
2515
- * error message or timing, or, more generally, learn partial
2516
- * information about the encoded message EM. Otherwise an opponent may
2517
- * be able to obtain useful information about the decryption of the
2518
- * ciphertext C, leading to a chosen-ciphertext attack such as the one
2519
- * observed by Manger [36].
2520
- *
2521
- * As for $l... to quote from {@link http://tools.ietf.org/html/rfc3447#page-17 RFC3447#page-17}:
2522
- *
2523
- * Both the encryption and the decryption operations of RSAES-OAEP take
2524
- * the value of a label L as input. In this version of PKCS #1, L is
2525
- * the empty string; other uses of the label are outside the scope of
2526
- * this document.
2527
- *
2528
- * @access private
2529
- * @param string $c
2530
- * @param string $l
2531
- * @return string
2532
- */
2533
- function _rsaes_oaep_decrypt($c, $l = '')
2534
- {
2535
- // Length checking
2536
-
2537
- // if $l is larger than two million terrabytes and you're using sha1, PKCS#1 suggests a "Label too long" error
2538
- // be output.
2539
-
2540
- if (strlen($c) != $this->k || $this->k < 2 * $this->hLen + 2) {
2541
- user_error('Decryption error');
2542
- return false;
2543
- }
2544
-
2545
- // RSA decryption
2546
-
2547
- $c = $this->_os2ip($c);
2548
- $m = $this->_rsadp($c);
2549
- if ($m === false) {
2550
- user_error('Decryption error');
2551
- return false;
2552
- }
2553
- $em = $this->_i2osp($m, $this->k);
2554
-
2555
- // EME-OAEP decoding
2556
-
2557
- $lHash = $this->hash->hash($l);
2558
- $y = ord($em[0]);
2559
- $maskedSeed = substr($em, 1, $this->hLen);
2560
- $maskedDB = substr($em, $this->hLen + 1);
2561
- $seedMask = $this->_mgf1($maskedDB, $this->hLen);
2562
- $seed = $maskedSeed ^ $seedMask;
2563
- $dbMask = $this->_mgf1($seed, $this->k - $this->hLen - 1);
2564
- $db = $maskedDB ^ $dbMask;
2565
- $lHash2 = substr($db, 0, $this->hLen);
2566
- $m = substr($db, $this->hLen);
2567
- $hashesMatch = $this->_equals($lHash, $lHash2);
2568
- $leadingZeros = 1;
2569
- $patternMatch = 0;
2570
- $offset = 0;
2571
- for ($i = 0; $i < strlen($m); $i++) {
2572
- $patternMatch|= $leadingZeros & ($m[$i] === "\1");
2573
- $leadingZeros&= $m[$i] === "\0";
2574
- $offset+= $patternMatch ? 0 : 1;
2575
- }
2576
-
2577
- // we do & instead of && to avoid https://en.wikipedia.org/wiki/Short-circuit_evaluation
2578
- // to protect against timing attacks
2579
- if (!$hashesMatch & !$patternMatch) {
2580
- user_error('Decryption error');
2581
- return false;
2582
- }
2583
-
2584
- // Output the message M
2585
-
2586
- return substr($m, $offset + 1);
2587
- }
2588
-
2589
- /**
2590
- * Raw Encryption / Decryption
2591
- *
2592
- * Doesn't use padding and is not recommended.
2593
- *
2594
- * @access private
2595
- * @param string $m
2596
- * @return string
2597
- */
2598
- function _raw_encrypt($m)
2599
- {
2600
- $temp = $this->_os2ip($m);
2601
- $temp = $this->_rsaep($temp);
2602
- return $this->_i2osp($temp, $this->k);
2603
- }
2604
-
2605
- /**
2606
- * RSAES-PKCS1-V1_5-ENCRYPT
2607
- *
2608
- * See {@link http://tools.ietf.org/html/rfc3447#section-7.2.1 RFC3447#section-7.2.1}.
2609
- *
2610
- * @access private
2611
- * @param string $m
2612
- * @return string
2613
- */
2614
- function _rsaes_pkcs1_v1_5_encrypt($m)
2615
- {
2616
- $mLen = strlen($m);
2617
-
2618
- // Length checking
2619
-
2620
- if ($mLen > $this->k - 11) {
2621
- user_error('Message too long');
2622
- return false;
2623
- }
2624
-
2625
- // EME-PKCS1-v1_5 encoding
2626
-
2627
- $psLen = $this->k - $mLen - 3;
2628
- $ps = '';
2629
- while (strlen($ps) != $psLen) {
2630
- $temp = Random::string($psLen - strlen($ps));
2631
- $temp = str_replace("\x00", '', $temp);
2632
- $ps.= $temp;
2633
- }
2634
- $type = 2;
2635
- // see the comments of _rsaes_pkcs1_v1_5_decrypt() to understand why this is being done
2636
- if (defined('CRYPT_RSA_PKCS15_COMPAT') && (!isset($this->publicExponent) || $this->exponent !== $this->publicExponent)) {
2637
- $type = 1;
2638
- // "The padding string PS shall consist of k-3-||D|| octets. ... for block type 01, they shall have value FF"
2639
- $ps = str_repeat("\xFF", $psLen);
2640
- }
2641
- $em = chr(0) . chr($type) . $ps . chr(0) . $m;
2642
-
2643
- // RSA encryption
2644
- $m = $this->_os2ip($em);
2645
- $c = $this->_rsaep($m);
2646
- $c = $this->_i2osp($c, $this->k);
2647
-
2648
- // Output the ciphertext C
2649
-
2650
- return $c;
2651
- }
2652
-
2653
- /**
2654
- * RSAES-PKCS1-V1_5-DECRYPT
2655
- *
2656
- * See {@link http://tools.ietf.org/html/rfc3447#section-7.2.2 RFC3447#section-7.2.2}.
2657
- *
2658
- * For compatibility purposes, this function departs slightly from the description given in RFC3447.
2659
- * The reason being that RFC2313#section-8.1 (PKCS#1 v1.5) states that ciphertext's encrypted by the
2660
- * private key should have the second byte set to either 0 or 1 and that ciphertext's encrypted by the
2661
- * public key should have the second byte set to 2. In RFC3447 (PKCS#1 v2.1), the second byte is supposed
2662
- * to be 2 regardless of which key is used. For compatibility purposes, we'll just check to make sure the
2663
- * second byte is 2 or less. If it is, we'll accept the decrypted string as valid.
2664
- *
2665
- * As a consequence of this, a private key encrypted ciphertext produced with \phpseclib\Crypt\RSA may not decrypt
2666
- * with a strictly PKCS#1 v1.5 compliant RSA implementation. Public key encrypted ciphertext's should but
2667
- * not private key encrypted ciphertext's.
2668
- *
2669
- * @access private
2670
- * @param string $c
2671
- * @return string
2672
- */
2673
- function _rsaes_pkcs1_v1_5_decrypt($c)
2674
- {
2675
- // Length checking
2676
-
2677
- if (strlen($c) != $this->k) { // or if k < 11
2678
- user_error('Decryption error');
2679
- return false;
2680
- }
2681
-
2682
- // RSA decryption
2683
-
2684
- $c = $this->_os2ip($c);
2685
- $m = $this->_rsadp($c);
2686
-
2687
- if ($m === false) {
2688
- user_error('Decryption error');
2689
- return false;
2690
- }
2691
- $em = $this->_i2osp($m, $this->k);
2692
-
2693
- // EME-PKCS1-v1_5 decoding
2694
-
2695
- if (ord($em[0]) != 0 || ord($em[1]) > 2) {
2696
- user_error('Decryption error');
2697
- return false;
2698
- }
2699
-
2700
- $ps = substr($em, 2, strpos($em, chr(0), 2) - 2);
2701
- $m = substr($em, strlen($ps) + 3);
2702
-
2703
- if (strlen($ps) < 8) {
2704
- user_error('Decryption error');
2705
- return false;
2706
- }
2707
-
2708
- // Output M
2709
-
2710
- return $m;
2711
- }
2712
-
2713
- /**
2714
- * EMSA-PSS-ENCODE
2715
- *
2716
- * See {@link http://tools.ietf.org/html/rfc3447#section-9.1.1 RFC3447#section-9.1.1}.
2717
- *
2718
- * @access private
2719
- * @param string $m
2720
- * @param int $emBits
2721
- */
2722
- function _emsa_pss_encode($m, $emBits)
2723
- {
2724
- // if $m is larger than two million terrabytes and you're using sha1, PKCS#1 suggests a "Label too long" error
2725
- // be output.
2726
-
2727
- $emLen = ($emBits + 1) >> 3; // ie. ceil($emBits / 8)
2728
- $sLen = $this->sLen !== null ? $this->sLen : $this->hLen;
2729
-
2730
- $mHash = $this->hash->hash($m);
2731
- if ($emLen < $this->hLen + $sLen + 2) {
2732
- user_error('Encoding error');
2733
- return false;
2734
- }
2735
-
2736
- $salt = Random::string($sLen);
2737
- $m2 = "\0\0\0\0\0\0\0\0" . $mHash . $salt;
2738
- $h = $this->hash->hash($m2);
2739
- $ps = str_repeat(chr(0), $emLen - $sLen - $this->hLen - 2);
2740
- $db = $ps . chr(1) . $salt;
2741
- $dbMask = $this->_mgf1($h, $emLen - $this->hLen - 1);
2742
- $maskedDB = $db ^ $dbMask;
2743
- $maskedDB[0] = ~chr(0xFF << ($emBits & 7)) & $maskedDB[0];
2744
- $em = $maskedDB . $h . chr(0xBC);
2745
-
2746
- return $em;
2747
- }
2748
-
2749
- /**
2750
- * EMSA-PSS-VERIFY
2751
- *
2752
- * See {@link http://tools.ietf.org/html/rfc3447#section-9.1.2 RFC3447#section-9.1.2}.
2753
- *
2754
- * @access private
2755
- * @param string $m
2756
- * @param string $em
2757
- * @param int $emBits
2758
- * @return string
2759
- */
2760
- function _emsa_pss_verify($m, $em, $emBits)
2761
- {
2762
- // if $m is larger than two million terrabytes and you're using sha1, PKCS#1 suggests a "Label too long" error
2763
- // be output.
2764
-
2765
- $emLen = ($emBits + 1) >> 3; // ie. ceil($emBits / 8);
2766
- $sLen = $this->sLen !== null ? $this->sLen : $this->hLen;
2767
-
2768
- $mHash = $this->hash->hash($m);
2769
- if ($emLen < $this->hLen + $sLen + 2) {
2770
- return false;
2771
- }
2772
-
2773
- if ($em[strlen($em) - 1] != chr(0xBC)) {
2774
- return false;
2775
- }
2776
-
2777
- $maskedDB = substr($em, 0, -$this->hLen - 1);
2778
- $h = substr($em, -$this->hLen - 1, $this->hLen);
2779
- $temp = chr(0xFF << ($emBits & 7));
2780
- if ((~$maskedDB[0] & $temp) != $temp) {
2781
- return false;
2782
- }
2783
- $dbMask = $this->_mgf1($h, $emLen - $this->hLen - 1);
2784
- $db = $maskedDB ^ $dbMask;
2785
- $db[0] = ~chr(0xFF << ($emBits & 7)) & $db[0];
2786
- $temp = $emLen - $this->hLen - $sLen - 2;
2787
- if (substr($db, 0, $temp) != str_repeat(chr(0), $temp) || ord($db[$temp]) != 1) {
2788
- return false;
2789
- }
2790
- $salt = substr($db, $temp + 1); // should be $sLen long
2791
- $m2 = "\0\0\0\0\0\0\0\0" . $mHash . $salt;
2792
- $h2 = $this->hash->hash($m2);
2793
- return $this->_equals($h, $h2);
2794
- }
2795
-
2796
- /**
2797
- * RSASSA-PSS-SIGN
2798
- *
2799
- * See {@link http://tools.ietf.org/html/rfc3447#section-8.1.1 RFC3447#section-8.1.1}.
2800
- *
2801
- * @access private
2802
- * @param string $m
2803
- * @return string
2804
- */
2805
- function _rsassa_pss_sign($m)
2806
- {
2807
- // EMSA-PSS encoding
2808
-
2809
- $em = $this->_emsa_pss_encode($m, 8 * $this->k - 1);
2810
-
2811
- // RSA signature
2812
-
2813
- $m = $this->_os2ip($em);
2814
- $s = $this->_rsasp1($m);
2815
- $s = $this->_i2osp($s, $this->k);
2816
-
2817
- // Output the signature S
2818
-
2819
- return $s;
2820
- }
2821
-
2822
- /**
2823
- * RSASSA-PSS-VERIFY
2824
- *
2825
- * See {@link http://tools.ietf.org/html/rfc3447#section-8.1.2 RFC3447#section-8.1.2}.
2826
- *
2827
- * @access private
2828
- * @param string $m
2829
- * @param string $s
2830
- * @return string
2831
- */
2832
- function _rsassa_pss_verify($m, $s)
2833
- {
2834
- // Length checking
2835
-
2836
- if (strlen($s) != $this->k) {
2837
- user_error('Invalid signature');
2838
- return false;
2839
- }
2840
-
2841
- // RSA verification
2842
-
2843
- $modBits = 8 * $this->k;
2844
-
2845
- $s2 = $this->_os2ip($s);
2846
- $m2 = $this->_rsavp1($s2);
2847
- if ($m2 === false) {
2848
- user_error('Invalid signature');
2849
- return false;
2850
- }
2851
- $em = $this->_i2osp($m2, $modBits >> 3);
2852
- if ($em === false) {
2853
- user_error('Invalid signature');
2854
- return false;
2855
- }
2856
-
2857
- // EMSA-PSS verification
2858
-
2859
- return $this->_emsa_pss_verify($m, $em, $modBits - 1);
2860
- }
2861
-
2862
- /**
2863
- * EMSA-PKCS1-V1_5-ENCODE
2864
- *
2865
- * See {@link http://tools.ietf.org/html/rfc3447#section-9.2 RFC3447#section-9.2}.
2866
- *
2867
- * @access private
2868
- * @param string $m
2869
- * @param int $emLen
2870
- * @return string
2871
- */
2872
- function _emsa_pkcs1_v1_5_encode($m, $emLen)
2873
- {
2874
- $h = $this->hash->hash($m);
2875
- if ($h === false) {
2876
- return false;
2877
- }
2878
-
2879
- // see http://tools.ietf.org/html/rfc3447#page-43
2880
- switch ($this->hashName) {
2881
- case 'md2':
2882
- $t = pack('H*', '3020300c06082a864886f70d020205000410');
2883
- break;
2884
- case 'md5':
2885
- $t = pack('H*', '3020300c06082a864886f70d020505000410');
2886
- break;
2887
- case 'sha1':
2888
- $t = pack('H*', '3021300906052b0e03021a05000414');
2889
- break;
2890
- case 'sha256':
2891
- $t = pack('H*', '3031300d060960864801650304020105000420');
2892
- break;
2893
- case 'sha384':
2894
- $t = pack('H*', '3041300d060960864801650304020205000430');
2895
- break;
2896
- case 'sha512':
2897
- $t = pack('H*', '3051300d060960864801650304020305000440');
2898
- }
2899
- $t.= $h;
2900
- $tLen = strlen($t);
2901
-
2902
- if ($emLen < $tLen + 11) {
2903
- user_error('Intended encoded message length too short');
2904
- return false;
2905
- }
2906
-
2907
- $ps = str_repeat(chr(0xFF), $emLen - $tLen - 3);
2908
-
2909
- $em = "\0\1$ps\0$t";
2910
-
2911
- return $em;
2912
- }
2913
-
2914
- /**
2915
- * RSASSA-PKCS1-V1_5-SIGN
2916
- *
2917
- * See {@link http://tools.ietf.org/html/rfc3447#section-8.2.1 RFC3447#section-8.2.1}.
2918
- *
2919
- * @access private
2920
- * @param string $m
2921
- * @return string
2922
- */
2923
- function _rsassa_pkcs1_v1_5_sign($m)
2924
- {
2925
- // EMSA-PKCS1-v1_5 encoding
2926
-
2927
- $em = $this->_emsa_pkcs1_v1_5_encode($m, $this->k);
2928
- if ($em === false) {
2929
- user_error('RSA modulus too short');
2930
- return false;
2931
- }
2932
-
2933
- // RSA signature
2934
-
2935
- $m = $this->_os2ip($em);
2936
- $s = $this->_rsasp1($m);
2937
- $s = $this->_i2osp($s, $this->k);
2938
-
2939
- // Output the signature S
2940
-
2941
- return $s;
2942
- }
2943
-
2944
- /**
2945
- * RSASSA-PKCS1-V1_5-VERIFY
2946
- *
2947
- * See {@link http://tools.ietf.org/html/rfc3447#section-8.2.2 RFC3447#section-8.2.2}.
2948
- *
2949
- * @access private
2950
- * @param string $m
2951
- * @return string
2952
- */
2953
- function _rsassa_pkcs1_v1_5_verify($m, $s)
2954
- {
2955
- // Length checking
2956
-
2957
- if (strlen($s) != $this->k) {
2958
- user_error('Invalid signature');
2959
- return false;
2960
- }
2961
-
2962
- // RSA verification
2963
-
2964
- $s = $this->_os2ip($s);
2965
- $m2 = $this->_rsavp1($s);
2966
- if ($m2 === false) {
2967
- user_error('Invalid signature');
2968
- return false;
2969
- }
2970
- $em = $this->_i2osp($m2, $this->k);
2971
- if ($em === false) {
2972
- user_error('Invalid signature');
2973
- return false;
2974
- }
2975
-
2976
- // EMSA-PKCS1-v1_5 encoding
2977
-
2978
- $em2 = $this->_emsa_pkcs1_v1_5_encode($m, $this->k);
2979
- if ($em2 === false) {
2980
- user_error('RSA modulus too short');
2981
- return false;
2982
- }
2983
-
2984
- // Compare
2985
- return $this->_equals($em, $em2);
2986
- }
2987
-
2988
- /**
2989
- * Set Encryption Mode
2990
- *
2991
- * Valid values include self::ENCRYPTION_OAEP and self::ENCRYPTION_PKCS1.
2992
- *
2993
- * @access public
2994
- * @param int $mode
2995
- */
2996
- function setEncryptionMode($mode)
2997
- {
2998
- $this->encryptionMode = $mode;
2999
- }
3000
-
3001
- /**
3002
- * Set Signature Mode
3003
- *
3004
- * Valid values include self::SIGNATURE_PSS and self::SIGNATURE_PKCS1
3005
- *
3006
- * @access public
3007
- * @param int $mode
3008
- */
3009
- function setSignatureMode($mode)
3010
- {
3011
- $this->signatureMode = $mode;
3012
- }
3013
-
3014
- /**
3015
- * Set public key comment.
3016
- *
3017
- * @access public
3018
- * @param string $comment
3019
- */
3020
- function setComment($comment)
3021
- {
3022
- $this->comment = $comment;
3023
- }
3024
-
3025
- /**
3026
- * Get public key comment.
3027
- *
3028
- * @access public
3029
- * @return string
3030
- */
3031
- function getComment()
3032
- {
3033
- return $this->comment;
3034
- }
3035
-
3036
- /**
3037
- * Encryption
3038
- *
3039
- * Both self::ENCRYPTION_OAEP and self::ENCRYPTION_PKCS1 both place limits on how long $plaintext can be.
3040
- * If $plaintext exceeds those limits it will be broken up so that it does and the resultant ciphertext's will
3041
- * be concatenated together.
3042
- *
3043
- * @see self::decrypt()
3044
- * @access public
3045
- * @param string $plaintext
3046
- * @return string
3047
- */
3048
- function encrypt($plaintext)
3049
- {
3050
- switch ($this->encryptionMode) {
3051
- case self::ENCRYPTION_NONE:
3052
- $plaintext = str_split($plaintext, $this->k);
3053
- $ciphertext = '';
3054
- foreach ($plaintext as $m) {
3055
- $ciphertext.= $this->_raw_encrypt($m);
3056
- }
3057
- return $ciphertext;
3058
- case self::ENCRYPTION_PKCS1:
3059
- $length = $this->k - 11;
3060
- if ($length <= 0) {
3061
- return false;
3062
- }
3063
-
3064
- $plaintext = str_split($plaintext, $length);
3065
- $ciphertext = '';
3066
- foreach ($plaintext as $m) {
3067
- $ciphertext.= $this->_rsaes_pkcs1_v1_5_encrypt($m);
3068
- }
3069
- return $ciphertext;
3070
- //case self::ENCRYPTION_OAEP:
3071
- default:
3072
- $length = $this->k - 2 * $this->hLen - 2;
3073
- if ($length <= 0) {
3074
- return false;
3075
- }
3076
-
3077
- $plaintext = str_split($plaintext, $length);
3078
- $ciphertext = '';
3079
- foreach ($plaintext as $m) {
3080
- $ciphertext.= $this->_rsaes_oaep_encrypt($m);
3081
- }
3082
- return $ciphertext;
3083
- }
3084
- }
3085
-
3086
- /**
3087
- * Decryption
3088
- *
3089
- * @see self::encrypt()
3090
- * @access public
3091
- * @param string $plaintext
3092
- * @return string
3093
- */
3094
- function decrypt($ciphertext)
3095
- {
3096
- if ($this->k <= 0) {
3097
- return false;
3098
- }
3099
-
3100
- $ciphertext = str_split($ciphertext, $this->k);
3101
- $ciphertext[count($ciphertext) - 1] = str_pad($ciphertext[count($ciphertext) - 1], $this->k, chr(0), STR_PAD_LEFT);
3102
-
3103
- $plaintext = '';
3104
-
3105
- switch ($this->encryptionMode) {
3106
- case self::ENCRYPTION_NONE:
3107
- $decrypt = '_raw_encrypt';
3108
- break;
3109
- case self::ENCRYPTION_PKCS1:
3110
- $decrypt = '_rsaes_pkcs1_v1_5_decrypt';
3111
- break;
3112
- //case self::ENCRYPTION_OAEP:
3113
- default:
3114
- $decrypt = '_rsaes_oaep_decrypt';
3115
- }
3116
-
3117
- foreach ($ciphertext as $c) {
3118
- $temp = $this->$decrypt($c);
3119
- if ($temp === false) {
3120
- return false;
3121
- }
3122
- $plaintext.= $temp;
3123
- }
3124
-
3125
- return $plaintext;
3126
- }
3127
-
3128
- /**
3129
- * Create a signature
3130
- *
3131
- * @see self::verify()
3132
- * @access public
3133
- * @param string $message
3134
- * @return string
3135
- */
3136
- function sign($message)
3137
- {
3138
- if (empty($this->modulus) || empty($this->exponent)) {
3139
- return false;
3140
- }
3141
-
3142
- switch ($this->signatureMode) {
3143
- case self::SIGNATURE_PKCS1:
3144
- return $this->_rsassa_pkcs1_v1_5_sign($message);
3145
- //case self::SIGNATURE_PSS:
3146
- default:
3147
- return $this->_rsassa_pss_sign($message);
3148
- }
3149
- }
3150
-
3151
- /**
3152
- * Verifies a signature
3153
- *
3154
- * @see self::sign()
3155
- * @access public
3156
- * @param string $message
3157
- * @param string $signature
3158
- * @return bool
3159
- */
3160
- function verify($message, $signature)
3161
- {
3162
- if (empty($this->modulus) || empty($this->exponent)) {
3163
- return false;
3164
- }
3165
-
3166
- switch ($this->signatureMode) {
3167
- case self::SIGNATURE_PKCS1:
3168
- return $this->_rsassa_pkcs1_v1_5_verify($message, $signature);
3169
- //case self::SIGNATURE_PSS:
3170
- default:
3171
- return $this->_rsassa_pss_verify($message, $signature);
3172
- }
3173
- }
3174
-
3175
- /**
3176
- * Extract raw BER from Base64 encoding
3177
- *
3178
- * @access private
3179
- * @param string $str
3180
- * @return string
3181
- */
3182
- function _extractBER($str)
3183
- {
3184
- /* X.509 certs are assumed to be base64 encoded but sometimes they'll have additional things in them
3185
- * above and beyond the ceritificate.
3186
- * ie. some may have the following preceding the -----BEGIN CERTIFICATE----- line:
3187
- *
3188
- * Bag Attributes
3189
- * localKeyID: 01 00 00 00
3190
- * subject=/O=organization/OU=org unit/CN=common name
3191
- * issuer=/O=organization/CN=common name
3192
- */
3193
- $temp = preg_replace('#.*?^-+[^-]+-+[\r\n ]*$#ms', '', $str, 1);
3194
- // remove the -----BEGIN CERTIFICATE----- and -----END CERTIFICATE----- stuff
3195
- $temp = preg_replace('#-+[^-]+-+#', '', $temp);
3196
- // remove new lines
3197
- $temp = str_replace(array("\r", "\n", ' '), '', $temp);
3198
- $temp = preg_match('#^[a-zA-Z\d/+]*={0,2}$#', $temp) ? base64_decode($temp) : false;
3199
- return $temp != false ? $temp : $str;
3200
- }
3201
- }
1
+ <?php
2
+
3
+ /**
4
+ * Pure-PHP PKCS#1 (v2.1) compliant implementation of RSA.
5
+ *
6
+ * PHP version 5
7
+ *
8
+ * Here's an example of how to encrypt and decrypt text with this library:
9
+ * <code>
10
+ * <?php
11
+ * include 'vendor/autoload.php';
12
+ *
13
+ * $rsa = new \phpseclib\Crypt\RSA();
14
+ * extract($rsa->createKey());
15
+ *
16
+ * $plaintext = 'terrafrost';
17
+ *
18
+ * $rsa->loadKey($privatekey);
19
+ * $ciphertext = $rsa->encrypt($plaintext);
20
+ *
21
+ * $rsa->loadKey($publickey);
22
+ * echo $rsa->decrypt($ciphertext);
23
+ * ?>
24
+ * </code>
25
+ *
26
+ * Here's an example of how to create signatures and verify signatures with this library:
27
+ * <code>
28
+ * <?php
29
+ * include 'vendor/autoload.php';
30
+ *
31
+ * $rsa = new \phpseclib\Crypt\RSA();
32
+ * extract($rsa->createKey());
33
+ *
34
+ * $plaintext = 'terrafrost';
35
+ *
36
+ * $rsa->loadKey($privatekey);
37
+ * $signature = $rsa->sign($plaintext);
38
+ *
39
+ * $rsa->loadKey($publickey);
40
+ * echo $rsa->verify($plaintext, $signature) ? 'verified' : 'unverified';
41
+ * ?>
42
+ * </code>
43
+ *
44
+ * @category Crypt
45
+ * @package RSA
46
+ * @author Jim Wigginton <terrafrost@php.net>
47
+ * @copyright 2009 Jim Wigginton
48
+ * @license http://www.opensource.org/licenses/mit-license.html MIT License
49
+ * @link http://phpseclib.sourceforge.net
50
+ */
51
+
52
+ namespace phpseclib\Crypt;
53
+
54
+ use phpseclib\Math\BigInteger;
55
+
56
+ /**
57
+ * Pure-PHP PKCS#1 compliant implementation of RSA.
58
+ *
59
+ * @package RSA
60
+ * @author Jim Wigginton <terrafrost@php.net>
61
+ * @access public
62
+ */
63
+ class RSA
64
+ {
65
+ /**#@+
66
+ * @access public
67
+ * @see self::encrypt()
68
+ * @see self::decrypt()
69
+ */
70
+ /**
71
+ * Use {@link http://en.wikipedia.org/wiki/Optimal_Asymmetric_Encryption_Padding Optimal Asymmetric Encryption Padding}
72
+ * (OAEP) for encryption / decryption.
73
+ *
74
+ * Uses sha1 by default.
75
+ *
76
+ * @see self::setHash()
77
+ * @see self::setMGFHash()
78
+ */
79
+ const ENCRYPTION_OAEP = 1;
80
+ /**
81
+ * Use PKCS#1 padding.
82
+ *
83
+ * Although self::ENCRYPTION_OAEP offers more security, including PKCS#1 padding is necessary for purposes of backwards
84
+ * compatibility with protocols (like SSH-1) written before OAEP's introduction.
85
+ */
86
+ const ENCRYPTION_PKCS1 = 2;
87
+ /**
88
+ * Do not use any padding
89
+ *
90
+ * Although this method is not recommended it can none-the-less sometimes be useful if you're trying to decrypt some legacy
91
+ * stuff, if you're trying to diagnose why an encrypted message isn't decrypting, etc.
92
+ */
93
+ const ENCRYPTION_NONE = 3;
94
+ /**#@-*/
95
+
96
+ /**#@+
97
+ * @access public
98
+ * @see self::sign()
99
+ * @see self::verify()
100
+ * @see self::setHash()
101
+ */
102
+ /**
103
+ * Use the Probabilistic Signature Scheme for signing
104
+ *
105
+ * Uses sha1 by default.
106
+ *
107
+ * @see self::setSaltLength()
108
+ * @see self::setMGFHash()
109
+ */
110
+ const SIGNATURE_PSS = 1;
111
+ /**
112
+ * Use the PKCS#1 scheme by default.
113
+ *
114
+ * Although self::SIGNATURE_PSS offers more security, including PKCS#1 signing is necessary for purposes of backwards
115
+ * compatibility with protocols (like SSH-2) written before PSS's introduction.
116
+ */
117
+ const SIGNATURE_PKCS1 = 2;
118
+ /**#@-*/
119
+
120
+ /**#@+
121
+ * @access private
122
+ * @see \phpseclib\Crypt\RSA::createKey()
123
+ */
124
+ /**
125
+ * ASN1 Integer
126
+ */
127
+ const ASN1_INTEGER = 2;
128
+ /**
129
+ * ASN1 Bit String
130
+ */
131
+ const ASN1_BITSTRING = 3;
132
+ /**
133
+ * ASN1 Octet String
134
+ */
135
+ const ASN1_OCTETSTRING = 4;
136
+ /**
137
+ * ASN1 Object Identifier
138
+ */
139
+ const ASN1_OBJECT = 6;
140
+ /**
141
+ * ASN1 Sequence (with the constucted bit set)
142
+ */
143
+ const ASN1_SEQUENCE = 48;
144
+ /**#@-*/
145
+
146
+ /**#@+
147
+ * @access private
148
+ * @see \phpseclib\Crypt\RSA::__construct()
149
+ */
150
+ /**
151
+ * To use the pure-PHP implementation
152
+ */
153
+ const MODE_INTERNAL = 1;
154
+ /**
155
+ * To use the OpenSSL library
156
+ *
157
+ * (if enabled; otherwise, the internal implementation will be used)
158
+ */
159
+ const MODE_OPENSSL = 2;
160
+ /**#@-*/
161
+
162
+ /**#@+
163
+ * @access public
164
+ * @see \phpseclib\Crypt\RSA::createKey()
165
+ * @see \phpseclib\Crypt\RSA::setPrivateKeyFormat()
166
+ */
167
+ /**
168
+ * PKCS#1 formatted private key
169
+ *
170
+ * Used by OpenSSH
171
+ */
172
+ const PRIVATE_FORMAT_PKCS1 = 0;
173
+ /**
174
+ * PuTTY formatted private key
175
+ */
176
+ const PRIVATE_FORMAT_PUTTY = 1;
177
+ /**
178
+ * XML formatted private key
179
+ */
180
+ const PRIVATE_FORMAT_XML = 2;
181
+ /**
182
+ * PKCS#8 formatted private key
183
+ */
184
+ const PRIVATE_FORMAT_PKCS8 = 8;
185
+ /**
186
+ * OpenSSH formatted private key
187
+ */
188
+ const PRIVATE_FORMAT_OPENSSH = 9;
189
+ /**#@-*/
190
+
191
+ /**#@+
192
+ * @access public
193
+ * @see \phpseclib\Crypt\RSA::createKey()
194
+ * @see \phpseclib\Crypt\RSA::setPublicKeyFormat()
195
+ */
196
+ /**
197
+ * Raw public key
198
+ *
199
+ * An array containing two \phpseclib\Math\BigInteger objects.
200
+ *
201
+ * The exponent can be indexed with any of the following:
202
+ *
203
+ * 0, e, exponent, publicExponent
204
+ *
205
+ * The modulus can be indexed with any of the following:
206
+ *
207
+ * 1, n, modulo, modulus
208
+ */
209
+ const PUBLIC_FORMAT_RAW = 3;
210
+ /**
211
+ * PKCS#1 formatted public key (raw)
212
+ *
213
+ * Used by File/X509.php
214
+ *
215
+ * Has the following header:
216
+ *
217
+ * -----BEGIN RSA PUBLIC KEY-----
218
+ *
219
+ * Analogous to ssh-keygen's pem format (as specified by -m)
220
+ */
221
+ const PUBLIC_FORMAT_PKCS1 = 4;
222
+ const PUBLIC_FORMAT_PKCS1_RAW = 4;
223
+ /**
224
+ * XML formatted public key
225
+ */
226
+ const PUBLIC_FORMAT_XML = 5;
227
+ /**
228
+ * OpenSSH formatted public key
229
+ *
230
+ * Place in $HOME/.ssh/authorized_keys
231
+ */
232
+ const PUBLIC_FORMAT_OPENSSH = 6;
233
+ /**
234
+ * PKCS#1 formatted public key (encapsulated)
235
+ *
236
+ * Used by PHP's openssl_public_encrypt() and openssl's rsautl (when -pubin is set)
237
+ *
238
+ * Has the following header:
239
+ *
240
+ * -----BEGIN PUBLIC KEY-----
241
+ *
242
+ * Analogous to ssh-keygen's pkcs8 format (as specified by -m). Although PKCS8
243
+ * is specific to private keys it's basically creating a DER-encoded wrapper
244
+ * for keys. This just extends that same concept to public keys (much like ssh-keygen)
245
+ */
246
+ const PUBLIC_FORMAT_PKCS8 = 7;
247
+ /**#@-*/
248
+
249
+ /**
250
+ * Precomputed Zero
251
+ *
252
+ * @var \phpseclib\Math\BigInteger
253
+ * @access private
254
+ */
255
+ var $zero;
256
+
257
+ /**
258
+ * Precomputed One
259
+ *
260
+ * @var \phpseclib\Math\BigInteger
261
+ * @access private
262
+ */
263
+ var $one;
264
+
265
+ /**
266
+ * Private Key Format
267
+ *
268
+ * @var int
269
+ * @access private
270
+ */
271
+ var $privateKeyFormat = self::PRIVATE_FORMAT_PKCS1;
272
+
273
+ /**
274
+ * Public Key Format
275
+ *
276
+ * @var int
277
+ * @access public
278
+ */
279
+ var $publicKeyFormat = self::PUBLIC_FORMAT_PKCS8;
280
+
281
+ /**
282
+ * Modulus (ie. n)
283
+ *
284
+ * @var \phpseclib\Math\BigInteger
285
+ * @access private
286
+ */
287
+ var $modulus;
288
+
289
+ /**
290
+ * Modulus length
291
+ *
292
+ * @var \phpseclib\Math\BigInteger
293
+ * @access private
294
+ */
295
+ var $k;
296
+
297
+ /**
298
+ * Exponent (ie. e or d)
299
+ *
300
+ * @var \phpseclib\Math\BigInteger
301
+ * @access private
302
+ */
303
+ var $exponent;
304
+
305
+ /**
306
+ * Primes for Chinese Remainder Theorem (ie. p and q)
307
+ *
308
+ * @var array
309
+ * @access private
310
+ */
311
+ var $primes;
312
+
313
+ /**
314
+ * Exponents for Chinese Remainder Theorem (ie. dP and dQ)
315
+ *
316
+ * @var array
317
+ * @access private
318
+ */
319
+ var $exponents;
320
+
321
+ /**
322
+ * Coefficients for Chinese Remainder Theorem (ie. qInv)
323
+ *
324
+ * @var array
325
+ * @access private
326
+ */
327
+ var $coefficients;
328
+
329
+ /**
330
+ * Hash name
331
+ *
332
+ * @var string
333
+ * @access private
334
+ */
335
+ var $hashName;
336
+
337
+ /**
338
+ * Hash function
339
+ *
340
+ * @var \phpseclib\Crypt\Hash
341
+ * @access private
342
+ */
343
+ var $hash;
344
+
345
+ /**
346
+ * Length of hash function output
347
+ *
348
+ * @var int
349
+ * @access private
350
+ */
351
+ var $hLen;
352
+
353
+ /**
354
+ * Length of salt
355
+ *
356
+ * @var int
357
+ * @access private
358
+ */
359
+ var $sLen;
360
+
361
+ /**
362
+ * Hash function for the Mask Generation Function
363
+ *
364
+ * @var \phpseclib\Crypt\Hash
365
+ * @access private
366
+ */
367
+ var $mgfHash;
368
+
369
+ /**
370
+ * Length of MGF hash function output
371
+ *
372
+ * @var int
373
+ * @access private
374
+ */
375
+ var $mgfHLen;
376
+
377
+ /**
378
+ * Encryption mode
379
+ *
380
+ * @var int
381
+ * @access private
382
+ */
383
+ var $encryptionMode = self::ENCRYPTION_OAEP;
384
+
385
+ /**
386
+ * Signature mode
387
+ *
388
+ * @var int
389
+ * @access private
390
+ */
391
+ var $signatureMode = self::SIGNATURE_PSS;
392
+
393
+ /**
394
+ * Public Exponent
395
+ *
396
+ * @var mixed
397
+ * @access private
398
+ */
399
+ var $publicExponent = false;
400
+
401
+ /**
402
+ * Password
403
+ *
404
+ * @var string
405
+ * @access private
406
+ */
407
+ var $password = false;
408
+
409
+ /**
410
+ * Components
411
+ *
412
+ * For use with parsing XML formatted keys. PHP's XML Parser functions use utilized - instead of PHP's DOM functions -
413
+ * because PHP's XML Parser functions work on PHP4 whereas PHP's DOM functions - although surperior - don't.
414
+ *
415
+ * @see self::_start_element_handler()
416
+ * @var array
417
+ * @access private
418
+ */
419
+ var $components = array();
420
+
421
+ /**
422
+ * Current String
423
+ *
424
+ * For use with parsing XML formatted keys.
425
+ *
426
+ * @see self::_character_handler()
427
+ * @see self::_stop_element_handler()
428
+ * @var mixed
429
+ * @access private
430
+ */
431
+ var $current;
432
+
433
+ /**
434
+ * OpenSSL configuration file name.
435
+ *
436
+ * Set to null to use system configuration file.
437
+ * @see self::createKey()
438
+ * @var mixed
439
+ * @Access public
440
+ */
441
+ var $configFile;
442
+
443
+ /**
444
+ * Public key comment field.
445
+ *
446
+ * @var string
447
+ * @access private
448
+ */
449
+ var $comment = 'phpseclib-generated-key';
450
+
451
+ /**
452
+ * The constructor
453
+ *
454
+ * If you want to make use of the openssl extension, you'll need to set the mode manually, yourself. The reason
455
+ * \phpseclib\Crypt\RSA doesn't do it is because OpenSSL doesn't fail gracefully. openssl_pkey_new(), in particular, requires
456
+ * openssl.cnf be present somewhere and, unfortunately, the only real way to find out is too late.
457
+ *
458
+ * @return \phpseclib\Crypt\RSA
459
+ * @access public
460
+ */
461
+ function __construct()
462
+ {
463
+ $this->configFile = dirname(__FILE__) . '/../openssl.cnf';
464
+
465
+ if (!defined('CRYPT_RSA_MODE')) {
466
+ switch (true) {
467
+ // Math/BigInteger's openssl requirements are a little less stringent than Crypt/RSA's. in particular,
468
+ // Math/BigInteger doesn't require an openssl.cfg file whereas Crypt/RSA does. so if Math/BigInteger
469
+ // can't use OpenSSL it can be pretty trivially assumed, then, that Crypt/RSA can't either.
470
+ case defined('MATH_BIGINTEGER_OPENSSL_DISABLE'):
471
+ define('CRYPT_RSA_MODE', self::MODE_INTERNAL);
472
+ break;
473
+ case extension_loaded('openssl') && file_exists($this->configFile):
474
+ // some versions of XAMPP have mismatched versions of OpenSSL which causes it not to work
475
+ $versions = array();
476
+
477
+ // avoid generating errors (even with suppression) when phpinfo() is disabled (common in production systems)
478
+ if (strpos(ini_get('disable_functions'), 'phpinfo') === false) {
479
+ ob_start();
480
+ @phpinfo();
481
+ $content = ob_get_contents();
482
+ ob_end_clean();
483
+
484
+ preg_match_all('#OpenSSL (Header|Library) Version(.*)#im', $content, $matches);
485
+
486
+ if (!empty($matches[1])) {
487
+ for ($i = 0; $i < count($matches[1]); $i++) {
488
+ $fullVersion = trim(str_replace('=>', '', strip_tags($matches[2][$i])));
489
+
490
+ // Remove letter part in OpenSSL version
491
+ if (!preg_match('/(\d+\.\d+\.\d+)/i', $fullVersion, $m)) {
492
+ $versions[$matches[1][$i]] = $fullVersion;
493
+ } else {
494
+ $versions[$matches[1][$i]] = $m[0];
495
+ }
496
+ }
497
+ }
498
+ }
499
+
500
+ // it doesn't appear that OpenSSL versions were reported upon until PHP 5.3+
501
+ switch (true) {
502
+ case !isset($versions['Header']):
503
+ case !isset($versions['Library']):
504
+ case $versions['Header'] == $versions['Library']:
505
+ case version_compare($versions['Header'], '1.0.0') >= 0 && version_compare($versions['Library'], '1.0.0') >= 0:
506
+ define('CRYPT_RSA_MODE', self::MODE_OPENSSL);
507
+ break;
508
+ default:
509
+ define('CRYPT_RSA_MODE', self::MODE_INTERNAL);
510
+ define('MATH_BIGINTEGER_OPENSSL_DISABLE', true);
511
+ }
512
+ break;
513
+ default:
514
+ define('CRYPT_RSA_MODE', self::MODE_INTERNAL);
515
+ }
516
+ }
517
+
518
+ $this->zero = new BigInteger();
519
+ $this->one = new BigInteger(1);
520
+
521
+ $this->hash = new Hash('sha1');
522
+ $this->hLen = $this->hash->getLength();
523
+ $this->hashName = 'sha1';
524
+ $this->mgfHash = new Hash('sha1');
525
+ $this->mgfHLen = $this->mgfHash->getLength();
526
+ }
527
+
528
+ /**
529
+ * Create public / private key pair
530
+ *
531
+ * Returns an array with the following three elements:
532
+ * - 'privatekey': The private key.
533
+ * - 'publickey': The public key.
534
+ * - 'partialkey': A partially computed key (if the execution time exceeded $timeout).
535
+ * Will need to be passed back to \phpseclib\Crypt\RSA::createKey() as the third parameter for further processing.
536
+ *
537
+ * @access public
538
+ * @param int $bits
539
+ * @param int $timeout
540
+ * @param array $p
541
+ */
542
+ function createKey($bits = 1024, $timeout = false, $partial = array())
543
+ {
544
+ if (!defined('CRYPT_RSA_EXPONENT')) {
545
+ // http://en.wikipedia.org/wiki/65537_%28number%29
546
+ define('CRYPT_RSA_EXPONENT', '65537');
547
+ }
548
+ // per <http://cseweb.ucsd.edu/~hovav/dist/survey.pdf#page=5>, this number ought not result in primes smaller
549
+ // than 256 bits. as a consequence if the key you're trying to create is 1024 bits and you've set CRYPT_RSA_SMALLEST_PRIME
550
+ // to 384 bits then you're going to get a 384 bit prime and a 640 bit prime (384 + 1024 % 384). at least if
551
+ // CRYPT_RSA_MODE is set to self::MODE_INTERNAL. if CRYPT_RSA_MODE is set to self::MODE_OPENSSL then
552
+ // CRYPT_RSA_SMALLEST_PRIME is ignored (ie. multi-prime RSA support is more intended as a way to speed up RSA key
553
+ // generation when there's a chance neither gmp nor OpenSSL are installed)
554
+ if (!defined('CRYPT_RSA_SMALLEST_PRIME')) {
555
+ define('CRYPT_RSA_SMALLEST_PRIME', 4096);
556
+ }
557
+
558
+ // OpenSSL uses 65537 as the exponent and requires RSA keys be 384 bits minimum
559
+ if (CRYPT_RSA_MODE == self::MODE_OPENSSL && $bits >= 384 && CRYPT_RSA_EXPONENT == 65537) {
560
+ $config = array();
561
+ if (isset($this->configFile)) {
562
+ $config['config'] = $this->configFile;
563
+ }
564
+ $rsa = openssl_pkey_new(array('private_key_bits' => $bits) + $config);
565
+ openssl_pkey_export($rsa, $privatekey, null, $config);
566
+ $publickey = openssl_pkey_get_details($rsa);
567
+ $publickey = $publickey['key'];
568
+
569
+ $privatekey = call_user_func_array(array($this, '_convertPrivateKey'), array_values($this->_parseKey($privatekey, self::PRIVATE_FORMAT_PKCS1)));
570
+ $publickey = call_user_func_array(array($this, '_convertPublicKey'), array_values($this->_parseKey($publickey, self::PUBLIC_FORMAT_PKCS1)));
571
+
572
+ // clear the buffer of error strings stemming from a minimalistic openssl.cnf
573
+ while (openssl_error_string() !== false) {
574
+ }
575
+
576
+ return array(
577
+ 'privatekey' => $privatekey,
578
+ 'publickey' => $publickey,
579
+ 'partialkey' => false
580
+ );
581
+ }
582
+
583
+ static $e;
584
+ if (!isset($e)) {
585
+ $e = new BigInteger(CRYPT_RSA_EXPONENT);
586
+ }
587
+
588
+ extract($this->_generateMinMax($bits));
589
+ $absoluteMin = $min;
590
+ $temp = $bits >> 1; // divide by two to see how many bits P and Q would be
591
+ if ($temp > CRYPT_RSA_SMALLEST_PRIME) {
592
+ $num_primes = floor($bits / CRYPT_RSA_SMALLEST_PRIME);
593
+ $temp = CRYPT_RSA_SMALLEST_PRIME;
594
+ } else {
595
+ $num_primes = 2;
596
+ }
597
+ extract($this->_generateMinMax($temp + $bits % $temp));
598
+ $finalMax = $max;
599
+ extract($this->_generateMinMax($temp));
600
+
601
+ $generator = new BigInteger();
602
+
603
+ $n = $this->one->copy();
604
+ if (!empty($partial)) {
605
+ extract(unserialize($partial));
606
+ } else {
607
+ $exponents = $coefficients = $primes = array();
608
+ $lcm = array(
609
+ 'top' => $this->one->copy(),
610
+ 'bottom' => false
611
+ );
612
+ }
613
+
614
+ $start = time();
615
+ $i0 = count($primes) + 1;
616
+
617
+ do {
618
+ for ($i = $i0; $i <= $num_primes; $i++) {
619
+ if ($timeout !== false) {
620
+ $timeout-= time() - $start;
621
+ $start = time();
622
+ if ($timeout <= 0) {
623
+ return array(
624
+ 'privatekey' => '',
625
+ 'publickey' => '',
626
+ 'partialkey' => serialize(array(
627
+ 'primes' => $primes,
628
+ 'coefficients' => $coefficients,
629
+ 'lcm' => $lcm,
630
+ 'exponents' => $exponents
631
+ ))
632
+ );
633
+ }
634
+ }
635
+
636
+ if ($i == $num_primes) {
637
+ list($min, $temp) = $absoluteMin->divide($n);
638
+ if (!$temp->equals($this->zero)) {
639
+ $min = $min->add($this->one); // ie. ceil()
640
+ }
641
+ $primes[$i] = $generator->randomPrime($min, $finalMax, $timeout);
642
+ } else {
643
+ $primes[$i] = $generator->randomPrime($min, $max, $timeout);
644
+ }
645
+
646
+ if ($primes[$i] === false) { // if we've reached the timeout
647
+ if (count($primes) > 1) {
648
+ $partialkey = '';
649
+ } else {
650
+ array_pop($primes);
651
+ $partialkey = serialize(array(
652
+ 'primes' => $primes,
653
+ 'coefficients' => $coefficients,
654
+ 'lcm' => $lcm,
655
+ 'exponents' => $exponents
656
+ ));
657
+ }
658
+
659
+ return array(
660
+ 'privatekey' => '',
661
+ 'publickey' => '',
662
+ 'partialkey' => $partialkey
663
+ );
664
+ }
665
+
666
+ // the first coefficient is calculated differently from the rest
667
+ // ie. instead of being $primes[1]->modInverse($primes[2]), it's $primes[2]->modInverse($primes[1])
668
+ if ($i > 2) {
669
+ $coefficients[$i] = $n->modInverse($primes[$i]);
670
+ }
671
+
672
+ $n = $n->multiply($primes[$i]);
673
+
674
+ $temp = $primes[$i]->subtract($this->one);
675
+
676
+ // textbook RSA implementations use Euler's totient function instead of the least common multiple.
677
+ // see http://en.wikipedia.org/wiki/Euler%27s_totient_function
678
+ $lcm['top'] = $lcm['top']->multiply($temp);
679
+ $lcm['bottom'] = $lcm['bottom'] === false ? $temp : $lcm['bottom']->gcd($temp);
680
+
681
+ $exponents[$i] = $e->modInverse($temp);
682
+ }
683
+
684
+ list($temp) = $lcm['top']->divide($lcm['bottom']);
685
+ $gcd = $temp->gcd($e);
686
+ $i0 = 1;
687
+ } while (!$gcd->equals($this->one));
688
+
689
+ $d = $e->modInverse($temp);
690
+
691
+ $coefficients[2] = $primes[2]->modInverse($primes[1]);
692
+
693
+ // from <http://tools.ietf.org/html/rfc3447#appendix-A.1.2>:
694
+ // RSAPrivateKey ::= SEQUENCE {
695
+ // version Version,
696
+ // modulus INTEGER, -- n
697
+ // publicExponent INTEGER, -- e
698
+ // privateExponent INTEGER, -- d
699
+ // prime1 INTEGER, -- p
700
+ // prime2 INTEGER, -- q
701
+ // exponent1 INTEGER, -- d mod (p-1)
702
+ // exponent2 INTEGER, -- d mod (q-1)
703
+ // coefficient INTEGER, -- (inverse of q) mod p
704
+ // otherPrimeInfos OtherPrimeInfos OPTIONAL
705
+ // }
706
+
707
+ return array(
708
+ 'privatekey' => $this->_convertPrivateKey($n, $e, $d, $primes, $exponents, $coefficients),
709
+ 'publickey' => $this->_convertPublicKey($n, $e),
710
+ 'partialkey' => false
711
+ );
712
+ }
713
+
714
+ /**
715
+ * Convert a private key to the appropriate format.
716
+ *
717
+ * @access private
718
+ * @see self::setPrivateKeyFormat()
719
+ * @param string $RSAPrivateKey
720
+ * @return string
721
+ */
722
+ function _convertPrivateKey($n, $e, $d, $primes, $exponents, $coefficients)
723
+ {
724
+ $signed = $this->privateKeyFormat != self::PRIVATE_FORMAT_XML;
725
+ $num_primes = count($primes);
726
+ $raw = array(
727
+ 'version' => $num_primes == 2 ? chr(0) : chr(1), // two-prime vs. multi
728
+ 'modulus' => $n->toBytes($signed),
729
+ 'publicExponent' => $e->toBytes($signed),
730
+ 'privateExponent' => $d->toBytes($signed),
731
+ 'prime1' => $primes[1]->toBytes($signed),
732
+ 'prime2' => $primes[2]->toBytes($signed),
733
+ 'exponent1' => $exponents[1]->toBytes($signed),
734
+ 'exponent2' => $exponents[2]->toBytes($signed),
735
+ 'coefficient' => $coefficients[2]->toBytes($signed)
736
+ );
737
+
738
+ // if the format in question does not support multi-prime rsa and multi-prime rsa was used,
739
+ // call _convertPublicKey() instead.
740
+ switch ($this->privateKeyFormat) {
741
+ case self::PRIVATE_FORMAT_XML:
742
+ if ($num_primes != 2) {
743
+ return false;
744
+ }
745
+ return "<RSAKeyValue>\r\n" .
746
+ ' <Modulus>' . base64_encode($raw['modulus']) . "</Modulus>\r\n" .
747
+ ' <Exponent>' . base64_encode($raw['publicExponent']) . "</Exponent>\r\n" .
748
+ ' <P>' . base64_encode($raw['prime1']) . "</P>\r\n" .
749
+ ' <Q>' . base64_encode($raw['prime2']) . "</Q>\r\n" .
750
+ ' <DP>' . base64_encode($raw['exponent1']) . "</DP>\r\n" .
751
+ ' <DQ>' . base64_encode($raw['exponent2']) . "</DQ>\r\n" .
752
+ ' <InverseQ>' . base64_encode($raw['coefficient']) . "</InverseQ>\r\n" .
753
+ ' <D>' . base64_encode($raw['privateExponent']) . "</D>\r\n" .
754
+ '</RSAKeyValue>';
755
+ break;
756
+ case self::PRIVATE_FORMAT_PUTTY:
757
+ if ($num_primes != 2) {
758
+ return false;
759
+ }
760
+ $key = "PuTTY-User-Key-File-2: ssh-rsa\r\nEncryption: ";
761
+ $encryption = (!empty($this->password) || is_string($this->password)) ? 'aes256-cbc' : 'none';
762
+ $key.= $encryption;
763
+ $key.= "\r\nComment: " . $this->comment . "\r\n";
764
+ $public = pack(
765
+ 'Na*Na*Na*',
766
+ strlen('ssh-rsa'),
767
+ 'ssh-rsa',
768
+ strlen($raw['publicExponent']),
769
+ $raw['publicExponent'],
770
+ strlen($raw['modulus']),
771
+ $raw['modulus']
772
+ );
773
+ $source = pack(
774
+ 'Na*Na*Na*Na*',
775
+ strlen('ssh-rsa'),
776
+ 'ssh-rsa',
777
+ strlen($encryption),
778
+ $encryption,
779
+ strlen($this->comment),
780
+ $this->comment,
781
+ strlen($public),
782
+ $public
783
+ );
784
+ $public = base64_encode($public);
785
+ $key.= "Public-Lines: " . ((strlen($public) + 63) >> 6) . "\r\n";
786
+ $key.= chunk_split($public, 64);
787
+ $private = pack(
788
+ 'Na*Na*Na*Na*',
789
+ strlen($raw['privateExponent']),
790
+ $raw['privateExponent'],
791
+ strlen($raw['prime1']),
792
+ $raw['prime1'],
793
+ strlen($raw['prime2']),
794
+ $raw['prime2'],
795
+ strlen($raw['coefficient']),
796
+ $raw['coefficient']
797
+ );
798
+ if (empty($this->password) && !is_string($this->password)) {
799
+ $source.= pack('Na*', strlen($private), $private);
800
+ $hashkey = 'putty-private-key-file-mac-key';
801
+ } else {
802
+ $private.= Random::string(16 - (strlen($private) & 15));
803
+ $source.= pack('Na*', strlen($private), $private);
804
+ $sequence = 0;
805
+ $symkey = '';
806
+ while (strlen($symkey) < 32) {
807
+ $temp = pack('Na*', $sequence++, $this->password);
808
+ $symkey.= pack('H*', sha1($temp));
809
+ }
810
+ $symkey = substr($symkey, 0, 32);
811
+ $crypto = new AES();
812
+
813
+ $crypto->setKey($symkey);
814
+ $crypto->disablePadding();
815
+ $private = $crypto->encrypt($private);
816
+ $hashkey = 'putty-private-key-file-mac-key' . $this->password;
817
+ }
818
+
819
+ $private = base64_encode($private);
820
+ $key.= 'Private-Lines: ' . ((strlen($private) + 63) >> 6) . "\r\n";
821
+ $key.= chunk_split($private, 64);
822
+ $hash = new Hash('sha1');
823
+ $hash->setKey(pack('H*', sha1($hashkey)));
824
+ $key.= 'Private-MAC: ' . bin2hex($hash->hash($source)) . "\r\n";
825
+
826
+ return $key;
827
+ case self::PRIVATE_FORMAT_OPENSSH:
828
+ if ($num_primes != 2) {
829
+ return false;
830
+ }
831
+ $publicKey = pack('Na*Na*Na*', strlen('ssh-rsa'), 'ssh-rsa', strlen($raw['publicExponent']), $raw['publicExponent'], strlen($raw['modulus']), $raw['modulus']);
832
+ $privateKey = pack(
833
+ 'Na*Na*Na*Na*Na*Na*Na*',
834
+ strlen('ssh-rsa'),
835
+ 'ssh-rsa',
836
+ strlen($raw['modulus']),
837
+ $raw['modulus'],
838
+ strlen($raw['publicExponent']),
839
+ $raw['publicExponent'],
840
+ strlen($raw['privateExponent']),
841
+ $raw['privateExponent'],
842
+ strlen($raw['coefficient']),
843
+ $raw['coefficient'],
844
+ strlen($raw['prime1']),
845
+ $raw['prime1'],
846
+ strlen($raw['prime2']),
847
+ $raw['prime2']
848
+ );
849
+ $checkint = Random::string(4);
850
+ $paddedKey = pack(
851
+ 'a*Na*',
852
+ $checkint . $checkint . $privateKey,
853
+ strlen($this->comment),
854
+ $this->comment
855
+ );
856
+ $paddingLength = (7 * strlen($paddedKey)) % 8;
857
+ for ($i = 1; $i <= $paddingLength; $i++) {
858
+ $paddedKey.= chr($i);
859
+ }
860
+ $key = pack(
861
+ 'Na*Na*Na*NNa*Na*',
862
+ strlen('none'),
863
+ 'none',
864
+ strlen('none'),
865
+ 'none',
866
+ 0,
867
+ '',
868
+ 1,
869
+ strlen($publicKey),
870
+ $publicKey,
871
+ strlen($paddedKey),
872
+ $paddedKey
873
+ );
874
+ $key = "openssh-key-v1\0$key";
875
+
876
+ return "-----BEGIN OPENSSH PRIVATE KEY-----\r\n" .
877
+ chunk_split(base64_encode($key), 70) .
878
+ "-----END OPENSSH PRIVATE KEY-----";
879
+ default: // eg. self::PRIVATE_FORMAT_PKCS1
880
+ $components = array();
881
+ foreach ($raw as $name => $value) {
882
+ $components[$name] = pack('Ca*a*', self::ASN1_INTEGER, $this->_encodeLength(strlen($value)), $value);
883
+ }
884
+
885
+ $RSAPrivateKey = implode('', $components);
886
+
887
+ if ($num_primes > 2) {
888
+ $OtherPrimeInfos = '';
889
+ for ($i = 3; $i <= $num_primes; $i++) {
890
+ // OtherPrimeInfos ::= SEQUENCE SIZE(1..MAX) OF OtherPrimeInfo
891
+ //
892
+ // OtherPrimeInfo ::= SEQUENCE {
893
+ // prime INTEGER, -- ri
894
+ // exponent INTEGER, -- di
895
+ // coefficient INTEGER -- ti
896
+ // }
897
+ $OtherPrimeInfo = pack('Ca*a*', self::ASN1_INTEGER, $this->_encodeLength(strlen($primes[$i]->toBytes(true))), $primes[$i]->toBytes(true));
898
+ $OtherPrimeInfo.= pack('Ca*a*', self::ASN1_INTEGER, $this->_encodeLength(strlen($exponents[$i]->toBytes(true))), $exponents[$i]->toBytes(true));
899
+ $OtherPrimeInfo.= pack('Ca*a*', self::ASN1_INTEGER, $this->_encodeLength(strlen($coefficients[$i]->toBytes(true))), $coefficients[$i]->toBytes(true));
900
+ $OtherPrimeInfos.= pack('Ca*a*', self::ASN1_SEQUENCE, $this->_encodeLength(strlen($OtherPrimeInfo)), $OtherPrimeInfo);
901
+ }
902
+ $RSAPrivateKey.= pack('Ca*a*', self::ASN1_SEQUENCE, $this->_encodeLength(strlen($OtherPrimeInfos)), $OtherPrimeInfos);
903
+ }
904
+
905
+ $RSAPrivateKey = pack('Ca*a*', self::ASN1_SEQUENCE, $this->_encodeLength(strlen($RSAPrivateKey)), $RSAPrivateKey);
906
+
907
+ if ($this->privateKeyFormat == self::PRIVATE_FORMAT_PKCS8) {
908
+ $rsaOID = pack('H*', '300d06092a864886f70d0101010500'); // hex version of MA0GCSqGSIb3DQEBAQUA
909
+ $RSAPrivateKey = pack(
910
+ 'Ca*a*Ca*a*',
911
+ self::ASN1_INTEGER,
912
+ "\01\00",
913
+ $rsaOID,
914
+ 4,
915
+ $this->_encodeLength(strlen($RSAPrivateKey)),
916
+ $RSAPrivateKey
917
+ );
918
+ $RSAPrivateKey = pack('Ca*a*', self::ASN1_SEQUENCE, $this->_encodeLength(strlen($RSAPrivateKey)), $RSAPrivateKey);
919
+ if (!empty($this->password) || is_string($this->password)) {
920
+ $salt = Random::string(8);
921
+ $iterationCount = 2048;
922
+
923
+ $crypto = new DES();
924
+ $crypto->setPassword($this->password, 'pbkdf1', 'md5', $salt, $iterationCount);
925
+ $RSAPrivateKey = $crypto->encrypt($RSAPrivateKey);
926
+
927
+ $parameters = pack(
928
+ 'Ca*a*Ca*N',
929
+ self::ASN1_OCTETSTRING,
930
+ $this->_encodeLength(strlen($salt)),
931
+ $salt,
932
+ self::ASN1_INTEGER,
933
+ $this->_encodeLength(4),
934
+ $iterationCount
935
+ );
936
+ $pbeWithMD5AndDES_CBC = "\x2a\x86\x48\x86\xf7\x0d\x01\x05\x03";
937
+
938
+ $encryptionAlgorithm = pack(
939
+ 'Ca*a*Ca*a*',
940
+ self::ASN1_OBJECT,
941
+ $this->_encodeLength(strlen($pbeWithMD5AndDES_CBC)),
942
+ $pbeWithMD5AndDES_CBC,
943
+ self::ASN1_SEQUENCE,
944
+ $this->_encodeLength(strlen($parameters)),
945
+ $parameters
946
+ );
947
+
948
+ $RSAPrivateKey = pack(
949
+ 'Ca*a*Ca*a*',
950
+ self::ASN1_SEQUENCE,
951
+ $this->_encodeLength(strlen($encryptionAlgorithm)),
952
+ $encryptionAlgorithm,
953
+ self::ASN1_OCTETSTRING,
954
+ $this->_encodeLength(strlen($RSAPrivateKey)),
955
+ $RSAPrivateKey
956
+ );
957
+
958
+ $RSAPrivateKey = pack('Ca*a*', self::ASN1_SEQUENCE, $this->_encodeLength(strlen($RSAPrivateKey)), $RSAPrivateKey);
959
+
960
+ $RSAPrivateKey = "-----BEGIN ENCRYPTED PRIVATE KEY-----\r\n" .
961
+ chunk_split(base64_encode($RSAPrivateKey), 64) .
962
+ '-----END ENCRYPTED PRIVATE KEY-----';
963
+ } else {
964
+ $RSAPrivateKey = "-----BEGIN PRIVATE KEY-----\r\n" .
965
+ chunk_split(base64_encode($RSAPrivateKey), 64) .
966
+ '-----END PRIVATE KEY-----';
967
+ }
968
+ return $RSAPrivateKey;
969
+ }
970
+
971
+ if (!empty($this->password) || is_string($this->password)) {
972
+ $iv = Random::string(8);
973
+ $symkey = pack('H*', md5($this->password . $iv)); // symkey is short for symmetric key
974
+ $symkey.= substr(pack('H*', md5($symkey . $this->password . $iv)), 0, 8);
975
+ $des = new TripleDES();
976
+ $des->setKey($symkey);
977
+ $des->setIV($iv);
978
+ $iv = strtoupper(bin2hex($iv));
979
+ $RSAPrivateKey = "-----BEGIN RSA PRIVATE KEY-----\r\n" .
980
+ "Proc-Type: 4,ENCRYPTED\r\n" .
981
+ "DEK-Info: DES-EDE3-CBC,$iv\r\n" .
982
+ "\r\n" .
983
+ chunk_split(base64_encode($des->encrypt($RSAPrivateKey)), 64) .
984
+ '-----END RSA PRIVATE KEY-----';
985
+ } else {
986
+ $RSAPrivateKey = "-----BEGIN RSA PRIVATE KEY-----\r\n" .
987
+ chunk_split(base64_encode($RSAPrivateKey), 64) .
988
+ '-----END RSA PRIVATE KEY-----';
989
+ }
990
+
991
+ return $RSAPrivateKey;
992
+ }
993
+ }
994
+
995
+ /**
996
+ * Convert a public key to the appropriate format
997
+ *
998
+ * @access private
999
+ * @see self::setPublicKeyFormat()
1000
+ * @param string $RSAPrivateKey
1001
+ * @return string
1002
+ */
1003
+ function _convertPublicKey($n, $e)
1004
+ {
1005
+ $signed = $this->publicKeyFormat != self::PUBLIC_FORMAT_XML;
1006
+
1007
+ $modulus = $n->toBytes($signed);
1008
+ $publicExponent = $e->toBytes($signed);
1009
+
1010
+ switch ($this->publicKeyFormat) {
1011
+ case self::PUBLIC_FORMAT_RAW:
1012
+ return array('e' => $e->copy(), 'n' => $n->copy());
1013
+ case self::PUBLIC_FORMAT_XML:
1014
+ return "<RSAKeyValue>\r\n" .
1015
+ ' <Modulus>' . base64_encode($modulus) . "</Modulus>\r\n" .
1016
+ ' <Exponent>' . base64_encode($publicExponent) . "</Exponent>\r\n" .
1017
+ '</RSAKeyValue>';
1018
+ break;
1019
+ case self::PUBLIC_FORMAT_OPENSSH:
1020
+ // from <http://tools.ietf.org/html/rfc4253#page-15>:
1021
+ // string "ssh-rsa"
1022
+ // mpint e
1023
+ // mpint n
1024
+ $RSAPublicKey = pack('Na*Na*Na*', strlen('ssh-rsa'), 'ssh-rsa', strlen($publicExponent), $publicExponent, strlen($modulus), $modulus);
1025
+ $RSAPublicKey = 'ssh-rsa ' . base64_encode($RSAPublicKey) . ' ' . $this->comment;
1026
+
1027
+ return $RSAPublicKey;
1028
+ default: // eg. self::PUBLIC_FORMAT_PKCS1_RAW or self::PUBLIC_FORMAT_PKCS1
1029
+ // from <http://tools.ietf.org/html/rfc3447#appendix-A.1.1>:
1030
+ // RSAPublicKey ::= SEQUENCE {
1031
+ // modulus INTEGER, -- n
1032
+ // publicExponent INTEGER -- e
1033
+ // }
1034
+ $components = array(
1035
+ 'modulus' => pack('Ca*a*', self::ASN1_INTEGER, $this->_encodeLength(strlen($modulus)), $modulus),
1036
+ 'publicExponent' => pack('Ca*a*', self::ASN1_INTEGER, $this->_encodeLength(strlen($publicExponent)), $publicExponent)
1037
+ );
1038
+
1039
+ $RSAPublicKey = pack(
1040
+ 'Ca*a*a*',
1041
+ self::ASN1_SEQUENCE,
1042
+ $this->_encodeLength(strlen($components['modulus']) + strlen($components['publicExponent'])),
1043
+ $components['modulus'],
1044
+ $components['publicExponent']
1045
+ );
1046
+
1047
+ if ($this->publicKeyFormat == self::PUBLIC_FORMAT_PKCS1_RAW) {
1048
+ $RSAPublicKey = "-----BEGIN RSA PUBLIC KEY-----\r\n" .
1049
+ chunk_split(base64_encode($RSAPublicKey), 64) .
1050
+ '-----END RSA PUBLIC KEY-----';
1051
+ } else {
1052
+ // sequence(oid(1.2.840.113549.1.1.1), null)) = rsaEncryption.
1053
+ $rsaOID = pack('H*', '300d06092a864886f70d0101010500'); // hex version of MA0GCSqGSIb3DQEBAQUA
1054
+ $RSAPublicKey = chr(0) . $RSAPublicKey;
1055
+ $RSAPublicKey = chr(3) . $this->_encodeLength(strlen($RSAPublicKey)) . $RSAPublicKey;
1056
+
1057
+ $RSAPublicKey = pack(
1058
+ 'Ca*a*',
1059
+ self::ASN1_SEQUENCE,
1060
+ $this->_encodeLength(strlen($rsaOID . $RSAPublicKey)),
1061
+ $rsaOID . $RSAPublicKey
1062
+ );
1063
+
1064
+ $RSAPublicKey = "-----BEGIN PUBLIC KEY-----\r\n" .
1065
+ chunk_split(base64_encode($RSAPublicKey), 64) .
1066
+ '-----END PUBLIC KEY-----';
1067
+ }
1068
+
1069
+ return $RSAPublicKey;
1070
+ }
1071
+ }
1072
+
1073
+ /**
1074
+ * Break a public or private key down into its constituant components
1075
+ *
1076
+ * @access private
1077
+ * @see self::_convertPublicKey()
1078
+ * @see self::_convertPrivateKey()
1079
+ * @param string|array $key
1080
+ * @param int $type
1081
+ * @return array|bool
1082
+ */
1083
+ function _parseKey($key, $type)
1084
+ {
1085
+ if ($type != self::PUBLIC_FORMAT_RAW && !is_string($key)) {
1086
+ return false;
1087
+ }
1088
+
1089
+ switch ($type) {
1090
+ case self::PUBLIC_FORMAT_RAW:
1091
+ if (!is_array($key)) {
1092
+ return false;
1093
+ }
1094
+ $components = array();
1095
+ switch (true) {
1096
+ case isset($key['e']):
1097
+ $components['publicExponent'] = $key['e']->copy();
1098
+ break;
1099
+ case isset($key['exponent']):
1100
+ $components['publicExponent'] = $key['exponent']->copy();
1101
+ break;
1102
+ case isset($key['publicExponent']):
1103
+ $components['publicExponent'] = $key['publicExponent']->copy();
1104
+ break;
1105
+ case isset($key[0]):
1106
+ $components['publicExponent'] = $key[0]->copy();
1107
+ }
1108
+ switch (true) {
1109
+ case isset($key['n']):
1110
+ $components['modulus'] = $key['n']->copy();
1111
+ break;
1112
+ case isset($key['modulo']):
1113
+ $components['modulus'] = $key['modulo']->copy();
1114
+ break;
1115
+ case isset($key['modulus']):
1116
+ $components['modulus'] = $key['modulus']->copy();
1117
+ break;
1118
+ case isset($key[1]):
1119
+ $components['modulus'] = $key[1]->copy();
1120
+ }
1121
+ return isset($components['modulus']) && isset($components['publicExponent']) ? $components : false;
1122
+ case self::PRIVATE_FORMAT_PKCS1:
1123
+ case self::PRIVATE_FORMAT_PKCS8:
1124
+ case self::PUBLIC_FORMAT_PKCS1:
1125
+ /* Although PKCS#1 proposes a format that public and private keys can use, encrypting them is
1126
+ "outside the scope" of PKCS#1. PKCS#1 then refers you to PKCS#12 and PKCS#15 if you're wanting to
1127
+ protect private keys, however, that's not what OpenSSL* does. OpenSSL protects private keys by adding
1128
+ two new "fields" to the key - DEK-Info and Proc-Type. These fields are discussed here:
1129
+
1130
+ http://tools.ietf.org/html/rfc1421#section-4.6.1.1
1131
+ http://tools.ietf.org/html/rfc1421#section-4.6.1.3
1132
+
1133
+ DES-EDE3-CBC as an algorithm, however, is not discussed anywhere, near as I can tell.
1134
+ DES-CBC and DES-EDE are discussed in RFC1423, however, DES-EDE3-CBC isn't, nor is its key derivation
1135
+ function. As is, the definitive authority on this encoding scheme isn't the IETF but rather OpenSSL's
1136
+ own implementation. ie. the implementation *is* the standard and any bugs that may exist in that
1137
+ implementation are part of the standard, as well.
1138
+
1139
+ * OpenSSL is the de facto standard. It's utilized by OpenSSH and other projects */
1140
+ if (preg_match('#DEK-Info: (.+),(.+)#', $key, $matches)) {
1141
+ $iv = pack('H*', trim($matches[2]));
1142
+ $symkey = pack('H*', md5($this->password . substr($iv, 0, 8))); // symkey is short for symmetric key
1143
+ $symkey.= pack('H*', md5($symkey . $this->password . substr($iv, 0, 8)));
1144
+ // remove the Proc-Type / DEK-Info sections as they're no longer needed
1145
+ $key = preg_replace('#^(?:Proc-Type|DEK-Info): .*#m', '', $key);
1146
+ $ciphertext = $this->_extractBER($key);
1147
+ if ($ciphertext === false) {
1148
+ $ciphertext = $key;
1149
+ }
1150
+ switch ($matches[1]) {
1151
+ case 'AES-256-CBC':
1152
+ $crypto = new AES();
1153
+ break;
1154
+ case 'AES-128-CBC':
1155
+ $symkey = substr($symkey, 0, 16);
1156
+ $crypto = new AES();
1157
+ break;
1158
+ case 'DES-EDE3-CFB':
1159
+ $crypto = new TripleDES(Base::MODE_CFB);
1160
+ break;
1161
+ case 'DES-EDE3-CBC':
1162
+ $symkey = substr($symkey, 0, 24);
1163
+ $crypto = new TripleDES();
1164
+ break;
1165
+ case 'DES-CBC':
1166
+ $crypto = new DES();
1167
+ break;
1168
+ default:
1169
+ return false;
1170
+ }
1171
+ $crypto->setKey($symkey);
1172
+ $crypto->setIV($iv);
1173
+ $decoded = $crypto->decrypt($ciphertext);
1174
+ } else {
1175
+ $decoded = $this->_extractBER($key);
1176
+ }
1177
+
1178
+ if ($decoded !== false) {
1179
+ $key = $decoded;
1180
+ }
1181
+
1182
+ $components = array();
1183
+
1184
+ if (ord($this->_string_shift($key)) != self::ASN1_SEQUENCE) {
1185
+ return false;
1186
+ }
1187
+ if ($this->_decodeLength($key) != strlen($key)) {
1188
+ return false;
1189
+ }
1190
+
1191
+ $tag = ord($this->_string_shift($key));
1192
+ /* intended for keys for which OpenSSL's asn1parse returns the following:
1193
+
1194
+ 0:d=0 hl=4 l= 631 cons: SEQUENCE
1195
+ 4:d=1 hl=2 l= 1 prim: INTEGER :00
1196
+ 7:d=1 hl=2 l= 13 cons: SEQUENCE
1197
+ 9:d=2 hl=2 l= 9 prim: OBJECT :rsaEncryption
1198
+ 20:d=2 hl=2 l= 0 prim: NULL
1199
+ 22:d=1 hl=4 l= 609 prim: OCTET STRING
1200
+
1201
+ ie. PKCS8 keys*/
1202
+
1203
+ if ($tag == self::ASN1_INTEGER && substr($key, 0, 3) == "\x01\x00\x30") {
1204
+ $this->_string_shift($key, 3);
1205
+ $tag = self::ASN1_SEQUENCE;
1206
+ }
1207
+
1208
+ if ($tag == self::ASN1_SEQUENCE) {
1209
+ $temp = $this->_string_shift($key, $this->_decodeLength($key));
1210
+ if (ord($this->_string_shift($temp)) != self::ASN1_OBJECT) {
1211
+ return false;
1212
+ }
1213
+ $length = $this->_decodeLength($temp);
1214
+ switch ($this->_string_shift($temp, $length)) {
1215
+ case "\x2a\x86\x48\x86\xf7\x0d\x01\x01\x01": // rsaEncryption
1216
+ break;
1217
+ case "\x2a\x86\x48\x86\xf7\x0d\x01\x05\x03": // pbeWithMD5AndDES-CBC
1218
+ /*
1219
+ PBEParameter ::= SEQUENCE {
1220
+ salt OCTET STRING (SIZE(8)),
1221
+ iterationCount INTEGER }
1222
+ */
1223
+ if (ord($this->_string_shift($temp)) != self::ASN1_SEQUENCE) {
1224
+ return false;
1225
+ }
1226
+ if ($this->_decodeLength($temp) != strlen($temp)) {
1227
+ return false;
1228
+ }
1229
+ $this->_string_shift($temp); // assume it's an octet string
1230
+ $salt = $this->_string_shift($temp, $this->_decodeLength($temp));
1231
+ if (ord($this->_string_shift($temp)) != self::ASN1_INTEGER) {
1232
+ return false;
1233
+ }
1234
+ $this->_decodeLength($temp);
1235
+ list(, $iterationCount) = unpack('N', str_pad($temp, 4, chr(0), STR_PAD_LEFT));
1236
+ $this->_string_shift($key); // assume it's an octet string
1237
+ $length = $this->_decodeLength($key);
1238
+ if (strlen($key) != $length) {
1239
+ return false;
1240
+ }
1241
+
1242
+ $crypto = new DES();
1243
+ $crypto->setPassword($this->password, 'pbkdf1', 'md5', $salt, $iterationCount);
1244
+ $key = $crypto->decrypt($key);
1245
+ if ($key === false) {
1246
+ return false;
1247
+ }
1248
+ return $this->_parseKey($key, self::PRIVATE_FORMAT_PKCS1);
1249
+ default:
1250
+ return false;
1251
+ }
1252
+ /* intended for keys for which OpenSSL's asn1parse returns the following:
1253
+
1254
+ 0:d=0 hl=4 l= 290 cons: SEQUENCE
1255
+ 4:d=1 hl=2 l= 13 cons: SEQUENCE
1256
+ 6:d=2 hl=2 l= 9 prim: OBJECT :rsaEncryption
1257
+ 17:d=2 hl=2 l= 0 prim: NULL
1258
+ 19:d=1 hl=4 l= 271 prim: BIT STRING */
1259
+ $tag = ord($this->_string_shift($key)); // skip over the BIT STRING / OCTET STRING tag
1260
+ $this->_decodeLength($key); // skip over the BIT STRING / OCTET STRING length
1261
+ // "The initial octet shall encode, as an unsigned binary integer wtih bit 1 as the least significant bit, the number of
1262
+ // unused bits in the final subsequent octet. The number shall be in the range zero to seven."
1263
+ // -- http://www.itu.int/ITU-T/studygroups/com17/languages/X.690-0207.pdf (section 8.6.2.2)
1264
+ if ($tag == self::ASN1_BITSTRING) {
1265
+ $this->_string_shift($key);
1266
+ }
1267
+ if (ord($this->_string_shift($key)) != self::ASN1_SEQUENCE) {
1268
+ return false;
1269
+ }
1270
+ if ($this->_decodeLength($key) != strlen($key)) {
1271
+ return false;
1272
+ }
1273
+ $tag = ord($this->_string_shift($key));
1274
+ }
1275
+ if ($tag != self::ASN1_INTEGER) {
1276
+ return false;
1277
+ }
1278
+
1279
+ $length = $this->_decodeLength($key);
1280
+ $temp = $this->_string_shift($key, $length);
1281
+ if (strlen($temp) != 1 || ord($temp) > 2) {
1282
+ $components['modulus'] = new BigInteger($temp, 256);
1283
+ $this->_string_shift($key); // skip over self::ASN1_INTEGER
1284
+ $length = $this->_decodeLength($key);
1285
+ $components[$type == self::PUBLIC_FORMAT_PKCS1 ? 'publicExponent' : 'privateExponent'] = new BigInteger($this->_string_shift($key, $length), 256);
1286
+
1287
+ return $components;
1288
+ }
1289
+ if (ord($this->_string_shift($key)) != self::ASN1_INTEGER) {
1290
+ return false;
1291
+ }
1292
+ $length = $this->_decodeLength($key);
1293
+ $components['modulus'] = new BigInteger($this->_string_shift($key, $length), 256);
1294
+ $this->_string_shift($key);
1295
+ $length = $this->_decodeLength($key);
1296
+ $components['publicExponent'] = new BigInteger($this->_string_shift($key, $length), 256);
1297
+ $this->_string_shift($key);
1298
+ $length = $this->_decodeLength($key);
1299
+ $components['privateExponent'] = new BigInteger($this->_string_shift($key, $length), 256);
1300
+ $this->_string_shift($key);
1301
+ $length = $this->_decodeLength($key);
1302
+ $components['primes'] = array(1 => new BigInteger($this->_string_shift($key, $length), 256));
1303
+ $this->_string_shift($key);
1304
+ $length = $this->_decodeLength($key);
1305
+ $components['primes'][] = new BigInteger($this->_string_shift($key, $length), 256);
1306
+ $this->_string_shift($key);
1307
+ $length = $this->_decodeLength($key);
1308
+ $components['exponents'] = array(1 => new BigInteger($this->_string_shift($key, $length), 256));
1309
+ $this->_string_shift($key);
1310
+ $length = $this->_decodeLength($key);
1311
+ $components['exponents'][] = new BigInteger($this->_string_shift($key, $length), 256);
1312
+ $this->_string_shift($key);
1313
+ $length = $this->_decodeLength($key);
1314
+ $components['coefficients'] = array(2 => new BigInteger($this->_string_shift($key, $length), 256));
1315
+
1316
+ if (!empty($key)) {
1317
+ if (ord($this->_string_shift($key)) != self::ASN1_SEQUENCE) {
1318
+ return false;
1319
+ }
1320
+ $this->_decodeLength($key);
1321
+ while (!empty($key)) {
1322
+ if (ord($this->_string_shift($key)) != self::ASN1_SEQUENCE) {
1323
+ return false;
1324
+ }
1325
+ $this->_decodeLength($key);
1326
+ $key = substr($key, 1);
1327
+ $length = $this->_decodeLength($key);
1328
+ $components['primes'][] = new BigInteger($this->_string_shift($key, $length), 256);
1329
+ $this->_string_shift($key);
1330
+ $length = $this->_decodeLength($key);
1331
+ $components['exponents'][] = new BigInteger($this->_string_shift($key, $length), 256);
1332
+ $this->_string_shift($key);
1333
+ $length = $this->_decodeLength($key);
1334
+ $components['coefficients'][] = new BigInteger($this->_string_shift($key, $length), 256);
1335
+ }
1336
+ }
1337
+
1338
+ return $components;
1339
+ case self::PUBLIC_FORMAT_OPENSSH:
1340
+ $parts = explode(' ', $key, 3);
1341
+
1342
+ $key = isset($parts[1]) ? base64_decode($parts[1]) : false;
1343
+ if ($key === false) {
1344
+ return false;
1345
+ }
1346
+
1347
+ $comment = isset($parts[2]) ? $parts[2] : false;
1348
+
1349
+ $cleanup = substr($key, 0, 11) == "\0\0\0\7ssh-rsa";
1350
+
1351
+ if (strlen($key) <= 4) {
1352
+ return false;
1353
+ }
1354
+ extract(unpack('Nlength', $this->_string_shift($key, 4)));
1355
+ $publicExponent = new BigInteger($this->_string_shift($key, $length), -256);
1356
+ if (strlen($key) <= 4) {
1357
+ return false;
1358
+ }
1359
+ extract(unpack('Nlength', $this->_string_shift($key, 4)));
1360
+ $modulus = new BigInteger($this->_string_shift($key, $length), -256);
1361
+
1362
+ if ($cleanup && strlen($key)) {
1363
+ if (strlen($key) <= 4) {
1364
+ return false;
1365
+ }
1366
+ extract(unpack('Nlength', $this->_string_shift($key, 4)));
1367
+ $realModulus = new BigInteger($this->_string_shift($key, $length), -256);
1368
+ return strlen($key) ? false : array(
1369
+ 'modulus' => $realModulus,
1370
+ 'publicExponent' => $modulus,
1371
+ 'comment' => $comment
1372
+ );
1373
+ } else {
1374
+ return strlen($key) ? false : array(
1375
+ 'modulus' => $modulus,
1376
+ 'publicExponent' => $publicExponent,
1377
+ 'comment' => $comment
1378
+ );
1379
+ }
1380
+ // http://www.w3.org/TR/xmldsig-core/#sec-RSAKeyValue
1381
+ // http://en.wikipedia.org/wiki/XML_Signature
1382
+ case self::PRIVATE_FORMAT_XML:
1383
+ case self::PUBLIC_FORMAT_XML:
1384
+ $this->components = array();
1385
+
1386
+ $xml = xml_parser_create('UTF-8');
1387
+ xml_set_object($xml, $this);
1388
+ xml_set_element_handler($xml, '_start_element_handler', '_stop_element_handler');
1389
+ xml_set_character_data_handler($xml, '_data_handler');
1390
+ // add <xml></xml> to account for "dangling" tags like <BitStrength>...</BitStrength> that are sometimes added
1391
+ if (!xml_parse($xml, '<xml>' . $key . '</xml>')) {
1392
+ xml_parser_free($xml);
1393
+ unset($xml);
1394
+ return false;
1395
+ }
1396
+
1397
+ xml_parser_free($xml);
1398
+ unset($xml);
1399
+
1400
+ return isset($this->components['modulus']) && isset($this->components['publicExponent']) ? $this->components : false;
1401
+ // from PuTTY's SSHPUBK.C
1402
+ case self::PRIVATE_FORMAT_PUTTY:
1403
+ $components = array();
1404
+ $key = preg_split('#\r\n|\r|\n#', $key);
1405
+ $type = trim(preg_replace('#PuTTY-User-Key-File-2: (.+)#', '$1', $key[0]));
1406
+ if ($type != 'ssh-rsa') {
1407
+ return false;
1408
+ }
1409
+ $encryption = trim(preg_replace('#Encryption: (.+)#', '$1', $key[1]));
1410
+ $comment = trim(preg_replace('#Comment: (.+)#', '$1', $key[2]));
1411
+
1412
+ $publicLength = trim(preg_replace('#Public-Lines: (\d+)#', '$1', $key[3]));
1413
+ $public = base64_decode(implode('', array_map('trim', array_slice($key, 4, $publicLength))));
1414
+ $public = substr($public, 11);
1415
+ extract(unpack('Nlength', $this->_string_shift($public, 4)));
1416
+ $components['publicExponent'] = new BigInteger($this->_string_shift($public, $length), -256);
1417
+ extract(unpack('Nlength', $this->_string_shift($public, 4)));
1418
+ $components['modulus'] = new BigInteger($this->_string_shift($public, $length), -256);
1419
+
1420
+ $privateLength = trim(preg_replace('#Private-Lines: (\d+)#', '$1', $key[$publicLength + 4]));
1421
+ $private = base64_decode(implode('', array_map('trim', array_slice($key, $publicLength + 5, $privateLength))));
1422
+
1423
+ switch ($encryption) {
1424
+ case 'aes256-cbc':
1425
+ $symkey = '';
1426
+ $sequence = 0;
1427
+ while (strlen($symkey) < 32) {
1428
+ $temp = pack('Na*', $sequence++, $this->password);
1429
+ $symkey.= pack('H*', sha1($temp));
1430
+ }
1431
+ $symkey = substr($symkey, 0, 32);
1432
+ $crypto = new AES();
1433
+ }
1434
+
1435
+ if ($encryption != 'none') {
1436
+ $crypto->setKey($symkey);
1437
+ $crypto->disablePadding();
1438
+ $private = $crypto->decrypt($private);
1439
+ if ($private === false) {
1440
+ return false;
1441
+ }
1442
+ }
1443
+
1444
+ extract(unpack('Nlength', $this->_string_shift($private, 4)));
1445
+ if (strlen($private) < $length) {
1446
+ return false;
1447
+ }
1448
+ $components['privateExponent'] = new BigInteger($this->_string_shift($private, $length), -256);
1449
+ extract(unpack('Nlength', $this->_string_shift($private, 4)));
1450
+ if (strlen($private) < $length) {
1451
+ return false;
1452
+ }
1453
+ $components['primes'] = array(1 => new BigInteger($this->_string_shift($private, $length), -256));
1454
+ extract(unpack('Nlength', $this->_string_shift($private, 4)));
1455
+ if (strlen($private) < $length) {
1456
+ return false;
1457
+ }
1458
+ $components['primes'][] = new BigInteger($this->_string_shift($private, $length), -256);
1459
+
1460
+ $temp = $components['primes'][1]->subtract($this->one);
1461
+ $components['exponents'] = array(1 => $components['publicExponent']->modInverse($temp));
1462
+ $temp = $components['primes'][2]->subtract($this->one);
1463
+ $components['exponents'][] = $components['publicExponent']->modInverse($temp);
1464
+
1465
+ extract(unpack('Nlength', $this->_string_shift($private, 4)));
1466
+ if (strlen($private) < $length) {
1467
+ return false;
1468
+ }
1469
+ $components['coefficients'] = array(2 => new BigInteger($this->_string_shift($private, $length), -256));
1470
+
1471
+ return $components;
1472
+ case self::PRIVATE_FORMAT_OPENSSH:
1473
+ $components = array();
1474
+ $decoded = $this->_extractBER($key);
1475
+ $magic = $this->_string_shift($decoded, 15);
1476
+ if ($magic !== "openssh-key-v1\0") {
1477
+ return false;
1478
+ }
1479
+ $options = $this->_string_shift($decoded, 24);
1480
+ // \0\0\0\4none = ciphername
1481
+ // \0\0\0\4none = kdfname
1482
+ // \0\0\0\0 = kdfoptions
1483
+ // \0\0\0\1 = numkeys
1484
+ if ($options != "\0\0\0\4none\0\0\0\4none\0\0\0\0\0\0\0\1") {
1485
+ return false;
1486
+ }
1487
+ extract(unpack('Nlength', $this->_string_shift($decoded, 4)));
1488
+ if (strlen($decoded) < $length) {
1489
+ return false;
1490
+ }
1491
+ $publicKey = $this->_string_shift($decoded, $length);
1492
+ extract(unpack('Nlength', $this->_string_shift($decoded, 4)));
1493
+ if (strlen($decoded) < $length) {
1494
+ return false;
1495
+ }
1496
+ $paddedKey = $this->_string_shift($decoded, $length);
1497
+
1498
+ if ($this->_string_shift($publicKey, 11) !== "\0\0\0\7ssh-rsa") {
1499
+ return false;
1500
+ }
1501
+
1502
+ $checkint1 = $this->_string_shift($paddedKey, 4);
1503
+ $checkint2 = $this->_string_shift($paddedKey, 4);
1504
+ if (strlen($checkint1) != 4 || $checkint1 !== $checkint2) {
1505
+ return false;
1506
+ }
1507
+
1508
+ if ($this->_string_shift($paddedKey, 11) !== "\0\0\0\7ssh-rsa") {
1509
+ return false;
1510
+ }
1511
+
1512
+ $values = array(
1513
+ &$components['modulus'],
1514
+ &$components['publicExponent'],
1515
+ &$components['privateExponent'],
1516
+ &$components['coefficients'][2],
1517
+ &$components['primes'][1],
1518
+ &$components['primes'][2]
1519
+ );
1520
+
1521
+ foreach ($values as &$value) {
1522
+ extract(unpack('Nlength', $this->_string_shift($paddedKey, 4)));
1523
+ if (strlen($paddedKey) < $length) {
1524
+ return false;
1525
+ }
1526
+ $value = new BigInteger($this->_string_shift($paddedKey, $length), -256);
1527
+ }
1528
+
1529
+ extract(unpack('Nlength', $this->_string_shift($paddedKey, 4)));
1530
+ if (strlen($paddedKey) < $length) {
1531
+ return false;
1532
+ }
1533
+ $components['comment'] = $this->_string_shift($decoded, $length);
1534
+
1535
+ $temp = $components['primes'][1]->subtract($this->one);
1536
+ $components['exponents'] = array(1 => $components['publicExponent']->modInverse($temp));
1537
+ $temp = $components['primes'][2]->subtract($this->one);
1538
+ $components['exponents'][] = $components['publicExponent']->modInverse($temp);
1539
+
1540
+ return $components;
1541
+ }
1542
+ }
1543
+
1544
+ /**
1545
+ * Returns the key size
1546
+ *
1547
+ * More specifically, this returns the size of the modulo in bits.
1548
+ *
1549
+ * @access public
1550
+ * @return int
1551
+ */
1552
+ function getSize()
1553
+ {
1554
+ return !isset($this->modulus) ? 0 : strlen($this->modulus->toBits());
1555
+ }
1556
+
1557
+ /**
1558
+ * Start Element Handler
1559
+ *
1560
+ * Called by xml_set_element_handler()
1561
+ *
1562
+ * @access private
1563
+ * @param resource $parser
1564
+ * @param string $name
1565
+ * @param array $attribs
1566
+ */
1567
+ function _start_element_handler($parser, $name, $attribs)
1568
+ {
1569
+ //$name = strtoupper($name);
1570
+ switch ($name) {
1571
+ case 'MODULUS':
1572
+ $this->current = &$this->components['modulus'];
1573
+ break;
1574
+ case 'EXPONENT':
1575
+ $this->current = &$this->components['publicExponent'];
1576
+ break;
1577
+ case 'P':
1578
+ $this->current = &$this->components['primes'][1];
1579
+ break;
1580
+ case 'Q':
1581
+ $this->current = &$this->components['primes'][2];
1582
+ break;
1583
+ case 'DP':
1584
+ $this->current = &$this->components['exponents'][1];
1585
+ break;
1586
+ case 'DQ':
1587
+ $this->current = &$this->components['exponents'][2];
1588
+ break;
1589
+ case 'INVERSEQ':
1590
+ $this->current = &$this->components['coefficients'][2];
1591
+ break;
1592
+ case 'D':
1593
+ $this->current = &$this->components['privateExponent'];
1594
+ }
1595
+ $this->current = '';
1596
+ }
1597
+
1598
+ /**
1599
+ * Stop Element Handler
1600
+ *
1601
+ * Called by xml_set_element_handler()
1602
+ *
1603
+ * @access private
1604
+ * @param resource $parser
1605
+ * @param string $name
1606
+ */
1607
+ function _stop_element_handler($parser, $name)
1608
+ {
1609
+ if (isset($this->current)) {
1610
+ $this->current = new BigInteger(base64_decode($this->current), 256);
1611
+ unset($this->current);
1612
+ }
1613
+ }
1614
+
1615
+ /**
1616
+ * Data Handler
1617
+ *
1618
+ * Called by xml_set_character_data_handler()
1619
+ *
1620
+ * @access private
1621
+ * @param resource $parser
1622
+ * @param string $data
1623
+ */
1624
+ function _data_handler($parser, $data)
1625
+ {
1626
+ if (!isset($this->current) || is_object($this->current)) {
1627
+ return;
1628
+ }
1629
+ $this->current.= trim($data);
1630
+ }
1631
+
1632
+ /**
1633
+ * Loads a public or private key
1634
+ *
1635
+ * Returns true on success and false on failure (ie. an incorrect password was provided or the key was malformed)
1636
+ *
1637
+ * @access public
1638
+ * @param string|RSA|array $key
1639
+ * @param bool|int $type optional
1640
+ * @return bool
1641
+ */
1642
+ function loadKey($key, $type = false)
1643
+ {
1644
+ if ($key instanceof RSA) {
1645
+ $this->privateKeyFormat = $key->privateKeyFormat;
1646
+ $this->publicKeyFormat = $key->publicKeyFormat;
1647
+ $this->k = $key->k;
1648
+ $this->hLen = $key->hLen;
1649
+ $this->sLen = $key->sLen;
1650
+ $this->mgfHLen = $key->mgfHLen;
1651
+ $this->encryptionMode = $key->encryptionMode;
1652
+ $this->signatureMode = $key->signatureMode;
1653
+ $this->password = $key->password;
1654
+ $this->configFile = $key->configFile;
1655
+ $this->comment = $key->comment;
1656
+
1657
+ if (is_object($key->hash)) {
1658
+ $this->hash = new Hash($key->hash->getHash());
1659
+ }
1660
+ if (is_object($key->mgfHash)) {
1661
+ $this->mgfHash = new Hash($key->mgfHash->getHash());
1662
+ }
1663
+
1664
+ if (is_object($key->modulus)) {
1665
+ $this->modulus = $key->modulus->copy();
1666
+ }
1667
+ if (is_object($key->exponent)) {
1668
+ $this->exponent = $key->exponent->copy();
1669
+ }
1670
+ if (is_object($key->publicExponent)) {
1671
+ $this->publicExponent = $key->publicExponent->copy();
1672
+ }
1673
+
1674
+ $this->primes = array();
1675
+ $this->exponents = array();
1676
+ $this->coefficients = array();
1677
+
1678
+ foreach ($this->primes as $prime) {
1679
+ $this->primes[] = $prime->copy();
1680
+ }
1681
+ foreach ($this->exponents as $exponent) {
1682
+ $this->exponents[] = $exponent->copy();
1683
+ }
1684
+ foreach ($this->coefficients as $coefficient) {
1685
+ $this->coefficients[] = $coefficient->copy();
1686
+ }
1687
+
1688
+ return true;
1689
+ }
1690
+
1691
+ if ($type === false) {
1692
+ $types = array(
1693
+ self::PUBLIC_FORMAT_RAW,
1694
+ self::PRIVATE_FORMAT_PKCS1,
1695
+ self::PRIVATE_FORMAT_XML,
1696
+ self::PRIVATE_FORMAT_PUTTY,
1697
+ self::PUBLIC_FORMAT_OPENSSH,
1698
+ self::PRIVATE_FORMAT_OPENSSH
1699
+ );
1700
+ foreach ($types as $type) {
1701
+ $components = $this->_parseKey($key, $type);
1702
+ if ($components !== false) {
1703
+ break;
1704
+ }
1705
+ }
1706
+ } else {
1707
+ $components = $this->_parseKey($key, $type);
1708
+ }
1709
+
1710
+ if ($components === false) {
1711
+ $this->comment = null;
1712
+ $this->modulus = null;
1713
+ $this->k = null;
1714
+ $this->exponent = null;
1715
+ $this->primes = null;
1716
+ $this->exponents = null;
1717
+ $this->coefficients = null;
1718
+ $this->publicExponent = null;
1719
+
1720
+ return false;
1721
+ }
1722
+
1723
+ if (isset($components['comment']) && $components['comment'] !== false) {
1724
+ $this->comment = $components['comment'];
1725
+ }
1726
+ $this->modulus = $components['modulus'];
1727
+ $this->k = strlen($this->modulus->toBytes());
1728
+ $this->exponent = isset($components['privateExponent']) ? $components['privateExponent'] : $components['publicExponent'];
1729
+ if (isset($components['primes'])) {
1730
+ $this->primes = $components['primes'];
1731
+ $this->exponents = $components['exponents'];
1732
+ $this->coefficients = $components['coefficients'];
1733
+ $this->publicExponent = $components['publicExponent'];
1734
+ } else {
1735
+ $this->primes = array();
1736
+ $this->exponents = array();
1737
+ $this->coefficients = array();
1738
+ $this->publicExponent = false;
1739
+ }
1740
+
1741
+ switch ($type) {
1742
+ case self::PUBLIC_FORMAT_OPENSSH:
1743
+ case self::PUBLIC_FORMAT_RAW:
1744
+ $this->setPublicKey();
1745
+ break;
1746
+ case self::PRIVATE_FORMAT_PKCS1:
1747
+ switch (true) {
1748
+ case strpos($key, '-BEGIN PUBLIC KEY-') !== false:
1749
+ case strpos($key, '-BEGIN RSA PUBLIC KEY-') !== false:
1750
+ $this->setPublicKey();
1751
+ }
1752
+ }
1753
+
1754
+ return true;
1755
+ }
1756
+
1757
+ /**
1758
+ * Sets the password
1759
+ *
1760
+ * Private keys can be encrypted with a password. To unset the password, pass in the empty string or false.
1761
+ * Or rather, pass in $password such that empty($password) && !is_string($password) is true.
1762
+ *
1763
+ * @see self::createKey()
1764
+ * @see self::loadKey()
1765
+ * @access public
1766
+ * @param string $password
1767
+ */
1768
+ function setPassword($password = false)
1769
+ {
1770
+ $this->password = $password;
1771
+ }
1772
+
1773
+ /**
1774
+ * Defines the public key
1775
+ *
1776
+ * Some private key formats define the public exponent and some don't. Those that don't define it are problematic when
1777
+ * used in certain contexts. For example, in SSH-2, RSA authentication works by sending the public key along with a
1778
+ * message signed by the private key to the server. The SSH-2 server looks the public key up in an index of public keys
1779
+ * and if it's present then proceeds to verify the signature. Problem is, if your private key doesn't include the public
1780
+ * exponent this won't work unless you manually add the public exponent. phpseclib tries to guess if the key being used
1781
+ * is the public key but in the event that it guesses incorrectly you might still want to explicitly set the key as being
1782
+ * public.
1783
+ *
1784
+ * Do note that when a new key is loaded the index will be cleared.
1785
+ *
1786
+ * Returns true on success, false on failure
1787
+ *
1788
+ * @see self::getPublicKey()
1789
+ * @access public
1790
+ * @param string $key optional
1791
+ * @param int $type optional
1792
+ * @return bool
1793
+ */
1794
+ function setPublicKey($key = false, $type = false)
1795
+ {
1796
+ // if a public key has already been loaded return false
1797
+ if (!empty($this->publicExponent)) {
1798
+ return false;
1799
+ }
1800
+
1801
+ if ($key === false && !empty($this->modulus)) {
1802
+ $this->publicExponent = $this->exponent;
1803
+ return true;
1804
+ }
1805
+
1806
+ if ($type === false) {
1807
+ $types = array(
1808
+ self::PUBLIC_FORMAT_RAW,
1809
+ self::PUBLIC_FORMAT_PKCS1,
1810
+ self::PUBLIC_FORMAT_XML,
1811
+ self::PUBLIC_FORMAT_OPENSSH
1812
+ );
1813
+ foreach ($types as $type) {
1814
+ $components = $this->_parseKey($key, $type);
1815
+ if ($components !== false) {
1816
+ break;
1817
+ }
1818
+ }
1819
+ } else {
1820
+ $components = $this->_parseKey($key, $type);
1821
+ }
1822
+
1823
+ if ($components === false) {
1824
+ return false;
1825
+ }
1826
+
1827
+ if (empty($this->modulus) || !$this->modulus->equals($components['modulus'])) {
1828
+ $this->modulus = $components['modulus'];
1829
+ $this->exponent = $this->publicExponent = $components['publicExponent'];
1830
+ return true;
1831
+ }
1832
+
1833
+ $this->publicExponent = $components['publicExponent'];
1834
+
1835
+ return true;
1836
+ }
1837
+
1838
+ /**
1839
+ * Defines the private key
1840
+ *
1841
+ * If phpseclib guessed a private key was a public key and loaded it as such it might be desirable to force
1842
+ * phpseclib to treat the key as a private key. This function will do that.
1843
+ *
1844
+ * Do note that when a new key is loaded the index will be cleared.
1845
+ *
1846
+ * Returns true on success, false on failure
1847
+ *
1848
+ * @see self::getPublicKey()
1849
+ * @access public
1850
+ * @param string $key optional
1851
+ * @param int $type optional
1852
+ * @return bool
1853
+ */
1854
+ function setPrivateKey($key = false, $type = false)
1855
+ {
1856
+ if ($key === false && !empty($this->publicExponent)) {
1857
+ $this->publicExponent = false;
1858
+ return true;
1859
+ }
1860
+
1861
+ $rsa = new RSA();
1862
+ if (!$rsa->loadKey($key, $type)) {
1863
+ return false;
1864
+ }
1865
+ $rsa->publicExponent = false;
1866
+
1867
+ // don't overwrite the old key if the new key is invalid
1868
+ $this->loadKey($rsa);
1869
+ return true;
1870
+ }
1871
+
1872
+ /**
1873
+ * Returns the public key
1874
+ *
1875
+ * The public key is only returned under two circumstances - if the private key had the public key embedded within it
1876
+ * or if the public key was set via setPublicKey(). If the currently loaded key is supposed to be the public key this
1877
+ * function won't return it since this library, for the most part, doesn't distinguish between public and private keys.
1878
+ *
1879
+ * @see self::getPublicKey()
1880
+ * @access public
1881
+ * @param string $key
1882
+ * @param int $type optional
1883
+ */
1884
+ function getPublicKey($type = self::PUBLIC_FORMAT_PKCS8)
1885
+ {
1886
+ if (empty($this->modulus) || empty($this->publicExponent)) {
1887
+ return false;
1888
+ }
1889
+
1890
+ $oldFormat = $this->publicKeyFormat;
1891
+ $this->publicKeyFormat = $type;
1892
+ $temp = $this->_convertPublicKey($this->modulus, $this->publicExponent);
1893
+ $this->publicKeyFormat = $oldFormat;
1894
+ return $temp;
1895
+ }
1896
+
1897
+ /**
1898
+ * Returns the public key's fingerprint
1899
+ *
1900
+ * The public key's fingerprint is returned, which is equivalent to running `ssh-keygen -lf rsa.pub`. If there is
1901
+ * no public key currently loaded, false is returned.
1902
+ * Example output (md5): "c1:b1:30:29:d7:b8:de:6c:97:77:10:d7:46:41:63:87" (as specified by RFC 4716)
1903
+ *
1904
+ * @access public
1905
+ * @param string $algorithm The hashing algorithm to be used. Valid options are 'md5' and 'sha256'. False is returned
1906
+ * for invalid values.
1907
+ * @return mixed
1908
+ */
1909
+ function getPublicKeyFingerprint($algorithm = 'md5')
1910
+ {
1911
+ if (empty($this->modulus) || empty($this->publicExponent)) {
1912
+ return false;
1913
+ }
1914
+
1915
+ $modulus = $this->modulus->toBytes(true);
1916
+ $publicExponent = $this->publicExponent->toBytes(true);
1917
+
1918
+ $RSAPublicKey = pack('Na*Na*Na*', strlen('ssh-rsa'), 'ssh-rsa', strlen($publicExponent), $publicExponent, strlen($modulus), $modulus);
1919
+
1920
+ switch ($algorithm) {
1921
+ case 'sha256':
1922
+ $hash = new Hash('sha256');
1923
+ $base = base64_encode($hash->hash($RSAPublicKey));
1924
+ return substr($base, 0, strlen($base) - 1);
1925
+ case 'md5':
1926
+ return substr(chunk_split(md5($RSAPublicKey), 2, ':'), 0, -1);
1927
+ default:
1928
+ return false;
1929
+ }
1930
+ }
1931
+
1932
+ /**
1933
+ * Returns the private key
1934
+ *
1935
+ * The private key is only returned if the currently loaded key contains the constituent prime numbers.
1936
+ *
1937
+ * @see self::getPublicKey()
1938
+ * @access public
1939
+ * @param string $key
1940
+ * @param int $type optional
1941
+ * @return mixed
1942
+ */
1943
+ function getPrivateKey($type = self::PUBLIC_FORMAT_PKCS1)
1944
+ {
1945
+ if (empty($this->primes)) {
1946
+ return false;
1947
+ }
1948
+
1949
+ $oldFormat = $this->privateKeyFormat;
1950
+ $this->privateKeyFormat = $type;
1951
+ $temp = $this->_convertPrivateKey($this->modulus, $this->publicExponent, $this->exponent, $this->primes, $this->exponents, $this->coefficients);
1952
+ $this->privateKeyFormat = $oldFormat;
1953
+ return $temp;
1954
+ }
1955
+
1956
+ /**
1957
+ * Returns a minimalistic private key
1958
+ *
1959
+ * Returns the private key without the prime number constituants. Structurally identical to a public key that
1960
+ * hasn't been set as the public key
1961
+ *
1962
+ * @see self::getPrivateKey()
1963
+ * @access private
1964
+ * @param string $key
1965
+ * @param int $type optional
1966
+ */
1967
+ function _getPrivatePublicKey($mode = self::PUBLIC_FORMAT_PKCS8)
1968
+ {
1969
+ if (empty($this->modulus) || empty($this->exponent)) {
1970
+ return false;
1971
+ }
1972
+
1973
+ $oldFormat = $this->publicKeyFormat;
1974
+ $this->publicKeyFormat = $mode;
1975
+ $temp = $this->_convertPublicKey($this->modulus, $this->exponent);
1976
+ $this->publicKeyFormat = $oldFormat;
1977
+ return $temp;
1978
+ }
1979
+
1980
+ /**
1981
+ * __toString() magic method
1982
+ *
1983
+ * @access public
1984
+ * @return string
1985
+ */
1986
+ function __toString()
1987
+ {
1988
+ $key = $this->getPrivateKey($this->privateKeyFormat);
1989
+ if ($key !== false) {
1990
+ return $key;
1991
+ }
1992
+ $key = $this->_getPrivatePublicKey($this->publicKeyFormat);
1993
+ return $key !== false ? $key : '';
1994
+ }
1995
+
1996
+ /**
1997
+ * __clone() magic method
1998
+ *
1999
+ * @access public
2000
+ * @return Crypt_RSA
2001
+ */
2002
+ function __clone()
2003
+ {
2004
+ $key = new RSA();
2005
+ $key->loadKey($this);
2006
+ return $key;
2007
+ }
2008
+
2009
+ /**
2010
+ * Generates the smallest and largest numbers requiring $bits bits
2011
+ *
2012
+ * @access private
2013
+ * @param int $bits
2014
+ * @return array
2015
+ */
2016
+ function _generateMinMax($bits)
2017
+ {
2018
+ $bytes = $bits >> 3;
2019
+ $min = str_repeat(chr(0), $bytes);
2020
+ $max = str_repeat(chr(0xFF), $bytes);
2021
+ $msb = $bits & 7;
2022
+ if ($msb) {
2023
+ $min = chr(1 << ($msb - 1)) . $min;
2024
+ $max = chr((1 << $msb) - 1) . $max;
2025
+ } else {
2026
+ $min[0] = chr(0x80);
2027
+ }
2028
+
2029
+ return array(
2030
+ 'min' => new BigInteger($min, 256),
2031
+ 'max' => new BigInteger($max, 256)
2032
+ );
2033
+ }
2034
+
2035
+ /**
2036
+ * DER-decode the length
2037
+ *
2038
+ * DER supports lengths up to (2**8)**127, however, we'll only support lengths up to (2**8)**4. See
2039
+ * {@link http://itu.int/ITU-T/studygroups/com17/languages/X.690-0207.pdf#p=13 X.690 paragraph 8.1.3} for more information.
2040
+ *
2041
+ * @access private
2042
+ * @param string $string
2043
+ * @return int
2044
+ */
2045
+ function _decodeLength(&$string)
2046
+ {
2047
+ $length = ord($this->_string_shift($string));
2048
+ if ($length & 0x80) { // definite length, long form
2049
+ $length&= 0x7F;
2050
+ $temp = $this->_string_shift($string, $length);
2051
+ list(, $length) = unpack('N', substr(str_pad($temp, 4, chr(0), STR_PAD_LEFT), -4));
2052
+ }
2053
+ return $length;
2054
+ }
2055
+
2056
+ /**
2057
+ * DER-encode the length
2058
+ *
2059
+ * DER supports lengths up to (2**8)**127, however, we'll only support lengths up to (2**8)**4. See
2060
+ * {@link http://itu.int/ITU-T/studygroups/com17/languages/X.690-0207.pdf#p=13 X.690 paragraph 8.1.3} for more information.
2061
+ *
2062
+ * @access private
2063
+ * @param int $length
2064
+ * @return string
2065
+ */
2066
+ function _encodeLength($length)
2067
+ {
2068
+ if ($length <= 0x7F) {
2069
+ return chr($length);
2070
+ }
2071
+
2072
+ $temp = ltrim(pack('N', $length), chr(0));
2073
+ return pack('Ca*', 0x80 | strlen($temp), $temp);
2074
+ }
2075
+
2076
+ /**
2077
+ * String Shift
2078
+ *
2079
+ * Inspired by array_shift
2080
+ *
2081
+ * @param string $string
2082
+ * @param int $index
2083
+ * @return string
2084
+ * @access private
2085
+ */
2086
+ function _string_shift(&$string, $index = 1)
2087
+ {
2088
+ $substr = substr($string, 0, $index);
2089
+ $string = substr($string, $index);
2090
+ return $substr;
2091
+ }
2092
+
2093
+ /**
2094
+ * Determines the private key format
2095
+ *
2096
+ * @see self::createKey()
2097
+ * @access public
2098
+ * @param int $format
2099
+ */
2100
+ function setPrivateKeyFormat($format)
2101
+ {
2102
+ $this->privateKeyFormat = $format;
2103
+ }
2104
+
2105
+ /**
2106
+ * Determines the public key format
2107
+ *
2108
+ * @see self::createKey()
2109
+ * @access public
2110
+ * @param int $format
2111
+ */
2112
+ function setPublicKeyFormat($format)
2113
+ {
2114
+ $this->publicKeyFormat = $format;
2115
+ }
2116
+
2117
+ /**
2118
+ * Determines which hashing function should be used
2119
+ *
2120
+ * Used with signature production / verification and (if the encryption mode is self::ENCRYPTION_OAEP) encryption and
2121
+ * decryption. If $hash isn't supported, sha1 is used.
2122
+ *
2123
+ * @access public
2124
+ * @param string $hash
2125
+ */
2126
+ function setHash($hash)
2127
+ {
2128
+ // \phpseclib\Crypt\Hash supports algorithms that PKCS#1 doesn't support. md5-96 and sha1-96, for example.
2129
+ switch ($hash) {
2130
+ case 'md2':
2131
+ case 'md5':
2132
+ case 'sha1':
2133
+ case 'sha256':
2134
+ case 'sha384':
2135
+ case 'sha512':
2136
+ $this->hash = new Hash($hash);
2137
+ $this->hashName = $hash;
2138
+ break;
2139
+ default:
2140
+ $this->hash = new Hash('sha1');
2141
+ $this->hashName = 'sha1';
2142
+ }
2143
+ $this->hLen = $this->hash->getLength();
2144
+ }
2145
+
2146
+ /**
2147
+ * Determines which hashing function should be used for the mask generation function
2148
+ *
2149
+ * The mask generation function is used by self::ENCRYPTION_OAEP and self::SIGNATURE_PSS and although it's
2150
+ * best if Hash and MGFHash are set to the same thing this is not a requirement.
2151
+ *
2152
+ * @access public
2153
+ * @param string $hash
2154
+ */
2155
+ function setMGFHash($hash)
2156
+ {
2157
+ // \phpseclib\Crypt\Hash supports algorithms that PKCS#1 doesn't support. md5-96 and sha1-96, for example.
2158
+ switch ($hash) {
2159
+ case 'md2':
2160
+ case 'md5':
2161
+ case 'sha1':
2162
+ case 'sha256':
2163
+ case 'sha384':
2164
+ case 'sha512':
2165
+ $this->mgfHash = new Hash($hash);
2166
+ break;
2167
+ default:
2168
+ $this->mgfHash = new Hash('sha1');
2169
+ }
2170
+ $this->mgfHLen = $this->mgfHash->getLength();
2171
+ }
2172
+
2173
+ /**
2174
+ * Determines the salt length
2175
+ *
2176
+ * To quote from {@link http://tools.ietf.org/html/rfc3447#page-38 RFC3447#page-38}:
2177
+ *
2178
+ * Typical salt lengths in octets are hLen (the length of the output
2179
+ * of the hash function Hash) and 0.
2180
+ *
2181
+ * @access public
2182
+ * @param int $format
2183
+ */
2184
+ function setSaltLength($sLen)
2185
+ {
2186
+ $this->sLen = $sLen;
2187
+ }
2188
+
2189
+ /**
2190
+ * Integer-to-Octet-String primitive
2191
+ *
2192
+ * See {@link http://tools.ietf.org/html/rfc3447#section-4.1 RFC3447#section-4.1}.
2193
+ *
2194
+ * @access private
2195
+ * @param \phpseclib\Math\BigInteger $x
2196
+ * @param int $xLen
2197
+ * @return string
2198
+ */
2199
+ function _i2osp($x, $xLen)
2200
+ {
2201
+ $x = $x->toBytes();
2202
+ if (strlen($x) > $xLen) {
2203
+ user_error('Integer too large');
2204
+ return false;
2205
+ }
2206
+ return str_pad($x, $xLen, chr(0), STR_PAD_LEFT);
2207
+ }
2208
+
2209
+ /**
2210
+ * Octet-String-to-Integer primitive
2211
+ *
2212
+ * See {@link http://tools.ietf.org/html/rfc3447#section-4.2 RFC3447#section-4.2}.
2213
+ *
2214
+ * @access private
2215
+ * @param string $x
2216
+ * @return \phpseclib\Math\BigInteger
2217
+ */
2218
+ function _os2ip($x)
2219
+ {
2220
+ return new BigInteger($x, 256);
2221
+ }
2222
+
2223
+ /**
2224
+ * Exponentiate with or without Chinese Remainder Theorem
2225
+ *
2226
+ * See {@link http://tools.ietf.org/html/rfc3447#section-5.1.1 RFC3447#section-5.1.2}.
2227
+ *
2228
+ * @access private
2229
+ * @param \phpseclib\Math\BigInteger $x
2230
+ * @return \phpseclib\Math\BigInteger
2231
+ */
2232
+ function _exponentiate($x)
2233
+ {
2234
+ switch (true) {
2235
+ case empty($this->primes):
2236
+ case $this->primes[1]->equals($this->zero):
2237
+ case empty($this->coefficients):
2238
+ case $this->coefficients[2]->equals($this->zero):
2239
+ case empty($this->exponents):
2240
+ case $this->exponents[1]->equals($this->zero):
2241
+ return $x->modPow($this->exponent, $this->modulus);
2242
+ }
2243
+
2244
+ $num_primes = count($this->primes);
2245
+
2246
+ if (defined('CRYPT_RSA_DISABLE_BLINDING')) {
2247
+ $m_i = array(
2248
+ 1 => $x->modPow($this->exponents[1], $this->primes[1]),
2249
+ 2 => $x->modPow($this->exponents[2], $this->primes[2])
2250
+ );
2251
+ $h = $m_i[1]->subtract($m_i[2]);
2252
+ $h = $h->multiply($this->coefficients[2]);
2253
+ list(, $h) = $h->divide($this->primes[1]);
2254
+ $m = $m_i[2]->add($h->multiply($this->primes[2]));
2255
+
2256
+ $r = $this->primes[1];
2257
+ for ($i = 3; $i <= $num_primes; $i++) {
2258
+ $m_i = $x->modPow($this->exponents[$i], $this->primes[$i]);
2259
+
2260
+ $r = $r->multiply($this->primes[$i - 1]);
2261
+
2262
+ $h = $m_i->subtract($m);
2263
+ $h = $h->multiply($this->coefficients[$i]);
2264
+ list(, $h) = $h->divide($this->primes[$i]);
2265
+
2266
+ $m = $m->add($r->multiply($h));
2267
+ }
2268
+ } else {
2269
+ $smallest = $this->primes[1];
2270
+ for ($i = 2; $i <= $num_primes; $i++) {
2271
+ if ($smallest->compare($this->primes[$i]) > 0) {
2272
+ $smallest = $this->primes[$i];
2273
+ }
2274
+ }
2275
+
2276
+ $one = new BigInteger(1);
2277
+
2278
+ $r = $one->random($one, $smallest->subtract($one));
2279
+
2280
+ $m_i = array(
2281
+ 1 => $this->_blind($x, $r, 1),
2282
+ 2 => $this->_blind($x, $r, 2)
2283
+ );
2284
+ $h = $m_i[1]->subtract($m_i[2]);
2285
+ $h = $h->multiply($this->coefficients[2]);
2286
+ list(, $h) = $h->divide($this->primes[1]);
2287
+ $m = $m_i[2]->add($h->multiply($this->primes[2]));
2288
+
2289
+ $r = $this->primes[1];
2290
+ for ($i = 3; $i <= $num_primes; $i++) {
2291
+ $m_i = $this->_blind($x, $r, $i);
2292
+
2293
+ $r = $r->multiply($this->primes[$i - 1]);
2294
+
2295
+ $h = $m_i->subtract($m);
2296
+ $h = $h->multiply($this->coefficients[$i]);
2297
+ list(, $h) = $h->divide($this->primes[$i]);
2298
+
2299
+ $m = $m->add($r->multiply($h));
2300
+ }
2301
+ }
2302
+
2303
+ return $m;
2304
+ }
2305
+
2306
+ /**
2307
+ * Performs RSA Blinding
2308
+ *
2309
+ * Protects against timing attacks by employing RSA Blinding.
2310
+ * Returns $x->modPow($this->exponents[$i], $this->primes[$i])
2311
+ *
2312
+ * @access private
2313
+ * @param \phpseclib\Math\BigInteger $x
2314
+ * @param \phpseclib\Math\BigInteger $r
2315
+ * @param int $i
2316
+ * @return \phpseclib\Math\BigInteger
2317
+ */
2318
+ function _blind($x, $r, $i)
2319
+ {
2320
+ $x = $x->multiply($r->modPow($this->publicExponent, $this->primes[$i]));
2321
+ $x = $x->modPow($this->exponents[$i], $this->primes[$i]);
2322
+
2323
+ $r = $r->modInverse($this->primes[$i]);
2324
+ $x = $x->multiply($r);
2325
+ list(, $x) = $x->divide($this->primes[$i]);
2326
+
2327
+ return $x;
2328
+ }
2329
+
2330
+ /**
2331
+ * Performs blinded RSA equality testing
2332
+ *
2333
+ * Protects against a particular type of timing attack described.
2334
+ *
2335
+ * See {@link http://codahale.com/a-lesson-in-timing-attacks/ A Lesson In Timing Attacks (or, Don't use MessageDigest.isEquals)}
2336
+ *
2337
+ * Thanks for the heads up singpolyma!
2338
+ *
2339
+ * @access private
2340
+ * @param string $x
2341
+ * @param string $y
2342
+ * @return bool
2343
+ */
2344
+ function _equals($x, $y)
2345
+ {
2346
+ if (function_exists('hash_equals')) {
2347
+ return hash_equals($x, $y);
2348
+ }
2349
+
2350
+ if (strlen($x) != strlen($y)) {
2351
+ return false;
2352
+ }
2353
+
2354
+ $result = "\0";
2355
+ $x^= $y;
2356
+ for ($i = 0; $i < strlen($x); $i++) {
2357
+ $result|= $x[$i];
2358
+ }
2359
+
2360
+ return $result === "\0";
2361
+ }
2362
+
2363
+ /**
2364
+ * RSAEP
2365
+ *
2366
+ * See {@link http://tools.ietf.org/html/rfc3447#section-5.1.1 RFC3447#section-5.1.1}.
2367
+ *
2368
+ * @access private
2369
+ * @param \phpseclib\Math\BigInteger $m
2370
+ * @return \phpseclib\Math\BigInteger
2371
+ */
2372
+ function _rsaep($m)
2373
+ {
2374
+ if ($m->compare($this->zero) < 0 || $m->compare($this->modulus) > 0) {
2375
+ user_error('Message representative out of range');
2376
+ return false;
2377
+ }
2378
+ return $this->_exponentiate($m);
2379
+ }
2380
+
2381
+ /**
2382
+ * RSADP
2383
+ *
2384
+ * See {@link http://tools.ietf.org/html/rfc3447#section-5.1.2 RFC3447#section-5.1.2}.
2385
+ *
2386
+ * @access private
2387
+ * @param \phpseclib\Math\BigInteger $c
2388
+ * @return \phpseclib\Math\BigInteger
2389
+ */
2390
+ function _rsadp($c)
2391
+ {
2392
+ if ($c->compare($this->zero) < 0 || $c->compare($this->modulus) > 0) {
2393
+ user_error('Ciphertext representative out of range');
2394
+ return false;
2395
+ }
2396
+ return $this->_exponentiate($c);
2397
+ }
2398
+
2399
+ /**
2400
+ * RSASP1
2401
+ *
2402
+ * See {@link http://tools.ietf.org/html/rfc3447#section-5.2.1 RFC3447#section-5.2.1}.
2403
+ *
2404
+ * @access private
2405
+ * @param \phpseclib\Math\BigInteger $m
2406
+ * @return \phpseclib\Math\BigInteger
2407
+ */
2408
+ function _rsasp1($m)
2409
+ {
2410
+ if ($m->compare($this->zero) < 0 || $m->compare($this->modulus) > 0) {
2411
+ user_error('Message representative out of range');
2412
+ return false;
2413
+ }
2414
+ return $this->_exponentiate($m);
2415
+ }
2416
+
2417
+ /**
2418
+ * RSAVP1
2419
+ *
2420
+ * See {@link http://tools.ietf.org/html/rfc3447#section-5.2.2 RFC3447#section-5.2.2}.
2421
+ *
2422
+ * @access private
2423
+ * @param \phpseclib\Math\BigInteger $s
2424
+ * @return \phpseclib\Math\BigInteger
2425
+ */
2426
+ function _rsavp1($s)
2427
+ {
2428
+ if ($s->compare($this->zero) < 0 || $s->compare($this->modulus) > 0) {
2429
+ user_error('Signature representative out of range');
2430
+ return false;
2431
+ }
2432
+ return $this->_exponentiate($s);
2433
+ }
2434
+
2435
+ /**
2436
+ * MGF1
2437
+ *
2438
+ * See {@link http://tools.ietf.org/html/rfc3447#appendix-B.2.1 RFC3447#appendix-B.2.1}.
2439
+ *
2440
+ * @access private
2441
+ * @param string $mgfSeed
2442
+ * @param int $mgfLen
2443
+ * @return string
2444
+ */
2445
+ function _mgf1($mgfSeed, $maskLen)
2446
+ {
2447
+ // if $maskLen would yield strings larger than 4GB, PKCS#1 suggests a "Mask too long" error be output.
2448
+
2449
+ $t = '';
2450
+ $count = ceil($maskLen / $this->mgfHLen);
2451
+ for ($i = 0; $i < $count; $i++) {
2452
+ $c = pack('N', $i);
2453
+ $t.= $this->mgfHash->hash($mgfSeed . $c);
2454
+ }
2455
+
2456
+ return substr($t, 0, $maskLen);
2457
+ }
2458
+
2459
+ /**
2460
+ * RSAES-OAEP-ENCRYPT
2461
+ *
2462
+ * See {@link http://tools.ietf.org/html/rfc3447#section-7.1.1 RFC3447#section-7.1.1} and
2463
+ * {http://en.wikipedia.org/wiki/Optimal_Asymmetric_Encryption_Padding OAES}.
2464
+ *
2465
+ * @access private
2466
+ * @param string $m
2467
+ * @param string $l
2468
+ * @return string
2469
+ */
2470
+ function _rsaes_oaep_encrypt($m, $l = '')
2471
+ {
2472
+ $mLen = strlen($m);
2473
+
2474
+ // Length checking
2475
+
2476
+ // if $l is larger than two million terrabytes and you're using sha1, PKCS#1 suggests a "Label too long" error
2477
+ // be output.
2478
+
2479
+ if ($mLen > $this->k - 2 * $this->hLen - 2) {
2480
+ user_error('Message too long');
2481
+ return false;
2482
+ }
2483
+
2484
+ // EME-OAEP encoding
2485
+
2486
+ $lHash = $this->hash->hash($l);
2487
+ $ps = str_repeat(chr(0), $this->k - $mLen - 2 * $this->hLen - 2);
2488
+ $db = $lHash . $ps . chr(1) . $m;
2489
+ $seed = Random::string($this->hLen);
2490
+ $dbMask = $this->_mgf1($seed, $this->k - $this->hLen - 1);
2491
+ $maskedDB = $db ^ $dbMask;
2492
+ $seedMask = $this->_mgf1($maskedDB, $this->hLen);
2493
+ $maskedSeed = $seed ^ $seedMask;
2494
+ $em = chr(0) . $maskedSeed . $maskedDB;
2495
+
2496
+ // RSA encryption
2497
+
2498
+ $m = $this->_os2ip($em);
2499
+ $c = $this->_rsaep($m);
2500
+ $c = $this->_i2osp($c, $this->k);
2501
+
2502
+ // Output the ciphertext C
2503
+
2504
+ return $c;
2505
+ }
2506
+
2507
+ /**
2508
+ * RSAES-OAEP-DECRYPT
2509
+ *
2510
+ * See {@link http://tools.ietf.org/html/rfc3447#section-7.1.2 RFC3447#section-7.1.2}. The fact that the error
2511
+ * messages aren't distinguishable from one another hinders debugging, but, to quote from RFC3447#section-7.1.2:
2512
+ *
2513
+ * Note. Care must be taken to ensure that an opponent cannot
2514
+ * distinguish the different error conditions in Step 3.g, whether by
2515
+ * error message or timing, or, more generally, learn partial
2516
+ * information about the encoded message EM. Otherwise an opponent may
2517
+ * be able to obtain useful information about the decryption of the
2518
+ * ciphertext C, leading to a chosen-ciphertext attack such as the one
2519
+ * observed by Manger [36].
2520
+ *
2521
+ * As for $l... to quote from {@link http://tools.ietf.org/html/rfc3447#page-17 RFC3447#page-17}:
2522
+ *
2523
+ * Both the encryption and the decryption operations of RSAES-OAEP take
2524
+ * the value of a label L as input. In this version of PKCS #1, L is
2525
+ * the empty string; other uses of the label are outside the scope of
2526
+ * this document.
2527
+ *
2528
+ * @access private
2529
+ * @param string $c
2530
+ * @param string $l
2531
+ * @return string
2532
+ */
2533
+ function _rsaes_oaep_decrypt($c, $l = '')
2534
+ {
2535
+ // Length checking
2536
+
2537
+ // if $l is larger than two million terrabytes and you're using sha1, PKCS#1 suggests a "Label too long" error
2538
+ // be output.
2539
+
2540
+ if (strlen($c) != $this->k || $this->k < 2 * $this->hLen + 2) {
2541
+ user_error('Decryption error');
2542
+ return false;
2543
+ }
2544
+
2545
+ // RSA decryption
2546
+
2547
+ $c = $this->_os2ip($c);
2548
+ $m = $this->_rsadp($c);
2549
+ if ($m === false) {
2550
+ user_error('Decryption error');
2551
+ return false;
2552
+ }
2553
+ $em = $this->_i2osp($m, $this->k);
2554
+
2555
+ // EME-OAEP decoding
2556
+
2557
+ $lHash = $this->hash->hash($l);
2558
+ $y = ord($em[0]);
2559
+ $maskedSeed = substr($em, 1, $this->hLen);
2560
+ $maskedDB = substr($em, $this->hLen + 1);
2561
+ $seedMask = $this->_mgf1($maskedDB, $this->hLen);
2562
+ $seed = $maskedSeed ^ $seedMask;
2563
+ $dbMask = $this->_mgf1($seed, $this->k - $this->hLen - 1);
2564
+ $db = $maskedDB ^ $dbMask;
2565
+ $lHash2 = substr($db, 0, $this->hLen);
2566
+ $m = substr($db, $this->hLen);
2567
+ $hashesMatch = $this->_equals($lHash, $lHash2);
2568
+ $leadingZeros = 1;
2569
+ $patternMatch = 0;
2570
+ $offset = 0;
2571
+ for ($i = 0; $i < strlen($m); $i++) {
2572
+ $patternMatch|= $leadingZeros & ($m[$i] === "\1");
2573
+ $leadingZeros&= $m[$i] === "\0";
2574
+ $offset+= $patternMatch ? 0 : 1;
2575
+ }
2576
+
2577
+ // we do & instead of && to avoid https://en.wikipedia.org/wiki/Short-circuit_evaluation
2578
+ // to protect against timing attacks
2579
+ if (!$hashesMatch & !$patternMatch) {
2580
+ user_error('Decryption error');
2581
+ return false;
2582
+ }
2583
+
2584
+ // Output the message M
2585
+
2586
+ return substr($m, $offset + 1);
2587
+ }
2588
+
2589
+ /**
2590
+ * Raw Encryption / Decryption
2591
+ *
2592
+ * Doesn't use padding and is not recommended.
2593
+ *
2594
+ * @access private
2595
+ * @param string $m
2596
+ * @return string
2597
+ */
2598
+ function _raw_encrypt($m)
2599
+ {
2600
+ $temp = $this->_os2ip($m);
2601
+ $temp = $this->_rsaep($temp);
2602
+ return $this->_i2osp($temp, $this->k);
2603
+ }
2604
+
2605
+ /**
2606
+ * RSAES-PKCS1-V1_5-ENCRYPT
2607
+ *
2608
+ * See {@link http://tools.ietf.org/html/rfc3447#section-7.2.1 RFC3447#section-7.2.1}.
2609
+ *
2610
+ * @access private
2611
+ * @param string $m
2612
+ * @return string
2613
+ */
2614
+ function _rsaes_pkcs1_v1_5_encrypt($m)
2615
+ {
2616
+ $mLen = strlen($m);
2617
+
2618
+ // Length checking
2619
+
2620
+ if ($mLen > $this->k - 11) {
2621
+ user_error('Message too long');
2622
+ return false;
2623
+ }
2624
+
2625
+ // EME-PKCS1-v1_5 encoding
2626
+
2627
+ $psLen = $this->k - $mLen - 3;
2628
+ $ps = '';
2629
+ while (strlen($ps) != $psLen) {
2630
+ $temp = Random::string($psLen - strlen($ps));
2631
+ $temp = str_replace("\x00", '', $temp);
2632
+ $ps.= $temp;
2633
+ }
2634
+ $type = 2;
2635
+ // see the comments of _rsaes_pkcs1_v1_5_decrypt() to understand why this is being done
2636
+ if (defined('CRYPT_RSA_PKCS15_COMPAT') && (!isset($this->publicExponent) || $this->exponent !== $this->publicExponent)) {
2637
+ $type = 1;
2638
+ // "The padding string PS shall consist of k-3-||D|| octets. ... for block type 01, they shall have value FF"
2639
+ $ps = str_repeat("\xFF", $psLen);
2640
+ }
2641
+ $em = chr(0) . chr($type) . $ps . chr(0) . $m;
2642
+
2643
+ // RSA encryption
2644
+ $m = $this->_os2ip($em);
2645
+ $c = $this->_rsaep($m);
2646
+ $c = $this->_i2osp($c, $this->k);
2647
+
2648
+ // Output the ciphertext C
2649
+
2650
+ return $c;
2651
+ }
2652
+
2653
+ /**
2654
+ * RSAES-PKCS1-V1_5-DECRYPT
2655
+ *
2656
+ * See {@link http://tools.ietf.org/html/rfc3447#section-7.2.2 RFC3447#section-7.2.2}.
2657
+ *
2658
+ * For compatibility purposes, this function departs slightly from the description given in RFC3447.
2659
+ * The reason being that RFC2313#section-8.1 (PKCS#1 v1.5) states that ciphertext's encrypted by the
2660
+ * private key should have the second byte set to either 0 or 1 and that ciphertext's encrypted by the
2661
+ * public key should have the second byte set to 2. In RFC3447 (PKCS#1 v2.1), the second byte is supposed
2662
+ * to be 2 regardless of which key is used. For compatibility purposes, we'll just check to make sure the
2663
+ * second byte is 2 or less. If it is, we'll accept the decrypted string as valid.
2664
+ *
2665
+ * As a consequence of this, a private key encrypted ciphertext produced with \phpseclib\Crypt\RSA may not decrypt
2666
+ * with a strictly PKCS#1 v1.5 compliant RSA implementation. Public key encrypted ciphertext's should but
2667
+ * not private key encrypted ciphertext's.
2668
+ *
2669
+ * @access private
2670
+ * @param string $c
2671
+ * @return string
2672
+ */
2673
+ function _rsaes_pkcs1_v1_5_decrypt($c)
2674
+ {
2675
+ // Length checking
2676
+
2677
+ if (strlen($c) != $this->k) { // or if k < 11
2678
+ user_error('Decryption error');
2679
+ return false;
2680
+ }
2681
+
2682
+ // RSA decryption
2683
+
2684
+ $c = $this->_os2ip($c);
2685
+ $m = $this->_rsadp($c);
2686
+
2687
+ if ($m === false) {
2688
+ user_error('Decryption error');
2689
+ return false;
2690
+ }
2691
+ $em = $this->_i2osp($m, $this->k);
2692
+
2693
+ // EME-PKCS1-v1_5 decoding
2694
+
2695
+ if (ord($em[0]) != 0 || ord($em[1]) > 2) {
2696
+ user_error('Decryption error');
2697
+ return false;
2698
+ }
2699
+
2700
+ $ps = substr($em, 2, strpos($em, chr(0), 2) - 2);
2701
+ $m = substr($em, strlen($ps) + 3);
2702
+
2703
+ if (strlen($ps) < 8) {
2704
+ user_error('Decryption error');
2705
+ return false;
2706
+ }
2707
+
2708
+ // Output M
2709
+
2710
+ return $m;
2711
+ }
2712
+
2713
+ /**
2714
+ * EMSA-PSS-ENCODE
2715
+ *
2716
+ * See {@link http://tools.ietf.org/html/rfc3447#section-9.1.1 RFC3447#section-9.1.1}.
2717
+ *
2718
+ * @access private
2719
+ * @param string $m
2720
+ * @param int $emBits
2721
+ */
2722
+ function _emsa_pss_encode($m, $emBits)
2723
+ {
2724
+ // if $m is larger than two million terrabytes and you're using sha1, PKCS#1 suggests a "Label too long" error
2725
+ // be output.
2726
+
2727
+ $emLen = ($emBits + 1) >> 3; // ie. ceil($emBits / 8)
2728
+ $sLen = $this->sLen !== null ? $this->sLen : $this->hLen;
2729
+
2730
+ $mHash = $this->hash->hash($m);
2731
+ if ($emLen < $this->hLen + $sLen + 2) {
2732
+ user_error('Encoding error');
2733
+ return false;
2734
+ }
2735
+
2736
+ $salt = Random::string($sLen);
2737
+ $m2 = "\0\0\0\0\0\0\0\0" . $mHash . $salt;
2738
+ $h = $this->hash->hash($m2);
2739
+ $ps = str_repeat(chr(0), $emLen - $sLen - $this->hLen - 2);
2740
+ $db = $ps . chr(1) . $salt;
2741
+ $dbMask = $this->_mgf1($h, $emLen - $this->hLen - 1);
2742
+ $maskedDB = $db ^ $dbMask;
2743
+ $maskedDB[0] = ~chr(0xFF << ($emBits & 7)) & $maskedDB[0];
2744
+ $em = $maskedDB . $h . chr(0xBC);
2745
+
2746
+ return $em;
2747
+ }
2748
+
2749
+ /**
2750
+ * EMSA-PSS-VERIFY
2751
+ *
2752
+ * See {@link http://tools.ietf.org/html/rfc3447#section-9.1.2 RFC3447#section-9.1.2}.
2753
+ *
2754
+ * @access private
2755
+ * @param string $m
2756
+ * @param string $em
2757
+ * @param int $emBits
2758
+ * @return string
2759
+ */
2760
+ function _emsa_pss_verify($m, $em, $emBits)
2761
+ {
2762
+ // if $m is larger than two million terrabytes and you're using sha1, PKCS#1 suggests a "Label too long" error
2763
+ // be output.
2764
+
2765
+ $emLen = ($emBits + 1) >> 3; // ie. ceil($emBits / 8);
2766
+ $sLen = $this->sLen !== null ? $this->sLen : $this->hLen;
2767
+
2768
+ $mHash = $this->hash->hash($m);
2769
+ if ($emLen < $this->hLen + $sLen + 2) {
2770
+ return false;
2771
+ }
2772
+
2773
+ if ($em[strlen($em) - 1] != chr(0xBC)) {
2774
+ return false;
2775
+ }
2776
+
2777
+ $maskedDB = substr($em, 0, -$this->hLen - 1);
2778
+ $h = substr($em, -$this->hLen - 1, $this->hLen);
2779
+ $temp = chr(0xFF << ($emBits & 7));
2780
+ if ((~$maskedDB[0] & $temp) != $temp) {
2781
+ return false;
2782
+ }
2783
+ $dbMask = $this->_mgf1($h, $emLen - $this->hLen - 1);
2784
+ $db = $maskedDB ^ $dbMask;
2785
+ $db[0] = ~chr(0xFF << ($emBits & 7)) & $db[0];
2786
+ $temp = $emLen - $this->hLen - $sLen - 2;
2787
+ if (substr($db, 0, $temp) != str_repeat(chr(0), $temp) || ord($db[$temp]) != 1) {
2788
+ return false;
2789
+ }
2790
+ $salt = substr($db, $temp + 1); // should be $sLen long
2791
+ $m2 = "\0\0\0\0\0\0\0\0" . $mHash . $salt;
2792
+ $h2 = $this->hash->hash($m2);
2793
+ return $this->_equals($h, $h2);
2794
+ }
2795
+
2796
+ /**
2797
+ * RSASSA-PSS-SIGN
2798
+ *
2799
+ * See {@link http://tools.ietf.org/html/rfc3447#section-8.1.1 RFC3447#section-8.1.1}.
2800
+ *
2801
+ * @access private
2802
+ * @param string $m
2803
+ * @return string
2804
+ */
2805
+ function _rsassa_pss_sign($m)
2806
+ {
2807
+ // EMSA-PSS encoding
2808
+
2809
+ $em = $this->_emsa_pss_encode($m, 8 * $this->k - 1);
2810
+
2811
+ // RSA signature
2812
+
2813
+ $m = $this->_os2ip($em);
2814
+ $s = $this->_rsasp1($m);
2815
+ $s = $this->_i2osp($s, $this->k);
2816
+
2817
+ // Output the signature S
2818
+
2819
+ return $s;
2820
+ }
2821
+
2822
+ /**
2823
+ * RSASSA-PSS-VERIFY
2824
+ *
2825
+ * See {@link http://tools.ietf.org/html/rfc3447#section-8.1.2 RFC3447#section-8.1.2}.
2826
+ *
2827
+ * @access private
2828
+ * @param string $m
2829
+ * @param string $s
2830
+ * @return string
2831
+ */
2832
+ function _rsassa_pss_verify($m, $s)
2833
+ {
2834
+ // Length checking
2835
+
2836
+ if (strlen($s) != $this->k) {
2837
+ user_error('Invalid signature');
2838
+ return false;
2839
+ }
2840
+
2841
+ // RSA verification
2842
+
2843
+ $modBits = 8 * $this->k;
2844
+
2845
+ $s2 = $this->_os2ip($s);
2846
+ $m2 = $this->_rsavp1($s2);
2847
+ if ($m2 === false) {
2848
+ user_error('Invalid signature');
2849
+ return false;
2850
+ }
2851
+ $em = $this->_i2osp($m2, $modBits >> 3);
2852
+ if ($em === false) {
2853
+ user_error('Invalid signature');
2854
+ return false;
2855
+ }
2856
+
2857
+ // EMSA-PSS verification
2858
+
2859
+ return $this->_emsa_pss_verify($m, $em, $modBits - 1);
2860
+ }
2861
+
2862
+ /**
2863
+ * EMSA-PKCS1-V1_5-ENCODE
2864
+ *
2865
+ * See {@link http://tools.ietf.org/html/rfc3447#section-9.2 RFC3447#section-9.2}.
2866
+ *
2867
+ * @access private
2868
+ * @param string $m
2869
+ * @param int $emLen
2870
+ * @return string
2871
+ */
2872
+ function _emsa_pkcs1_v1_5_encode($m, $emLen)
2873
+ {
2874
+ $h = $this->hash->hash($m);
2875
+ if ($h === false) {
2876
+ return false;
2877
+ }
2878
+
2879
+ // see http://tools.ietf.org/html/rfc3447#page-43
2880
+ switch ($this->hashName) {
2881
+ case 'md2':
2882
+ $t = pack('H*', '3020300c06082a864886f70d020205000410');
2883
+ break;
2884
+ case 'md5':
2885
+ $t = pack('H*', '3020300c06082a864886f70d020505000410');
2886
+ break;
2887
+ case 'sha1':
2888
+ $t = pack('H*', '3021300906052b0e03021a05000414');
2889
+ break;
2890
+ case 'sha256':
2891
+ $t = pack('H*', '3031300d060960864801650304020105000420');
2892
+ break;
2893
+ case 'sha384':
2894
+ $t = pack('H*', '3041300d060960864801650304020205000430');
2895
+ break;
2896
+ case 'sha512':
2897
+ $t = pack('H*', '3051300d060960864801650304020305000440');
2898
+ }
2899
+ $t.= $h;
2900
+ $tLen = strlen($t);
2901
+
2902
+ if ($emLen < $tLen + 11) {
2903
+ user_error('Intended encoded message length too short');
2904
+ return false;
2905
+ }
2906
+
2907
+ $ps = str_repeat(chr(0xFF), $emLen - $tLen - 3);
2908
+
2909
+ $em = "\0\1$ps\0$t";
2910
+
2911
+ return $em;
2912
+ }
2913
+
2914
+ /**
2915
+ * RSASSA-PKCS1-V1_5-SIGN
2916
+ *
2917
+ * See {@link http://tools.ietf.org/html/rfc3447#section-8.2.1 RFC3447#section-8.2.1}.
2918
+ *
2919
+ * @access private
2920
+ * @param string $m
2921
+ * @return string
2922
+ */
2923
+ function _rsassa_pkcs1_v1_5_sign($m)
2924
+ {
2925
+ // EMSA-PKCS1-v1_5 encoding
2926
+
2927
+ $em = $this->_emsa_pkcs1_v1_5_encode($m, $this->k);
2928
+ if ($em === false) {
2929
+ user_error('RSA modulus too short');
2930
+ return false;
2931
+ }
2932
+
2933
+ // RSA signature
2934
+
2935
+ $m = $this->_os2ip($em);
2936
+ $s = $this->_rsasp1($m);
2937
+ $s = $this->_i2osp($s, $this->k);
2938
+
2939
+ // Output the signature S
2940
+
2941
+ return $s;
2942
+ }
2943
+
2944
+ /**
2945
+ * RSASSA-PKCS1-V1_5-VERIFY
2946
+ *
2947
+ * See {@link http://tools.ietf.org/html/rfc3447#section-8.2.2 RFC3447#section-8.2.2}.
2948
+ *
2949
+ * @access private
2950
+ * @param string $m
2951
+ * @return string
2952
+ */
2953
+ function _rsassa_pkcs1_v1_5_verify($m, $s)
2954
+ {
2955
+ // Length checking
2956
+
2957
+ if (strlen($s) != $this->k) {
2958
+ user_error('Invalid signature');
2959
+ return false;
2960
+ }
2961
+
2962
+ // RSA verification
2963
+
2964
+ $s = $this->_os2ip($s);
2965
+ $m2 = $this->_rsavp1($s);
2966
+ if ($m2 === false) {
2967
+ user_error('Invalid signature');
2968
+ return false;
2969
+ }
2970
+ $em = $this->_i2osp($m2, $this->k);
2971
+ if ($em === false) {
2972
+ user_error('Invalid signature');
2973
+ return false;
2974
+ }
2975
+
2976
+ // EMSA-PKCS1-v1_5 encoding
2977
+
2978
+ $em2 = $this->_emsa_pkcs1_v1_5_encode($m, $this->k);
2979
+ if ($em2 === false) {
2980
+ user_error('RSA modulus too short');
2981
+ return false;
2982
+ }
2983
+
2984
+ // Compare
2985
+ return $this->_equals($em, $em2);
2986
+ }
2987
+
2988
+ /**
2989
+ * Set Encryption Mode
2990
+ *
2991
+ * Valid values include self::ENCRYPTION_OAEP and self::ENCRYPTION_PKCS1.
2992
+ *
2993
+ * @access public
2994
+ * @param int $mode
2995
+ */
2996
+ function setEncryptionMode($mode)
2997
+ {
2998
+ $this->encryptionMode = $mode;
2999
+ }
3000
+
3001
+ /**
3002
+ * Set Signature Mode
3003
+ *
3004
+ * Valid values include self::SIGNATURE_PSS and self::SIGNATURE_PKCS1
3005
+ *
3006
+ * @access public
3007
+ * @param int $mode
3008
+ */
3009
+ function setSignatureMode($mode)
3010
+ {
3011
+ $this->signatureMode = $mode;
3012
+ }
3013
+
3014
+ /**
3015
+ * Set public key comment.
3016
+ *
3017
+ * @access public
3018
+ * @param string $comment
3019
+ */
3020
+ function setComment($comment)
3021
+ {
3022
+ $this->comment = $comment;
3023
+ }
3024
+
3025
+ /**
3026
+ * Get public key comment.
3027
+ *
3028
+ * @access public
3029
+ * @return string
3030
+ */
3031
+ function getComment()
3032
+ {
3033
+ return $this->comment;
3034
+ }
3035
+
3036
+ /**
3037
+ * Encryption
3038
+ *
3039
+ * Both self::ENCRYPTION_OAEP and self::ENCRYPTION_PKCS1 both place limits on how long $plaintext can be.
3040
+ * If $plaintext exceeds those limits it will be broken up so that it does and the resultant ciphertext's will
3041
+ * be concatenated together.
3042
+ *
3043
+ * @see self::decrypt()
3044
+ * @access public
3045
+ * @param string $plaintext
3046
+ * @return string
3047
+ */
3048
+ function encrypt($plaintext)
3049
+ {
3050
+ switch ($this->encryptionMode) {
3051
+ case self::ENCRYPTION_NONE:
3052
+ $plaintext = str_split($plaintext, $this->k);
3053
+ $ciphertext = '';
3054
+ foreach ($plaintext as $m) {
3055
+ $ciphertext.= $this->_raw_encrypt($m);
3056
+ }
3057
+ return $ciphertext;
3058
+ case self::ENCRYPTION_PKCS1:
3059
+ $length = $this->k - 11;
3060
+ if ($length <= 0) {
3061
+ return false;
3062
+ }
3063
+
3064
+ $plaintext = str_split($plaintext, $length);
3065
+ $ciphertext = '';
3066
+ foreach ($plaintext as $m) {
3067
+ $ciphertext.= $this->_rsaes_pkcs1_v1_5_encrypt($m);
3068
+ }
3069
+ return $ciphertext;
3070
+ //case self::ENCRYPTION_OAEP:
3071
+ default:
3072
+ $length = $this->k - 2 * $this->hLen - 2;
3073
+ if ($length <= 0) {
3074
+ return false;
3075
+ }
3076
+
3077
+ $plaintext = str_split($plaintext, $length);
3078
+ $ciphertext = '';
3079
+ foreach ($plaintext as $m) {
3080
+ $ciphertext.= $this->_rsaes_oaep_encrypt($m);
3081
+ }
3082
+ return $ciphertext;
3083
+ }
3084
+ }
3085
+
3086
+ /**
3087
+ * Decryption
3088
+ *
3089
+ * @see self::encrypt()
3090
+ * @access public
3091
+ * @param string $plaintext
3092
+ * @return string
3093
+ */
3094
+ function decrypt($ciphertext)
3095
+ {
3096
+ if ($this->k <= 0) {
3097
+ return false;
3098
+ }
3099
+
3100
+ $ciphertext = str_split($ciphertext, $this->k);
3101
+ $ciphertext[count($ciphertext) - 1] = str_pad($ciphertext[count($ciphertext) - 1], $this->k, chr(0), STR_PAD_LEFT);
3102
+
3103
+ $plaintext = '';
3104
+
3105
+ switch ($this->encryptionMode) {
3106
+ case self::ENCRYPTION_NONE:
3107
+ $decrypt = '_raw_encrypt';
3108
+ break;
3109
+ case self::ENCRYPTION_PKCS1:
3110
+ $decrypt = '_rsaes_pkcs1_v1_5_decrypt';
3111
+ break;
3112
+ //case self::ENCRYPTION_OAEP:
3113
+ default:
3114
+ $decrypt = '_rsaes_oaep_decrypt';
3115
+ }
3116
+
3117
+ foreach ($ciphertext as $c) {
3118
+ $temp = $this->$decrypt($c);
3119
+ if ($temp === false) {
3120
+ return false;
3121
+ }
3122
+ $plaintext.= $temp;
3123
+ }
3124
+
3125
+ return $plaintext;
3126
+ }
3127
+
3128
+ /**
3129
+ * Create a signature
3130
+ *
3131
+ * @see self::verify()
3132
+ * @access public
3133
+ * @param string $message
3134
+ * @return string
3135
+ */
3136
+ function sign($message)
3137
+ {
3138
+ if (empty($this->modulus) || empty($this->exponent)) {
3139
+ return false;
3140
+ }
3141
+
3142
+ switch ($this->signatureMode) {
3143
+ case self::SIGNATURE_PKCS1:
3144
+ return $this->_rsassa_pkcs1_v1_5_sign($message);
3145
+ //case self::SIGNATURE_PSS:
3146
+ default:
3147
+ return $this->_rsassa_pss_sign($message);
3148
+ }
3149
+ }
3150
+
3151
+ /**
3152
+ * Verifies a signature
3153
+ *
3154
+ * @see self::sign()
3155
+ * @access public
3156
+ * @param string $message
3157
+ * @param string $signature
3158
+ * @return bool
3159
+ */
3160
+ function verify($message, $signature)
3161
+ {
3162
+ if (empty($this->modulus) || empty($this->exponent)) {
3163
+ return false;
3164
+ }
3165
+
3166
+ switch ($this->signatureMode) {
3167
+ case self::SIGNATURE_PKCS1:
3168
+ return $this->_rsassa_pkcs1_v1_5_verify($message, $signature);
3169
+ //case self::SIGNATURE_PSS:
3170
+ default:
3171
+ return $this->_rsassa_pss_verify($message, $signature);
3172
+ }
3173
+ }
3174
+
3175
+ /**
3176
+ * Extract raw BER from Base64 encoding
3177
+ *
3178
+ * @access private
3179
+ * @param string $str
3180
+ * @return string
3181
+ */
3182
+ function _extractBER($str)
3183
+ {
3184
+ /* X.509 certs are assumed to be base64 encoded but sometimes they'll have additional things in them
3185
+ * above and beyond the ceritificate.
3186
+ * ie. some may have the following preceding the -----BEGIN CERTIFICATE----- line:
3187
+ *
3188
+ * Bag Attributes
3189
+ * localKeyID: 01 00 00 00
3190
+ * subject=/O=organization/OU=org unit/CN=common name
3191
+ * issuer=/O=organization/CN=common name
3192
+ */
3193
+ $temp = preg_replace('#.*?^-+[^-]+-+[\r\n ]*$#ms', '', $str, 1);
3194
+ // remove the -----BEGIN CERTIFICATE----- and -----END CERTIFICATE----- stuff
3195
+ $temp = preg_replace('#-+[^-]+-+#', '', $temp);
3196
+ // remove new lines
3197
+ $temp = str_replace(array("\r", "\n", ' '), '', $temp);
3198
+ $temp = preg_match('#^[a-zA-Z\d/+]*={0,2}$#', $temp) ? base64_decode($temp) : false;
3199
+ return $temp != false ? $temp : $str;
3200
+ }
3201
+ }
vendor/phpseclib/phpseclib/phpseclib/Crypt/Random.php CHANGED
@@ -1,274 +1,274 @@
1
- <?php
2
-
3
- /**
4
- * Random Number Generator
5
- *
6
- * PHP version 5
7
- *
8
- * Here's a short example of how to use this library:
9
- * <code>
10
- * <?php
11
- * include 'vendor/autoload.php';
12
- *
13
- * echo bin2hex(\phpseclib\Crypt\Random::string(8));
14
- * ?>
15
- * </code>
16
- *
17
- * @category Crypt
18
- * @package Random
19
- * @author Jim Wigginton <terrafrost@php.net>
20
- * @copyright 2007 Jim Wigginton
21
- * @license http://www.opensource.org/licenses/mit-license.html MIT License
22
- * @link http://phpseclib.sourceforge.net
23
- */
24
-
25
- namespace phpseclib\Crypt;
26
-
27
- /**
28
- * Pure-PHP Random Number Generator
29
- *
30
- * @package Random
31
- * @author Jim Wigginton <terrafrost@php.net>
32
- * @access public
33
- */
34
- class Random
35
- {
36
- /**
37
- * Generate a random string.
38
- *
39
- * Although microoptimizations are generally discouraged as they impair readability this function is ripe with
40
- * microoptimizations because this function has the potential of being called a huge number of times.
41
- * eg. for RSA key generation.
42
- *
43
- * @param int $length
44
- * @return string
45
- */
46
- static function string($length)
47
- {
48
- if (!$length) {
49
- return '';
50
- }
51
-
52
- if (version_compare(PHP_VERSION, '7.0.0', '>=')) {
53
- try {
54
- return \random_bytes($length);
55
- } catch (\Throwable $e) {
56
- // If a sufficient source of randomness is unavailable, random_bytes() will throw an
57
- // object that implements the Throwable interface (Exception, TypeError, Error).
58
- // We don't actually need to do anything here. The string() method should just continue
59
- // as normal. Note, however, that if we don't have a sufficient source of randomness for
60
- // random_bytes(), most of the other calls here will fail too, so we'll end up using
61
- // the PHP implementation.
62
- }
63
- }
64
-
65
- if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
66
- // method 1. prior to PHP 5.3 this would call rand() on windows hence the function_exists('class_alias') call.
67
- // ie. class_alias is a function that was introduced in PHP 5.3
68
- if (extension_loaded('mcrypt') && function_exists('class_alias')) {
69
- return @mcrypt_create_iv($length);
70
- }
71
- // method 2. openssl_random_pseudo_bytes was introduced in PHP 5.3.0 but prior to PHP 5.3.4 there was,
72
- // to quote <http://php.net/ChangeLog-5.php#5.3.4>, "possible blocking behavior". as of 5.3.4
73
- // openssl_random_pseudo_bytes and mcrypt_create_iv do the exact same thing on Windows. ie. they both
74
- // call php_win32_get_random_bytes():
75
- //
76
- // https://github.com/php/php-src/blob/7014a0eb6d1611151a286c0ff4f2238f92c120d6/ext/openssl/openssl.c#L5008
77
- // https://github.com/php/php-src/blob/7014a0eb6d1611151a286c0ff4f2238f92c120d6/ext/mcrypt/mcrypt.c#L1392
78
- //
79
- // php_win32_get_random_bytes() is defined thusly:
80
- //
81
- // https://github.com/php/php-src/blob/7014a0eb6d1611151a286c0ff4f2238f92c120d6/win32/winutil.c#L80
82
- //
83
- // we're calling it, all the same, in the off chance that the mcrypt extension is not available
84
- if (extension_loaded('openssl') && version_compare(PHP_VERSION, '5.3.4', '>=')) {
85
- return openssl_random_pseudo_bytes($length);
86
- }
87
- } else {
88
- // method 1. the fastest
89
- if (extension_loaded('openssl')) {
90
- return openssl_random_pseudo_bytes($length);
91
- }
92
- // method 2
93
- static $fp = true;
94
- if ($fp === true) {
95
- // warning's will be output unles the error suppression operator is used. errors such as
96
- // "open_basedir restriction in effect", "Permission denied", "No such file or directory", etc.
97
- $fp = @fopen('/dev/urandom', 'rb');
98
- }
99
- if ($fp !== true && $fp !== false) { // surprisingly faster than !is_bool() or is_resource()
100
- return fread($fp, $length);
101
- }
102
- // method 3. pretty much does the same thing as method 2 per the following url:
103
- // https://github.com/php/php-src/blob/7014a0eb6d1611151a286c0ff4f2238f92c120d6/ext/mcrypt/mcrypt.c#L1391
104
- // surprisingly slower than method 2. maybe that's because mcrypt_create_iv does a bunch of error checking that we're
105
- // not doing. regardless, this'll only be called if this PHP script couldn't open /dev/urandom due to open_basedir
106
- // restrictions or some such
107
- if (extension_loaded('mcrypt')) {
108
- return @mcrypt_create_iv($length, MCRYPT_DEV_URANDOM);
109
- }
110
- }
111
- // at this point we have no choice but to use a pure-PHP CSPRNG
112
-
113
- // cascade entropy across multiple PHP instances by fixing the session and collecting all
114
- // environmental variables, including the previous session data and the current session
115
- // data.
116
- //
117
- // mt_rand seeds itself by looking at the PID and the time, both of which are (relatively)
118
- // easy to guess at. linux uses mouse clicks, keyboard timings, etc, as entropy sources, but
119
- // PHP isn't low level to be able to use those as sources and on a web server there's not likely
120
- // going to be a ton of keyboard or mouse action. web servers do have one thing that we can use
121
- // however, a ton of people visiting the website. obviously you don't want to base your seeding
122
- // soley on parameters a potential attacker sends but (1) not everything in $_SERVER is controlled
123
- // by the user and (2) this isn't just looking at the data sent by the current user - it's based
124
- // on the data sent by all users. one user requests the page and a hash of their info is saved.
125
- // another user visits the page and the serialization of their data is utilized along with the
126
- // server envirnment stuff and a hash of the previous http request data (which itself utilizes
127
- // a hash of the session data before that). certainly an attacker should be assumed to have
128
- // full control over his own http requests. he, however, is not going to have control over
129
- // everyone's http requests.
130
- static $crypto = false, $v;
131
- if ($crypto === false) {
132
- // save old session data
133
- $old_session_id = session_id();
134
- $old_use_cookies = ini_get('session.use_cookies');
135
- $old_session_cache_limiter = session_cache_limiter();
136
- $_OLD_SESSION = isset($_SESSION) ? $_SESSION : false;
137
- if ($old_session_id != '') {
138
- session_write_close();
139
- }
140
-
141
- session_id(1);
142
- ini_set('session.use_cookies', 0);
143
- session_cache_limiter('');
144
- session_start();
145
-
146
- $v = $seed = $_SESSION['seed'] = pack('H*', sha1(
147
- (isset($_SERVER) ? phpseclib_safe_serialize($_SERVER) : '') .
148
- (isset($_POST) ? phpseclib_safe_serialize($_POST) : '') .
149
- (isset($_GET) ? phpseclib_safe_serialize($_GET) : '') .
150
- (isset($_COOKIE) ? phpseclib_safe_serialize($_COOKIE) : '') .
151
- phpseclib_safe_serialize($GLOBALS) .
152
- phpseclib_safe_serialize($_SESSION) .
153
- phpseclib_safe_serialize($_OLD_SESSION)
154
- ));
155
- if (!isset($_SESSION['count'])) {
156
- $_SESSION['count'] = 0;
157
- }
158
- $_SESSION['count']++;
159
-
160
- session_write_close();
161
-
162
- // restore old session data
163
- if ($old_session_id != '') {
164
- session_id($old_session_id);
165
- session_start();
166
- ini_set('session.use_cookies', $old_use_cookies);
167
- session_cache_limiter($old_session_cache_limiter);
168
- } else {
169
- if ($_OLD_SESSION !== false) {
170
- $_SESSION = $_OLD_SESSION;
171
- unset($_OLD_SESSION);
172
- } else {
173
- unset($_SESSION);
174
- }
175
- }
176
-
177
- // in SSH2 a shared secret and an exchange hash are generated through the key exchange process.
178
- // the IV client to server is the hash of that "nonce" with the letter A and for the encryption key it's the letter C.
179
- // if the hash doesn't produce enough a key or an IV that's long enough concat successive hashes of the
180
- // original hash and the current hash. we'll be emulating that. for more info see the following URL:
181
- //
182
- // http://tools.ietf.org/html/rfc4253#section-7.2
183
- //
184
- // see the is_string($crypto) part for an example of how to expand the keys
185
- $key = pack('H*', sha1($seed . 'A'));
186
- $iv = pack('H*', sha1($seed . 'C'));
187
-
188
- // ciphers are used as per the nist.gov link below. also, see this link:
189
- //
190
- // http://en.wikipedia.org/wiki/Cryptographically_secure_pseudorandom_number_generator#Designs_based_on_cryptographic_primitives
191
- switch (true) {
192
- case class_exists('\phpseclib\Crypt\AES'):
193
- $crypto = new AES(Base::MODE_CTR);
194
- break;
195
- case class_exists('\phpseclib\Crypt\Twofish'):
196
- $crypto = new Twofish(Base::MODE_CTR);
197
- break;
198
- case class_exists('\phpseclib\Crypt\Blowfish'):
199
- $crypto = new Blowfish(Base::MODE_CTR);
200
- break;
201
- case class_exists('\phpseclib\Crypt\TripleDES'):
202
- $crypto = new TripleDES(Base::MODE_CTR);
203
- break;
204
- case class_exists('\phpseclib\Crypt\DES'):
205
- $crypto = new DES(Base::MODE_CTR);
206
- break;
207
- case class_exists('\phpseclib\Crypt\RC4'):
208
- $crypto = new RC4();
209
- break;
210
- default:
211
- user_error(__CLASS__ . ' requires at least one symmetric cipher be loaded');
212
- return false;
213
- }
214
-
215
- $crypto->setKey($key);
216
- $crypto->setIV($iv);
217
- $crypto->enableContinuousBuffer();
218
- }
219
-
220
- //return $crypto->encrypt(str_repeat("\0", $length));
221
-
222
- // the following is based off of ANSI X9.31:
223
- //
224
- // http://csrc.nist.gov/groups/STM/cavp/documents/rng/931rngext.pdf
225
- //
226
- // OpenSSL uses that same standard for it's random numbers:
227
- //
228
- // http://www.opensource.apple.com/source/OpenSSL/OpenSSL-38/openssl/fips-1.0/rand/fips_rand.c
229
- // (do a search for "ANS X9.31 A.2.4")
230
- $result = '';
231
- while (strlen($result) < $length) {
232
- $i = $crypto->encrypt(microtime()); // strlen(microtime()) == 21
233
- $r = $crypto->encrypt($i ^ $v); // strlen($v) == 20
234
- $v = $crypto->encrypt($r ^ $i); // strlen($r) == 20
235
- $result.= $r;
236
- }
237
- return substr($result, 0, $length);
238
- }
239
- }
240
-
241
- if (!function_exists('phpseclib_safe_serialize')) {
242
- /**
243
- * Safely serialize variables
244
- *
245
- * If a class has a private __sleep() method it'll give a fatal error on PHP 5.2 and earlier.
246
- * PHP 5.3 will emit a warning.
247
- *
248
- * @param mixed $arr
249
- * @access public
250
- */
251
- function phpseclib_safe_serialize(&$arr)
252
- {
253
- if (is_object($arr)) {
254
- return '';
255
- }
256
- if (!is_array($arr)) {
257
- return serialize($arr);
258
- }
259
- // prevent circular array recursion
260
- if (isset($arr['__phpseclib_marker'])) {
261
- return '';
262
- }
263
- $safearr = array();
264
- $arr['__phpseclib_marker'] = true;
265
- foreach (array_keys($arr) as $key) {
266
- // do not recurse on the '__phpseclib_marker' key itself, for smaller memory usage
267
- if ($key !== '__phpseclib_marker') {
268
- $safearr[$key] = phpseclib_safe_serialize($arr[$key]);
269
- }
270
- }
271
- unset($arr['__phpseclib_marker']);
272
- return serialize($safearr);
273
- }
274
- }
1
+ <?php
2
+
3
+ /**
4
+ * Random Number Generator
5
+ *
6
+ * PHP version 5
7
+ *
8
+ * Here's a short example of how to use this library:
9
+ * <code>
10
+ * <?php
11
+ * include 'vendor/autoload.php';
12
+ *
13
+ * echo bin2hex(\phpseclib\Crypt\Random::string(8));
14
+ * ?>
15
+ * </code>
16
+ *
17
+ * @category Crypt
18
+ * @package Random
19
+ * @author Jim Wigginton <terrafrost@php.net>
20
+ * @copyright 2007 Jim Wigginton
21
+ * @license http://www.opensource.org/licenses/mit-license.html MIT License
22
+ * @link http://phpseclib.sourceforge.net
23
+ */
24
+
25
+ namespace phpseclib\Crypt;
26
+
27
+ /**
28
+ * Pure-PHP Random Number Generator
29
+ *
30
+ * @package Random
31
+ * @author Jim Wigginton <terrafrost@php.net>
32
+ * @access public
33
+ */
34
+ class Random
35
+ {
36
+ /**
37
+ * Generate a random string.
38
+ *
39
+ * Although microoptimizations are generally discouraged as they impair readability this function is ripe with
40
+ * microoptimizations because this function has the potential of being called a huge number of times.
41
+ * eg. for RSA key generation.
42
+ *
43
+ * @param int $length
44
+ * @return string
45
+ */
46
+ static function string($length)
47
+ {
48
+ if (!$length) {
49
+ return '';
50
+ }
51
+
52
+ if (version_compare(PHP_VERSION, '7.0.0', '>=')) {
53
+ try {
54
+ return \random_bytes($length);
55
+ } catch (\Throwable $e) {
56
+ // If a sufficient source of randomness is unavailable, random_bytes() will throw an
57
+ // object that implements the Throwable interface (Exception, TypeError, Error).
58
+ // We don't actually need to do anything here. The string() method should just continue
59
+ // as normal. Note, however, that if we don't have a sufficient source of randomness for
60
+ // random_bytes(), most of the other calls here will fail too, so we'll end up using
61
+ // the PHP implementation.
62
+ }
63
+ }
64
+
65
+ if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
66
+ // method 1. prior to PHP 5.3 this would call rand() on windows hence the function_exists('class_alias') call.
67
+ // ie. class_alias is a function that was introduced in PHP 5.3
68
+ if (extension_loaded('mcrypt') && function_exists('class_alias')) {
69
+ return @mcrypt_create_iv($length);
70
+ }
71
+ // method 2. openssl_random_pseudo_bytes was introduced in PHP 5.3.0 but prior to PHP 5.3.4 there was,
72
+ // to quote <http://php.net/ChangeLog-5.php#5.3.4>, "possible blocking behavior". as of 5.3.4
73
+ // openssl_random_pseudo_bytes and mcrypt_create_iv do the exact same thing on Windows. ie. they both
74
+ // call php_win32_get_random_bytes():
75
+ //
76
+ // https://github.com/php/php-src/blob/7014a0eb6d1611151a286c0ff4f2238f92c120d6/ext/openssl/openssl.c#L5008
77
+ // https://github.com/php/php-src/blob/7014a0eb6d1611151a286c0ff4f2238f92c120d6/ext/mcrypt/mcrypt.c#L1392
78
+ //
79
+ // php_win32_get_random_bytes() is defined thusly:
80
+ //
81
+ // https://github.com/php/php-src/blob/7014a0eb6d1611151a286c0ff4f2238f92c120d6/win32/winutil.c#L80
82
+ //
83
+ // we're calling it, all the same, in the off chance that the mcrypt extension is not available
84
+ if (extension_loaded('openssl') && version_compare(PHP_VERSION, '5.3.4', '>=')) {
85
+ return openssl_random_pseudo_bytes($length);
86
+ }
87
+ } else {
88
+ // method 1. the fastest
89
+ if (extension_loaded('openssl')) {
90
+ return openssl_random_pseudo_bytes($length);
91
+ }
92
+ // method 2
93
+ static $fp = true;
94
+ if ($fp === true) {
95
+ // warning's will be output unles the error suppression operator is used. errors such as
96
+ // "open_basedir restriction in effect", "Permission denied", "No such file or directory", etc.
97
+ $fp = @fopen('/dev/urandom', 'rb');
98
+ }
99
+ if ($fp !== true && $fp !== false) { // surprisingly faster than !is_bool() or is_resource()
100
+ return fread($fp, $length);
101
+ }
102
+ // method 3. pretty much does the same thing as method 2 per the following url:
103
+ // https://github.com/php/php-src/blob/7014a0eb6d1611151a286c0ff4f2238f92c120d6/ext/mcrypt/mcrypt.c#L1391
104
+ // surprisingly slower than method 2. maybe that's because mcrypt_create_iv does a bunch of error checking that we're
105
+ // not doing. regardless, this'll only be called if this PHP script couldn't open /dev/urandom due to open_basedir
106
+ // restrictions or some such
107
+ if (extension_loaded('mcrypt')) {
108
+ return @mcrypt_create_iv($length, MCRYPT_DEV_URANDOM);
109
+ }
110
+ }
111
+ // at this point we have no choice but to use a pure-PHP CSPRNG
112
+
113
+ // cascade entropy across multiple PHP instances by fixing the session and collecting all
114
+ // environmental variables, including the previous session data and the current session
115
+ // data.
116
+ //
117
+ // mt_rand seeds itself by looking at the PID and the time, both of which are (relatively)
118
+ // easy to guess at. linux uses mouse clicks, keyboard timings, etc, as entropy sources, but
119
+ // PHP isn't low level to be able to use those as sources and on a web server there's not likely
120
+ // going to be a ton of keyboard or mouse action. web servers do have one thing that we can use
121
+ // however, a ton of people visiting the website. obviously you don't want to base your seeding
122
+ // soley on parameters a potential attacker sends but (1) not everything in $_SERVER is controlled
123
+ // by the user and (2) this isn't just looking at the data sent by the current user - it's based
124
+ // on the data sent by all users. one user requests the page and a hash of their info is saved.
125
+ // another user visits the page and the serialization of their data is utilized along with the
126
+ // server envirnment stuff and a hash of the previous http request data (which itself utilizes
127
+ // a hash of the session data before that). certainly an attacker should be assumed to have
128
+ // full control over his own http requests. he, however, is not going to have control over
129
+ // everyone's http requests.
130
+ static $crypto = false, $v;
131
+ if ($crypto === false) {
132
+ // save old session data
133
+ $old_session_id = session_id();
134
+ $old_use_cookies = ini_get('session.use_cookies');
135
+ $old_session_cache_limiter = session_cache_limiter();
136
+ $_OLD_SESSION = isset($_SESSION) ? $_SESSION : false;
137
+ if ($old_session_id != '') {
138
+ session_write_close();
139
+ }
140
+
141
+ session_id(1);
142
+ ini_set('session.use_cookies', 0);
143
+ session_cache_limiter('');
144
+ session_start();
145
+
146
+ $v = $seed = $_SESSION['seed'] = pack('H*', sha1(
147
+ (isset($_SERVER) ? phpseclib_safe_serialize($_SERVER) : '') .
148
+ (isset($_POST) ? phpseclib_safe_serialize($_POST) : '') .
149
+ (isset($_GET) ? phpseclib_safe_serialize($_GET) : '') .
150
+ (isset($_COOKIE) ? phpseclib_safe_serialize($_COOKIE) : '') .
151
+ phpseclib_safe_serialize($GLOBALS) .
152
+ phpseclib_safe_serialize($_SESSION) .
153
+ phpseclib_safe_serialize($_OLD_SESSION)
154
+ ));
155
+ if (!isset($_SESSION['count'])) {
156
+ $_SESSION['count'] = 0;
157
+ }
158
+ $_SESSION['count']++;
159
+
160
+ session_write_close();
161
+
162
+ // restore old session data
163
+ if ($old_session_id != '') {
164
+ session_id($old_session_id);
165
+ session_start();
166
+ ini_set('session.use_cookies', $old_use_cookies);
167
+ session_cache_limiter($old_session_cache_limiter);
168
+ } else {
169
+ if ($_OLD_SESSION !== false) {
170
+ $_SESSION = $_OLD_SESSION;
171
+ unset($_OLD_SESSION);
172
+ } else {
173
+ unset($_SESSION);
174
+ }
175
+ }
176
+
177
+ // in SSH2 a shared secret and an exchange hash are generated through the key exchange process.
178
+ // the IV client to server is the hash of that "nonce" with the letter A and for the encryption key it's the letter C.
179
+ // if the hash doesn't produce enough a key or an IV that's long enough concat successive hashes of the
180
+ // original hash and the current hash. we'll be emulating that. for more info see the following URL:
181
+ //
182
+ // http://tools.ietf.org/html/rfc4253#section-7.2
183
+ //
184
+ // see the is_string($crypto) part for an example of how to expand the keys
185
+ $key = pack('H*', sha1($seed . 'A'));
186
+ $iv = pack('H*', sha1($seed . 'C'));
187
+
188
+ // ciphers are used as per the nist.gov link below. also, see this link:
189
+ //
190
+ // http://en.wikipedia.org/wiki/Cryptographically_secure_pseudorandom_number_generator#Designs_based_on_cryptographic_primitives
191
+ switch (true) {
192
+ case class_exists('\phpseclib\Crypt\AES'):
193
+ $crypto = new AES(Base::MODE_CTR);
194
+ break;
195
+ case class_exists('\phpseclib\Crypt\Twofish'):
196
+ $crypto = new Twofish(Base::MODE_CTR);
197
+ break;
198
+ case class_exists('\phpseclib\Crypt\Blowfish'):
199
+ $crypto = new Blowfish(Base::MODE_CTR);
200
+ break;
201
+ case class_exists('\phpseclib\Crypt\TripleDES'):
202
+ $crypto = new TripleDES(Base::MODE_CTR);
203
+ break;
204
+ case class_exists('\phpseclib\Crypt\DES'):
205
+ $crypto = new DES(Base::MODE_CTR);
206
+ break;
207
+ case class_exists('\phpseclib\Crypt\RC4'):
208
+ $crypto = new RC4();
209
+ break;
210
+ default:
211
+ user_error(__CLASS__ . ' requires at least one symmetric cipher be loaded');
212
+ return false;
213
+ }
214
+
215
+ $crypto->setKey($key);
216
+ $crypto->setIV($iv);
217
+ $crypto->enableContinuousBuffer();
218
+ }
219
+
220
+ //return $crypto->encrypt(str_repeat("\0", $length));
221
+
222
+ // the following is based off of ANSI X9.31:
223
+ //
224
+ // http://csrc.nist.gov/groups/STM/cavp/documents/rng/931rngext.pdf
225
+ //
226
+ // OpenSSL uses that same standard for it's random numbers:
227
+ //
228
+ // http://www.opensource.apple.com/source/OpenSSL/OpenSSL-38/openssl/fips-1.0/rand/fips_rand.c
229
+ // (do a search for "ANS X9.31 A.2.4")
230
+ $result = '';
231
+ while (strlen($result) < $length) {
232
+ $i = $crypto->encrypt(microtime()); // strlen(microtime()) == 21
233
+ $r = $crypto->encrypt($i ^ $v); // strlen($v) == 20
234
+ $v = $crypto->encrypt($r ^ $i); // strlen($r) == 20
235
+ $result.= $r;
236
+ }
237
+ return substr($result, 0, $length);
238
+ }
239
+ }
240
+
241
+ if (!function_exists('phpseclib_safe_serialize')) {
242
+ /**
243
+ * Safely serialize variables
244
+ *
245
+ * If a class has a private __sleep() method it'll give a fatal error on PHP 5.2 and earlier.
246
+ * PHP 5.3 will emit a warning.
247
+ *
248
+ * @param mixed $arr
249
+ * @access public
250
+ */
251
+ function phpseclib_safe_serialize(&$arr)
252
+ {
253
+ if (is_object($arr)) {
254
+ return '';
255
+ }
256
+ if (!is_array($arr)) {
257
+ return serialize($arr);
258
+ }
259
+ // prevent circular array recursion
260
+ if (isset($arr['__phpseclib_marker'])) {
261
+ return '';
262
+ }
263
+ $safearr = array();
264
+ $arr['__phpseclib_marker'] = true;
265
+ foreach (array_keys($arr) as $key) {
266
+ // do not recurse on the '__phpseclib_marker' key itself, for smaller memory usage
267
+ if ($key !== '__phpseclib_marker') {
268
+ $safearr[$key] = phpseclib_safe_serialize($arr[$key]);
269
+ }
270
+ }
271
+ unset($arr['__phpseclib_marker']);
272
+ return serialize($safearr);
273
+ }
274
+ }
vendor/phpseclib/phpseclib/phpseclib/Crypt/Rijndael.php CHANGED
@@ -1,936 +1,936 @@
1
- <?php
2
-
3
- /**
4
- * Pure-PHP implementation of Rijndael.
5
- *
6
- * Uses mcrypt, if available/possible, and an internal implementation, otherwise.
7
- *
8
- * PHP version 5
9
- *
10
- * If {@link self::setBlockLength() setBlockLength()} isn't called, it'll be assumed to be 128 bits. If
11
- * {@link self::setKeyLength() setKeyLength()} isn't called, it'll be calculated from
12
- * {@link self::setKey() setKey()}. ie. if the key is 128-bits, the key length will be 128-bits. If it's
13
- * 136-bits it'll be null-padded to 192-bits and 192 bits will be the key length until
14
- * {@link self::setKey() setKey()} is called, again, at which point, it'll be recalculated.
15
- *
16
- * Not all Rijndael implementations may support 160-bits or 224-bits as the block length / key length. mcrypt, for example,
17
- * does not. AES, itself, only supports block lengths of 128 and key lengths of 128, 192, and 256.
18
- * {@link http://csrc.nist.gov/archive/aes/rijndael/Rijndael-ammended.pdf#page=10 Rijndael-ammended.pdf#page=10} defines the
19
- * algorithm for block lengths of 192 and 256 but not for block lengths / key lengths of 160 and 224. Indeed, 160 and 224
20
- * are first defined as valid key / block lengths in
21
- * {@link http://csrc.nist.gov/archive/aes/rijndael/Rijndael-ammended.pdf#page=44 Rijndael-ammended.pdf#page=44}:
22
- * Extensions: Other block and Cipher Key lengths.
23
- * Note: Use of 160/224-bit Keys must be explicitly set by setKeyLength(160) respectively setKeyLength(224).
24
- *
25
- * {@internal The variable names are the same as those in
26
- * {@link http://www.csrc.nist.gov/publications/fips/fips197/fips-197.pdf#page=10 fips-197.pdf#page=10}.}}
27
- *
28
- * Here's a short example of how to use this library:
29
- * <code>
30
- * <?php
31
- * include 'vendor/autoload.php';
32
- *
33
- * $rijndael = new \phpseclib\Crypt\Rijndael();
34
- *
35
- * $rijndael->setKey('abcdefghijklmnop');
36
- *
37
- * $size = 10 * 1024;
38
- * $plaintext = '';
39
- * for ($i = 0; $i < $size; $i++) {
40
- * $plaintext.= 'a';
41
- * }
42
- *
43
- * echo $rijndael->decrypt($rijndael->encrypt($plaintext));
44
- * ?>
45
- * </code>
46
- *
47
- * @category Crypt
48
- * @package Rijndael
49
- * @author Jim Wigginton <terrafrost@php.net>
50
- * @copyright 2008 Jim Wigginton
51
- * @license http://www.opensource.org/licenses/mit-license.html MIT License
52
- * @link http://phpseclib.sourceforge.net
53
- */
54
-
55
- namespace phpseclib\Crypt;
56
-
57
- /**
58
- * Pure-PHP implementation of Rijndael.
59
- *
60
- * @package Rijndael
61
- * @author Jim Wigginton <terrafrost@php.net>
62
- * @access public
63
- */
64
- class Rijndael extends Base
65
- {
66
- /**
67
- * The mcrypt specific name of the cipher
68
- *
69
- * Mcrypt is useable for 128/192/256-bit $block_size/$key_length. For 160/224 not.
70
- * \phpseclib\Crypt\Rijndael determines automatically whether mcrypt is useable
71
- * or not for the current $block_size/$key_length.
72
- * In case of, $cipher_name_mcrypt will be set dynamically at run time accordingly.
73
- *
74
- * @see \phpseclib\Crypt\Base::cipher_name_mcrypt
75
- * @see \phpseclib\Crypt\Base::engine
76
- * @see self::isValidEngine()
77
- * @var string
78
- * @access private
79
- */
80
- var $cipher_name_mcrypt = 'rijndael-128';
81
-
82
- /**
83
- * The default salt used by setPassword()
84
- *
85
- * @see \phpseclib\Crypt\Base::password_default_salt
86
- * @see \phpseclib\Crypt\Base::setPassword()
87
- * @var string
88
- * @access private
89
- */
90
- var $password_default_salt = 'phpseclib';
91
-
92
- /**
93
- * The Key Schedule
94
- *
95
- * @see self::_setup()
96
- * @var array
97
- * @access private
98
- */
99
- var $w;
100
-
101
- /**
102
- * The Inverse Key Schedule
103
- *
104
- * @see self::_setup()
105
- * @var array
106
- * @access private
107
- */
108
- var $dw;
109
-
110
- /**
111
- * The Block Length divided by 32
112
- *
113
- * @see self::setBlockLength()
114
- * @var int
115
- * @access private
116
- * @internal The max value is 256 / 32 = 8, the min value is 128 / 32 = 4. Exists in conjunction with $block_size
117
- * because the encryption / decryption / key schedule creation requires this number and not $block_size. We could
118
- * derive this from $block_size or vice versa, but that'd mean we'd have to do multiple shift operations, so in lieu
119
- * of that, we'll just precompute it once.
120
- */
121
- var $Nb = 4;
122
-
123
- /**
124
- * The Key Length (in bytes)
125
- *
126
- * @see self::setKeyLength()
127
- * @var int
128
- * @access private
129
- * @internal The max value is 256 / 8 = 32, the min value is 128 / 8 = 16. Exists in conjunction with $Nk
130
- * because the encryption / decryption / key schedule creation requires this number and not $key_length. We could
131
- * derive this from $key_length or vice versa, but that'd mean we'd have to do multiple shift operations, so in lieu
132
- * of that, we'll just precompute it once.
133
- */
134
- var $key_length = 16;
135
-
136
- /**
137
- * The Key Length divided by 32
138
- *
139
- * @see self::setKeyLength()
140
- * @var int
141
- * @access private
142
- * @internal The max value is 256 / 32 = 8, the min value is 128 / 32 = 4
143
- */
144
- var $Nk = 4;
145
-
146
- /**
147
- * The Number of Rounds
148
- *
149
- * @var int
150
- * @access private
151
- * @internal The max value is 14, the min value is 10.
152
- */
153
- var $Nr;
154
-
155
- /**
156
- * Shift offsets
157
- *
158
- * @var array
159
- * @access private
160
- */
161
- var $c;
162
-
163
- /**
164
- * Holds the last used key- and block_size information
165
- *
166
- * @var array
167
- * @access private
168
- */
169
- var $kl;
170
-
171
- /**
172
- * Sets the key length.
173
- *
174
- * Valid key lengths are 128, 160, 192, 224, and 256. If the length is less than 128, it will be rounded up to
175
- * 128. If the length is greater than 128 and invalid, it will be rounded down to the closest valid amount.
176
- *
177
- * Note: phpseclib extends Rijndael (and AES) for using 160- and 224-bit keys but they are officially not defined
178
- * and the most (if not all) implementations are not able using 160/224-bit keys but round/pad them up to
179
- * 192/256 bits as, for example, mcrypt will do.
180
- *
181
- * That said, if you want be compatible with other Rijndael and AES implementations,
182
- * you should not setKeyLength(160) or setKeyLength(224).
183
- *
184
- * Additional: In case of 160- and 224-bit keys, phpseclib will/can, for that reason, not use
185
- * the mcrypt php extension, even if available.
186
- * This results then in slower encryption.
187
- *
188
- * @access public
189
- * @param int $length
190
- */
191
- function setKeyLength($length)
192
- {
193
- switch (true) {
194
- case $length <= 128:
195
- $this->key_length = 16;
196
- break;
197
- case $length <= 160:
198
- $this->key_length = 20;
199
- break;
200
- case $length <= 192:
201
- $this->key_length = 24;
202
- break;
203
- case $length <= 224:
204
- $this->key_length = 28;
205
- break;
206
- default:
207
- $this->key_length = 32;
208
- }
209
-
210
- parent::setKeyLength($length);
211
- }
212
-
213
- /**
214
- * Sets the block length
215
- *
216
- * Valid block lengths are 128, 160, 192, 224, and 256. If the length is less than 128, it will be rounded up to
217
- * 128. If the length is greater than 128 and invalid, it will be rounded down to the closest valid amount.
218
- *
219
- * @access public
220
- * @param int $length
221
- */
222
- function setBlockLength($length)
223
- {
224
- $length >>= 5;
225
- if ($length > 8) {
226
- $length = 8;
227
- } elseif ($length < 4) {
228
- $length = 4;
229
- }
230
- $this->Nb = $length;
231
- $this->block_size = $length << 2;
232
- $this->changed = true;
233
- $this->_setEngine();
234
- }
235
-
236
- /**
237
- * Test for engine validity
238
- *
239
- * This is mainly just a wrapper to set things up for \phpseclib\Crypt\Base::isValidEngine()
240
- *
241
- * @see \phpseclib\Crypt\Base::__construct()
242
- * @param int $engine
243
- * @access public
244
- * @return bool
245
- */
246
- function isValidEngine($engine)
247
- {
248
- switch ($engine) {
249
- case self::ENGINE_OPENSSL:
250
- if ($this->block_size != 16) {
251
- return false;
252
- }
253
- $this->cipher_name_openssl_ecb = 'aes-' . ($this->key_length << 3) . '-ecb';
254
- $this->cipher_name_openssl = 'aes-' . ($this->key_length << 3) . '-' . $this->_openssl_translate_mode();
255
- break;
256
- case self::ENGINE_MCRYPT:
257
- $this->cipher_name_mcrypt = 'rijndael-' . ($this->block_size << 3);
258
- if ($this->key_length % 8) { // is it a 160/224-bit key?
259
- // mcrypt is not usable for them, only for 128/192/256-bit keys
260
- return false;
261
- }
262
- }
263
-
264
- return parent::isValidEngine($engine);
265
- }
266
-
267
- /**
268
- * Encrypts a block
269
- *
270
- * @access private
271
- * @param string $in
272
- * @return string
273
- */
274
- function _encryptBlock($in)
275
- {
276
- static $tables;
277
- if (empty($tables)) {
278
- $tables = &$this->_getTables();
279
- }
280
- $t0 = $tables[0];
281
- $t1 = $tables[1];
282
- $t2 = $tables[2];
283
- $t3 = $tables[3];
284
- $sbox = $tables[4];
285
-
286
- $state = array();
287
- $words = unpack('N*', $in);
288
-
289
- $c = $this->c;
290
- $w = $this->w;
291
- $Nb = $this->Nb;
292
- $Nr = $this->Nr;
293
-
294
- // addRoundKey
295
- $wc = $Nb - 1;
296
- foreach ($words as $word) {
297
- $state[] = $word ^ $w[++$wc];
298
- }
299
-
300
- // fips-197.pdf#page=19, "Figure 5. Pseudo Code for the Cipher", states that this loop has four components -
301
- // subBytes, shiftRows, mixColumns, and addRoundKey. fips-197.pdf#page=30, "Implementation Suggestions Regarding
302
- // Various Platforms" suggests that performs enhanced implementations are described in Rijndael-ammended.pdf.
303
- // Rijndael-ammended.pdf#page=20, "Implementation aspects / 32-bit processor", discusses such an optimization.
304
- // Unfortunately, the description given there is not quite correct. Per aes.spec.v316.pdf#page=19 [1],
305
- // equation (7.4.7) is supposed to use addition instead of subtraction, so we'll do that here, as well.
306
-
307
- // [1] http://fp.gladman.plus.com/cryptography_technology/rijndael/aes.spec.v316.pdf
308
- $temp = array();
309
- for ($round = 1; $round < $Nr; ++$round) {
310
- $i = 0; // $c[0] == 0
311
- $j = $c[1];
312
- $k = $c[2];
313
- $l = $c[3];
314
-
315
- while ($i < $Nb) {
316
- $temp[$i] = $t0[$state[$i] >> 24 & 0x000000FF] ^
317
- $t1[$state[$j] >> 16 & 0x000000FF] ^
318
- $t2[$state[$k] >> 8 & 0x000000FF] ^
319
- $t3[$state[$l] & 0x000000FF] ^
320
- $w[++$wc];
321
- ++$i;
322
- $j = ($j + 1) % $Nb;
323
- $k = ($k + 1) % $Nb;
324
- $l = ($l + 1) % $Nb;
325
- }
326
- $state = $temp;
327
- }
328
-
329
- // subWord
330
- for ($i = 0; $i < $Nb; ++$i) {
331
- $state[$i] = $sbox[$state[$i] & 0x000000FF] |
332
- ($sbox[$state[$i] >> 8 & 0x000000FF] << 8) |
333
- ($sbox[$state[$i] >> 16 & 0x000000FF] << 16) |
334
- ($sbox[$state[$i] >> 24 & 0x000000FF] << 24);
335
- }
336
-
337
- // shiftRows + addRoundKey
338
- $i = 0; // $c[0] == 0
339
- $j = $c[1];
340
- $k = $c[2];
341
- $l = $c[3];
342
- while ($i < $Nb) {
343
- $temp[$i] = ($state[$i] & 0xFF000000) ^
344
- ($state[$j] & 0x00FF0000) ^
345
- ($state[$k] & 0x0000FF00) ^
346
- ($state[$l] & 0x000000FF) ^
347
- $w[$i];
348
- ++$i;
349
- $j = ($j + 1) % $Nb;
350
- $k = ($k + 1) % $Nb;
351
- $l = ($l + 1) % $Nb;
352
- }
353
-
354
- switch ($Nb) {
355
- case 8:
356
- return pack('N*', $temp[0], $temp[1], $temp[2], $temp[3], $temp[4], $temp[5], $temp[6], $temp[7]);
357
- case 7:
358
- return pack('N*', $temp[0], $temp[1], $temp[2], $temp[3], $temp[4], $temp[5], $temp[6]);
359
- case 6:
360
- return pack('N*', $temp[0], $temp[1], $temp[2], $temp[3], $temp[4], $temp[5]);
361
- case 5:
362
- return pack('N*', $temp[0], $temp[1], $temp[2], $temp[3], $temp[4]);
363
- default:
364
- return pack('N*', $temp[0], $temp[1], $temp[2], $temp[3]);
365
- }
366
- }
367
-
368
- /**
369
- * Decrypts a block
370
- *
371
- * @access private
372
- * @param string $in
373
- * @return string
374
- */
375
- function _decryptBlock($in)
376
- {
377
- static $invtables;
378
- if (empty($invtables)) {
379
- $invtables = &$this->_getInvTables();
380
- }
381
- $dt0 = $invtables[0];
382
- $dt1 = $invtables[1];
383
- $dt2 = $invtables[2];
384
- $dt3 = $invtables[3];
385
- $isbox = $invtables[4];
386
-
387
- $state = array();
388
- $words = unpack('N*', $in);
389
-
390
- $c = $this->c;
391
- $dw = $this->dw;
392
- $Nb = $this->Nb;
393
- $Nr = $this->Nr;
394
-
395
- // addRoundKey
396
- $wc = $Nb - 1;
397
- foreach ($words as $word) {
398
- $state[] = $word ^ $dw[++$wc];
399
- }
400
-
401
- $temp = array();
402
- for ($round = $Nr - 1; $round > 0; --$round) {
403
- $i = 0; // $c[0] == 0
404
- $j = $Nb - $c[1];
405
- $k = $Nb - $c[2];
406
- $l = $Nb - $c[3];
407
-
408
- while ($i < $Nb) {
409
- $temp[$i] = $dt0[$state[$i] >> 24 & 0x000000FF] ^
410
- $dt1[$state[$j] >> 16 & 0x000000FF] ^
411
- $dt2[$state[$k] >> 8 & 0x000000FF] ^
412
- $dt3[$state[$l] & 0x000000FF] ^
413
- $dw[++$wc];
414
- ++$i;
415
- $j = ($j + 1) % $Nb;
416
- $k = ($k + 1) % $Nb;
417
- $l = ($l + 1) % $Nb;
418
- }
419
- $state = $temp;
420
- }
421
-
422
- // invShiftRows + invSubWord + addRoundKey
423
- $i = 0; // $c[0] == 0
424
- $j = $Nb - $c[1];
425
- $k = $Nb - $c[2];
426
- $l = $Nb - $c[3];
427
-
428
- while ($i < $Nb) {
429
- $word = ($state[$i] & 0xFF000000) |
430
- ($state[$j] & 0x00FF0000) |
431
- ($state[$k] & 0x0000FF00) |
432
- ($state[$l] & 0x000000FF);
433
-
434
- $temp[$i] = $dw[$i] ^ ($isbox[$word & 0x000000FF] |
435
- ($isbox[$word >> 8 & 0x000000FF] << 8) |
436
- ($isbox[$word >> 16 & 0x000000FF] << 16) |
437
- ($isbox[$word >> 24 & 0x000000FF] << 24));
438
- ++$i;
439
- $j = ($j + 1) % $Nb;
440
- $k = ($k + 1) % $Nb;
441
- $l = ($l + 1) % $Nb;
442
- }
443
-
444
- switch ($Nb) {
445
- case 8:
446
- return pack('N*', $temp[0], $temp[1], $temp[2], $temp[3], $temp[4], $temp[5], $temp[6], $temp[7]);
447
- case 7:
448
- return pack('N*', $temp[0], $temp[1], $temp[2], $temp[3], $temp[4], $temp[5], $temp[6]);
449
- case 6:
450
- return pack('N*', $temp[0], $temp[1], $temp[2], $temp[3], $temp[4], $temp[5]);
451
- case 5:
452
- return pack('N*', $temp[0], $temp[1], $temp[2], $temp[3], $temp[4]);
453
- default:
454
- return pack('N*', $temp[0], $temp[1], $temp[2], $temp[3]);
455
- }
456
- }
457
-
458
- /**
459
- * Setup the key (expansion)
460
- *
461
- * @see \phpseclib\Crypt\Base::_setupKey()
462
- * @access private
463
- */
464
- function _setupKey()
465
- {
466
- // Each number in $rcon is equal to the previous number multiplied by two in Rijndael's finite field.
467
- // See http://en.wikipedia.org/wiki/Finite_field_arithmetic#Multiplicative_inverse
468
- static $rcon = array(0,
469
- 0x01000000, 0x02000000, 0x04000000, 0x08000000, 0x10000000,
470
- 0x20000000, 0x40000000, 0x80000000, 0x1B000000, 0x36000000,
471
- 0x6C000000, 0xD8000000, 0xAB000000, 0x4D000000, 0x9A000000,
472
- 0x2F000000, 0x5E000000, 0xBC000000, 0x63000000, 0xC6000000,
473
- 0x97000000, 0x35000000, 0x6A000000, 0xD4000000, 0xB3000000,
474
- 0x7D000000, 0xFA000000, 0xEF000000, 0xC5000000, 0x91000000
475
- );
476
-
477
- if (isset($this->kl['key']) && $this->key === $this->kl['key'] && $this->key_length === $this->kl['key_length'] && $this->block_size === $this->kl['block_size']) {
478
- // already expanded
479
- return;
480
- }
481
- $this->kl = array('key' => $this->key, 'key_length' => $this->key_length, 'block_size' => $this->block_size);
482
-
483
- $this->Nk = $this->key_length >> 2;
484
- // see Rijndael-ammended.pdf#page=44
485
- $this->Nr = max($this->Nk, $this->Nb) + 6;
486
-
487
- // shift offsets for Nb = 5, 7 are defined in Rijndael-ammended.pdf#page=44,
488
- // "Table 8: Shift offsets in Shiftrow for the alternative block lengths"
489
- // shift offsets for Nb = 4, 6, 8 are defined in Rijndael-ammended.pdf#page=14,
490
- // "Table 2: Shift offsets for different block lengths"
491
- switch ($this->Nb) {
492
- case 4:
493
- case 5:
494
- case 6:
495
- $this->c = array(0, 1, 2, 3);
496
- break;
497
- case 7:
498
- $this->c = array(0, 1, 2, 4);
499
- break;
500
- case 8:
501
- $this->c = array(0, 1, 3, 4);
502
- }
503
-
504
- $w = array_values(unpack('N*words', $this->key));
505
-
506
- $length = $this->Nb * ($this->Nr + 1);
507
- for ($i = $this->Nk; $i < $length; $i++) {
508
- $temp = $w[$i - 1];
509
- if ($i % $this->Nk == 0) {
510
- // according to <http://php.net/language.types.integer>, "the size of an integer is platform-dependent".
511
- // on a 32-bit machine, it's 32-bits, and on a 64-bit machine, it's 64-bits. on a 32-bit machine,
512
- // 0xFFFFFFFF << 8 == 0xFFFFFF00, but on a 64-bit machine, it equals 0xFFFFFFFF00. as such, doing 'and'
513
- // with 0xFFFFFFFF (or 0xFFFFFF00) on a 32-bit machine is unnecessary, but on a 64-bit machine, it is.
514
- $temp = (($temp << 8) & 0xFFFFFF00) | (($temp >> 24) & 0x000000FF); // rotWord
515
- $temp = $this->_subWord($temp) ^ $rcon[$i / $this->Nk];
516
- } elseif ($this->Nk > 6 && $i % $this->Nk == 4) {
517
- $temp = $this->_subWord($temp);
518
- }
519
- $w[$i] = $w[$i - $this->Nk] ^ $temp;
520
- }
521
-
522
- // convert the key schedule from a vector of $Nb * ($Nr + 1) length to a matrix with $Nr + 1 rows and $Nb columns
523
- // and generate the inverse key schedule. more specifically,
524
- // according to <http://csrc.nist.gov/archive/aes/rijndael/Rijndael-ammended.pdf#page=23> (section 5.3.3),
525
- // "The key expansion for the Inverse Cipher is defined as follows:
526
- // 1. Apply the Key Expansion.
527
- // 2. Apply InvMixColumn to all Round Keys except the first and the last one."
528
- // also, see fips-197.pdf#page=27, "5.3.5 Equivalent Inverse Cipher"
529
- list($dt0, $dt1, $dt2, $dt3) = $this->_getInvTables();
530
- $temp = $this->w = $this->dw = array();
531
- for ($i = $row = $col = 0; $i < $length; $i++, $col++) {
532
- if ($col == $this->Nb) {
533
- if ($row == 0) {
534
- $this->dw[0] = $this->w[0];
535
- } else {
536
- // subWord + invMixColumn + invSubWord = invMixColumn
537
- $j = 0;
538
- while ($j < $this->Nb) {
539
- $dw = $this->_subWord($this->w[$row][$j]);
540
- $temp[$j] = $dt0[$dw >> 24 & 0x000000FF] ^
541
- $dt1[$dw >> 16 & 0x000000FF] ^
542
- $dt2[$dw >> 8 & 0x000000FF] ^
543
- $dt3[$dw & 0x000000FF];
544
- $j++;
545
- }
546
- $this->dw[$row] = $temp;
547
- }
548
-
549
- $col = 0;
550
- $row++;
551
- }
552
- $this->w[$row][$col] = $w[$i];
553
- }
554
-
555
- $this->dw[$row] = $this->w[$row];
556
-
557
- // Converting to 1-dim key arrays (both ascending)
558
- $this->dw = array_reverse($this->dw);
559
- $w = array_pop($this->w);
560
- $dw = array_pop($this->dw);
561
- foreach ($this->w as $r => $wr) {
562
- foreach ($wr as $c => $wc) {
563
- $w[] = $wc;
564
- $dw[] = $this->dw[$r][$c];
565
- }
566
- }
567
- $this->w = $w;
568
- $this->dw = $dw;
569
- }
570
-
571
- /**
572
- * Performs S-Box substitutions
573
- *
574
- * @access private
575
- * @param int $word
576
- */
577
- function _subWord($word)
578
- {
579
- static $sbox;
580
- if (empty($sbox)) {
581
- list(, , , , $sbox) = $this->_getTables();
582
- }
583
-
584
- return $sbox[$word & 0x000000FF] |
585
- ($sbox[$word >> 8 & 0x000000FF] << 8) |
586
- ($sbox[$word >> 16 & 0x000000FF] << 16) |
587
- ($sbox[$word >> 24 & 0x000000FF] << 24);
588
- }
589
-
590
- /**
591
- * Provides the mixColumns and sboxes tables
592
- *
593
- * @see self::_encryptBlock()
594
- * @see self::_setupInlineCrypt()
595
- * @see self::_subWord()
596
- * @access private
597
- * @return array &$tables
598
- */
599
- function &_getTables()
600
- {
601
- static $tables;
602
- if (empty($tables)) {
603
- // according to <http://csrc.nist.gov/archive/aes/rijndael/Rijndael-ammended.pdf#page=19> (section 5.2.1),
604
- // precomputed tables can be used in the mixColumns phase. in that example, they're assigned t0...t3, so
605
- // those are the names we'll use.
606
- $t3 = array_map('intval', array(
607
- // with array_map('intval', ...) we ensure we have only int's and not
608
- // some slower floats converted by php automatically on high values
609
- 0x6363A5C6, 0x7C7C84F8, 0x777799EE, 0x7B7B8DF6, 0xF2F20DFF, 0x6B6BBDD6, 0x6F6FB1DE, 0xC5C55491,
610
- 0x30305060, 0x01010302, 0x6767A9CE, 0x2B2B7D56, 0xFEFE19E7, 0xD7D762B5, 0xABABE64D, 0x76769AEC,
611
- 0xCACA458F, 0x82829D1F, 0xC9C94089, 0x7D7D87FA, 0xFAFA15EF, 0x5959EBB2, 0x4747C98E, 0xF0F00BFB,
612
- 0xADADEC41, 0xD4D467B3, 0xA2A2FD5F, 0xAFAFEA45, 0x9C9CBF23, 0xA4A4F753, 0x727296E4, 0xC0C05B9B,
613
- 0xB7B7C275, 0xFDFD1CE1, 0x9393AE3D, 0x26266A4C, 0x36365A6C, 0x3F3F417E, 0xF7F702F5, 0xCCCC4F83,
614
- 0x34345C68, 0xA5A5F451, 0xE5E534D1, 0xF1F108F9, 0x717193E2, 0xD8D873AB, 0x31315362, 0x15153F2A,
615
- 0x04040C08, 0xC7C75295, 0x23236546, 0xC3C35E9D, 0x18182830, 0x9696A137, 0x05050F0A, 0x9A9AB52F,
616
- 0x0707090E, 0x12123624, 0x80809B1B, 0xE2E23DDF, 0xEBEB26CD, 0x2727694E, 0xB2B2CD7F, 0x75759FEA,
617
- 0x09091B12, 0x83839E1D, 0x2C2C7458, 0x1A1A2E34, 0x1B1B2D36, 0x6E6EB2DC, 0x5A5AEEB4, 0xA0A0FB5B,
618
- 0x5252F6A4, 0x3B3B4D76, 0xD6D661B7, 0xB3B3CE7D, 0x29297B52, 0xE3E33EDD, 0x2F2F715E, 0x84849713,
619
- 0x5353F5A6, 0xD1D168B9, 0x00000000, 0xEDED2CC1, 0x20206040, 0xFCFC1FE3, 0xB1B1C879, 0x5B5BEDB6,
620
- 0x6A6ABED4, 0xCBCB468D, 0xBEBED967, 0x39394B72, 0x4A4ADE94, 0x4C4CD498, 0x5858E8B0, 0xCFCF4A85,
621
- 0xD0D06BBB, 0xEFEF2AC5, 0xAAAAE54F, 0xFBFB16ED, 0x4343C586, 0x4D4DD79A, 0x33335566, 0x85859411,
622
- 0x4545CF8A, 0xF9F910E9, 0x02020604, 0x7F7F81FE, 0x5050F0A0, 0x3C3C4478, 0x9F9FBA25, 0xA8A8E34B,
623
- 0x5151F3A2, 0xA3A3FE5D, 0x4040C080, 0x8F8F8A05, 0x9292AD3F, 0x9D9DBC21, 0x38384870, 0xF5F504F1,
624
- 0xBCBCDF63, 0xB6B6C177, 0xDADA75AF, 0x21216342, 0x10103020, 0xFFFF1AE5, 0xF3F30EFD, 0xD2D26DBF,
625
- 0xCDCD4C81, 0x0C0C1418, 0x13133526, 0xECEC2FC3, 0x5F5FE1BE, 0x9797A235, 0x4444CC88, 0x1717392E,
626
- 0xC4C45793, 0xA7A7F255, 0x7E7E82FC, 0x3D3D477A, 0x6464ACC8, 0x5D5DE7BA, 0x19192B32, 0x737395E6,
627
- 0x6060A0C0, 0x81819819, 0x4F4FD19E, 0xDCDC7FA3, 0x22226644, 0x2A2A7E54, 0x9090AB3B, 0x8888830B,
628
- 0x4646CA8C, 0xEEEE29C7, 0xB8B8D36B, 0x14143C28, 0xDEDE79A7, 0x5E5EE2BC, 0x0B0B1D16, 0xDBDB76AD,
629
- 0xE0E03BDB, 0x32325664, 0x3A3A4E74, 0x0A0A1E14, 0x4949DB92, 0x06060A0C, 0x24246C48, 0x5C5CE4B8,
630
- 0xC2C25D9F, 0xD3D36EBD, 0xACACEF43, 0x6262A6C4, 0x9191A839, 0x9595A431, 0xE4E437D3, 0x79798BF2,
631
- 0xE7E732D5, 0xC8C8438B, 0x3737596E, 0x6D6DB7DA, 0x8D8D8C01, 0xD5D564B1, 0x4E4ED29C, 0xA9A9E049,
632
- 0x6C6CB4D8, 0x5656FAAC, 0xF4F407F3, 0xEAEA25CF, 0x6565AFCA, 0x7A7A8EF4, 0xAEAEE947, 0x08081810,
633
- 0xBABAD56F, 0x787888F0, 0x25256F4A, 0x2E2E725C, 0x1C1C2438, 0xA6A6F157, 0xB4B4C773, 0xC6C65197,
634
- 0xE8E823CB, 0xDDDD7CA1, 0x74749CE8, 0x1F1F213E, 0x4B4BDD96, 0xBDBDDC61, 0x8B8B860D, 0x8A8A850F,
635
- 0x707090E0, 0x3E3E427C, 0xB5B5C471, 0x6666AACC, 0x4848D890, 0x03030506, 0xF6F601F7, 0x0E0E121C,
636
- 0x6161A3C2, 0x35355F6A, 0x5757F9AE, 0xB9B9D069, 0x86869117, 0xC1C15899, 0x1D1D273A, 0x9E9EB927,
637
- 0xE1E138D9, 0xF8F813EB, 0x9898B32B, 0x11113322, 0x6969BBD2, 0xD9D970A9, 0x8E8E8907, 0x9494A733,
638
- 0x9B9BB62D, 0x1E1E223C, 0x87879215, 0xE9E920C9, 0xCECE4987, 0x5555FFAA, 0x28287850, 0xDFDF7AA5,
639
- 0x8C8C8F03, 0xA1A1F859, 0x89898009, 0x0D0D171A, 0xBFBFDA65, 0xE6E631D7, 0x4242C684, 0x6868B8D0,
640
- 0x4141C382, 0x9999B029, 0x2D2D775A, 0x0F0F111E, 0xB0B0CB7B, 0x5454FCA8, 0xBBBBD66D, 0x16163A2C
641
- ));
642
-
643
- foreach ($t3 as $t3i) {
644
- $t0[] = (($t3i << 24) & 0xFF000000) | (($t3i >> 8) & 0x00FFFFFF);
645
- $t1[] = (($t3i << 16) & 0xFFFF0000) | (($t3i >> 16) & 0x0000FFFF);
646
- $t2[] = (($t3i << 8) & 0xFFFFFF00) | (($t3i >> 24) & 0x000000FF);
647
- }
648
-
649
- $tables = array(
650
- // The Precomputed mixColumns tables t0 - t3
651
- $t0,
652
- $t1,
653
- $t2,
654
- $t3,
655
- // The SubByte S-Box
656
- array(
657
- 0x63, 0x7C, 0x77, 0x7B, 0xF2, 0x6B, 0x6F, 0xC5, 0x30, 0x01, 0x67, 0x2B, 0xFE, 0xD7, 0xAB, 0x76,
658
- 0xCA, 0x82, 0xC9, 0x7D, 0xFA, 0x59, 0x47, 0xF0, 0xAD, 0xD4, 0xA2, 0xAF, 0x9C, 0xA4, 0x72, 0xC0,
659
- 0xB7, 0xFD, 0x93, 0x26, 0x36, 0x3F, 0xF7, 0xCC, 0x34, 0xA5, 0xE5, 0xF1, 0x71, 0xD8, 0x31, 0x15,
660
- 0x04, 0xC7, 0x23, 0xC3, 0x18, 0x96, 0x05, 0x9A, 0x07, 0x12, 0x80, 0xE2, 0xEB, 0x27, 0xB2, 0x75,
661
- 0x09, 0x83, 0x2C, 0x1A, 0x1B, 0x6E, 0x5A, 0xA0, 0x52, 0x3B, 0xD6, 0xB3, 0x29, 0xE3, 0x2F, 0x84,
662
- 0x53, 0xD1, 0x00, 0xED, 0x20, 0xFC, 0xB1, 0x5B, 0x6A, 0xCB, 0xBE, 0x39, 0x4A, 0x4C, 0x58, 0xCF,
663
- 0xD0, 0xEF, 0xAA, 0xFB, 0x43, 0x4D, 0x33, 0x85, 0x45, 0xF9, 0x02, 0x7F, 0x50, 0x3C, 0x9F, 0xA8,
664
- 0x51, 0xA3, 0x40, 0x8F, 0x92, 0x9D, 0x38, 0xF5, 0xBC, 0xB6, 0xDA, 0x21, 0x10, 0xFF, 0xF3, 0xD2,
665
- 0xCD, 0x0C, 0x13, 0xEC, 0x5F, 0x97, 0x44, 0x17, 0xC4, 0xA7, 0x7E, 0x3D, 0x64, 0x5D, 0x19, 0x73,
666
- 0x60, 0x81, 0x4F, 0xDC, 0x22, 0x2A, 0x90, 0x88, 0x46, 0xEE, 0xB8, 0x14, 0xDE, 0x5E, 0x0B, 0xDB,
667
- 0xE0, 0x32, 0x3A, 0x0A, 0x49, 0x06, 0x24, 0x5C, 0xC2, 0xD3, 0xAC, 0x62, 0x91, 0x95, 0xE4, 0x79,
668
- 0xE7, 0xC8, 0x37, 0x6D, 0x8D, 0xD5, 0x4E, 0xA9, 0x6C, 0x56, 0xF4, 0xEA, 0x65, 0x7A, 0xAE, 0x08,
669
- 0xBA, 0x78, 0x25, 0x2E, 0x1C, 0xA6, 0xB4, 0xC6, 0xE8, 0xDD, 0x74, 0x1F, 0x4B, 0xBD, 0x8B, 0x8A,
670
- 0x70, 0x3E, 0xB5, 0x66, 0x48, 0x03, 0xF6, 0x0E, 0x61, 0x35, 0x57, 0xB9, 0x86, 0xC1, 0x1D, 0x9E,
671
- 0xE1, 0xF8, 0x98, 0x11, 0x69, 0xD9, 0x8E, 0x94, 0x9B, 0x1E, 0x87, 0xE9, 0xCE, 0x55, 0x28, 0xDF,
672
- 0x8C, 0xA1, 0x89, 0x0D, 0xBF, 0xE6, 0x42, 0x68, 0x41, 0x99, 0x2D, 0x0F, 0xB0, 0x54, 0xBB, 0x16
673
- )
674
- );
675
- }
676
- return $tables;
677
- }
678
-
679
- /**
680
- * Provides the inverse mixColumns and inverse sboxes tables
681
- *
682
- * @see self::_decryptBlock()
683
- * @see self::_setupInlineCrypt()
684
- * @see self::_setupKey()
685
- * @access private
686
- * @return array &$tables
687
- */
688
- function &_getInvTables()
689
- {
690
- static $tables;
691
- if (empty($tables)) {
692
- $dt3 = array_map('intval', array(
693
- 0xF4A75051, 0x4165537E, 0x17A4C31A, 0x275E963A, 0xAB6BCB3B, 0x9D45F11F, 0xFA58ABAC, 0xE303934B,
694
- 0x30FA5520, 0x766DF6AD, 0xCC769188, 0x024C25F5, 0xE5D7FC4F, 0x2ACBD7C5, 0x35448026, 0x62A38FB5,
695
- 0xB15A49DE, 0xBA1B6725, 0xEA0E9845, 0xFEC0E15D, 0x2F7502C3, 0x4CF01281, 0x4697A38D, 0xD3F9C66B,
696
- 0x8F5FE703, 0x929C9515, 0x6D7AEBBF, 0x5259DA95, 0xBE832DD4, 0x7421D358, 0xE0692949, 0xC9C8448E,
697
- 0xC2896A75, 0x8E7978F4, 0x583E6B99, 0xB971DD27, 0xE14FB6BE, 0x88AD17F0, 0x20AC66C9, 0xCE3AB47D,
698
- 0xDF4A1863, 0x1A3182E5, 0x51336097, 0x537F4562, 0x6477E0B1, 0x6BAE84BB, 0x81A01CFE, 0x082B94F9,
699
- 0x48685870, 0x45FD198F, 0xDE6C8794, 0x7BF8B752, 0x73D323AB, 0x4B02E272, 0x1F8F57E3, 0x55AB2A66,
700
- 0xEB2807B2, 0xB5C2032F, 0xC57B9A86, 0x3708A5D3, 0x2887F230, 0xBFA5B223, 0x036ABA02, 0x16825CED,
701
- 0xCF1C2B8A, 0x79B492A7, 0x07F2F0F3, 0x69E2A14E, 0xDAF4CD65, 0x05BED506, 0x34621FD1, 0xA6FE8AC4,
702
- 0x2E539D34, 0xF355A0A2, 0x8AE13205, 0xF6EB75A4, 0x83EC390B, 0x60EFAA40, 0x719F065E, 0x6E1051BD,
703
- 0x218AF93E, 0xDD063D96, 0x3E05AEDD, 0xE6BD464D, 0x548DB591, 0xC45D0571, 0x06D46F04, 0x5015FF60,
704
- 0x98FB2419, 0xBDE997D6, 0x4043CC89, 0xD99E7767, 0xE842BDB0, 0x898B8807, 0x195B38E7, 0xC8EEDB79,
705
- 0x7C0A47A1, 0x420FE97C, 0x841EC9F8, 0x00000000, 0x80868309, 0x2BED4832, 0x1170AC1E, 0x5A724E6C,
706
- 0x0EFFFBFD, 0x8538560F, 0xAED51E3D, 0x2D392736, 0x0FD9640A, 0x5CA62168, 0x5B54D19B, 0x362E3A24,
707
- 0x0A67B10C, 0x57E70F93, 0xEE96D2B4, 0x9B919E1B, 0xC0C54F80, 0xDC20A261, 0x774B695A, 0x121A161C,
708
- 0x93BA0AE2, 0xA02AE5C0, 0x22E0433C, 0x1B171D12, 0x090D0B0E, 0x8BC7ADF2, 0xB6A8B92D, 0x1EA9C814,
709
- 0xF1198557, 0x75074CAF, 0x99DDBBEE, 0x7F60FDA3, 0x01269FF7, 0x72F5BC5C, 0x663BC544, 0xFB7E345B,
710
- 0x4329768B, 0x23C6DCCB, 0xEDFC68B6, 0xE4F163B8, 0x31DCCAD7, 0x63851042, 0x97224013, 0xC6112084,
711
- 0x4A247D85, 0xBB3DF8D2, 0xF93211AE, 0x29A16DC7, 0x9E2F4B1D, 0xB230F3DC, 0x8652EC0D, 0xC1E3D077,
712
- 0xB3166C2B, 0x70B999A9, 0x9448FA11, 0xE9642247, 0xFC8CC4A8, 0xF03F1AA0, 0x7D2CD856, 0x3390EF22,
713
- 0x494EC787, 0x38D1C1D9, 0xCAA2FE8C, 0xD40B3698, 0xF581CFA6, 0x7ADE28A5, 0xB78E26DA, 0xADBFA43F,
714
- 0x3A9DE42C, 0x78920D50, 0x5FCC9B6A, 0x7E466254, 0x8D13C2F6, 0xD8B8E890, 0x39F75E2E, 0xC3AFF582,
715
- 0x5D80BE9F, 0xD0937C69, 0xD52DA96F, 0x2512B3CF, 0xAC993BC8, 0x187DA710, 0x9C636EE8, 0x3BBB7BDB,
716
- 0x267809CD, 0x5918F46E, 0x9AB701EC, 0x4F9AA883, 0x956E65E6, 0xFFE67EAA, 0xBCCF0821, 0x15E8E6EF,
717
- 0xE79BD9BA, 0x6F36CE4A, 0x9F09D4EA, 0xB07CD629, 0xA4B2AF31, 0x3F23312A, 0xA59430C6, 0xA266C035,
718
- 0x4EBC3774, 0x82CAA6FC, 0x90D0B0E0, 0xA7D81533, 0x04984AF1, 0xECDAF741, 0xCD500E7F, 0x91F62F17,
719
- 0x4DD68D76, 0xEFB04D43, 0xAA4D54CC, 0x9604DFE4, 0xD1B5E39E, 0x6A881B4C, 0x2C1FB8C1, 0x65517F46,
720
- 0x5EEA049D, 0x8C355D01, 0x877473FA, 0x0B412EFB, 0x671D5AB3, 0xDBD25292, 0x105633E9, 0xD647136D,
721
- 0xD7618C9A, 0xA10C7A37, 0xF8148E59, 0x133C89EB, 0xA927EECE, 0x61C935B7, 0x1CE5EDE1, 0x47B13C7A,
722
- 0xD2DF599C, 0xF2733F55, 0x14CE7918, 0xC737BF73, 0xF7CDEA53, 0xFDAA5B5F, 0x3D6F14DF, 0x44DB8678,
723
- 0xAFF381CA, 0x68C43EB9, 0x24342C38, 0xA3405FC2, 0x1DC37216, 0xE2250CBC, 0x3C498B28, 0x0D9541FF,
724
- 0xA8017139, 0x0CB3DE08, 0xB4E49CD8, 0x56C19064, 0xCB84617B, 0x32B670D5, 0x6C5C7448, 0xB85742D0
725
- ));
726
-
727
- foreach ($dt3 as $dt3i) {
728
- $dt0[] = (($dt3i << 24) & 0xFF000000) | (($dt3i >> 8) & 0x00FFFFFF);
729
- $dt1[] = (($dt3i << 16) & 0xFFFF0000) | (($dt3i >> 16) & 0x0000FFFF);
730
- $dt2[] = (($dt3i << 8) & 0xFFFFFF00) | (($dt3i >> 24) & 0x000000FF);
731
- };
732
-
733
- $tables = array(
734
- // The Precomputed inverse mixColumns tables dt0 - dt3
735
- $dt0,
736
- $dt1,
737
- $dt2,
738
- $dt3,
739
- // The inverse SubByte S-Box
740
- array(
741
- 0x52, 0x09, 0x6A, 0xD5, 0x30, 0x36, 0xA5, 0x38, 0xBF, 0x40, 0xA3, 0x9E, 0x81, 0xF3, 0xD7, 0xFB,
742
- 0x7C, 0xE3, 0x39, 0x82, 0x9B, 0x2F, 0xFF, 0x87, 0x34, 0x8E, 0x43, 0x44, 0xC4, 0xDE, 0xE9, 0xCB,
743
- 0x54, 0x7B, 0x94, 0x32, 0xA6, 0xC2, 0x23, 0x3D, 0xEE, 0x4C, 0x95, 0x0B, 0x42, 0xFA, 0xC3, 0x4E,
744
- 0x08, 0x2E, 0xA1, 0x66, 0x28, 0xD9, 0x24, 0xB2, 0x76, 0x5B, 0xA2, 0x49, 0x6D, 0x8B, 0xD1, 0x25,
745
- 0x72, 0xF8, 0xF6, 0x64, 0x86, 0x68, 0x98, 0x16, 0xD4, 0xA4, 0x5C, 0xCC, 0x5D, 0x65, 0xB6, 0x92,
746
- 0x6C, 0x70, 0x48, 0x50, 0xFD, 0xED, 0xB9, 0xDA, 0x5E, 0x15, 0x46, 0x57, 0xA7, 0x8D, 0x9D, 0x84,
747
- 0x90, 0xD8, 0xAB, 0x00, 0x8C, 0xBC, 0xD3, 0x0A, 0xF7, 0xE4, 0x58, 0x05, 0xB8, 0xB3, 0x45, 0x06,
748
- 0xD0, 0x2C, 0x1E, 0x8F, 0xCA, 0x3F, 0x0F, 0x02, 0xC1, 0xAF, 0xBD, 0x03, 0x01, 0x13, 0x8A, 0x6B,
749
- 0x3A, 0x91, 0x11, 0x41, 0x4F, 0x67, 0xDC, 0xEA, 0x97, 0xF2, 0xCF, 0xCE, 0xF0, 0xB4, 0xE6, 0x73,
750
- 0x96, 0xAC, 0x74, 0x22, 0xE7, 0xAD, 0x35, 0x85, 0xE2, 0xF9, 0x37, 0xE8, 0x1C, 0x75, 0xDF, 0x6E,
751
- 0x47, 0xF1, 0x1A, 0x71, 0x1D, 0x29, 0xC5, 0x89, 0x6F, 0xB7, 0x62, 0x0E, 0xAA, 0x18, 0xBE, 0x1B,
752
- 0xFC, 0x56, 0x3E, 0x4B, 0xC6, 0xD2, 0x79, 0x20, 0x9A, 0xDB, 0xC0, 0xFE, 0x78, 0xCD, 0x5A, 0xF4,
753
- 0x1F, 0xDD, 0xA8, 0x33, 0x88, 0x07, 0xC7, 0x31, 0xB1, 0x12, 0x10, 0x59, 0x27, 0x80, 0xEC, 0x5F,
754
- 0x60, 0x51, 0x7F, 0xA9, 0x19, 0xB5, 0x4A, 0x0D, 0x2D, 0xE5, 0x7A, 0x9F, 0x93, 0xC9, 0x9C, 0xEF,
755
- 0xA0, 0xE0, 0x3B, 0x4D, 0xAE, 0x2A, 0xF5, 0xB0, 0xC8, 0xEB, 0xBB, 0x3C, 0x83, 0x53, 0x99, 0x61,
756
- 0x17, 0x2B, 0x04, 0x7E, 0xBA, 0x77, 0xD6, 0x26, 0xE1, 0x69, 0x14, 0x63, 0x55, 0x21, 0x0C, 0x7D
757
- )
758
- );
759
- }
760
- return $tables;
761
- }
762
-
763
- /**
764
- * Setup the performance-optimized function for de/encrypt()
765
- *
766
- * @see \phpseclib\Crypt\Base::_setupInlineCrypt()
767
- * @access private
768
- */
769
- function _setupInlineCrypt()
770
- {
771
- // Note: _setupInlineCrypt() will be called only if $this->changed === true
772
- // So here we are'nt under the same heavy timing-stress as we are in _de/encryptBlock() or de/encrypt().
773
- // However...the here generated function- $code, stored as php callback in $this->inline_crypt, must work as fast as even possible.
774
-
775
- $lambda_functions =& self::_getLambdaFunctions();
776
-
777
- // We create max. 10 hi-optimized code for memory reason. Means: For each $key one ultra fast inline-crypt function.
778
- // (Currently, for Crypt_Rijndael/AES, one generated $lambda_function cost on php5.5@32bit ~80kb unfreeable mem and ~130kb on php5.5@64bit)
779
- // After that, we'll still create very fast optimized code but not the hi-ultimative code, for each $mode one.
780
- $gen_hi_opt_code = (bool)(count($lambda_functions) < 10);
781
-
782
- // Generation of a uniqe hash for our generated code
783
- $code_hash = "Crypt_Rijndael, {$this->mode}, {$this->Nr}, {$this->Nb}";
784
- if ($gen_hi_opt_code) {
785
- $code_hash = str_pad($code_hash, 32) . $this->_hashInlineCryptFunction($this->key);
786
- }
787
-
788
- if (!isset($lambda_functions[$code_hash])) {
789
- switch (true) {
790
- case $gen_hi_opt_code:
791
- // The hi-optimized $lambda_functions will use the key-words hardcoded for better performance.
792
- $w = $this->w;
793
- $dw = $this->dw;
794
- $init_encrypt = '';
795
- $init_decrypt = '';
796
- break;
797
- default:
798
- for ($i = 0, $cw = count($this->w); $i < $cw; ++$i) {
799
- $w[] = '$w[' . $i . ']';
800
- $dw[] = '$dw[' . $i . ']';
801
- }
802
- $init_encrypt = '$w = $self->w;';
803
- $init_decrypt = '$dw = $self->dw;';
804
- }
805
-
806
- $Nr = $this->Nr;
807
- $Nb = $this->Nb;
808
- $c = $this->c;
809
-
810
- // Generating encrypt code:
811
- $init_encrypt.= '
812
- static $tables;
813
- if (empty($tables)) {
814
- $tables = &$self->_getTables();
815
- }
816
- $t0 = $tables[0];
817
- $t1 = $tables[1];
818
- $t2 = $tables[2];
819
- $t3 = $tables[3];
820
- $sbox = $tables[4];
821
- ';
822
-
823
- $s = 'e';
824
- $e = 's';
825
- $wc = $Nb - 1;
826
-
827
- // Preround: addRoundKey
828
- $encrypt_block = '$in = unpack("N*", $in);'."\n";
829
- for ($i = 0; $i < $Nb; ++$i) {
830
- $encrypt_block .= '$s'.$i.' = $in['.($i + 1).'] ^ '.$w[++$wc].";\n";
831
- }
832
-
833
- // Mainrounds: shiftRows + subWord + mixColumns + addRoundKey
834
- for ($round = 1; $round < $Nr; ++$round) {
835
- list($s, $e) = array($e, $s);
836
- for ($i = 0; $i < $Nb; ++$i) {
837
- $encrypt_block.=
838
- '$'.$e.$i.' =
839
- $t0[($'.$s.$i .' >> 24) & 0xff] ^
840
- $t1[($'.$s.(($i + $c[1]) % $Nb).' >> 16) & 0xff] ^
841
- $t2[($'.$s.(($i + $c[2]) % $Nb).' >> 8) & 0xff] ^
842
- $t3[ $'.$s.(($i + $c[3]) % $Nb).' & 0xff] ^
843
- '.$w[++$wc].";\n";
844
- }
845
- }
846
-
847
- // Finalround: subWord + shiftRows + addRoundKey
848
- for ($i = 0; $i < $Nb; ++$i) {
849
- $encrypt_block.=
850
- '$'.$e.$i.' =
851
- $sbox[ $'.$e.$i.' & 0xff] |
852
- ($sbox[($'.$e.$i.' >> 8) & 0xff] << 8) |
853
- ($sbox[($'.$e.$i.' >> 16) & 0xff] << 16) |
854
- ($sbox[($'.$e.$i.' >> 24) & 0xff] << 24);'."\n";
855
- }
856
- $encrypt_block .= '$in = pack("N*"'."\n";
857
- for ($i = 0; $i < $Nb; ++$i) {
858
- $encrypt_block.= ',
859
- ($'.$e.$i .' & '.((int)0xFF000000).') ^
860
- ($'.$e.(($i + $c[1]) % $Nb).' & 0x00FF0000 ) ^
861
- ($'.$e.(($i + $c[2]) % $Nb).' & 0x0000FF00 ) ^
862
- ($'.$e.(($i + $c[3]) % $Nb).' & 0x000000FF ) ^
863
- '.$w[$i]."\n";
864
- }
865
- $encrypt_block .= ');';
866
-
867
- // Generating decrypt code:
868
- $init_decrypt.= '
869
- static $invtables;
870
- if (empty($invtables)) {
871
- $invtables = &$self->_getInvTables();
872
- }
873
- $dt0 = $invtables[0];
874
- $dt1 = $invtables[1];
875
- $dt2 = $invtables[2];
876
- $dt3 = $invtables[3];
877
- $isbox = $invtables[4];
878
- ';
879
-
880
- $s = 'e';
881
- $e = 's';
882
- $wc = $Nb - 1;
883
-
884
- // Preround: addRoundKey
885
- $decrypt_block = '$in = unpack("N*", $in);'."\n";
886
- for ($i = 0; $i < $Nb; ++$i) {
887
- $decrypt_block .= '$s'.$i.' = $in['.($i + 1).'] ^ '.$dw[++$wc].';'."\n";
888
- }
889
-
890
- // Mainrounds: shiftRows + subWord + mixColumns + addRoundKey
891
- for ($round = 1; $round < $Nr; ++$round) {
892
- list($s, $e) = array($e, $s);
893
- for ($i = 0; $i < $Nb; ++$i) {
894
- $decrypt_block.=
895
- '$'.$e.$i.' =
896
- $dt0[($'.$s.$i .' >> 24) & 0xff] ^
897
- $dt1[($'.$s.(($Nb + $i - $c[1]) % $Nb).' >> 16) & 0xff] ^
898
- $dt2[($'.$s.(($Nb + $i - $c[2]) % $Nb).' >> 8) & 0xff] ^
899
- $dt3[ $'.$s.(($Nb + $i - $c[3]) % $Nb).' & 0xff] ^
900
- '.$dw[++$wc].";\n";
901
- }
902
- }
903
-
904
- // Finalround: subWord + shiftRows + addRoundKey
905
- for ($i = 0; $i < $Nb; ++$i) {
906
- $decrypt_block.=
907
- '$'.$e.$i.' =
908
- $isbox[ $'.$e.$i.' & 0xff] |
909
- ($isbox[($'.$e.$i.' >> 8) & 0xff] << 8) |
910
- ($isbox[($'.$e.$i.' >> 16) & 0xff] << 16) |
911
- ($isbox[($'.$e.$i.' >> 24) & 0xff] << 24);'."\n";
912
- }
913
- $decrypt_block .= '$in = pack("N*"'."\n";
914
- for ($i = 0; $i < $Nb; ++$i) {
915
- $decrypt_block.= ',
916
- ($'.$e.$i. ' & '.((int)0xFF000000).') ^
917
- ($'.$e.(($Nb + $i - $c[1]) % $Nb).' & 0x00FF0000 ) ^
918
- ($'.$e.(($Nb + $i - $c[2]) % $Nb).' & 0x0000FF00 ) ^
919
- ($'.$e.(($Nb + $i - $c[3]) % $Nb).' & 0x000000FF ) ^
920
- '.$dw[$i]."\n";
921
- }
922
- $decrypt_block .= ');';
923
-
924
- $lambda_functions[$code_hash] = $this->_createInlineCryptFunction(
925
- array(
926
- 'init_crypt' => '',
927
- 'init_encrypt' => $init_encrypt,
928
- 'init_decrypt' => $init_decrypt,
929
- 'encrypt_block' => $encrypt_block,
930
- 'decrypt_block' => $decrypt_block
931
- )
932
- );
933
- }
934
- $this->inline_crypt = $lambda_functions[$code_hash];
935
- }
936
- }
1
+ <?php
2
+
3
+ /**
4
+ * Pure-PHP implementation of Rijndael.
5
+ *
6
+ * Uses mcrypt, if available/possible, and an internal implementation, otherwise.
7
+ *
8
+ * PHP version 5
9
+ *
10
+ * If {@link self::setBlockLength() setBlockLength()} isn't called, it'll be assumed to be 128 bits. If
11
+ * {@link self::setKeyLength() setKeyLength()} isn't called, it'll be calculated from
12
+ * {@link self::setKey() setKey()}. ie. if the key is 128-bits, the key length will be 128-bits. If it's
13
+ * 136-bits it'll be null-padded to 192-bits and 192 bits will be the key length until
14
+ * {@link self::setKey() setKey()} is called, again, at which point, it'll be recalculated.
15
+ *
16
+ * Not all Rijndael implementations may support 160-bits or 224-bits as the block length / key length. mcrypt, for example,
17
+ * does not. AES, itself, only supports block lengths of 128 and key lengths of 128, 192, and 256.
18
+ * {@link http://csrc.nist.gov/archive/aes/rijndael/Rijndael-ammended.pdf#page=10 Rijndael-ammended.pdf#page=10} defines the
19
+ * algorithm for block lengths of 192 and 256 but not for block lengths / key lengths of 160 and 224. Indeed, 160 and 224
20
+ * are first defined as valid key / block lengths in
21
+ * {@link http://csrc.nist.gov/archive/aes/rijndael/Rijndael-ammended.pdf#page=44 Rijndael-ammended.pdf#page=44}:
22
+ * Extensions: Other block and Cipher Key lengths.
23
+ * Note: Use of 160/224-bit Keys must be explicitly set by setKeyLength(160) respectively setKeyLength(224).
24
+ *
25
+ * {@internal The variable names are the same as those in
26
+ * {@link http://www.csrc.nist.gov/publications/fips/fips197/fips-197.pdf#page=10 fips-197.pdf#page=10}.}}
27
+ *
28
+ * Here's a short example of how to use this library:
29
+ * <code>
30
+ * <?php
31
+ * include 'vendor/autoload.php';
32
+ *
33
+ * $rijndael = new \phpseclib\Crypt\Rijndael();
34
+ *
35
+ * $rijndael->setKey('abcdefghijklmnop');
36
+ *
37
+ * $size = 10 * 1024;
38
+ * $plaintext = '';
39
+ * for ($i = 0; $i < $size; $i++) {
40
+ * $plaintext.= 'a';
41
+ * }
42
+ *
43
+ * echo $rijndael->decrypt($rijndael->encrypt($plaintext));
44
+ * ?>
45
+ * </code>
46
+ *
47
+ * @category Crypt
48
+ * @package Rijndael
49
+ * @author Jim Wigginton <terrafrost@php.net>
50
+ * @copyright 2008 Jim Wigginton
51
+ * @license http://www.opensource.org/licenses/mit-license.html MIT License
52
+ * @link http://phpseclib.sourceforge.net
53
+ */
54
+
55
+ namespace phpseclib\Crypt;
56
+
57
+ /**
58
+ * Pure-PHP implementation of Rijndael.
59
+ *
60
+ * @package Rijndael
61
+ * @author Jim Wigginton <terrafrost@php.net>
62
+ * @access public
63
+ */
64
+ class Rijndael extends Base
65
+ {
66
+ /**
67
+ * The mcrypt specific name of the cipher
68
+ *
69
+ * Mcrypt is useable for 128/192/256-bit $block_size/$key_length. For 160/224 not.
70
+ * \phpseclib\Crypt\Rijndael determines automatically whether mcrypt is useable
71
+ * or not for the current $block_size/$key_length.
72
+ * In case of, $cipher_name_mcrypt will be set dynamically at run time accordingly.
73
+ *
74
+ * @see \phpseclib\Crypt\Base::cipher_name_mcrypt
75
+ * @see \phpseclib\Crypt\Base::engine
76
+ * @see self::isValidEngine()
77
+ * @var string
78
+ * @access private
79
+ */
80
+ var $cipher_name_mcrypt = 'rijndael-128';
81
+
82
+ /**
83
+ * The default salt used by setPassword()
84
+ *
85
+ * @see \phpseclib\Crypt\Base::password_default_salt
86
+ * @see \phpseclib\Crypt\Base::setPassword()
87
+ * @var string
88
+ * @access private
89
+ */
90
+ var $password_default_salt = 'phpseclib';
91
+
92
+ /**
93
+ * The Key Schedule
94
+ *
95
+ * @see self::_setup()
96
+ * @var array
97
+ * @access private
98
+ */
99
+ var $w;
100
+
101
+ /**
102
+ * The Inverse Key Schedule
103
+ *
104
+ * @see self::_setup()
105
+ * @var array
106
+ * @access private
107
+ */
108
+ var $dw;
109
+
110
+ /**
111
+ * The Block Length divided by 32
112
+ *
113
+ * @see self::setBlockLength()
114
+ * @var int
115
+ * @access private
116
+ * @internal The max value is 256 / 32 = 8, the min value is 128 / 32 = 4. Exists in conjunction with $block_size
117
+ * because the encryption / decryption / key schedule creation requires this number and not $block_size. We could
118
+ * derive this from $block_size or vice versa, but that'd mean we'd have to do multiple shift operations, so in lieu
119
+ * of that, we'll just precompute it once.
120
+ */
121
+ var $Nb = 4;
122
+
123
+ /**
124
+ * The Key Length (in bytes)
125
+ *
126
+ * @see self::setKeyLength()
127
+ * @var int
128
+ * @access private
129
+ * @internal The max value is 256 / 8 = 32, the min value is 128 / 8 = 16. Exists in conjunction with $Nk
130
+ * because the encryption / decryption / key schedule creation requires this number and not $key_length. We could
131
+ * derive this from $key_length or vice versa, but that'd mean we'd have to do multiple shift operations, so in lieu
132
+ * of that, we'll just precompute it once.
133
+ */
134
+ var $key_length = 16;
135
+
136
+ /**
137
+ * The Key Length divided by 32
138
+ *
139
+ * @see self::setKeyLength()
140
+ * @var int
141
+ * @access private
142
+ * @internal The max value is 256 / 32 = 8, the min value is 128 / 32 = 4
143
+ */
144
+ var $Nk = 4;
145
+
146
+ /**
147
+ * The Number of Rounds
148
+ *
149
+ * @var int
150
+ * @access private
151
+ * @internal The max value is 14, the min value is 10.
152
+ */
153
+ var $Nr;
154
+
155
+ /**
156
+ * Shift offsets
157
+ *
158
+ * @var array
159
+ * @access private
160
+ */
161
+ var $c;
162
+
163
+ /**
164
+ * Holds the last used key- and block_size information
165
+ *
166
+ * @var array
167
+ * @access private
168
+ */
169
+ var $kl;
170
+
171
+ /**
172
+ * Sets the key length.
173
+ *
174
+ * Valid key lengths are 128, 160, 192, 224, and 256. If the length is less than 128, it will be rounded up to
175
+ * 128. If the length is greater than 128 and invalid, it will be rounded down to the closest valid amount.
176
+ *
177
+ * Note: phpseclib extends Rijndael (and AES) for using 160- and 224-bit keys but they are officially not defined
178
+ * and the most (if not all) implementations are not able using 160/224-bit keys but round/pad them up to
179
+ * 192/256 bits as, for example, mcrypt will do.
180
+ *
181
+ * That said, if you want be compatible with other Rijndael and AES implementations,
182
+ * you should not setKeyLength(160) or setKeyLength(224).
183
+ *
184
+ * Additional: In case of 160- and 224-bit keys, phpseclib will/can, for that reason, not use
185
+ * the mcrypt php extension, even if available.
186
+ * This results then in slower encryption.
187
+ *
188
+ * @access public
189
+ * @param int $length
190
+ */
191
+ function setKeyLength($length)
192
+ {
193
+ switch (true) {
194
+ case $length <= 128:
195
+ $this->key_length = 16;
196
+ break;
197
+ case $length <= 160:
198
+ $this->key_length = 20;
199
+ break;
200
+ case $length <= 192:
201
+ $this->key_length = 24;
202
+ break;
203
+ case $length <= 224:
204
+ $this->key_length = 28;
205
+ break;
206
+ default:
207
+ $this->key_length = 32;
208
+ }
209
+
210
+ parent::setKeyLength($length);
211
+ }
212
+
213
+ /**
214
+ * Sets the block length
215
+ *
216
+ * Valid block lengths are 128, 160, 192, 224, and 256. If the length is less than 128, it will be rounded up to
217
+ * 128. If the length is greater than 128 and invalid, it will be rounded down to the closest valid amount.
218
+ *
219
+ * @access public
220
+ * @param int $length
221
+ */
222
+ function setBlockLength($length)
223
+ {
224
+ $length >>= 5;
225
+ if ($length > 8) {
226
+ $length = 8;
227
+ } elseif ($length < 4) {
228
+ $length = 4;
229
+ }
230
+ $this->Nb = $length;
231
+ $this->block_size = $length << 2;
232
+ $this->changed = true;
233
+ $this->_setEngine();
234
+ }
235
+
236
+ /**
237
+ * Test for engine validity
238
+ *
239
+ * This is mainly just a wrapper to set things up for \phpseclib\Crypt\Base::isValidEngine()
240
+ *
241
+ * @see \phpseclib\Crypt\Base::__construct()
242
+ * @param int $engine
243
+ * @access public
244
+ * @return bool
245
+ */
246
+ function isValidEngine($engine)
247
+ {
248
+ switch ($engine) {
249
+ case self::ENGINE_OPENSSL:
250
+ if ($this->block_size != 16) {
251
+ return false;
252
+ }
253
+ $this->cipher_name_openssl_ecb = 'aes-' . ($this->key_length << 3) . '-ecb';
254
+ $this->cipher_name_openssl = 'aes-' . ($this->key_length << 3) . '-' . $this->_openssl_translate_mode();
255
+ break;
256
+ case self::ENGINE_MCRYPT:
257
+ $this->cipher_name_mcrypt = 'rijndael-' . ($this->block_size << 3);
258
+ if ($this->key_length % 8) { // is it a 160/224-bit key?
259
+ // mcrypt is not usable for them, only for 128/192/256-bit keys
260
+ return false;
261
+ }
262
+ }
263
+
264
+ return parent::isValidEngine($engine);
265
+ }
266
+
267
+ /**
268
+ * Encrypts a block
269
+ *
270
+ * @access private
271
+ * @param string $in
272
+ * @return string
273
+ */
274
+ function _encryptBlock($in)
275
+ {
276
+ static $tables;
277
+ if (empty($tables)) {
278
+ $tables = &$this->_getTables();
279
+ }
280
+ $t0 = $tables[0];
281
+ $t1 = $tables[1];
282
+ $t2 = $tables[2];
283
+ $t3 = $tables[3];
284
+ $sbox = $tables[4];
285
+
286
+ $state = array();
287
+ $words = unpack('N*', $in);
288
+
289
+ $c = $this->c;
290
+ $w = $this->w;
291
+ $Nb = $this->Nb;
292
+ $Nr = $this->Nr;
293
+
294
+ // addRoundKey
295
+ $wc = $Nb - 1;
296
+ foreach ($words as $word) {
297
+ $state[] = $word ^ $w[++$wc];
298
+ }
299
+
300
+ // fips-197.pdf#page=19, "Figure 5. Pseudo Code for the Cipher", states that this loop has four components -
301
+ // subBytes, shiftRows, mixColumns, and addRoundKey. fips-197.pdf#page=30, "Implementation Suggestions Regarding
302
+ // Various Platforms" suggests that performs enhanced implementations are described in Rijndael-ammended.pdf.
303
+ // Rijndael-ammended.pdf#page=20, "Implementation aspects / 32-bit processor", discusses such an optimization.
304
+ // Unfortunately, the description given there is not quite correct. Per aes.spec.v316.pdf#page=19 [1],
305
+ // equation (7.4.7) is supposed to use addition instead of subtraction, so we'll do that here, as well.
306
+
307
+ // [1] http://fp.gladman.plus.com/cryptography_technology/rijndael/aes.spec.v316.pdf
308
+ $temp = array();
309
+ for ($round = 1; $round < $Nr; ++$round) {
310
+ $i = 0; // $c[0] == 0
311
+ $j = $c[1];
312
+ $k = $c[2];
313
+ $l = $c[3];
314
+
315
+ while ($i < $Nb) {
316
+ $temp[$i] = $t0[$state[$i] >> 24 & 0x000000FF] ^
317
+ $t1[$state[$j] >> 16 & 0x000000FF] ^
318
+ $t2[$state[$k] >> 8 & 0x000000FF] ^
319
+ $t3[$state[$l] & 0x000000FF] ^
320
+ $w[++$wc];
321
+ ++$i;
322
+ $j = ($j + 1) % $Nb;
323
+ $k = ($k + 1) % $Nb;
324
+ $l = ($l + 1) % $Nb;
325
+ }
326
+ $state = $temp;
327
+ }
328
+
329
+ // subWord
330
+ for ($i = 0; $i < $Nb; ++$i) {
331
+ $state[$i] = $sbox[$state[$i] & 0x000000FF] |
332
+ ($sbox[$state[$i] >> 8 & 0x000000FF] << 8) |
333
+ ($sbox[$state[$i] >> 16 & 0x000000FF] << 16) |
334
+ ($sbox[$state[$i] >> 24 & 0x000000FF] << 24);
335
+ }
336
+
337
+ // shiftRows + addRoundKey
338
+ $i = 0; // $c[0] == 0
339
+ $j = $c[1];
340
+ $k = $c[2];
341
+ $l = $c[3];
342
+ while ($i < $Nb) {
343
+ $temp[$i] = ($state[$i] & 0xFF000000) ^
344
+ ($state[$j] & 0x00FF0000) ^
345
+ ($state[$k] & 0x0000FF00) ^
346
+ ($state[$l] & 0x000000FF) ^
347
+ $w[$i];
348
+ ++$i;
349
+ $j = ($j + 1) % $Nb;
350
+ $k = ($k + 1) % $Nb;
351
+ $l = ($l + 1) % $Nb;
352
+ }
353
+
354
+ switch ($Nb) {
355
+ case 8:
356
+ return pack('N*', $temp[0], $temp[1], $temp[2], $temp[3], $temp[4], $temp[5], $temp[6], $temp[7]);
357
+ case 7:
358
+ return pack('N*', $temp[0], $temp[1], $temp[2], $temp[3], $temp[4], $temp[5], $temp[6]);
359
+ case 6:
360
+ return pack('N*', $temp[0], $temp[1], $temp[2], $temp[3], $temp[4], $temp[5]);
361
+ case 5:
362
+ return pack('N*', $temp[0], $temp[1], $temp[2], $temp[3], $temp[4]);
363
+ default:
364
+ return pack('N*', $temp[0], $temp[1], $temp[2], $temp[3]);
365
+ }
366
+ }
367
+
368
+ /**
369
+ * Decrypts a block
370
+ *
371
+ * @access private
372
+ * @param string $in
373
+ * @return string
374
+ */
375
+ function _decryptBlock($in)
376
+ {
377
+ static $invtables;
378
+ if (empty($invtables)) {
379
+ $invtables = &$this->_getInvTables();
380
+ }
381
+ $dt0 = $invtables[0];
382
+ $dt1 = $invtables[1];
383
+ $dt2 = $invtables[2];
384
+ $dt3 = $invtables[3];
385
+ $isbox = $invtables[4];
386
+
387
+ $state = array();
388
+ $words = unpack('N*', $in);
389
+
390
+ $c = $this->c;
391
+ $dw = $this->dw;
392
+ $Nb = $this->Nb;
393
+ $Nr = $this->Nr;
394
+
395
+ // addRoundKey
396
+ $wc = $Nb - 1;
397
+ foreach ($words as $word) {
398
+ $state[] = $word ^ $dw[++$wc];
399
+ }
400
+
401
+ $temp = array();
402
+ for ($round = $Nr - 1; $round > 0; --$round) {
403
+ $i = 0; // $c[0] == 0
404
+ $j = $Nb - $c[1];
405
+ $k = $Nb - $c[2];
406
+ $l = $Nb - $c[3];
407
+
408
+ while ($i < $Nb) {
409
+ $temp[$i] = $dt0[$state[$i] >> 24 & 0x000000FF] ^
410
+ $dt1[$state[$j] >> 16 & 0x000000FF] ^
411
+ $dt2[$state[$k] >> 8 & 0x000000FF] ^
412
+ $dt3[$state[$l] & 0x000000FF] ^
413
+ $dw[++$wc];
414
+ ++$i;
415
+ $j = ($j + 1) % $Nb;
416
+ $k = ($k + 1) % $Nb;
417
+ $l = ($l + 1) % $Nb;
418
+ }
419
+ $state = $temp;
420
+ }
421
+
422
+ // invShiftRows + invSubWord + addRoundKey
423
+ $i = 0; // $c[0] == 0
424
+ $j = $Nb - $c[1];
425
+ $k = $Nb - $c[2];
426
+ $l = $Nb - $c[3];
427
+
428
+ while ($i < $Nb) {
429
+ $word = ($state[$i] & 0xFF000000) |
430
+ ($state[$j] & 0x00FF0000) |
431
+ ($state[$k] & 0x0000FF00) |
432
+ ($state[$l] & 0x000000FF);
433
+
434
+ $temp[$i] = $dw[$i] ^ ($isbox[$word & 0x000000FF] |
435
+ ($isbox[$word >> 8 & 0x000000FF] << 8) |
436
+ ($isbox[$word >> 16 & 0x000000FF] << 16) |
437
+ ($isbox[$word >> 24 & 0x000000FF] << 24));
438
+ ++$i;
439
+ $j = ($j + 1) % $Nb;
440
+ $k = ($k + 1) % $Nb;
441
+ $l = ($l + 1) % $Nb;
442
+ }
443
+
444
+ switch ($Nb) {
445
+ case 8:
446
+ return pack('N*', $temp[0], $temp[1], $temp[2], $temp[3], $temp[4], $temp[5], $temp[6], $temp[7]);
447
+ case 7:
448
+ return pack('N*', $temp[0], $temp[1], $temp[2], $temp[3], $temp[4], $temp[5], $temp[6]);
449
+ case 6:
450
+ return pack('N*', $temp[0], $temp[1], $temp[2], $temp[3], $temp[4], $temp[5]);
451
+ case 5:
452
+ return pack('N*', $temp[0], $temp[1], $temp[2], $temp[3], $temp[4]);
453
+ default:
454
+ return pack('N*', $temp[0], $temp[1], $temp[2], $temp[3]);
455
+ }
456
+ }
457
+
458
+ /**
459
+ * Setup the key (expansion)
460
+ *
461
+ * @see \phpseclib\Crypt\Base::_setupKey()
462
+ * @access private
463
+ */
464
+ function _setupKey()
465
+ {
466
+ // Each number in $rcon is equal to the previous number multiplied by two in Rijndael's finite field.
467
+ // See http://en.wikipedia.org/wiki/Finite_field_arithmetic#Multiplicative_inverse
468
+ static $rcon = array(0,
469
+ 0x01000000, 0x02000000, 0x04000000, 0x08000000, 0x10000000,
470
+ 0x20000000, 0x40000000, 0x80000000, 0x1B000000, 0x36000000,
471
+ 0x6C000000, 0xD8000000, 0xAB000000, 0x4D000000, 0x9A000000,
472
+ 0x2F000000, 0x5E000000, 0xBC000000, 0x63000000, 0xC6000000,
473
+ 0x97000000, 0x35000000, 0x6A000000, 0xD4000000, 0xB3000000,
474
+ 0x7D000000, 0xFA000000, 0xEF000000, 0xC5000000, 0x91000000
475
+ );
476
+
477
+ if (isset($this->kl['key']) && $this->key === $this->kl['key'] && $this->key_length === $this->kl['key_length'] && $this->block_size === $this->kl['block_size']) {
478
+ // already expanded
479
+ return;
480
+ }
481
+ $this->kl = array('key' => $this->key, 'key_length' => $this->key_length, 'block_size' => $this->block_size);
482
+
483
+ $this->Nk = $this->key_length >> 2;
484
+ // see Rijndael-ammended.pdf#page=44
485
+ $this->Nr = max($this->Nk, $this->Nb) + 6;
486
+
487
+ // shift offsets for Nb = 5, 7 are defined in Rijndael-ammended.pdf#page=44,
488
+ // "Table 8: Shift offsets in Shiftrow for the alternative block lengths"
489
+ // shift offsets for Nb = 4, 6, 8 are defined in Rijndael-ammended.pdf#page=14,
490
+ // "Table 2: Shift offsets for different block lengths"
491
+ switch ($this->Nb) {
492
+ case 4:
493
+ case 5:
494
+ case 6:
495
+ $this->c = array(0, 1, 2, 3);
496
+ break;
497
+ case 7:
498
+ $this->c = array(0, 1, 2, 4);
499
+ break;
500
+ case 8:
501
+ $this->c = array(0, 1, 3, 4);
502
+ }
503
+
504
+ $w = array_values(unpack('N*words', $this->key));
505
+
506
+ $length = $this->Nb * ($this->Nr + 1);
507
+ for ($i = $this->Nk; $i < $length; $i++) {
508
+ $temp = $w[$i - 1];
509
+ if ($i % $this->Nk == 0) {
510
+ // according to <http://php.net/language.types.integer>, "the size of an integer is platform-dependent".
511
+ // on a 32-bit machine, it's 32-bits, and on a 64-bit machine, it's 64-bits. on a 32-bit machine,
512
+ // 0xFFFFFFFF << 8 == 0xFFFFFF00, but on a 64-bit machine, it equals 0xFFFFFFFF00. as such, doing 'and'
513
+ // with 0xFFFFFFFF (or 0xFFFFFF00) on a 32-bit machine is unnecessary, but on a 64-bit machine, it is.
514
+ $temp = (($temp << 8) & 0xFFFFFF00) | (($temp >> 24) & 0x000000FF); // rotWord
515
+ $temp = $this->_subWord($temp) ^ $rcon[$i / $this->Nk];
516
+ } elseif ($this->Nk > 6 && $i % $this->Nk == 4) {
517
+ $temp = $this->_subWord($temp);
518
+ }
519
+ $w[$i] = $w[$i - $this->Nk] ^ $temp;
520
+ }
521
+
522
+ // convert the key schedule from a vector of $Nb * ($Nr + 1) length to a matrix with $Nr + 1 rows and $Nb columns
523
+ // and generate the inverse key schedule. more specifically,
524
+ // according to <http://csrc.nist.gov/archive/aes/rijndael/Rijndael-ammended.pdf#page=23> (section 5.3.3),
525
+ // "The key expansion for the Inverse Cipher is defined as follows:
526
+ // 1. Apply the Key Expansion.
527
+ // 2. Apply InvMixColumn to all Round Keys except the first and the last one."
528
+ // also, see fips-197.pdf#page=27, "5.3.5 Equivalent Inverse Cipher"
529
+ list($dt0, $dt1, $dt2, $dt3) = $this->_getInvTables();
530
+ $temp = $this->w = $this->dw = array();
531
+ for ($i = $row = $col = 0; $i < $length; $i++, $col++) {
532
+ if ($col == $this->Nb) {
533
+ if ($row == 0) {
534
+ $this->dw[0] = $this->w[0];
535
+ } else {
536
+ // subWord + invMixColumn + invSubWord = invMixColumn
537
+ $j = 0;
538
+ while ($j < $this->Nb) {
539
+ $dw = $this->_subWord($this->w[$row][$j]);
540
+ $temp[$j] = $dt0[$dw >> 24 & 0x000000FF] ^
541
+ $dt1[$dw >> 16 & 0x000000FF] ^
542
+ $dt2[$dw >> 8 & 0x000000FF] ^
543
+ $dt3[$dw & 0x000000FF];
544
+ $j++;
545
+ }
546
+ $this->dw[$row] = $temp;
547
+ }
548
+
549
+ $col = 0;
550
+ $row++;
551
+ }
552
+ $this->w[$row][$col] = $w[$i];
553
+ }
554
+
555
+ $this->dw[$row] = $this->w[$row];
556
+
557
+ // Converting to 1-dim key arrays (both ascending)
558
+ $this->dw = array_reverse($this->dw);
559
+ $w = array_pop($this->w);
560
+ $dw = array_pop($this->dw);
561
+ foreach ($this->w as $r => $wr) {
562
+ foreach ($wr as $c => $wc) {
563
+ $w[] = $wc;
564
+ $dw[] = $this->dw[$r][$c];
565
+ }
566
+ }
567
+ $this->w = $w;
568
+ $this->dw = $dw;
569
+ }
570
+
571
+ /**
572
+ * Performs S-Box substitutions
573
+ *
574
+ * @access private
575
+ * @param int $word
576
+ */
577
+ function _subWord($word)
578
+ {
579
+ static $sbox;
580
+ if (empty($sbox)) {
581
+ list(, , , , $sbox) = $this->_getTables();
582
+ }
583
+
584
+ return $sbox[$word & 0x000000FF] |
585
+ ($sbox[$word >> 8 & 0x000000FF] << 8) |
586
+ ($sbox[$word >> 16 & 0x000000FF] << 16) |
587
+ ($sbox[$word >> 24 & 0x000000FF] << 24);
588
+ }
589
+
590
+ /**
591
+ * Provides the mixColumns and sboxes tables
592
+ *
593
+ * @see self::_encryptBlock()
594
+ * @see self::_setupInlineCrypt()
595
+ * @see self::_subWord()
596
+ * @access private
597
+ * @return array &$tables
598
+ */
599
+ function &_getTables()
600
+ {
601
+ static $tables;
602
+ if (empty($tables)) {
603
+ // according to <http://csrc.nist.gov/archive/aes/rijndael/Rijndael-ammended.pdf#page=19> (section 5.2.1),
604
+ // precomputed tables can be used in the mixColumns phase. in that example, they're assigned t0...t3, so
605
+ // those are the names we'll use.
606
+ $t3 = array_map('intval', array(
607
+ // with array_map('intval', ...) we ensure we have only int's and not
608
+ // some slower floats converted by php automatically on high values
609
+ 0x6363A5C6, 0x7C7C84F8, 0x777799EE, 0x7B7B8DF6, 0xF2F20DFF, 0x6B6BBDD6, 0x6F6FB1DE, 0xC5C55491,
610
+ 0x30305060, 0x01010302, 0x6767A9CE, 0x2B2B7D56, 0xFEFE19E7, 0xD7D762B5, 0xABABE64D, 0x76769AEC,
611
+ 0xCACA458F, 0x82829D1F, 0xC9C94089, 0x7D7D87FA, 0xFAFA15EF, 0x5959EBB2, 0x4747C98E, 0xF0F00BFB,
612
+ 0xADADEC41, 0xD4D467B3, 0xA2A2FD5F, 0xAFAFEA45, 0x9C9CBF23, 0xA4A4F753, 0x727296E4, 0xC0C05B9B,
613
+ 0xB7B7C275, 0xFDFD1CE1, 0x9393AE3D, 0x26266A4C, 0x36365A6C, 0x3F3F417E, 0xF7F702F5, 0xCCCC4F83,
614
+ 0x34345C68, 0xA5A5F451, 0xE5E534D1, 0xF1F108F9, 0x717193E2, 0xD8D873AB, 0x31315362, 0x15153F2A,
615
+ 0x04040C08, 0xC7C75295, 0x23236546, 0xC3C35E9D, 0x18182830, 0x9696A137, 0x05050F0A, 0x9A9AB52F,
616
+ 0x0707090E, 0x12123624, 0x80809B1B, 0xE2E23DDF, 0xEBEB26CD, 0x2727694E, 0xB2B2CD7F, 0x75759FEA,
617
+ 0x09091B12, 0x83839E1D, 0x2C2C7458, 0x1A1A2E34, 0x1B1B2D36, 0x6E6EB2DC, 0x5A5AEEB4, 0xA0A0FB5B,
618
+ 0x5252F6A4, 0x3B3B4D76, 0xD6D661B7, 0xB3B3CE7D, 0x29297B52, 0xE3E33EDD, 0x2F2F715E, 0x84849713,
619
+ 0x5353F5A6, 0xD1D168B9, 0x00000000, 0xEDED2CC1, 0x20206040, 0xFCFC1FE3, 0xB1B1C879, 0x5B5BEDB6,
620
+ 0x6A6ABED4, 0xCBCB468D, 0xBEBED967, 0x39394B72, 0x4A4ADE94, 0x4C4CD498, 0x5858E8B0, 0xCFCF4A85,
621
+ 0xD0D06BBB, 0xEFEF2AC5, 0xAAAAE54F, 0xFBFB16ED, 0x4343C586, 0x4D4DD79A, 0x33335566, 0x85859411,
622
+ 0x4545CF8A, 0xF9F910E9, 0x02020604, 0x7F7F81FE, 0x5050F0A0, 0x3C3C4478, 0x9F9FBA25, 0xA8A8E34B,
623
+ 0x5151F3A2, 0xA3A3FE5D, 0x4040C080, 0x8F8F8A05, 0x9292AD3F, 0x9D9DBC21, 0x38384870, 0xF5F504F1,
624
+ 0xBCBCDF63, 0xB6B6C177, 0xDADA75AF, 0x21216342, 0x10103020, 0xFFFF1AE5, 0xF3F30EFD, 0xD2D26DBF,
625
+ 0xCDCD4C81, 0x0C0C1418, 0x13133526, 0xECEC2FC3, 0x5F5FE1BE, 0x9797A235, 0x4444CC88, 0x1717392E,
626
+ 0xC4C45793, 0xA7A7F255, 0x7E7E82FC, 0x3D3D477A, 0x6464ACC8, 0x5D5DE7BA, 0x19192B32, 0x737395E6,
627
+ 0x6060A0C0, 0x81819819, 0x4F4FD19E, 0xDCDC7FA3, 0x22226644, 0x2A2A7E54, 0x9090AB3B, 0x8888830B,
628
+ 0x4646CA8C, 0xEEEE29C7, 0xB8B8D36B, 0x14143C28, 0xDEDE79A7, 0x5E5EE2BC, 0x0B0B1D16, 0xDBDB76AD,
629
+ 0xE0E03BDB, 0x32325664, 0x3A3A4E74, 0x0A0A1E14, 0x4949DB92, 0x06060A0C, 0x24246C48, 0x5C5CE4B8,
630
+ 0xC2C25D9F, 0xD3D36EBD, 0xACACEF43, 0x6262A6C4, 0x9191A839, 0x9595A431, 0xE4E437D3, 0x79798BF2,
631
+ 0xE7E732D5, 0xC8C8438B, 0x3737596E, 0x6D6DB7DA, 0x8D8D8C01, 0xD5D564B1, 0x4E4ED29C, 0xA9A9E049,
632
+ 0x6C6CB4D8, 0x5656FAAC, 0xF4F407F3, 0xEAEA25CF, 0x6565AFCA, 0x7A7A8EF4, 0xAEAEE947, 0x08081810,
633
+ 0xBABAD56F, 0x787888F0, 0x25256F4A, 0x2E2E725C, 0x1C1C2438, 0xA6A6F157, 0xB4B4C773, 0xC6C65197,
634
+ 0xE8E823CB, 0xDDDD7CA1, 0x74749CE8, 0x1F1F213E, 0x4B4BDD96, 0xBDBDDC61, 0x8B8B860D, 0x8A8A850F,
635
+ 0x707090E0, 0x3E3E427C, 0xB5B5C471, 0x6666AACC, 0x4848D890, 0x03030506, 0xF6F601F7, 0x0E0E121C,
636
+ 0x6161A3C2, 0x35355F6A, 0x5757F9AE, 0xB9B9D069, 0x86869117, 0xC1C15899, 0x1D1D273A, 0x9E9EB927,
637
+ 0xE1E138D9, 0xF8F813EB, 0x9898B32B, 0x11113322, 0x6969BBD2, 0xD9D970A9, 0x8E8E8907, 0x9494A733,
638
+ 0x9B9BB62D, 0x1E1E223C, 0x87879215, 0xE9E920C9, 0xCECE4987, 0x5555FFAA, 0x28287850, 0xDFDF7AA5,
639
+ 0x8C8C8F03, 0xA1A1F859, 0x89898009, 0x0D0D171A, 0xBFBFDA65, 0xE6E631D7, 0x4242C684, 0x6868B8D0,
640
+ 0x4141C382, 0x9999B029, 0x2D2D775A, 0x0F0F111E, 0xB0B0CB7B, 0x5454FCA8, 0xBBBBD66D, 0x16163A2C
641
+ ));
642
+
643
+ foreach ($t3 as $t3i) {
644
+ $t0[] = (($t3i << 24) & 0xFF000000) | (($t3i >> 8) & 0x00FFFFFF);
645
+ $t1[] = (($t3i << 16) & 0xFFFF0000) | (($t3i >> 16) & 0x0000FFFF);
646
+ $t2[] = (($t3i << 8) & 0xFFFFFF00) | (($t3i >> 24) & 0x000000FF);
647
+ }
648
+
649
+ $tables = array(
650
+ // The Precomputed mixColumns tables t0 - t3
651
+ $t0,
652
+ $t1,
653
+ $t2,
654
+ $t3,
655
+ // The SubByte S-Box
656
+ array(
657
+ 0x63, 0x7C, 0x77, 0x7B, 0xF2, 0x6B, 0x6F, 0xC5, 0x30, 0x01, 0x67, 0x2B, 0xFE, 0xD7, 0xAB, 0x76,
658
+ 0xCA, 0x82, 0xC9, 0x7D, 0xFA, 0x59, 0x47, 0xF0, 0xAD, 0xD4, 0xA2, 0xAF, 0x9C, 0xA4, 0x72, 0xC0,
659
+ 0xB7, 0xFD, 0x93, 0x26, 0x36, 0x3F, 0xF7, 0xCC, 0x34, 0xA5, 0xE5, 0xF1, 0x71, 0xD8, 0x31, 0x15,
660
+ 0x04, 0xC7, 0x23, 0xC3, 0x18, 0x96, 0x05, 0x9A, 0x07, 0x12, 0x80, 0xE2, 0xEB, 0x27, 0xB2, 0x75,
661
+ 0x09, 0x83, 0x2C, 0x1A, 0x1B, 0x6E, 0x5A, 0xA0, 0x52, 0x3B, 0xD6, 0xB3, 0x29, 0xE3, 0x2F, 0x84,
662
+ 0x53, 0xD1, 0x00, 0xED, 0x20, 0xFC, 0xB1, 0x5B, 0x6A, 0xCB, 0xBE, 0x39, 0x4A, 0x4C, 0x58, 0xCF,
663
+ 0xD0, 0xEF, 0xAA, 0xFB, 0x43, 0x4D, 0x33, 0x85, 0x45, 0xF9, 0x02, 0x7F, 0x50, 0x3C, 0x9F, 0xA8,
664
+ 0x51, 0xA3, 0x40, 0x8F, 0x92, 0x9D, 0x38, 0xF5, 0xBC, 0xB6, 0xDA, 0x21, 0x10, 0xFF, 0xF3, 0xD2,
665
+ 0xCD, 0x0C, 0x13, 0xEC, 0x5F, 0x97, 0x44, 0x17, 0xC4, 0xA7, 0x7E, 0x3D, 0x64, 0x5D, 0x19, 0x73,
666
+ 0x60, 0x81, 0x4F, 0xDC, 0x22, 0x2A, 0x90, 0x88, 0x46, 0xEE, 0xB8, 0x14, 0xDE, 0x5E, 0x0B, 0xDB,
667
+ 0xE0, 0x32, 0x3A, 0x0A, 0x49, 0x06, 0x24, 0x5C, 0xC2, 0xD3, 0xAC, 0x62, 0x91, 0x95, 0xE4, 0x79,
668
+ 0xE7, 0xC8, 0x37, 0x6D, 0x8D, 0xD5, 0x4E, 0xA9, 0x6C, 0x56, 0xF4, 0xEA, 0x65, 0x7A, 0xAE, 0x08,
669
+ 0xBA, 0x78, 0x25, 0x2E, 0x1C, 0xA6, 0xB4, 0xC6, 0xE8, 0xDD, 0x74, 0x1F, 0x4B, 0xBD, 0x8B, 0x8A,
670
+ 0x70, 0x3E, 0xB5, 0x66, 0x48, 0x03, 0xF6, 0x0E, 0x61, 0x35, 0x57, 0xB9, 0x86, 0xC1, 0x1D, 0x9E,
671
+ 0xE1, 0xF8, 0x98, 0x11, 0x69, 0xD9, 0x8E, 0x94, 0x9B, 0x1E, 0x87, 0xE9, 0xCE, 0x55, 0x28, 0xDF,
672
+ 0x8C, 0xA1, 0x89, 0x0D, 0xBF, 0xE6, 0x42, 0x68, 0x41, 0x99, 0x2D, 0x0F, 0xB0, 0x54, 0xBB, 0x16
673
+ )
674
+ );
675
+ }
676
+ return $tables;
677
+ }
678
+
679
+ /**
680
+ * Provides the inverse mixColumns and inverse sboxes tables
681
+ *
682
+ * @see self::_decryptBlock()
683
+ * @see self::_setupInlineCrypt()
684
+ * @see self::_setupKey()
685
+ * @access private
686
+ * @return array &$tables
687
+ */
688
+ function &_getInvTables()
689
+ {
690
+ static $tables;
691
+ if (empty($tables)) {
692
+ $dt3 = array_map('intval', array(
693
+ 0xF4A75051, 0x4165537E, 0x17A4C31A, 0x275E963A, 0xAB6BCB3B, 0x9D45F11F, 0xFA58ABAC, 0xE303934B,
694
+ 0x30FA5520, 0x766DF6AD, 0xCC769188, 0x024C25F5, 0xE5D7FC4F, 0x2ACBD7C5, 0x35448026, 0x62A38FB5,
695
+ 0xB15A49DE, 0xBA1B6725, 0xEA0E9845, 0xFEC0E15D, 0x2F7502C3, 0x4CF01281, 0x4697A38D, 0xD3F9C66B,
696
+ 0x8F5FE703, 0x929C9515, 0x6D7AEBBF, 0x5259DA95, 0xBE832DD4, 0x7421D358, 0xE0692949, 0xC9C8448E,
697
+ 0xC2896A75, 0x8E7978F4, 0x583E6B99, 0xB971DD27, 0xE14FB6BE, 0x88AD17F0, 0x20AC66C9, 0xCE3AB47D,
698
+ 0xDF4A1863, 0x1A3182E5, 0x51336097, 0x537F4562, 0x6477E0B1, 0x6BAE84BB, 0x81A01CFE, 0x082B94F9,
699
+ 0x48685870, 0x45FD198F, 0xDE6C8794, 0x7BF8B752, 0x73D323AB, 0x4B02E272, 0x1F8F57E3, 0x55AB2A66,
700
+ 0xEB2807B2, 0xB5C2032F, 0xC57B9A86, 0x3708A5D3, 0x2887F230, 0xBFA5B223, 0x036ABA02, 0x16825CED,
701
+ 0xCF1C2B8A, 0x79B492A7, 0x07F2F0F3, 0x69E2A14E, 0xDAF4CD65, 0x05BED506, 0x34621FD1, 0xA6FE8AC4,
702
+ 0x2E539D34, 0xF355A0A2, 0x8AE13205, 0xF6EB75A4, 0x83EC390B, 0x60EFAA40, 0x719F065E, 0x6E1051BD,
703
+ 0x218AF93E, 0xDD063D96, 0x3E05AEDD, 0xE6BD464D, 0x548DB591, 0xC45D0571, 0x06D46F04, 0x5015FF60,
704
+ 0x98FB2419, 0xBDE997D6, 0x4043CC89, 0xD99E7767, 0xE842BDB0, 0x898B8807, 0x195B38E7, 0xC8EEDB79,
705
+ 0x7C0A47A1, 0x420FE97C, 0x841EC9F8, 0x00000000, 0x80868309, 0x2BED4832, 0x1170AC1E, 0x5A724E6C,
706
+ 0x0EFFFBFD, 0x8538560F, 0xAED51E3D, 0x2D392736, 0x0FD9640A, 0x5CA62168, 0x5B54D19B, 0x362E3A24,
707
+ 0x0A67B10C, 0x57E70F93, 0xEE96D2B4, 0x9B919E1B, 0xC0C54F80, 0xDC20A261, 0x774B695A, 0x121A161C,
708
+ 0x93BA0AE2, 0xA02AE5C0, 0x22E0433C, 0x1B171D12, 0x090D0B0E, 0x8BC7ADF2, 0xB6A8B92D, 0x1EA9C814,
709
+ 0xF1198557, 0x75074CAF, 0x99DDBBEE, 0x7F60FDA3, 0x01269FF7, 0x72F5BC5C, 0x663BC544, 0xFB7E345B,
710
+ 0x4329768B, 0x23C6DCCB, 0xEDFC68B6, 0xE4F163B8, 0x31DCCAD7, 0x63851042, 0x97224013, 0xC6112084,
711
+ 0x4A247D85, 0xBB3DF8D2, 0xF93211AE, 0x29A16DC7, 0x9E2F4B1D, 0xB230F3DC, 0x8652EC0D, 0xC1E3D077,
712
+ 0xB3166C2B, 0x70B999A9, 0x9448FA11, 0xE9642247, 0xFC8CC4A8, 0xF03F1AA0, 0x7D2CD856, 0x3390EF22,
713
+ 0x494EC787, 0x38D1C1D9, 0xCAA2FE8C, 0xD40B3698, 0xF581CFA6, 0x7ADE28A5, 0xB78E26DA, 0xADBFA43F,
714
+ 0x3A9DE42C, 0x78920D50, 0x5FCC9B6A, 0x7E466254, 0x8D13C2F6, 0xD8B8E890, 0x39F75E2E, 0xC3AFF582,
715
+ 0x5D80BE9F, 0xD0937C69, 0xD52DA96F, 0x2512B3CF, 0xAC993BC8, 0x187DA710, 0x9C636EE8, 0x3BBB7BDB,
716
+ 0x267809CD, 0x5918F46E, 0x9AB701EC, 0x4F9AA883, 0x956E65E6, 0xFFE67EAA, 0xBCCF0821, 0x15E8E6EF,
717
+ 0xE79BD9BA, 0x6F36CE4A, 0x9F09D4EA, 0xB07CD629, 0xA4B2AF31, 0x3F23312A, 0xA59430C6, 0xA266C035,
718
+ 0x4EBC3774, 0x82CAA6FC, 0x90D0B0E0, 0xA7D81533, 0x04984AF1, 0xECDAF741, 0xCD500E7F, 0x91F62F17,
719
+ 0x4DD68D76, 0xEFB04D43, 0xAA4D54CC, 0x9604DFE4, 0xD1B5E39E, 0x6A881B4C, 0x2C1FB8C1, 0x65517F46,
720
+ 0x5EEA049D, 0x8C355D01, 0x877473FA, 0x0B412EFB, 0x671D5AB3, 0xDBD25292, 0x105633E9, 0xD647136D,
721
+ 0xD7618C9A, 0xA10C7A37, 0xF8148E59, 0x133C89EB, 0xA927EECE, 0x61C935B7, 0x1CE5EDE1, 0x47B13C7A,
722
+ 0xD2DF599C, 0xF2733F55, 0x14CE7918, 0xC737BF73, 0xF7CDEA53, 0xFDAA5B5F, 0x3D6F14DF, 0x44DB8678,
723
+ 0xAFF381CA, 0x68C43EB9, 0x24342C38, 0xA3405FC2, 0x1DC37216, 0xE2250CBC, 0x3C498B28, 0x0D9541FF,
724
+ 0xA8017139, 0x0CB3DE08, 0xB4E49CD8, 0x56C19064, 0xCB84617B, 0x32B670D5, 0x6C5C7448, 0xB85742D0
725
+ ));
726
+
727
+ foreach ($dt3 as $dt3i) {
728
+ $dt0[] = (($dt3i << 24) & 0xFF000000) | (($dt3i >> 8) & 0x00FFFFFF);
729
+ $dt1[] = (($dt3i << 16) & 0xFFFF0000) | (($dt3i >> 16) & 0x0000FFFF);
730
+ $dt2[] = (($dt3i << 8) & 0xFFFFFF00) | (($dt3i >> 24) & 0x000000FF);
731
+ };
732
+
733
+ $tables = array(
734
+ // The Precomputed inverse mixColumns tables dt0 - dt3
735
+ $dt0,
736
+ $dt1,
737
+ $dt2,
738
+ $dt3,
739
+ // The inverse SubByte S-Box
740
+ array(
741
+ 0x52, 0x09, 0x6A, 0xD5, 0x30, 0x36, 0xA5, 0x38, 0xBF, 0x40, 0xA3, 0x9E, 0x81, 0xF3, 0xD7, 0xFB,
742
+ 0x7C, 0xE3, 0x39, 0x82, 0x9B, 0x2F, 0xFF, 0x87, 0x34, 0x8E, 0x43, 0x44, 0xC4, 0xDE, 0xE9, 0xCB,
743
+ 0x54, 0x7B, 0x94, 0x32, 0xA6, 0xC2, 0x23, 0x3D, 0xEE, 0x4C, 0x95, 0x0B, 0x42, 0xFA, 0xC3, 0x4E,
744
+ 0x08, 0x2E, 0xA1, 0x66, 0x28, 0xD9, 0x24, 0xB2, 0x76, 0x5B, 0xA2, 0x49, 0x6D, 0x8B, 0xD1, 0x25,
745
+ 0x72, 0xF8, 0xF6, 0x64, 0x86, 0x68, 0x98, 0x16, 0xD4, 0xA4, 0x5C, 0xCC, 0x5D, 0x65, 0xB6, 0x92,
746
+ 0x6C, 0x70, 0x48, 0x50, 0xFD, 0xED, 0xB9, 0xDA, 0x5E, 0x15, 0x46, 0x57, 0xA7, 0x8D, 0x9D, 0x84,
747
+ 0x90, 0xD8, 0xAB, 0x00, 0x8C, 0xBC, 0xD3, 0x0A, 0xF7, 0xE4, 0x58, 0x05, 0xB8, 0xB3, 0x45, 0x06,
748
+ 0xD0, 0x2C, 0x1E, 0x8F, 0xCA, 0x3F, 0x0F, 0x02, 0xC1, 0xAF, 0xBD, 0x03, 0x01, 0x13, 0x8A, 0x6B,
749
+ 0x3A, 0x91, 0x11, 0x41, 0x4F, 0x67, 0xDC, 0xEA, 0x97, 0xF2, 0xCF, 0xCE, 0xF0, 0xB4, 0xE6, 0x73,
750
+ 0x96, 0xAC, 0x74, 0x22, 0xE7, 0xAD, 0x35, 0x85, 0xE2, 0xF9, 0x37, 0xE8, 0x1C, 0x75, 0xDF, 0x6E,
751
+ 0x47, 0xF1, 0x1A, 0x71, 0x1D, 0x29, 0xC5, 0x89, 0x6F, 0xB7, 0x62, 0x0E, 0xAA, 0x18, 0xBE, 0x1B,
752
+ 0xFC, 0x56, 0x3E, 0x4B, 0xC6, 0xD2, 0x79, 0x20, 0x9A, 0xDB, 0xC0, 0xFE, 0x78, 0xCD, 0x5A, 0xF4,
753
+ 0x1F, 0xDD, 0xA8, 0x33, 0x88, 0x07, 0xC7, 0x31, 0xB1, 0x12, 0x10, 0x59, 0x27, 0x80, 0xEC, 0x5F,
754
+ 0x60, 0x51, 0x7F, 0xA9, 0x19, 0xB5, 0x4A, 0x0D, 0x2D, 0xE5, 0x7A, 0x9F, 0x93, 0xC9, 0x9C, 0xEF,
755
+ 0xA0, 0xE0, 0x3B, 0x4D, 0xAE, 0x2A, 0xF5, 0xB0, 0xC8, 0xEB, 0xBB, 0x3C, 0x83, 0x53, 0x99, 0x61,
756
+ 0x17, 0x2B, 0x04, 0x7E, 0xBA, 0x77, 0xD6, 0x26, 0xE1, 0x69, 0x14, 0x63, 0x55, 0x21, 0x0C, 0x7D
757
+ )
758
+ );
759
+ }
760
+ return $tables;
761
+ }
762
+
763
+ /**
764
+ * Setup the performance-optimized function for de/encrypt()
765
+ *
766
+ * @see \phpseclib\Crypt\Base::_setupInlineCrypt()
767
+ * @access private
768
+ */
769
+ function _setupInlineCrypt()
770
+ {
771
+ // Note: _setupInlineCrypt() will be called only if $this->changed === true
772
+ // So here we are'nt under the same heavy timing-stress as we are in _de/encryptBlock() or de/encrypt().
773
+ // However...the here generated function- $code, stored as php callback in $this->inline_crypt, must work as fast as even possible.
774
+
775
+ $lambda_functions =& self::_getLambdaFunctions();
776
+
777
+ // We create max. 10 hi-optimized code for memory reason. Means: For each $key one ultra fast inline-crypt function.
778
+ // (Currently, for Crypt_Rijndael/AES, one generated $lambda_function cost on php5.5@32bit ~80kb unfreeable mem and ~130kb on php5.5@64bit)
779
+ // After that, we'll still create very fast optimized code but not the hi-ultimative code, for each $mode one.
780
+ $gen_hi_opt_code = (bool)(count($lambda_functions) < 10);
781
+
782
+ // Generation of a uniqe hash for our generated code
783
+ $code_hash = "Crypt_Rijndael, {$this->mode}, {$this->Nr}, {$this->Nb}";
784
+ if ($gen_hi_opt_code) {
785
+ $code_hash = str_pad($code_hash, 32) . $this->_hashInlineCryptFunction($this->key);
786
+ }
787
+
788
+ if (!isset($lambda_functions[$code_hash])) {
789
+ switch (true) {
790
+ case $gen_hi_opt_code:
791
+ // The hi-optimized $lambda_functions will use the key-words hardcoded for better performance.
792
+ $w = $this->w;
793
+ $dw = $this->dw;
794
+ $init_encrypt = '';
795
+ $init_decrypt = '';
796
+ break;
797
+ default:
798
+ for ($i = 0, $cw = count($this->w); $i < $cw; ++$i) {
799
+ $w[] = '$w[' . $i . ']';
800
+ $dw[] = '$dw[' . $i . ']';
801
+ }
802
+ $init_encrypt = '$w = $self->w;';
803
+ $init_decrypt = '$dw = $self->dw;';
804
+ }
805
+
806
+ $Nr = $this->Nr;
807
+ $Nb = $this->Nb;
808
+ $c = $this->c;
809
+
810
+ // Generating encrypt code:
811
+ $init_encrypt.= '
812
+ static $tables;
813
+ if (empty($tables)) {
814
+ $tables = &$self->_getTables();
815
+ }
816
+ $t0 = $tables[0];
817
+ $t1 = $tables[1];
818
+ $t2 = $tables[2];
819
+ $t3 = $tables[3];
820
+ $sbox = $tables[4];
821
+ ';
822
+
823
+ $s = 'e';
824
+ $e = 's';
825
+ $wc = $Nb - 1;
826
+
827
+ // Preround: addRoundKey
828
+ $encrypt_block = '$in = unpack("N*", $in);'."\n";
829
+ for ($i = 0; $i < $Nb; ++$i) {
830
+ $encrypt_block .= '$s'.$i.' = $in['.($i + 1).'] ^ '.$w[++$wc].";\n";
831
+ }
832
+
833
+ // Mainrounds: shiftRows + subWord + mixColumns + addRoundKey
834
+ for ($round = 1; $round < $Nr; ++$round) {
835
+ list($s, $e) = array($e, $s);
836
+ for ($i = 0; $i < $Nb; ++$i) {
837
+ $encrypt_block.=
838
+ '$'.$e.$i.' =
839
+ $t0[($'.$s.$i .' >> 24) & 0xff] ^
840
+ $t1[($'.$s.(($i + $c[1]) % $Nb).' >> 16) & 0xff] ^
841
+ $t2[($'.$s.(($i + $c[2]) % $Nb).' >> 8) & 0xff] ^
842
+ $t3[ $'.$s.(($i + $c[3]) % $Nb).' & 0xff] ^
843
+ '.$w[++$wc].";\n";
844
+ }
845
+ }
846
+
847
+ // Finalround: subWord + shiftRows + addRoundKey
848
+ for ($i = 0; $i < $Nb; ++$i) {
849
+ $encrypt_block.=
850
+ '$'.$e.$i.' =
851
+ $sbox[ $'.$e.$i.' & 0xff] |
852
+ ($sbox[($'.$e.$i.' >> 8) & 0xff] << 8) |
853
+ ($sbox[($'.$e.$i.' >> 16) & 0xff] << 16) |
854
+ ($sbox[($'.$e.$i.' >> 24) & 0xff] << 24);'."\n";
855
+ }
856
+ $encrypt_block .= '$in = pack("N*"'."\n";
857
+ for ($i = 0; $i < $Nb; ++$i) {
858
+ $encrypt_block.= ',
859
+ ($'.$e.$i .' & '.((int)0xFF000000).') ^
860
+ ($'.$e.(($i + $c[1]) % $Nb).' & 0x00FF0000 ) ^
861
+ ($'.$e.(($i + $c[2]) % $Nb).' & 0x0000FF00 ) ^
862
+ ($'.$e.(($i + $c[3]) % $Nb).' & 0x000000FF ) ^
863
+ '.$w[$i]."\n";
864
+ }
865
+ $encrypt_block .= ');';
866
+
867
+ // Generating decrypt code:
868
+ $init_decrypt.= '
869
+ static $invtables;
870
+ if (empty($invtables)) {
871
+ $invtables = &$self->_getInvTables();
872
+ }
873
+ $dt0 = $invtables[0];
874
+ $dt1 = $invtables[1];
875
+ $dt2 = $invtables[2];
876
+ $dt3 = $invtables[3];
877
+ $isbox = $invtables[4];
878
+ ';
879
+
880
+ $s = 'e';
881
+ $e = 's';
882
+ $wc = $Nb - 1;
883
+
884
+ // Preround: addRoundKey
885
+ $decrypt_block = '$in = unpack("N*", $in);'."\n";
886
+ for ($i = 0; $i < $Nb; ++$i) {
887
+ $decrypt_block .= '$s'.$i.' = $in['.($i + 1).'] ^ '.$dw[++$wc].';'."\n";
888
+ }
889
+
890
+ // Mainrounds: shiftRows + subWord + mixColumns + addRoundKey
891
+ for ($round = 1; $round < $Nr; ++$round) {
892
+ list($s, $e) = array($e, $s);
893
+ for ($i = 0; $i < $Nb; ++$i) {
894
+ $decrypt_block.=
895
+ '$'.$e.$i.' =
896
+ $dt0[($'.$s.$i .' >> 24) & 0xff] ^
897
+ $dt1[($'.$s.(($Nb + $i - $c[1]) % $Nb).' >> 16) & 0xff] ^
898
+ $dt2[($'.$s.(($Nb + $i - $c[2]) % $Nb).' >> 8) & 0xff] ^
899
+ $dt3[ $'.$s.(($Nb + $i - $c[3]) % $Nb).' & 0xff] ^
900
+ '.$dw[++$wc].";\n";
901
+ }
902
+ }
903
+
904
+ // Finalround: subWord + shiftRows + addRoundKey
905
+ for ($i = 0; $i < $Nb; ++$i) {
906
+ $decrypt_block.=
907
+ '$'.$e.$i.' =
908
+ $isbox[ $'.$e.$i.' & 0xff] |
909
+ ($isbox[($'.$e.$i.' >> 8) & 0xff] << 8) |
910
+ ($isbox[($'.$e.$i.' >> 16) & 0xff] << 16) |
911
+ ($isbox[($'.$e.$i.' >> 24) & 0xff] << 24);'."\n";
912
+ }
913
+ $decrypt_block .= '$in = pack("N*"'."\n";
914
+ for ($i = 0; $i < $Nb; ++$i) {
915
+ $decrypt_block.= ',
916
+ ($'.$e.$i. ' & '.((int)0xFF000000).') ^
917
+ ($'.$e.(($Nb + $i - $c[1]) % $Nb).' & 0x00FF0000 ) ^
918
+ ($'.$e.(($Nb + $i - $c[2]) % $Nb).' & 0x0000FF00 ) ^
919
+ ($'.$e.(($Nb + $i - $c[3]) % $Nb).' & 0x000000FF ) ^
920
+ '.$dw[$i]."\n";
921
+ }
922
+ $decrypt_block .= ');';
923
+
924
+ $lambda_functions[$code_hash] = $this->_createInlineCryptFunction(
925
+ array(
926
+ 'init_crypt' => '',
927
+ 'init_encrypt' => $init_encrypt,
928
+ 'init_decrypt' => $init_decrypt,
929
+ 'encrypt_block' => $encrypt_block,
930
+ 'decrypt_block' => $decrypt_block
931
+ )
932
+ );
933
+ }
934
+ $this->inline_crypt = $lambda_functions[$code_hash];
935
+ }
936
+ }
vendor/phpseclib/phpseclib/phpseclib/bootstrap.php CHANGED
@@ -1,16 +1,16 @@
1
- <?php
2
- /**
3
- * Bootstrapping File for phpseclib
4
- *
5
- * @license http://www.opensource.org/licenses/mit-license.html MIT License
6
- */
7
-
8
- if (extension_loaded('mbstring')) {
9
- // 2 - MB_OVERLOAD_STRING
10
- if (ini_get('mbstring.func_overload') & 2) {
11
- throw new \UnexpectedValueException(
12
- 'Overloading of string functions using mbstring.func_overload ' .
13
- 'is not supported by phpseclib.'
14
- );
15
- }
16
- }
1
+ <?php
2
+ /**
3
+ * Bootstrapping File for phpseclib
4
+ *
5
+ * @license http://www.opensource.org/licenses/mit-license.html MIT License
6
+ */
7
+
8
+ if (extension_loaded('mbstring')) {
9
+ // 2 - MB_OVERLOAD_STRING
10
+ if (ini_get('mbstring.func_overload') & 2) {
11
+ throw new \UnexpectedValueException(
12
+ 'Overloading of string functions using mbstring.func_overload ' .
13
+ 'is not supported by phpseclib.'
14
+ );
15
+ }
16
+ }
vendor/phpseclib/phpseclib/phpseclib/openssl.cnf CHANGED
@@ -1,6 +1,6 @@
1
- # minimalist openssl.cnf file for use with phpseclib
2
-
3
- HOME = .
4
- RANDFILE = $ENV::HOME/.rnd
5
-
6
- [ v3_ca ]
1
+ # minimalist openssl.cnf file for use with phpseclib
2
+
3
+ HOME = .
4
+ RANDFILE = $ENV::HOME/.rnd
5
+
6
+ [ v3_ca ]
vendor/phpseclib/phpseclib/travis/code_coverage_id_rsa DELETED
@@ -1,30 +0,0 @@
1
- -----BEGIN RSA PRIVATE KEY-----
2
- Proc-Type: 4,ENCRYPTED
3
- DEK-Info: AES-128-CBC,2F15FCF0B21FCFB5A37D709322F9B9EB
4
-
5
- JpGgJqRnr0+3mHQoeYXXUzSWeA1wGwMzm6KOPnQLEmA9ztPlBQulzZRh6QJckCwy
6
- TC7BMo+XRnYVXF3e0rjji0k7cfEk5Gs8saNcxxOa0u0SUOCXelGnZeqzwiT0a6Fe
7
- qAc7NLgTEo9zul9s+MHsplkVk71Oke+1dL7kksMRT0TdXIaqSvk/+nyAeLzAot04
8
- wo61T3+Y7/v/8oVxlCbxI5YfYZkm/4jTy7AfbXZBvC0R+F0ZYvIDRCuBe6h6XvcH
9
- AiYtw5+Qek6FwIa2CFVxsefvsEnZQYaiJpEFAq2xVHlTjQHHYrfd5cgu1koUNsAt
10
- nX1zpsK7tIregXFa07KfDaBBPxfEBqVJQInzj0Rc8HUt0AZ+MrPldrZ28+YQ4RXk
11
- /qk5UyKkdHMSKBb4va3mxcpDq1As9HREfeUeOjjduRh1LnNQCJaOhydXBqCFvhFy
12
- +Q9utDXP6q4OUxeDHCPGQ7K1I7erwiwuTeSXB3BEDZyZywHXABvJpsidkDlD/aNo
13
- QmM19V8y0IAxEAZvc8N0MIOO8hmd8R9U1RK4S24o9M8mgRrmuXjViJjZd5E3h6tX
14
- Mgxm8dpOiT77i+NsJwyp2A+MhkAHg2ruwlCIrSCC81zvdphVTfuc/vx3JpXYvhTP
15
- Xf9R8ppGnDUFauroN7E7odJKDhLVuAbmU1lWwue2iaNEKZ3L/o9dpRz4Td4NzzSf
16
- HKvKbJR35FCsqZq2krmNVd6ynF5PzWfYmz850yn/qdU8zwnW0fV+iHKS2oXuH9X1
17
- ZW02/MDdCylpRftNJMntR4Yxim7WEZ5Dif9ZLj8IGRQdWbbIn0WjtiVrFrcUbIfk
18
- TCP/3GeEcUa/XbE9hO9APw+7rO3sOehGJ84n4tXxFTFSnOJ5ZxTKpLvxRrmC8DaD
19
- cvqy8bbjPfn1EjZmRpCjanLZ1UJbLitFfpUT55aTrcozS4FMHmFm74X2xZGeBhxC
20
- CpWQe/agxhWxG+ZXdxt9ExI78ftQCQoGE0Si1KZXH5KQ/xiGmebY9wbtEHWG+q25
21
- sKqvjQHQsE3NZq7kne3mnyvjzMDDFYPLDlQLgcKInNrLZ3GszyemtzqcVf3YVur4
22
- N+nN0gu6LCx0vtw3yNRqjjmGN1V6sKMCqmIAtFDh9zRTlDTs7ZUBGPgakmmJLLVM
23
- ESme0JrRxCP+eEU8JNti9pKlKPGOFVpu4shLjmnmKuDpOytFNpcB/NylkGwZCxvE
24
- 1KI+EQMZOE5VROAfkvwBLE0SsVxMq7H87zSEOtOqr+QN8RoY1V6N/woBVWda9GFk
25
- HI44PM2ZywQbLGthaQV/Kxwf9YZruJdunNoTfEufZgv2Vp+3VAs+gCTGIsbblTnH
26
- J8QGfs/lHRBqK1pMZrYy0ubFqifA+b9Xa6VJWToCgcQuWbOVWn1zKQTTXZPksVbB
27
- qyE8BJkQCDGgoeq4kdxm0XUR5p3UZWQv0HoykQt33U06TCzU9HOcp0z+Glhrzsvd
28
- rbNBhRK0zXF/BFSNBHwKEg02TNlj7gSFJXmvZqvyCAFo5D6nSDbzqm6ARuscsrF0
29
- 6Zd3toOZTWmrVsKvTlsNPfHXyoGqP3+0NXcTY+kKXG58u4TbEtw8pVyPikuVdh/m
30
- -----END RSA PRIVATE KEY-----
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
wp_mail_smtp.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  /**
3
  * Plugin Name: WP Mail SMTP
4
- * Version: 1.8.0
5
  * Plugin URI: https://wpmailsmtp.com/
6
  * Description: Reconfigures the <code>wp_mail()</code> function to use Gmail/Mailgun/SendGrid/SMTP instead of the default <code>mail()</code> and creates an options page to manage the settings.
7
  * Author: WPForms
@@ -143,7 +143,7 @@ if ( ! function_exists( 'wp_mail_smtp_check_pro_loading_allowed' ) ) {
143
  }
144
 
145
  if ( ! defined( 'WPMS_PLUGIN_VER' ) ) {
146
- define( 'WPMS_PLUGIN_VER', '1.8.0' );
147
  }
148
  if ( ! defined( 'WPMS_PHP_VER' ) ) {
149
  define( 'WPMS_PHP_VER', '5.3.6' );
1
  <?php
2
  /**
3
  * Plugin Name: WP Mail SMTP
4
+ * Version: 1.8.1
5
  * Plugin URI: https://wpmailsmtp.com/
6
  * Description: Reconfigures the <code>wp_mail()</code> function to use Gmail/Mailgun/SendGrid/SMTP instead of the default <code>mail()</code> and creates an options page to manage the settings.
7
  * Author: WPForms
143
  }
144
 
145
  if ( ! defined( 'WPMS_PLUGIN_VER' ) ) {
146
+ define( 'WPMS_PLUGIN_VER', '1.8.1' );
147
  }
148
  if ( ! defined( 'WPMS_PHP_VER' ) ) {
149
  define( 'WPMS_PHP_VER', '5.3.6' );