JWT Authentication for WP REST API - Version 1.3.0

Version Description

  • Update firebase/php-jwt to 6.3
  • Fix warning, register_rest_route was called incorrectly
  • Allow for Basic Auth, by not attempting to validate Authentication Headers if a valid user has already been determined (see: https://github.com/Tmeister/wp-api-jwt-auth/issues/241)
  • Added a new filter (jwt_auth_algorithm) to allow for customizing the algorithm used for signing the token
  • Props: https://github.com/bradmkjr
Download this release

Release Info

Developer Tmeister
Plugin Icon JWT Authentication for WP REST API
Version 1.3.0
Comparing to
See all releases

Code changes from version 1.2.6 to 1.3.0

Files changed (136) hide show
  1. README.md +16 -10
  2. composer.json +25 -9
  3. composer.lock +161 -1536
  4. includes/vendor/autoload.php +5 -0
  5. includes/vendor/composer/ClassLoader.php +146 -19
  6. includes/vendor/composer/InstalledVersions.php +352 -0
  7. includes/vendor/composer/autoload_classmap.php +2 -1
  8. includes/vendor/composer/autoload_namespaces.php +1 -1
  9. includes/vendor/composer/autoload_psr4.php +2 -1
  10. includes/vendor/composer/autoload_real.php +8 -22
  11. includes/vendor/composer/autoload_static.php +13 -0
  12. includes/vendor/composer/installed.json +224 -49
  13. includes/vendor/composer/installed.php +53 -0
  14. includes/vendor/composer/installers/.github/workflows/continuous-integration.yml +76 -0
  15. includes/vendor/composer/installers/.github/workflows/lint.yml +30 -0
  16. includes/vendor/composer/installers/.github/workflows/phpstan.yml +51 -0
  17. includes/vendor/composer/installers/LICENSE +19 -0
  18. includes/vendor/composer/installers/composer.json +122 -0
  19. includes/vendor/composer/installers/phpstan.neon.dist +10 -0
  20. includes/vendor/composer/installers/src/Composer/Installers/AglInstaller.php +21 -0
  21. includes/vendor/composer/installers/src/Composer/Installers/AimeosInstaller.php +9 -0
  22. includes/vendor/composer/installers/src/Composer/Installers/AnnotateCmsInstaller.php +11 -0
  23. includes/vendor/composer/installers/src/Composer/Installers/AsgardInstaller.php +49 -0
  24. includes/vendor/composer/installers/src/Composer/Installers/AttogramInstaller.php +9 -0
  25. includes/vendor/composer/installers/src/Composer/Installers/BaseInstaller.php +137 -0
  26. includes/vendor/composer/installers/src/Composer/Installers/BitrixInstaller.php +126 -0
  27. includes/vendor/composer/installers/src/Composer/Installers/BonefishInstaller.php +9 -0
  28. includes/vendor/composer/installers/src/Composer/Installers/CakePHPInstaller.php +66 -0
  29. includes/vendor/composer/installers/src/Composer/Installers/ChefInstaller.php +11 -0
  30. includes/vendor/composer/installers/src/Composer/Installers/CiviCrmInstaller.php +9 -0
  31. includes/vendor/composer/installers/src/Composer/Installers/ClanCatsFrameworkInstaller.php +10 -0
  32. includes/vendor/composer/installers/src/Composer/Installers/CockpitInstaller.php +32 -0
  33. includes/vendor/composer/installers/src/Composer/Installers/CodeIgniterInstaller.php +11 -0
  34. includes/vendor/composer/installers/src/Composer/Installers/Concrete5Installer.php +13 -0
  35. includes/vendor/composer/installers/src/Composer/Installers/CraftInstaller.php +35 -0
  36. includes/vendor/composer/installers/src/Composer/Installers/CroogoInstaller.php +21 -0
  37. includes/vendor/composer/installers/src/Composer/Installers/DecibelInstaller.php +10 -0
  38. includes/vendor/composer/installers/src/Composer/Installers/DframeInstaller.php +10 -0
  39. includes/vendor/composer/installers/src/Composer/Installers/DokuWikiInstaller.php +50 -0
  40. includes/vendor/composer/installers/src/Composer/Installers/DolibarrInstaller.php +16 -0
  41. includes/vendor/composer/installers/src/Composer/Installers/DrupalInstaller.php +22 -0
  42. includes/vendor/composer/installers/src/Composer/Installers/ElggInstaller.php +9 -0
  43. includes/vendor/composer/installers/src/Composer/Installers/EliasisInstaller.php +12 -0
  44. includes/vendor/composer/installers/src/Composer/Installers/ExpressionEngineInstaller.php +29 -0
  45. includes/vendor/composer/installers/src/Composer/Installers/EzPlatformInstaller.php +10 -0
  46. includes/vendor/composer/installers/src/Composer/Installers/FuelInstaller.php +11 -0
  47. includes/vendor/composer/installers/src/Composer/Installers/FuelphpInstaller.php +9 -0
  48. includes/vendor/composer/installers/src/Composer/Installers/GravInstaller.php +30 -0
  49. includes/vendor/composer/installers/src/Composer/Installers/HuradInstaller.php +25 -0
  50. includes/vendor/composer/installers/src/Composer/Installers/ImageCMSInstaller.php +11 -0
  51. includes/vendor/composer/installers/src/Composer/Installers/Installer.php +298 -0
  52. includes/vendor/composer/installers/src/Composer/Installers/ItopInstaller.php +9 -0
  53. includes/vendor/composer/installers/src/Composer/Installers/JoomlaInstaller.php +15 -0
  54. includes/vendor/composer/installers/src/Composer/Installers/KanboardInstaller.php +18 -0
  55. includes/vendor/composer/installers/src/Composer/Installers/KirbyInstaller.php +11 -0
  56. includes/vendor/composer/installers/src/Composer/Installers/KnownInstaller.php +11 -0
  57. includes/vendor/composer/installers/src/Composer/Installers/KodiCMSInstaller.php +10 -0
  58. includes/vendor/composer/installers/src/Composer/Installers/KohanaInstaller.php +9 -0
  59. includes/vendor/composer/installers/src/Composer/Installers/LanManagementSystemInstaller.php +27 -0
  60. includes/vendor/composer/installers/src/Composer/Installers/LaravelInstaller.php +9 -0
  61. includes/vendor/composer/installers/src/Composer/Installers/LavaLiteInstaller.php +10 -0
  62. includes/vendor/composer/installers/src/Composer/Installers/LithiumInstaller.php +10 -0
  63. includes/vendor/composer/installers/src/Composer/Installers/MODULEWorkInstaller.php +9 -0
  64. includes/vendor/composer/installers/src/Composer/Installers/MODXEvoInstaller.php +16 -0
  65. includes/vendor/composer/installers/src/Composer/Installers/MagentoInstaller.php +11 -0
  66. includes/vendor/composer/installers/src/Composer/Installers/MajimaInstaller.php +37 -0
  67. includes/vendor/composer/installers/src/Composer/Installers/MakoInstaller.php +9 -0
  68. includes/vendor/composer/installers/src/Composer/Installers/MantisBTInstaller.php +23 -0
  69. includes/vendor/composer/installers/src/Composer/Installers/MauticInstaller.php +48 -0
  70. includes/vendor/composer/installers/src/Composer/Installers/MayaInstaller.php +33 -0
  71. includes/vendor/composer/installers/src/Composer/Installers/MediaWikiInstaller.php +51 -0
  72. includes/vendor/composer/installers/src/Composer/Installers/MiaoxingInstaller.php +10 -0
  73. includes/vendor/composer/installers/src/Composer/Installers/MicroweberInstaller.php +119 -0
  74. includes/vendor/composer/installers/src/Composer/Installers/ModxInstaller.php +12 -0
  75. includes/vendor/composer/installers/src/Composer/Installers/MoodleInstaller.php +59 -0
  76. includes/vendor/composer/installers/src/Composer/Installers/OctoberInstaller.php +48 -0
  77. includes/vendor/composer/installers/src/Composer/Installers/OntoWikiInstaller.php +24 -0
  78. includes/vendor/composer/installers/src/Composer/Installers/OsclassInstaller.php +14 -0
  79. includes/vendor/composer/installers/src/Composer/Installers/OxidInstaller.php +59 -0
  80. includes/vendor/composer/installers/src/Composer/Installers/PPIInstaller.php +9 -0
  81. includes/vendor/composer/installers/src/Composer/Installers/PantheonInstaller.php +12 -0
  82. includes/vendor/composer/installers/src/Composer/Installers/PhiftyInstaller.php +11 -0
  83. includes/vendor/composer/installers/src/Composer/Installers/PhpBBInstaller.php +11 -0
  84. includes/vendor/composer/installers/src/Composer/Installers/PimcoreInstaller.php +21 -0
  85. includes/vendor/composer/installers/src/Composer/Installers/PiwikInstaller.php +32 -0
  86. includes/vendor/composer/installers/src/Composer/Installers/PlentymarketsInstaller.php +29 -0
  87. includes/vendor/composer/installers/src/Composer/Installers/Plugin.php +27 -0
  88. includes/vendor/composer/installers/src/Composer/Installers/PortoInstaller.php +9 -0
  89. includes/vendor/composer/installers/src/Composer/Installers/PrestashopInstaller.php +10 -0
  90. includes/vendor/composer/installers/src/Composer/Installers/ProcessWireInstaller.php +22 -0
  91. includes/vendor/composer/installers/src/Composer/Installers/PuppetInstaller.php +11 -0
  92. includes/vendor/composer/installers/src/Composer/Installers/PxcmsInstaller.php +63 -0
  93. includes/vendor/composer/installers/src/Composer/Installers/RadPHPInstaller.php +24 -0
  94. includes/vendor/composer/installers/src/Composer/Installers/ReIndexInstaller.php +10 -0
  95. includes/vendor/composer/installers/src/Composer/Installers/Redaxo5Installer.php +10 -0
  96. includes/vendor/composer/installers/src/Composer/Installers/RedaxoInstaller.php +10 -0
  97. includes/vendor/composer/installers/src/Composer/Installers/RoundcubeInstaller.php +22 -0
  98. includes/vendor/composer/installers/src/Composer/Installers/SMFInstaller.php +10 -0
  99. includes/vendor/composer/installers/src/Composer/Installers/ShopwareInstaller.php +60 -0
  100. includes/vendor/composer/installers/src/Composer/Installers/SilverStripeInstaller.php +35 -0
  101. includes/vendor/composer/installers/src/Composer/Installers/SiteDirectInstaller.php +25 -0
  102. includes/vendor/composer/installers/src/Composer/Installers/StarbugInstaller.php +12 -0
  103. includes/vendor/composer/installers/src/Composer/Installers/SyDESInstaller.php +47 -0
  104. includes/vendor/composer/installers/src/Composer/Installers/SyliusInstaller.php +9 -0
  105. includes/vendor/composer/installers/src/Composer/Installers/Symfony1Installer.php +26 -0
  106. includes/vendor/composer/installers/src/Composer/Installers/TYPO3CmsInstaller.php +16 -0
  107. includes/vendor/composer/installers/src/Composer/Installers/TYPO3FlowInstaller.php +38 -0
  108. includes/vendor/composer/installers/src/Composer/Installers/TaoInstaller.php +30 -0
  109. includes/vendor/composer/installers/src/Composer/Installers/TastyIgniterInstaller.php +32 -0
  110. includes/vendor/composer/installers/src/Composer/Installers/TheliaInstaller.php +12 -0
  111. includes/vendor/composer/installers/src/Composer/Installers/TuskInstaller.php +14 -0
  112. includes/vendor/composer/installers/src/Composer/Installers/UserFrostingInstaller.php +9 -0
  113. includes/vendor/composer/installers/src/Composer/Installers/VanillaInstaller.php +10 -0
  114. includes/vendor/composer/installers/src/Composer/Installers/VgmcpInstaller.php +49 -0
  115. includes/vendor/composer/installers/src/Composer/Installers/WHMCSInstaller.php +21 -0
  116. includes/vendor/composer/installers/src/Composer/Installers/WinterInstaller.php +58 -0
  117. includes/vendor/composer/installers/src/Composer/Installers/WolfCMSInstaller.php +9 -0
  118. includes/vendor/composer/installers/src/Composer/Installers/WordPressInstaller.php +12 -0
  119. includes/vendor/composer/installers/src/Composer/Installers/YawikInstaller.php +32 -0
  120. includes/vendor/composer/installers/src/Composer/Installers/ZendInstaller.php +11 -0
  121. includes/vendor/composer/installers/src/Composer/Installers/ZikulaInstaller.php +10 -0
  122. includes/vendor/composer/installers/src/bootstrap.php +13 -0
  123. includes/vendor/composer/platform_check.php +26 -0
  124. includes/vendor/firebase/php-jwt/LICENSE +1 -1
  125. includes/vendor/firebase/php-jwt/README.md +194 -27
  126. includes/vendor/firebase/php-jwt/composer.json +14 -2
  127. includes/vendor/firebase/php-jwt/src/BeforeValidException.php +1 -1
  128. includes/vendor/firebase/php-jwt/src/CachedKeySet.php +229 -0
  129. includes/vendor/firebase/php-jwt/src/ExpiredException.php +1 -1
  130. includes/vendor/firebase/php-jwt/src/JWK.php +322 -0
  131. includes/vendor/firebase/php-jwt/src/JWT.php +387 -139
  132. includes/vendor/firebase/php-jwt/src/Key.php +64 -0
  133. includes/vendor/firebase/php-jwt/src/SignatureInvalidException.php +1 -1
  134. jwt-auth.php +2 -2
  135. public/class-jwt-auth-public.php +38 -25
  136. readme.txt +1 -1
README.md CHANGED
@@ -319,20 +319,26 @@ $data = array(
319
  );
320
  ```
321
 
322
- ## Testing
 
323
 
324
- Since version **1.1.0** I've added a new test suite to be sure that the basic features of this plugin do what it's expected.
325
-
326
- You can run this test using the following command
327
 
328
- ```
329
- composer install
330
- includes/vendor/bin/phpunit tests
331
- ```
 
 
 
332
 
333
- ![Command Line Output](https://s3.amazonaws.com/f.cl.ly/items/2o0j0a403A0N1a0r1C3H/Image%202016-02-27%20at%208.16.48%20PM.png?v=5fe1c76e)
334
 
335
- All the tests can be found at https://github.com/Tmeister/wp-api-jwt-auth/tree/develop/tests/GeneralTest.php
 
 
 
 
336
 
337
  ##Credits
338
  [WP REST API V2](http://v2.wp-api.org/)
319
  );
320
  ```
321
 
322
+ ### jwt_auth_algorithm
323
+ The **jwt_auth_algorithm** allows you to modify the signing algorithm.
324
 
325
+ Default value:
 
 
326
 
327
+ ```php
328
+ <?php
329
+ $token = JWT::encode(
330
+ apply_filters('jwt_auth_token_before_sign', $token, $user),
331
+ $secret_key,
332
+ apply_filters('jwt_auth_algorithm', 'HS256')
333
+ );
334
 
335
+ // ...
336
 
337
+ $token = JWT::decode(
338
+ $token,
339
+ new Key($secret_key, apply_filters('jwt_auth_algorithm', 'HS256'))
340
+ );
341
+ ```
342
 
343
  ##Credits
344
  [WP REST API V2](http://v2.wp-api.org/)
composer.json CHANGED
@@ -1,12 +1,28 @@
1
  {
2
- "config": {
3
- "vendor-dir": "includes/vendor"
4
- },
5
- "require": {
6
- "firebase/php-jwt": "^5.0.0"
7
- },
8
- "require-dev": {
9
- "phpunit/phpunit": "^5.2",
10
- "guzzlehttp/guzzle": "^6.1"
 
 
 
 
 
 
 
 
 
 
11
  }
 
 
 
 
 
 
12
  }
1
  {
2
+ "name": "tmeister/wp-api-jwt-auth",
3
+ "description": "A simple plugin to add JSON Web Token (JWT) Authentication to WP REST API.",
4
+ "homepage": "https://github.com/Tmeister/wp-api-jwt-auth/",
5
+ "type": "wordpress-plugin",
6
+ "license": "GPL-2.0+",
7
+ "authors": [
8
+ {
9
+ "name": "Enrique Chavez",
10
+ "homepage": "https://enriquechavez.co"
11
+ }
12
+ ],
13
+ "support": {
14
+ "issues": "https://github.com/Tmeister/wp-api-jwt-auth/issues",
15
+ "source": "https://github.com/Tmeister/wp-api-jwt-auth/"
16
+ },
17
+ "config": {
18
+ "vendor-dir": "includes/vendor",
19
+ "allow-plugins": {
20
+ "composer/installers": true
21
  }
22
+ },
23
+ "require": {
24
+ "php": ">=5.3",
25
+ "composer/installers": "~1.0",
26
+ "firebase/php-jwt": "^6.3"
27
+ }
28
  }
composer.lock CHANGED
@@ -1,92 +1,50 @@
1
  {
2
  "_readme": [
3
  "This file locks the dependencies of your project to a known state",
4
- "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
5
  "This file is @generated automatically"
6
  ],
7
- "content-hash": "975fa7e89f33924a53e61aef52eaa5e3",
8
  "packages": [
9
  {
10
- "name": "firebase/php-jwt",
11
- "version": "v5.0.0",
12
  "source": {
13
  "type": "git",
14
- "url": "https://github.com/firebase/php-jwt.git",
15
- "reference": "9984a4d3a32ae7673d6971ea00bae9d0a1abba0e"
16
  },
17
  "dist": {
18
  "type": "zip",
19
- "url": "https://api.github.com/repos/firebase/php-jwt/zipball/9984a4d3a32ae7673d6971ea00bae9d0a1abba0e",
20
- "reference": "9984a4d3a32ae7673d6971ea00bae9d0a1abba0e",
21
  "shasum": ""
22
  },
23
  "require": {
24
- "php": ">=5.3.0"
25
- },
26
- "require-dev": {
27
- "phpunit/phpunit": " 4.8.35"
28
- },
29
- "type": "library",
30
- "autoload": {
31
- "psr-4": {
32
- "Firebase\\JWT\\": "src"
33
- }
34
- },
35
- "notification-url": "https://packagist.org/downloads/",
36
- "license": [
37
- "BSD-3-Clause"
38
- ],
39
- "authors": [
40
- {
41
- "name": "Neuman Vong",
42
- "email": "neuman+pear@twilio.com",
43
- "role": "Developer"
44
- },
45
- {
46
- "name": "Anant Narayanan",
47
- "email": "anant@php.net",
48
- "role": "Developer"
49
- }
50
- ],
51
- "description": "A simple library to encode and decode JSON Web Tokens (JWT) in PHP. Should conform to the current spec.",
52
- "homepage": "https://github.com/firebase/php-jwt",
53
- "time": "2017-06-27T22:17:23+00:00"
54
- }
55
- ],
56
- "packages-dev": [
57
- {
58
- "name": "doctrine/instantiator",
59
- "version": "1.1.0",
60
- "source": {
61
- "type": "git",
62
- "url": "https://github.com/doctrine/instantiator.git",
63
- "reference": "185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda"
64
- },
65
- "dist": {
66
- "type": "zip",
67
- "url": "https://api.github.com/repos/doctrine/instantiator/zipball/185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda",
68
- "reference": "185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda",
69
- "shasum": ""
70
  },
71
- "require": {
72
- "php": "^7.1"
 
73
  },
74
  "require-dev": {
75
- "athletic/athletic": "~0.1.8",
76
- "ext-pdo": "*",
77
- "ext-phar": "*",
78
- "phpunit/phpunit": "^6.2.3",
79
- "squizlabs/php_codesniffer": "^3.0.2"
 
80
  },
81
- "type": "library",
82
  "extra": {
 
83
  "branch-alias": {
84
- "dev-master": "1.2.x-dev"
85
  }
86
  },
87
  "autoload": {
88
  "psr-4": {
89
- "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/"
90
  }
91
  },
92
  "notification-url": "https://packagist.org/downloads/",
@@ -95,1515 +53,182 @@
95
  ],
96
  "authors": [
97
  {
98
- "name": "Marco Pivetta",
99
- "email": "ocramius@gmail.com",
100
- "homepage": "http://ocramius.github.com/"
101
- }
102
- ],
103
- "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors",
104
- "homepage": "https://github.com/doctrine/instantiator",
105
- "keywords": [
106
- "constructor",
107
- "instantiate"
108
- ],
109
- "time": "2017-07-22T11:58:36+00:00"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
110
  },
111
  {
112
- "name": "guzzlehttp/guzzle",
113
- "version": "6.3.0",
114
  "source": {
115
  "type": "git",
116
- "url": "https://github.com/guzzle/guzzle.git",
117
- "reference": "f4db5a78a5ea468d4831de7f0bf9d9415e348699"
118
  },
119
  "dist": {
120
  "type": "zip",
121
- "url": "https://api.github.com/repos/guzzle/guzzle/zipball/f4db5a78a5ea468d4831de7f0bf9d9415e348699",
122
- "reference": "f4db5a78a5ea468d4831de7f0bf9d9415e348699",
123
  "shasum": ""
124
  },
125
  "require": {
126
- "guzzlehttp/promises": "^1.0",
127
- "guzzlehttp/psr7": "^1.4",
128
- "php": ">=5.5"
129
  },
130
  "require-dev": {
131
- "ext-curl": "*",
132
- "phpunit/phpunit": "^4.0 || ^5.0",
133
- "psr/log": "^1.0"
 
 
 
134
  },
135
  "suggest": {
136
- "psr/log": "Required for using the Log middleware"
137
- },
138
- "type": "library",
139
- "extra": {
140
- "branch-alias": {
141
- "dev-master": "6.2-dev"
142
- }
143
- },
144
- "autoload": {
145
- "files": [
146
- "src/functions_include.php"
147
- ],
148
- "psr-4": {
149
- "GuzzleHttp\\": "src/"
150
- }
151
- },
152
- "notification-url": "https://packagist.org/downloads/",
153
- "license": [
154
- "MIT"
155
- ],
156
- "authors": [
157
- {
158
- "name": "Michael Dowling",
159
- "email": "mtdowling@gmail.com",
160
- "homepage": "https://github.com/mtdowling"
161
- }
162
- ],
163
- "description": "Guzzle is a PHP HTTP client library",
164
- "homepage": "http://guzzlephp.org/",
165
- "keywords": [
166
- "client",
167
- "curl",
168
- "framework",
169
- "http",
170
- "http client",
171
- "rest",
172
- "web service"
173
- ],
174
- "time": "2017-06-22T18:50:49+00:00"
175
- },
176
- {
177
- "name": "guzzlehttp/promises",
178
- "version": "v1.3.1",
179
- "source": {
180
- "type": "git",
181
- "url": "https://github.com/guzzle/promises.git",
182
- "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646"
183
- },
184
- "dist": {
185
- "type": "zip",
186
- "url": "https://api.github.com/repos/guzzle/promises/zipball/a59da6cf61d80060647ff4d3eb2c03a2bc694646",
187
- "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646",
188
- "shasum": ""
189
- },
190
- "require": {
191
- "php": ">=5.5.0"
192
- },
193
- "require-dev": {
194
- "phpunit/phpunit": "^4.0"
195
  },
196
  "type": "library",
197
- "extra": {
198
- "branch-alias": {
199
- "dev-master": "1.4-dev"
200
- }
201
- },
202
  "autoload": {
203
  "psr-4": {
204
- "GuzzleHttp\\Promise\\": "src/"
205
- },
206
- "files": [
207
- "src/functions_include.php"
208
- ]
209
- },
210
- "notification-url": "https://packagist.org/downloads/",
211
- "license": [
212
- "MIT"
213
- ],
214
- "authors": [
215
- {
216
- "name": "Michael Dowling",
217
- "email": "mtdowling@gmail.com",
218
- "homepage": "https://github.com/mtdowling"
219
- }
220
- ],
221
- "description": "Guzzle promises library",
222
- "keywords": [
223
- "promise"
224
- ],
225
- "time": "2016-12-20T10:07:11+00:00"
226
- },
227
- {
228
- "name": "guzzlehttp/psr7",
229
- "version": "1.4.2",
230
- "source": {
231
- "type": "git",
232
- "url": "https://github.com/guzzle/psr7.git",
233
- "reference": "f5b8a8512e2b58b0071a7280e39f14f72e05d87c"
234
- },
235
- "dist": {
236
- "type": "zip",
237
- "url": "https://api.github.com/repos/guzzle/psr7/zipball/f5b8a8512e2b58b0071a7280e39f14f72e05d87c",
238
- "reference": "f5b8a8512e2b58b0071a7280e39f14f72e05d87c",
239
- "shasum": ""
240
- },
241
- "require": {
242
- "php": ">=5.4.0",
243
- "psr/http-message": "~1.0"
244
- },
245
- "provide": {
246
- "psr/http-message-implementation": "1.0"
247
- },
248
- "require-dev": {
249
- "phpunit/phpunit": "~4.0"
250
- },
251
- "type": "library",
252
- "extra": {
253
- "branch-alias": {
254
- "dev-master": "1.4-dev"
255
  }
256
  },
257
- "autoload": {
258
- "psr-4": {
259
- "GuzzleHttp\\Psr7\\": "src/"
260
- },
261
- "files": [
262
- "src/functions_include.php"
263
- ]
264
- },
265
  "notification-url": "https://packagist.org/downloads/",
266
  "license": [
267
- "MIT"
268
  ],
269
  "authors": [
270
  {
271
- "name": "Michael Dowling",
272
- "email": "mtdowling@gmail.com",
273
- "homepage": "https://github.com/mtdowling"
274
  },
275
  {
276
- "name": "Tobias Schultze",
277
- "homepage": "https://github.com/Tobion"
278
- }
279
- ],
280
- "description": "PSR-7 message implementation that also provides common utility methods",
281
- "keywords": [
282
- "http",
283
- "message",
284
- "request",
285
- "response",
286
- "stream",
287
- "uri",
288
- "url"
289
- ],
290
- "time": "2017-03-20T17:10:46+00:00"
291
- },
292
- {
293
- "name": "myclabs/deep-copy",
294
- "version": "1.6.1",
295
- "source": {
296
- "type": "git",
297
- "url": "https://github.com/myclabs/DeepCopy.git",
298
- "reference": "8e6e04167378abf1ddb4d3522d8755c5fd90d102"
299
- },
300
- "dist": {
301
- "type": "zip",
302
- "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/8e6e04167378abf1ddb4d3522d8755c5fd90d102",
303
- "reference": "8e6e04167378abf1ddb4d3522d8755c5fd90d102",
304
- "shasum": ""
305
- },
306
- "require": {
307
- "php": ">=5.4.0"
308
- },
309
- "require-dev": {
310
- "doctrine/collections": "1.*",
311
- "phpunit/phpunit": "~4.1"
312
- },
313
- "type": "library",
314
- "autoload": {
315
- "psr-4": {
316
- "DeepCopy\\": "src/DeepCopy/"
317
- }
318
- },
319
- "notification-url": "https://packagist.org/downloads/",
320
- "license": [
321
- "MIT"
322
- ],
323
- "description": "Create deep copies (clones) of your objects",
324
- "homepage": "https://github.com/myclabs/DeepCopy",
325
- "keywords": [
326
- "clone",
327
- "copy",
328
- "duplicate",
329
- "object",
330
- "object graph"
331
- ],
332
- "time": "2017-04-12T18:52:22+00:00"
333
- },
334
- {
335
- "name": "phpdocumentor/reflection-common",
336
- "version": "1.0",
337
- "source": {
338
- "type": "git",
339
- "url": "https://github.com/phpDocumentor/ReflectionCommon.git",
340
- "reference": "144c307535e82c8fdcaacbcfc1d6d8eeb896687c"
341
- },
342
- "dist": {
343
- "type": "zip",
344
- "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/144c307535e82c8fdcaacbcfc1d6d8eeb896687c",
345
- "reference": "144c307535e82c8fdcaacbcfc1d6d8eeb896687c",
346
- "shasum": ""
347
- },
348
- "require": {
349
- "php": ">=5.5"
350
- },
351
- "require-dev": {
352
- "phpunit/phpunit": "^4.6"
353
- },
354
- "type": "library",
355
- "extra": {
356
- "branch-alias": {
357
- "dev-master": "1.0.x-dev"
358
- }
359
- },
360
- "autoload": {
361
- "psr-4": {
362
- "phpDocumentor\\Reflection\\": [
363
- "src"
364
- ]
365
- }
366
- },
367
- "notification-url": "https://packagist.org/downloads/",
368
- "license": [
369
- "MIT"
370
- ],
371
- "authors": [
372
- {
373
- "name": "Jaap van Otterdijk",
374
- "email": "opensource@ijaap.nl"
375
  }
376
  ],
377
- "description": "Common reflection classes used by phpdocumentor to reflect the code structure",
378
- "homepage": "http://www.phpdoc.org",
379
  "keywords": [
380
- "FQSEN",
381
- "phpDocumentor",
382
- "phpdoc",
383
- "reflection",
384
- "static analysis"
385
- ],
386
- "time": "2015-12-27T11:43:31+00:00"
387
- },
388
- {
389
- "name": "phpdocumentor/reflection-docblock",
390
- "version": "4.1.1",
391
- "source": {
392
- "type": "git",
393
- "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git",
394
- "reference": "2d3d238c433cf69caeb4842e97a3223a116f94b2"
395
- },
396
- "dist": {
397
- "type": "zip",
398
- "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/2d3d238c433cf69caeb4842e97a3223a116f94b2",
399
- "reference": "2d3d238c433cf69caeb4842e97a3223a116f94b2",
400
- "shasum": ""
401
- },
402
- "require": {
403
- "php": "^7.0",
404
- "phpdocumentor/reflection-common": "^1.0@dev",
405
- "phpdocumentor/type-resolver": "^0.4.0",
406
- "webmozart/assert": "^1.0"
407
- },
408
- "require-dev": {
409
- "mockery/mockery": "^0.9.4",
410
- "phpunit/phpunit": "^4.4"
411
- },
412
- "type": "library",
413
- "autoload": {
414
- "psr-4": {
415
- "phpDocumentor\\Reflection\\": [
416
- "src/"
417
- ]
418
- }
419
- },
420
- "notification-url": "https://packagist.org/downloads/",
421
- "license": [
422
- "MIT"
423
- ],
424
- "authors": [
425
- {
426
- "name": "Mike van Riel",
427
- "email": "me@mikevanriel.com"
428
- }
429
- ],
430
- "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.",
431
- "time": "2017-08-30T18:51:59+00:00"
432
- },
433
- {
434
- "name": "phpdocumentor/type-resolver",
435
- "version": "0.4.0",
436
- "source": {
437
- "type": "git",
438
- "url": "https://github.com/phpDocumentor/TypeResolver.git",
439
- "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7"
440
- },
441
- "dist": {
442
- "type": "zip",
443
- "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/9c977708995954784726e25d0cd1dddf4e65b0f7",
444
- "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7",
445
- "shasum": ""
446
- },
447
- "require": {
448
- "php": "^5.5 || ^7.0",
449
- "phpdocumentor/reflection-common": "^1.0"
450
- },
451
- "require-dev": {
452
- "mockery/mockery": "^0.9.4",
453
- "phpunit/phpunit": "^5.2||^4.8.24"
454
- },
455
- "type": "library",
456
- "extra": {
457
- "branch-alias": {
458
- "dev-master": "1.0.x-dev"
459
- }
460
- },
461
- "autoload": {
462
- "psr-4": {
463
- "phpDocumentor\\Reflection\\": [
464
- "src/"
465
- ]
466
- }
467
- },
468
- "notification-url": "https://packagist.org/downloads/",
469
- "license": [
470
- "MIT"
471
- ],
472
- "authors": [
473
- {
474
- "name": "Mike van Riel",
475
- "email": "me@mikevanriel.com"
476
- }
477
  ],
478
- "time": "2017-07-14T14:27:02+00:00"
479
- },
480
- {
481
- "name": "phpspec/prophecy",
482
- "version": "v1.7.2",
483
- "source": {
484
- "type": "git",
485
- "url": "https://github.com/phpspec/prophecy.git",
486
- "reference": "c9b8c6088acd19d769d4cc0ffa60a9fe34344bd6"
487
- },
488
- "dist": {
489
- "type": "zip",
490
- "url": "https://api.github.com/repos/phpspec/prophecy/zipball/c9b8c6088acd19d769d4cc0ffa60a9fe34344bd6",
491
- "reference": "c9b8c6088acd19d769d4cc0ffa60a9fe34344bd6",
492
- "shasum": ""
493
- },
494
- "require": {
495
- "doctrine/instantiator": "^1.0.2",
496
- "php": "^5.3|^7.0",
497
- "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0",
498
- "sebastian/comparator": "^1.1|^2.0",
499
- "sebastian/recursion-context": "^1.0|^2.0|^3.0"
500
  },
501
- "require-dev": {
502
- "phpspec/phpspec": "^2.5|^3.2",
503
- "phpunit/phpunit": "^4.8 || ^5.6.5"
504
- },
505
- "type": "library",
506
- "extra": {
507
- "branch-alias": {
508
- "dev-master": "1.7.x-dev"
509
- }
510
- },
511
- "autoload": {
512
- "psr-0": {
513
- "Prophecy\\": "src/"
514
- }
515
- },
516
- "notification-url": "https://packagist.org/downloads/",
517
- "license": [
518
- "MIT"
519
- ],
520
- "authors": [
521
- {
522
- "name": "Konstantin Kudryashov",
523
- "email": "ever.zet@gmail.com",
524
- "homepage": "http://everzet.com"
525
- },
526
- {
527
- "name": "Marcello Duarte",
528
- "email": "marcello.duarte@gmail.com"
529
- }
530
- ],
531
- "description": "Highly opinionated mocking framework for PHP 5.3+",
532
- "homepage": "https://github.com/phpspec/prophecy",
533
- "keywords": [
534
- "Double",
535
- "Dummy",
536
- "fake",
537
- "mock",
538
- "spy",
539
- "stub"
540
- ],
541
- "time": "2017-09-04T11:05:03+00:00"
542
- },
543
- {
544
- "name": "phpunit/php-code-coverage",
545
- "version": "4.0.8",
546
- "source": {
547
- "type": "git",
548
- "url": "https://github.com/sebastianbergmann/php-code-coverage.git",
549
- "reference": "ef7b2f56815df854e66ceaee8ebe9393ae36a40d"
550
- },
551
- "dist": {
552
- "type": "zip",
553
- "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/ef7b2f56815df854e66ceaee8ebe9393ae36a40d",
554
- "reference": "ef7b2f56815df854e66ceaee8ebe9393ae36a40d",
555
- "shasum": ""
556
- },
557
- "require": {
558
- "ext-dom": "*",
559
- "ext-xmlwriter": "*",
560
- "php": "^5.6 || ^7.0",
561
- "phpunit/php-file-iterator": "^1.3",
562
- "phpunit/php-text-template": "^1.2",
563
- "phpunit/php-token-stream": "^1.4.2 || ^2.0",
564
- "sebastian/code-unit-reverse-lookup": "^1.0",
565
- "sebastian/environment": "^1.3.2 || ^2.0",
566
- "sebastian/version": "^1.0 || ^2.0"
567
- },
568
- "require-dev": {
569
- "ext-xdebug": "^2.1.4",
570
- "phpunit/phpunit": "^5.7"
571
- },
572
- "suggest": {
573
- "ext-xdebug": "^2.5.1"
574
- },
575
- "type": "library",
576
- "extra": {
577
- "branch-alias": {
578
- "dev-master": "4.0.x-dev"
579
- }
580
- },
581
- "autoload": {
582
- "classmap": [
583
- "src/"
584
- ]
585
- },
586
- "notification-url": "https://packagist.org/downloads/",
587
- "license": [
588
- "BSD-3-Clause"
589
- ],
590
- "authors": [
591
- {
592
- "name": "Sebastian Bergmann",
593
- "email": "sb@sebastian-bergmann.de",
594
- "role": "lead"
595
- }
596
- ],
597
- "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.",
598
- "homepage": "https://github.com/sebastianbergmann/php-code-coverage",
599
- "keywords": [
600
- "coverage",
601
- "testing",
602
- "xunit"
603
- ],
604
- "time": "2017-04-02T07:44:40+00:00"
605
- },
606
- {
607
- "name": "phpunit/php-file-iterator",
608
- "version": "1.4.2",
609
- "source": {
610
- "type": "git",
611
- "url": "https://github.com/sebastianbergmann/php-file-iterator.git",
612
- "reference": "3cc8f69b3028d0f96a9078e6295d86e9bf019be5"
613
- },
614
- "dist": {
615
- "type": "zip",
616
- "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/3cc8f69b3028d0f96a9078e6295d86e9bf019be5",
617
- "reference": "3cc8f69b3028d0f96a9078e6295d86e9bf019be5",
618
- "shasum": ""
619
- },
620
- "require": {
621
- "php": ">=5.3.3"
622
- },
623
- "type": "library",
624
- "extra": {
625
- "branch-alias": {
626
- "dev-master": "1.4.x-dev"
627
- }
628
- },
629
- "autoload": {
630
- "classmap": [
631
- "src/"
632
- ]
633
- },
634
- "notification-url": "https://packagist.org/downloads/",
635
- "license": [
636
- "BSD-3-Clause"
637
- ],
638
- "authors": [
639
- {
640
- "name": "Sebastian Bergmann",
641
- "email": "sb@sebastian-bergmann.de",
642
- "role": "lead"
643
- }
644
- ],
645
- "description": "FilterIterator implementation that filters files based on a list of suffixes.",
646
- "homepage": "https://github.com/sebastianbergmann/php-file-iterator/",
647
- "keywords": [
648
- "filesystem",
649
- "iterator"
650
- ],
651
- "time": "2016-10-03T07:40:28+00:00"
652
- },
653
- {
654
- "name": "phpunit/php-text-template",
655
- "version": "1.2.1",
656
- "source": {
657
- "type": "git",
658
- "url": "https://github.com/sebastianbergmann/php-text-template.git",
659
- "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686"
660
- },
661
- "dist": {
662
- "type": "zip",
663
- "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686",
664
- "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686",
665
- "shasum": ""
666
- },
667
- "require": {
668
- "php": ">=5.3.3"
669
- },
670
- "type": "library",
671
- "autoload": {
672
- "classmap": [
673
- "src/"
674
- ]
675
- },
676
- "notification-url": "https://packagist.org/downloads/",
677
- "license": [
678
- "BSD-3-Clause"
679
- ],
680
- "authors": [
681
- {
682
- "name": "Sebastian Bergmann",
683
- "email": "sebastian@phpunit.de",
684
- "role": "lead"
685
- }
686
- ],
687
- "description": "Simple template engine.",
688
- "homepage": "https://github.com/sebastianbergmann/php-text-template/",
689
- "keywords": [
690
- "template"
691
- ],
692
- "time": "2015-06-21T13:50:34+00:00"
693
- },
694
- {
695
- "name": "phpunit/php-timer",
696
- "version": "1.0.9",
697
- "source": {
698
- "type": "git",
699
- "url": "https://github.com/sebastianbergmann/php-timer.git",
700
- "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f"
701
- },
702
- "dist": {
703
- "type": "zip",
704
- "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3dcf38ca72b158baf0bc245e9184d3fdffa9c46f",
705
- "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f",
706
- "shasum": ""
707
- },
708
- "require": {
709
- "php": "^5.3.3 || ^7.0"
710
- },
711
- "require-dev": {
712
- "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0"
713
- },
714
- "type": "library",
715
- "extra": {
716
- "branch-alias": {
717
- "dev-master": "1.0-dev"
718
- }
719
- },
720
- "autoload": {
721
- "classmap": [
722
- "src/"
723
- ]
724
- },
725
- "notification-url": "https://packagist.org/downloads/",
726
- "license": [
727
- "BSD-3-Clause"
728
- ],
729
- "authors": [
730
- {
731
- "name": "Sebastian Bergmann",
732
- "email": "sb@sebastian-bergmann.de",
733
- "role": "lead"
734
- }
735
- ],
736
- "description": "Utility class for timing",
737
- "homepage": "https://github.com/sebastianbergmann/php-timer/",
738
- "keywords": [
739
- "timer"
740
- ],
741
- "time": "2017-02-26T11:10:40+00:00"
742
- },
743
- {
744
- "name": "phpunit/php-token-stream",
745
- "version": "2.0.1",
746
- "source": {
747
- "type": "git",
748
- "url": "https://github.com/sebastianbergmann/php-token-stream.git",
749
- "reference": "9a02332089ac48e704c70f6cefed30c224e3c0b0"
750
- },
751
- "dist": {
752
- "type": "zip",
753
- "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/9a02332089ac48e704c70f6cefed30c224e3c0b0",
754
- "reference": "9a02332089ac48e704c70f6cefed30c224e3c0b0",
755
- "shasum": ""
756
- },
757
- "require": {
758
- "ext-tokenizer": "*",
759
- "php": "^7.0"
760
- },
761
- "require-dev": {
762
- "phpunit/phpunit": "^6.2.4"
763
- },
764
- "type": "library",
765
- "extra": {
766
- "branch-alias": {
767
- "dev-master": "2.0-dev"
768
- }
769
- },
770
- "autoload": {
771
- "classmap": [
772
- "src/"
773
- ]
774
- },
775
- "notification-url": "https://packagist.org/downloads/",
776
- "license": [
777
- "BSD-3-Clause"
778
- ],
779
- "authors": [
780
- {
781
- "name": "Sebastian Bergmann",
782
- "email": "sebastian@phpunit.de"
783
- }
784
- ],
785
- "description": "Wrapper around PHP's tokenizer extension.",
786
- "homepage": "https://github.com/sebastianbergmann/php-token-stream/",
787
- "keywords": [
788
- "tokenizer"
789
- ],
790
- "time": "2017-08-20T05:47:52+00:00"
791
- },
792
- {
793
- "name": "phpunit/phpunit",
794
- "version": "5.7.21",
795
- "source": {
796
- "type": "git",
797
- "url": "https://github.com/sebastianbergmann/phpunit.git",
798
- "reference": "3b91adfb64264ddec5a2dee9851f354aa66327db"
799
- },
800
- "dist": {
801
- "type": "zip",
802
- "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/3b91adfb64264ddec5a2dee9851f354aa66327db",
803
- "reference": "3b91adfb64264ddec5a2dee9851f354aa66327db",
804
- "shasum": ""
805
- },
806
- "require": {
807
- "ext-dom": "*",
808
- "ext-json": "*",
809
- "ext-libxml": "*",
810
- "ext-mbstring": "*",
811
- "ext-xml": "*",
812
- "myclabs/deep-copy": "~1.3",
813
- "php": "^5.6 || ^7.0",
814
- "phpspec/prophecy": "^1.6.2",
815
- "phpunit/php-code-coverage": "^4.0.4",
816
- "phpunit/php-file-iterator": "~1.4",
817
- "phpunit/php-text-template": "~1.2",
818
- "phpunit/php-timer": "^1.0.6",
819
- "phpunit/phpunit-mock-objects": "^3.2",
820
- "sebastian/comparator": "^1.2.4",
821
- "sebastian/diff": "^1.4.3",
822
- "sebastian/environment": "^1.3.4 || ^2.0",
823
- "sebastian/exporter": "~2.0",
824
- "sebastian/global-state": "^1.1",
825
- "sebastian/object-enumerator": "~2.0",
826
- "sebastian/resource-operations": "~1.0",
827
- "sebastian/version": "~1.0.3|~2.0",
828
- "symfony/yaml": "~2.1|~3.0"
829
- },
830
- "conflict": {
831
- "phpdocumentor/reflection-docblock": "3.0.2"
832
- },
833
- "require-dev": {
834
- "ext-pdo": "*"
835
- },
836
- "suggest": {
837
- "ext-xdebug": "*",
838
- "phpunit/php-invoker": "~1.1"
839
- },
840
- "bin": [
841
- "phpunit"
842
- ],
843
- "type": "library",
844
- "extra": {
845
- "branch-alias": {
846
- "dev-master": "5.7.x-dev"
847
- }
848
- },
849
- "autoload": {
850
- "classmap": [
851
- "src/"
852
- ]
853
- },
854
- "notification-url": "https://packagist.org/downloads/",
855
- "license": [
856
- "BSD-3-Clause"
857
- ],
858
- "authors": [
859
- {
860
- "name": "Sebastian Bergmann",
861
- "email": "sebastian@phpunit.de",
862
- "role": "lead"
863
- }
864
- ],
865
- "description": "The PHP Unit Testing framework.",
866
- "homepage": "https://phpunit.de/",
867
- "keywords": [
868
- "phpunit",
869
- "testing",
870
- "xunit"
871
- ],
872
- "time": "2017-06-21T08:11:54+00:00"
873
- },
874
- {
875
- "name": "phpunit/phpunit-mock-objects",
876
- "version": "3.4.4",
877
- "source": {
878
- "type": "git",
879
- "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git",
880
- "reference": "a23b761686d50a560cc56233b9ecf49597cc9118"
881
- },
882
- "dist": {
883
- "type": "zip",
884
- "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/a23b761686d50a560cc56233b9ecf49597cc9118",
885
- "reference": "a23b761686d50a560cc56233b9ecf49597cc9118",
886
- "shasum": ""
887
- },
888
- "require": {
889
- "doctrine/instantiator": "^1.0.2",
890
- "php": "^5.6 || ^7.0",
891
- "phpunit/php-text-template": "^1.2",
892
- "sebastian/exporter": "^1.2 || ^2.0"
893
- },
894
- "conflict": {
895
- "phpunit/phpunit": "<5.4.0"
896
- },
897
- "require-dev": {
898
- "phpunit/phpunit": "^5.4"
899
- },
900
- "suggest": {
901
- "ext-soap": "*"
902
- },
903
- "type": "library",
904
- "extra": {
905
- "branch-alias": {
906
- "dev-master": "3.2.x-dev"
907
- }
908
- },
909
- "autoload": {
910
- "classmap": [
911
- "src/"
912
- ]
913
- },
914
- "notification-url": "https://packagist.org/downloads/",
915
- "license": [
916
- "BSD-3-Clause"
917
- ],
918
- "authors": [
919
- {
920
- "name": "Sebastian Bergmann",
921
- "email": "sb@sebastian-bergmann.de",
922
- "role": "lead"
923
- }
924
- ],
925
- "description": "Mock Object library for PHPUnit",
926
- "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/",
927
- "keywords": [
928
- "mock",
929
- "xunit"
930
- ],
931
- "time": "2017-06-30T09:13:00+00:00"
932
- },
933
- {
934
- "name": "psr/http-message",
935
- "version": "1.0.1",
936
- "source": {
937
- "type": "git",
938
- "url": "https://github.com/php-fig/http-message.git",
939
- "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363"
940
- },
941
- "dist": {
942
- "type": "zip",
943
- "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363",
944
- "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363",
945
- "shasum": ""
946
- },
947
- "require": {
948
- "php": ">=5.3.0"
949
- },
950
- "type": "library",
951
- "extra": {
952
- "branch-alias": {
953
- "dev-master": "1.0.x-dev"
954
- }
955
- },
956
- "autoload": {
957
- "psr-4": {
958
- "Psr\\Http\\Message\\": "src/"
959
- }
960
- },
961
- "notification-url": "https://packagist.org/downloads/",
962
- "license": [
963
- "MIT"
964
- ],
965
- "authors": [
966
- {
967
- "name": "PHP-FIG",
968
- "homepage": "http://www.php-fig.org/"
969
- }
970
- ],
971
- "description": "Common interface for HTTP messages",
972
- "homepage": "https://github.com/php-fig/http-message",
973
- "keywords": [
974
- "http",
975
- "http-message",
976
- "psr",
977
- "psr-7",
978
- "request",
979
- "response"
980
- ],
981
- "time": "2016-08-06T14:39:51+00:00"
982
- },
983
- {
984
- "name": "sebastian/code-unit-reverse-lookup",
985
- "version": "1.0.1",
986
- "source": {
987
- "type": "git",
988
- "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git",
989
- "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18"
990
- },
991
- "dist": {
992
- "type": "zip",
993
- "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/4419fcdb5eabb9caa61a27c7a1db532a6b55dd18",
994
- "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18",
995
- "shasum": ""
996
- },
997
- "require": {
998
- "php": "^5.6 || ^7.0"
999
- },
1000
- "require-dev": {
1001
- "phpunit/phpunit": "^5.7 || ^6.0"
1002
- },
1003
- "type": "library",
1004
- "extra": {
1005
- "branch-alias": {
1006
- "dev-master": "1.0.x-dev"
1007
- }
1008
- },
1009
- "autoload": {
1010
- "classmap": [
1011
- "src/"
1012
- ]
1013
- },
1014
- "notification-url": "https://packagist.org/downloads/",
1015
- "license": [
1016
- "BSD-3-Clause"
1017
- ],
1018
- "authors": [
1019
- {
1020
- "name": "Sebastian Bergmann",
1021
- "email": "sebastian@phpunit.de"
1022
- }
1023
- ],
1024
- "description": "Looks up which function or method a line of code belongs to",
1025
- "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/",
1026
- "time": "2017-03-04T06:30:41+00:00"
1027
- },
1028
- {
1029
- "name": "sebastian/comparator",
1030
- "version": "1.2.4",
1031
- "source": {
1032
- "type": "git",
1033
- "url": "https://github.com/sebastianbergmann/comparator.git",
1034
- "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be"
1035
- },
1036
- "dist": {
1037
- "type": "zip",
1038
- "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/2b7424b55f5047b47ac6e5ccb20b2aea4011d9be",
1039
- "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be",
1040
- "shasum": ""
1041
- },
1042
- "require": {
1043
- "php": ">=5.3.3",
1044
- "sebastian/diff": "~1.2",
1045
- "sebastian/exporter": "~1.2 || ~2.0"
1046
- },
1047
- "require-dev": {
1048
- "phpunit/phpunit": "~4.4"
1049
- },
1050
- "type": "library",
1051
- "extra": {
1052
- "branch-alias": {
1053
- "dev-master": "1.2.x-dev"
1054
- }
1055
- },
1056
- "autoload": {
1057
- "classmap": [
1058
- "src/"
1059
- ]
1060
- },
1061
- "notification-url": "https://packagist.org/downloads/",
1062
- "license": [
1063
- "BSD-3-Clause"
1064
- ],
1065
- "authors": [
1066
- {
1067
- "name": "Jeff Welch",
1068
- "email": "whatthejeff@gmail.com"
1069
- },
1070
- {
1071
- "name": "Volker Dusch",
1072
- "email": "github@wallbash.com"
1073
- },
1074
- {
1075
- "name": "Bernhard Schussek",
1076
- "email": "bschussek@2bepublished.at"
1077
- },
1078
- {
1079
- "name": "Sebastian Bergmann",
1080
- "email": "sebastian@phpunit.de"
1081
- }
1082
- ],
1083
- "description": "Provides the functionality to compare PHP values for equality",
1084
- "homepage": "http://www.github.com/sebastianbergmann/comparator",
1085
- "keywords": [
1086
- "comparator",
1087
- "compare",
1088
- "equality"
1089
- ],
1090
- "time": "2017-01-29T09:50:25+00:00"
1091
- },
1092
- {
1093
- "name": "sebastian/diff",
1094
- "version": "1.4.3",
1095
- "source": {
1096
- "type": "git",
1097
- "url": "https://github.com/sebastianbergmann/diff.git",
1098
- "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4"
1099
- },
1100
- "dist": {
1101
- "type": "zip",
1102
- "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/7f066a26a962dbe58ddea9f72a4e82874a3975a4",
1103
- "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4",
1104
- "shasum": ""
1105
- },
1106
- "require": {
1107
- "php": "^5.3.3 || ^7.0"
1108
- },
1109
- "require-dev": {
1110
- "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0"
1111
- },
1112
- "type": "library",
1113
- "extra": {
1114
- "branch-alias": {
1115
- "dev-master": "1.4-dev"
1116
- }
1117
- },
1118
- "autoload": {
1119
- "classmap": [
1120
- "src/"
1121
- ]
1122
- },
1123
- "notification-url": "https://packagist.org/downloads/",
1124
- "license": [
1125
- "BSD-3-Clause"
1126
- ],
1127
- "authors": [
1128
- {
1129
- "name": "Kore Nordmann",
1130
- "email": "mail@kore-nordmann.de"
1131
- },
1132
- {
1133
- "name": "Sebastian Bergmann",
1134
- "email": "sebastian@phpunit.de"
1135
- }
1136
- ],
1137
- "description": "Diff implementation",
1138
- "homepage": "https://github.com/sebastianbergmann/diff",
1139
- "keywords": [
1140
- "diff"
1141
- ],
1142
- "time": "2017-05-22T07:24:03+00:00"
1143
- },
1144
- {
1145
- "name": "sebastian/environment",
1146
- "version": "2.0.0",
1147
- "source": {
1148
- "type": "git",
1149
- "url": "https://github.com/sebastianbergmann/environment.git",
1150
- "reference": "5795ffe5dc5b02460c3e34222fee8cbe245d8fac"
1151
- },
1152
- "dist": {
1153
- "type": "zip",
1154
- "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/5795ffe5dc5b02460c3e34222fee8cbe245d8fac",
1155
- "reference": "5795ffe5dc5b02460c3e34222fee8cbe245d8fac",
1156
- "shasum": ""
1157
- },
1158
- "require": {
1159
- "php": "^5.6 || ^7.0"
1160
- },
1161
- "require-dev": {
1162
- "phpunit/phpunit": "^5.0"
1163
- },
1164
- "type": "library",
1165
- "extra": {
1166
- "branch-alias": {
1167
- "dev-master": "2.0.x-dev"
1168
- }
1169
- },
1170
- "autoload": {
1171
- "classmap": [
1172
- "src/"
1173
- ]
1174
- },
1175
- "notification-url": "https://packagist.org/downloads/",
1176
- "license": [
1177
- "BSD-3-Clause"
1178
- ],
1179
- "authors": [
1180
- {
1181
- "name": "Sebastian Bergmann",
1182
- "email": "sebastian@phpunit.de"
1183
- }
1184
- ],
1185
- "description": "Provides functionality to handle HHVM/PHP environments",
1186
- "homepage": "http://www.github.com/sebastianbergmann/environment",
1187
- "keywords": [
1188
- "Xdebug",
1189
- "environment",
1190
- "hhvm"
1191
- ],
1192
- "time": "2016-11-26T07:53:53+00:00"
1193
- },
1194
- {
1195
- "name": "sebastian/exporter",
1196
- "version": "2.0.0",
1197
- "source": {
1198
- "type": "git",
1199
- "url": "https://github.com/sebastianbergmann/exporter.git",
1200
- "reference": "ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4"
1201
- },
1202
- "dist": {
1203
- "type": "zip",
1204
- "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4",
1205
- "reference": "ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4",
1206
- "shasum": ""
1207
- },
1208
- "require": {
1209
- "php": ">=5.3.3",
1210
- "sebastian/recursion-context": "~2.0"
1211
- },
1212
- "require-dev": {
1213
- "ext-mbstring": "*",
1214
- "phpunit/phpunit": "~4.4"
1215
- },
1216
- "type": "library",
1217
- "extra": {
1218
- "branch-alias": {
1219
- "dev-master": "2.0.x-dev"
1220
- }
1221
- },
1222
- "autoload": {
1223
- "classmap": [
1224
- "src/"
1225
- ]
1226
- },
1227
- "notification-url": "https://packagist.org/downloads/",
1228
- "license": [
1229
- "BSD-3-Clause"
1230
- ],
1231
- "authors": [
1232
- {
1233
- "name": "Jeff Welch",
1234
- "email": "whatthejeff@gmail.com"
1235
- },
1236
- {
1237
- "name": "Volker Dusch",
1238
- "email": "github@wallbash.com"
1239
- },
1240
- {
1241
- "name": "Bernhard Schussek",
1242
- "email": "bschussek@2bepublished.at"
1243
- },
1244
- {
1245
- "name": "Sebastian Bergmann",
1246
- "email": "sebastian@phpunit.de"
1247
- },
1248
- {
1249
- "name": "Adam Harvey",
1250
- "email": "aharvey@php.net"
1251
- }
1252
- ],
1253
- "description": "Provides the functionality to export PHP variables for visualization",
1254
- "homepage": "http://www.github.com/sebastianbergmann/exporter",
1255
- "keywords": [
1256
- "export",
1257
- "exporter"
1258
- ],
1259
- "time": "2016-11-19T08:54:04+00:00"
1260
- },
1261
- {
1262
- "name": "sebastian/global-state",
1263
- "version": "1.1.1",
1264
- "source": {
1265
- "type": "git",
1266
- "url": "https://github.com/sebastianbergmann/global-state.git",
1267
- "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4"
1268
- },
1269
- "dist": {
1270
- "type": "zip",
1271
- "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bc37d50fea7d017d3d340f230811c9f1d7280af4",
1272
- "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4",
1273
- "shasum": ""
1274
- },
1275
- "require": {
1276
- "php": ">=5.3.3"
1277
- },
1278
- "require-dev": {
1279
- "phpunit/phpunit": "~4.2"
1280
- },
1281
- "suggest": {
1282
- "ext-uopz": "*"
1283
- },
1284
- "type": "library",
1285
- "extra": {
1286
- "branch-alias": {
1287
- "dev-master": "1.0-dev"
1288
- }
1289
- },
1290
- "autoload": {
1291
- "classmap": [
1292
- "src/"
1293
- ]
1294
- },
1295
- "notification-url": "https://packagist.org/downloads/",
1296
- "license": [
1297
- "BSD-3-Clause"
1298
- ],
1299
- "authors": [
1300
- {
1301
- "name": "Sebastian Bergmann",
1302
- "email": "sebastian@phpunit.de"
1303
- }
1304
- ],
1305
- "description": "Snapshotting of global state",
1306
- "homepage": "http://www.github.com/sebastianbergmann/global-state",
1307
- "keywords": [
1308
- "global state"
1309
- ],
1310
- "time": "2015-10-12T03:26:01+00:00"
1311
- },
1312
- {
1313
- "name": "sebastian/object-enumerator",
1314
- "version": "2.0.1",
1315
- "source": {
1316
- "type": "git",
1317
- "url": "https://github.com/sebastianbergmann/object-enumerator.git",
1318
- "reference": "1311872ac850040a79c3c058bea3e22d0f09cbb7"
1319
- },
1320
- "dist": {
1321
- "type": "zip",
1322
- "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/1311872ac850040a79c3c058bea3e22d0f09cbb7",
1323
- "reference": "1311872ac850040a79c3c058bea3e22d0f09cbb7",
1324
- "shasum": ""
1325
- },
1326
- "require": {
1327
- "php": ">=5.6",
1328
- "sebastian/recursion-context": "~2.0"
1329
- },
1330
- "require-dev": {
1331
- "phpunit/phpunit": "~5"
1332
- },
1333
- "type": "library",
1334
- "extra": {
1335
- "branch-alias": {
1336
- "dev-master": "2.0.x-dev"
1337
- }
1338
- },
1339
- "autoload": {
1340
- "classmap": [
1341
- "src/"
1342
- ]
1343
- },
1344
- "notification-url": "https://packagist.org/downloads/",
1345
- "license": [
1346
- "BSD-3-Clause"
1347
- ],
1348
- "authors": [
1349
- {
1350
- "name": "Sebastian Bergmann",
1351
- "email": "sebastian@phpunit.de"
1352
- }
1353
- ],
1354
- "description": "Traverses array structures and object graphs to enumerate all referenced objects",
1355
- "homepage": "https://github.com/sebastianbergmann/object-enumerator/",
1356
- "time": "2017-02-18T15:18:39+00:00"
1357
- },
1358
- {
1359
- "name": "sebastian/recursion-context",
1360
- "version": "2.0.0",
1361
- "source": {
1362
- "type": "git",
1363
- "url": "https://github.com/sebastianbergmann/recursion-context.git",
1364
- "reference": "2c3ba150cbec723aa057506e73a8d33bdb286c9a"
1365
- },
1366
- "dist": {
1367
- "type": "zip",
1368
- "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/2c3ba150cbec723aa057506e73a8d33bdb286c9a",
1369
- "reference": "2c3ba150cbec723aa057506e73a8d33bdb286c9a",
1370
- "shasum": ""
1371
- },
1372
- "require": {
1373
- "php": ">=5.3.3"
1374
- },
1375
- "require-dev": {
1376
- "phpunit/phpunit": "~4.4"
1377
- },
1378
- "type": "library",
1379
- "extra": {
1380
- "branch-alias": {
1381
- "dev-master": "2.0.x-dev"
1382
- }
1383
- },
1384
- "autoload": {
1385
- "classmap": [
1386
- "src/"
1387
- ]
1388
- },
1389
- "notification-url": "https://packagist.org/downloads/",
1390
- "license": [
1391
- "BSD-3-Clause"
1392
- ],
1393
- "authors": [
1394
- {
1395
- "name": "Jeff Welch",
1396
- "email": "whatthejeff@gmail.com"
1397
- },
1398
- {
1399
- "name": "Sebastian Bergmann",
1400
- "email": "sebastian@phpunit.de"
1401
- },
1402
- {
1403
- "name": "Adam Harvey",
1404
- "email": "aharvey@php.net"
1405
- }
1406
- ],
1407
- "description": "Provides functionality to recursively process PHP variables",
1408
- "homepage": "http://www.github.com/sebastianbergmann/recursion-context",
1409
- "time": "2016-11-19T07:33:16+00:00"
1410
- },
1411
- {
1412
- "name": "sebastian/resource-operations",
1413
- "version": "1.0.0",
1414
- "source": {
1415
- "type": "git",
1416
- "url": "https://github.com/sebastianbergmann/resource-operations.git",
1417
- "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52"
1418
- },
1419
- "dist": {
1420
- "type": "zip",
1421
- "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/ce990bb21759f94aeafd30209e8cfcdfa8bc3f52",
1422
- "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52",
1423
- "shasum": ""
1424
- },
1425
- "require": {
1426
- "php": ">=5.6.0"
1427
- },
1428
- "type": "library",
1429
- "extra": {
1430
- "branch-alias": {
1431
- "dev-master": "1.0.x-dev"
1432
- }
1433
- },
1434
- "autoload": {
1435
- "classmap": [
1436
- "src/"
1437
- ]
1438
- },
1439
- "notification-url": "https://packagist.org/downloads/",
1440
- "license": [
1441
- "BSD-3-Clause"
1442
- ],
1443
- "authors": [
1444
- {
1445
- "name": "Sebastian Bergmann",
1446
- "email": "sebastian@phpunit.de"
1447
- }
1448
- ],
1449
- "description": "Provides a list of PHP built-in functions that operate on resources",
1450
- "homepage": "https://www.github.com/sebastianbergmann/resource-operations",
1451
- "time": "2015-07-28T20:34:47+00:00"
1452
- },
1453
- {
1454
- "name": "sebastian/version",
1455
- "version": "2.0.1",
1456
- "source": {
1457
- "type": "git",
1458
- "url": "https://github.com/sebastianbergmann/version.git",
1459
- "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019"
1460
- },
1461
- "dist": {
1462
- "type": "zip",
1463
- "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/99732be0ddb3361e16ad77b68ba41efc8e979019",
1464
- "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019",
1465
- "shasum": ""
1466
- },
1467
- "require": {
1468
- "php": ">=5.6"
1469
- },
1470
- "type": "library",
1471
- "extra": {
1472
- "branch-alias": {
1473
- "dev-master": "2.0.x-dev"
1474
- }
1475
- },
1476
- "autoload": {
1477
- "classmap": [
1478
- "src/"
1479
- ]
1480
- },
1481
- "notification-url": "https://packagist.org/downloads/",
1482
- "license": [
1483
- "BSD-3-Clause"
1484
- ],
1485
- "authors": [
1486
- {
1487
- "name": "Sebastian Bergmann",
1488
- "email": "sebastian@phpunit.de",
1489
- "role": "lead"
1490
- }
1491
- ],
1492
- "description": "Library that helps with managing the version number of Git-hosted PHP projects",
1493
- "homepage": "https://github.com/sebastianbergmann/version",
1494
- "time": "2016-10-03T07:35:21+00:00"
1495
- },
1496
- {
1497
- "name": "symfony/yaml",
1498
- "version": "v3.3.8",
1499
- "source": {
1500
- "type": "git",
1501
- "url": "https://github.com/symfony/yaml.git",
1502
- "reference": "1d8c2a99c80862bdc3af94c1781bf70f86bccac0"
1503
- },
1504
- "dist": {
1505
- "type": "zip",
1506
- "url": "https://api.github.com/repos/symfony/yaml/zipball/1d8c2a99c80862bdc3af94c1781bf70f86bccac0",
1507
- "reference": "1d8c2a99c80862bdc3af94c1781bf70f86bccac0",
1508
- "shasum": ""
1509
- },
1510
- "require": {
1511
- "php": "^5.5.9|>=7.0.8"
1512
- },
1513
- "require-dev": {
1514
- "symfony/console": "~2.8|~3.0"
1515
- },
1516
- "suggest": {
1517
- "symfony/console": "For validating YAML files using the lint command"
1518
- },
1519
- "type": "library",
1520
- "extra": {
1521
- "branch-alias": {
1522
- "dev-master": "3.3-dev"
1523
- }
1524
- },
1525
- "autoload": {
1526
- "psr-4": {
1527
- "Symfony\\Component\\Yaml\\": ""
1528
- },
1529
- "exclude-from-classmap": [
1530
- "/Tests/"
1531
- ]
1532
- },
1533
- "notification-url": "https://packagist.org/downloads/",
1534
- "license": [
1535
- "MIT"
1536
- ],
1537
- "authors": [
1538
- {
1539
- "name": "Fabien Potencier",
1540
- "email": "fabien@symfony.com"
1541
- },
1542
- {
1543
- "name": "Symfony Community",
1544
- "homepage": "https://symfony.com/contributors"
1545
- }
1546
- ],
1547
- "description": "Symfony Yaml Component",
1548
- "homepage": "https://symfony.com",
1549
- "time": "2017-07-29T21:54:42+00:00"
1550
- },
1551
- {
1552
- "name": "webmozart/assert",
1553
- "version": "1.2.0",
1554
- "source": {
1555
- "type": "git",
1556
- "url": "https://github.com/webmozart/assert.git",
1557
- "reference": "2db61e59ff05fe5126d152bd0655c9ea113e550f"
1558
- },
1559
- "dist": {
1560
- "type": "zip",
1561
- "url": "https://api.github.com/repos/webmozart/assert/zipball/2db61e59ff05fe5126d152bd0655c9ea113e550f",
1562
- "reference": "2db61e59ff05fe5126d152bd0655c9ea113e550f",
1563
- "shasum": ""
1564
- },
1565
- "require": {
1566
- "php": "^5.3.3 || ^7.0"
1567
- },
1568
- "require-dev": {
1569
- "phpunit/phpunit": "^4.6",
1570
- "sebastian/version": "^1.0.1"
1571
- },
1572
- "type": "library",
1573
- "extra": {
1574
- "branch-alias": {
1575
- "dev-master": "1.3-dev"
1576
- }
1577
- },
1578
- "autoload": {
1579
- "psr-4": {
1580
- "Webmozart\\Assert\\": "src/"
1581
- }
1582
- },
1583
- "notification-url": "https://packagist.org/downloads/",
1584
- "license": [
1585
- "MIT"
1586
- ],
1587
- "authors": [
1588
- {
1589
- "name": "Bernhard Schussek",
1590
- "email": "bschussek@gmail.com"
1591
- }
1592
- ],
1593
- "description": "Assertions to validate method input/output with nice error messages.",
1594
- "keywords": [
1595
- "assert",
1596
- "check",
1597
- "validate"
1598
- ],
1599
- "time": "2016-11-23T20:04:58+00:00"
1600
  }
1601
  ],
 
1602
  "aliases": [],
1603
  "minimum-stability": "stable",
1604
  "stability-flags": [],
1605
  "prefer-stable": false,
1606
  "prefer-lowest": false,
1607
- "platform": [],
1608
- "platform-dev": []
 
 
 
1609
  }
1
  {
2
  "_readme": [
3
  "This file locks the dependencies of your project to a known state",
4
+ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
5
  "This file is @generated automatically"
6
  ],
7
+ "content-hash": "2664848c237e209d59c46d6374795bfd",
8
  "packages": [
9
  {
10
+ "name": "composer/installers",
11
+ "version": "v1.12.0",
12
  "source": {
13
  "type": "git",
14
+ "url": "https://github.com/composer/installers.git",
15
+ "reference": "d20a64ed3c94748397ff5973488761b22f6d3f19"
16
  },
17
  "dist": {
18
  "type": "zip",
19
+ "url": "https://api.github.com/repos/composer/installers/zipball/d20a64ed3c94748397ff5973488761b22f6d3f19",
20
+ "reference": "d20a64ed3c94748397ff5973488761b22f6d3f19",
21
  "shasum": ""
22
  },
23
  "require": {
24
+ "composer-plugin-api": "^1.0 || ^2.0"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
25
  },
26
+ "replace": {
27
+ "roundcube/plugin-installer": "*",
28
+ "shama/baton": "*"
29
  },
30
  "require-dev": {
31
+ "composer/composer": "1.6.* || ^2.0",
32
+ "composer/semver": "^1 || ^3",
33
+ "phpstan/phpstan": "^0.12.55",
34
+ "phpstan/phpstan-phpunit": "^0.12.16",
35
+ "symfony/phpunit-bridge": "^4.2 || ^5",
36
+ "symfony/process": "^2.3"
37
  },
38
+ "type": "composer-plugin",
39
  "extra": {
40
+ "class": "Composer\\Installers\\Plugin",
41
  "branch-alias": {
42
+ "dev-main": "1.x-dev"
43
  }
44
  },
45
  "autoload": {
46
  "psr-4": {
47
+ "Composer\\Installers\\": "src/Composer/Installers"
48
  }
49
  },
50
  "notification-url": "https://packagist.org/downloads/",
53
  ],
54
  "authors": [
55
  {
56
+ "name": "Kyle Robinson Young",
57
+ "email": "kyle@dontkry.com",
58
+ "homepage": "https://github.com/shama"
59
+ }
60
+ ],
61
+ "description": "A multi-framework Composer library installer",
62
+ "homepage": "https://composer.github.io/installers/",
63
+ "keywords": [
64
+ "Craft",
65
+ "Dolibarr",
66
+ "Eliasis",
67
+ "Hurad",
68
+ "ImageCMS",
69
+ "Kanboard",
70
+ "Lan Management System",
71
+ "MODX Evo",
72
+ "MantisBT",
73
+ "Mautic",
74
+ "Maya",
75
+ "OXID",
76
+ "Plentymarkets",
77
+ "Porto",
78
+ "RadPHP",
79
+ "SMF",
80
+ "Starbug",
81
+ "Thelia",
82
+ "Whmcs",
83
+ "WolfCMS",
84
+ "agl",
85
+ "aimeos",
86
+ "annotatecms",
87
+ "attogram",
88
+ "bitrix",
89
+ "cakephp",
90
+ "chef",
91
+ "cockpit",
92
+ "codeigniter",
93
+ "concrete5",
94
+ "croogo",
95
+ "dokuwiki",
96
+ "drupal",
97
+ "eZ Platform",
98
+ "elgg",
99
+ "expressionengine",
100
+ "fuelphp",
101
+ "grav",
102
+ "installer",
103
+ "itop",
104
+ "joomla",
105
+ "known",
106
+ "kohana",
107
+ "laravel",
108
+ "lavalite",
109
+ "lithium",
110
+ "magento",
111
+ "majima",
112
+ "mako",
113
+ "mediawiki",
114
+ "miaoxing",
115
+ "modulework",
116
+ "modx",
117
+ "moodle",
118
+ "osclass",
119
+ "pantheon",
120
+ "phpbb",
121
+ "piwik",
122
+ "ppi",
123
+ "processwire",
124
+ "puppet",
125
+ "pxcms",
126
+ "reindex",
127
+ "roundcube",
128
+ "shopware",
129
+ "silverstripe",
130
+ "sydes",
131
+ "sylius",
132
+ "symfony",
133
+ "tastyigniter",
134
+ "typo3",
135
+ "wordpress",
136
+ "yawik",
137
+ "zend",
138
+ "zikula"
139
+ ],
140
+ "support": {
141
+ "issues": "https://github.com/composer/installers/issues",
142
+ "source": "https://github.com/composer/installers/tree/v1.12.0"
143
+ },
144
+ "funding": [
145
+ {
146
+ "url": "https://packagist.com",
147
+ "type": "custom"
148
+ },
149
+ {
150
+ "url": "https://github.com/composer",
151
+ "type": "github"
152
+ },
153
+ {
154
+ "url": "https://tidelift.com/funding/github/packagist/composer/composer",
155
+ "type": "tidelift"
156
+ }
157
+ ],
158
+ "time": "2021-09-13T08:19:44+00:00"
159
  },
160
  {
161
+ "name": "firebase/php-jwt",
162
+ "version": "v6.3.0",
163
  "source": {
164
  "type": "git",
165
+ "url": "https://github.com/firebase/php-jwt.git",
166
+ "reference": "018dfc4e1da92ad8a1b90adc4893f476a3b41cb8"
167
  },
168
  "dist": {
169
  "type": "zip",
170
+ "url": "https://api.github.com/repos/firebase/php-jwt/zipball/018dfc4e1da92ad8a1b90adc4893f476a3b41cb8",
171
+ "reference": "018dfc4e1da92ad8a1b90adc4893f476a3b41cb8",
172
  "shasum": ""
173
  },
174
  "require": {
175
+ "php": "^7.1||^8.0"
 
 
176
  },
177
  "require-dev": {
178
+ "guzzlehttp/guzzle": "^6.5||^7.4",
179
+ "phpspec/prophecy-phpunit": "^1.1",
180
+ "phpunit/phpunit": "^7.5||^9.5",
181
+ "psr/cache": "^1.0||^2.0",
182
+ "psr/http-client": "^1.0",
183
+ "psr/http-factory": "^1.0"
184
  },
185
  "suggest": {
186
+ "paragonie/sodium_compat": "Support EdDSA (Ed25519) signatures when libsodium is not present"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
187
  },
188
  "type": "library",
 
 
 
 
 
189
  "autoload": {
190
  "psr-4": {
191
+ "Firebase\\JWT\\": "src"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
192
  }
193
  },
 
 
 
 
 
 
 
 
194
  "notification-url": "https://packagist.org/downloads/",
195
  "license": [
196
+ "BSD-3-Clause"
197
  ],
198
  "authors": [
199
  {
200
+ "name": "Neuman Vong",
201
+ "email": "neuman+pear@twilio.com",
202
+ "role": "Developer"
203
  },
204
  {
205
+ "name": "Anant Narayanan",
206
+ "email": "anant@php.net",
207
+ "role": "Developer"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
208
  }
209
  ],
210
+ "description": "A simple library to encode and decode JSON Web Tokens (JWT) in PHP. Should conform to the current spec.",
211
+ "homepage": "https://github.com/firebase/php-jwt",
212
  "keywords": [
213
+ "jwt",
214
+ "php"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
215
  ],
216
+ "support": {
217
+ "issues": "https://github.com/firebase/php-jwt/issues",
218
+ "source": "https://github.com/firebase/php-jwt/tree/v6.3.0"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
219
  },
220
+ "time": "2022-07-15T16:48:45+00:00"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
221
  }
222
  ],
223
+ "packages-dev": [],
224
  "aliases": [],
225
  "minimum-stability": "stable",
226
  "stability-flags": [],
227
  "prefer-stable": false,
228
  "prefer-lowest": false,
229
+ "platform": {
230
+ "php": ">=5.3"
231
+ },
232
+ "platform-dev": [],
233
+ "plugin-api-version": "2.3.0"
234
  }
includes/vendor/autoload.php CHANGED
@@ -2,6 +2,11 @@
2
 
3
  // autoload.php @generated by Composer
4
 
 
 
 
 
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
  return ComposerAutoloaderInit6ba6ee55693d165c056f65e51c5383a5::getLoader();
2
 
3
  // autoload.php @generated by Composer
4
 
5
+ if (PHP_VERSION_ID < 50600) {
6
+ echo 'Composer 2.3.0 dropped support for autoloading on PHP <5.6 and you are running '.PHP_VERSION.', please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.'.PHP_EOL;
7
+ exit(1);
8
+ }
9
+
10
  require_once __DIR__ . '/composer/autoload_real.php';
11
 
12
  return ComposerAutoloaderInit6ba6ee55693d165c056f65e51c5383a5::getLoader();
includes/vendor/composer/ClassLoader.php CHANGED
@@ -37,57 +37,130 @@ namespace Composer\Autoload;
37
  *
38
  * @author Fabien Potencier <fabien@symfony.com>
39
  * @author Jordi Boggiano <j.boggiano@seld.be>
40
- * @see http://www.php-fig.org/psr/psr-0/
41
- * @see http://www.php-fig.org/psr/psr-4/
42
  */
43
  class ClassLoader
44
  {
 
 
 
45
  // PSR-4
 
 
 
 
46
  private $prefixLengthsPsr4 = array();
 
 
 
 
47
  private $prefixDirsPsr4 = array();
 
 
 
 
48
  private $fallbackDirsPsr4 = array();
49
 
50
  // PSR-0
 
 
 
 
51
  private $prefixesPsr0 = array();
 
 
 
 
52
  private $fallbackDirsPsr0 = array();
53
 
 
54
  private $useIncludePath = false;
 
 
 
 
 
55
  private $classMap = array();
 
 
56
  private $classMapAuthoritative = false;
 
 
 
 
 
57
  private $missingClasses = array();
 
 
58
  private $apcuPrefix;
59
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
60
  public function getPrefixes()
61
  {
62
  if (!empty($this->prefixesPsr0)) {
63
- return call_user_func_array('array_merge', $this->prefixesPsr0);
64
  }
65
 
66
  return array();
67
  }
68
 
 
 
 
 
69
  public function getPrefixesPsr4()
70
  {
71
  return $this->prefixDirsPsr4;
72
  }
73
 
 
 
 
 
74
  public function getFallbackDirs()
75
  {
76
  return $this->fallbackDirsPsr0;
77
  }
78
 
 
 
 
 
79
  public function getFallbackDirsPsr4()
80
  {
81
  return $this->fallbackDirsPsr4;
82
  }
83
 
 
 
 
 
84
  public function getClassMap()
85
  {
86
  return $this->classMap;
87
  }
88
 
89
  /**
90
- * @param array $classMap Class to filename map
 
 
 
91
  */
92
  public function addClassMap(array $classMap)
93
  {
@@ -102,9 +175,11 @@ class ClassLoader
102
  * Registers a set of PSR-0 directories for a given prefix, either
103
  * appending or prepending to the ones previously set for this prefix.
104
  *
105
- * @param string $prefix The prefix
106
- * @param array|string $paths The PSR-0 root directories
107
- * @param bool $prepend Whether to prepend the directories
 
 
108
  */
109
  public function add($prefix, $paths, $prepend = false)
110
  {
@@ -147,11 +222,13 @@ class ClassLoader
147
  * Registers a set of PSR-4 directories for a given namespace, either
148
  * appending or prepending to the ones previously set for this namespace.
149
  *
150
- * @param string $prefix The prefix/namespace, with trailing '\\'
151
- * @param array|string $paths The PSR-4 base directories
152
- * @param bool $prepend Whether to prepend the directories
153
  *
154
  * @throws \InvalidArgumentException
 
 
155
  */
156
  public function addPsr4($prefix, $paths, $prepend = false)
157
  {
@@ -195,8 +272,10 @@ class ClassLoader
195
  * Registers a set of PSR-0 directories for a given prefix,
196
  * replacing any others previously set for this prefix.
197
  *
198
- * @param string $prefix The prefix
199
- * @param array|string $paths The PSR-0 base directories
 
 
200
  */
201
  public function set($prefix, $paths)
202
  {
@@ -211,10 +290,12 @@ class ClassLoader
211
  * Registers a set of PSR-4 directories for a given namespace,
212
  * replacing any others previously set for this namespace.
213
  *
214
- * @param string $prefix The prefix/namespace, with trailing '\\'
215
- * @param array|string $paths The PSR-4 base directories
216
  *
217
  * @throws \InvalidArgumentException
 
 
218
  */
219
  public function setPsr4($prefix, $paths)
220
  {
@@ -234,6 +315,8 @@ class ClassLoader
234
  * Turns on searching the include path for class files.
235
  *
236
  * @param bool $useIncludePath
 
 
237
  */
238
  public function setUseIncludePath($useIncludePath)
239
  {
@@ -256,6 +339,8 @@ class ClassLoader
256
  * that have not been registered with the class map.
257
  *
258
  * @param bool $classMapAuthoritative
 
 
259
  */
260
  public function setClassMapAuthoritative($classMapAuthoritative)
261
  {
@@ -276,10 +361,12 @@ class ClassLoader
276
  * APCu prefix to use to cache found/not-found classes, if the extension is enabled.
277
  *
278
  * @param string|null $apcuPrefix
 
 
279
  */
280
  public function setApcuPrefix($apcuPrefix)
281
  {
282
- $this->apcuPrefix = function_exists('apcu_fetch') && ini_get('apc.enabled') ? $apcuPrefix : null;
283
  }
284
 
285
  /**
@@ -296,25 +383,44 @@ class ClassLoader
296
  * Registers this instance as an autoloader.
297
  *
298
  * @param bool $prepend Whether to prepend the autoloader or not
 
 
299
  */
300
  public function register($prepend = false)
301
  {
302
  spl_autoload_register(array($this, 'loadClass'), true, $prepend);
 
 
 
 
 
 
 
 
 
 
 
303
  }
304
 
305
  /**
306
  * Unregisters this instance as an autoloader.
 
 
307
  */
308
  public function unregister()
309
  {
310
  spl_autoload_unregister(array($this, 'loadClass'));
 
 
 
 
311
  }
312
 
313
  /**
314
  * Loads the given class or interface.
315
  *
316
  * @param string $class The name of the class
317
- * @return bool|null True if loaded, null otherwise
318
  */
319
  public function loadClass($class)
320
  {
@@ -323,6 +429,8 @@ class ClassLoader
323
 
324
  return true;
325
  }
 
 
326
  }
327
 
328
  /**
@@ -367,6 +475,21 @@ class ClassLoader
367
  return $file;
368
  }
369
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
370
  private function findFileWithExtension($class, $ext)
371
  {
372
  // PSR-4 lookup
@@ -377,11 +500,11 @@ class ClassLoader
377
  $subPath = $class;
378
  while (false !== $lastPos = strrpos($subPath, '\\')) {
379
  $subPath = substr($subPath, 0, $lastPos);
380
- $search = $subPath.'\\';
381
  if (isset($this->prefixDirsPsr4[$search])) {
 
382
  foreach ($this->prefixDirsPsr4[$search] as $dir) {
383
- $length = $this->prefixLengthsPsr4[$first][$search];
384
- if (file_exists($file = $dir . DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $length))) {
385
  return $file;
386
  }
387
  }
@@ -438,6 +561,10 @@ class ClassLoader
438
  * Scope isolated include.
439
  *
440
  * Prevents access to $this/self from included files.
 
 
 
 
441
  */
442
  function includeFile($file)
443
  {
37
  *
38
  * @author Fabien Potencier <fabien@symfony.com>
39
  * @author Jordi Boggiano <j.boggiano@seld.be>
40
+ * @see https://www.php-fig.org/psr/psr-0/
41
+ * @see https://www.php-fig.org/psr/psr-4/
42
  */
43
  class ClassLoader
44
  {
45
+ /** @var ?string */
46
+ private $vendorDir;
47
+
48
  // PSR-4
49
+ /**
50
+ * @var array[]
51
+ * @psalm-var array<string, array<string, int>>
52
+ */
53
  private $prefixLengthsPsr4 = array();
54
+ /**
55
+ * @var array[]
56
+ * @psalm-var array<string, array<int, string>>
57
+ */
58
  private $prefixDirsPsr4 = array();
59
+ /**
60
+ * @var array[]
61
+ * @psalm-var array<string, string>
62
+ */
63
  private $fallbackDirsPsr4 = array();
64
 
65
  // PSR-0
66
+ /**
67
+ * @var array[]
68
+ * @psalm-var array<string, array<string, string[]>>
69
+ */
70
  private $prefixesPsr0 = array();
71
+ /**
72
+ * @var array[]
73
+ * @psalm-var array<string, string>
74
+ */
75
  private $fallbackDirsPsr0 = array();
76
 
77
+ /** @var bool */
78
  private $useIncludePath = false;
79
+
80
+ /**
81
+ * @var string[]
82
+ * @psalm-var array<string, string>
83
+ */
84
  private $classMap = array();
85
+
86
+ /** @var bool */
87
  private $classMapAuthoritative = false;
88
+
89
+ /**
90
+ * @var bool[]
91
+ * @psalm-var array<string, bool>
92
+ */
93
  private $missingClasses = array();
94
+
95
+ /** @var ?string */
96
  private $apcuPrefix;
97
 
98
+ /**
99
+ * @var self[]
100
+ */
101
+ private static $registeredLoaders = array();
102
+
103
+ /**
104
+ * @param ?string $vendorDir
105
+ */
106
+ public function __construct($vendorDir = null)
107
+ {
108
+ $this->vendorDir = $vendorDir;
109
+ }
110
+
111
+ /**
112
+ * @return string[]
113
+ */
114
  public function getPrefixes()
115
  {
116
  if (!empty($this->prefixesPsr0)) {
117
+ return call_user_func_array('array_merge', array_values($this->prefixesPsr0));
118
  }
119
 
120
  return array();
121
  }
122
 
123
+ /**
124
+ * @return array[]
125
+ * @psalm-return array<string, array<int, string>>
126
+ */
127
  public function getPrefixesPsr4()
128
  {
129
  return $this->prefixDirsPsr4;
130
  }
131
 
132
+ /**
133
+ * @return array[]
134
+ * @psalm-return array<string, string>
135
+ */
136
  public function getFallbackDirs()
137
  {
138
  return $this->fallbackDirsPsr0;
139
  }
140
 
141
+ /**
142
+ * @return array[]
143
+ * @psalm-return array<string, string>
144
+ */
145
  public function getFallbackDirsPsr4()
146
  {
147
  return $this->fallbackDirsPsr4;
148
  }
149
 
150
+ /**
151
+ * @return string[] Array of classname => path
152
+ * @psalm-return array<string, string>
153
+ */
154
  public function getClassMap()
155
  {
156
  return $this->classMap;
157
  }
158
 
159
  /**
160
+ * @param string[] $classMap Class to filename map
161
+ * @psalm-param array<string, string> $classMap
162
+ *
163
+ * @return void
164
  */
165
  public function addClassMap(array $classMap)
166
  {
175
  * Registers a set of PSR-0 directories for a given prefix, either
176
  * appending or prepending to the ones previously set for this prefix.
177
  *
178
+ * @param string $prefix The prefix
179
+ * @param string[]|string $paths The PSR-0 root directories
180
+ * @param bool $prepend Whether to prepend the directories
181
+ *
182
+ * @return void
183
  */
184
  public function add($prefix, $paths, $prepend = false)
185
  {
222
  * Registers a set of PSR-4 directories for a given namespace, either
223
  * appending or prepending to the ones previously set for this namespace.
224
  *
225
+ * @param string $prefix The prefix/namespace, with trailing '\\'
226
+ * @param string[]|string $paths The PSR-4 base directories
227
+ * @param bool $prepend Whether to prepend the directories
228
  *
229
  * @throws \InvalidArgumentException
230
+ *
231
+ * @return void
232
  */
233
  public function addPsr4($prefix, $paths, $prepend = false)
234
  {
272
  * Registers a set of PSR-0 directories for a given prefix,
273
  * replacing any others previously set for this prefix.
274
  *
275
+ * @param string $prefix The prefix
276
+ * @param string[]|string $paths The PSR-0 base directories
277
+ *
278
+ * @return void
279
  */
280
  public function set($prefix, $paths)
281
  {
290
  * Registers a set of PSR-4 directories for a given namespace,
291
  * replacing any others previously set for this namespace.
292
  *
293
+ * @param string $prefix The prefix/namespace, with trailing '\\'
294
+ * @param string[]|string $paths The PSR-4 base directories
295
  *
296
  * @throws \InvalidArgumentException
297
+ *
298
+ * @return void
299
  */
300
  public function setPsr4($prefix, $paths)
301
  {
315
  * Turns on searching the include path for class files.
316
  *
317
  * @param bool $useIncludePath
318
+ *
319
+ * @return void
320
  */
321
  public function setUseIncludePath($useIncludePath)
322
  {
339
  * that have not been registered with the class map.
340
  *
341
  * @param bool $classMapAuthoritative
342
+ *
343
+ * @return void
344
  */
345
  public function setClassMapAuthoritative($classMapAuthoritative)
346
  {
361
  * APCu prefix to use to cache found/not-found classes, if the extension is enabled.
362
  *
363
  * @param string|null $apcuPrefix
364
+ *
365
+ * @return void
366
  */
367
  public function setApcuPrefix($apcuPrefix)
368
  {
369
+ $this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null;
370
  }
371
 
372
  /**
383
  * Registers this instance as an autoloader.
384
  *
385
  * @param bool $prepend Whether to prepend the autoloader or not
386
+ *
387
+ * @return void
388
  */
389
  public function register($prepend = false)
390
  {
391
  spl_autoload_register(array($this, 'loadClass'), true, $prepend);
392
+
393
+ if (null === $this->vendorDir) {
394
+ return;
395
+ }
396
+
397
+ if ($prepend) {
398
+ self::$registeredLoaders = array($this->vendorDir => $this) + self::$registeredLoaders;
399
+ } else {
400
+ unset(self::$registeredLoaders[$this->vendorDir]);
401
+ self::$registeredLoaders[$this->vendorDir] = $this;
402
+ }
403
  }
404
 
405
  /**
406
  * Unregisters this instance as an autoloader.
407
+ *
408
+ * @return void
409
  */
410
  public function unregister()
411
  {
412
  spl_autoload_unregister(array($this, 'loadClass'));
413
+
414
+ if (null !== $this->vendorDir) {
415
+ unset(self::$registeredLoaders[$this->vendorDir]);
416
+ }
417
  }
418
 
419
  /**
420
  * Loads the given class or interface.
421
  *
422
  * @param string $class The name of the class
423
+ * @return true|null True if loaded, null otherwise
424
  */
425
  public function loadClass($class)
426
  {
429
 
430
  return true;
431
  }
432
+
433
+ return null;
434
  }
435
 
436
  /**
475
  return $file;
476
  }
477
 
478
+ /**
479
+ * Returns the currently registered loaders indexed by their corresponding vendor directories.
480
+ *
481
+ * @return self[]
482
+ */
483
+ public static function getRegisteredLoaders()
484
+ {
485
+ return self::$registeredLoaders;
486
+ }
487
+
488
+ /**
489
+ * @param string $class
490
+ * @param string $ext
491
+ * @return string|false
492
+ */
493
  private function findFileWithExtension($class, $ext)
494
  {
495
  // PSR-4 lookup
500
  $subPath = $class;
501
  while (false !== $lastPos = strrpos($subPath, '\\')) {
502
  $subPath = substr($subPath, 0, $lastPos);
503
+ $search = $subPath . '\\';
504
  if (isset($this->prefixDirsPsr4[$search])) {
505
+ $pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1);
506
  foreach ($this->prefixDirsPsr4[$search] as $dir) {
507
+ if (file_exists($file = $dir . $pathEnd)) {
 
508
  return $file;
509
  }
510
  }
561
  * Scope isolated include.
562
  *
563
  * Prevents access to $this/self from included files.
564
+ *
565
+ * @param string $file
566
+ * @return void
567
+ * @private
568
  */
569
  function includeFile($file)
570
  {
includes/vendor/composer/InstalledVersions.php ADDED
@@ -0,0 +1,352 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /*
4
+ * This file is part of Composer.
5
+ *
6
+ * (c) Nils Adermann <naderman@naderman.de>
7
+ * Jordi Boggiano <j.boggiano@seld.be>
8
+ *
9
+ * For the full copyright and license information, please view the LICENSE
10
+ * file that was distributed with this source code.
11
+ */
12
+
13
+ namespace Composer;
14
+
15
+ use Composer\Autoload\ClassLoader;
16
+ use Composer\Semver\VersionParser;
17
+
18
+ /**
19
+ * This class is copied in every Composer installed project and available to all
20
+ *
21
+ * See also https://getcomposer.org/doc/07-runtime.md#installed-versions
22
+ *
23
+ * To require its presence, you can require `composer-runtime-api ^2.0`
24
+ *
25
+ * @final
26
+ */
27
+ class InstalledVersions
28
+ {
29
+ /**
30
+ * @var mixed[]|null
31
+ * @psalm-var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}|array{}|null
32
+ */
33
+ private static $installed;
34
+
35
+ /**
36
+ * @var bool|null
37
+ */
38
+ private static $canGetVendors;
39
+
40
+ /**
41
+ * @var array[]
42
+ * @psalm-var array<string, array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}>
43
+ */
44
+ private static $installedByVendor = array();
45
+
46
+ /**
47
+ * Returns a list of all package names which are present, either by being installed, replaced or provided
48
+ *
49
+ * @return string[]
50
+ * @psalm-return list<string>
51
+ */
52
+ public static function getInstalledPackages()
53
+ {
54
+ $packages = array();
55
+ foreach (self::getInstalled() as $installed) {
56
+ $packages[] = array_keys($installed['versions']);
57
+ }
58
+
59
+ if (1 === \count($packages)) {
60
+ return $packages[0];
61
+ }
62
+
63
+ return array_keys(array_flip(\call_user_func_array('array_merge', $packages)));
64
+ }
65
+
66
+ /**
67
+ * Returns a list of all package names with a specific type e.g. 'library'
68
+ *
69
+ * @param string $type
70
+ * @return string[]
71
+ * @psalm-return list<string>
72
+ */
73
+ public static function getInstalledPackagesByType($type)
74
+ {
75
+ $packagesByType = array();
76
+
77
+ foreach (self::getInstalled() as $installed) {
78
+ foreach ($installed['versions'] as $name => $package) {
79
+ if (isset($package['type']) && $package['type'] === $type) {
80
+ $packagesByType[] = $name;
81
+ }
82
+ }
83
+ }
84
+
85
+ return $packagesByType;
86
+ }
87
+
88
+ /**
89
+ * Checks whether the given package is installed
90
+ *
91
+ * This also returns true if the package name is provided or replaced by another package
92
+ *
93
+ * @param string $packageName
94
+ * @param bool $includeDevRequirements
95
+ * @return bool
96
+ */
97
+ public static function isInstalled($packageName, $includeDevRequirements = true)
98
+ {
99
+ foreach (self::getInstalled() as $installed) {
100
+ if (isset($installed['versions'][$packageName])) {
101
+ return $includeDevRequirements || empty($installed['versions'][$packageName]['dev_requirement']);
102
+ }
103
+ }
104
+
105
+ return false;
106
+ }
107
+
108
+ /**
109
+ * Checks whether the given package satisfies a version constraint
110
+ *
111
+ * e.g. If you want to know whether version 2.3+ of package foo/bar is installed, you would call:
112
+ *
113
+ * Composer\InstalledVersions::satisfies(new VersionParser, 'foo/bar', '^2.3')
114
+ *
115
+ * @param VersionParser $parser Install composer/semver to have access to this class and functionality
116
+ * @param string $packageName
117
+ * @param string|null $constraint A version constraint to check for, if you pass one you have to make sure composer/semver is required by your package
118
+ * @return bool
119
+ */
120
+ public static function satisfies(VersionParser $parser, $packageName, $constraint)
121
+ {
122
+ $constraint = $parser->parseConstraints($constraint);
123
+ $provided = $parser->parseConstraints(self::getVersionRanges($packageName));
124
+
125
+ return $provided->matches($constraint);
126
+ }
127
+
128
+ /**
129
+ * Returns a version constraint representing all the range(s) which are installed for a given package
130
+ *
131
+ * It is easier to use this via isInstalled() with the $constraint argument if you need to check
132
+ * whether a given version of a package is installed, and not just whether it exists
133
+ *
134
+ * @param string $packageName
135
+ * @return string Version constraint usable with composer/semver
136
+ */
137
+ public static function getVersionRanges($packageName)
138
+ {
139
+ foreach (self::getInstalled() as $installed) {
140
+ if (!isset($installed['versions'][$packageName])) {
141
+ continue;
142
+ }
143
+
144
+ $ranges = array();
145
+ if (isset($installed['versions'][$packageName]['pretty_version'])) {
146
+ $ranges[] = $installed['versions'][$packageName]['pretty_version'];
147
+ }
148
+ if (array_key_exists('aliases', $installed['versions'][$packageName])) {
149
+ $ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']);
150
+ }
151
+ if (array_key_exists('replaced', $installed['versions'][$packageName])) {
152
+ $ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']);
153
+ }
154
+ if (array_key_exists('provided', $installed['versions'][$packageName])) {
155
+ $ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']);
156
+ }
157
+
158
+ return implode(' || ', $ranges);
159
+ }
160
+
161
+ throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
162
+ }
163
+
164
+ /**
165
+ * @param string $packageName
166
+ * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present
167
+ */
168
+ public static function getVersion($packageName)
169
+ {
170
+ foreach (self::getInstalled() as $installed) {
171
+ if (!isset($installed['versions'][$packageName])) {
172
+ continue;
173
+ }
174
+
175
+ if (!isset($installed['versions'][$packageName]['version'])) {
176
+ return null;
177
+ }
178
+
179
+ return $installed['versions'][$packageName]['version'];
180
+ }
181
+
182
+ throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
183
+ }
184
+
185
+ /**
186
+ * @param string $packageName
187
+ * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present
188
+ */
189
+ public static function getPrettyVersion($packageName)
190
+ {
191
+ foreach (self::getInstalled() as $installed) {
192
+ if (!isset($installed['versions'][$packageName])) {
193
+ continue;
194
+ }
195
+
196
+ if (!isset($installed['versions'][$packageName]['pretty_version'])) {
197
+ return null;
198
+ }
199
+
200
+ return $installed['versions'][$packageName]['pretty_version'];
201
+ }
202
+
203
+ throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
204
+ }
205
+
206
+ /**
207
+ * @param string $packageName
208
+ * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as reference
209
+ */
210
+ public static function getReference($packageName)
211
+ {
212
+ foreach (self::getInstalled() as $installed) {
213
+ if (!isset($installed['versions'][$packageName])) {
214
+ continue;
215
+ }
216
+
217
+ if (!isset($installed['versions'][$packageName]['reference'])) {
218
+ return null;
219
+ }
220
+
221
+ return $installed['versions'][$packageName]['reference'];
222
+ }
223
+
224
+ throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
225
+ }
226
+
227
+ /**
228
+ * @param string $packageName
229
+ * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as install path. Packages of type metapackages also have a null install path.
230
+ */
231
+ public static function getInstallPath($packageName)
232
+ {
233
+ foreach (self::getInstalled() as $installed) {
234
+ if (!isset($installed['versions'][$packageName])) {
235
+ continue;
236
+ }
237
+
238
+ return isset($installed['versions'][$packageName]['install_path']) ? $installed['versions'][$packageName]['install_path'] : null;
239
+ }
240
+
241
+ throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
242
+ }
243
+
244
+ /**
245
+ * @return array
246
+ * @psalm-return array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}
247
+ */
248
+ public static function getRootPackage()
249
+ {
250
+ $installed = self::getInstalled();
251
+
252
+ return $installed[0]['root'];
253
+ }
254
+
255
+ /**
256
+ * Returns the raw installed.php data for custom implementations
257
+ *
258
+ * @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect.
259
+ * @return array[]
260
+ * @psalm-return array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}
261
+ */
262
+ public static function getRawData()
263
+ {
264
+ @trigger_error('getRawData only returns the first dataset loaded, which may not be what you expect. Use getAllRawData() instead which returns all datasets for all autoloaders present in the process.', E_USER_DEPRECATED);
265
+
266
+ if (null === self::$installed) {
267
+ // only require the installed.php file if this file is loaded from its dumped location,
268
+ // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937
269
+ if (substr(__DIR__, -8, 1) !== 'C') {
270
+ self::$installed = include __DIR__ . '/installed.php';
271
+ } else {
272
+ self::$installed = array();
273
+ }
274
+ }
275
+
276
+ return self::$installed;
277
+ }
278
+
279
+ /**
280
+ * Returns the raw data of all installed.php which are currently loaded for custom implementations
281
+ *
282
+ * @return array[]
283
+ * @psalm-return list<array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}>
284
+ */
285
+ public static function getAllRawData()
286
+ {
287
+ return self::getInstalled();
288
+ }
289
+
290
+ /**
291
+ * Lets you reload the static array from another file
292
+ *
293
+ * This is only useful for complex integrations in which a project needs to use
294
+ * this class but then also needs to execute another project's autoloader in process,
295
+ * and wants to ensure both projects have access to their version of installed.php.
296
+ *
297
+ * A typical case would be PHPUnit, where it would need to make sure it reads all
298
+ * the data it needs from this class, then call reload() with
299
+ * `require $CWD/vendor/composer/installed.php` (or similar) as input to make sure
300
+ * the project in which it runs can then also use this class safely, without
301
+ * interference between PHPUnit's dependencies and the project's dependencies.
302
+ *
303
+ * @param array[] $data A vendor/composer/installed.php data set
304
+ * @return void
305
+ *
306
+ * @psalm-param array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $data
307
+ */
308
+ public static function reload($data)
309
+ {
310
+ self::$installed = $data;
311
+ self::$installedByVendor = array();
312
+ }
313
+
314
+ /**
315
+ * @return array[]
316
+ * @psalm-return list<array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}>
317
+ */
318
+ private static function getInstalled()
319
+ {
320
+ if (null === self::$canGetVendors) {
321
+ self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders');
322
+ }
323
+
324
+ $installed = array();
325
+
326
+ if (self::$canGetVendors) {
327
+ foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) {
328
+ if (isset(self::$installedByVendor[$vendorDir])) {
329
+ $installed[] = self::$installedByVendor[$vendorDir];
330
+ } elseif (is_file($vendorDir.'/composer/installed.php')) {
331
+ $installed[] = self::$installedByVendor[$vendorDir] = require $vendorDir.'/composer/installed.php';
332
+ if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) {
333
+ self::$installed = $installed[count($installed) - 1];
334
+ }
335
+ }
336
+ }
337
+ }
338
+
339
+ if (null === self::$installed) {
340
+ // only require the installed.php file if this file is loaded from its dumped location,
341
+ // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937
342
+ if (substr(__DIR__, -8, 1) !== 'C') {
343
+ self::$installed = require __DIR__ . '/installed.php';
344
+ } else {
345
+ self::$installed = array();
346
+ }
347
+ }
348
+ $installed[] = self::$installed;
349
+
350
+ return $installed;
351
+ }
352
+ }
includes/vendor/composer/autoload_classmap.php CHANGED
@@ -2,8 +2,9 @@
2
 
3
  // autoload_classmap.php @generated by Composer
4
 
5
- $vendorDir = dirname(dirname(__FILE__));
6
  $baseDir = dirname(dirname($vendorDir));
7
 
8
  return array(
 
9
  );
2
 
3
  // autoload_classmap.php @generated by Composer
4
 
5
+ $vendorDir = dirname(__DIR__);
6
  $baseDir = dirname(dirname($vendorDir));
7
 
8
  return array(
9
+ 'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php',
10
  );
includes/vendor/composer/autoload_namespaces.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  // autoload_namespaces.php @generated by Composer
4
 
5
- $vendorDir = dirname(dirname(__FILE__));
6
  $baseDir = dirname(dirname($vendorDir));
7
 
8
  return array(
2
 
3
  // autoload_namespaces.php @generated by Composer
4
 
5
+ $vendorDir = dirname(__DIR__);
6
  $baseDir = dirname(dirname($vendorDir));
7
 
8
  return array(
includes/vendor/composer/autoload_psr4.php CHANGED
@@ -2,9 +2,10 @@
2
 
3
  // autoload_psr4.php @generated by Composer
4
 
5
- $vendorDir = dirname(dirname(__FILE__));
6
  $baseDir = dirname(dirname($vendorDir));
7
 
8
  return array(
9
  'Firebase\\JWT\\' => array($vendorDir . '/firebase/php-jwt/src'),
 
10
  );
2
 
3
  // autoload_psr4.php @generated by Composer
4
 
5
+ $vendorDir = dirname(__DIR__);
6
  $baseDir = dirname(dirname($vendorDir));
7
 
8
  return array(
9
  'Firebase\\JWT\\' => array($vendorDir . '/firebase/php-jwt/src'),
10
+ 'Composer\\Installers\\' => array($vendorDir . '/composer/installers/src/Composer/Installers'),
11
  );
includes/vendor/composer/autoload_real.php CHANGED
@@ -13,37 +13,23 @@ class ComposerAutoloaderInit6ba6ee55693d165c056f65e51c5383a5
13
  }
14
  }
15
 
 
 
 
16
  public static function getLoader()
17
  {
18
  if (null !== self::$loader) {
19
  return self::$loader;
20
  }
21
 
 
 
22
  spl_autoload_register(array('ComposerAutoloaderInit6ba6ee55693d165c056f65e51c5383a5', 'loadClassLoader'), true, true);
23
- self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
  spl_autoload_unregister(array('ComposerAutoloaderInit6ba6ee55693d165c056f65e51c5383a5', '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\ComposerStaticInit6ba6ee55693d165c056f65e51c5383a5::getInitializer($loader));
31
- } else {
32
- $map = require __DIR__ . '/autoload_namespaces.php';
33
- foreach ($map as $namespace => $path) {
34
- $loader->set($namespace, $path);
35
- }
36
-
37
- $map = require __DIR__ . '/autoload_psr4.php';
38
- foreach ($map as $namespace => $path) {
39
- $loader->setPsr4($namespace, $path);
40
- }
41
-
42
- $classMap = require __DIR__ . '/autoload_classmap.php';
43
- if ($classMap) {
44
- $loader->addClassMap($classMap);
45
- }
46
- }
47
 
48
  $loader->register(true);
49
 
13
  }
14
  }
15
 
16
+ /**
17
+ * @return \Composer\Autoload\ClassLoader
18
+ */
19
  public static function getLoader()
20
  {
21
  if (null !== self::$loader) {
22
  return self::$loader;
23
  }
24
 
25
+ require __DIR__ . '/platform_check.php';
26
+
27
  spl_autoload_register(array('ComposerAutoloaderInit6ba6ee55693d165c056f65e51c5383a5', 'loadClassLoader'), true, true);
28
+ self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
29
  spl_autoload_unregister(array('ComposerAutoloaderInit6ba6ee55693d165c056f65e51c5383a5', 'loadClassLoader'));
30
 
31
+ require __DIR__ . '/autoload_static.php';
32
+ call_user_func(\Composer\Autoload\ComposerStaticInit6ba6ee55693d165c056f65e51c5383a5::getInitializer($loader));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
33
 
34
  $loader->register(true);
35
 
includes/vendor/composer/autoload_static.php CHANGED
@@ -11,6 +11,10 @@ class ComposerStaticInit6ba6ee55693d165c056f65e51c5383a5
11
  array (
12
  'Firebase\\JWT\\' => 13,
13
  ),
 
 
 
 
14
  );
15
 
16
  public static $prefixDirsPsr4 = array (
@@ -18,6 +22,14 @@ class ComposerStaticInit6ba6ee55693d165c056f65e51c5383a5
18
  array (
19
  0 => __DIR__ . '/..' . '/firebase/php-jwt/src',
20
  ),
 
 
 
 
 
 
 
 
21
  );
22
 
23
  public static function getInitializer(ClassLoader $loader)
@@ -25,6 +37,7 @@ class ComposerStaticInit6ba6ee55693d165c056f65e51c5383a5
25
  return \Closure::bind(function () use ($loader) {
26
  $loader->prefixLengthsPsr4 = ComposerStaticInit6ba6ee55693d165c056f65e51c5383a5::$prefixLengthsPsr4;
27
  $loader->prefixDirsPsr4 = ComposerStaticInit6ba6ee55693d165c056f65e51c5383a5::$prefixDirsPsr4;
 
28
 
29
  }, null, ClassLoader::class);
30
  }
11
  array (
12
  'Firebase\\JWT\\' => 13,
13
  ),
14
+ 'C' =>
15
+ array (
16
+ 'Composer\\Installers\\' => 20,
17
+ ),
18
  );
19
 
20
  public static $prefixDirsPsr4 = array (
22
  array (
23
  0 => __DIR__ . '/..' . '/firebase/php-jwt/src',
24
  ),
25
+ 'Composer\\Installers\\' =>
26
+ array (
27
+ 0 => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers',
28
+ ),
29
+ );
30
+
31
+ public static $classMap = array (
32
+ 'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php',
33
  );
34
 
35
  public static function getInitializer(ClassLoader $loader)
37
  return \Closure::bind(function () use ($loader) {
38
  $loader->prefixLengthsPsr4 = ComposerStaticInit6ba6ee55693d165c056f65e51c5383a5::$prefixLengthsPsr4;
39
  $loader->prefixDirsPsr4 = ComposerStaticInit6ba6ee55693d165c056f65e51c5383a5::$prefixDirsPsr4;
40
+ $loader->classMap = ComposerStaticInit6ba6ee55693d165c056f65e51c5383a5::$classMap;
41
 
42
  }, null, ClassLoader::class);
43
  }
includes/vendor/composer/installed.json CHANGED
@@ -1,50 +1,225 @@
1
- [
2
- {
3
- "name": "firebase/php-jwt",
4
- "version": "v5.0.0",
5
- "version_normalized": "5.0.0.0",
6
- "source": {
7
- "type": "git",
8
- "url": "https://github.com/firebase/php-jwt.git",
9
- "reference": "9984a4d3a32ae7673d6971ea00bae9d0a1abba0e"
10
- },
11
- "dist": {
12
- "type": "zip",
13
- "url": "https://api.github.com/repos/firebase/php-jwt/zipball/9984a4d3a32ae7673d6971ea00bae9d0a1abba0e",
14
- "reference": "9984a4d3a32ae7673d6971ea00bae9d0a1abba0e",
15
- "shasum": ""
16
- },
17
- "require": {
18
- "php": ">=5.3.0"
19
- },
20
- "require-dev": {
21
- "phpunit/phpunit": " 4.8.35"
22
- },
23
- "time": "2017-06-27T22:17:23+00:00",
24
- "type": "library",
25
- "installation-source": "dist",
26
- "autoload": {
27
- "psr-4": {
28
- "Firebase\\JWT\\": "src"
29
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
30
  },
31
- "notification-url": "https://packagist.org/downloads/",
32
- "license": [
33
- "BSD-3-Clause"
34
- ],
35
- "authors": [
36
- {
37
- "name": "Neuman Vong",
38
- "email": "neuman+pear@twilio.com",
39
- "role": "Developer"
40
- },
41
- {
42
- "name": "Anant Narayanan",
43
- "email": "anant@php.net",
44
- "role": "Developer"
45
- }
46
- ],
47
- "description": "A simple library to encode and decode JSON Web Tokens (JWT) in PHP. Should conform to the current spec.",
48
- "homepage": "https://github.com/firebase/php-jwt"
49
- }
50
- ]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "packages": [
3
+ {
4
+ "name": "composer/installers",
5
+ "version": "v1.12.0",
6
+ "version_normalized": "1.12.0.0",
7
+ "source": {
8
+ "type": "git",
9
+ "url": "https://github.com/composer/installers.git",
10
+ "reference": "d20a64ed3c94748397ff5973488761b22f6d3f19"
11
+ },
12
+ "dist": {
13
+ "type": "zip",
14
+ "url": "https://api.github.com/repos/composer/installers/zipball/d20a64ed3c94748397ff5973488761b22f6d3f19",
15
+ "reference": "d20a64ed3c94748397ff5973488761b22f6d3f19",
16
+ "shasum": ""
17
+ },
18
+ "require": {
19
+ "composer-plugin-api": "^1.0 || ^2.0"
20
+ },
21
+ "replace": {
22
+ "roundcube/plugin-installer": "*",
23
+ "shama/baton": "*"
24
+ },
25
+ "require-dev": {
26
+ "composer/composer": "1.6.* || ^2.0",
27
+ "composer/semver": "^1 || ^3",
28
+ "phpstan/phpstan": "^0.12.55",
29
+ "phpstan/phpstan-phpunit": "^0.12.16",
30
+ "symfony/phpunit-bridge": "^4.2 || ^5",
31
+ "symfony/process": "^2.3"
32
+ },
33
+ "time": "2021-09-13T08:19:44+00:00",
34
+ "type": "composer-plugin",
35
+ "extra": {
36
+ "class": "Composer\\Installers\\Plugin",
37
+ "branch-alias": {
38
+ "dev-main": "1.x-dev"
39
+ }
40
+ },
41
+ "installation-source": "dist",
42
+ "autoload": {
43
+ "psr-4": {
44
+ "Composer\\Installers\\": "src/Composer/Installers"
45
+ }
46
+ },
47
+ "notification-url": "https://packagist.org/downloads/",
48
+ "license": [
49
+ "MIT"
50
+ ],
51
+ "authors": [
52
+ {
53
+ "name": "Kyle Robinson Young",
54
+ "email": "kyle@dontkry.com",
55
+ "homepage": "https://github.com/shama"
56
+ }
57
+ ],
58
+ "description": "A multi-framework Composer library installer",
59
+ "homepage": "https://composer.github.io/installers/",
60
+ "keywords": [
61
+ "Craft",
62
+ "Dolibarr",
63
+ "Eliasis",
64
+ "Hurad",
65
+ "ImageCMS",
66
+ "Kanboard",
67
+ "Lan Management System",
68
+ "MODX Evo",
69
+ "MantisBT",
70
+ "Mautic",
71
+ "Maya",
72
+ "OXID",
73
+ "Plentymarkets",
74
+ "Porto",
75
+ "RadPHP",
76
+ "SMF",
77
+ "Starbug",
78
+ "Thelia",
79
+ "Whmcs",
80
+ "WolfCMS",
81
+ "agl",
82
+ "aimeos",
83
+ "annotatecms",
84
+ "attogram",
85
+ "bitrix",
86
+ "cakephp",
87
+ "chef",
88
+ "cockpit",
89
+ "codeigniter",
90
+ "concrete5",
91
+ "croogo",
92
+ "dokuwiki",
93
+ "drupal",
94
+ "eZ Platform",
95
+ "elgg",
96
+ "expressionengine",
97
+ "fuelphp",
98
+ "grav",
99
+ "installer",
100
+ "itop",
101
+ "joomla",
102
+ "known",
103
+ "kohana",
104
+ "laravel",
105
+ "lavalite",
106
+ "lithium",
107
+ "magento",
108
+ "majima",
109
+ "mako",
110
+ "mediawiki",
111
+ "miaoxing",
112
+ "modulework",
113
+ "modx",
114
+ "moodle",
115
+ "osclass",
116
+ "pantheon",
117
+ "phpbb",
118
+ "piwik",
119
+ "ppi",
120
+ "processwire",
121
+ "puppet",
122
+ "pxcms",
123
+ "reindex",
124
+ "roundcube",
125
+ "shopware",
126
+ "silverstripe",
127
+ "sydes",
128
+ "sylius",
129
+ "symfony",
130
+ "tastyigniter",
131
+ "typo3",
132
+ "wordpress",
133
+ "yawik",
134
+ "zend",
135
+ "zikula"
136
+ ],
137
+ "support": {
138
+ "issues": "https://github.com/composer/installers/issues",
139
+ "source": "https://github.com/composer/installers/tree/v1.12.0"
140
+ },
141
+ "funding": [
142
+ {
143
+ "url": "https://packagist.com",
144
+ "type": "custom"
145
+ },
146
+ {
147
+ "url": "https://github.com/composer",
148
+ "type": "github"
149
+ },
150
+ {
151
+ "url": "https://tidelift.com/funding/github/packagist/composer/composer",
152
+ "type": "tidelift"
153
+ }
154
+ ],
155
+ "install-path": "./installers"
156
  },
157
+ {
158
+ "name": "firebase/php-jwt",
159
+ "version": "v6.3.0",
160
+ "version_normalized": "6.3.0.0",
161
+ "source": {
162
+ "type": "git",
163
+ "url": "https://github.com/firebase/php-jwt.git",
164
+ "reference": "018dfc4e1da92ad8a1b90adc4893f476a3b41cb8"
165
+ },
166
+ "dist": {
167
+ "type": "zip",
168
+ "url": "https://api.github.com/repos/firebase/php-jwt/zipball/018dfc4e1da92ad8a1b90adc4893f476a3b41cb8",
169
+ "reference": "018dfc4e1da92ad8a1b90adc4893f476a3b41cb8",
170
+ "shasum": ""
171
+ },
172
+ "require": {
173
+ "php": "^7.1||^8.0"
174
+ },
175
+ "require-dev": {
176
+ "guzzlehttp/guzzle": "^6.5||^7.4",
177
+ "phpspec/prophecy-phpunit": "^1.1",
178
+ "phpunit/phpunit": "^7.5||^9.5",
179
+ "psr/cache": "^1.0||^2.0",
180
+ "psr/http-client": "^1.0",
181
+ "psr/http-factory": "^1.0"
182
+ },
183
+ "suggest": {
184
+ "paragonie/sodium_compat": "Support EdDSA (Ed25519) signatures when libsodium is not present"
185
+ },
186
+ "time": "2022-07-15T16:48:45+00:00",
187
+ "type": "library",
188
+ "installation-source": "dist",
189
+ "autoload": {
190
+ "psr-4": {
191
+ "Firebase\\JWT\\": "src"
192
+ }
193
+ },
194
+ "notification-url": "https://packagist.org/downloads/",
195
+ "license": [
196
+ "BSD-3-Clause"
197
+ ],
198
+ "authors": [
199
+ {
200
+ "name": "Neuman Vong",
201
+ "email": "neuman+pear@twilio.com",
202
+ "role": "Developer"
203
+ },
204
+ {
205
+ "name": "Anant Narayanan",
206
+ "email": "anant@php.net",
207
+ "role": "Developer"
208
+ }
209
+ ],
210
+ "description": "A simple library to encode and decode JSON Web Tokens (JWT) in PHP. Should conform to the current spec.",
211
+ "homepage": "https://github.com/firebase/php-jwt",
212
+ "keywords": [
213
+ "jwt",
214
+ "php"
215
+ ],
216
+ "support": {
217
+ "issues": "https://github.com/firebase/php-jwt/issues",
218
+ "source": "https://github.com/firebase/php-jwt/tree/v6.3.0"
219
+ },
220
+ "install-path": "../firebase/php-jwt"
221
+ }
222
+ ],
223
+ "dev": true,
224
+ "dev-package-names": []
225
+ }
includes/vendor/composer/installed.php ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php return array(
2
+ 'root' => array(
3
+ 'name' => 'tmeister/wp-api-jwt-auth',
4
+ 'pretty_version' => 'dev-develop',
5
+ 'version' => 'dev-develop',
6
+ 'reference' => 'a295379a9c93180daff228ce2050a376dc17acab',
7
+ 'type' => 'wordpress-plugin',
8
+ 'install_path' => __DIR__ . '/../../../',
9
+ 'aliases' => array(),
10
+ 'dev' => true,
11
+ ),
12
+ 'versions' => array(
13
+ 'composer/installers' => array(
14
+ 'pretty_version' => 'v1.12.0',
15
+ 'version' => '1.12.0.0',
16
+ 'reference' => 'd20a64ed3c94748397ff5973488761b22f6d3f19',
17
+ 'type' => 'composer-plugin',
18
+ 'install_path' => __DIR__ . '/./installers',
19
+ 'aliases' => array(),
20
+ 'dev_requirement' => false,
21
+ ),
22
+ 'firebase/php-jwt' => array(
23
+ 'pretty_version' => 'v6.3.0',
24
+ 'version' => '6.3.0.0',
25
+ 'reference' => '018dfc4e1da92ad8a1b90adc4893f476a3b41cb8',
26
+ 'type' => 'library',
27
+ 'install_path' => __DIR__ . '/../firebase/php-jwt',
28
+ 'aliases' => array(),
29
+ 'dev_requirement' => false,
30
+ ),
31
+ 'roundcube/plugin-installer' => array(
32
+ 'dev_requirement' => false,
33
+ 'replaced' => array(
34
+ 0 => '*',
35
+ ),
36
+ ),
37
+ 'shama/baton' => array(
38
+ 'dev_requirement' => false,
39
+ 'replaced' => array(
40
+ 0 => '*',
41
+ ),
42
+ ),
43
+ 'tmeister/wp-api-jwt-auth' => array(
44
+ 'pretty_version' => 'dev-develop',
45
+ 'version' => 'dev-develop',
46
+ 'reference' => 'a295379a9c93180daff228ce2050a376dc17acab',
47
+ 'type' => 'wordpress-plugin',
48
+ 'install_path' => __DIR__ . '/../../../',
49
+ 'aliases' => array(),
50
+ 'dev_requirement' => false,
51
+ ),
52
+ ),
53
+ );
includes/vendor/composer/installers/.github/workflows/continuous-integration.yml ADDED
@@ -0,0 +1,76 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: "Continuous Integration"
2
+
3
+ on:
4
+ - push
5
+ - pull_request
6
+
7
+ env:
8
+ COMPOSER_FLAGS: "--ansi --no-interaction --no-progress --prefer-dist"
9
+ SYMFONY_PHPUNIT_REMOVE_RETURN_TYPEHINT: "1"
10
+
11
+ jobs:
12
+ tests:
13
+ name: "CI"
14
+
15
+ runs-on: ubuntu-latest
16
+
17
+ strategy:
18
+ matrix:
19
+ php-version:
20
+ - "5.3"
21
+ - "5.4"
22
+ - "5.5"
23
+ - "5.6"
24
+ - "7.0"
25
+ - "7.1"
26
+ - "7.2"
27
+ - "7.3"
28
+ - "7.4"
29
+ - "8.0"
30
+ - "8.1"
31
+ dependencies: [locked]
32
+ include:
33
+ - php-version: "5.3"
34
+ dependencies: lowest
35
+ - php-version: "8.1"
36
+ dependencies: lowest
37
+
38
+ steps:
39
+ - name: "Checkout"
40
+ uses: "actions/checkout@v2"
41
+
42
+ - name: "Install PHP"
43
+ uses: "shivammathur/setup-php@v2"
44
+ with:
45
+ coverage: "none"
46
+ php-version: "${{ matrix.php-version }}"
47
+ tools: composer:snapshot
48
+
49
+ - name: Get composer cache directory
50
+ id: composercache
51
+ run: echo "::set-output name=dir::$(composer config cache-files-dir)"
52
+
53
+ - name: Cache dependencies
54
+ uses: actions/cache@v2
55
+ with:
56
+ path: ${{ steps.composercache.outputs.dir }}
57
+ key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
58
+ restore-keys: ${{ runner.os }}-composer-
59
+
60
+ - name: "Handle lowest dependencies update"
61
+ if: "contains(matrix.dependencies, 'lowest')"
62
+ run: "echo \"COMPOSER_FLAGS=$COMPOSER_FLAGS --prefer-lowest\" >> $GITHUB_ENV"
63
+
64
+ - name: "Upgrade phpunit-bridge if needed for php 8 lowest build"
65
+ if: "contains(matrix.php-version, '8.')"
66
+ run: |
67
+ composer require symfony/phpunit-bridge:^5.3.3 --dev --no-update
68
+
69
+ - name: "Install latest dependencies"
70
+ run: |
71
+ # Remove PHPStan as it requires a newer PHP
72
+ composer remove phpstan/phpstan phpstan/phpstan-phpunit --dev --no-update
73
+ composer update ${{ env.COMPOSER_FLAGS }}
74
+
75
+ - name: "Run tests"
76
+ run: "vendor/bin/simple-phpunit --verbose"
includes/vendor/composer/installers/.github/workflows/lint.yml ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: "PHP Lint"
2
+
3
+ on:
4
+ - push
5
+ - pull_request
6
+
7
+ jobs:
8
+ tests:
9
+ name: "Lint"
10
+
11
+ runs-on: ubuntu-latest
12
+
13
+ strategy:
14
+ matrix:
15
+ php-version:
16
+ - "5.3"
17
+ - "8.0"
18
+
19
+ steps:
20
+ - name: "Checkout"
21
+ uses: "actions/checkout@v2"
22
+
23
+ - name: "Install PHP"
24
+ uses: "shivammathur/setup-php@v2"
25
+ with:
26
+ coverage: "none"
27
+ php-version: "${{ matrix.php-version }}"
28
+
29
+ - name: "Lint PHP files"
30
+ run: "find src/ -type f -name '*.php' -print0 | xargs -0 -L1 -P4 -- php -l -f"
includes/vendor/composer/installers/.github/workflows/phpstan.yml ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: "PHPStan"
2
+
3
+ on:
4
+ - push
5
+ - pull_request
6
+
7
+ env:
8
+ COMPOSER_FLAGS: "--ansi --no-interaction --no-progress --prefer-dist"
9
+ SYMFONY_PHPUNIT_VERSION: ""
10
+
11
+ jobs:
12
+ tests:
13
+ name: "PHPStan"
14
+
15
+ runs-on: ubuntu-latest
16
+
17
+ strategy:
18
+ matrix:
19
+ php-version:
20
+ # pinned to 7.4 because we need PHPUnit 7.5 which does not support PHP 8
21
+ - "7.4"
22
+
23
+ steps:
24
+ - name: "Checkout"
25
+ uses: "actions/checkout@v2"
26
+
27
+ - name: "Install PHP"
28
+ uses: "shivammathur/setup-php@v2"
29
+ with:
30
+ coverage: "none"
31
+ php-version: "${{ matrix.php-version }}"
32
+
33
+ - name: Get composer cache directory
34
+ id: composercache
35
+ run: echo "::set-output name=dir::$(composer config cache-files-dir)"
36
+
37
+ - name: Cache dependencies
38
+ uses: actions/cache@v2
39
+ with:
40
+ path: ${{ steps.composercache.outputs.dir }}
41
+ key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
42
+ restore-keys: ${{ runner.os }}-composer-
43
+
44
+ - name: "Install latest dependencies"
45
+ run: "composer update ${{ env.COMPOSER_FLAGS }}"
46
+
47
+ - name: Run PHPStan
48
+ # Locked to phpunit 7.5 here as newer ones have void return types which break inheritance
49
+ run: |
50
+ composer require --dev phpunit/phpunit:^7.5.20 --with-all-dependencies ${{ env.COMPOSER_FLAGS }}
51
+ vendor/bin/phpstan analyse
includes/vendor/composer/installers/LICENSE ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Copyright (c) 2012 Kyle Robinson Young
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 furnished
8
+ to do so, subject to the following conditions:
9
+
10
+ The above copyright notice and this permission notice shall be included in all
11
+ 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.
includes/vendor/composer/installers/composer.json ADDED
@@ -0,0 +1,122 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "composer/installers",
3
+ "type": "composer-plugin",
4
+ "license": "MIT",
5
+ "description": "A multi-framework Composer library installer",
6
+ "keywords": [
7
+ "installer",
8
+ "Aimeos",
9
+ "AGL",
10
+ "AnnotateCms",
11
+ "Attogram",
12
+ "Bitrix",
13
+ "CakePHP",
14
+ "Chef",
15
+ "Cockpit",
16
+ "CodeIgniter",
17
+ "concrete5",
18
+ "Craft",
19
+ "Croogo",
20
+ "DokuWiki",
21
+ "Dolibarr",
22
+ "Drupal",
23
+ "Elgg",
24
+ "Eliasis",
25
+ "ExpressionEngine",
26
+ "eZ Platform",
27
+ "FuelPHP",
28
+ "Grav",
29
+ "Hurad",
30
+ "ImageCMS",
31
+ "iTop",
32
+ "Joomla",
33
+ "Kanboard",
34
+ "Known",
35
+ "Kohana",
36
+ "Lan Management System",
37
+ "Laravel",
38
+ "Lavalite",
39
+ "Lithium",
40
+ "Magento",
41
+ "majima",
42
+ "Mako",
43
+ "MantisBT",
44
+ "Mautic",
45
+ "Maya",
46
+ "MODX",
47
+ "MODX Evo",
48
+ "MediaWiki",
49
+ "Miaoxing",
50
+ "OXID",
51
+ "osclass",
52
+ "MODULEWork",
53
+ "Moodle",
54
+ "Pantheon",
55
+ "Piwik",
56
+ "pxcms",
57
+ "phpBB",
58
+ "Plentymarkets",
59
+ "PPI",
60
+ "Puppet",
61
+ "Porto",
62
+ "ProcessWire",
63
+ "RadPHP",
64
+ "ReIndex",
65
+ "Roundcube",
66
+ "shopware",
67
+ "SilverStripe",
68
+ "SMF",
69
+ "Starbug",
70
+ "SyDES",
71
+ "Sylius",
72
+ "symfony",
73
+ "TastyIgniter",
74
+ "Thelia",
75
+ "TYPO3",
76
+ "WHMCS",
77
+ "WolfCMS",
78
+ "WordPress",
79
+ "YAWIK",
80
+ "Zend",
81
+ "Zikula"
82
+ ],
83
+ "homepage": "https://composer.github.io/installers/",
84
+ "authors": [
85
+ {
86
+ "name": "Kyle Robinson Young",
87
+ "email": "kyle@dontkry.com",
88
+ "homepage": "https://github.com/shama"
89
+ }
90
+ ],
91
+ "autoload": {
92
+ "psr-4": { "Composer\\Installers\\": "src/Composer/Installers" }
93
+ },
94
+ "autoload-dev": {
95
+ "psr-4": { "Composer\\Installers\\Test\\": "tests/Composer/Installers/Test" }
96
+ },
97
+ "extra": {
98
+ "class": "Composer\\Installers\\Plugin",
99
+ "branch-alias": {
100
+ "dev-main": "1.x-dev"
101
+ }
102
+ },
103
+ "replace": {
104
+ "shama/baton": "*",
105
+ "roundcube/plugin-installer": "*"
106
+ },
107
+ "require": {
108
+ "composer-plugin-api": "^1.0 || ^2.0"
109
+ },
110
+ "require-dev": {
111
+ "composer/composer": "1.6.* || ^2.0",
112
+ "composer/semver": "^1 || ^3",
113
+ "symfony/phpunit-bridge": "^4.2 || ^5",
114
+ "phpstan/phpstan": "^0.12.55",
115
+ "symfony/process": "^2.3",
116
+ "phpstan/phpstan-phpunit": "^0.12.16"
117
+ },
118
+ "scripts": {
119
+ "test": "SYMFONY_PHPUNIT_REMOVE_RETURN_TYPEHINT=1 vendor/bin/simple-phpunit",
120
+ "phpstan": "vendor/bin/phpstan analyse"
121
+ }
122
+ }
includes/vendor/composer/installers/phpstan.neon.dist ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ parameters:
2
+ level: 5
3
+ paths:
4
+ - src
5
+ - tests
6
+ excludes_analyse:
7
+ - tests/Composer/Installers/Test/PolyfillTestCase.php
8
+
9
+ includes:
10
+ - vendor/phpstan/phpstan-phpunit/extension.neon
includes/vendor/composer/installers/src/Composer/Installers/AglInstaller.php ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class AglInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'module' => 'More/{$name}/',
8
+ );
9
+
10
+ /**
11
+ * Format package name to CamelCase
12
+ */
13
+ public function inflectPackageVars($vars)
14
+ {
15
+ $vars['name'] = preg_replace_callback('/(?:^|_|-)(.?)/', function ($matches) {
16
+ return strtoupper($matches[1]);
17
+ }, $vars['name']);
18
+
19
+ return $vars;
20
+ }
21
+ }
includes/vendor/composer/installers/src/Composer/Installers/AimeosInstaller.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class AimeosInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'extension' => 'ext/{$name}/',
8
+ );
9
+ }
includes/vendor/composer/installers/src/Composer/Installers/AnnotateCmsInstaller.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class AnnotateCmsInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'module' => 'addons/modules/{$name}/',
8
+ 'component' => 'addons/components/{$name}/',
9
+ 'service' => 'addons/services/{$name}/',
10
+ );
11
+ }
includes/vendor/composer/installers/src/Composer/Installers/AsgardInstaller.php ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class AsgardInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'module' => 'Modules/{$name}/',
8
+ 'theme' => 'Themes/{$name}/'
9
+ );
10
+
11
+ /**
12
+ * Format package name.
13
+ *
14
+ * For package type asgard-module, cut off a trailing '-plugin' if present.
15
+ *
16
+ * For package type asgard-theme, cut off a trailing '-theme' if present.
17
+ *
18
+ */
19
+ public function inflectPackageVars($vars)
20
+ {
21
+ if ($vars['type'] === 'asgard-module') {
22
+ return $this->inflectPluginVars($vars);
23
+ }
24
+
25
+ if ($vars['type'] === 'asgard-theme') {
26
+ return $this->inflectThemeVars($vars);
27
+ }
28
+
29
+ return $vars;
30
+ }
31
+
32
+ protected function inflectPluginVars($vars)
33
+ {
34
+ $vars['name'] = preg_replace('/-module$/', '', $vars['name']);
35
+ $vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
36
+ $vars['name'] = str_replace(' ', '', ucwords($vars['name']));
37
+
38
+ return $vars;
39
+ }
40
+
41
+ protected function inflectThemeVars($vars)
42
+ {
43
+ $vars['name'] = preg_replace('/-theme$/', '', $vars['name']);
44
+ $vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
45
+ $vars['name'] = str_replace(' ', '', ucwords($vars['name']));
46
+
47
+ return $vars;
48
+ }
49
+ }
includes/vendor/composer/installers/src/Composer/Installers/AttogramInstaller.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class AttogramInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'module' => 'modules/{$name}/',
8
+ );
9
+ }
includes/vendor/composer/installers/src/Composer/Installers/BaseInstaller.php ADDED
@@ -0,0 +1,137 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ use Composer\IO\IOInterface;
5
+ use Composer\Composer;
6
+ use Composer\Package\PackageInterface;
7
+
8
+ abstract class BaseInstaller
9
+ {
10
+ protected $locations = array();
11
+ protected $composer;
12
+ protected $package;
13
+ protected $io;
14
+
15
+ /**
16
+ * Initializes base installer.
17
+ *
18
+ * @param PackageInterface $package
19
+ * @param Composer $composer
20
+ * @param IOInterface $io
21
+ */
22
+ public function __construct(PackageInterface $package = null, Composer $composer = null, IOInterface $io = null)
23
+ {
24
+ $this->composer = $composer;
25
+ $this->package = $package;
26
+ $this->io = $io;
27
+ }
28
+
29
+ /**
30
+ * Return the install path based on package type.
31
+ *
32
+ * @param PackageInterface $package
33
+ * @param string $frameworkType
34
+ * @return string
35
+ */
36
+ public function getInstallPath(PackageInterface $package, $frameworkType = '')
37
+ {
38
+ $type = $this->package->getType();
39
+
40
+ $prettyName = $this->package->getPrettyName();
41
+ if (strpos($prettyName, '/') !== false) {
42
+ list($vendor, $name) = explode('/', $prettyName);
43
+ } else {
44
+ $vendor = '';
45
+ $name = $prettyName;
46
+ }
47
+
48
+ $availableVars = $this->inflectPackageVars(compact('name', 'vendor', 'type'));
49
+
50
+ $extra = $package->getExtra();
51
+ if (!empty($extra['installer-name'])) {
52
+ $availableVars['name'] = $extra['installer-name'];
53
+ }
54
+
55
+ if ($this->composer->getPackage()) {
56
+ $extra = $this->composer->getPackage()->getExtra();
57
+ if (!empty($extra['installer-paths'])) {
58
+ $customPath = $this->mapCustomInstallPaths($extra['installer-paths'], $prettyName, $type, $vendor);
59
+ if ($customPath !== false) {
60
+ return $this->templatePath($customPath, $availableVars);
61
+ }
62
+ }
63
+ }
64
+
65
+ $packageType = substr($type, strlen($frameworkType) + 1);
66
+ $locations = $this->getLocations();
67
+ if (!isset($locations[$packageType])) {
68
+ throw new \InvalidArgumentException(sprintf('Package type "%s" is not supported', $type));
69
+ }
70
+
71
+ return $this->templatePath($locations[$packageType], $availableVars);
72
+ }
73
+
74
+ /**
75
+ * For an installer to override to modify the vars per installer.
76
+ *
77
+ * @param array<string, string> $vars This will normally receive array{name: string, vendor: string, type: string}
78
+ * @return array<string, string>
79
+ */
80
+ public function inflectPackageVars($vars)
81
+ {
82
+ return $vars;
83
+ }
84
+
85
+ /**
86
+ * Gets the installer's locations
87
+ *
88
+ * @return array<string, string> map of package types => install path
89
+ */
90
+ public function getLocations()
91
+ {
92
+ return $this->locations;
93
+ }
94
+
95
+ /**
96
+ * Replace vars in a path
97
+ *
98
+ * @param string $path
99
+ * @param array<string, string> $vars
100
+ * @return string
101
+ */
102
+ protected function templatePath($path, array $vars = array())
103
+ {
104
+ if (strpos($path, '{') !== false) {
105
+ extract($vars);
106
+ preg_match_all('@\{\$([A-Za-z0-9_]*)\}@i', $path, $matches);
107
+ if (!empty($matches[1])) {
108
+ foreach ($matches[1] as $var) {
109
+ $path = str_replace('{$' . $var . '}', $$var, $path);
110
+ }
111
+ }
112
+ }
113
+
114
+ return $path;
115
+ }
116
+
117
+ /**
118
+ * Search through a passed paths array for a custom install path.
119
+ *
120
+ * @param array $paths
121
+ * @param string $name
122
+ * @param string $type
123
+ * @param string $vendor = NULL
124
+ * @return string|false
125
+ */
126
+ protected function mapCustomInstallPaths(array $paths, $name, $type, $vendor = NULL)
127
+ {
128
+ foreach ($paths as $path => $names) {
129
+ $names = (array) $names;
130
+ if (in_array($name, $names) || in_array('type:' . $type, $names) || in_array('vendor:' . $vendor, $names)) {
131
+ return $path;
132
+ }
133
+ }
134
+
135
+ return false;
136
+ }
137
+ }
includes/vendor/composer/installers/src/Composer/Installers/BitrixInstaller.php ADDED
@@ -0,0 +1,126 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Composer\Installers;
4
+
5
+ use Composer\Util\Filesystem;
6
+
7
+ /**
8
+ * Installer for Bitrix Framework. Supported types of extensions:
9
+ * - `bitrix-d7-module` — copy the module to directory `bitrix/modules/<vendor>.<name>`.
10
+ * - `bitrix-d7-component` — copy the component to directory `bitrix/components/<vendor>/<name>`.
11
+ * - `bitrix-d7-template` — copy the template to directory `bitrix/templates/<vendor>_<name>`.
12
+ *
13
+ * You can set custom path to directory with Bitrix kernel in `composer.json`:
14
+ *
15
+ * ```json
16
+ * {
17
+ * "extra": {
18
+ * "bitrix-dir": "s1/bitrix"
19
+ * }
20
+ * }
21
+ * ```
22
+ *
23
+ * @author Nik Samokhvalov <nik@samokhvalov.info>
24
+ * @author Denis Kulichkin <onexhovia@gmail.com>
25
+ */
26
+ class BitrixInstaller extends BaseInstaller
27
+ {
28
+ protected $locations = array(
29
+ 'module' => '{$bitrix_dir}/modules/{$name}/', // deprecated, remove on the major release (Backward compatibility will be broken)
30
+ 'component' => '{$bitrix_dir}/components/{$name}/', // deprecated, remove on the major release (Backward compatibility will be broken)
31
+ 'theme' => '{$bitrix_dir}/templates/{$name}/', // deprecated, remove on the major release (Backward compatibility will be broken)
32
+ 'd7-module' => '{$bitrix_dir}/modules/{$vendor}.{$name}/',
33
+ 'd7-component' => '{$bitrix_dir}/components/{$vendor}/{$name}/',
34
+ 'd7-template' => '{$bitrix_dir}/templates/{$vendor}_{$name}/',
35
+ );
36
+
37
+ /**
38
+ * @var array Storage for informations about duplicates at all the time of installation packages.
39
+ */
40
+ private static $checkedDuplicates = array();
41
+
42
+ /**
43
+ * {@inheritdoc}
44
+ */
45
+ public function inflectPackageVars($vars)
46
+ {
47
+ if ($this->composer->getPackage()) {
48
+ $extra = $this->composer->getPackage()->getExtra();
49
+
50
+ if (isset($extra['bitrix-dir'])) {
51
+ $vars['bitrix_dir'] = $extra['bitrix-dir'];
52
+ }
53
+ }
54
+
55
+ if (!isset($vars['bitrix_dir'])) {
56
+ $vars['bitrix_dir'] = 'bitrix';
57
+ }
58
+
59
+ return parent::inflectPackageVars($vars);
60
+ }
61
+
62
+ /**
63
+ * {@inheritdoc}
64
+ */
65
+ protected function templatePath($path, array $vars = array())
66
+ {
67
+ $templatePath = parent::templatePath($path, $vars);
68
+ $this->checkDuplicates($templatePath, $vars);
69
+
70
+ return $templatePath;
71
+ }
72
+
73
+ /**
74
+ * Duplicates search packages.
75
+ *
76
+ * @param string $path
77
+ * @param array $vars
78
+ */
79
+ protected function checkDuplicates($path, array $vars = array())
80
+ {
81
+ $packageType = substr($vars['type'], strlen('bitrix') + 1);
82
+ $localDir = explode('/', $vars['bitrix_dir']);
83
+ array_pop($localDir);
84
+ $localDir[] = 'local';
85
+ $localDir = implode('/', $localDir);
86
+
87
+ $oldPath = str_replace(
88
+ array('{$bitrix_dir}', '{$name}'),
89
+ array($localDir, $vars['name']),
90
+ $this->locations[$packageType]
91
+ );
92
+
93
+ if (in_array($oldPath, static::$checkedDuplicates)) {
94
+ return;
95
+ }
96
+
97
+ if ($oldPath !== $path && file_exists($oldPath) && $this->io && $this->io->isInteractive()) {
98
+
99
+ $this->io->writeError(' <error>Duplication of packages:</error>');
100
+ $this->io->writeError(' <info>Package ' . $oldPath . ' will be called instead package ' . $path . '</info>');
101
+
102
+ while (true) {
103
+ switch ($this->io->ask(' <info>Delete ' . $oldPath . ' [y,n,?]?</info> ', '?')) {
104
+ case 'y':
105
+ $fs = new Filesystem();
106
+ $fs->removeDirectory($oldPath);
107
+ break 2;
108
+
109
+ case 'n':
110
+ break 2;
111
+
112
+ case '?':
113
+ default:
114
+ $this->io->writeError(array(
115
+ ' y - delete package ' . $oldPath . ' and to continue with the installation',
116
+ ' n - don\'t delete and to continue with the installation',
117
+ ));
118
+ $this->io->writeError(' ? - print help');
119
+ break;
120
+ }
121
+ }
122
+ }
123
+
124
+ static::$checkedDuplicates[] = $oldPath;
125
+ }
126
+ }
includes/vendor/composer/installers/src/Composer/Installers/BonefishInstaller.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class BonefishInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'package' => 'Packages/{$vendor}/{$name}/'
8
+ );
9
+ }
includes/vendor/composer/installers/src/Composer/Installers/CakePHPInstaller.php ADDED
@@ -0,0 +1,66 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ use Composer\DependencyResolver\Pool;
5
+ use Composer\Semver\Constraint\Constraint;
6
+
7
+ class CakePHPInstaller extends BaseInstaller
8
+ {
9
+ protected $locations = array(
10
+ 'plugin' => 'Plugin/{$name}/',
11
+ );
12
+
13
+ /**
14
+ * Format package name to CamelCase
15
+ */
16
+ public function inflectPackageVars($vars)
17
+ {
18
+ if ($this->matchesCakeVersion('>=', '3.0.0')) {
19
+ return $vars;
20
+ }
21
+
22
+ $nameParts = explode('/', $vars['name']);
23
+ foreach ($nameParts as &$value) {
24
+ $value = strtolower(preg_replace('/(?<=\\w)([A-Z])/', '_\\1', $value));
25
+ $value = str_replace(array('-', '_'), ' ', $value);
26
+ $value = str_replace(' ', '', ucwords($value));
27
+ }
28
+ $vars['name'] = implode('/', $nameParts);
29
+
30
+ return $vars;
31
+ }
32
+
33
+ /**
34
+ * Change the default plugin location when cakephp >= 3.0
35
+ */
36
+ public function getLocations()
37
+ {
38
+ if ($this->matchesCakeVersion('>=', '3.0.0')) {
39
+ $this->locations['plugin'] = $this->composer->getConfig()->get('vendor-dir') . '/{$vendor}/{$name}/';
40
+ }
41
+ return $this->locations;
42
+ }
43
+
44
+ /**
45
+ * Check if CakePHP version matches against a version
46
+ *
47
+ * @param string $matcher
48
+ * @param string $version
49
+ * @return bool
50
+ * @phpstan-param Constraint::STR_OP_* $matcher
51
+ */
52
+ protected function matchesCakeVersion($matcher, $version)
53
+ {
54
+ $repositoryManager = $this->composer->getRepositoryManager();
55
+ if (! $repositoryManager) {
56
+ return false;
57
+ }
58
+
59
+ $repos = $repositoryManager->getLocalRepository();
60
+ if (!$repos) {
61
+ return false;
62
+ }
63
+
64
+ return $repos->findPackage('cakephp/cakephp', new Constraint($matcher, $version)) !== null;
65
+ }
66
+ }
includes/vendor/composer/installers/src/Composer/Installers/ChefInstaller.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class ChefInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'cookbook' => 'Chef/{$vendor}/{$name}/',
8
+ 'role' => 'Chef/roles/{$name}/',
9
+ );
10
+ }
11
+
includes/vendor/composer/installers/src/Composer/Installers/CiviCrmInstaller.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class CiviCrmInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'ext' => 'ext/{$name}/'
8
+ );
9
+ }
includes/vendor/composer/installers/src/Composer/Installers/ClanCatsFrameworkInstaller.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class ClanCatsFrameworkInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'ship' => 'CCF/orbit/{$name}/',
8
+ 'theme' => 'CCF/app/themes/{$name}/',
9
+ );
10
+ }
includes/vendor/composer/installers/src/Composer/Installers/CockpitInstaller.php ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class CockpitInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'module' => 'cockpit/modules/addons/{$name}/',
8
+ );
9
+
10
+ /**
11
+ * Format module name.
12
+ *
13
+ * Strip `module-` prefix from package name.
14
+ *
15
+ * {@inheritDoc}
16
+ */
17
+ public function inflectPackageVars($vars)
18
+ {
19
+ if ($vars['type'] == 'cockpit-module') {
20
+ return $this->inflectModuleVars($vars);
21
+ }
22
+
23
+ return $vars;
24
+ }
25
+
26
+ public function inflectModuleVars($vars)
27
+ {
28
+ $vars['name'] = ucfirst(preg_replace('/cockpit-/i', '', $vars['name']));
29
+
30
+ return $vars;
31
+ }
32
+ }
includes/vendor/composer/installers/src/Composer/Installers/CodeIgniterInstaller.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class CodeIgniterInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'library' => 'application/libraries/{$name}/',
8
+ 'third-party' => 'application/third_party/{$name}/',
9
+ 'module' => 'application/modules/{$name}/',
10
+ );
11
+ }
includes/vendor/composer/installers/src/Composer/Installers/Concrete5Installer.php ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class Concrete5Installer extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'core' => 'concrete/',
8
+ 'block' => 'application/blocks/{$name}/',
9
+ 'package' => 'packages/{$name}/',
10
+ 'theme' => 'application/themes/{$name}/',
11
+ 'update' => 'updates/{$name}/',
12
+ );
13
+ }
includes/vendor/composer/installers/src/Composer/Installers/CraftInstaller.php ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ /**
5
+ * Installer for Craft Plugins
6
+ */
7
+ class CraftInstaller extends BaseInstaller
8
+ {
9
+ const NAME_PREFIX = 'craft';
10
+ const NAME_SUFFIX = 'plugin';
11
+
12
+ protected $locations = array(
13
+ 'plugin' => 'craft/plugins/{$name}/',
14
+ );
15
+
16
+ /**
17
+ * Strip `craft-` prefix and/or `-plugin` suffix from package names
18
+ *
19
+ * @param array $vars
20
+ *
21
+ * @return array
22
+ */
23
+ final public function inflectPackageVars($vars)
24
+ {
25
+ return $this->inflectPluginVars($vars);
26
+ }
27
+
28
+ private function inflectPluginVars($vars)
29
+ {
30
+ $vars['name'] = preg_replace('/-' . self::NAME_SUFFIX . '$/i', '', $vars['name']);
31
+ $vars['name'] = preg_replace('/^' . self::NAME_PREFIX . '-/i', '', $vars['name']);
32
+
33
+ return $vars;
34
+ }
35
+ }
includes/vendor/composer/installers/src/Composer/Installers/CroogoInstaller.php ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class CroogoInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'plugin' => 'Plugin/{$name}/',
8
+ 'theme' => 'View/Themed/{$name}/',
9
+ );
10
+
11
+ /**
12
+ * Format package name to CamelCase
13
+ */
14
+ public function inflectPackageVars($vars)
15
+ {
16
+ $vars['name'] = strtolower(str_replace(array('-', '_'), ' ', $vars['name']));
17
+ $vars['name'] = str_replace(' ', '', ucwords($vars['name']));
18
+
19
+ return $vars;
20
+ }
21
+ }
includes/vendor/composer/installers/src/Composer/Installers/DecibelInstaller.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class DecibelInstaller extends BaseInstaller
5
+ {
6
+ /** @var array */
7
+ protected $locations = array(
8
+ 'app' => 'app/{$name}/',
9
+ );
10
+ }
includes/vendor/composer/installers/src/Composer/Installers/DframeInstaller.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Composer\Installers;
4
+
5
+ class DframeInstaller extends BaseInstaller
6
+ {
7
+ protected $locations = array(
8
+ 'module' => 'modules/{$vendor}/{$name}/',
9
+ );
10
+ }
includes/vendor/composer/installers/src/Composer/Installers/DokuWikiInstaller.php ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class DokuWikiInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'plugin' => 'lib/plugins/{$name}/',
8
+ 'template' => 'lib/tpl/{$name}/',
9
+ );
10
+
11
+ /**
12
+ * Format package name.
13
+ *
14
+ * For package type dokuwiki-plugin, cut off a trailing '-plugin',
15
+ * or leading dokuwiki_ if present.
16
+ *
17
+ * For package type dokuwiki-template, cut off a trailing '-template' if present.
18
+ *
19
+ */
20
+ public function inflectPackageVars($vars)
21
+ {
22
+
23
+ if ($vars['type'] === 'dokuwiki-plugin') {
24
+ return $this->inflectPluginVars($vars);
25
+ }
26
+
27
+ if ($vars['type'] === 'dokuwiki-template') {
28
+ return $this->inflectTemplateVars($vars);
29
+ }
30
+
31
+ return $vars;
32
+ }
33
+
34
+ protected function inflectPluginVars($vars)
35
+ {
36
+ $vars['name'] = preg_replace('/-plugin$/', '', $vars['name']);
37
+ $vars['name'] = preg_replace('/^dokuwiki_?-?/', '', $vars['name']);
38
+
39
+ return $vars;
40
+ }
41
+
42
+ protected function inflectTemplateVars($vars)
43
+ {
44
+ $vars['name'] = preg_replace('/-template$/', '', $vars['name']);
45
+ $vars['name'] = preg_replace('/^dokuwiki_?-?/', '', $vars['name']);
46
+
47
+ return $vars;
48
+ }
49
+
50
+ }
includes/vendor/composer/installers/src/Composer/Installers/DolibarrInstaller.php ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ /**
5
+ * Class DolibarrInstaller
6
+ *
7
+ * @package Composer\Installers
8
+ * @author Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
9
+ */
10
+ class DolibarrInstaller extends BaseInstaller
11
+ {
12
+ //TODO: Add support for scripts and themes
13
+ protected $locations = array(
14
+ 'module' => 'htdocs/custom/{$name}/',
15
+ );
16
+ }
includes/vendor/composer/installers/src/Composer/Installers/DrupalInstaller.php ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class DrupalInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'core' => 'core/',
8
+ 'module' => 'modules/{$name}/',
9
+ 'theme' => 'themes/{$name}/',
10
+ 'library' => 'libraries/{$name}/',
11
+ 'profile' => 'profiles/{$name}/',
12
+ 'database-driver' => 'drivers/lib/Drupal/Driver/Database/{$name}/',
13
+ 'drush' => 'drush/{$name}/',
14
+ 'custom-theme' => 'themes/custom/{$name}/',
15
+ 'custom-module' => 'modules/custom/{$name}/',
16
+ 'custom-profile' => 'profiles/custom/{$name}/',
17
+ 'drupal-multisite' => 'sites/{$name}/',
18
+ 'console' => 'console/{$name}/',
19
+ 'console-language' => 'console/language/{$name}/',
20
+ 'config' => 'config/sync/',
21
+ );
22
+ }
includes/vendor/composer/installers/src/Composer/Installers/ElggInstaller.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class ElggInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'plugin' => 'mod/{$name}/',
8
+ );
9
+ }
includes/vendor/composer/installers/src/Composer/Installers/EliasisInstaller.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class EliasisInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'component' => 'components/{$name}/',
8
+ 'module' => 'modules/{$name}/',
9
+ 'plugin' => 'plugins/{$name}/',
10
+ 'template' => 'templates/{$name}/',
11
+ );
12
+ }
includes/vendor/composer/installers/src/Composer/Installers/ExpressionEngineInstaller.php ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ use Composer\Package\PackageInterface;
5
+
6
+ class ExpressionEngineInstaller extends BaseInstaller
7
+ {
8
+
9
+ protected $locations = array();
10
+
11
+ private $ee2Locations = array(
12
+ 'addon' => 'system/expressionengine/third_party/{$name}/',
13
+ 'theme' => 'themes/third_party/{$name}/',
14
+ );
15
+
16
+ private $ee3Locations = array(
17
+ 'addon' => 'system/user/addons/{$name}/',
18
+ 'theme' => 'themes/user/{$name}/',
19
+ );
20
+
21
+ public function getInstallPath(PackageInterface $package, $frameworkType = '')
22
+ {
23
+
24
+ $version = "{$frameworkType}Locations";
25
+ $this->locations = $this->$version;
26
+
27
+ return parent::getInstallPath($package, $frameworkType);
28
+ }
29
+ }
includes/vendor/composer/installers/src/Composer/Installers/EzPlatformInstaller.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class EzPlatformInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'meta-assets' => 'web/assets/ezplatform/',
8
+ 'assets' => 'web/assets/ezplatform/{$name}/',
9
+ );
10
+ }
includes/vendor/composer/installers/src/Composer/Installers/FuelInstaller.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class FuelInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'module' => 'fuel/app/modules/{$name}/',
8
+ 'package' => 'fuel/packages/{$name}/',
9
+ 'theme' => 'fuel/app/themes/{$name}/',
10
+ );
11
+ }
includes/vendor/composer/installers/src/Composer/Installers/FuelphpInstaller.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class FuelphpInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'component' => 'components/{$name}/',
8
+ );
9
+ }
includes/vendor/composer/installers/src/Composer/Installers/GravInstaller.php ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class GravInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'plugin' => 'user/plugins/{$name}/',
8
+ 'theme' => 'user/themes/{$name}/',
9
+ );
10
+
11
+ /**
12
+ * Format package name
13
+ *
14
+ * @param array $vars
15
+ *
16
+ * @return array
17
+ */
18
+ public function inflectPackageVars($vars)
19
+ {
20
+ $restrictedWords = implode('|', array_keys($this->locations));
21
+
22
+ $vars['name'] = strtolower($vars['name']);
23
+ $vars['name'] = preg_replace('/^(?:grav-)?(?:(?:'.$restrictedWords.')-)?(.*?)(?:-(?:'.$restrictedWords.'))?$/ui',
24
+ '$1',
25
+ $vars['name']
26
+ );
27
+
28
+ return $vars;
29
+ }
30
+ }
includes/vendor/composer/installers/src/Composer/Installers/HuradInstaller.php ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class HuradInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'plugin' => 'plugins/{$name}/',
8
+ 'theme' => 'plugins/{$name}/',
9
+ );
10
+
11
+ /**
12
+ * Format package name to CamelCase
13
+ */
14
+ public function inflectPackageVars($vars)
15
+ {
16
+ $nameParts = explode('/', $vars['name']);
17
+ foreach ($nameParts as &$value) {
18
+ $value = strtolower(preg_replace('/(?<=\\w)([A-Z])/', '_\\1', $value));
19
+ $value = str_replace(array('-', '_'), ' ', $value);
20
+ $value = str_replace(' ', '', ucwords($value));
21
+ }
22
+ $vars['name'] = implode('/', $nameParts);
23
+ return $vars;
24
+ }
25
+ }
includes/vendor/composer/installers/src/Composer/Installers/ImageCMSInstaller.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class ImageCMSInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'template' => 'templates/{$name}/',
8
+ 'module' => 'application/modules/{$name}/',
9
+ 'library' => 'application/libraries/{$name}/',
10
+ );
11
+ }
includes/vendor/composer/installers/src/Composer/Installers/Installer.php ADDED
@@ -0,0 +1,298 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Composer\Installers;
4
+
5
+ use Composer\Composer;
6
+ use Composer\Installer\BinaryInstaller;
7
+ use Composer\Installer\LibraryInstaller;
8
+ use Composer\IO\IOInterface;
9
+ use Composer\Package\PackageInterface;
10
+ use Composer\Repository\InstalledRepositoryInterface;
11
+ use Composer\Util\Filesystem;
12
+ use React\Promise\PromiseInterface;
13
+
14
+ class Installer extends LibraryInstaller
15
+ {
16
+
17
+ /**
18
+ * Package types to installer class map
19
+ *
20
+ * @var array
21
+ */
22
+ private $supportedTypes = array(
23
+ 'aimeos' => 'AimeosInstaller',
24
+ 'asgard' => 'AsgardInstaller',
25
+ 'attogram' => 'AttogramInstaller',
26
+ 'agl' => 'AglInstaller',
27
+ 'annotatecms' => 'AnnotateCmsInstaller',
28
+ 'bitrix' => 'BitrixInstaller',
29
+ 'bonefish' => 'BonefishInstaller',
30
+ 'cakephp' => 'CakePHPInstaller',
31
+ 'chef' => 'ChefInstaller',
32
+ 'civicrm' => 'CiviCrmInstaller',
33
+ 'ccframework' => 'ClanCatsFrameworkInstaller',
34
+ 'cockpit' => 'CockpitInstaller',
35
+ 'codeigniter' => 'CodeIgniterInstaller',
36
+ 'concrete5' => 'Concrete5Installer',
37
+ 'craft' => 'CraftInstaller',
38
+ 'croogo' => 'CroogoInstaller',
39
+ 'dframe' => 'DframeInstaller',
40
+ 'dokuwiki' => 'DokuWikiInstaller',
41
+ 'dolibarr' => 'DolibarrInstaller',
42
+ 'decibel' => 'DecibelInstaller',
43
+ 'drupal' => 'DrupalInstaller',
44
+ 'elgg' => 'ElggInstaller',
45
+ 'eliasis' => 'EliasisInstaller',
46
+ 'ee3' => 'ExpressionEngineInstaller',
47
+ 'ee2' => 'ExpressionEngineInstaller',
48
+ 'ezplatform' => 'EzPlatformInstaller',
49
+ 'fuel' => 'FuelInstaller',
50
+ 'fuelphp' => 'FuelphpInstaller',
51
+ 'grav' => 'GravInstaller',
52
+ 'hurad' => 'HuradInstaller',
53
+ 'tastyigniter' => 'TastyIgniterInstaller',
54
+ 'imagecms' => 'ImageCMSInstaller',
55
+ 'itop' => 'ItopInstaller',
56
+ 'joomla' => 'JoomlaInstaller',
57
+ 'kanboard' => 'KanboardInstaller',
58
+ 'kirby' => 'KirbyInstaller',
59
+ 'known' => 'KnownInstaller',
60
+ 'kodicms' => 'KodiCMSInstaller',
61
+ 'kohana' => 'KohanaInstaller',
62
+ 'lms' => 'LanManagementSystemInstaller',
63
+ 'laravel' => 'LaravelInstaller',
64
+ 'lavalite' => 'LavaLiteInstaller',
65
+ 'lithium' => 'LithiumInstaller',
66
+ 'magento' => 'MagentoInstaller',
67
+ 'majima' => 'MajimaInstaller',
68
+ 'mantisbt' => 'MantisBTInstaller',
69
+ 'mako' => 'MakoInstaller',
70
+ 'maya' => 'MayaInstaller',
71
+ 'mautic' => 'MauticInstaller',
72
+ 'mediawiki' => 'MediaWikiInstaller',
73
+ 'miaoxing' => 'MiaoxingInstaller',
74
+ 'microweber' => 'MicroweberInstaller',
75
+ 'modulework' => 'MODULEWorkInstaller',
76
+ 'modx' => 'ModxInstaller',
77
+ 'modxevo' => 'MODXEvoInstaller',
78
+ 'moodle' => 'MoodleInstaller',
79
+ 'october' => 'OctoberInstaller',
80
+ 'ontowiki' => 'OntoWikiInstaller',
81
+ 'oxid' => 'OxidInstaller',
82
+ 'osclass' => 'OsclassInstaller',
83
+ 'pxcms' => 'PxcmsInstaller',
84
+ 'phpbb' => 'PhpBBInstaller',
85
+ 'pimcore' => 'PimcoreInstaller',
86
+ 'piwik' => 'PiwikInstaller',
87
+ 'plentymarkets'=> 'PlentymarketsInstaller',
88
+ 'ppi' => 'PPIInstaller',
89
+ 'puppet' => 'PuppetInstaller',
90
+ 'radphp' => 'RadPHPInstaller',
91
+ 'phifty' => 'PhiftyInstaller',
92
+ 'porto' => 'PortoInstaller',
93
+ 'processwire' => 'ProcessWireInstaller',
94
+ 'quicksilver' => 'PantheonInstaller',
95
+ 'redaxo' => 'RedaxoInstaller',
96
+ 'redaxo5' => 'Redaxo5Installer',
97
+ 'reindex' => 'ReIndexInstaller',
98
+ 'roundcube' => 'RoundcubeInstaller',
99
+ 'shopware' => 'ShopwareInstaller',
100
+ 'sitedirect' => 'SiteDirectInstaller',
101
+ 'silverstripe' => 'SilverStripeInstaller',
102
+ 'smf' => 'SMFInstaller',
103
+ 'starbug' => 'StarbugInstaller',
104
+ 'sydes' => 'SyDESInstaller',
105
+ 'sylius' => 'SyliusInstaller',
106
+ 'symfony1' => 'Symfony1Installer',
107
+ 'tao' => 'TaoInstaller',
108
+ 'thelia' => 'TheliaInstaller',
109
+ 'tusk' => 'TuskInstaller',
110
+ 'typo3-cms' => 'TYPO3CmsInstaller',
111
+ 'typo3-flow' => 'TYPO3FlowInstaller',
112
+ 'userfrosting' => 'UserFrostingInstaller',
113
+ 'vanilla' => 'VanillaInstaller',
114
+ 'whmcs' => 'WHMCSInstaller',
115
+ 'winter' => 'WinterInstaller',
116
+ 'wolfcms' => 'WolfCMSInstaller',
117
+ 'wordpress' => 'WordPressInstaller',
118
+ 'yawik' => 'YawikInstaller',
119
+ 'zend' => 'ZendInstaller',
120
+ 'zikula' => 'ZikulaInstaller',
121
+ 'prestashop' => 'PrestashopInstaller'
122
+ );
123
+
124
+ /**
125
+ * Installer constructor.
126
+ *
127
+ * Disables installers specified in main composer extra installer-disable
128
+ * list
129
+ *
130
+ * @param IOInterface $io
131
+ * @param Composer $composer
132
+ * @param string $type
133
+ * @param Filesystem|null $filesystem
134
+ * @param BinaryInstaller|null $binaryInstaller
135
+ */
136
+ public function __construct(
137
+ IOInterface $io,
138
+ Composer $composer,
139
+ $type = 'library',
140
+ Filesystem $filesystem = null,
141
+ BinaryInstaller $binaryInstaller = null
142
+ ) {
143
+ parent::__construct($io, $composer, $type, $filesystem,
144
+ $binaryInstaller);
145
+ $this->removeDisabledInstallers();
146
+ }
147
+
148
+ /**
149
+ * {@inheritDoc}
150
+ */
151
+ public function getInstallPath(PackageInterface $package)
152
+ {
153
+ $type = $package->getType();
154
+ $frameworkType = $this->findFrameworkType($type);
155
+
156
+ if ($frameworkType === false) {
157
+ throw new \InvalidArgumentException(
158
+ 'Sorry the package type of this package is not yet supported.'
159
+ );
160
+ }
161
+
162
+ $class = 'Composer\\Installers\\' . $this->supportedTypes[$frameworkType];
163
+ $installer = new $class($package, $this->composer, $this->getIO());
164
+
165
+ return $installer->getInstallPath($package, $frameworkType);
166
+ }
167
+
168
+ public function uninstall(InstalledRepositoryInterface $repo, PackageInterface $package)
169
+ {
170
+ $installPath = $this->getPackageBasePath($package);
171
+ $io = $this->io;
172
+ $outputStatus = function () use ($io, $installPath) {
173
+ $io->write(sprintf('Deleting %s - %s', $installPath, !file_exists($installPath) ? '<comment>deleted</comment>' : '<error>not deleted</error>'));
174
+ };
175
+
176
+ $promise = parent::uninstall($repo, $package);
177
+
178
+ // Composer v2 might return a promise here
179
+ if ($promise instanceof PromiseInterface) {
180
+ return $promise->then($outputStatus);
181
+ }
182
+
183
+ // If not, execute the code right away as parent::uninstall executed synchronously (composer v1, or v2 without async)
184
+ $outputStatus();
185
+
186
+ return null;
187
+ }
188
+
189
+ /**
190
+ * {@inheritDoc}
191
+ */
192
+ public function supports($packageType)
193
+ {
194
+ $frameworkType = $this->findFrameworkType($packageType);
195
+
196
+ if ($frameworkType === false) {
197
+ return false;
198
+ }
199
+
200
+ $locationPattern = $this->getLocationPattern($frameworkType);
201
+
202
+ return preg_match('#' . $frameworkType . '-' . $locationPattern . '#', $packageType, $matches) === 1;
203
+ }
204
+
205
+ /**
206
+ * Finds a supported framework type if it exists and returns it
207
+ *
208
+ * @param string $type
209
+ * @return string|false
210
+ */
211
+ protected function findFrameworkType($type)
212
+ {
213
+ krsort($this->supportedTypes);
214
+
215
+ foreach ($this->supportedTypes as $key => $val) {
216
+ if ($key === substr($type, 0, strlen($key))) {
217
+ return substr($type, 0, strlen($key));
218
+ }
219
+ }
220
+
221
+ return false;
222
+ }
223
+
224
+ /**
225
+ * Get the second part of the regular expression to check for support of a
226
+ * package type
227
+ *
228
+ * @param string $frameworkType
229
+ * @return string
230
+ */
231
+ protected function getLocationPattern($frameworkType)
232
+ {
233
+ $pattern = false;
234
+ if (!empty($this->supportedTypes[$frameworkType])) {
235
+ $frameworkClass = 'Composer\\Installers\\' . $this->supportedTypes[$frameworkType];
236
+ /** @var BaseInstaller $framework */
237
+ $framework = new $frameworkClass(null, $this->composer, $this->getIO());
238
+ $locations = array_keys($framework->getLocations());
239
+ $pattern = $locations ? '(' . implode('|', $locations) . ')' : false;
240
+ }
241
+
242
+ return $pattern ? : '(\w+)';
243
+ }
244
+
245
+ /**
246
+ * Get I/O object
247
+ *
248
+ * @return IOInterface
249
+ */
250
+ private function getIO()
251
+ {
252
+ return $this->io;
253
+ }
254
+
255
+ /**
256
+ * Look for installers set to be disabled in composer's extra config and
257
+ * remove them from the list of supported installers.
258
+ *
259
+ * Globals:
260
+ * - true, "all", and "*" - disable all installers.
261
+ * - false - enable all installers (useful with
262
+ * wikimedia/composer-merge-plugin or similar)
263
+ *
264
+ * @return void
265
+ */
266
+ protected function removeDisabledInstallers()
267
+ {
268
+ $extra = $this->composer->getPackage()->getExtra();
269
+
270
+ if (!isset($extra['installer-disable']) || $extra['installer-disable'] === false) {
271
+ // No installers are disabled
272
+ return;
273
+ }
274
+
275
+ // Get installers to disable
276
+ $disable = $extra['installer-disable'];
277
+
278
+ // Ensure $disabled is an array
279
+ if (!is_array($disable)) {
280
+ $disable = array($disable);
281
+ }
282
+
283
+ // Check which installers should be disabled
284
+ $all = array(true, "all", "*");
285
+ $intersect = array_intersect($all, $disable);
286
+ if (!empty($intersect)) {
287
+ // Disable all installers
288
+ $this->supportedTypes = array();
289
+ } else {
290
+ // Disable specified installers
291
+ foreach ($disable as $key => $installer) {
292
+ if (is_string($installer) && key_exists($installer, $this->supportedTypes)) {
293
+ unset($this->supportedTypes[$installer]);
294
+ }
295
+ }
296
+ }
297
+ }
298
+ }
includes/vendor/composer/installers/src/Composer/Installers/ItopInstaller.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class ItopInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'extension' => 'extensions/{$name}/',
8
+ );
9
+ }
includes/vendor/composer/installers/src/Composer/Installers/JoomlaInstaller.php ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class JoomlaInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'component' => 'components/{$name}/',
8
+ 'module' => 'modules/{$name}/',
9
+ 'template' => 'templates/{$name}/',
10
+ 'plugin' => 'plugins/{$name}/',
11
+ 'library' => 'libraries/{$name}/',
12
+ );
13
+
14
+ // TODO: Add inflector for mod_ and com_ names
15
+ }
includes/vendor/composer/installers/src/Composer/Installers/KanboardInstaller.php ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ /**
5
+ *
6
+ * Installer for kanboard plugins
7
+ *
8
+ * kanboard.net
9
+ *
10
+ * Class KanboardInstaller
11
+ * @package Composer\Installers
12
+ */
13
+ class KanboardInstaller extends BaseInstaller
14
+ {
15
+ protected $locations = array(
16
+ 'plugin' => 'plugins/{$name}/',
17
+ );
18
+ }
includes/vendor/composer/installers/src/Composer/Installers/KirbyInstaller.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class KirbyInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'plugin' => 'site/plugins/{$name}/',
8
+ 'field' => 'site/fields/{$name}/',
9
+ 'tag' => 'site/tags/{$name}/'
10
+ );
11
+ }
includes/vendor/composer/installers/src/Composer/Installers/KnownInstaller.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class KnownInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'plugin' => 'IdnoPlugins/{$name}/',
8
+ 'theme' => 'Themes/{$name}/',
9
+ 'console' => 'ConsolePlugins/{$name}/',
10
+ );
11
+ }
includes/vendor/composer/installers/src/Composer/Installers/KodiCMSInstaller.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class KodiCMSInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'plugin' => 'cms/plugins/{$name}/',
8
+ 'media' => 'cms/media/vendor/{$name}/'
9
+ );
10
+ }
includes/vendor/composer/installers/src/Composer/Installers/KohanaInstaller.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class KohanaInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'module' => 'modules/{$name}/',
8
+ );
9
+ }
includes/vendor/composer/installers/src/Composer/Installers/LanManagementSystemInstaller.php ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Composer\Installers;
4
+
5
+ class LanManagementSystemInstaller extends BaseInstaller
6
+ {
7
+
8
+ protected $locations = array(
9
+ 'plugin' => 'plugins/{$name}/',
10
+ 'template' => 'templates/{$name}/',
11
+ 'document-template' => 'documents/templates/{$name}/',
12
+ 'userpanel-module' => 'userpanel/modules/{$name}/',
13
+ );
14
+
15
+ /**
16
+ * Format package name to CamelCase
17
+ */
18
+ public function inflectPackageVars($vars)
19
+ {
20
+ $vars['name'] = strtolower(preg_replace('/(?<=\\w)([A-Z])/', '_\\1', $vars['name']));
21
+ $vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
22
+ $vars['name'] = str_replace(' ', '', ucwords($vars['name']));
23
+
24
+ return $vars;
25
+ }
26
+
27
+ }
includes/vendor/composer/installers/src/Composer/Installers/LaravelInstaller.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class LaravelInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'library' => 'libraries/{$name}/',
8
+ );
9
+ }
includes/vendor/composer/installers/src/Composer/Installers/LavaLiteInstaller.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class LavaLiteInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'package' => 'packages/{$vendor}/{$name}/',
8
+ 'theme' => 'public/themes/{$name}/',
9
+ );
10
+ }
includes/vendor/composer/installers/src/Composer/Installers/LithiumInstaller.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class LithiumInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'library' => 'libraries/{$name}/',
8
+ 'source' => 'libraries/_source/{$name}/',
9
+ );
10
+ }
includes/vendor/composer/installers/src/Composer/Installers/MODULEWorkInstaller.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class MODULEWorkInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'module' => 'modules/{$name}/',
8
+ );
9
+ }
includes/vendor/composer/installers/src/Composer/Installers/MODXEvoInstaller.php ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ /**
5
+ * An installer to handle MODX Evolution specifics when installing packages.
6
+ */
7
+ class MODXEvoInstaller extends BaseInstaller
8
+ {
9
+ protected $locations = array(
10
+ 'snippet' => 'assets/snippets/{$name}/',
11
+ 'plugin' => 'assets/plugins/{$name}/',
12
+ 'module' => 'assets/modules/{$name}/',
13
+ 'template' => 'assets/templates/{$name}/',
14
+ 'lib' => 'assets/lib/{$name}/'
15
+ );
16
+ }
includes/vendor/composer/installers/src/Composer/Installers/MagentoInstaller.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class MagentoInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'theme' => 'app/design/frontend/{$name}/',
8
+ 'skin' => 'skin/frontend/default/{$name}/',
9
+ 'library' => 'lib/{$name}/',
10
+ );
11
+ }
includes/vendor/composer/installers/src/Composer/Installers/MajimaInstaller.php ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ /**
5
+ * Plugin/theme installer for majima
6
+ * @author David Neustadt
7
+ */
8
+ class MajimaInstaller extends BaseInstaller
9
+ {
10
+ protected $locations = array(
11
+ 'plugin' => 'plugins/{$name}/',
12
+ );
13
+
14
+ /**
15
+ * Transforms the names
16
+ * @param array $vars
17
+ * @return array
18
+ */
19
+ public function inflectPackageVars($vars)
20
+ {
21
+ return $this->correctPluginName($vars);
22
+ }
23
+
24
+ /**
25
+ * Change hyphenated names to camelcase
26
+ * @param array $vars
27
+ * @return array
28
+ */
29
+ private function correctPluginName($vars)
30
+ {
31
+ $camelCasedName = preg_replace_callback('/(-[a-z])/', function ($matches) {
32
+ return strtoupper($matches[0][1]);
33
+ }, $vars['name']);
34
+ $vars['name'] = ucfirst($camelCasedName);
35
+ return $vars;
36
+ }
37
+ }
includes/vendor/composer/installers/src/Composer/Installers/MakoInstaller.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class MakoInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'package' => 'app/packages/{$name}/',
8
+ );
9
+ }
includes/vendor/composer/installers/src/Composer/Installers/MantisBTInstaller.php ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ use Composer\DependencyResolver\Pool;
5
+
6
+ class MantisBTInstaller extends BaseInstaller
7
+ {
8
+ protected $locations = array(
9
+ 'plugin' => 'plugins/{$name}/',
10
+ );
11
+
12
+ /**
13
+ * Format package name to CamelCase
14
+ */
15
+ public function inflectPackageVars($vars)
16
+ {
17
+ $vars['name'] = strtolower(preg_replace('/(?<=\\w)([A-Z])/', '_\\1', $vars['name']));
18
+ $vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
19
+ $vars['name'] = str_replace(' ', '', ucwords($vars['name']));
20
+
21
+ return $vars;
22
+ }
23
+ }
includes/vendor/composer/installers/src/Composer/Installers/MauticInstaller.php ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ use Composer\Package\PackageInterface;
5
+
6
+ class MauticInstaller extends BaseInstaller
7
+ {
8
+ protected $locations = array(
9
+ 'plugin' => 'plugins/{$name}/',
10
+ 'theme' => 'themes/{$name}/',
11
+ 'core' => 'app/',
12
+ );
13
+
14
+ private function getDirectoryName()
15
+ {
16
+ $extra = $this->package->getExtra();
17
+ if (!empty($extra['install-directory-name'])) {
18
+ return $extra['install-directory-name'];
19
+ }
20
+
21
+ return $this->toCamelCase($this->package->getPrettyName());
22
+ }
23
+
24
+ /**
25
+ * @param string $packageName
26
+ *
27
+ * @return string
28
+ */
29
+ private function toCamelCase($packageName)
30
+ {
31
+ return str_replace(' ', '', ucwords(str_replace('-', ' ', basename($packageName))));
32
+ }
33
+
34
+ /**
35
+ * Format package name of mautic-plugins to CamelCase
36
+ */
37
+ public function inflectPackageVars($vars)
38
+ {
39
+
40
+ if ($vars['type'] == 'mautic-plugin' || $vars['type'] == 'mautic-theme') {
41
+ $directoryName = $this->getDirectoryName();
42
+ $vars['name'] = $directoryName;
43
+ }
44
+
45
+ return $vars;
46
+ }
47
+
48
+ }
includes/vendor/composer/installers/src/Composer/Installers/MayaInstaller.php ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class MayaInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'module' => 'modules/{$name}/',
8
+ );
9
+
10
+ /**
11
+ * Format package name.
12
+ *
13
+ * For package type maya-module, cut off a trailing '-module' if present.
14
+ *
15
+ */
16
+ public function inflectPackageVars($vars)
17
+ {
18
+ if ($vars['type'] === 'maya-module') {
19
+ return $this->inflectModuleVars($vars);
20
+ }
21
+
22
+ return $vars;
23
+ }
24
+
25
+ protected function inflectModuleVars($vars)
26
+ {
27
+ $vars['name'] = preg_replace('/-module$/', '', $vars['name']);
28
+ $vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
29
+ $vars['name'] = str_replace(' ', '', ucwords($vars['name']));
30
+
31
+ return $vars;
32
+ }
33
+ }
includes/vendor/composer/installers/src/Composer/Installers/MediaWikiInstaller.php ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class MediaWikiInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'core' => 'core/',
8
+ 'extension' => 'extensions/{$name}/',
9
+ 'skin' => 'skins/{$name}/',
10
+ );
11
+
12
+ /**
13
+ * Format package name.
14
+ *
15
+ * For package type mediawiki-extension, cut off a trailing '-extension' if present and transform
16
+ * to CamelCase keeping existing uppercase chars.
17
+ *
18
+ * For package type mediawiki-skin, cut off a trailing '-skin' if present.
19
+ *
20
+ */
21
+ public function inflectPackageVars($vars)
22
+ {
23
+
24
+ if ($vars['type'] === 'mediawiki-extension') {
25
+ return $this->inflectExtensionVars($vars);
26
+ }
27
+
28
+ if ($vars['type'] === 'mediawiki-skin') {
29
+ return $this->inflectSkinVars($vars);
30
+ }
31
+
32
+ return $vars;
33
+ }
34
+
35
+ protected function inflectExtensionVars($vars)
36
+ {
37
+ $vars['name'] = preg_replace('/-extension$/', '', $vars['name']);
38
+ $vars['name'] = str_replace('-', ' ', $vars['name']);
39
+ $vars['name'] = str_replace(' ', '', ucwords($vars['name']));
40
+
41
+ return $vars;
42
+ }
43
+
44
+ protected function inflectSkinVars($vars)
45
+ {
46
+ $vars['name'] = preg_replace('/-skin$/', '', $vars['name']);
47
+
48
+ return $vars;
49
+ }
50
+
51
+ }
includes/vendor/composer/installers/src/Composer/Installers/MiaoxingInstaller.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Composer\Installers;
4
+
5
+ class MiaoxingInstaller extends BaseInstaller
6
+ {
7
+ protected $locations = array(
8
+ 'plugin' => 'plugins/{$name}/',
9
+ );
10
+ }
includes/vendor/composer/installers/src/Composer/Installers/MicroweberInstaller.php ADDED
@@ -0,0 +1,119 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class MicroweberInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'module' => 'userfiles/modules/{$install_item_dir}/',
8
+ 'module-skin' => 'userfiles/modules/{$install_item_dir}/templates/',
9
+ 'template' => 'userfiles/templates/{$install_item_dir}/',
10
+ 'element' => 'userfiles/elements/{$install_item_dir}/',
11
+ 'vendor' => 'vendor/{$install_item_dir}/',
12
+ 'components' => 'components/{$install_item_dir}/'
13
+ );
14
+
15
+ /**
16
+ * Format package name.
17
+ *
18
+ * For package type microweber-module, cut off a trailing '-module' if present
19
+ *
20
+ * For package type microweber-template, cut off a trailing '-template' if present.
21
+ *
22
+ */
23
+ public function inflectPackageVars($vars)
24
+ {
25
+
26
+
27
+ if ($this->package->getTargetDir()) {
28
+ $vars['install_item_dir'] = $this->package->getTargetDir();
29
+ } else {
30
+ $vars['install_item_dir'] = $vars['name'];
31
+ if ($vars['type'] === 'microweber-template') {
32
+ return $this->inflectTemplateVars($vars);
33
+ }
34
+ if ($vars['type'] === 'microweber-templates') {
35
+ return $this->inflectTemplatesVars($vars);
36
+ }
37
+ if ($vars['type'] === 'microweber-core') {
38
+ return $this->inflectCoreVars($vars);
39
+ }
40
+ if ($vars['type'] === 'microweber-adapter') {
41
+ return $this->inflectCoreVars($vars);
42
+ }
43
+ if ($vars['type'] === 'microweber-module') {
44
+ return $this->inflectModuleVars($vars);
45
+ }
46
+ if ($vars['type'] === 'microweber-modules') {
47
+ return $this->inflectModulesVars($vars);
48
+ }
49
+ if ($vars['type'] === 'microweber-skin') {
50
+ return $this->inflectSkinVars($vars);
51
+ }
52
+ if ($vars['type'] === 'microweber-element' or $vars['type'] === 'microweber-elements') {
53
+ return $this->inflectElementVars($vars);
54
+ }
55
+ }
56
+
57
+
58
+ return $vars;
59
+ }
60
+
61
+ protected function inflectTemplateVars($vars)
62
+ {
63
+ $vars['install_item_dir'] = preg_replace('/-template$/', '', $vars['install_item_dir']);
64
+ $vars['install_item_dir'] = preg_replace('/template-$/', '', $vars['install_item_dir']);
65
+
66
+ return $vars;
67
+ }
68
+
69
+ protected function inflectTemplatesVars($vars)
70
+ {
71
+ $vars['install_item_dir'] = preg_replace('/-templates$/', '', $vars['install_item_dir']);
72
+ $vars['install_item_dir'] = preg_replace('/templates-$/', '', $vars['install_item_dir']);
73
+
74
+ return $vars;
75
+ }
76
+
77
+ protected function inflectCoreVars($vars)
78
+ {
79
+ $vars['install_item_dir'] = preg_replace('/-providers$/', '', $vars['install_item_dir']);
80
+ $vars['install_item_dir'] = preg_replace('/-provider$/', '', $vars['install_item_dir']);
81
+ $vars['install_item_dir'] = preg_replace('/-adapter$/', '', $vars['install_item_dir']);
82
+
83
+ return $vars;
84
+ }
85
+
86
+ protected function inflectModuleVars($vars)
87
+ {
88
+ $vars['install_item_dir'] = preg_replace('/-module$/', '', $vars['install_item_dir']);
89
+ $vars['install_item_dir'] = preg_replace('/module-$/', '', $vars['install_item_dir']);
90
+
91
+ return $vars;
92
+ }
93
+
94
+ protected function inflectModulesVars($vars)
95
+ {
96
+ $vars['install_item_dir'] = preg_replace('/-modules$/', '', $vars['install_item_dir']);
97
+ $vars['install_item_dir'] = preg_replace('/modules-$/', '', $vars['install_item_dir']);
98
+
99
+ return $vars;
100
+ }
101
+
102
+ protected function inflectSkinVars($vars)
103
+ {
104
+ $vars['install_item_dir'] = preg_replace('/-skin$/', '', $vars['install_item_dir']);
105
+ $vars['install_item_dir'] = preg_replace('/skin-$/', '', $vars['install_item_dir']);
106
+
107
+ return $vars;
108
+ }
109
+
110
+ protected function inflectElementVars($vars)
111
+ {
112
+ $vars['install_item_dir'] = preg_replace('/-elements$/', '', $vars['install_item_dir']);
113
+ $vars['install_item_dir'] = preg_replace('/elements-$/', '', $vars['install_item_dir']);
114
+ $vars['install_item_dir'] = preg_replace('/-element$/', '', $vars['install_item_dir']);
115
+ $vars['install_item_dir'] = preg_replace('/element-$/', '', $vars['install_item_dir']);
116
+
117
+ return $vars;
118
+ }
119
+ }
includes/vendor/composer/installers/src/Composer/Installers/ModxInstaller.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ /**
5
+ * An installer to handle MODX specifics when installing packages.
6
+ */
7
+ class ModxInstaller extends BaseInstaller
8
+ {
9
+ protected $locations = array(
10
+ 'extra' => 'core/packages/{$name}/'
11
+ );
12
+ }
includes/vendor/composer/installers/src/Composer/Installers/MoodleInstaller.php ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class MoodleInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'mod' => 'mod/{$name}/',
8
+ 'admin_report' => 'admin/report/{$name}/',
9
+ 'atto' => 'lib/editor/atto/plugins/{$name}/',
10
+ 'tool' => 'admin/tool/{$name}/',
11
+ 'assignment' => 'mod/assignment/type/{$name}/',
12
+ 'assignsubmission' => 'mod/assign/submission/{$name}/',
13
+ 'assignfeedback' => 'mod/assign/feedback/{$name}/',
14
+ 'auth' => 'auth/{$name}/',
15
+ 'availability' => 'availability/condition/{$name}/',
16
+ 'block' => 'blocks/{$name}/',
17
+ 'booktool' => 'mod/book/tool/{$name}/',
18
+ 'cachestore' => 'cache/stores/{$name}/',
19
+ 'cachelock' => 'cache/locks/{$name}/',
20
+ 'calendartype' => 'calendar/type/{$name}/',
21
+ 'fileconverter' => 'files/converter/{$name}/',
22
+ 'format' => 'course/format/{$name}/',
23
+ 'coursereport' => 'course/report/{$name}/',
24
+ 'customcertelement' => 'mod/customcert/element/{$name}/',
25
+ 'datafield' => 'mod/data/field/{$name}/',
26
+ 'datapreset' => 'mod/data/preset/{$name}/',
27
+ 'editor' => 'lib/editor/{$name}/',
28
+ 'enrol' => 'enrol/{$name}/',
29
+ 'filter' => 'filter/{$name}/',
30
+ 'gradeexport' => 'grade/export/{$name}/',
31
+ 'gradeimport' => 'grade/import/{$name}/',
32
+ 'gradereport' => 'grade/report/{$name}/',
33
+ 'gradingform' => 'grade/grading/form/{$name}/',
34
+ 'local' => 'local/{$name}/',
35
+ 'logstore' => 'admin/tool/log/store/{$name}/',
36
+ 'ltisource' => 'mod/lti/source/{$name}/',
37
+ 'ltiservice' => 'mod/lti/service/{$name}/',
38
+ 'message' => 'message/output/{$name}/',
39
+ 'mnetservice' => 'mnet/service/{$name}/',
40
+ 'plagiarism' => 'plagiarism/{$name}/',
41
+ 'portfolio' => 'portfolio/{$name}/',
42
+ 'qbehaviour' => 'question/behaviour/{$name}/',
43
+ 'qformat' => 'question/format/{$name}/',
44
+ 'qtype' => 'question/type/{$name}/',
45
+ 'quizaccess' => 'mod/quiz/accessrule/{$name}/',
46
+ 'quiz' => 'mod/quiz/report/{$name}/',
47
+ 'report' => 'report/{$name}/',
48
+ 'repository' => 'repository/{$name}/',
49
+ 'scormreport' => 'mod/scorm/report/{$name}/',
50
+ 'search' => 'search/engine/{$name}/',
51
+ 'theme' => 'theme/{$name}/',
52
+ 'tinymce' => 'lib/editor/tinymce/plugins/{$name}/',
53
+ 'profilefield' => 'user/profile/field/{$name}/',
54
+ 'webservice' => 'webservice/{$name}/',
55
+ 'workshopallocation' => 'mod/workshop/allocation/{$name}/',
56
+ 'workshopeval' => 'mod/workshop/eval/{$name}/',
57
+ 'workshopform' => 'mod/workshop/form/{$name}/'
58
+ );
59
+ }
includes/vendor/composer/installers/src/Composer/Installers/OctoberInstaller.php ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class OctoberInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'module' => 'modules/{$name}/',
8
+ 'plugin' => 'plugins/{$vendor}/{$name}/',
9
+ 'theme' => 'themes/{$vendor}-{$name}/'
10
+ );
11
+
12
+ /**
13
+ * Format package name.
14
+ *
15
+ * For package type october-plugin, cut off a trailing '-plugin' if present.
16
+ *
17
+ * For package type october-theme, cut off a trailing '-theme' if present.
18
+ *
19
+ */
20
+ public function inflectPackageVars($vars)
21
+ {
22
+ if ($vars['type'] === 'october-plugin') {
23
+ return $this->inflectPluginVars($vars);
24
+ }
25
+
26
+ if ($vars['type'] === 'october-theme') {
27
+ return $this->inflectThemeVars($vars);
28
+ }
29
+
30
+ return $vars;
31
+ }
32
+
33
+ protected function inflectPluginVars($vars)
34
+ {
35
+ $vars['name'] = preg_replace('/^oc-|-plugin$/', '', $vars['name']);
36
+ $vars['vendor'] = preg_replace('/[^a-z0-9_]/i', '', $vars['vendor']);
37
+
38
+ return $vars;
39
+ }
40
+
41
+ protected function inflectThemeVars($vars)
42
+ {
43
+ $vars['name'] = preg_replace('/^oc-|-theme$/', '', $vars['name']);
44
+ $vars['vendor'] = preg_replace('/[^a-z0-9_]/i', '', $vars['vendor']);
45
+
46
+ return $vars;
47
+ }
48
+ }
includes/vendor/composer/installers/src/Composer/Installers/OntoWikiInstaller.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class OntoWikiInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'extension' => 'extensions/{$name}/',
8
+ 'theme' => 'extensions/themes/{$name}/',
9
+ 'translation' => 'extensions/translations/{$name}/',
10
+ );
11
+
12
+ /**
13
+ * Format package name to lower case and remove ".ontowiki" suffix
14
+ */
15
+ public function inflectPackageVars($vars)
16
+ {
17
+ $vars['name'] = strtolower($vars['name']);
18
+ $vars['name'] = preg_replace('/.ontowiki$/', '', $vars['name']);
19
+ $vars['name'] = preg_replace('/-theme$/', '', $vars['name']);
20
+ $vars['name'] = preg_replace('/-translation$/', '', $vars['name']);
21
+
22
+ return $vars;
23
+ }
24
+ }
includes/vendor/composer/installers/src/Composer/Installers/OsclassInstaller.php ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+
5
+ class OsclassInstaller extends BaseInstaller
6
+ {
7
+
8
+ protected $locations = array(
9
+ 'plugin' => 'oc-content/plugins/{$name}/',
10
+ 'theme' => 'oc-content/themes/{$name}/',
11
+ 'language' => 'oc-content/languages/{$name}/',
12
+ );
13
+
14
+ }
includes/vendor/composer/installers/src/Composer/Installers/OxidInstaller.php ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ use Composer\Package\PackageInterface;
5
+
6
+ class OxidInstaller extends BaseInstaller
7
+ {
8
+ const VENDOR_PATTERN = '/^modules\/(?P<vendor>.+)\/.+/';
9
+
10
+ protected $locations = array(
11
+ 'module' => 'modules/{$name}/',
12
+ 'theme' => 'application/views/{$name}/',
13
+ 'out' => 'out/{$name}/',
14
+ );
15
+
16
+ /**
17
+ * getInstallPath
18
+ *
19
+ * @param PackageInterface $package
20
+ * @param string $frameworkType
21
+ * @return string
22
+ */
23
+ public function getInstallPath(PackageInterface $package, $frameworkType = '')
24
+ {
25
+ $installPath = parent::getInstallPath($package, $frameworkType);
26
+ $type = $this->package->getType();
27
+ if ($type === 'oxid-module') {
28
+ $this->prepareVendorDirectory($installPath);
29
+ }
30
+ return $installPath;
31
+ }
32
+
33
+ /**
34
+ * prepareVendorDirectory
35
+ *
36
+ * Makes sure there is a vendormetadata.php file inside
37
+ * the vendor folder if there is a vendor folder.
38
+ *
39
+ * @param string $installPath
40
+ * @return void
41
+ */
42
+ protected function prepareVendorDirectory($installPath)
43
+ {
44
+ $matches = '';
45
+ $hasVendorDirectory = preg_match(self::VENDOR_PATTERN, $installPath, $matches);
46
+ if (!$hasVendorDirectory) {
47
+ return;
48
+ }
49
+
50
+ $vendorDirectory = $matches['vendor'];
51
+ $vendorPath = getcwd() . '/modules/' . $vendorDirectory;
52
+ if (!file_exists($vendorPath)) {
53
+ mkdir($vendorPath, 0755, true);
54
+ }
55
+
56
+ $vendorMetaDataPath = $vendorPath . '/vendormetadata.php';
57
+ touch($vendorMetaDataPath);
58
+ }
59
+ }
includes/vendor/composer/installers/src/Composer/Installers/PPIInstaller.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class PPIInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'module' => 'modules/{$name}/',
8
+ );
9
+ }
includes/vendor/composer/installers/src/Composer/Installers/PantheonInstaller.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Composer\Installers;
4
+
5
+ class PantheonInstaller extends BaseInstaller
6
+ {
7
+ /** @var array<string, string> */
8
+ protected $locations = array(
9
+ 'script' => 'web/private/scripts/quicksilver/{$name}',
10
+ 'module' => 'web/private/scripts/quicksilver/{$name}',
11
+ );
12
+ }
includes/vendor/composer/installers/src/Composer/Installers/PhiftyInstaller.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class PhiftyInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'bundle' => 'bundles/{$name}/',
8
+ 'library' => 'libraries/{$name}/',
9
+ 'framework' => 'frameworks/{$name}/',
10
+ );
11
+ }
includes/vendor/composer/installers/src/Composer/Installers/PhpBBInstaller.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class PhpBBInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'extension' => 'ext/{$vendor}/{$name}/',
8
+ 'language' => 'language/{$name}/',
9
+ 'style' => 'styles/{$name}/',
10
+ );
11
+ }
includes/vendor/composer/installers/src/Composer/Installers/PimcoreInstaller.php ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class PimcoreInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'plugin' => 'plugins/{$name}/',
8
+ );
9
+
10
+ /**
11
+ * Format package name to CamelCase
12
+ */
13
+ public function inflectPackageVars($vars)
14
+ {
15
+ $vars['name'] = strtolower(preg_replace('/(?<=\\w)([A-Z])/', '_\\1', $vars['name']));
16
+ $vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
17
+ $vars['name'] = str_replace(' ', '', ucwords($vars['name']));
18
+
19
+ return $vars;
20
+ }
21
+ }
includes/vendor/composer/installers/src/Composer/Installers/PiwikInstaller.php ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ /**
5
+ * Class PiwikInstaller
6
+ *
7
+ * @package Composer\Installers
8
+ */
9
+ class PiwikInstaller extends BaseInstaller
10
+ {
11
+ /**
12
+ * @var array
13
+ */
14
+ protected $locations = array(
15
+ 'plugin' => 'plugins/{$name}/',
16
+ );
17
+
18
+ /**
19
+ * Format package name to CamelCase
20
+ * @param array $vars
21
+ *
22
+ * @return array
23
+ */
24
+ public function inflectPackageVars($vars)
25
+ {
26
+ $vars['name'] = strtolower(preg_replace('/(?<=\\w)([A-Z])/', '_\\1', $vars['name']));
27
+ $vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
28
+ $vars['name'] = str_replace(' ', '', ucwords($vars['name']));
29
+
30
+ return $vars;
31
+ }
32
+ }
includes/vendor/composer/installers/src/Composer/Installers/PlentymarketsInstaller.php ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class PlentymarketsInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'plugin' => '{$name}/'
8
+ );
9
+
10
+ /**
11
+ * Remove hyphen, "plugin" and format to camelcase
12
+ * @param array $vars
13
+ *
14
+ * @return array
15
+ */
16
+ public function inflectPackageVars($vars)
17
+ {
18
+ $vars['name'] = explode("-", $vars['name']);
19
+ foreach ($vars['name'] as $key => $name) {
20
+ $vars['name'][$key] = ucfirst($vars['name'][$key]);
21
+ if (strcasecmp($name, "Plugin") == 0) {
22
+ unset($vars['name'][$key]);
23
+ }
24
+ }
25
+ $vars['name'] = implode("",$vars['name']);
26
+
27
+ return $vars;
28
+ }
29
+ }
includes/vendor/composer/installers/src/Composer/Installers/Plugin.php ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Composer\Installers;
4
+
5
+ use Composer\Composer;
6
+ use Composer\IO\IOInterface;
7
+ use Composer\Plugin\PluginInterface;
8
+
9
+ class Plugin implements PluginInterface
10
+ {
11
+ private $installer;
12
+
13
+ public function activate(Composer $composer, IOInterface $io)
14
+ {
15
+ $this->installer = new Installer($io, $composer);
16
+ $composer->getInstallationManager()->addInstaller($this->installer);
17
+ }
18
+
19
+ public function deactivate(Composer $composer, IOInterface $io)
20
+ {
21
+ $composer->getInstallationManager()->removeInstaller($this->installer);
22
+ }
23
+
24
+ public function uninstall(Composer $composer, IOInterface $io)
25
+ {
26
+ }
27
+ }
includes/vendor/composer/installers/src/Composer/Installers/PortoInstaller.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class PortoInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'container' => 'app/Containers/{$name}/',
8
+ );
9
+ }
includes/vendor/composer/installers/src/Composer/Installers/PrestashopInstaller.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class PrestashopInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'module' => 'modules/{$name}/',
8
+ 'theme' => 'themes/{$name}/',
9
+ );
10
+ }
includes/vendor/composer/installers/src/Composer/Installers/ProcessWireInstaller.php ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Composer\Installers;
4
+
5
+ class ProcessWireInstaller extends BaseInstaller
6
+ {
7
+ protected $locations = array(
8
+ 'module' => 'site/modules/{$name}/',
9
+ );
10
+
11
+ /**
12
+ * Format package name to CamelCase
13
+ */
14
+ public function inflectPackageVars($vars)
15
+ {
16
+ $vars['name'] = strtolower(preg_replace('/(?<=\\w)([A-Z])/', '_\\1', $vars['name']));
17
+ $vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
18
+ $vars['name'] = str_replace(' ', '', ucwords($vars['name']));
19
+
20
+ return $vars;
21
+ }
22
+ }
includes/vendor/composer/installers/src/Composer/Installers/PuppetInstaller.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Composer\Installers;
4
+
5
+ class PuppetInstaller extends BaseInstaller
6
+ {
7
+
8
+ protected $locations = array(
9
+ 'module' => 'modules/{$name}/',
10
+ );
11
+ }
includes/vendor/composer/installers/src/Composer/Installers/PxcmsInstaller.php ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class PxcmsInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'module' => 'app/Modules/{$name}/',
8
+ 'theme' => 'themes/{$name}/',
9
+ );
10
+
11
+ /**
12
+ * Format package name.
13
+ *
14
+ * @param array $vars
15
+ *
16
+ * @return array
17
+ */
18
+ public function inflectPackageVars($vars)
19
+ {
20
+ if ($vars['type'] === 'pxcms-module') {
21
+ return $this->inflectModuleVars($vars);
22
+ }
23
+
24
+ if ($vars['type'] === 'pxcms-theme') {
25
+ return $this->inflectThemeVars($vars);
26
+ }
27
+
28
+ return $vars;
29
+ }
30
+
31
+ /**
32
+ * For package type pxcms-module, cut off a trailing '-plugin' if present.
33
+ *
34
+ * return string
35
+ */
36
+ protected function inflectModuleVars($vars)
37
+ {
38
+ $vars['name'] = str_replace('pxcms-', '', $vars['name']); // strip out pxcms- just incase (legacy)
39
+ $vars['name'] = str_replace('module-', '', $vars['name']); // strip out module-
40
+ $vars['name'] = preg_replace('/-module$/', '', $vars['name']); // strip out -module
41
+ $vars['name'] = str_replace('-', '_', $vars['name']); // make -'s be _'s
42
+ $vars['name'] = ucwords($vars['name']); // make module name camelcased
43
+
44
+ return $vars;
45
+ }
46
+
47
+
48
+ /**
49
+ * For package type pxcms-module, cut off a trailing '-plugin' if present.
50
+ *
51
+ * return string
52
+ */
53
+ protected function inflectThemeVars($vars)
54
+ {
55
+ $vars['name'] = str_replace('pxcms-', '', $vars['name']); // strip out pxcms- just incase (legacy)
56
+ $vars['name'] = str_replace('theme-', '', $vars['name']); // strip out theme-
57
+ $vars['name'] = preg_replace('/-theme$/', '', $vars['name']); // strip out -theme
58
+ $vars['name'] = str_replace('-', '_', $vars['name']); // make -'s be _'s
59
+ $vars['name'] = ucwords($vars['name']); // make module name camelcased
60
+
61
+ return $vars;
62
+ }
63
+ }
includes/vendor/composer/installers/src/Composer/Installers/RadPHPInstaller.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class RadPHPInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'bundle' => 'src/{$name}/'
8
+ );
9
+
10
+ /**
11
+ * Format package name to CamelCase
12
+ */
13
+ public function inflectPackageVars($vars)
14
+ {
15
+ $nameParts = explode('/', $vars['name']);
16
+ foreach ($nameParts as &$value) {
17
+ $value = strtolower(preg_replace('/(?<=\\w)([A-Z])/', '_\\1', $value));
18
+ $value = str_replace(array('-', '_'), ' ', $value);
19
+ $value = str_replace(' ', '', ucwords($value));
20
+ }
21
+ $vars['name'] = implode('/', $nameParts);
22
+ return $vars;
23
+ }
24
+ }
includes/vendor/composer/installers/src/Composer/Installers/ReIndexInstaller.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class ReIndexInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'theme' => 'themes/{$name}/',
8
+ 'plugin' => 'plugins/{$name}/'
9
+ );
10
+ }
includes/vendor/composer/installers/src/Composer/Installers/Redaxo5Installer.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class Redaxo5Installer extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'addon' => 'redaxo/src/addons/{$name}/',
8
+ 'bestyle-plugin' => 'redaxo/src/addons/be_style/plugins/{$name}/'
9
+ );
10
+ }
includes/vendor/composer/installers/src/Composer/Installers/RedaxoInstaller.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class RedaxoInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'addon' => 'redaxo/include/addons/{$name}/',
8
+ 'bestyle-plugin' => 'redaxo/include/addons/be_style/plugins/{$name}/'
9
+ );
10
+ }
includes/vendor/composer/installers/src/Composer/Installers/RoundcubeInstaller.php ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class RoundcubeInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'plugin' => 'plugins/{$name}/',
8
+ );
9
+
10
+ /**
11
+ * Lowercase name and changes the name to a underscores
12
+ *
13
+ * @param array $vars
14
+ * @return array
15
+ */
16
+ public function inflectPackageVars($vars)
17
+ {
18
+ $vars['name'] = strtolower(str_replace('-', '_', $vars['name']));
19
+
20
+ return $vars;
21
+ }
22
+ }
includes/vendor/composer/installers/src/Composer/Installers/SMFInstaller.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class SMFInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'module' => 'Sources/{$name}/',
8
+ 'theme' => 'Themes/{$name}/',
9
+ );
10
+ }
includes/vendor/composer/installers/src/Composer/Installers/ShopwareInstaller.php ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ /**
5
+ * Plugin/theme installer for shopware
6
+ * @author Benjamin Boit
7
+ */
8
+ class ShopwareInstaller extends BaseInstaller
9
+ {
10
+ protected $locations = array(
11
+ 'backend-plugin' => 'engine/Shopware/Plugins/Local/Backend/{$name}/',
12
+ 'core-plugin' => 'engine/Shopware/Plugins/Local/Core/{$name}/',
13
+ 'frontend-plugin' => 'engine/Shopware/Plugins/Local/Frontend/{$name}/',
14
+ 'theme' => 'templates/{$name}/',
15
+ 'plugin' => 'custom/plugins/{$name}/',
16
+ 'frontend-theme' => 'themes/Frontend/{$name}/',
17
+ );
18
+
19
+ /**
20
+ * Transforms the names
21
+ * @param array $vars
22
+ * @return array
23
+ */
24
+ public function inflectPackageVars($vars)
25
+ {
26
+ if ($vars['type'] === 'shopware-theme') {
27
+ return $this->correctThemeName($vars);
28
+ }
29
+
30
+ return $this->correctPluginName($vars);
31
+ }
32
+
33
+ /**
34
+ * Changes the name to a camelcased combination of vendor and name
35
+ * @param array $vars
36
+ * @return array
37
+ */
38
+ private function correctPluginName($vars)
39
+ {
40
+ $camelCasedName = preg_replace_callback('/(-[a-z])/', function ($matches) {
41
+ return strtoupper($matches[0][1]);
42
+ }, $vars['name']);
43
+
44
+ $vars['name'] = ucfirst($vars['vendor']) . ucfirst($camelCasedName);
45
+
46
+ return $vars;
47
+ }
48
+
49
+ /**
50
+ * Changes the name to a underscore separated name
51
+ * @param array $vars
52
+ * @return array
53
+ */
54
+ private function correctThemeName($vars)
55
+ {
56
+ $vars['name'] = str_replace('-', '_', $vars['name']);
57
+
58
+ return $vars;
59
+ }
60
+ }
includes/vendor/composer/installers/src/Composer/Installers/SilverStripeInstaller.php ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ use Composer\Package\PackageInterface;
5
+
6
+ class SilverStripeInstaller extends BaseInstaller
7
+ {
8
+ protected $locations = array(
9
+ 'module' => '{$name}/',
10
+ 'theme' => 'themes/{$name}/',
11
+ );
12
+
13
+ /**
14
+ * Return the install path based on package type.
15
+ *
16
+ * Relies on built-in BaseInstaller behaviour with one exception: silverstripe/framework
17
+ * must be installed to 'sapphire' and not 'framework' if the version is <3.0.0
18
+ *
19
+ * @param PackageInterface $package
20
+ * @param string $frameworkType
21
+ * @return string
22
+ */
23
+ public function getInstallPath(PackageInterface $package, $frameworkType = '')
24
+ {
25
+ if (
26
+ $package->getName() == 'silverstripe/framework'
27
+ && preg_match('/^\d+\.\d+\.\d+/', $package->getVersion())
28
+ && version_compare($package->getVersion(), '2.999.999') < 0
29
+ ) {
30
+ return $this->templatePath($this->locations['module'], array('name' => 'sapphire'));
31
+ }
32
+
33
+ return parent::getInstallPath($package, $frameworkType);
34
+ }
35
+ }
includes/vendor/composer/installers/src/Composer/Installers/SiteDirectInstaller.php ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Composer\Installers;
4
+
5
+ class SiteDirectInstaller extends BaseInstaller
6
+ {
7
+ protected $locations = array(
8
+ 'module' => 'modules/{$vendor}/{$name}/',
9
+ 'plugin' => 'plugins/{$vendor}/{$name}/'
10
+ );
11
+
12
+ public function inflectPackageVars($vars)
13
+ {
14
+ return $this->parseVars($vars);
15
+ }
16
+
17
+ protected function parseVars($vars)
18
+ {
19
+ $vars['vendor'] = strtolower($vars['vendor']) == 'sitedirect' ? 'SiteDirect' : $vars['vendor'];
20
+ $vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
21
+ $vars['name'] = str_replace(' ', '', ucwords($vars['name']));
22
+
23
+ return $vars;
24
+ }
25
+ }
includes/vendor/composer/installers/src/Composer/Installers/StarbugInstaller.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class StarbugInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'module' => 'modules/{$name}/',
8
+ 'theme' => 'themes/{$name}/',
9
+ 'custom-module' => 'app/modules/{$name}/',
10
+ 'custom-theme' => 'app/themes/{$name}/'
11
+ );
12
+ }
includes/vendor/composer/installers/src/Composer/Installers/SyDESInstaller.php ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class SyDESInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'module' => 'app/modules/{$name}/',
8
+ 'theme' => 'themes/{$name}/',
9
+ );
10
+
11
+ /**
12
+ * Format module name.
13
+ *
14
+ * Strip `sydes-` prefix and a trailing '-theme' or '-module' from package name if present.
15
+ *
16
+ * {@inerhitDoc}
17
+ */
18
+ public function inflectPackageVars($vars)
19
+ {
20
+ if ($vars['type'] == 'sydes-module') {
21
+ return $this->inflectModuleVars($vars);
22
+ }
23
+
24
+ if ($vars['type'] === 'sydes-theme') {
25
+ return $this->inflectThemeVars($vars);
26
+ }
27
+
28
+ return $vars;
29
+ }
30
+
31
+ public function inflectModuleVars($vars)
32
+ {
33
+ $vars['name'] = preg_replace('/(^sydes-|-module$)/i', '', $vars['name']);
34
+ $vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
35
+ $vars['name'] = str_replace(' ', '', ucwords($vars['name']));
36
+
37
+ return $vars;
38
+ }
39
+
40
+ protected function inflectThemeVars($vars)
41
+ {
42
+ $vars['name'] = preg_replace('/(^sydes-|-theme$)/', '', $vars['name']);
43
+ $vars['name'] = strtolower($vars['name']);
44
+
45
+ return $vars;
46
+ }
47
+ }
includes/vendor/composer/installers/src/Composer/Installers/SyliusInstaller.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class SyliusInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'theme' => 'themes/{$name}/',
8
+ );
9
+ }
includes/vendor/composer/installers/src/Composer/Installers/Symfony1Installer.php ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ /**
5
+ * Plugin installer for symfony 1.x
6
+ *
7
+ * @author Jérôme Tamarelle <jerome@tamarelle.net>
8
+ */
9
+ class Symfony1Installer extends BaseInstaller
10
+ {
11
+ protected $locations = array(
12
+ 'plugin' => 'plugins/{$name}/',
13
+ );
14
+
15
+ /**
16
+ * Format package name to CamelCase
17
+ */
18
+ public function inflectPackageVars($vars)
19
+ {
20
+ $vars['name'] = preg_replace_callback('/(-[a-z])/', function ($matches) {
21
+ return strtoupper($matches[0][1]);
22
+ }, $vars['name']);
23
+
24
+ return $vars;
25
+ }
26
+ }
includes/vendor/composer/installers/src/Composer/Installers/TYPO3CmsInstaller.php ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ /**
5
+ * Extension installer for TYPO3 CMS
6
+ *
7
+ * @deprecated since 1.0.25, use https://packagist.org/packages/typo3/cms-composer-installers instead
8
+ *
9
+ * @author Sascha Egerer <sascha.egerer@dkd.de>
10
+ */
11
+ class TYPO3CmsInstaller extends BaseInstaller
12
+ {
13
+ protected $locations = array(
14
+ 'extension' => 'typo3conf/ext/{$name}/',
15
+ );
16
+ }
includes/vendor/composer/installers/src/Composer/Installers/TYPO3FlowInstaller.php ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ /**
5
+ * An installer to handle TYPO3 Flow specifics when installing packages.
6
+ */
7
+ class TYPO3FlowInstaller extends BaseInstaller
8
+ {
9
+ protected $locations = array(
10
+ 'package' => 'Packages/Application/{$name}/',
11
+ 'framework' => 'Packages/Framework/{$name}/',
12
+ 'plugin' => 'Packages/Plugins/{$name}/',
13
+ 'site' => 'Packages/Sites/{$name}/',
14
+ 'boilerplate' => 'Packages/Boilerplates/{$name}/',
15
+ 'build' => 'Build/{$name}/',
16
+ );
17
+
18
+ /**
19
+ * Modify the package name to be a TYPO3 Flow style key.
20
+ *
21
+ * @param array $vars
22
+ * @return array
23
+ */
24
+ public function inflectPackageVars($vars)
25
+ {
26
+ $autoload = $this->package->getAutoload();
27
+ if (isset($autoload['psr-0']) && is_array($autoload['psr-0'])) {
28
+ $namespace = key($autoload['psr-0']);
29
+ $vars['name'] = str_replace('\\', '.', $namespace);
30
+ }
31
+ if (isset($autoload['psr-4']) && is_array($autoload['psr-4'])) {
32
+ $namespace = key($autoload['psr-4']);
33
+ $vars['name'] = rtrim(str_replace('\\', '.', $namespace), '.');
34
+ }
35
+
36
+ return $vars;
37
+ }
38
+ }
includes/vendor/composer/installers/src/Composer/Installers/TaoInstaller.php ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ /**
5
+ * An installer to handle TAO extensions.
6
+ */
7
+ class TaoInstaller extends BaseInstaller
8
+ {
9
+ const EXTRA_TAO_EXTENSION_NAME = 'tao-extension-name';
10
+
11
+ protected $locations = array(
12
+ 'extension' => '{$name}'
13
+ );
14
+
15
+ public function inflectPackageVars($vars)
16
+ {
17
+ $extra = $this->package->getExtra();
18
+
19
+ if (array_key_exists(self::EXTRA_TAO_EXTENSION_NAME, $extra)) {
20
+ $vars['name'] = $extra[self::EXTRA_TAO_EXTENSION_NAME];
21
+ return $vars;
22
+ }
23
+
24
+ $vars['name'] = str_replace('extension-', '', $vars['name']);
25
+ $vars['name'] = str_replace('-', ' ', $vars['name']);
26
+ $vars['name'] = lcfirst(str_replace(' ', '', ucwords($vars['name'])));
27
+
28
+ return $vars;
29
+ }
30
+ }
includes/vendor/composer/installers/src/Composer/Installers/TastyIgniterInstaller.php ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Composer\Installers;
4
+
5
+ class TastyIgniterInstaller extends BaseInstaller
6
+ {
7
+ protected $locations = array(
8
+ 'extension' => 'extensions/{$vendor}/{$name}/',
9
+ 'theme' => 'themes/{$name}/',
10
+ );
11
+
12
+ /**
13
+ * Format package name.
14
+ *
15
+ * Cut off leading 'ti-ext-' or 'ti-theme-' if present.
16
+ * Strip vendor name of characters that is not alphanumeric or an underscore
17
+ *
18
+ */
19
+ public function inflectPackageVars($vars)
20
+ {
21
+ if ($vars['type'] === 'tastyigniter-extension') {
22
+ $vars['vendor'] = preg_replace('/[^a-z0-9_]/i', '', $vars['vendor']);
23
+ $vars['name'] = preg_replace('/^ti-ext-/', '', $vars['name']);
24
+ }
25
+
26
+ if ($vars['type'] === 'tastyigniter-theme') {
27
+ $vars['name'] = preg_replace('/^ti-theme-/', '', $vars['name']);
28
+ }
29
+
30
+ return $vars;
31
+ }
32
+ }
includes/vendor/composer/installers/src/Composer/Installers/TheliaInstaller.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class TheliaInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'module' => 'local/modules/{$name}/',
8
+ 'frontoffice-template' => 'templates/frontOffice/{$name}/',
9
+ 'backoffice-template' => 'templates/backOffice/{$name}/',
10
+ 'email-template' => 'templates/email/{$name}/',
11
+ );
12
+ }
includes/vendor/composer/installers/src/Composer/Installers/TuskInstaller.php ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+ /**
4
+ * Composer installer for 3rd party Tusk utilities
5
+ * @author Drew Ewing <drew@phenocode.com>
6
+ */
7
+ class TuskInstaller extends BaseInstaller
8
+ {
9
+ protected $locations = array(
10
+ 'task' => '.tusk/tasks/{$name}/',
11
+ 'command' => '.tusk/commands/{$name}/',
12
+ 'asset' => 'assets/tusk/{$name}/',
13
+ );
14
+ }
includes/vendor/composer/installers/src/Composer/Installers/UserFrostingInstaller.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class UserFrostingInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'sprinkle' => 'app/sprinkles/{$name}/',
8
+ );
9
+ }
includes/vendor/composer/installers/src/Composer/Installers/VanillaInstaller.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class VanillaInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'plugin' => 'plugins/{$name}/',
8
+ 'theme' => 'themes/{$name}/',
9
+ );
10
+ }
includes/vendor/composer/installers/src/Composer/Installers/VgmcpInstaller.php ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class VgmcpInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'bundle' => 'src/{$vendor}/{$name}/',
8
+ 'theme' => 'themes/{$name}/'
9
+ );
10
+
11
+ /**
12
+ * Format package name.
13
+ *
14
+ * For package type vgmcp-bundle, cut off a trailing '-bundle' if present.
15
+ *
16
+ * For package type vgmcp-theme, cut off a trailing '-theme' if present.
17
+ *
18
+ */
19
+ public function inflectPackageVars($vars)
20
+ {
21
+ if ($vars['type'] === 'vgmcp-bundle') {
22
+ return $this->inflectPluginVars($vars);
23
+ }
24
+
25
+ if ($vars['type'] === 'vgmcp-theme') {
26
+ return $this->inflectThemeVars($vars);
27
+ }
28
+
29
+ return $vars;
30
+ }
31
+
32
+ protected function inflectPluginVars($vars)
33
+ {
34
+ $vars['name'] = preg_replace('/-bundle$/', '', $vars['name']);
35
+ $vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
36
+ $vars['name'] = str_replace(' ', '', ucwords($vars['name']));
37
+
38
+ return $vars;
39
+ }
40
+
41
+ protected function inflectThemeVars($vars)
42
+ {
43
+ $vars['name'] = preg_replace('/-theme$/', '', $vars['name']);
44
+ $vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
45
+ $vars['name'] = str_replace(' ', '', ucwords($vars['name']));
46
+
47
+ return $vars;
48
+ }
49
+ }
includes/vendor/composer/installers/src/Composer/Installers/WHMCSInstaller.php ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Composer\Installers;
4
+
5
+ class WHMCSInstaller extends BaseInstaller
6
+ {
7
+ protected $locations = array(
8
+ 'addons' => 'modules/addons/{$vendor}_{$name}/',
9
+ 'fraud' => 'modules/fraud/{$vendor}_{$name}/',
10
+ 'gateways' => 'modules/gateways/{$vendor}_{$name}/',
11
+ 'notifications' => 'modules/notifications/{$vendor}_{$name}/',
12
+ 'registrars' => 'modules/registrars/{$vendor}_{$name}/',
13
+ 'reports' => 'modules/reports/{$vendor}_{$name}/',
14
+ 'security' => 'modules/security/{$vendor}_{$name}/',
15
+ 'servers' => 'modules/servers/{$vendor}_{$name}/',
16
+ 'social' => 'modules/social/{$vendor}_{$name}/',
17
+ 'support' => 'modules/support/{$vendor}_{$name}/',
18
+ 'templates' => 'templates/{$vendor}_{$name}/',
19
+ 'includes' => 'includes/{$vendor}_{$name}/'
20
+ );
21
+ }
includes/vendor/composer/installers/src/Composer/Installers/WinterInstaller.php ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class WinterInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'module' => 'modules/{$name}/',
8
+ 'plugin' => 'plugins/{$vendor}/{$name}/',
9
+ 'theme' => 'themes/{$name}/'
10
+ );
11
+
12
+ /**
13
+ * Format package name.
14
+ *
15
+ * For package type winter-plugin, cut off a trailing '-plugin' if present.
16
+ *
17
+ * For package type winter-theme, cut off a trailing '-theme' if present.
18
+ *
19
+ */
20
+ public function inflectPackageVars($vars)
21
+ {
22
+ if ($vars['type'] === 'winter-module') {
23
+ return $this->inflectModuleVars($vars);
24
+ }
25
+
26
+ if ($vars['type'] === 'winter-plugin') {
27
+ return $this->inflectPluginVars($vars);
28
+ }
29
+
30
+ if ($vars['type'] === 'winter-theme') {
31
+ return $this->inflectThemeVars($vars);
32
+ }
33
+
34
+ return $vars;
35
+ }
36
+
37
+ protected function inflectModuleVars($vars)
38
+ {
39
+ $vars['name'] = preg_replace('/^wn-|-module$/', '', $vars['name']);
40
+
41
+ return $vars;
42
+ }
43
+
44
+ protected function inflectPluginVars($vars)
45
+ {
46
+ $vars['name'] = preg_replace('/^wn-|-plugin$/', '', $vars['name']);
47
+ $vars['vendor'] = preg_replace('/[^a-z0-9_]/i', '', $vars['vendor']);
48
+
49
+ return $vars;
50
+ }
51
+
52
+ protected function inflectThemeVars($vars)
53
+ {
54
+ $vars['name'] = preg_replace('/^wn-|-theme$/', '', $vars['name']);
55
+
56
+ return $vars;
57
+ }
58
+ }
includes/vendor/composer/installers/src/Composer/Installers/WolfCMSInstaller.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class WolfCMSInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'plugin' => 'wolf/plugins/{$name}/',
8
+ );
9
+ }
includes/vendor/composer/installers/src/Composer/Installers/WordPressInstaller.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class WordPressInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'plugin' => 'wp-content/plugins/{$name}/',
8
+ 'theme' => 'wp-content/themes/{$name}/',
9
+ 'muplugin' => 'wp-content/mu-plugins/{$name}/',
10
+ 'dropin' => 'wp-content/{$name}/',
11
+ );
12
+ }
includes/vendor/composer/installers/src/Composer/Installers/YawikInstaller.php ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Created by PhpStorm.
4
+ * User: cbleek
5
+ * Date: 25.03.16
6
+ * Time: 20:55
7
+ */
8
+
9
+ namespace Composer\Installers;
10
+
11
+
12
+ class YawikInstaller extends BaseInstaller
13
+ {
14
+ protected $locations = array(
15
+ 'module' => 'module/{$name}/',
16
+ );
17
+
18
+ /**
19
+ * Format package name to CamelCase
20
+ * @param array $vars
21
+ *
22
+ * @return array
23
+ */
24
+ public function inflectPackageVars($vars)
25
+ {
26
+ $vars['name'] = strtolower(preg_replace('/(?<=\\w)([A-Z])/', '_\\1', $vars['name']));
27
+ $vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
28
+ $vars['name'] = str_replace(' ', '', ucwords($vars['name']));
29
+
30
+ return $vars;
31
+ }
32
+ }
includes/vendor/composer/installers/src/Composer/Installers/ZendInstaller.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class ZendInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'library' => 'library/{$name}/',
8
+ 'extra' => 'extras/library/{$name}/',
9
+ 'module' => 'module/{$name}/',
10
+ );
11
+ }
includes/vendor/composer/installers/src/Composer/Installers/ZikulaInstaller.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class ZikulaInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'module' => 'modules/{$vendor}-{$name}/',
8
+ 'theme' => 'themes/{$vendor}-{$name}/'
9
+ );
10
+ }
includes/vendor/composer/installers/src/bootstrap.php ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ function includeIfExists($file)
3
+ {
4
+ if (file_exists($file)) {
5
+ return include $file;
6
+ }
7
+ }
8
+ if ((!$loader = includeIfExists(__DIR__ . '/../vendor/autoload.php')) && (!$loader = includeIfExists(__DIR__ . '/../../../autoload.php'))) {
9
+ die('You must set up the project dependencies, run the following commands:'.PHP_EOL.
10
+ 'curl -s http://getcomposer.org/installer | php'.PHP_EOL.
11
+ 'php composer.phar install'.PHP_EOL);
12
+ }
13
+ return $loader;
includes/vendor/composer/platform_check.php ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ // platform_check.php @generated by Composer
4
+
5
+ $issues = array();
6
+
7
+ if (!(PHP_VERSION_ID >= 70100)) {
8
+ $issues[] = 'Your Composer dependencies require a PHP version ">= 7.1.0". You are running ' . PHP_VERSION . '.';
9
+ }
10
+
11
+ if ($issues) {
12
+ if (!headers_sent()) {
13
+ header('HTTP/1.1 500 Internal Server Error');
14
+ }
15
+ if (!ini_get('display_errors')) {
16
+ if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') {
17
+ fwrite(STDERR, 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . implode(PHP_EOL, $issues) . PHP_EOL.PHP_EOL);
18
+ } elseif (!headers_sent()) {
19
+ echo 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . str_replace('You are running '.PHP_VERSION.'.', '', implode(PHP_EOL, $issues)) . PHP_EOL.PHP_EOL;
20
+ }
21
+ }
22
+ trigger_error(
23
+ 'Composer detected issues in your platform: ' . implode(' ', $issues),
24
+ E_USER_ERROR
25
+ );
26
+ }
includes/vendor/firebase/php-jwt/LICENSE CHANGED
@@ -13,7 +13,7 @@ modification, are permitted provided that the following conditions are met:
13
  disclaimer in the documentation and/or other materials provided
14
  with the distribution.
15
 
16
- * Neither the name of Neuman Vong nor the names of other
17
  contributors may be used to endorse or promote products derived
18
  from this software without specific prior written permission.
19
 
13
  disclaimer in the documentation and/or other materials provided
14
  with the distribution.
15
 
16
+ * Neither the name of the copyright holder nor the names of other
17
  contributors may be used to endorse or promote products derived
18
  from this software without specific prior written permission.
19
 
includes/vendor/firebase/php-jwt/README.md CHANGED
@@ -1,4 +1,4 @@
1
- [![Build Status](https://travis-ci.org/firebase/php-jwt.png?branch=master)](https://travis-ci.org/firebase/php-jwt)
2
  [![Latest Stable Version](https://poser.pugx.org/firebase/php-jwt/v/stable)](https://packagist.org/packages/firebase/php-jwt)
3
  [![Total Downloads](https://poser.pugx.org/firebase/php-jwt/downloads)](https://packagist.org/packages/firebase/php-jwt)
4
  [![License](https://poser.pugx.org/firebase/php-jwt/license)](https://packagist.org/packages/firebase/php-jwt)
@@ -16,19 +16,26 @@ Use composer to manage your dependencies and download PHP-JWT:
16
  composer require firebase/php-jwt
17
  ```
18
 
 
 
 
 
 
 
 
19
  Example
20
  -------
21
  ```php
22
- <?php
23
- use \Firebase\JWT\JWT;
24
-
25
- $key = "example_key";
26
- $token = array(
27
- "iss" => "http://example.org",
28
- "aud" => "http://example.com",
29
- "iat" => 1356999524,
30
- "nbf" => 1357000000
31
- );
32
 
33
  /**
34
  * IMPORTANT:
@@ -36,8 +43,8 @@ $token = array(
36
  * https://tools.ietf.org/html/draft-ietf-jose-json-web-algorithms-40
37
  * for a list of spec-compliant algorithms.
38
  */
39
- $jwt = JWT::encode($token, $key);
40
- $decoded = JWT::decode($jwt, $key, array('HS256'));
41
 
42
  print_r($decoded);
43
 
@@ -56,15 +63,13 @@ $decoded_array = (array) $decoded;
56
  * Source: http://self-issued.info/docs/draft-ietf-oauth-json-web-token.html#nbfDef
57
  */
58
  JWT::$leeway = 60; // $leeway in seconds
59
- $decoded = JWT::decode($jwt, $key, array('HS256'));
60
-
61
- ?>
62
  ```
63
  Example with RS256 (openssl)
64
  ----------------------------
65
  ```php
66
- <?php
67
- use \Firebase\JWT\JWT;
68
 
69
  $privateKey = <<<EOD
70
  -----BEGIN RSA PRIVATE KEY-----
@@ -93,17 +98,17 @@ ehde/zUxo6UvS7UrBQIDAQAB
93
  -----END PUBLIC KEY-----
94
  EOD;
95
 
96
- $token = array(
97
- "iss" => "example.org",
98
- "aud" => "example.com",
99
- "iat" => 1356999524,
100
- "nbf" => 1357000000
101
- );
102
 
103
- $jwt = JWT::encode($token, $privateKey, 'RS256');
104
  echo "Encode:\n" . print_r($jwt, true) . "\n";
105
 
106
- $decoded = JWT::decode($jwt, $publicKey, array('RS256'));
107
 
108
  /*
109
  NOTE: This will now be an object instead of an associative array. To get
@@ -112,12 +117,174 @@ $decoded = JWT::decode($jwt, $publicKey, array('RS256'));
112
 
113
  $decoded_array = (array) $decoded;
114
  echo "Decode:\n" . print_r($decoded_array, true) . "\n";
115
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
116
  ```
117
 
118
  Changelog
119
  ---------
120
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
121
  #### 5.0.0 / 2017-06-26
122
  - Support RS384 and RS512.
123
  See [#117](https://github.com/firebase/php-jwt/pull/117). Thanks [@joostfaassen](https://github.com/joostfaassen)!
1
+ ![Build Status](https://github.com/firebase/php-jwt/actions/workflows/tests.yml/badge.svg)
2
  [![Latest Stable Version](https://poser.pugx.org/firebase/php-jwt/v/stable)](https://packagist.org/packages/firebase/php-jwt)
3
  [![Total Downloads](https://poser.pugx.org/firebase/php-jwt/downloads)](https://packagist.org/packages/firebase/php-jwt)
4
  [![License](https://poser.pugx.org/firebase/php-jwt/license)](https://packagist.org/packages/firebase/php-jwt)
16
  composer require firebase/php-jwt
17
  ```
18
 
19
+ Optionally, install the `paragonie/sodium_compat` package from composer if your
20
+ php is < 7.2 or does not have libsodium installed:
21
+
22
+ ```bash
23
+ composer require paragonie/sodium_compat
24
+ ```
25
+
26
  Example
27
  -------
28
  ```php
29
+ use Firebase\JWT\JWT;
30
+ use Firebase\JWT\Key;
31
+
32
+ $key = 'example_key';
33
+ $payload = [
34
+ 'iss' => 'http://example.org',
35
+ 'aud' => 'http://example.com',
36
+ 'iat' => 1356999524,
37
+ 'nbf' => 1357000000
38
+ ];
39
 
40
  /**
41
  * IMPORTANT:
43
  * https://tools.ietf.org/html/draft-ietf-jose-json-web-algorithms-40
44
  * for a list of spec-compliant algorithms.
45
  */
46
+ $jwt = JWT::encode($payload, $key, 'HS256');
47
+ $decoded = JWT::decode($jwt, new Key($key, 'HS256'));
48
 
49
  print_r($decoded);
50
 
63
  * Source: http://self-issued.info/docs/draft-ietf-oauth-json-web-token.html#nbfDef
64
  */
65
  JWT::$leeway = 60; // $leeway in seconds
66
+ $decoded = JWT::decode($jwt, new Key($key, 'HS256'));
 
 
67
  ```
68
  Example with RS256 (openssl)
69
  ----------------------------
70
  ```php
71
+ use Firebase\JWT\JWT;
72
+ use Firebase\JWT\Key;
73
 
74
  $privateKey = <<<EOD
75
  -----BEGIN RSA PRIVATE KEY-----
98
  -----END PUBLIC KEY-----
99
  EOD;
100
 
101
+ $payload = [
102
+ 'iss' => 'example.org',
103
+ 'aud' => 'example.com',
104
+ 'iat' => 1356999524,
105
+ 'nbf' => 1357000000
106
+ ];
107
 
108
+ $jwt = JWT::encode($payload, $privateKey, 'RS256');
109
  echo "Encode:\n" . print_r($jwt, true) . "\n";
110
 
111
+ $decoded = JWT::decode($jwt, new Key($publicKey, 'RS256'));
112
 
113
  /*
114
  NOTE: This will now be an object instead of an associative array. To get
117
 
118
  $decoded_array = (array) $decoded;
119
  echo "Decode:\n" . print_r($decoded_array, true) . "\n";
120
+ ```
121
+
122
+ Example with a passphrase
123
+ -------------------------
124
+
125
+ ```php
126
+ use Firebase\JWT\JWT;
127
+ use Firebase\JWT\Key;
128
+
129
+ // Your passphrase
130
+ $passphrase = '[YOUR_PASSPHRASE]';
131
+
132
+ // Your private key file with passphrase
133
+ // Can be generated with "ssh-keygen -t rsa -m pem"
134
+ $privateKeyFile = '/path/to/key-with-passphrase.pem';
135
+
136
+ // Create a private key of type "resource"
137
+ $privateKey = openssl_pkey_get_private(
138
+ file_get_contents($privateKeyFile),
139
+ $passphrase
140
+ );
141
+
142
+ $payload = [
143
+ 'iss' => 'example.org',
144
+ 'aud' => 'example.com',
145
+ 'iat' => 1356999524,
146
+ 'nbf' => 1357000000
147
+ ];
148
+
149
+ $jwt = JWT::encode($payload, $privateKey, 'RS256');
150
+ echo "Encode:\n" . print_r($jwt, true) . "\n";
151
+
152
+ // Get public key from the private key, or pull from from a file.
153
+ $publicKey = openssl_pkey_get_details($privateKey)['key'];
154
+
155
+ $decoded = JWT::decode($jwt, new Key($publicKey, 'RS256'));
156
+ echo "Decode:\n" . print_r((array) $decoded, true) . "\n";
157
+ ```
158
+
159
+ Example with EdDSA (libsodium and Ed25519 signature)
160
+ ----------------------------
161
+ ```php
162
+ use Firebase\JWT\JWT;
163
+ use Firebase\JWT\Key;
164
+
165
+ // Public and private keys are expected to be Base64 encoded. The last
166
+ // non-empty line is used so that keys can be generated with
167
+ // sodium_crypto_sign_keypair(). The secret keys generated by other tools may
168
+ // need to be adjusted to match the input expected by libsodium.
169
+
170
+ $keyPair = sodium_crypto_sign_keypair();
171
+
172
+ $privateKey = base64_encode(sodium_crypto_sign_secretkey($keyPair));
173
+
174
+ $publicKey = base64_encode(sodium_crypto_sign_publickey($keyPair));
175
+
176
+ $payload = [
177
+ 'iss' => 'example.org',
178
+ 'aud' => 'example.com',
179
+ 'iat' => 1356999524,
180
+ 'nbf' => 1357000000
181
+ ];
182
+
183
+ $jwt = JWT::encode($payload, $privateKey, 'EdDSA');
184
+ echo "Encode:\n" . print_r($jwt, true) . "\n";
185
+
186
+ $decoded = JWT::decode($jwt, new Key($publicKey, 'EdDSA'));
187
+ echo "Decode:\n" . print_r((array) $decoded, true) . "\n";
188
+ ````
189
+
190
+ Using JWKs
191
+ ----------
192
+
193
+ ```php
194
+ use Firebase\JWT\JWK;
195
+ use Firebase\JWT\JWT;
196
+
197
+ // Set of keys. The "keys" key is required. For example, the JSON response to
198
+ // this endpoint: https://www.gstatic.com/iap/verify/public_key-jwk
199
+ $jwks = ['keys' => []];
200
+
201
+ // JWK::parseKeySet($jwks) returns an associative array of **kid** to Firebase\JWT\Key
202
+ // objects. Pass this as the second parameter to JWT::decode.
203
+ JWT::decode($payload, JWK::parseKeySet($jwks));
204
+ ```
205
+
206
+ Using Cached Key Sets
207
+ ---------------------
208
+
209
+ The `CachedKeySet` class can be used to fetch and cache JWKS (JSON Web Key Sets) from a public URI.
210
+ This has the following advantages:
211
+
212
+ 1. The results are cached for performance.
213
+ 2. If an unrecognized key is requested, the cache is refreshed, to accomodate for key rotation.
214
+ 3. If rate limiting is enabled, the JWKS URI will not make more than 10 requests a second.
215
+
216
+ ```php
217
+ use Firebase\JWT\CachedKeySet;
218
+ use Firebase\JWT\JWT;
219
+
220
+ // The URI for the JWKS you wish to cache the results from
221
+ $jwksUri = 'https://www.gstatic.com/iap/verify/public_key-jwk';
222
+
223
+ // Create an HTTP client (can be any PSR-7 compatible HTTP client)
224
+ $httpClient = new GuzzleHttp\Client();
225
+
226
+ // Create an HTTP request factory (can be any PSR-17 compatible HTTP request factory)
227
+ $httpFactory = new GuzzleHttp\Psr\HttpFactory();
228
+
229
+ // Create a cache item pool (can be any PSR-6 compatible cache item pool)
230
+ $cacheItemPool = Phpfastcache\CacheManager::getInstance('files');
231
+
232
+ $keySet = new CachedKeySet(
233
+ $jwksUri,
234
+ $httpClient,
235
+ $httpFactory,
236
+ $cacheItemPool,
237
+ null, // $expiresAfter int seconds to set the JWKS to expire
238
+ true // $rateLimit true to enable rate limit of 10 RPS on lookup of invalid keys
239
+ );
240
+
241
+ $jwt = 'eyJhbGci...'; // Some JWT signed by a key from the $jwkUri above
242
+ $decoded = JWT::decode($jwt, $keySet);
243
+ ```
244
+
245
+ Miscellaneous
246
+ -------------
247
+
248
+ #### Casting to array
249
+
250
+ The return value of `JWT::decode` is the generic PHP object `stdClass`. If you'd like to handle with arrays
251
+ instead, you can do the following:
252
+
253
+ ```php
254
+ // return type is stdClass
255
+ $decoded = JWT::decode($payload, $keys);
256
+
257
+ // cast to array
258
+ $decoded = json_decode(json_encode($decoded), true);
259
  ```
260
 
261
  Changelog
262
  ---------
263
 
264
+ #### 6.3.0 / 2022-07-15
265
+
266
+ - Added ES256 support to JWK parsing ([#399](https://github.com/firebase/php-jwt/pull/399))
267
+ - Fixed potential caching error in `CachedKeySet` by caching jwks as strings ([#435](https://github.com/firebase/php-jwt/pull/435))
268
+
269
+ #### 6.2.0 / 2022-05-14
270
+
271
+ - Added `CachedKeySet` ([#397](https://github.com/firebase/php-jwt/pull/397))
272
+ - Added `$defaultAlg` parameter to `JWT::parseKey` and `JWT::parseKeySet` ([#426](https://github.com/firebase/php-jwt/pull/426)).
273
+
274
+ #### 6.1.0 / 2022-03-23
275
+
276
+ - Drop support for PHP 5.3, 5.4, 5.5, 5.6, and 7.0
277
+ - Add parameter typing and return types where possible
278
+
279
+ #### 6.0.0 / 2022-01-24
280
+
281
+ - **Backwards-Compatibility Breaking Changes**: See the [Release Notes](https://github.com/firebase/php-jwt/releases/tag/v6.0.0) for more information.
282
+ - New Key object to prevent key/algorithm type confusion (#365)
283
+ - Add JWK support (#273)
284
+ - Add ES256 support (#256)
285
+ - Add ES384 support (#324)
286
+ - Add Ed25519 support (#343)
287
+
288
  #### 5.0.0 / 2017-06-26
289
  - Support RS384 and RS512.
290
  See [#117](https://github.com/firebase/php-jwt/pull/117). Thanks [@joostfaassen](https://github.com/joostfaassen)!
includes/vendor/firebase/php-jwt/composer.json CHANGED
@@ -2,6 +2,10 @@
2
  "name": "firebase/php-jwt",
3
  "description": "A simple library to encode and decode JSON Web Tokens (JWT) in PHP. Should conform to the current spec.",
4
  "homepage": "https://github.com/firebase/php-jwt",
 
 
 
 
5
  "authors": [
6
  {
7
  "name": "Neuman Vong",
@@ -16,7 +20,10 @@
16
  ],
17
  "license": "BSD-3-Clause",
18
  "require": {
19
- "php": ">=5.3.0"
 
 
 
20
  },
21
  "autoload": {
22
  "psr-4": {
@@ -24,6 +31,11 @@
24
  }
25
  },
26
  "require-dev": {
27
- "phpunit/phpunit": " 4.8.35"
 
 
 
 
 
28
  }
29
  }
2
  "name": "firebase/php-jwt",
3
  "description": "A simple library to encode and decode JSON Web Tokens (JWT) in PHP. Should conform to the current spec.",
4
  "homepage": "https://github.com/firebase/php-jwt",
5
+ "keywords": [
6
+ "php",
7
+ "jwt"
8
+ ],
9
  "authors": [
10
  {
11
  "name": "Neuman Vong",
20
  ],
21
  "license": "BSD-3-Clause",
22
  "require": {
23
+ "php": "^7.1||^8.0"
24
+ },
25
+ "suggest": {
26
+ "paragonie/sodium_compat": "Support EdDSA (Ed25519) signatures when libsodium is not present"
27
  },
28
  "autoload": {
29
  "psr-4": {
31
  }
32
  },
33
  "require-dev": {
34
+ "guzzlehttp/guzzle": "^6.5||^7.4",
35
+ "phpspec/prophecy-phpunit": "^1.1",
36
+ "phpunit/phpunit": "^7.5||^9.5",
37
+ "psr/cache": "^1.0||^2.0",
38
+ "psr/http-client": "^1.0",
39
+ "psr/http-factory": "^1.0"
40
  }
41
  }
includes/vendor/firebase/php-jwt/src/BeforeValidException.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
 
2
  namespace Firebase\JWT;
3
 
4
  class BeforeValidException extends \UnexpectedValueException
5
  {
6
-
7
  }
1
  <?php
2
+
3
  namespace Firebase\JWT;
4
 
5
  class BeforeValidException extends \UnexpectedValueException
6
  {
 
7
  }
includes/vendor/firebase/php-jwt/src/CachedKeySet.php ADDED
@@ -0,0 +1,229 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Firebase\JWT;
4
+
5
+ use ArrayAccess;
6
+ use LogicException;
7
+ use OutOfBoundsException;
8
+ use Psr\Cache\CacheItemInterface;
9
+ use Psr\Cache\CacheItemPoolInterface;
10
+ use Psr\Http\Client\ClientInterface;
11
+ use Psr\Http\Message\RequestFactoryInterface;
12
+ use RuntimeException;
13
+
14
+ /**
15
+ * @implements ArrayAccess<string, Key>
16
+ */
17
+ class CachedKeySet implements ArrayAccess
18
+ {
19
+ /**
20
+ * @var string
21
+ */
22
+ private $jwksUri;
23
+ /**
24
+ * @var ClientInterface
25
+ */
26
+ private $httpClient;
27
+ /**
28
+ * @var RequestFactoryInterface
29
+ */
30
+ private $httpFactory;
31
+ /**
32
+ * @var CacheItemPoolInterface
33
+ */
34
+ private $cache;
35
+ /**
36
+ * @var ?int
37
+ */
38
+ private $expiresAfter;
39
+ /**
40
+ * @var ?CacheItemInterface
41
+ */
42
+ private $cacheItem;
43
+ /**
44
+ * @var array<string, Key>
45
+ */
46
+ private $keySet;
47
+ /**
48
+ * @var string
49
+ */
50
+ private $cacheKey;
51
+ /**
52
+ * @var string
53
+ */
54
+ private $cacheKeyPrefix = 'jwks';
55
+ /**
56
+ * @var int
57
+ */
58
+ private $maxKeyLength = 64;
59
+ /**
60
+ * @var bool
61
+ */
62
+ private $rateLimit;
63
+ /**
64
+ * @var string
65
+ */
66
+ private $rateLimitCacheKey;
67
+ /**
68
+ * @var int
69
+ */
70
+ private $maxCallsPerMinute = 10;
71
+ /**
72
+ * @var string|null
73
+ */
74
+ private $defaultAlg;
75
+
76
+ public function __construct(
77
+ string $jwksUri,
78
+ ClientInterface $httpClient,
79
+ RequestFactoryInterface $httpFactory,
80
+ CacheItemPoolInterface $cache,
81
+ int $expiresAfter = null,
82
+ bool $rateLimit = false,
83
+ string $defaultAlg = null
84
+ ) {
85
+ $this->jwksUri = $jwksUri;
86
+ $this->httpClient = $httpClient;
87
+ $this->httpFactory = $httpFactory;
88
+ $this->cache = $cache;
89
+ $this->expiresAfter = $expiresAfter;
90
+ $this->rateLimit = $rateLimit;
91
+ $this->defaultAlg = $defaultAlg;
92
+ $this->setCacheKeys();
93
+ }
94
+
95
+ /**
96
+ * @param string $keyId
97
+ * @return Key
98
+ */
99
+ public function offsetGet($keyId): Key
100
+ {
101
+ if (!$this->keyIdExists($keyId)) {
102
+ throw new OutOfBoundsException('Key ID not found');
103
+ }
104
+ return $this->keySet[$keyId];
105
+ }
106
+
107
+ /**
108
+ * @param string $keyId
109
+ * @return bool
110
+ */
111
+ public function offsetExists($keyId): bool
112
+ {
113
+ return $this->keyIdExists($keyId);
114
+ }
115
+
116
+ /**
117
+ * @param string $offset
118
+ * @param Key $value
119
+ */
120
+ public function offsetSet($offset, $value): void
121
+ {
122
+ throw new LogicException('Method not implemented');
123
+ }
124
+
125
+ /**
126
+ * @param string $offset
127
+ */
128
+ public function offsetUnset($offset): void
129
+ {
130
+ throw new LogicException('Method not implemented');
131
+ }
132
+
133
+ private function keyIdExists(string $keyId): bool
134
+ {
135
+ if (null === $this->keySet) {
136
+ $item = $this->getCacheItem();
137
+ // Try to load keys from cache
138
+ if ($item->isHit()) {
139
+ // item found! Return it
140
+ $jwks = $item->get();
141
+ $this->keySet = JWK::parseKeySet(json_decode($jwks, true), $this->defaultAlg);
142
+ }
143
+ }
144
+
145
+ if (!isset($this->keySet[$keyId])) {
146
+ if ($this->rateLimitExceeded()) {
147
+ return false;
148
+ }
149
+ $request = $this->httpFactory->createRequest('get', $this->jwksUri);
150
+ $jwksResponse = $this->httpClient->sendRequest($request);
151
+ $jwks = (string) $jwksResponse->getBody();
152
+ $this->keySet = JWK::parseKeySet(json_decode($jwks, true), $this->defaultAlg);
153
+
154
+ if (!isset($this->keySet[$keyId])) {
155
+ return false;
156
+ }
157
+
158
+ $item = $this->getCacheItem();
159
+ $item->set($jwks);
160
+ if ($this->expiresAfter) {
161
+ $item->expiresAfter($this->expiresAfter);
162
+ }
163
+ $this->cache->save($item);
164
+ }
165
+
166
+ return true;
167
+ }
168
+
169
+ private function rateLimitExceeded(): bool
170
+ {
171
+ if (!$this->rateLimit) {
172
+ return false;
173
+ }
174
+
175
+ $cacheItem = $this->cache->getItem($this->rateLimitCacheKey);
176
+ if (!$cacheItem->isHit()) {
177
+ $cacheItem->expiresAfter(1); // # of calls are cached each minute
178
+ }
179
+
180
+ $callsPerMinute = (int) $cacheItem->get();
181
+ if (++$callsPerMinute > $this->maxCallsPerMinute) {
182
+ return true;
183
+ }
184
+ $cacheItem->set($callsPerMinute);
185
+ $this->cache->save($cacheItem);
186
+ return false;
187
+ }
188
+
189
+ private function getCacheItem(): CacheItemInterface
190
+ {
191
+ if (\is_null($this->cacheItem)) {
192
+ $this->cacheItem = $this->cache->getItem($this->cacheKey);
193
+ }
194
+
195
+ return $this->cacheItem;
196
+ }
197
+
198
+ private function setCacheKeys(): void
199
+ {
200
+ if (empty($this->jwksUri)) {
201
+ throw new RuntimeException('JWKS URI is empty');
202
+ }
203
+
204
+ // ensure we do not have illegal characters
205
+ $key = preg_replace('|[^a-zA-Z0-9_\.!]|', '', $this->jwksUri);
206
+
207
+ // add prefix
208
+ $key = $this->cacheKeyPrefix . $key;
209
+
210
+ // Hash keys if they exceed $maxKeyLength of 64
211
+ if (\strlen($key) > $this->maxKeyLength) {
212
+ $key = substr(hash('sha256', $key), 0, $this->maxKeyLength);
213
+ }
214
+
215
+ $this->cacheKey = $key;
216
+
217
+ if ($this->rateLimit) {
218
+ // add prefix
219
+ $rateLimitKey = $this->cacheKeyPrefix . 'ratelimit' . $key;
220
+
221
+ // Hash keys if they exceed $maxKeyLength of 64
222
+ if (\strlen($rateLimitKey) > $this->maxKeyLength) {
223
+ $rateLimitKey = substr(hash('sha256', $rateLimitKey), 0, $this->maxKeyLength);
224
+ }
225
+
226
+ $this->rateLimitCacheKey = $rateLimitKey;
227
+ }
228
+ }
229
+ }
includes/vendor/firebase/php-jwt/src/ExpiredException.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
 
2
  namespace Firebase\JWT;
3
 
4
  class ExpiredException extends \UnexpectedValueException
5
  {
6
-
7
  }
1
  <?php
2
+
3
  namespace Firebase\JWT;
4
 
5
  class ExpiredException extends \UnexpectedValueException
6
  {
 
7
  }
includes/vendor/firebase/php-jwt/src/JWK.php ADDED
@@ -0,0 +1,322 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Firebase\JWT;
4
+
5
+ use DomainException;
6
+ use InvalidArgumentException;
7
+ use UnexpectedValueException;
8
+
9
+ /**
10
+ * JSON Web Key implementation, based on this spec:
11
+ * https://tools.ietf.org/html/draft-ietf-jose-json-web-key-41
12
+ *
13
+ * PHP version 5
14
+ *
15
+ * @category Authentication
16
+ * @package Authentication_JWT
17
+ * @author Bui Sy Nguyen <nguyenbs@gmail.com>
18
+ * @license http://opensource.org/licenses/BSD-3-Clause 3-clause BSD
19
+ * @link https://github.com/firebase/php-jwt
20
+ */
21
+ class JWK
22
+ {
23
+ private const OID = '1.2.840.10045.2.1';
24
+ private const ASN1_OBJECT_IDENTIFIER = 0x06;
25
+ private const ASN1_SEQUENCE = 0x10; // also defined in JWT
26
+ private const ASN1_BIT_STRING = 0x03;
27
+ private const EC_CURVES = [
28
+ 'P-256' => '1.2.840.10045.3.1.7', // Len: 64
29
+ // 'P-384' => '1.3.132.0.34', // Len: 96 (not yet supported)
30
+ // 'P-521' => '1.3.132.0.35', // Len: 132 (not supported)
31
+ ];
32
+
33
+ /**
34
+ * Parse a set of JWK keys
35
+ *
36
+ * @param array<mixed> $jwks The JSON Web Key Set as an associative array
37
+ * @param string $defaultAlg The algorithm for the Key object if "alg" is not set in the
38
+ * JSON Web Key Set
39
+ *
40
+ * @return array<string, Key> An associative array of key IDs (kid) to Key objects
41
+ *
42
+ * @throws InvalidArgumentException Provided JWK Set is empty
43
+ * @throws UnexpectedValueException Provided JWK Set was invalid
44
+ * @throws DomainException OpenSSL failure
45
+ *
46
+ * @uses parseKey
47
+ */
48
+ public static function parseKeySet(array $jwks, string $defaultAlg = null): array
49
+ {
50
+ $keys = [];
51
+
52
+ if (!isset($jwks['keys'])) {
53
+ throw new UnexpectedValueException('"keys" member must exist in the JWK Set');
54
+ }
55
+
56
+ if (empty($jwks['keys'])) {
57
+ throw new InvalidArgumentException('JWK Set did not contain any keys');
58
+ }
59
+
60
+ foreach ($jwks['keys'] as $k => $v) {
61
+ $kid = isset($v['kid']) ? $v['kid'] : $k;
62
+ if ($key = self::parseKey($v, $defaultAlg)) {
63
+ $keys[(string) $kid] = $key;
64
+ }
65
+ }
66
+
67
+ if (0 === \count($keys)) {
68
+ throw new UnexpectedValueException('No supported algorithms found in JWK Set');
69
+ }
70
+
71
+ return $keys;
72
+ }
73
+
74
+ /**
75
+ * Parse a JWK key
76
+ *
77
+ * @param array<mixed> $jwk An individual JWK
78
+ * @param string $defaultAlg The algorithm for the Key object if "alg" is not set in the
79
+ * JSON Web Key Set
80
+ *
81
+ * @return Key The key object for the JWK
82
+ *
83
+ * @throws InvalidArgumentException Provided JWK is empty
84
+ * @throws UnexpectedValueException Provided JWK was invalid
85
+ * @throws DomainException OpenSSL failure
86
+ *
87
+ * @uses createPemFromModulusAndExponent
88
+ */
89
+ public static function parseKey(array $jwk, string $defaultAlg = null): ?Key
90
+ {
91
+ if (empty($jwk)) {
92
+ throw new InvalidArgumentException('JWK must not be empty');
93
+ }
94
+
95
+ if (!isset($jwk['kty'])) {
96
+ throw new UnexpectedValueException('JWK must contain a "kty" parameter');
97
+ }
98
+
99
+ if (!isset($jwk['alg'])) {
100
+ if (\is_null($defaultAlg)) {
101
+ // The "alg" parameter is optional in a KTY, but an algorithm is required
102
+ // for parsing in this library. Use the $defaultAlg parameter when parsing the
103
+ // key set in order to prevent this error.
104
+ // @see https://datatracker.ietf.org/doc/html/rfc7517#section-4.4
105
+ throw new UnexpectedValueException('JWK must contain an "alg" parameter');
106
+ }
107
+ $jwk['alg'] = $defaultAlg;
108
+ }
109
+
110
+ switch ($jwk['kty']) {
111
+ case 'RSA':
112
+ if (!empty($jwk['d'])) {
113
+ throw new UnexpectedValueException('RSA private keys are not supported');
114
+ }
115
+ if (!isset($jwk['n']) || !isset($jwk['e'])) {
116
+ throw new UnexpectedValueException('RSA keys must contain values for both "n" and "e"');
117
+ }
118
+
119
+ $pem = self::createPemFromModulusAndExponent($jwk['n'], $jwk['e']);
120
+ $publicKey = \openssl_pkey_get_public($pem);
121
+ if (false === $publicKey) {
122
+ throw new DomainException(
123
+ 'OpenSSL error: ' . \openssl_error_string()
124
+ );
125
+ }
126
+ return new Key($publicKey, $jwk['alg']);
127
+ case 'EC':
128
+ if (isset($jwk['d'])) {
129
+ // The key is actually a private key
130
+ throw new UnexpectedValueException('Key data must be for a public key');
131
+ }
132
+
133
+ if (empty($jwk['crv'])) {
134
+ throw new UnexpectedValueException('crv not set');
135
+ }
136
+
137
+ if (!isset(self::EC_CURVES[$jwk['crv']])) {
138
+ throw new DomainException('Unrecognised or unsupported EC curve');
139
+ }
140
+
141
+ if (empty($jwk['x']) || empty($jwk['y'])) {
142
+ throw new UnexpectedValueException('x and y not set');
143
+ }
144
+
145
+ $publicKey = self::createPemFromCrvAndXYCoordinates($jwk['crv'], $jwk['x'], $jwk['y']);
146
+ return new Key($publicKey, $jwk['alg']);
147
+ default:
148
+ // Currently only RSA is supported
149
+ break;
150
+ }
151
+
152
+ return null;
153
+ }
154
+
155
+ /**
156
+ * Converts the EC JWK values to pem format.
157
+ *
158
+ * @param string $crv The EC curve (only P-256 is supported)
159
+ * @param string $x The EC x-coordinate
160
+ * @param string $y The EC y-coordinate
161
+ *
162
+ * @return string
163
+ */
164
+ private static function createPemFromCrvAndXYCoordinates(string $crv, string $x, string $y): string
165
+ {
166
+ $pem =
167
+ self::encodeDER(
168
+ self::ASN1_SEQUENCE,
169
+ self::encodeDER(
170
+ self::ASN1_SEQUENCE,
171
+ self::encodeDER(
172
+ self::ASN1_OBJECT_IDENTIFIER,
173
+ self::encodeOID(self::OID)
174
+ )
175
+ . self::encodeDER(
176
+ self::ASN1_OBJECT_IDENTIFIER,
177
+ self::encodeOID(self::EC_CURVES[$crv])
178
+ )
179
+ ) .
180
+ self::encodeDER(
181
+ self::ASN1_BIT_STRING,
182
+ \chr(0x00) . \chr(0x04)
183
+ . JWT::urlsafeB64Decode($x)
184
+ . JWT::urlsafeB64Decode($y)
185
+ )
186
+ );
187
+
188
+ return sprintf(
189
+ "-----BEGIN PUBLIC KEY-----\n%s\n-----END PUBLIC KEY-----\n",
190
+ wordwrap(base64_encode($pem), 64, "\n", true)
191
+ );
192
+ }
193
+
194
+ /**
195
+ * Create a public key represented in PEM format from RSA modulus and exponent information
196
+ *
197
+ * @param string $n The RSA modulus encoded in Base64
198
+ * @param string $e The RSA exponent encoded in Base64
199
+ *
200
+ * @return string The RSA public key represented in PEM format
201
+ *
202
+ * @uses encodeLength
203
+ */
204
+ private static function createPemFromModulusAndExponent(
205
+ string $n,
206
+ string $e
207
+ ): string {
208
+ $mod = JWT::urlsafeB64Decode($n);
209
+ $exp = JWT::urlsafeB64Decode($e);
210
+
211
+ $modulus = \pack('Ca*a*', 2, self::encodeLength(\strlen($mod)), $mod);
212
+ $publicExponent = \pack('Ca*a*', 2, self::encodeLength(\strlen($exp)), $exp);
213
+
214
+ $rsaPublicKey = \pack(
215
+ 'Ca*a*a*',
216
+ 48,
217
+ self::encodeLength(\strlen($modulus) + \strlen($publicExponent)),
218
+ $modulus,
219
+ $publicExponent
220
+ );
221
+
222
+ // sequence(oid(1.2.840.113549.1.1.1), null)) = rsaEncryption.
223
+ $rsaOID = \pack('H*', '300d06092a864886f70d0101010500'); // hex version of MA0GCSqGSIb3DQEBAQUA
224
+ $rsaPublicKey = \chr(0) . $rsaPublicKey;
225
+ $rsaPublicKey = \chr(3) . self::encodeLength(\strlen($rsaPublicKey)) . $rsaPublicKey;
226
+
227
+ $rsaPublicKey = \pack(
228
+ 'Ca*a*',
229
+ 48,
230
+ self::encodeLength(\strlen($rsaOID . $rsaPublicKey)),
231
+ $rsaOID . $rsaPublicKey
232
+ );
233
+
234
+ return "-----BEGIN PUBLIC KEY-----\r\n" .
235
+ \chunk_split(\base64_encode($rsaPublicKey), 64) .
236
+ '-----END PUBLIC KEY-----';
237
+ }
238
+
239
+ /**
240
+ * DER-encode the length
241
+ *
242
+ * DER supports lengths up to (2**8)**127, however, we'll only support lengths up to (2**8)**4. See
243
+ * {@link http://itu.int/ITU-T/studygroups/com17/languages/X.690-0207.pdf#p=13 X.690 paragraph 8.1.3} for more information.
244
+ *
245
+ * @param int $length
246
+ * @return string
247
+ */
248
+ private static function encodeLength(int $length): string
249
+ {
250
+ if ($length <= 0x7F) {
251
+ return \chr($length);
252
+ }
253
+
254
+ $temp = \ltrim(\pack('N', $length), \chr(0));
255
+
256
+ return \pack('Ca*', 0x80 | \strlen($temp), $temp);
257
+ }
258
+
259
+ /**
260
+ * Encodes a value into a DER object.
261
+ * Also defined in Firebase\JWT\JWT
262
+ *
263
+ * @param int $type DER tag
264
+ * @param string $value the value to encode
265
+ * @return string the encoded object
266
+ */
267
+ private static function encodeDER(int $type, string $value): string
268
+ {
269
+ $tag_header = 0;
270
+ if ($type === self::ASN1_SEQUENCE) {
271
+ $tag_header |= 0x20;
272
+ }
273
+
274
+ // Type
275
+ $der = \chr($tag_header | $type);
276
+
277
+ // Length
278
+ $der .= \chr(\strlen($value));
279
+
280
+ return $der . $value;
281
+ }
282
+
283
+ /**
284
+ * Encodes a string into a DER-encoded OID.
285
+ *
286
+ * @param string $oid the OID string
287
+ * @return string the binary DER-encoded OID
288
+ */
289
+ private static function encodeOID(string $oid): string
290
+ {
291
+ $octets = explode('.', $oid);
292
+
293
+ // Get the first octet
294
+ $first = (int) array_shift($octets);
295
+ $second = (int) array_shift($octets);
296
+ $oid = \chr($first * 40 + $second);
297
+
298
+ // Iterate over subsequent octets
299
+ foreach ($octets as $octet) {
300
+ if ($octet == 0) {
301
+ $oid .= \chr(0x00);
302
+ continue;
303
+ }
304
+ $bin = '';
305
+
306
+ while ($octet) {
307
+ $bin .= \chr(0x80 | ($octet & 0x7f));
308
+ $octet >>= 7;
309
+ }
310
+ $bin[0] = $bin[0] & \chr(0x7f);
311
+
312
+ // Convert to big endian if necessary
313
+ if (pack('V', 65534) == pack('L', 65534)) {
314
+ $oid .= strrev($bin);
315
+ } else {
316
+ $oid .= $bin;
317
+ }
318
+ }
319
+
320
+ return $oid;
321
+ }
322
+ }
includes/vendor/firebase/php-jwt/src/JWT.php CHANGED
@@ -1,10 +1,16 @@
1
  <?php
2
 
3
  namespace Firebase\JWT;
4
- use \DomainException;
5
- use \InvalidArgumentException;
6
- use \UnexpectedValueException;
7
- use \DateTime;
 
 
 
 
 
 
8
 
9
  /**
10
  * JSON Web Token implementation, based on this spec:
@@ -21,42 +27,57 @@ use \DateTime;
21
  */
22
  class JWT
23
  {
 
 
 
24
 
25
  /**
26
  * When checking nbf, iat or expiration times,
27
  * we want to provide some extra leeway time to
28
  * account for clock skew.
 
 
29
  */
30
  public static $leeway = 0;
31
 
32
  /**
33
  * Allow the current timestamp to be specified.
34
  * Useful for fixing a value within unit testing.
35
- *
36
  * Will default to PHP time() value if null.
 
 
37
  */
38
  public static $timestamp = null;
39
 
40
- public static $supported_algs = array(
41
- 'HS256' => array('hash_hmac', 'SHA256'),
42
- 'HS512' => array('hash_hmac', 'SHA512'),
43
- 'HS384' => array('hash_hmac', 'SHA384'),
44
- 'RS256' => array('openssl', 'SHA256'),
45
- 'RS384' => array('openssl', 'SHA384'),
46
- 'RS512' => array('openssl', 'SHA512'),
47
- );
 
 
 
 
 
 
48
 
49
  /**
50
  * Decodes a JWT string into a PHP object.
51
  *
52
- * @param string $jwt The JWT
53
- * @param string|array $key The key, or map of keys.
54
- * If the algorithm used is asymmetric, this is the public key
55
- * @param array $allowed_algs List of supported verification algorithms
56
- * Supported algorithms are 'HS256', 'HS384', 'HS512' and 'RS256'
 
57
  *
58
- * @return object The JWT's payload as a PHP object
59
  *
 
 
60
  * @throws UnexpectedValueException Provided JWT was invalid
61
  * @throws SignatureInvalidException Provided JWT was invalid because the signature verification failed
62
  * @throws BeforeValidException Provided JWT is trying to be used before it's eligible as defined by 'nbf'
@@ -66,57 +87,64 @@ class JWT
66
  * @uses jsonDecode
67
  * @uses urlsafeB64Decode
68
  */
69
- public static function decode($jwt, $key, array $allowed_algs = array())
70
- {
71
- $timestamp = is_null(static::$timestamp) ? time() : static::$timestamp;
 
 
 
72
 
73
- if (empty($key)) {
74
  throw new InvalidArgumentException('Key may not be empty');
75
  }
76
- $tks = explode('.', $jwt);
77
- if (count($tks) != 3) {
78
  throw new UnexpectedValueException('Wrong number of segments');
79
  }
80
  list($headb64, $bodyb64, $cryptob64) = $tks;
81
- if (null === ($header = static::jsonDecode(static::urlsafeB64Decode($headb64)))) {
 
82
  throw new UnexpectedValueException('Invalid header encoding');
83
  }
84
- if (null === $payload = static::jsonDecode(static::urlsafeB64Decode($bodyb64))) {
 
85
  throw new UnexpectedValueException('Invalid claims encoding');
86
  }
87
- if (false === ($sig = static::urlsafeB64Decode($cryptob64))) {
88
- throw new UnexpectedValueException('Invalid signature encoding');
 
89
  }
 
 
 
 
90
  if (empty($header->alg)) {
91
  throw new UnexpectedValueException('Empty algorithm');
92
  }
93
  if (empty(static::$supported_algs[$header->alg])) {
94
  throw new UnexpectedValueException('Algorithm not supported');
95
  }
96
- if (!in_array($header->alg, $allowed_algs)) {
97
- throw new UnexpectedValueException('Algorithm not allowed');
 
 
 
 
 
98
  }
99
- if (is_array($key) || $key instanceof \ArrayAccess) {
100
- if (isset($header->kid)) {
101
- if (!isset($key[$header->kid])) {
102
- throw new UnexpectedValueException('"kid" invalid, unable to lookup correct key');
103
- }
104
- $key = $key[$header->kid];
105
- } else {
106
- throw new UnexpectedValueException('"kid" empty, unable to lookup correct key');
107
- }
108
  }
109
-
110
- // Check the signature
111
- if (!static::verify("$headb64.$bodyb64", $sig, $key, $header->alg)) {
112
  throw new SignatureInvalidException('Signature verification failed');
113
  }
114
 
115
- // Check if the nbf if it is defined. This is the time that the
116
  // token can actually be used. If it's not yet that time, abort.
117
  if (isset($payload->nbf) && $payload->nbf > ($timestamp + static::$leeway)) {
118
  throw new BeforeValidException(
119
- 'Cannot handle token prior to ' . date(DateTime::ISO8601, $payload->nbf)
120
  );
121
  }
122
 
@@ -125,7 +153,7 @@ class JWT
125
  // correctly used the nbf claim).
126
  if (isset($payload->iat) && $payload->iat > ($timestamp + static::$leeway)) {
127
  throw new BeforeValidException(
128
- 'Cannot handle token prior to ' . date(DateTime::ISO8601, $payload->iat)
129
  );
130
  }
131
 
@@ -140,118 +168,161 @@ class JWT
140
  /**
141
  * Converts and signs a PHP object or array into a JWT string.
142
  *
143
- * @param object|array $payload PHP object or array
144
- * @param string $key The secret key.
145
- * If the algorithm used is asymmetric, this is the private key
146
- * @param string $alg The signing algorithm.
147
- * Supported algorithms are 'HS256', 'HS384', 'HS512' and 'RS256'
148
- * @param mixed $keyId
149
- * @param array $head An array with header elements to attach
150
  *
151
  * @return string A signed JWT
152
  *
153
  * @uses jsonEncode
154
  * @uses urlsafeB64Encode
155
  */
156
- public static function encode($payload, $key, $alg = 'HS256', $keyId = null, $head = null)
157
- {
158
- $header = array('typ' => 'JWT', 'alg' => $alg);
 
 
 
 
 
159
  if ($keyId !== null) {
160
  $header['kid'] = $keyId;
161
  }
162
- if ( isset($head) && is_array($head) ) {
163
- $header = array_merge($head, $header);
164
  }
165
- $segments = array();
166
- $segments[] = static::urlsafeB64Encode(static::jsonEncode($header));
167
- $segments[] = static::urlsafeB64Encode(static::jsonEncode($payload));
168
- $signing_input = implode('.', $segments);
169
 
170
  $signature = static::sign($signing_input, $key, $alg);
171
  $segments[] = static::urlsafeB64Encode($signature);
172
 
173
- return implode('.', $segments);
174
  }
175
 
176
  /**
177
  * Sign a string with a given key and algorithm.
178
  *
179
- * @param string $msg The message to sign
180
- * @param string|resource $key The secret key
181
- * @param string $alg The signing algorithm.
182
- * Supported algorithms are 'HS256', 'HS384', 'HS512' and 'RS256'
183
  *
184
  * @return string An encrypted message
185
  *
186
- * @throws DomainException Unsupported algorithm was specified
187
  */
188
- public static function sign($msg, $key, $alg = 'HS256')
189
- {
 
 
 
190
  if (empty(static::$supported_algs[$alg])) {
191
  throw new DomainException('Algorithm not supported');
192
  }
193
  list($function, $algorithm) = static::$supported_algs[$alg];
194
- switch($function) {
195
  case 'hash_hmac':
196
- return hash_hmac($algorithm, $msg, $key, true);
 
 
 
197
  case 'openssl':
198
  $signature = '';
199
- $success = openssl_sign($msg, $signature, $key, $algorithm);
200
  if (!$success) {
201
- throw new DomainException("OpenSSL unable to sign data");
202
- } else {
203
- return $signature;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
204
  }
205
  }
 
 
206
  }
207
 
208
  /**
209
  * Verify a signature with the message, key and method. Not all methods
210
  * are symmetric, so we must have a separate verify and sign method.
211
  *
212
- * @param string $msg The original message (header and body)
213
- * @param string $signature The original signature
214
- * @param string|resource $key For HS*, a string key works. for RS*, must be a resource of an openssl public key
215
- * @param string $alg The algorithm
216
  *
217
  * @return bool
218
  *
219
- * @throws DomainException Invalid Algorithm or OpenSSL failure
220
  */
221
- private static function verify($msg, $signature, $key, $alg)
222
- {
 
 
 
 
223
  if (empty(static::$supported_algs[$alg])) {
224
  throw new DomainException('Algorithm not supported');
225
  }
226
 
227
  list($function, $algorithm) = static::$supported_algs[$alg];
228
- switch($function) {
229
  case 'openssl':
230
- $success = openssl_verify($msg, $signature, $key, $algorithm);
231
  if ($success === 1) {
232
  return true;
233
- } elseif ($success === 0) {
 
234
  return false;
235
  }
236
  // returns 1 on success, 0 on failure, -1 on error.
237
  throw new DomainException(
238
- 'OpenSSL error: ' . openssl_error_string()
239
  );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
240
  case 'hash_hmac':
241
  default:
242
- $hash = hash_hmac($algorithm, $msg, $key, true);
243
- if (function_exists('hash_equals')) {
244
- return hash_equals($signature, $hash);
245
- }
246
- $len = min(static::safeStrlen($signature), static::safeStrlen($hash));
247
-
248
- $status = 0;
249
- for ($i = 0; $i < $len; $i++) {
250
- $status |= (ord($signature[$i]) ^ ord($hash[$i]));
251
  }
252
- $status |= (static::safeStrlen($signature) ^ static::safeStrlen($hash));
253
-
254
- return ($status === 0);
255
  }
256
  }
257
 
@@ -260,30 +331,16 @@ class JWT
260
  *
261
  * @param string $input JSON string
262
  *
263
- * @return object Object representation of JSON string
264
  *
265
  * @throws DomainException Provided string was invalid JSON
266
  */
267
- public static function jsonDecode($input)
268
  {
269
- if (version_compare(PHP_VERSION, '5.4.0', '>=') && !(defined('JSON_C_VERSION') && PHP_INT_SIZE > 4)) {
270
- /** In PHP >=5.4.0, json_decode() accepts an options parameter, that allows you
271
- * to specify that large ints (like Steam Transaction IDs) should be treated as
272
- * strings, rather than the PHP default behaviour of converting them to floats.
273
- */
274
- $obj = json_decode($input, false, 512, JSON_BIGINT_AS_STRING);
275
- } else {
276
- /** Not all servers will support that, however, so for older versions we must
277
- * manually detect large ints in the JSON string and quote them (thus converting
278
- *them to strings) before decoding, hence the preg_replace() call.
279
- */
280
- $max_int_length = strlen((string) PHP_INT_MAX) - 1;
281
- $json_without_bigints = preg_replace('/:\s*(-?\d{'.$max_int_length.',})/', ': "$1"', $input);
282
- $obj = json_decode($json_without_bigints);
283
- }
284
 
285
- if (function_exists('json_last_error') && $errno = json_last_error()) {
286
- static::handleJsonError($errno);
287
  } elseif ($obj === null && $input !== 'null') {
288
  throw new DomainException('Null result with non-null input');
289
  }
@@ -291,22 +348,30 @@ class JWT
291
  }
292
 
293
  /**
294
- * Encode a PHP object into a JSON string.
295
  *
296
- * @param object|array $input A PHP object or array
297
  *
298
- * @return string JSON representation of the PHP object or array
299
  *
300
  * @throws DomainException Provided object could not be encoded to valid JSON
301
  */
302
- public static function jsonEncode($input)
303
  {
304
- $json = json_encode($input);
305
- if (function_exists('json_last_error') && $errno = json_last_error()) {
306
- static::handleJsonError($errno);
 
 
 
 
 
307
  } elseif ($json === 'null' && $input !== null) {
308
  throw new DomainException('Null result with non-null input');
309
  }
 
 
 
310
  return $json;
311
  }
312
 
@@ -316,15 +381,17 @@ class JWT
316
  * @param string $input A Base64 encoded string
317
  *
318
  * @return string A decoded string
 
 
319
  */
320
- public static function urlsafeB64Decode($input)
321
  {
322
- $remainder = strlen($input) % 4;
323
  if ($remainder) {
324
  $padlen = 4 - $remainder;
325
- $input .= str_repeat('=', $padlen);
326
  }
327
- return base64_decode(strtr($input, '-_', '+/'));
328
  }
329
 
330
  /**
@@ -334,9 +401,64 @@ class JWT
334
  *
335
  * @return string The base64 encode of what you passed in
336
  */
337
- public static function urlsafeB64Encode($input)
338
  {
339
- return str_replace('=', '', strtr(base64_encode($input), '+/', '-_'));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
340
  }
341
 
342
  /**
@@ -344,17 +466,19 @@ class JWT
344
  *
345
  * @param int $errno An error number from json_last_error()
346
  *
 
 
347
  * @return void
348
  */
349
- private static function handleJsonError($errno)
350
  {
351
- $messages = array(
352
  JSON_ERROR_DEPTH => 'Maximum stack depth exceeded',
353
  JSON_ERROR_STATE_MISMATCH => 'Invalid or malformed JSON',
354
  JSON_ERROR_CTRL_CHAR => 'Unexpected control character found',
355
  JSON_ERROR_SYNTAX => 'Syntax error, malformed JSON',
356
  JSON_ERROR_UTF8 => 'Malformed UTF-8 characters' //PHP >= 5.3.3
357
- );
358
  throw new DomainException(
359
  isset($messages[$errno])
360
  ? $messages[$errno]
@@ -365,15 +489,139 @@ class JWT
365
  /**
366
  * Get the number of bytes in cryptographic strings.
367
  *
368
- * @param string
369
  *
370
  * @return int
371
  */
372
- private static function safeStrlen($str)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
373
  {
374
- if (function_exists('mb_strlen')) {
375
- return mb_strlen($str, '8bit');
 
376
  }
377
- return strlen($str);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
378
  }
379
  }
1
  <?php
2
 
3
  namespace Firebase\JWT;
4
+
5
+ use ArrayAccess;
6
+ use DateTime;
7
+ use DomainException;
8
+ use Exception;
9
+ use InvalidArgumentException;
10
+ use OpenSSLAsymmetricKey;
11
+ use OpenSSLCertificate;
12
+ use stdClass;
13
+ use UnexpectedValueException;
14
 
15
  /**
16
  * JSON Web Token implementation, based on this spec:
27
  */
28
  class JWT
29
  {
30
+ private const ASN1_INTEGER = 0x02;
31
+ private const ASN1_SEQUENCE = 0x10;
32
+ private const ASN1_BIT_STRING = 0x03;
33
 
34
  /**
35
  * When checking nbf, iat or expiration times,
36
  * we want to provide some extra leeway time to
37
  * account for clock skew.
38
+ *
39
+ * @var int
40
  */
41
  public static $leeway = 0;
42
 
43
  /**
44
  * Allow the current timestamp to be specified.
45
  * Useful for fixing a value within unit testing.
 
46
  * Will default to PHP time() value if null.
47
+ *
48
+ * @var ?int
49
  */
50
  public static $timestamp = null;
51
 
52
+ /**
53
+ * @var array<string, string[]>
54
+ */
55
+ public static $supported_algs = [
56
+ 'ES384' => ['openssl', 'SHA384'],
57
+ 'ES256' => ['openssl', 'SHA256'],
58
+ 'HS256' => ['hash_hmac', 'SHA256'],
59
+ 'HS384' => ['hash_hmac', 'SHA384'],
60
+ 'HS512' => ['hash_hmac', 'SHA512'],
61
+ 'RS256' => ['openssl', 'SHA256'],
62
+ 'RS384' => ['openssl', 'SHA384'],
63
+ 'RS512' => ['openssl', 'SHA512'],
64
+ 'EdDSA' => ['sodium_crypto', 'EdDSA'],
65
+ ];
66
 
67
  /**
68
  * Decodes a JWT string into a PHP object.
69
  *
70
+ * @param string $jwt The JWT
71
+ * @param Key|array<string,Key> $keyOrKeyArray The Key or associative array of key IDs (kid) to Key objects.
72
+ * If the algorithm used is asymmetric, this is the public key
73
+ * Each Key object contains an algorithm and matching key.
74
+ * Supported algorithms are 'ES384','ES256', 'HS256', 'HS384',
75
+ * 'HS512', 'RS256', 'RS384', and 'RS512'
76
  *
77
+ * @return stdClass The JWT's payload as a PHP object
78
  *
79
+ * @throws InvalidArgumentException Provided key/key-array was empty
80
+ * @throws DomainException Provided JWT is malformed
81
  * @throws UnexpectedValueException Provided JWT was invalid
82
  * @throws SignatureInvalidException Provided JWT was invalid because the signature verification failed
83
  * @throws BeforeValidException Provided JWT is trying to be used before it's eligible as defined by 'nbf'
87
  * @uses jsonDecode
88
  * @uses urlsafeB64Decode
89
  */
90
+ public static function decode(
91
+ string $jwt,
92
+ $keyOrKeyArray
93
+ ): stdClass {
94
+ // Validate JWT
95
+ $timestamp = \is_null(static::$timestamp) ? \time() : static::$timestamp;
96
 
97
+ if (empty($keyOrKeyArray)) {
98
  throw new InvalidArgumentException('Key may not be empty');
99
  }
100
+ $tks = \explode('.', $jwt);
101
+ if (\count($tks) !== 3) {
102
  throw new UnexpectedValueException('Wrong number of segments');
103
  }
104
  list($headb64, $bodyb64, $cryptob64) = $tks;
105
+ $headerRaw = static::urlsafeB64Decode($headb64);
106
+ if (null === ($header = static::jsonDecode($headerRaw))) {
107
  throw new UnexpectedValueException('Invalid header encoding');
108
  }
109
+ $payloadRaw = static::urlsafeB64Decode($bodyb64);
110
+ if (null === ($payload = static::jsonDecode($payloadRaw))) {
111
  throw new UnexpectedValueException('Invalid claims encoding');
112
  }
113
+ if (\is_array($payload)) {
114
+ // prevent PHP Fatal Error in edge-cases when payload is empty array
115
+ $payload = (object) $payload;
116
  }
117
+ if (!$payload instanceof stdClass) {
118
+ throw new UnexpectedValueException('Payload must be a JSON object');
119
+ }
120
+ $sig = static::urlsafeB64Decode($cryptob64);
121
  if (empty($header->alg)) {
122
  throw new UnexpectedValueException('Empty algorithm');
123
  }
124
  if (empty(static::$supported_algs[$header->alg])) {
125
  throw new UnexpectedValueException('Algorithm not supported');
126
  }
127
+
128
+ $key = self::getKey($keyOrKeyArray, property_exists($header, 'kid') ? $header->kid : null);
129
+
130
+ // Check the algorithm
131
+ if (!self::constantTimeEquals($key->getAlgorithm(), $header->alg)) {
132
+ // See issue #351
133
+ throw new UnexpectedValueException('Incorrect key for this algorithm');
134
  }
135
+ if ($header->alg === 'ES256' || $header->alg === 'ES384') {
136
+ // OpenSSL expects an ASN.1 DER sequence for ES256/ES384 signatures
137
+ $sig = self::signatureToDER($sig);
 
 
 
 
 
 
138
  }
139
+ if (!self::verify("${headb64}.${bodyb64}", $sig, $key->getKeyMaterial(), $header->alg)) {
 
 
140
  throw new SignatureInvalidException('Signature verification failed');
141
  }
142
 
143
+ // Check the nbf if it is defined. This is the time that the
144
  // token can actually be used. If it's not yet that time, abort.
145
  if (isset($payload->nbf) && $payload->nbf > ($timestamp + static::$leeway)) {
146
  throw new BeforeValidException(
147
+ 'Cannot handle token prior to ' . \date(DateTime::ISO8601, $payload->nbf)
148
  );
149
  }
150
 
153
  // correctly used the nbf claim).
154
  if (isset($payload->iat) && $payload->iat > ($timestamp + static::$leeway)) {
155
  throw new BeforeValidException(
156
+ 'Cannot handle token prior to ' . \date(DateTime::ISO8601, $payload->iat)
157
  );
158
  }
159
 
168
  /**
169
  * Converts and signs a PHP object or array into a JWT string.
170
  *
171
+ * @param array<mixed> $payload PHP array
172
+ * @param string|resource|OpenSSLAsymmetricKey|OpenSSLCertificate $key The secret key.
173
+ * @param string $alg Supported algorithms are 'ES384','ES256', 'HS256', 'HS384',
174
+ * 'HS512', 'RS256', 'RS384', and 'RS512'
175
+ * @param string $keyId
176
+ * @param array<string, string> $head An array with header elements to attach
 
177
  *
178
  * @return string A signed JWT
179
  *
180
  * @uses jsonEncode
181
  * @uses urlsafeB64Encode
182
  */
183
+ public static function encode(
184
+ array $payload,
185
+ $key,
186
+ string $alg,
187
+ string $keyId = null,
188
+ array $head = null
189
+ ): string {
190
+ $header = ['typ' => 'JWT', 'alg' => $alg];
191
  if ($keyId !== null) {
192
  $header['kid'] = $keyId;
193
  }
194
+ if (isset($head) && \is_array($head)) {
195
+ $header = \array_merge($head, $header);
196
  }
197
+ $segments = [];
198
+ $segments[] = static::urlsafeB64Encode((string) static::jsonEncode($header));
199
+ $segments[] = static::urlsafeB64Encode((string) static::jsonEncode($payload));
200
+ $signing_input = \implode('.', $segments);
201
 
202
  $signature = static::sign($signing_input, $key, $alg);
203
  $segments[] = static::urlsafeB64Encode($signature);
204
 
205
+ return \implode('.', $segments);
206
  }
207
 
208
  /**
209
  * Sign a string with a given key and algorithm.
210
  *
211
+ * @param string $msg The message to sign
212
+ * @param string|resource|OpenSSLAsymmetricKey|OpenSSLCertificate $key The secret key.
213
+ * @param string $alg Supported algorithms are 'ES384','ES256', 'HS256', 'HS384',
214
+ * 'HS512', 'RS256', 'RS384', and 'RS512'
215
  *
216
  * @return string An encrypted message
217
  *
218
+ * @throws DomainException Unsupported algorithm or bad key was specified
219
  */
220
+ public static function sign(
221
+ string $msg,
222
+ $key,
223
+ string $alg
224
+ ): string {
225
  if (empty(static::$supported_algs[$alg])) {
226
  throw new DomainException('Algorithm not supported');
227
  }
228
  list($function, $algorithm) = static::$supported_algs[$alg];
229
+ switch ($function) {
230
  case 'hash_hmac':
231
+ if (!\is_string($key)) {
232
+ throw new InvalidArgumentException('key must be a string when using hmac');
233
+ }
234
+ return \hash_hmac($algorithm, $msg, $key, true);
235
  case 'openssl':
236
  $signature = '';
237
+ $success = \openssl_sign($msg, $signature, $key, $algorithm); // @phpstan-ignore-line
238
  if (!$success) {
239
+ throw new DomainException('OpenSSL unable to sign data');
240
+ }
241
+ if ($alg === 'ES256') {
242
+ $signature = self::signatureFromDER($signature, 256);
243
+ } elseif ($alg === 'ES384') {
244
+ $signature = self::signatureFromDER($signature, 384);
245
+ }
246
+ return $signature;
247
+ case 'sodium_crypto':
248
+ if (!\function_exists('sodium_crypto_sign_detached')) {
249
+ throw new DomainException('libsodium is not available');
250
+ }
251
+ if (!\is_string($key)) {
252
+ throw new InvalidArgumentException('key must be a string when using EdDSA');
253
+ }
254
+ try {
255
+ // The last non-empty line is used as the key.
256
+ $lines = array_filter(explode("\n", $key));
257
+ $key = base64_decode((string) end($lines));
258
+ return sodium_crypto_sign_detached($msg, $key);
259
+ } catch (Exception $e) {
260
+ throw new DomainException($e->getMessage(), 0, $e);
261
  }
262
  }
263
+
264
+ throw new DomainException('Algorithm not supported');
265
  }
266
 
267
  /**
268
  * Verify a signature with the message, key and method. Not all methods
269
  * are symmetric, so we must have a separate verify and sign method.
270
  *
271
+ * @param string $msg The original message (header and body)
272
+ * @param string $signature The original signature
273
+ * @param string|resource|OpenSSLAsymmetricKey|OpenSSLCertificate $keyMaterial For HS*, a string key works. for RS*, must be an instance of OpenSSLAsymmetricKey
274
+ * @param string $alg The algorithm
275
  *
276
  * @return bool
277
  *
278
+ * @throws DomainException Invalid Algorithm, bad key, or OpenSSL failure
279
  */
280
+ private static function verify(
281
+ string $msg,
282
+ string $signature,
283
+ $keyMaterial,
284
+ string $alg
285
+ ): bool {
286
  if (empty(static::$supported_algs[$alg])) {
287
  throw new DomainException('Algorithm not supported');
288
  }
289
 
290
  list($function, $algorithm) = static::$supported_algs[$alg];
291
+ switch ($function) {
292
  case 'openssl':
293
+ $success = \openssl_verify($msg, $signature, $keyMaterial, $algorithm); // @phpstan-ignore-line
294
  if ($success === 1) {
295
  return true;
296
+ }
297
+ if ($success === 0) {
298
  return false;
299
  }
300
  // returns 1 on success, 0 on failure, -1 on error.
301
  throw new DomainException(
302
+ 'OpenSSL error: ' . \openssl_error_string()
303
  );
304
+ case 'sodium_crypto':
305
+ if (!\function_exists('sodium_crypto_sign_verify_detached')) {
306
+ throw new DomainException('libsodium is not available');
307
+ }
308
+ if (!\is_string($keyMaterial)) {
309
+ throw new InvalidArgumentException('key must be a string when using EdDSA');
310
+ }
311
+ try {
312
+ // The last non-empty line is used as the key.
313
+ $lines = array_filter(explode("\n", $keyMaterial));
314
+ $key = base64_decode((string) end($lines));
315
+ return sodium_crypto_sign_verify_detached($signature, $msg, $key);
316
+ } catch (Exception $e) {
317
+ throw new DomainException($e->getMessage(), 0, $e);
318
+ }
319
  case 'hash_hmac':
320
  default:
321
+ if (!\is_string($keyMaterial)) {
322
+ throw new InvalidArgumentException('key must be a string when using hmac');
 
 
 
 
 
 
 
323
  }
324
+ $hash = \hash_hmac($algorithm, $msg, $keyMaterial, true);
325
+ return self::constantTimeEquals($hash, $signature);
 
326
  }
327
  }
328
 
331
  *
332
  * @param string $input JSON string
333
  *
334
+ * @return mixed The decoded JSON string
335
  *
336
  * @throws DomainException Provided string was invalid JSON
337
  */
338
+ public static function jsonDecode(string $input)
339
  {
340
+ $obj = \json_decode($input, false, 512, JSON_BIGINT_AS_STRING);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
341
 
342
+ if ($errno = \json_last_error()) {
343
+ self::handleJsonError($errno);
344
  } elseif ($obj === null && $input !== 'null') {
345
  throw new DomainException('Null result with non-null input');
346
  }
348
  }
349
 
350
  /**
351
+ * Encode a PHP array into a JSON string.
352
  *
353
+ * @param array<mixed> $input A PHP array
354
  *
355
+ * @return string JSON representation of the PHP array
356
  *
357
  * @throws DomainException Provided object could not be encoded to valid JSON
358
  */
359
+ public static function jsonEncode(array $input): string
360
  {
361
+ if (PHP_VERSION_ID >= 50400) {
362
+ $json = \json_encode($input, \JSON_UNESCAPED_SLASHES);
363
+ } else {
364
+ // PHP 5.3 only
365
+ $json = \json_encode($input);
366
+ }
367
+ if ($errno = \json_last_error()) {
368
+ self::handleJsonError($errno);
369
  } elseif ($json === 'null' && $input !== null) {
370
  throw new DomainException('Null result with non-null input');
371
  }
372
+ if ($json === false) {
373
+ throw new DomainException('Provided object could not be encoded to valid JSON');
374
+ }
375
  return $json;
376
  }
377
 
381
  * @param string $input A Base64 encoded string
382
  *
383
  * @return string A decoded string
384
+ *
385
+ * @throws InvalidArgumentException invalid base64 characters
386
  */
387
+ public static function urlsafeB64Decode(string $input): string
388
  {
389
+ $remainder = \strlen($input) % 4;
390
  if ($remainder) {
391
  $padlen = 4 - $remainder;
392
+ $input .= \str_repeat('=', $padlen);
393
  }
394
+ return \base64_decode(\strtr($input, '-_', '+/'));
395
  }
396
 
397
  /**
401
  *
402
  * @return string The base64 encode of what you passed in
403
  */
404
+ public static function urlsafeB64Encode(string $input): string
405
  {
406
+ return \str_replace('=', '', \strtr(\base64_encode($input), '+/', '-_'));
407
+ }
408
+
409
+
410
+ /**
411
+ * Determine if an algorithm has been provided for each Key
412
+ *
413
+ * @param Key|ArrayAccess<string,Key>|array<string,Key> $keyOrKeyArray
414
+ * @param string|null $kid
415
+ *
416
+ * @throws UnexpectedValueException
417
+ *
418
+ * @return Key
419
+ */
420
+ private static function getKey(
421
+ $keyOrKeyArray,
422
+ ?string $kid
423
+ ): Key {
424
+ if ($keyOrKeyArray instanceof Key) {
425
+ return $keyOrKeyArray;
426
+ }
427
+
428
+ if ($keyOrKeyArray instanceof CachedKeySet) {
429
+ // Skip "isset" check, as this will automatically refresh if not set
430
+ return $keyOrKeyArray[$kid];
431
+ }
432
+
433
+ if (empty($kid)) {
434
+ throw new UnexpectedValueException('"kid" empty, unable to lookup correct key');
435
+ }
436
+ if (!isset($keyOrKeyArray[$kid])) {
437
+ throw new UnexpectedValueException('"kid" invalid, unable to lookup correct key');
438
+ }
439
+
440
+ return $keyOrKeyArray[$kid];
441
+ }
442
+
443
+ /**
444
+ * @param string $left The string of known length to compare against
445
+ * @param string $right The user-supplied string
446
+ * @return bool
447
+ */
448
+ public static function constantTimeEquals(string $left, string $right): bool
449
+ {
450
+ if (\function_exists('hash_equals')) {
451
+ return \hash_equals($left, $right);
452
+ }
453
+ $len = \min(self::safeStrlen($left), self::safeStrlen($right));
454
+
455
+ $status = 0;
456
+ for ($i = 0; $i < $len; $i++) {
457
+ $status |= (\ord($left[$i]) ^ \ord($right[$i]));
458
+ }
459
+ $status |= (self::safeStrlen($left) ^ self::safeStrlen($right));
460
+
461
+ return ($status === 0);
462
  }
463
 
464
  /**
466
  *
467
  * @param int $errno An error number from json_last_error()
468
  *
469
+ * @throws DomainException
470
+ *
471
  * @return void
472
  */
473
+ private static function handleJsonError(int $errno): void
474
  {
475
+ $messages = [
476
  JSON_ERROR_DEPTH => 'Maximum stack depth exceeded',
477
  JSON_ERROR_STATE_MISMATCH => 'Invalid or malformed JSON',
478
  JSON_ERROR_CTRL_CHAR => 'Unexpected control character found',
479
  JSON_ERROR_SYNTAX => 'Syntax error, malformed JSON',
480
  JSON_ERROR_UTF8 => 'Malformed UTF-8 characters' //PHP >= 5.3.3
481
+ ];
482
  throw new DomainException(
483
  isset($messages[$errno])
484
  ? $messages[$errno]
489
  /**
490
  * Get the number of bytes in cryptographic strings.
491
  *
492
+ * @param string $str
493
  *
494
  * @return int
495
  */
496
+ private static function safeStrlen(string $str): int
497
+ {
498
+ if (\function_exists('mb_strlen')) {
499
+ return \mb_strlen($str, '8bit');
500
+ }
501
+ return \strlen($str);
502
+ }
503
+
504
+ /**
505
+ * Convert an ECDSA signature to an ASN.1 DER sequence
506
+ *
507
+ * @param string $sig The ECDSA signature to convert
508
+ * @return string The encoded DER object
509
+ */
510
+ private static function signatureToDER(string $sig): string
511
+ {
512
+ // Separate the signature into r-value and s-value
513
+ $length = max(1, (int) (\strlen($sig) / 2));
514
+ list($r, $s) = \str_split($sig, $length);
515
+
516
+ // Trim leading zeros
517
+ $r = \ltrim($r, "\x00");
518
+ $s = \ltrim($s, "\x00");
519
+
520
+ // Convert r-value and s-value from unsigned big-endian integers to
521
+ // signed two's complement
522
+ if (\ord($r[0]) > 0x7f) {
523
+ $r = "\x00" . $r;
524
+ }
525
+ if (\ord($s[0]) > 0x7f) {
526
+ $s = "\x00" . $s;
527
+ }
528
+
529
+ return self::encodeDER(
530
+ self::ASN1_SEQUENCE,
531
+ self::encodeDER(self::ASN1_INTEGER, $r) .
532
+ self::encodeDER(self::ASN1_INTEGER, $s)
533
+ );
534
+ }
535
+
536
+ /**
537
+ * Encodes a value into a DER object.
538
+ *
539
+ * @param int $type DER tag
540
+ * @param string $value the value to encode
541
+ *
542
+ * @return string the encoded object
543
+ */
544
+ private static function encodeDER(int $type, string $value): string
545
  {
546
+ $tag_header = 0;
547
+ if ($type === self::ASN1_SEQUENCE) {
548
+ $tag_header |= 0x20;
549
  }
550
+
551
+ // Type
552
+ $der = \chr($tag_header | $type);
553
+
554
+ // Length
555
+ $der .= \chr(\strlen($value));
556
+
557
+ return $der . $value;
558
+ }
559
+
560
+ /**
561
+ * Encodes signature from a DER object.
562
+ *
563
+ * @param string $der binary signature in DER format
564
+ * @param int $keySize the number of bits in the key
565
+ *
566
+ * @return string the signature
567
+ */
568
+ private static function signatureFromDER(string $der, int $keySize): string
569
+ {
570
+ // OpenSSL returns the ECDSA signatures as a binary ASN.1 DER SEQUENCE
571
+ list($offset, $_) = self::readDER($der);
572
+ list($offset, $r) = self::readDER($der, $offset);
573
+ list($offset, $s) = self::readDER($der, $offset);
574
+
575
+ // Convert r-value and s-value from signed two's compliment to unsigned
576
+ // big-endian integers
577
+ $r = \ltrim($r, "\x00");
578
+ $s = \ltrim($s, "\x00");
579
+
580
+ // Pad out r and s so that they are $keySize bits long
581
+ $r = \str_pad($r, $keySize / 8, "\x00", STR_PAD_LEFT);
582
+ $s = \str_pad($s, $keySize / 8, "\x00", STR_PAD_LEFT);
583
+
584
+ return $r . $s;
585
+ }
586
+
587
+ /**
588
+ * Reads binary DER-encoded data and decodes into a single object
589
+ *
590
+ * @param string $der the binary data in DER format
591
+ * @param int $offset the offset of the data stream containing the object
592
+ * to decode
593
+ *
594
+ * @return array{int, string|null} the new offset and the decoded object
595
+ */
596
+ private static function readDER(string $der, int $offset = 0): array
597
+ {
598
+ $pos = $offset;
599
+ $size = \strlen($der);
600
+ $constructed = (\ord($der[$pos]) >> 5) & 0x01;
601
+ $type = \ord($der[$pos++]) & 0x1f;
602
+
603
+ // Length
604
+ $len = \ord($der[$pos++]);
605
+ if ($len & 0x80) {
606
+ $n = $len & 0x1f;
607
+ $len = 0;
608
+ while ($n-- && $pos < $size) {
609
+ $len = ($len << 8) | \ord($der[$pos++]);
610
+ }
611
+ }
612
+
613
+ // Value
614
+ if ($type === self::ASN1_BIT_STRING) {
615
+ $pos++; // Skip the first contents octet (padding indicator)
616
+ $data = \substr($der, $pos, $len - 1);
617
+ $pos += $len - 1;
618
+ } elseif (!$constructed) {
619
+ $data = \substr($der, $pos, $len);
620
+ $pos += $len;
621
+ } else {
622
+ $data = null;
623
+ }
624
+
625
+ return [$pos, $data];
626
  }
627
  }
includes/vendor/firebase/php-jwt/src/Key.php ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Firebase\JWT;
4
+
5
+ use InvalidArgumentException;
6
+ use OpenSSLAsymmetricKey;
7
+ use OpenSSLCertificate;
8
+ use TypeError;
9
+
10
+ class Key
11
+ {
12
+ /** @var string|resource|OpenSSLAsymmetricKey|OpenSSLCertificate */
13
+ private $keyMaterial;
14
+ /** @var string */
15
+ private $algorithm;
16
+
17
+ /**
18
+ * @param string|resource|OpenSSLAsymmetricKey|OpenSSLCertificate $keyMaterial
19
+ * @param string $algorithm
20
+ */
21
+ public function __construct(
22
+ $keyMaterial,
23
+ string $algorithm
24
+ ) {
25
+ if (
26
+ !\is_string($keyMaterial)
27
+ && !$keyMaterial instanceof OpenSSLAsymmetricKey
28
+ && !$keyMaterial instanceof OpenSSLCertificate
29
+ && !\is_resource($keyMaterial)
30
+ ) {
31
+ throw new TypeError('Key material must be a string, resource, or OpenSSLAsymmetricKey');
32
+ }
33
+
34
+ if (empty($keyMaterial)) {
35
+ throw new InvalidArgumentException('Key material must not be empty');
36
+ }
37
+
38
+ if (empty($algorithm)) {
39
+ throw new InvalidArgumentException('Algorithm must not be empty');
40
+ }
41
+
42
+ // TODO: Remove in PHP 8.0 in favor of class constructor property promotion
43
+ $this->keyMaterial = $keyMaterial;
44
+ $this->algorithm = $algorithm;
45
+ }
46
+
47
+ /**
48
+ * Return the algorithm valid for this key
49
+ *
50
+ * @return string
51
+ */
52
+ public function getAlgorithm(): string
53
+ {
54
+ return $this->algorithm;
55
+ }
56
+
57
+ /**
58
+ * @return string|resource|OpenSSLAsymmetricKey|OpenSSLCertificate
59
+ */
60
+ public function getKeyMaterial()
61
+ {
62
+ return $this->keyMaterial;
63
+ }
64
+ }
includes/vendor/firebase/php-jwt/src/SignatureInvalidException.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
 
2
  namespace Firebase\JWT;
3
 
4
  class SignatureInvalidException extends \UnexpectedValueException
5
  {
6
-
7
  }
1
  <?php
2
+
3
  namespace Firebase\JWT;
4
 
5
  class SignatureInvalidException extends \UnexpectedValueException
6
  {
 
7
  }
jwt-auth.php CHANGED
@@ -4,7 +4,7 @@
4
  * The plugin bootstrap file.
5
  *
6
  * This file is read by WordPress to generate the plugin information in the plugin
7
- * admin area. This file also includes all of the dependencies used by the plugin,
8
  * registers the activation and deactivation functions, and defines a function
9
  * that starts the plugin.
10
  *
@@ -15,7 +15,7 @@
15
  * Plugin Name: JWT Authentication for WP-API
16
  * Plugin URI: https://enriquechavez.co
17
  * Description: Extends the WP REST API using JSON Web Tokens Authentication as an authentication method.
18
- * Version: 1.2.6
19
  * Author: Enrique Chavez
20
  * Author URI: https://enriquechavez.co
21
  * License: GPL-2.0+
4
  * The plugin bootstrap file.
5
  *
6
  * This file is read by WordPress to generate the plugin information in the plugin
7
+ * admin area. This file also includes all the dependencies used by the plugin,
8
  * registers the activation and deactivation functions, and defines a function
9
  * that starts the plugin.
10
  *
15
  * Plugin Name: JWT Authentication for WP-API
16
  * Plugin URI: https://enriquechavez.co
17
  * Description: Extends the WP REST API using JSON Web Tokens Authentication as an authentication method.
18
+ * Version: 1.3.0
19
  * Author: Enrique Chavez
20
  * Author URI: https://enriquechavez.co
21
  * License: GPL-2.0+
public/class-jwt-auth-public.php CHANGED
@@ -1,7 +1,8 @@
1
  <?php
2
 
3
- /** Requiere the JWT library. */
4
- use \Firebase\JWT\JWT;
 
5
 
6
  /**
7
  * The public-facing functionality of the plugin.
@@ -75,16 +76,18 @@ class Jwt_Auth_Public
75
  register_rest_route($this->namespace, 'token', array(
76
  'methods' => 'POST',
77
  'callback' => array($this, 'generate_token'),
 
78
  ));
79
 
80
  register_rest_route($this->namespace, 'token/validate', array(
81
  'methods' => 'POST',
82
  'callback' => array($this, 'validate_token'),
 
83
  ));
84
  }
85
 
86
  /**
87
- * Add CORs suppot to the request.
88
  */
89
  public function add_cors_support()
90
  {
@@ -95,13 +98,13 @@ class Jwt_Auth_Public
95
  }
96
  }
97
 
98
- /**
99
- * Get the user and password in the request body and generate a JWT
100
- *
101
- * @param [type] $request [description]
102
- *
103
- * @return [type] [description]
104
- */
105
  public function generate_token($request)
106
  {
107
  $secret_key = defined('JWT_AUTH_SECRET_KEY') ? JWT_AUTH_SECRET_KEY : false;
@@ -112,7 +115,7 @@ class Jwt_Auth_Public
112
  if (!$secret_key) {
113
  return new WP_Error(
114
  'jwt_auth_bad_config',
115
- __('JWT is not configurated properly, please contact the admin', 'wp-api-jwt-auth'),
116
  array(
117
  'status' => 403,
118
  )
@@ -121,7 +124,7 @@ class Jwt_Auth_Public
121
  /** Try to authenticate the user with the passed credentials*/
122
  $user = wp_authenticate($username, $password);
123
 
124
- /** If the authentication fails return a error*/
125
  if (is_wp_error($user)) {
126
  $error_code = $user->get_error_code();
127
  return new WP_Error(
@@ -151,7 +154,11 @@ class Jwt_Auth_Public
151
  );
152
 
153
  /** Let the user modify the token data before the sign. */
154
- $token = JWT::encode(apply_filters('jwt_auth_token_before_sign', $token, $user), $secret_key);
 
 
 
 
155
 
156
  /** The token is signed, now create the object with no sensible user data to the client*/
157
  $data = array(
@@ -184,13 +191,14 @@ class Jwt_Auth_Public
184
  **/
185
  $rest_api_slug = rest_get_url_prefix();
186
  $valid_api_uri = strpos($_SERVER['REQUEST_URI'], $rest_api_slug);
187
- if (!$valid_api_uri) {
 
188
  return $user;
189
  }
190
 
191
  /*
192
  * if the request URI is for validate the token don't do anything,
193
- * this avoid double calls to the validate_token function.
194
  */
195
  $validate_uri = strpos($_SERVER['REQUEST_URI'], 'token/validate');
196
  if ($validate_uri > 0) {
@@ -201,7 +209,7 @@ class Jwt_Auth_Public
201
 
202
  if (is_wp_error($token)) {
203
  if ($token->get_error_code() != 'jwt_auth_no_auth_header') {
204
- /** If there is a error, store it to show it after see rest_pre_dispatch */
205
  $this->jwt_error = $token;
206
  return $user;
207
  } else {
@@ -213,7 +221,7 @@ class Jwt_Auth_Public
213
  }
214
 
215
  /**
216
- * Main validation function, this function try to get the Autentication
217
  * headers and decoded.
218
  *
219
  * @param bool $output
@@ -263,7 +271,7 @@ class Jwt_Auth_Public
263
  if (!$secret_key) {
264
  return new WP_Error(
265
  'jwt_auth_bad_config',
266
- 'JWT is not configurated properly, please contact the admin',
267
  array(
268
  'status' => 403,
269
  )
@@ -272,7 +280,10 @@ class Jwt_Auth_Public
272
 
273
  /** Try to decode the token */
274
  try {
275
- $token = JWT::decode($token, $secret_key, array('HS256'));
 
 
 
276
  /** The Token is decoded now validate the iss */
277
  if ($token->iss != get_bloginfo('url')) {
278
  /** The iss do not match, return error */
@@ -318,12 +329,14 @@ class Jwt_Auth_Public
318
  }
319
  }
320
 
321
- /**
322
- * Filter to hook the rest_pre_dispatch, if the is an error in the request
323
- * send it, if there is no error just continue with the current request.
324
- *
325
- * @param $request
326
- */
 
 
327
  public function rest_pre_dispatch($request)
328
  {
329
  if (is_wp_error($this->jwt_error)) {
1
  <?php
2
 
3
+ /** Require the JWT library. */
4
+ use Firebase\JWT\JWT;
5
+ use Firebase\JWT\Key;
6
 
7
  /**
8
  * The public-facing functionality of the plugin.
76
  register_rest_route($this->namespace, 'token', array(
77
  'methods' => 'POST',
78
  'callback' => array($this, 'generate_token'),
79
+ 'permission_callback' => '__return_true',
80
  ));
81
 
82
  register_rest_route($this->namespace, 'token/validate', array(
83
  'methods' => 'POST',
84
  'callback' => array($this, 'validate_token'),
85
+ 'permission_callback' => '__return_true',
86
  ));
87
  }
88
 
89
  /**
90
+ * Add CORs support to the request.
91
  */
92
  public function add_cors_support()
93
  {
98
  }
99
  }
100
 
101
+ /**
102
+ * Get the user and password in the request body and generate a JWT
103
+ *
104
+ * @param [type] $request [description]
105
+ *
106
+ * @return mixed|WP_Error|null [type] [description]
107
+ */
108
  public function generate_token($request)
109
  {
110
  $secret_key = defined('JWT_AUTH_SECRET_KEY') ? JWT_AUTH_SECRET_KEY : false;
115
  if (!$secret_key) {
116
  return new WP_Error(
117
  'jwt_auth_bad_config',
118
+ __('JWT is not configured properly, please contact the admin', 'wp-api-jwt-auth'),
119
  array(
120
  'status' => 403,
121
  )
124
  /** Try to authenticate the user with the passed credentials*/
125
  $user = wp_authenticate($username, $password);
126
 
127
+ /** If the authentication fails return an error*/
128
  if (is_wp_error($user)) {
129
  $error_code = $user->get_error_code();
130
  return new WP_Error(
154
  );
155
 
156
  /** Let the user modify the token data before the sign. */
157
+ $token = JWT::encode(
158
+ apply_filters('jwt_auth_token_before_sign', $token, $user),
159
+ $secret_key,
160
+ apply_filters('jwt_auth_algorithm', 'HS256')
161
+ );
162
 
163
  /** The token is signed, now create the object with no sensible user data to the client*/
164
  $data = array(
191
  **/
192
  $rest_api_slug = rest_get_url_prefix();
193
  $valid_api_uri = strpos($_SERVER['REQUEST_URI'], $rest_api_slug);
194
+ // if already valid user or invalid url, don't attempt to validate token
195
+ if ( !$valid_api_uri || $user ) {
196
  return $user;
197
  }
198
 
199
  /*
200
  * if the request URI is for validate the token don't do anything,
201
+ * this avoids double calls to the validate_token function.
202
  */
203
  $validate_uri = strpos($_SERVER['REQUEST_URI'], 'token/validate');
204
  if ($validate_uri > 0) {
209
 
210
  if (is_wp_error($token)) {
211
  if ($token->get_error_code() != 'jwt_auth_no_auth_header') {
212
+ /** If there is an error, store it to show it after see rest_pre_dispatch */
213
  $this->jwt_error = $token;
214
  return $user;
215
  } else {
221
  }
222
 
223
  /**
224
+ * Main validation function, this function try to get the Authentication
225
  * headers and decoded.
226
  *
227
  * @param bool $output
271
  if (!$secret_key) {
272
  return new WP_Error(
273
  'jwt_auth_bad_config',
274
+ 'JWT is not configured properly, please contact the admin',
275
  array(
276
  'status' => 403,
277
  )
280
 
281
  /** Try to decode the token */
282
  try {
283
+ $token = JWT::decode(
284
+ $token,
285
+ new Key($secret_key, apply_filters('jwt_auth_algorithm', 'HS256'))
286
+ );
287
  /** The Token is decoded now validate the iss */
288
  if ($token->iss != get_bloginfo('url')) {
289
  /** The iss do not match, return error */
329
  }
330
  }
331
 
332
+ /**
333
+ * Filter to hook the rest_pre_dispatch, if the is an error in the request
334
+ * send it, if there is no error just continue with the current request.
335
+ *
336
+ * @param $request
337
+ *
338
+ * @return mixed|WP_Error|null
339
+ */
340
  public function rest_pre_dispatch($request)
341
  {
342
  if (is_wp_error($this->jwt_error)) {
readme.txt CHANGED
@@ -6,7 +6,7 @@ Tags: wp-json, jwt, json web authentication, wp-api
6
  Requires at least: 4.2
7
  Tested up to: 6.0.2
8
  Requires PHP: 5.3.0
9
- Stable tag: 1.2.6
10
  License: GPLv2 or later
11
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
 
6
  Requires at least: 4.2
7
  Tested up to: 6.0.2
8
  Requires PHP: 5.3.0
9
+ Stable tag: 1.3.0
10
  License: GPLv2 or later
11
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
12