Browse Source

yuanjiajia

master
yuanjiajia 2 years ago
commit
48a284db55
  1. 19
      composer.json
  2. 1575
      composer.lock
  3. 9
      console/index.php
  4. 1
      qlOut/QueryListLog.txt
  5. 1623
      qlOut/errLog.txt
  6. 295
      qlOut/recruit_info.xls
  7. 178
      src/YuanjiajiaQl.php
  8. 12
      vendor/autoload.php
  9. 117
      vendor/bin/var-dump-server
  10. 559
      vendor/cache/adapter-common/AbstractCachePool.php
  11. 269
      vendor/cache/adapter-common/CacheItem.php
  12. 73
      vendor/cache/adapter-common/Changelog.md
  13. 23
      vendor/cache/adapter-common/Exception/CacheException.php
  14. 21
      vendor/cache/adapter-common/Exception/CachePoolException.php
  15. 19
      vendor/cache/adapter-common/Exception/InvalidArgumentException.php
  16. 26
      vendor/cache/adapter-common/HasExpirationTimestampInterface.php
  17. 68
      vendor/cache/adapter-common/JsonBinaryArmoring.php
  18. 22
      vendor/cache/adapter-common/LICENSE
  19. 32
      vendor/cache/adapter-common/PhpCacheItem.php
  20. 34
      vendor/cache/adapter-common/PhpCachePool.php
  21. 15
      vendor/cache/adapter-common/README.md
  22. 88
      vendor/cache/adapter-common/TagSupportWithArray.php
  23. 55
      vendor/cache/adapter-common/composer.json
  24. 64
      vendor/cache/filesystem-adapter/Changelog.md
  25. 213
      vendor/cache/filesystem-adapter/FilesystemCachePool.php
  26. 22
      vendor/cache/filesystem-adapter/LICENSE
  27. 45
      vendor/cache/filesystem-adapter/README.md
  28. 55
      vendor/cache/filesystem-adapter/composer.json
  29. 5
      vendor/cache/tag-interop/.github/PULL_REQUEST_TEMPLATE.md
  30. 2
      vendor/cache/tag-interop/.gitignore
  31. 22
      vendor/cache/tag-interop/.travis.yml
  32. 18
      vendor/cache/tag-interop/Changelog.md
  33. 22
      vendor/cache/tag-interop/LICENSE
  34. 25
      vendor/cache/tag-interop/README.md
  35. 43
      vendor/cache/tag-interop/TaggableCacheItemInterface.php
  36. 60
      vendor/cache/tag-interop/TaggableCacheItemPoolInterface.php
  37. 39
      vendor/cache/tag-interop/composer.json
  38. 572
      vendor/composer/ClassLoader.php
  39. 352
      vendor/composer/InstalledVersions.php
  40. 21
      vendor/composer/LICENSE
  41. 28
      vendor/composer/autoload_classmap.php
  42. 18
      vendor/composer/autoload_files.php
  43. 9
      vendor/composer/autoload_namespaces.php
  44. 29
      vendor/composer/autoload_psr4.php
  45. 57
      vendor/composer/autoload_real.php
  46. 186
      vendor/composer/autoload_static.php
  47. 1629
      vendor/composer/installed.json
  48. 260
      vendor/composer/installed.php
  49. 26
      vendor/composer/platform_check.php
  50. 1519
      vendor/guzzlehttp/guzzle/CHANGELOG.md
  51. 27
      vendor/guzzlehttp/guzzle/LICENSE
  52. 94
      vendor/guzzlehttp/guzzle/README.md
  53. 1253
      vendor/guzzlehttp/guzzle/UPGRADING.md
  54. 105
      vendor/guzzlehttp/guzzle/composer.json
  55. 28
      vendor/guzzlehttp/guzzle/src/BodySummarizer.php
  56. 13
      vendor/guzzlehttp/guzzle/src/BodySummarizerInterface.php
  57. 477
      vendor/guzzlehttp/guzzle/src/Client.php
  58. 84
      vendor/guzzlehttp/guzzle/src/ClientInterface.php
  59. 241
      vendor/guzzlehttp/guzzle/src/ClientTrait.php
  60. 317
      vendor/guzzlehttp/guzzle/src/Cookie/CookieJar.php
  61. 79
      vendor/guzzlehttp/guzzle/src/Cookie/CookieJarInterface.php
  62. 101
      vendor/guzzlehttp/guzzle/src/Cookie/FileCookieJar.php
  63. 77
      vendor/guzzlehttp/guzzle/src/Cookie/SessionCookieJar.php
  64. 446
      vendor/guzzlehttp/guzzle/src/Cookie/SetCookie.php
  65. 39
      vendor/guzzlehttp/guzzle/src/Exception/BadResponseException.php
  66. 10
      vendor/guzzlehttp/guzzle/src/Exception/ClientException.php
  67. 56
      vendor/guzzlehttp/guzzle/src/Exception/ConnectException.php
  68. 9
      vendor/guzzlehttp/guzzle/src/Exception/GuzzleException.php
  69. 7
      vendor/guzzlehttp/guzzle/src/Exception/InvalidArgumentException.php
  70. 166
      vendor/guzzlehttp/guzzle/src/Exception/RequestException.php
  71. 10
      vendor/guzzlehttp/guzzle/src/Exception/ServerException.php
  72. 7
      vendor/guzzlehttp/guzzle/src/Exception/TooManyRedirectsException.php
  73. 7
      vendor/guzzlehttp/guzzle/src/Exception/TransferException.php
  74. 595
      vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php
  75. 25
      vendor/guzzlehttp/guzzle/src/Handler/CurlFactoryInterface.php
  76. 49
      vendor/guzzlehttp/guzzle/src/Handler/CurlHandler.php
  77. 262
      vendor/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php
  78. 112
      vendor/guzzlehttp/guzzle/src/Handler/EasyHandle.php
  79. 42
      vendor/guzzlehttp/guzzle/src/Handler/HeaderProcessor.php
  80. 211
      vendor/guzzlehttp/guzzle/src/Handler/MockHandler.php
  81. 51
      vendor/guzzlehttp/guzzle/src/Handler/Proxy.php
  82. 593
      vendor/guzzlehttp/guzzle/src/Handler/StreamHandler.php
  83. 275
      vendor/guzzlehttp/guzzle/src/HandlerStack.php
  84. 198
      vendor/guzzlehttp/guzzle/src/MessageFormatter.php
  85. 18
      vendor/guzzlehttp/guzzle/src/MessageFormatterInterface.php
  86. 260
      vendor/guzzlehttp/guzzle/src/Middleware.php
  87. 125
      vendor/guzzlehttp/guzzle/src/Pool.php
  88. 104
      vendor/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php
  89. 228
      vendor/guzzlehttp/guzzle/src/RedirectMiddleware.php
  90. 264
      vendor/guzzlehttp/guzzle/src/RequestOptions.php
  91. 116
      vendor/guzzlehttp/guzzle/src/RetryMiddleware.php
  92. 133
      vendor/guzzlehttp/guzzle/src/TransferStats.php
  93. 385
      vendor/guzzlehttp/guzzle/src/Utils.php
  94. 167
      vendor/guzzlehttp/guzzle/src/functions.php
  95. 6
      vendor/guzzlehttp/guzzle/src/functions_include.php
  96. 110
      vendor/guzzlehttp/promises/CHANGELOG.md
  97. 24
      vendor/guzzlehttp/promises/LICENSE
  98. 546
      vendor/guzzlehttp/promises/README.md
  99. 58
      vendor/guzzlehttp/promises/composer.json
  100. 17
      vendor/guzzlehttp/promises/src/AggregateException.php

19
composer.json

@ -0,0 +1,19 @@
{
"name": "yuanjiajia/qldome",
"type": "library",
"require": {
"php": ">=7.4,<8.0",
"jaeger/querylist": "^4.2"
},
"autoload": {
"psr-4": {
"Yuanjiajia\\Qldome\\": "src/"
}
},
"authors": [
{
"name": "yuanjiajia",
"email": "1139393632@qq.com"
}
]
}

1575
composer.lock
File diff suppressed because it is too large
View File

9
console/index.php

@ -0,0 +1,9 @@
<?php
include dirname(dirname(__FILE__)) . "/vendor/autoload.php";
use Yuanjiajia\Qldome\YuanjiajiaQl;
$ql = new YuanjiajiaQl();
$ql->actionIndex();

1
qlOut/QueryListLog.txt

@ -0,0 +1 @@
35

1623
qlOut/errLog.txt
File diff suppressed because it is too large
View File

295
qlOut/recruit_info.xls

@ -0,0 +1,295 @@
17a06dfcea5294ee962ad6861399f235,香港教育服務中心,Erica Cheng,39924299,hr@hkescedu.com,https://recruit.hkfew.org.hk/jobs/%e5%88%b0%e6%a0%a1%e6%9d%b1%e6%b6%8c%e5%8d%80%e4%bb%a5%e9%9d%a2%e6%8e%88%e5%bd%a2%e5%bc%8f%e5%b0%8f%e5%ad%b8%e5%8a%9f%e8%aa%b2%e8%bc%94%e5%b0%8e%e7%8f%ad/
031d124e4e60ebd0edad692b55a03743,Mood Education (Prince Edward),Ms Chan,84904568,moodventure2022@gmail.com,https://recruit.hkfew.org.hk/jobs/%e5%85%bc%e8%81%b7-%e5%85%a8%e8%81%b7%e5%b9%bc%e5%85%92%e5%b0%8e%e5%b8%ab-3/
5b90a2e55769c09bdc6df670a695ad0e,聖芳濟各書院,李小姐,26779709,principal@sfac.edu.hk,https://recruit.hkfew.org.hk/jobs/%e8%aa%a0%e8%81%98%e4%b8%ad%e6%96%87%e7%a7%91%e8%aa%9e%e6%96%87%e6%8a%80%e5%b7%a7%e7%8f%ad%e5%b0%8e%e5%b8%ab2%e5%90%8d/
2e66d9d5cf03f9e09b8a1c2be45c04fc,連青網絡-香港神託會,黃小姐,26371866,aster.wong@stewards.hk,https://recruit.hkfew.org.hk/jobs/%e5%b0%8f%e5%ad%b8%e5%8a%9f%e8%bc%94%e7%8f%ad%e5%b0%8e%e5%b8%ab%ef%bc%88%e7%a2%a9%e9%96%80%ef%bc%89-6/
22ec1a7ba99c891739fba9279a5681da,Parsons Music Limited,Reyes Cheng,23331863,tutor@parsonsmusic.com,https://recruit.hkfew.org.hk/jobs/%e5%85%92%e7%ab%a5%e9%9f%b3%e6%a8%82%e7%8f%ad%e5%b0%8e%e5%b8%ab-children-music-class-tutor/
18f105b4d9504ca8e53507b6f5483c2f,聖雅各福群會 延續教育中心,Daphne Suen,59885027,daphne.suen@sjs.org.hk,https://recruit.hkfew.org.hk/jobs/%e5%b0%8f%e5%ad%b8%e4%b8%ad%e6%96%87%e5%b0%88%e7%a7%91%e7%8f%ad%e8%8d%83%e7%81%a3%e3%80%81%e8%91%b5%e6%b6%8c%e5%8d%80-%e5%b0%8e%e5%b8%ab-%e5%85%bc%e8%81%b7-%e6%95%99%e5%b8%ab-6/
2d2b74403569a83d2bf0fe8fa99bd978,爾雅教育,何小姐,56012170,eryaeducation2021@gmail.com,https://recruit.hkfew.org.hk/jobs/%e8%a3%9c%e7%bf%92%e4%b8%ad%e5%bf%83%e8%8b%b1%e6%96%87%e7%a7%91%e5%b0%8e%e5%b8%ab/
bdf23f0b82089eaca4b9d463d26b8177,香港傷殘青年協會,Anna SHAM,27596408,supemp@hkfhy.org.hk,https://recruit.hkfew.org.hk/jobs/%e5%85%bc%e8%81%b7%e8%8b%b1%e6%96%87%e5%b0%8e%e5%b8%ab-%e5%83%b1%e5%93%a1%e5%86%8d%e5%9f%b9%e8%a8%93%e5%b1%80%e8%aa%b2%e7%a8%8b/
642e5ed2d7b10da4a7c781cda429e0d0,阡陌中心,黎卓瑩女士,24332525,keiyan@ccbc.org.hk,https://recruit.hkfew.org.hk/jobs/%e5%8d%8a%e8%81%b7%e8%aa%b2%e9%a4%98%e8%a8%97%e7%ae%a1%e5%b0%8e%e5%b8%ab/
88de9892a3caaf947fd795c1ac0e92b8,HKTA香港導師會,李小姐,21142188,april.lee@hkta.edu.hk,https://recruit.hkfew.org.hk/jobs/%e5%a4%a9%e6%b0%b4%e5%9c%8d%e5%8d%80%e4%b8%ad%e5%ad%b8%e4%b8%ad%e6%96%87-%e6%95%b8%e5%ad%b8-%e5%8a%9f%e8%aa%b2%e8%bc%94%e5%b0%8e%e7%8f%ad%e5%b0%8e%e5%b8%ab/
e43d2975cb3eccd525830a36f272f3d6,勵致研習中心,黃生,61125961,fair_ltd@yahoo.com.hk,https://recruit.hkfew.org.hk/jobs/%e4%b8%ad%e5%b0%8f%e5%ad%b8%e5%b0%8e%e5%b8%ab-secondary-school-and-primary-school-tutor/
dab83f59351312fd37b091333d127a85,大眾教室 (堅尼地城) Popular Learning Centre (Kennedy Town),Ms Lau,98073009,popularlearning.kt@gmail.com,https://recruit.hkfew.org.hk/jobs/%e5%85%bc%e8%81%b7%e6%95%99%e5%ae%a4%e5%b0%8e%e5%b8%ab-%e4%b8%ad%e6%96%87-%e8%8b%b1%e6%96%87-%e6%95%b8%e5%ad%b8%ef%bc%89/
0179595d2ce2971b13818150d8d6d475,創思教育管理有限公司,陳先生,64656677,recruit_1@ccon.com.hk,https://recruit.hkfew.org.hk/jobs/2022-2023%e5%b9%b4%e5%ba%a6%e5%90%84%e5%8d%80%e5%8a%9f%e8%aa%b2%e8%bc%94%e5%b0%8e%e7%8f%ad%e5%b0%8e%e5%b8%ab-part-time-school-tutor/
aa8e178d5a87394c21198901e410d743,保良局何壽南教育服務中心,Ms Chan,23203244or23262627,hsnesc@plkhsn.edu.hk,https://recruit.hkfew.org.hk/jobs/%e5%90%88%e7%b4%84%e5%8a%9f%e8%aa%b2%e8%bc%94%e5%b0%8e%e7%8f%ad%e5%b0%8e%e5%b8%ab/
897432e7458223d3eb117b134c8ef992,東華三院邱金元中學,楊先生 / 吳小姐,26497385,recruit@twyky.edu.hk,https://recruit.hkfew.org.hk/jobs/%e8%b6%b3%e7%90%83%e6%95%99%e7%b7%b4-%e8%aa%b2%e5%a4%96%e6%b4%bb%e5%8b%95/
2fcb0c36e76a0443ec245c5090aeebf2,豆豆導師招聘網,陳小姐,67480761,edu970330@gmail.com,https://recruit.hkfew.org.hk/jobs/%e6%8b%9b%e8%81%98%e5%85%bc%e8%81%b7%e5%88%b0%e6%a0%a1%e5%b0%8e%e5%b8%ab__%e4%b8%ad%e6%96%87-%e8%8b%b1%e6%96%87-%e6%95%b8%e5%ad%b8-%e8%a8%bb%e5%86%8a%e6%95%99%e5%b8%ab-%e7%a4%be%e5%b7%a5/
6f2d52743459eb52c77cb06c6867d4af,Kinderland Playgroup and Learning Centre Limited,Miss kwan,95604448,kidskinderland@yahoo.com.hk,https://recruit.hkfew.org.hk/jobs/%e5%b9%bc%e5%85%92%e6%99%ae%e9%80%9a%e8%a9%b1%e5%b0%8e%e5%b8%ab/
3e2704b0b8ced7d4535b102e8e3a5ec5,JEI Diversity Learning Centre(Tsing Yi),Miss Chow,60128411,naturejovial@gmail.com,https://recruit.hkfew.org.hk/jobs/%e6%9c%ac%e5%9c%b0%e6%95%b8%e5%ad%b8%e6%88%96%e8%8b%b1%e6%96%87%e5%b0%8e%e5%b8%ab-3/
a91a9711eb774301fdc76038fb63c363,NEW ASIA,Miss Wong/ Mr. Tang,64322545,hkg.edu.hk@gmail.com,https://recruit.hkfew.org.hk/jobs/%e5%88%b0%e6%a0%a1%e9%9f%b3%e6%a8%82%e7%8f%ad-%e8%97%9d%e8%a1%93%e7%8f%ad-%e9%81%8b%e5%8b%95%e7%8f%ad%e5%b0%8e%e5%b8%ab-%e8%88%9e%e8%b9%88%e7%8f%ad%e5%b0%8e%e5%b8%ab-hip-hop-k-pop/
3013d32a3903379486873b8ce221ea61,ENGLISH EXPRESS EDUCATION CENTRE,Miss Lam,54265083,tutor.com.hk@gmail.com,https://recruit.hkfew.org.hk/jobs/%e5%85%bc%e8%81%b7%e4%b8%8a%e9%96%80%e8%a3%9c%e7%bf%92%e5%b0%8e%e5%b8%ab-%e8%8b%b1%e6%96%87-%e6%95%b8%e5%ad%b8-%e6%99%ae%e9%80%9a%e8%a9%b1/
a23d91b8bcd26017e39a2ddbf86643f6,大衆教室(田心村),Ms Li,66501338,populartaiwai@gmail.com,https://recruit.hkfew.org.hk/jobs/%e4%b8%ad%e6%96%87-%e8%8b%b1%e6%96%87%e7%a7%91%e5%b0%8e%e5%b8%ab%ef%bc%88%e5%85%a8%e8%81%b7-%e5%85%bc%e8%81%b7%ef%bc%89-6/
a47f584c83670ffd6627babd1a09cdc4,Math Ocean Education Limited,Kelvin Tsui,26092333,reception@mathoceanhk.com,https://recruit.hkfew.org.hk/jobs/english-or-math-tutor-2/
21129e7aa84dfb05438e0ee8f0ef7cdc,Magic Season Limited,Zoe Ng,61232292,magicseasonlimited@gmail.com,https://recruit.hkfew.org.hk/jobs/head-tutor-children-farming-learning-venue-full-time/
eab05a3b6c0d1809f7451565a14135ef,MAMAGREENIA嬰幼教育園,馬小姐,51106339,info@mamagreenia.com.hk,https://recruit.hkfew.org.hk/jobs/%e5%85%a8%e8%81%b7%e5%b9%bc%e5%85%92%e7%be%8e%e8%a1%93%e5%b0%8e%e5%b8%ab%e5%9b%9b%e5%a4%a9%e5%b7%a5%e4%bd%9c/
bf5d5771b436019f192e6d24ef77bf8b,機構 Kids' Gallery Company Limited,潘小姐,23371001,careers@kggeducation.edu.hk,https://recruit.hkfew.org.hk/jobs/drama-teacher-pt-worked-on-saturday/
5f118d93b531a6e3a7b575005e59c971,森林貓教育中心有限公司,江先生,46427095,kong@sss.org.hk,https://recruit.hkfew.org.hk/jobs/%e5%85%bc%e8%81%b7%e8%a3%9c%e7%bf%92%e5%b0%8e%e5%b8%ab%e5%b0%8f%e5%ad%b8/
47bb396ae3aeda7ffb44a852d274e863,基督教香港信義會元朗信義中學,陳貴月小姐 (秘書),24480622,tswyllss@yahoo.com.hk,https://recruit.hkfew.org.hk/jobs/%e5%88%9d%e4%b8%ad%e8%a3%9c%e7%bf%92%e7%8f%ad%e5%b0%8e%e5%b8%ab-2/
35ca851a4bfcdc4ed1e45d25bd890377,活力教育,Ms Lau,55096636,energyeducationhk@gmail.com,https://recruit.hkfew.org.hk/jobs/%e4%b8%ad%e5%b0%8f%e5%ad%b8%e5%b0%88%e7%a7%91%e7%8f%ad%e8%a3%9c%e7%bf%92%e8%80%81%e5%b8%ab/
0c73fc19b12af377a3d87d13a81141fe,香港戒毒會 凹頭青少年中心,梁生,24787026,sswa_atyc@sarda.org.hk,https://recruit.hkfew.org.hk/jobs/%e4%b8%ad%e5%bf%83%e5%85%a8%e8%81%b7%e4%b8%ad%e6%96%87-%e8%8b%b1%e6%96%87-%e6%95%b8%e7%a7%91%e5%b0%8e%e5%b8%ab-full-time-chinese-english-mathematics-teacher/
c1bfc1e3e986d64444a904c4ae5e011b,新會商會陳白沙紀念中學,李穎沁老師,25535324,hr@cpss.edu.hk,https://recruit.hkfew.org.hk/jobs/2022-2023%e5%ad%b8%e5%b9%b4%e7%94%b7%e7%ab%a5%e8%bb%8d%e5%90%88%e7%b4%84%e5%b0%8e%e5%b8%ab/
8197b316f290ce8449d9b9efc339c3cf,大衆教室佐敦分校(恒豐中心),李小姐,94162842,sinotrend13@gmail.com,https://recruit.hkfew.org.hk/jobs/%e5%b0%8f%e5%ad%b8%e5%b0%8e%e5%b8%ab-8/
4cbd7633ffeea48ed041188c39013564,天主教培聖中學,宋小姐,24450800,info@puishing.edu.hk,https://recruit.hkfew.org.hk/jobs/%e4%b8%ad%e6%96%87%e7%a7%91%e5%89%af%e6%95%99%e5%b8%ab%ef%bc%88%e5%85%a8%e8%81%b7%ef%bc%89%ef%bc%8f%e9%ab%98%e4%b8%ad%e4%b8%ad%e6%96%87%e5%a2%9e%e6%bd%a4%e7%8f%ad%e5%b0%8e%e5%b8%ab%ef%bc%88%e5%85%bc/
d9ae739262f22a7d738c02ca15c8b4c0,HKCCCU Logos Academy,Personnel Department,23372123,jobs@logosacademy.edu.hk,https://recruit.hkfew.org.hk/jobs/f-1-english-tutor/
be9d7fa74dfb645f478b99307c12c905,奇趣學藝坊有限公司,薜小姐,25200353,info.school.hkclp@gmail.com,https://recruit.hkfew.org.hk/jobs/%e5%b0%87%e8%bb%8d%e6%be%b3%e5%b0%8f%e5%ad%b8%e5%8a%9f%e8%bc%94%e7%8f%ad%e5%b0%8e%e5%b8%ab/
fe87d578c1819fc3ac16ccf7a834f2b8,華英中學,行政主任麥先生,27607772,recruit@waying.edu.hk,https://recruit.hkfew.org.hk/jobs/%e8%bc%94%e5%b0%8e%e7%b5%84%e5%ad%b8%e8%a1%93%e8%bc%94%e5%b0%8e%e7%8f%ad%e5%b0%8e%e5%b8%ab/
06d4189bef6dbaabfe02faea5fa7faa0,聖士提反女子中學,Ms. Josephine Yuen,25492521,ssgcpost@ssgc.edu.hk,https://recruit.hkfew.org.hk/jobs/%e5%85%bc%e8%81%b7%e7%91%9c%e4%bc%bd%e6%95%99%e7%b7%b4-2/
fa8c68062aeb078aa7399341ff7b1ddb,小領袖潛能發展教育中心,楊小姐,29479998,new.wonders@yahoo.com.hk,https://recruit.hkfew.org.hk/jobs/%e5%90%88%e7%b4%84%e5%88%b0%e6%a0%a1%ef%bc%88%e5%88%9d%e4%b8%ad%ef%bc%89%e5%a5%a7%e6%95%b8%e5%b0%8e%e5%b8%ab/
99a1ea1045c728e16d21f9c37f6ce058,數研喜樂教育中心,陳先生,36197929,blissful@soinedu.com.hk,https://recruit.hkfew.org.hk/jobs/%e5%85%a8%e8%81%b7%e6%95%b8%e5%ad%b8%e5%b0%8e%e5%b8%ab-maths-tutor/
c30d8ddc95d48ded1693fc78cf9b02b6,文理書院(香港),校務處,25567413,cognitiohk@cognitiohk.edu.hk,https://recruit.hkfew.org.hk/jobs/%e4%b8%ad%e5%9b%9b%e7%b4%9a%e8%8b%b1%e6%96%87%e8%a3%9c%e7%bf%92%e7%8f%ad%e5%b0%8e%e5%b8%ab/
49e5bc5176f50d3b7b63f1e2750d1cd1,Tom Lee Music Co. Ltd,Ophelia Choi,27377530,hr@tomleemusic.com,https://recruit.hkfew.org.hk/jobs/%e9%8b%bc%e7%90%b4%e5%b0%8e%e5%b8%ab-%e5%b9%bc%e5%85%92%e9%9f%b3%e6%a8%82%e5%b0%8e%e5%b8%ab-%e7%b5%90%e4%bb%96%e6%a8%82%e5%99%a8%e5%b0%8e%e5%b8%ab-%e5%a4%a7%e6%8f%90%e7%90%b4%e5%b0%8e%e5%b8%ab-14/
6a731229321d6064caaa8e7333c1c492,東華三院李潤田紀念中學,戲劇組負責老師,25715422,job@lcdmc.edu.hk,https://recruit.hkfew.org.hk/jobs/%e6%88%b2%e5%8a%87%e8%a8%93%e7%b7%b4%e7%8f%ad%e5%b0%8e%e5%b8%ab-2/
05952611f1c8896b3257a8c28940bc70,安基司國際幼兒園(滌濤山),周主任,26506660,cc@anchors.edu.hk,https://recruit.hkfew.org.hk/jobs/%e5%8a%9f%e8%aa%b2%e8%bc%94%e5%b0%8e%e5%b0%8e%e5%b8%ab%e5%85%a8%e8%81%b7/
1e9b053a564a30fc7e747e6b21358f7e,香港漢一語文研習學校,葉小姐,23848100,hklahkla@yahoo.com.hk,https://recruit.hkfew.org.hk/jobs/%e5%85%bc%e8%81%b7%e4%b8%ad%e6%96%87%e5%b0%8e%e5%b8%ab%e9%80%a2%e6%98%9f%e6%9c%9f%e4%ba%94/
9622dc42e38fc08781949fc5c1fa1f67,凱怡教育有限公司,梁小姐,35430309,hoikam00016@gmail.com,https://recruit.hkfew.org.hk/jobs/%e5%8a%9f%e8%aa%b2%e7%8f%ad%e5%b0%8e%e5%b8%ab/
0bc755a440863f0010fbc3efdc5c0789,Unleashing Mind Professional Counselling Academy,MS CHEUNG,60765667,hr@dailyweb.hk,https://recruit.hkfew.org.hk/jobs/%e8%ae%80%e5%af%ab%e5%b0%8f%e7%b5%84%e5%b0%8e%e5%b8%ab/
9e9c1868f021d11aa09e663eb8c19840,彧恩軒(中作教室),林老師,97017907,yuenxuan000@gmail.com,https://recruit.hkfew.org.hk/jobs/%e4%b8%ad%e6%96%87%e4%bd%9c%e6%96%87%e8%80%81%e5%b8%ab/
e30e9339232d701d33b798b8bea17d51,小星光兒童教育中心,文先生,52169183,mylittlestar062020@gmail.com,https://recruit.hkfew.org.hk/jobs/%e5%ad%b8%e5%89%8d-%e5%b0%8f%e5%ad%b8%e7%a0%94%e7%bf%92%e7%8f%ad%e5%b0%8e%e5%b8%ab%e5%85%a8%e8%81%b7-%e5%85%bc%e8%81%b7/
dc2f2a2e8f129dda5b1e6f9abd96ac3d,東華三院馬振玉紀念中學,梁家熙老師,24439833,leungkaheisimon@cyma.edu.hk,https://recruit.hkfew.org.hk/jobs/%e4%b8%ad%e5%85%ad%e6%96%87%e6%86%91%e8%a9%a6%e6%95%b8%e5%ad%b8%e6%94%af%e6%8f%b4%e8%aa%b2%e7%a8%8b-2/
13827f6ec55f1c5e560565868d155d1f,東華三院馬振玉紀念中學,錢明榮老師,24439833,vincentmwchin@yahoo.com.hk,https://recruit.hkfew.org.hk/jobs/%e6%95%b8%e5%ad%b8%e7%a7%91%e8%aa%b2%e5%be%8c%e8%a3%9c%e7%bf%92%e7%8f%ad/
96141bae2f4b0b41d5e613762e394da7,東華三院馬振玉紀念中學,林慧聰老師,24439833,lamwaichung@cyma.edu.hk,https://recruit.hkfew.org.hk/jobs/%e4%b8%ad%e4%ba%94%e7%b4%9a%e8%8b%b1%e6%96%87%e5%a2%9e%e6%bd%a4%e8%aa%b2%e7%a8%8b%e5%b0%8e%e5%b8%ab%e6%95%b8%e5%90%8d/
088d0f8f2304ac39c541fcf8bb46c38d,樂善堂余近卿中學,Ms. Yeung,23362657,job@ykh.edu.hk,https://recruit.hkfew.org.hk/jobs/%e7%91%9c%e4%bc%bd%e5%b0%8e%e5%b8%ab/
d4aa984c6ed05a88ef977f76911380bc,瑪利諾神父教會學校,傅先生,27775117,mfshr@mfs2.edu.hk,https://recruit.hkfew.org.hk/jobs/%e8%88%88%e8%b6%a3%e7%8f%ad%e5%b0%8e%e5%b8%ab-%e5%a4%a7%e6%8f%90%e7%90%b4/
b8861a5709023c08691a00027b0167da,孔聖堂中學,莫玉玲副校長,25763415,enquiry@chss.edu.hk,https://recruit.hkfew.org.hk/jobs/%e6%80%a5%e8%81%98%e9%9d%9e%e8%8f%af%e8%aa%9e%e4%b8%ad%e6%96%87%e8%aa%b2%e5%be%8c%e8%a3%9c%e7%bf%92%e7%8f%ad%e5%b0%8e%e5%b8%ab-3/
e1d8c4c1adc892dbc0c4120bb3c7bad7,現代小學士有限公司,Miss Li,21421111,bachelor.partime@gmail.com,https://recruit.hkfew.org.hk/jobs/part-time-tutor-%e5%85%bc%e8%81%b7%e5%88%b0%e6%a0%a1%e4%b8%ad%e6%96%87-%e8%8b%b1%e6%96%87%e5%b0%88%e7%a7%91%e7%8f%ad%e5%b0%8e%e5%b8%ab%e5%a4%a9%e6%b0%b4%e5%9c%8d/
d954cec6d41ebcf8097eaa4933aba176,現代小學士有限公司,Miss Li,21421111,bachelor.fulltime@gmail.com,https://recruit.hkfew.org.hk/jobs/full-time-tutor-teacher-%e5%85%a8%e8%81%b7%e5%b0%8e%e5%b8%ab-%e9%a6%ac%e9%9e%8d%e5%b1%b1-%e5%a4%a7%e5%9f%94%e5%88%86%e6%a0%a1/
5db6539f3c1433790fa82880ace40cf4,Modern Education (HK) Ltd,Queenie Ma,22563395,human.resources@modern.edu.hk,https://recruit.hkfew.org.hk/jobs/full-time-part-time-tutor-teacher-%e5%85%a8%e8%81%b7-%e5%85%bc%e8%81%b7%e5%b0%8e%e5%b8%ab/
871100bae2447c5b24ab9cf2d95ef0c2,The Hong Kong Council of the Church of Christ in China 中華基督教會香港區會家情軒,丁小姐 / 莊小姐,24414833,fwinfo@hkcccc.org,https://recruit.hkfew.org.hk/jobs/%e5%85%bc%e8%81%b7%e5%8a%9f%e8%aa%b2%e5%b0%8e%e4%bf%ae%e7%8f%ad%e5%b0%8e%e5%b8%ab-%e5%b1%af%e9%96%80%ef%bc%8f%e5%a4%a9%e6%b0%b4%e5%9c%8d%ef%bc%8f%e5%85%83%e6%9c%97%ef%bc%8f%e6%b2%99%e7%94%b0-5/
03fb73db218a1b92606780fc22d982ba,Indigo Kids,Miss Lo,97571105,indigo_kids.adm@hotmail.com,https://recruit.hkfew.org.hk/jobs/%e5%85%bc%e8%81%b7%e4%b8%ad%e5%bf%83%e5%b0%8e%e5%b8%ab%e5%a4%aa%e5%8f%a4%e5%88%86%e6%a0%a1/
0e37a5954643b325c70d4566df7e38ee,佛教志蓮中學,盧小姐,23218511,clnedu@chilin.org,https://recruit.hkfew.org.hk/jobs/%e5%85%bc%e8%81%b7dse%e6%87%89%e8%a9%a6%e5%a2%9e%e6%bd%a4%e7%8f%ad%e5%b0%8e%e5%b8%ab/
8ccc5a34e62bdf7561dccdaaed95a1a8,Superior Education Centre,Ms Yik,59160563,superior.yl2017@gmail.com,https://recruit.hkfew.org.hk/jobs/%e5%85%bc%e8%81%b7%e5%b0%88%e7%a7%91%e8%a3%9c%e7%bf%92%e5%b0%8e%e5%b8%ab-part-time-tutor/
cad1a9ae5b37dd86932aa773f00cfc08,嘉德麗教育機構 (沙田),李太,96814517,HR@catiline.edu.hk,https://recruit.hkfew.org.hk/jobs/%e5%b0%8f%e5%ad%b8%e8%a3%9c%e7%bf%92%e8%80%81%e5%b8%ab-%e5%8a%9f%e8%aa%b2%e8%bc%94%e5%b0%8e%e3%80%81%e4%b8%ad%e6%96%87-%e8%8b%b1%e6%96%87-%e6%95%b8%e5%ad%b8-%e9%95%b7%e6%9c%9f%e5%85%bc%e8%81%b7/
a71af1d769f25392811cac34e39537fe,Creative Power,Miss Cheng,98320892,chengcsk@yahoo.com.hk,https://recruit.hkfew.org.hk/jobs/%e5%85%bc%e8%81%b7-%e4%b8%ad%e5%ad%b8%e5%8a%9f%e8%aa%b2%e8%bc%94%e5%b0%8e%e7%8f%ad%e5%b0%8e%e5%b8%ab/
54e39762cfea2445510a4fd7a41aeef2,Enlightening Education Limited,Ms Cheung,91414028,recruit@enlighteningedu.com,https://recruit.hkfew.org.hk/jobs/%e5%85%a8%e8%81%b7-%e5%8d%8a%e8%81%b7%e5%b9%bc%e5%85%92%e5%b0%8e%e5%b8%ab-%e5%8a%a9%e6%95%99-%e5%b0%87%e8%bb%8d%e6%be%b3-playgroup-teacher-teaching-assistant-tseung-kwan-o/
575f1beb97e7dd343211eae56504dcdd,智妍教育,MS YEUNG,92812693,saraswati.ct@gmail.com,https://recruit.hkfew.org.hk/jobs/%e5%85%bc%e8%81%b7%e8%a3%9c%e7%bf%92%e5%b0%8e%e5%b8%ab-4/
a5d2fb17c3d323b401b4340dc2717fc2,幸福文化,阮小姐,23370678,recruit@likogroup.com.hk,https://recruit.hkfew.org.hk/jobs/%e9%9f%b3%e6%a8%82%e5%b0%8e%e5%b8%ab-2/
4b5dc6566f775ec776e3a53b76ecc5eb,康盈中英文幼稚園,盧承依校長,27723163,hongyinginfo@gmail.com,https://recruit.hkfew.org.hk/jobs/%e5%85%bc%e8%81%b7%e8%aa%b2%e9%a4%98%e8%a8%97%e7%ae%a1%e5%b0%8e%e5%b8%ab-15/
694e96de2e3be3c8b1ddb3008358a2bc,勵致研習中心,黃生,24622576,fair_ltd@yahoo.com.hk,https://recruit.hkfew.org.hk/jobs/%e4%b8%ad%e5%b0%8f%e5%ad%b8%e5%b0%8e%e5%b8%ab-5-6%e5%a4%a9-%e8%a7%80%e5%a1%98%e5%ae%89%e9%81%94-secondary-school-and-primary-school-tutor-5-6days-on-tat-estate-kwun-tong/
3c2715c80a51960ee71dd3a942459cd6,早慧兒童教育中心,Ms Kong,26012080,recruit@societyofgenesis.com.hk,https://recruit.hkfew.org.hk/jobs/%e5%85%bc%e8%81%b7%e4%b8%ad%e6%96%87%e5%b0%8e%e5%b8%ab/
b58fda3b86f35b3a93065d19b81c474e,東華三院馬振玉紀念中學,林嘉駿老師,24439833,lamkajin@cyma.edu.hk,https://recruit.hkfew.org.hk/jobs/%e5%8c%96%e5%ad%b8%e7%a0%94%e7%bf%92%e7%8f%ad%e5%b0%8e%e5%b8%ab/
e6245db6374d2697fde806c0de144678,香港遊戲及心理治療學苑,Kayden Chun,37554982,hr@apphk.org,https://recruit.hkfew.org.hk/jobs/%e5%85%bc%e8%81%b7sen%e8%bc%94%e5%b0%8e%e5%b0%8f%e7%b5%84%e5%b0%8e%e5%b8%ab/
b85f673d714cd914ad3b10f00efa836e,齊齊學教育中心(佐敦),中心主任劉女士,23779039,info@cometolearn.net,https://recruit.hkfew.org.hk/jobs/%e5%85%a8%e8%81%b7%e5%b0%8f%e5%ad%b8%e8%a3%9c%e7%bf%92%e5%b0%8e%e5%b8%ab%e4%bd%90%e6%95%a6%ef%bc%9b14k-16k-month/
f89af551db3463e5272ff7ebc60a5e5e,ACE EDUCATION CENTRE,Eric KC Lai,94083553,aceeducentre.hk@gmail.com,https://recruit.hkfew.org.hk/jobs/%e5%85%a8%e8%81%b7%e8%a3%9c%e7%bf%92%e5%b0%8e%e5%b8%ab-5/
8ae2f76004fd9ca62fafcd3c1a3b5e3a,HONG KONG YOUNG TALENTS ASSOCIATION,MANDY CHEUNG,97025048,mandycheung0702@gmail.com,https://recruit.hkfew.org.hk/jobs/%e4%b8%ad%e8%8b%b1%e6%96%87%e8%bc%94%e5%b0%8e%e7%8f%ad%e5%b0%8e%e5%b8%ab/
e3374edbb0a0cb840c0993136a8dfdc7,圓玄學院妙法寺內明陳呂重德紀念中學,魏小姐,24458899,admin@clctmc.edu.hk,https://recruit.hkfew.org.hk/jobs/%e8%8b%b1%e8%aa%9e%e6%8b%94%e5%b0%96%e7%8f%ad%e5%b0%8e%e5%b8%ab-2/
7e36341844a9b151eeac02a6901cd13b,香港數理科技及英語教育中⼼ Hong Kong Stem & English Education Center,莊先生,62858278,admin@stem100.com.hk,https://recruit.hkfew.org.hk/jobs/%e5%85%bc%e8%81%b7%e5%b0%8e%e5%b8%ab-12/
3989d7769c7fc5ddf1e326debbe23777,協恩中學附屬小學,蔡小姐,27111263,hyps@hyps.edu.hk,https://recruit.hkfew.org.hk/jobs/%e8%aa%b2%e5%be%8c%e5%8a%9f%e8%aa%b2%e8%bc%94%e5%b0%8e%e7%8f%ad%e5%b0%8e%e5%b8%ab%e5%85%bc%e8%81%b7/
33183e9ca06280939b5dc971e7cacd9c,御學軒集團有限公司,Enos Cheng,63604267,hr@royallearning.com,https://recruit.hkfew.org.hk/jobs/%e5%85%bc%e8%81%b7-%e9%9d%a2%e8%a9%a6%e5%9f%b9%e8%a8%93%e5%b0%8e%e5%b8%ab/
d5dd84bef7c2a0436e1a6050a15901e1,梁式芝書院,鄭小姐,23496626,recruitment@lscc.edu.hk,https://recruit.hkfew.org.hk/jobs/enhancement-class-tutors-for-students-after-school/
ccf076ae8aa5a65a5445502a4b5b5864,星橋教育中心 (Starbridge Education Centre),鄧小姐,60127547,starbridgehk@gmail.com,https://recruit.hkfew.org.hk/jobs/%e5%85%bc%e8%81%b7%e5%b0%8f%e5%ad%b8%e5%8a%9f%e8%bc%94%e5%b0%8e%e5%b8%ab/
d7681d52fdd65bd55265cb9a555af5f6,保良局朱敬文中學,何小姐,26991031,master@plkcwc.edu.hk,https://recruit.hkfew.org.hk/jobs/%e5%85%bc%e8%81%b7-%e8%8b%b1%e6%96%87%e7%a7%91dse-strategy-class-%e5%b0%8e%e5%b8%ab/
e58ff5ee147d829129c6471c7473e9f6,HKBUAS Wong Kam Fai Secondary and Primary School,Ms. Chiu,26367383,hr@hkbuas.edu.hk,https://recruit.hkfew.org.hk/jobs/part-time-tutors-math-science/
6367d478f9c7e42b8e88fd8f308982ff,哲研教育中心,黃先生,97984698,hr@philedu.hk,https://recruit.hkfew.org.hk/jobs/%e5%85%bc%e8%81%b7%e8%a3%9c%e7%bf%92%e5%b0%8e%e5%b8%ab-%e5%8a%9f%e8%aa%b2%e8%bc%94%e5%b0%8e%e7%8f%ad-2/
353cda9db540e4a82dcbad48a099f631,荃灣kidversity,Miss Lam,31690588,kidsbobo111@gmail.com,https://recruit.hkfew.org.hk/jobs/playgroup-%e5%b0%8e%e5%b8%ab-%e5%8a%a9%e7%90%86%e4%b8%ad%e5%bf%83%e4%b8%bb%e7%ae%a1/
6bd97a95c3f859be9ad4bf447b21ac26,CHILDREN WORKSHOP 綠苗工作坊,Miss Wong,21382508,info.childrenworkshop@yahoo.com.hk,https://recruit.hkfew.org.hk/jobs/%e5%85%a8%e8%81%b7%e8%a6%aa%e5%ad%90%e7%8f%ad%e5%b0%8e%e5%b8%ab/
605892cb4f63d11b273ccb947ba8d0c5,BLUE SKY ENGLISH EDUCATION CENTRE,Winnie,25728600,ask@treasure-global.com,https://recruit.hkfew.org.hk/jobs/%e5%85%a8%e8%81%b7-%e5%85%bc%e8%81%b7-%e4%b8%ad%e5%b0%8f%e5%ad%b8%e5%8a%9f%e8%aa%b2%e8%bc%94%e5%b0%8e%e7%8f%ad%e5%b0%8e%e5%b8%ab-2/
446ccc0602c5f1fad4ba7016b0206b7e,明愛賽馬會黃大仙綜合服務,周姑娘,23820265,chaukm.joyce@caritassws.org.hk,https://recruit.hkfew.org.hk/jobs/%e4%b8%ad%e6%96%87%e7%8f%ad%e5%b0%8e%e5%b8%ab-2/
7f9f8c23c8b6d4d85707fb7fbf356f4a,基督教恩活堂,鄭先生,60223693,leoming422cs@gmail.com,https://recruit.hkfew.org.hk/jobs/%e5%8d%8a%e8%81%b7%e8%a3%9c%e7%bf%92%e8%80%81%e5%b8%ab-%e5%b0%8f%e5%ad%b8-%e6%88%96-%e4%b8%ad%e5%ad%b8/
f683c9f3fecea8e44e23c643d2674ee5,Dunn's Education 梓峰教育,許小姐,98535867,recruit.dunn@gmail.com,https://recruit.hkfew.org.hk/jobs/%e5%85%a8%e8%81%b7-%e5%b9%bc%e5%85%92%e5%b0%8e%e5%b8%ab-%e5%b7%a5%e4%bd%9c%e5%9c%b0%e9%bb%9e%ef%bc%9a%e4%b9%9d%e9%be%8d%e7%81%a3/
c33f8d20592d7e018e77c4408a134235,東莞工商總會劉百樂中學,朱小姐,26951336,info@lplss.edu.hk,https://recruit.hkfew.org.hk/jobs/%e9%9d%9e%e8%8f%af%e8%aa%9e%e4%b8%ad%e6%96%87%e7%a7%91%e8%aa%b2%e5%be%8c%e5%b0%8e%e5%b8%ab/
ccc99e974314ab07be5d7e1731f86685,慈航學校,曾小姐,26486834,info@chihong.edu.hk,https://recruit.hkfew.org.hk/jobs/%e8%aa%b2%e5%be%8c%e8%bc%94%e5%b0%8e%e7%8f%ad%e5%b0%8e%e5%b8%ab%ef%bc%88%e5%a4%9a%e5%90%8d%ef%bc%89/
c835ac9d6f3b2c52ccf2d4c2eec8027b,EDUKEY CENTRE FOR EDUCATION,Miss Chan,27940851,info.epc.edu@gmail.com,https://recruit.hkfew.org.hk/jobs/%e5%85%a8%e8%81%b7%e5%8a%9f%e8%aa%b2%e8%bc%94%e5%b0%8e%e7%8f%ad%e5%b0%8e%e5%b8%ab-%e4%b9%9d%e9%be%8d%e5%9f%8e/
b02abffa636435b62aeba78961646e9c,余振強紀念中學,王名儉老師,27144161,mkwong@gm.yckmc.edu.hk,https://recruit.hkfew.org.hk/jobs/%e9%9d%9e%e8%8f%af%e8%aa%9e%e5%ad%b8%e7%94%9f%e5%b0%8e%e5%b8%ab%e4%b8%ad%e6%96%87/
c7eb3872441b56be87b8761dba667b8b,明愛粉嶺陳震夏中學,梁雅燕老師,26699966,cfs@cfs.edu.hk,https://recruit.hkfew.org.hk/jobs/%e8%aa%b2%e5%a4%96%e6%b4%bb%e5%8b%95%e5%b0%8e%e5%b8%ab%ef%bc%88%e7%be%8e%e9%a3%9f%e8%a3%bd%e4%bd%9c%ef%bc%89/
401dc8e3e21c89491728280e8de10007,旅港開平商會中學,張小姐,27123107,school@hpccss.edu.hk,https://recruit.hkfew.org.hk/jobs/%e5%88%9d%e4%b8%ad%e4%b8%ad%e6%96%87%e5%a2%9e%e6%bd%a4%e7%8f%ad%e5%b0%8e%e5%b8%ab/
32867074935dbf457eb13f53b07b94e2,山林教育Hillwood Tutorial School,Miss Amanda Ng,23779937,hillwoodtst@yahoo.com.hk,https://recruit.hkfew.org.hk/jobs/%e5%85%a8%e8%81%b7%e8%a3%9c%e7%bf%92%e5%b0%8e%e5%b8%ab-4/
10d00799c6da88d2b8420b36b8110790,大眾教室(將軍澳廣場),蘇太,44046977,seededucation2020@gmail.com,https://recruit.hkfew.org.hk/jobs/%e5%85%bc%e8%81%b7%e8%8b%b1%e6%96%87%e7%a7%91%e5%b0%8e%e5%b8%ab-2/
4f88db7fd8df1bfe716150cf464660f5,啟航教育中心,王sir / miss lam,65800045(whatsapp)/56427706(whatsapp),hksailingadventure@gmail.com,https://recruit.hkfew.org.hk/jobs/%e5%85%bc%e8%81%b7%e6%95%b8%e5%ad%b8%e5%b0%88%e7%a7%91%e5%b0%8e%e5%b8%ab/
b87ec1100cab4c6860bb0b2bf7d96d5a,余振強紀念中學,楊竣皓,55340585,chyeung@gm.yckmc.edu.hk,https://recruit.hkfew.org.hk/jobs/%e5%a2%9e%e7%9b%8a%e8%aa%b2%e7%a8%8b%e5%b0%8e%e5%b8%ab%ef%bc%88%e4%b8%ad%e6%96%87%ef%bc%89-7/
a2eb7d4382246d2e1648d0a00201e3d7,靈實恩光學校,梁小姐 (Amy Leung),27031722,mcleung@sunnyside.edu.hk,https://recruit.hkfew.org.hk/jobs/%e5%8d%8a%e8%81%b7-%e6%97%a5%e8%96%aa-%e5%ae%bf%e8%88%8d%e5%b0%8e%e5%b8%ab%e5%90%88%e7%b4%84%e5%88%b6-%e7%b7%a8%e8%99%9f%ef%bc%9ass-0-5hp-daily-rated-hp/
6860d71a7603c9104fb842d1a348a22c,拓維教育中心,Ms So,98422887,recruit@topbrighteducation.com,https://recruit.hkfew.org.hk/jobs/%e5%85%bc%e8%81%b7%e5%8a%9f%e8%aa%b2%e8%bc%94%e5%b0%8e%e7%8f%ad%e5%b0%8e%e5%b8%ab-%e7%b4%85%e7%a3%a1%e8%a3%9c%e7%bf%92-2/
b31308780570d9250b2bf5c2fb3cc88f,匯成教育中心(IBEC),Cherry Li,31089040/57424553,adminibecssp@buznetvigator.com,https://recruit.hkfew.org.hk/jobs/%e5%85%bc%e8%81%b7%e5%8a%9f%e8%aa%b2%e5%b0%8e%e5%b8%ab-2/
a2ec56017704578b555869f4fe338ca6,卓爾畫室,Raymond Chan,31149050,info@jr-art.hk,https://recruit.hkfew.org.hk/jobs/%e5%85%92%e7%ab%a5%e7%b9%aa%e7%95%ab%e7%8f%ad%e5%b0%8e%e5%b8%ab/
a92862089028a2b6d092e92dacfd2dd6,香港布廠商會朱石麟中學,Cora Lam,27968323,recruit@chusheklun.edu.hk,https://recruit.hkfew.org.hk/jobs/%e9%9f%b3%e6%a8%82%e7%8f%ad%e5%b0%8e%e5%b8%ab-2/
e7f79c6c8d13c9c8baa51f82691a2d92,智趣小博士教育中心 Dr I-Kids Education Centre,Lois Chain,84912723,lois@drikids.com,https://recruit.hkfew.org.hk/jobs/%e5%85%bc%e8%81%b7-%e8%a3%9c%e7%bf%92%e8%80%81%e5%b8%ab-%e8%a3%9c%e7%bf%92%e5%b0%8e%e5%b8%ab/
03c987ea330a35e23cfc513f5f7ac3a6,匯成教育中心(IBEC),葉小姐,26777778/54119779,adminibec@biznetvigator.com,https://recruit.hkfew.org.hk/jobs/%e9%9d%9e%e8%8f%af%e8%aa%9e%e8%a3%9c%e7%bf%92%e5%b0%8e%e5%b8%ab%ef%bc%88%e5%85%a8%e8%81%b7-%e5%85%bc%e8%81%b7%ef%bc%89-2/
fb351292f4062aad6060800e40a66246,香港基督教女青年會 將軍澳綜合社會服務處,周先生,27093388,ittkorecruit@ywca.org.hk,https://recruit.hkfew.org.hk/jobs/%e9%8b%bc%e7%90%b4%e7%8f%ad%e5%b0%8e%e5%b8%ab%e5%a4%9a%e5%90%8d/
fcbdd8576a77ce34f7495a1384448002,中華基督教會何福堂書院,江老師,24596354,hft-mail@hftc.edu.hk,https://recruit.hkfew.org.hk/jobs/%e6%8e%92%e7%90%83%e6%a0%a1%e9%9a%8a%e6%9c%8d%e5%8b%99%e5%93%a1/
faaa2cc941cbaee4e54dbb23cc7be150,賽馬會萬鈞毅智書院(政府津貼文法中學),黃小姐,24472322,eduyoung@jcmkec.edu.hk,https://recruit.hkfew.org.hk/jobs/%e5%85%bc%e8%81%b7%e5%b0%8e%e5%b8%ab-11/
b92b7550daf20457609cde50d14f5586,路德會沙崙堂幼稚園(慈愛分校),李麗萍校長,23260280,sckg0360to@gmail.com,https://recruit.hkfew.org.hk/jobs/%e7%9f%ad%e6%9c%9f%e5%b0%8e%e5%b8%ab%e6%94%af%e6%8f%b4%e9%9d%9e%e8%8f%af%e8%aa%9e%e5%ad%b8%e7%ab%a5/
bfb9f0f5a1fa66d0b7ceb39674d137d7,Rainbow Creative Arts Limited,Nora Ng,52737875,hr2@rainbowarts.hk,https://recruit.hkfew.org.hk/jobs/%e5%85%92%e7%ab%a5%e6%99%9d%e7%8f%ad%e5%b0%8e%e5%b8%ab-%e4%b9%9d%e9%be%8d%e6%9d%b1-%e5%85%83%e6%9c%97-%e9%9d%92%e8%a1%a3-%e6%b8%af%e5%b3%b6%e6%9d%b1-%e5%b0%87%e8%bb%8d%e6%be%b3/
d5e837520f8b641fc11f50e42d3a6a55,東華三院馬振玉紀念中學,鄭慶珠老師,24439833,chenghingchu@cyma.edu.hk,https://recruit.hkfew.org.hk/jobs/%e8%8b%b1%e6%96%87%e6%8b%94%e5%b0%96-%e5%a2%9e%e6%bd%a4%e8%aa%b2%e7%a8%8b%e5%b0%8e%e5%b8%ab-%e4%b8%ad%e4%b8%89%e8%87%b3%e4%b8%ad%e5%85%ad%e7%b4%9a-4/
090d2df8aa6523902ac7858c3845f67f,HKTA香港導師會,劉小姐,55961800,sandi.lau@hkta.edu.hk,https://recruit.hkfew.org.hk/jobs/%e5%b0%8f%e5%ad%b8%e5%a5%a7%e6%95%b8%e8%88%88%e8%b6%a3%e7%8f%ad%e5%b0%8e%e5%b8%ab/
e566599145c689699698a20f4b3bed0b,匯成教育中心(IBEC),Cherry Li,31089040/57424553,adminibec@biznetvigator.com,https://recruit.hkfew.org.hk/jobs/%e5%85%bc%e8%81%b7%e5%8a%9f%e8%aa%b2%e5%b0%8e%e5%b8%ab/
9da5b00ab63f12023f71ed74b5d7beaa,中華基督教會馮梁結紀念中學,區小姐,26516033,info@flk.edu.hk,https://recruit.hkfew.org.hk/jobs/e-%e6%a8%82%e5%9c%98%e5%b0%8e%e5%b8%ab/
ad4cb490514ec7e6047f331ae070c9f6,循道衛理楊震社會服務處 家庭健康教育及輔導中心,黃先生,21714111,leowong@yang.org.hk,https://recruit.hkfew.org.hk/jobs/%e7%be%a9%e5%b7%a5%e8%a8%88%e5%8a%83%e6%b4%bb%e5%8b%95%e5%b0%8e%e5%b8%ab-2/
8ed56041a8c66a44254ca2b416244999,智趣小博士教育中心 Dr I-Kids Education Centre,Mr. Wong,52324018,application@idrkids.com,https://recruit.hkfew.org.hk/jobs/%e6%95%99%e8%82%b2%e4%b8%ad%e5%bf%83%e5%85%a8%e8%81%b7%e5%b0%8e%e5%b8%ab-full-time-tutor-%e5%85%bc%e8%81%b7%e5%b0%8e%e5%b8%ab-part-time-tutor/
f6b2fa5c376c02c3b5091e544bba6f21,St. Paul's Secondary School,Ms. Li,25773836,spssmail@spss.edu.hk,https://recruit.hkfew.org.hk/jobs/%e9%9d%9e%e8%8f%af%e8%aa%9e%e4%b8%ad%e6%96%87%e6%95%99%e5%ad%b8%e5%b0%8e%e5%b8%ab-%e5%85%bc%e8%81%b7/
fea4a0303877ba03ad4ea74f17ce5a23,心計劃上門訓練,Josie Yung,53302658,josie@sencares.hk,https://recruit.hkfew.org.hk/jobs/%e3%80%8c%e5%bf%83-%e8%a8%88%e5%8a%83%e3%80%8d%e4%b8%8a%e9%96%80%e7%89%b9%e6%ae%8a%e6%95%99%e8%82%b2%e8%80%81%e5%b8%ab-2/
01f0867bd2d796cd50a3ee054c5c4739,One Plus One Educational Centre,蘇小姐,22468139,yuenlong@1plus1edu.com,https://recruit.hkfew.org.hk/jobs/%e5%85%bc%e8%81%b7%e5%b0%8e%e5%b8%ab-10/
1a2ea913455d82163071a3a6c7609438,BLUE SKY ENGLISH EDUCATION CENTRE,Winnie,TEL:25728600WHATSAPP:90463429,marta.dl@outlook.com,https://recruit.hkfew.org.hk/jobs/%e5%85%a8%e8%81%b7-%e5%85%bc%e8%81%b7-%e4%b8%ad%e5%b0%8f%e5%ad%b8%e5%8a%9f%e8%aa%b2%e8%bc%94%e5%b0%8e%e7%8f%ad%e5%b0%8e%e5%b8%ab/
96725f4cae2abf07e75a40e49339ec0a,文化教育 (補習社),鄭生,95878700,gregenius71@gmail.com,https://recruit.hkfew.org.hk/jobs/%e5%85%bc%e8%81%b7%e5%8a%9f%e8%aa%b2%e7%8f%ad%e8%80%81%e5%b8%ab-%ef%bc%8f%e5%85%a8%e8%81%b7%e5%ba%97%e9%95%b7/
44828f1363177ffdc56cfebaf593d7c4,KA CHUNG EDUCATION CENTRE,黃小姐,55923953,kk21717@yahoo.com.hk,https://recruit.hkfew.org.hk/jobs/%e5%8a%9f%e8%aa%b2%e8%bc%94%e5%b0%8e%e5%93%a1/
363fd499d77f1c3838f745bb9e29fd27,Tiffany Lau Vocal Performance Academy,Miss Lok,35472550,enquiry@tlvpa.com.hk,https://recruit.hkfew.org.hk/jobs/%e5%90%88%e7%b4%84%e9%9f%b3%e6%a8%82%e7%8f%ad%e5%b0%8e%e5%b8%ab/
ec756419bc526e673680910868b081bf,神召會康樂中學,湯小姐,26520698,application@gc.hebron.edu.hk,https://recruit.hkfew.org.hk/jobs/%e9%ab%98%e4%b8%ad%e6%95%b8%e5%ad%b8%e8%a3%9c%e7%bf%92%e7%8f%ad/
55119adc66d0c42427bd8f47190ff1c8,智恒教育中心有限公司,Raymond Wong,21267633,raymond.wong@i-software.com.hk,https://recruit.hkfew.org.hk/jobs/%e5%85%bc%e8%81%b7%e9%9b%bb%e8%85%a6%e5%b0%8e%e5%b8%ab-%e5%85%bc%e8%81%b7steam%e5%b0%8e%e5%b8%ab-i-t-trainer-steam-trainer-2/
19b4037c5399545c72d4473b432a289b,東華三院蕭旺李滿福幼兒園,李小姐,25802273,swlmfns@tungwah.org.hk,https://recruit.hkfew.org.hk/jobs/%e5%b9%bc%e5%85%92%e5%b0%8e%e5%b8%ab-19/
a38ed0758dbd95ca7ec3e4c55c398502,連青網絡-香港神託會青少年綜合服務中心,陳小姐,90123610,kayan.chan@stewards.hk,https://recruit.hkfew.org.hk/jobs/%e5%b0%8f%e5%ad%b8%e5%8a%9f%e8%bc%94%e5%b0%8e%e5%b8%ab/
64fbe58efa245e89452827f34115712c,循道衛理楊震社會服務處 家庭健康教育及輔導中心,黃先生,21714111,fhe@yang.org.hk,https://recruit.hkfew.org.hk/jobs/%e7%be%a9%e5%b7%a5%e8%a8%88%e5%8a%83%e6%b4%bb%e5%8b%95%e5%b0%8e%e5%b8%ab/
9713377c4e5300934b6d2cb13e467ba0,御學軒集團有限公司,Enos Cheng,63604267,hr@rlg.hk,https://recruit.hkfew.org.hk/jobs/%e5%85%a8%e8%81%b7-%e5%b0%8f%e5%ad%b8%e5%8a%9f%e8%aa%b2%e8%bc%94%e5%b0%8e%e7%8f%ad%e5%b0%8e%e5%b8%ab/
fa41383208cf179c92804e592327067e,臻越教育中心,Chloe Chung,46839183,zhenyue2021@gmail.com,https://recruit.hkfew.org.hk/jobs/part-time-%e5%8c%96%e5%ad%b8%e5%b0%8e%e5%b8%ab/
c4d09031c0a6485946d0288f170735f1,Learn together Limited,Gladys Yeung,54362935,apply.learntogether@gmail.com,https://recruit.hkfew.org.hk/jobs/%e5%85%a8%e8%81%b7-%e5%85%bc%e8%81%b7%e4%b8%ad%e5%b0%8f%e5%ad%b8%e5%b0%88%e7%a7%91%e7%8f%ad%e8%a3%9c%e7%bf%92%e5%b0%8e%e5%b8%ab-%e5%9c%9f%e7%93%9c%e7%81%a3/
96d0be6f9c0928e8390767f62a6b35ea,浸信會沙田教育中心,陳小姐,82003351,baptistec@hkstbc.org,https://recruit.hkfew.org.hk/jobs/%e8%aa%b2%e5%be%8c%e5%8a%9f%e8%bc%94%e7%8f%ad%e5%b0%8e%e5%b8%ab%e5%85%bc%e8%81%b7-%e6%b2%99%e7%94%b0%e5%8d%80/
91f455718ef449f203016adebcc3b9fc,Childwalker童行者,Ms Catherine Ho,95585099,catherineho33@yahoo.com.hk,https://recruit.hkfew.org.hk/jobs/%e5%85%a8%e8%81%b7%e5%b9%bc%e5%85%92%e5%b0%8e%e5%b8%ab%e6%b8%af%e5%b3%b6%e5%8d%97%e5%8d%80/
8b524fd43b3a04746a5ff83aebc41e76,中華基督教會燕京書院,伍小姐,23879988,recruit@yenching.edu.hk,https://recruit.hkfew.org.hk/jobs/%e8%81%af%e8%aa%b2%e6%b4%bb%e5%8b%95%e5%8a%a9%e7%90%86%e5%b0%8e%e5%b8%ab/
6c9abcfd2fae6b535f6774d50e075da8,Man Kai Education,Miss Chan,26688294,eunice@monkeymaster.com.hk,https://recruit.hkfew.org.hk/jobs/%e5%85%83%e6%9c%97%e6%95%99%e8%82%b2%e4%b8%ad%e5%bf%83%e5%85%bc%e8%81%b7%e5%b0%8e%e5%b8%ab-part-time-tutor-5/
c37f2e7441372c81401955b744208311,港九潮州公會中學,Emily Ngan,23964187,recruit@ccpass.edu.hk,https://recruit.hkfew.org.hk/jobs/%e8%aa%b2%e5%be%8c%e5%ad%b8%e7%bf%92%e6%94%af%e6%8f%b4%e5%b0%8e%e5%b8%ab/
4d79c27d6294ff4c6713f4877ea41ec7,Delia (Man Kiu) English Primary School,Ms Leung,24325123,ty@deliagroup.edu.hk,https://recruit.hkfew.org.hk/jobs/after-school-chinese-tutorial-class-tutor-2/
8c484acfd33be7f5759ab6b1c8e10995,Ginny Education Center,Kevin Wong,95243357,ginnyeducation@gmail.com,https://recruit.hkfew.org.hk/jobs/%e5%85%bc%e8%81%b7%e5%8a%9f%e8%aa%b2%e7%8f%ad%e5%b0%8e%e5%b8%ab-2/
164c9b88fbe4e67e7fd501c07fca2275,千瑪教育中心,連佩文,51341789,admin@marchcentre.com,https://recruit.hkfew.org.hk/jobs/%e5%85%bc%e8%81%b7%e5%b0%8f%e5%ad%b8%e5%8a%9f%e8%bc%94%e7%8f%ad%e5%b0%8e%e5%b8%ab/
0822bd50c389f36f464ffcb2ea62de75,學孜教育有限公司,Henry Chu,60124257,hotedu.info@gmail.com,https://recruit.hkfew.org.hk/jobs/%e5%b0%8f%e5%ad%b8%e5%8a%9f%e8%aa%b2%e5%b0%8f%e7%b5%84%e5%b0%8e%e5%b8%ab/
8b18b8021be53212f95752d9b518895e,保良局陸慶濤小學,藍小姐,27010011,cmlam@plklht.edu.hk,https://recruit.hkfew.org.hk/jobs/%e5%90%88%e5%94%b1%e5%9c%98%e6%8c%87%e6%8f%ae%e4%bb%a3%e8%aa%b2-29-11-28-2%e6%9c%9f%e9%96%93/
85bf2458d8c258568c3f86ca6856b089,聖公會聖西門呂明才中學,李小姐,24598236/39567900,recruit@skhsslmc.edu.hk,https://recruit.hkfew.org.hk/jobs/%e6%96%87%e6%86%91%e8%a9%a6%e8%8b%b1%e8%aa%9e%e7%89%b9%e8%a8%93%e7%8f%ad%e5%b0%8e%e5%b8%ab/
85908dce38939fea84cf672c90bace37,進研學習中心,楊小姐,67909241,infocontemporaryedu@gmail.com,https://recruit.hkfew.org.hk/jobs/%e5%85%a8%e8%81%b7%e5%8a%9f%e8%aa%b2%e8%bc%94%e5%b0%8e%e7%8f%ad%e5%b0%8e%e5%b8%ab%ef%bc%88%e5%a0%85%e5%b0%bc%e5%9c%b0%e5%9f%8e%ef%bc%89/
1a1523e792b771811c10ce0fddd29794,廠商會蔡章閣中學,Anson Chan,24520681,ac@cmacck.edu.hk,https://recruit.hkfew.org.hk/jobs/%e5%91%a8%e4%b8%89-%e5%91%a8%e5%9b%9b%e8%8b%b1%e6%96%87%e8%a3%9c%e7%bf%92%e7%8f%ad%e5%b0%8e%e5%b8%ab1%e5%90%8d/
a2a35a797635782e476201203f80fdeb,星級第一教育中心,Ms Hui,64851211,1stedu.hr@gmail.com,https://recruit.hkfew.org.hk/jobs/%e5%85%bc%e8%81%b7%e5%b0%8f%e7%b5%84%e5%8a%9f%e8%aa%b2%e7%8f%ad%e5%b0%8e%e5%b8%ab/
17d33ca218e1cc0d0e7aaca5037b1b8f,香港真光書院,莫潔儀老師,28711214,hktlcoff@hkstar.com,https://recruit.hkfew.org.hk/jobs/%e8%88%9e%e5%8f%b0%e9%9f%b3%e9%9f%bf%e5%b0%8e%e5%b8%ab/
ef85f850aaab3eb7fb73f0c201c27fd5,現代小學士有限公司,MS Poon,97290919,bachelor.junniepoon@gmail.com,https://recruit.hkfew.org.hk/jobs/%e5%85%bc%e8%81%b7%e5%8a%9f%e8%aa%b2%e8%bc%94%e5%b0%8e%e7%8f%ad%e5%b0%8e%e5%b8%ab-part-time-tutor-%e9%95%b7%e6%9c%9f-%e7%9f%ad%e6%9c%9f%e4%b9%9f%e5%8f%af/
8964eff2ec44aff6f49cf04d553bec8a,進才教育中心(土瓜灣),施小姐,61753811,gslc.edu@gmail.com,https://recruit.hkfew.org.hk/jobs/%e5%85%a8%e8%81%b7%e5%b0%8f%e5%ad%b8-%e4%b8%ad%e5%ad%b8%e8%a3%9c%e7%bf%92%e5%b0%8e%e5%b8%ab/
8c4e3519d3793e51d214787ca725167a,文耀教育中心,蔣老師,93290888(可Whatsapp聯絡),myeducen@gmail.com,https://recruit.hkfew.org.hk/jobs/%e6%95%99%e8%82%b2%e4%b8%ad%e5%bf%83%e5%b0%8e%e5%b8%ab/
53294f96c3932cdf975f2c95faa4e818,啟航教育中心,王sir / miss lam,65800045(whatsapp),hksailingadventure@gmail.com,https://recruit.hkfew.org.hk/jobs/%e5%85%bc%e8%81%b7%e8%8b%b1%e6%96%87%e5%b0%88%e7%a7%91%e5%b0%8e%e5%b8%ab/
3fc29530c725233de33ac02e35d6ed18,愛家庭賽馬會成長中心,黃姑娘,82011163,ltlec@skhwc.org.hk,https://recruit.hkfew.org.hk/jobs/%e5%85%bc%e8%81%b7%e8%aa%b2%e9%a4%98%e8%a8%97%e7%ae%a1%e5%b0%8e%e5%b8%ab-13/
bc53208979d081a2ac4008ac62d1390b,Good Hope School 德望學校,Ms. Sonia Wong,23210250(Ext.22),recruitment@ghs.edu.hk,https://recruit.hkfew.org.hk/jobs/%e5%9c%8b%e8%a1%93%e5%ad%b8%e6%9c%83%e5%b0%8e%e5%b8%ab/
5b97182eb8c122a28e60620f2fbda474,Dr I-Kids 智趣小博士教育中心,Lois Chan,84912723,application@idrkids.com,https://recruit.hkfew.org.hk/jobs/%e5%b0%8f%e5%ad%b8%e5%85%a8%e7%a7%91%e8%bc%94%e5%b0%8e%e5%85%bc%e8%81%b7%e5%b0%8e%e5%b8%ab-%e4%bd%95%e6%96%87%e7%94%b0-%e7%ad%b2%e7%ae%95%e7%81%a3-%e5%b0%8f%e8%a5%bf%e7%81%a3/
4e88acd9f46e791b78dcccc595dba502,伊利沙伯中學舊生會湯國華中學,校長,26175000,info@qts.edu.hk,https://recruit.hkfew.org.hk/jobs/%e6%96%87%e6%86%91%e8%a9%a6%e7%a7%91%e7%9b%ae%e8%aa%b2%e5%be%8c%e6%94%af%e6%8f%b4%e5%b0%8e%e5%b8%ab/
4cfa862e76b81dc2fd76ad23f6ed1954,東華三院郭一葦中學,莊小姐,24471258,office@twghkywc.edu.hk,https://recruit.hkfew.org.hk/jobs/%e9%ab%98%e4%b8%ad%e8%aa%b2%e5%be%8c%e4%b8%ad%e6%96%87%e7%a7%91%e5%b0%8e%e5%b8%ab/
c316f7fe15ac9b24f75696905bcd0bc1,豆豆導師招聘網,陳小姐,67480761,careers@education-plus.com.hk,https://recruit.hkfew.org.hk/jobs/%e5%85%bc%e8%81%b7%e5%88%b0%e6%a0%a1%e5%b0%8e%e5%b8%ab__%e4%b8%ad%e4%b8%80%e4%b8%ad%e4%ba%8c%e5%8a%9f%e8%bc%94%e7%8f%ad%e5%b0%8e%e5%b8%ab__%e6%af%8f%e7%af%80120/
1129941093f97af04de1680cfcc85e8f,佛教何南金中學,莊小姐,23400871,recruit@bhnkc.edu.hk,https://recruit.hkfew.org.hk/jobs/%e8%8b%b1%e8%aa%9e%e8%a3%9c%e7%bf%92%e5%b0%8e%e5%b8%ab/
985a5c2ac6edf21a31d8247594ff529a,Happy Workshop樂斯音樂藝術坊,Ann Leung,95406014,happyworkshop09@yahoo.com.hk,https://recruit.hkfew.org.hk/jobs/%e5%85%bc%e8%81%b7%e8%8b%b1%e6%96%87%e7%8f%ad%e5%b0%8e%e5%b8%ab/
5f883789705a5852afe658313101e391,基督教香港信義會屯門青少年綜合服務中心,趙姑娘(社工),24621700,yuenshanchiu@elchk.org.hk,https://recruit.hkfew.org.hk/jobs/%e8%aa%b2%e9%a4%98%e8%a8%97%e7%ae%a1%e5%b0%8e%e5%b8%ab-9/
d2d17bc72431692d2c0269488a3a04ed,梓峰教育(石門),林小姐,36111948,Jessica.lam@dunn.hk,https://recruit.hkfew.org.hk/jobs/%e5%85%a8%e8%81%b7-%e5%85%bc%e8%81%b7%e5%b9%bc%e5%85%92%e5%b0%8e%e5%b8%ab-2/
1a72893a6973f5cf6953436ed3cf3085,香港道教聯合會圓玄幼稚園,招校長,24984636,hktayykg@yuenyuenkg.edu.hk,https://recruit.hkfew.org.hk/jobs/%e5%8d%8a%e6%97%a5%e9%9d%9e%e8%8f%af%e8%aa%9e%e5%ad%b8%e7%ab%a5%e6%94%af%e6%8f%b4%e5%b0%8e%e5%b8%ab-half-day-teacher-supporting-non-chinese-speaking-students-ncs-2/
5ffcf81e59269be9134554fc53bd411e,基督教宣道會華基堂青年中心,黃小姐,25516629,candy@cmawkc.org,https://recruit.hkfew.org.hk/jobs/%e8%8b%b1%e8%aa%9e%e7%8f%ad%e5%b0%8e%e5%b8%ab-%e7%89%b9%e6%ae%8a%e5%ad%b8%e6%a0%a1-2/
81b56988b3923c9116423454acb62204,香港紅十字會雅麗珊郡主學校,劉小姐,23401022,pars@redcross.org.hk,https://recruit.hkfew.org.hk/jobs/%e6%95%b8%e5%ad%b8%e7%a7%91%e8%aa%b2%e5%be%8c%e8%bc%94%e5%b0%8e%e5%b0%8e%e5%b8%ab/
88fae0fc1e84c8ab964bf54214ebf060,香港青少年服務處 賽馬會麗城綜合青少年服務中心,MISS CHAN,24148283,bgit@hkcys.org.hk,https://recruit.hkfew.org.hk/jobs/%e8%aa%b2%e9%a4%98%e8%a8%97%e7%ae%a1%e5%b0%8e%e5%b8%ab-8/
c460ee30a324181c78b82c406328cd5e,兼職導師招聘網,陳小姐,98658294,hkeducationcenter01@gmail.com,https://recruit.hkfew.org.hk/jobs/%e5%85%bc%e8%81%b7%e5%8a%9f%e8%aa%b2%e7%8f%ad%e5%b0%8e%e5%b8%ab-%e6%9f%b4%e7%81%a3-%e6%af%8f%e5%b0%8f%e6%99%8280/
e85947c8f6e4503937b7f02ae90b7b1a,佛教林炳炎紀念學校,吳劍峰先生,24220125,info@blbyms.edu.hk,https://recruit.hkfew.org.hk/jobs/%e5%90%88%e7%b4%84%e6%ad%b7%e5%a5%87%e6%95%99%e7%b7%b4/
c5ba4c7d58420bf8f8fea32db626a13e,展才能通識教育集團,陳小姐,35830137,tutor.gegroup@gmail.com,https://recruit.hkfew.org.hk/jobs/%e8%88%88%e8%b6%a3%e7%8f%ad%e5%b0%8e%e5%b8%ab%e6%95%b8%e5%ad%b8%e9%a1%9e-%e6%b2%99%e7%94%b0%e5%8d%80-%e8%a7%80%e5%a1%98%e5%8d%80/
df600057d041eb02545af8fe8504b96e,明愛賽馬會社區書院-荃灣,陳小姐,36103715,cb.twpa@cice.edu.hk,https://recruit.hkfew.org.hk/jobs/%e4%b8%ad%e5%ad%b8%e8%8b%b1%e6%96%87%e7%8f%ad%e5%b0%8e%e5%b8%ab-%e5%a4%a7%e5%9c%8d/
7000c24e8d48b1b140851ed7c7b09a2c,彩虹邨天主教英文中學,林小姐,23203594,enquiry@choihung.edu.hk,https://recruit.hkfew.org.hk/jobs/%e8%be%af%e8%ab%96%e9%9a%8a%e6%95%99%e7%b7%b4/
656a5b336cb51dcbe1c62081ab0c8ec4,香港數學奧林匹克學校/香港數學學校,梁小姐,25771148,general@hkmos.org,https://recruit.hkfew.org.hk/jobs/%e6%95%b8%e5%ad%b8%e5%b0%8e%e5%b8%ab-3/
73970c7dfe834e844b6f33df6889c02b,金巴崙長老會耀道中學,莊小姐,24730777,info@cpcydss.edu.hk,https://recruit.hkfew.org.hk/jobs/%e8%88%88%e8%b6%a3%e7%8f%ad%e5%b0%8e%e5%b8%ab%e8%8a%b1%e8%97%9d%e5%8f%8a%e9%a3%be%e5%93%81%e8%a3%bd%e4%bd%9c%e3%80%81%e9%ab%ae%e5%9e%8b%e8%a8%ad%e8%a8%88%e3%80%81%e6%94%9d%e5%bd%b1%e5%8f%8a%e5%89%aa/
ba5be385045e9b55f45caeaa4f999d3c,LITTLE BEANS CLASSROOM,Ms Lau,93828701,littlebeansclassroom@gmail.com,https://recruit.hkfew.org.hk/jobs/%e5%89%b5%e6%84%8f%e7%95%ab%e5%ae%a4%e5%8a%a9%e7%90%86-%e5%b0%8e%e5%b8%ab/
b612fa45605314da722387b5b22cb1ea,Children initiation Association Education Centre,湯先生,64435475,Hkcia.edu@gmail.com,https://recruit.hkfew.org.hk/jobs/%e5%85%bc%e8%81%b7%e5%b0%88%e7%a7%91-%e5%8a%9f%e8%aa%b2%e8%bc%94%e5%b0%8e%e7%8f%ad%e5%b0%8e%e5%b8%ab/
d15d7df35cc79443f5bd0512d7bd5841,裘錦秋中學(屯門),校務處李小姐,24611555,mail@jcctm.edu.hk,https://recruit.hkfew.org.hk/jobs/%e5%90%84%e7%a7%91%e6%8b%94%e5%b0%96%e5%8f%8a%e8%a3%9c%e5%ba%95%e7%8f%ad%e5%b0%8e%e5%b8%ab/
a9b59b3f077ab40aac1617301babe91e,順德聯誼總會翁祐中學,姚小姐,31570632,info@stfa-yyc.edu.hk,https://recruit.hkfew.org.hk/jobs/%e5%8c%96%e5%ad%b8%e7%a7%91%e5%b0%8e%e5%b8%ab-3/
69ef30afba489079db2cb2d65b310d8a,Little Master Education Centre,Eve Ching,55331762,littlemasterhongkong@gmail.com,https://recruit.hkfew.org.hk/jobs/%e5%85%a8%e8%81%b7%e6%88%96%e5%85%bc%e8%81%b7%e8%a3%9c%e7%bf%92%e7%8f%ad%e5%8a%a9%e7%90%86-%e5%b0%8e%e5%b8%ab-%e5%9c%9f%e7%93%9c%e7%81%a3%e5%8d%80/
0f90fd0c70831f02d9b5566cefb2f4b7,沙田浸信會,陳小姐,26325000,baptistec@hkstbc.org,https://recruit.hkfew.org.hk/jobs/%e5%85%bc%e8%81%b7%e5%b0%8e%e5%b8%ab-%e6%b8%af%e5%b3%b6%e3%80%81%e4%b9%9d%e9%be%8d%e5%8d%80%e3%80%81%e5%a4%a7%e5%9f%94%e3%80%81%e5%85%83%e6%9c%97%e5%8f%8a%e6%b2%99%e7%94%b0%e5%8d%80/
41e590d135ecba1d6525f003fd539cf1,香港四邑商工總會陳南昌紀念中學,林小姐,27410326,info@cnc.edu.hk,https://recruit.hkfew.org.hk/jobs/%e4%b8%ad%e6%96%87%e7%a7%91%e9%ab%98%e4%b8%ad%e5%af%ab%e4%bd%9c%e5%b0%8e%e5%b8%ab-2/
bbe960de5e8d1f564ebfc99c8d978466,iMusic Arts Gallery,Wong,96580812,cs@imusicarts.com.hk,https://recruit.hkfew.org.hk/jobs/%e7%b9%aa%e7%95%ab%e8%a6%96%e8%97%9d%e5%b0%8e%e5%b8%ab-2/
af3ba3c1ca1df2ff74f642384af6a419,匯萃小學士教育中心,Miss Chan,55117628,schoolrecruit201702@gmail.com,https://recruit.hkfew.org.hk/jobs/%e5%85%a8%e8%81%b7%e5%b0%8f%e5%ad%b8%e5%b0%8e%e5%b8%ab-2/
8f6e95188093423d915b82994bbb83fe,EVI Services Limited,Mr. Choi,35890840,career@evi.com.hk,https://recruit.hkfew.org.hk/jobs/part-time-stem-course-tutor/
0462529c2a5db80fee4f666a853cd6b2,Easey Add Education Centre,Ms Chong,27940850,maggiechong97@gmail.com,https://recruit.hkfew.org.hk/jobs/%e8%81%98biology-economics-bafs-%e5%b0%8e%e5%b8%ab/
2b36fa8d30440b794e023f7f060bca79,心愛人事顧問,yan,63834168,sales@iproactive.com.hk,https://recruit.hkfew.org.hk/jobs/art-tutor/
82aa2b79527a756a90d3b0fd2129d3d3,佛教沈香林紀念中學,林麗麗,24377004,info@bsc.edu.hk,https://recruit.hkfew.org.hk/jobs/dse%e6%8b%94%e5%b0%96%e8%a3%9c%e7%bf%92%e7%8f%ad%e6%95%99%e5%b8%ab%ef%bc%88%e6%95%b8%e5%ad%b8%e7%a7%91-%e5%9c%b0%e7%90%86%e7%a7%91-%e7%94%9f%e7%89%a9%e7%a7%91%ef%bc%89/
788bb7bc0d46ea14bf8ccb8b38677fa0,Greenway Education Centre,馬主任,55230378,greenwaytlb@gmail.com,https://recruit.hkfew.org.hk/jobs/%e6%95%99%e8%82%b2%e4%b8%ad%e5%bf%83%e6%96%87%e5%93%a1%e5%8f%8a%e5%b0%8e%e5%b8%ab/
302b6cf1bf66ef698325d268779ba448,新聰穎教育中心 Talent Development Training Centre Limited,麥主任 Mrs. Mak,93580856,fionamak_1000@yahoo.com.hk,https://recruit.hkfew.org.hk/jobs/%e5%85%bc%e8%81%b7%e8%a3%9c%e7%bf%92%e8%80%81%e5%b8%ab-2/
775e8e3a58a025c341942312c3f88904,啟航教育中心,Miss Lam,56427706(whatsapp),hksailingadventure@gmail.com,https://recruit.hkfew.org.hk/jobs/%e5%88%b0%e6%a0%a1%e6%97%a5%e8%aa%9e%e5%b0%8e%e5%b8%ab/
16340241401411a36eaa88da21841047,One Plus One Educational Centre,Miss Lau,22468139,wts@1plus1edu.com,https://recruit.hkfew.org.hk/jobs/%e5%85%bc%e8%81%b7%e4%b8%ad%e5%ad%b8%e5%8a%9f%e8%aa%b2%e8%bc%94%e5%b0%8e%e5%b0%8e%e5%b8%ab-%e5%bd%a9%e8%99%b9-2/
f6b9a59c7f8f2571d76c4540e4fa9388,大衆教室(薈學坊) 有限公司,吳先生,57230080,plcsmarta3c@gmail.com,https://recruit.hkfew.org.hk/jobs/%e5%85%a8%e8%81%b7%e5%b0%8e%e5%b8%ab-%e4%b8%ad%e6%96%87%e3%80%81%e8%8b%b1%e6%96%87%e3%80%81%e6%95%b8%e5%ad%b8/
b9e85a71da493723a51e44a431f9eaac,東華三院馬振玉紀念中學,陳銘勤,24439833,chanmingkan@cyma.edu.hk,https://recruit.hkfew.org.hk/jobs/%e7%b1%83%e7%90%83%e9%9a%8a%e6%95%99%e7%b7%b4-2/
6edd2b05bd4473a07f064d13390c11ab,救世軍,人力資源部,27832366,hrd.recruit@hkm.salvationarmy.org,https://recruit.hkfew.org.hk/jobs/%e5%85%bc%e8%81%b7%e5%b0%8e%e5%b8%ab-%e5%a4%a7%e5%9d%91%e6%9d%b1%e9%9a%8a%e6%95%99%e6%9c%83-%e5%b7%a5%e4%bd%9c%e5%8f%83%e8%80%83%e7%b7%a8%e8%99%9f-ptt-thtc-05-22/
03222135e5babfe9dd70902f69333ea1,鄰舍輔導會 賽馬會天水圍綜合服務中心,嚴姑娘,26178816,tssc@naac.org.hk,https://recruit.hkfew.org.hk/jobs/%e5%85%bc%e8%81%b7%e5%b0%8e%e5%b8%ab-9/
54eee4216edbeea09086d4b742b1b044,皇仁舊生會中學,黃小姐,24975688,info@qcobass.edu.hk,https://recruit.hkfew.org.hk/jobs/english-classes-tutors/
4542a8f1d5ef8b6e6370804ac2224745,香港中華基督教青年會顯徑會所,莊季陶,92191989,ktchong@ymca.org.hk,https://recruit.hkfew.org.hk/jobs/%e5%8a%9f%e8%bc%94%e7%8f%ad%e5%b0%8e%e5%b8%ab-4/
eba3222dcb794a25112287b0a9817b3b,THE BLUE GALLERY (CWB)LIMITED,PAULA LO,96277997,info@xiaoyanschoolofart.com.hk,https://recruit.hkfew.org.hk/jobs/%e3%80%90%e7%95%ab%e7%8f%ad%e5%b0%8e%e5%b8%ab%e3%80%91full-time/
18db57ea532385a3c31bee354f8f93cd,培星園教育中心,Sylvia Lo,60798428,stargardeneducation@gmail.com,https://recruit.hkfew.org.hk/jobs/%e6%95%99%e5%b8%ab-%e5%b0%8e%e5%b8%ab/
e60e104f90e01c21d72fa95852457b5a,新家園協會賽馬會港島東服務中心,黎姑娘,28072188,hr.hkisc@gmail.com,https://recruit.hkfew.org.hk/jobs/%e4%b8%ad%e6%96%87%e6%8f%90%e5%8d%87%e7%8f%ad%e5%b0%8e%e5%b8%ab%e5%88%9d%e4%b8%ad/
5a41df96d82a352182b3da853bfff081,Seasons Music Studio,Mr. So,93003391,seasonsmusicstudio@gmail.com,https://recruit.hkfew.org.hk/jobs/%e5%85%a8%e8%81%b7%e5%8f%8a%e5%85%bc%e8%81%b7%e9%9f%b3%e6%a8%82%e5%b0%8e%e5%b8%ab/
856cb7c8cac5a4506c4fa9d459d9f5c1,My Gym Children's Fitness Center(TST),Ms Lam,23348334,mygymhk@outlook.com,https://recruit.hkfew.org.hk/jobs/playgroup-lead-teacher-full-time/
387aaed2c8afbfe89bcea9be063e43c8,Bright English Education Centre (Shek Mun),Frankie Cheung,92316114,bright.edu.hr@gmail.com,https://recruit.hkfew.org.hk/jobs/full-time-english-phonics-teacher-shatin-shau-kei-wan-5-mins-walk-to-mtr-station/
fbe1c75f20a5fa8786c3aa54fd985710,大衆教室(佐敦恒豐中心分校),李小姐,91462842,sinotrend13@gmail.com,https://recruit.hkfew.org.hk/jobs/%e5%b0%8f%e5%ad%b8%e5%b0%8e%e5%b8%ab/
60eb06db550897ef067f1f0acc072cac,SMALL KIDS BIG ART CENTER,MISS CHUNG,67084616,smallkidsbigarthk@gmail.com,https://recruit.hkfew.org.hk/jobs/part-time-art-teacher-part-time-english-teacher/
dc671ec36871e7bd43f580078933b3ea,聖雅各福群會 延續教育中心,Daphne Suen,28313268,daphne.suen@sjs.org.hk,https://recruit.hkfew.org.hk/jobs/%e5%b0%8f%e5%ad%b8-%e4%b8%ad%e6%96%87-%e8%8b%b1%e6%96%87-%e6%95%b8%e5%ad%b8-%e5%b0%88%e7%a7%91%e7%8f%ad%e5%b0%8e%e5%b8%ab%e7%b6%b2%e8%aa%b2%e5%b0%8e%e5%b8%ab-%e5%85%bc%e8%81%b7-%e6%95%99/
962854f5db9735a160fb6052124804e0,小豆苗教育中心,柳小姐,26489059,info@seedling-edu.com,https://recruit.hkfew.org.hk/jobs/s4574-%e5%b0%87%e8%bb%8d%e6%be%b3%e5%8d%80%e5%88%b0%e6%a0%a1%e4%b8%ad%e5%ad%b8%e5%a5%a7%e6%95%b8%e8%aa%b2%e7%a8%8b/
c7e85ab3bac0eef812f3fb5f31f8d153,/,Mr. Chan / Ms. Wong,97914544,popularlearningskw@gmail.com,https://recruit.hkfew.org.hk/jobs/%e6%95%99%e5%ae%a4%e5%b0%8e%e5%b8%ab-%e4%b8%ad%e6%96%87-centre-tutor-chinese-%e5%85%bc%e8%81%b7-part-time-%e5%85%a8%e8%81%b7-full-time-2/
9e83918f433532154fcc56e2cfa94e53,卓峰優越教育中心,Mr Lam,93173553,recruitment@apex.edu.hk,https://recruit.hkfew.org.hk/jobs/%e5%85%a8%e8%81%b7%e8%a3%9c%e7%bf%92%e8%80%81%e5%b8%ab-phy-chem-bio-math/
9672089796bdbbcf8a40a8f98e37af8a,Loving Kids Community Service Co. Limited,周姑娘,21173675,iona.chow@lovingkids.org.hk,https://recruit.hkfew.org.hk/jobs/%e5%85%bc%e8%81%b7%e5%8a%9f%e8%aa%b2%e8%bc%94%e5%b0%8e%e5%b0%8e%e5%b8%ab-2/
e346504fef33fcb8dd1a6807aaca1904,鳳溪第一中學,馬小姐,26700366,fk1ss@fk1ss.edu.hk,https://recruit.hkfew.org.hk/jobs/%e5%88%9d%e4%b8%ad%e8%aa%b2%e5%be%8c%e5%8a%9f%e8%aa%b2%e8%bc%94%e5%b0%8e%e7%8f%ad%e5%b0%8e%e5%b8%ab%e4%b8%bb%e7%a7%91/
0a4e1afe892fdc86126fe96cd4952a13,聖公會林裘謀中學,郭小姐,26488222,skhlkmss@skhlkmss.edu.hk,https://recruit.hkfew.org.hk/jobs/coaches-for-english-public-speaking-solo-verse-speaking/
e1c0fbec58d9917cc79b5ec9781748cd,香港布廠商會朱石麟中學,林小姐,27968323,lamwf@chusheklun.edu.hk,https://recruit.hkfew.org.hk/jobs/%e6%88%b2%e5%8a%87%e7%8f%ad%e5%85%bc%e8%81%b7%e5%b0%8e%e5%b8%ab/
cad62a61f3ebcbd1891b0f46487e41a9,Bishop Hall Jubilee School,Ms. Wong,23363034,hr@bhjs.edu.hk,https://recruit.hkfew.org.hk/jobs/tutors-for-enhancement-classes-after-school-classes-saturday-remedial-classes/
f2828f36f2d1c927f12290d90cc33aad,天主教聖華學校,何敏淇老師,26924593,hmk@littleflowerschool.edu.hk,https://recruit.hkfew.org.hk/jobs/%e5%b0%8f%e5%ad%b8%e5%90%88%e5%94%b1%e5%9c%98%e5%b0%8e%e5%b8%ab/
67ff0c0e94a71576b0e36cf70db27d65,Tak Sun Secondary School,Mr Mervyn Lam,23174339,hrd@tsss.edu.hk,https://recruit.hkfew.org.hk/jobs/coaches-and-course-tutors-service-agreement-based-4/
ea4cd23f27b8b85c6834d2412c1617a5,石籬天主教中學,黃小姐,24291221,email@slc.edu.hk,https://recruit.hkfew.org.hk/jobs/%e8%aa%b2%e5%be%8c%e6%94%af%e6%8f%b4%e7%8f%ad%e5%b0%8e%e5%b8%ab-2/
26cdf8524b7da56baaa3a997960523dd,大衆教室(田心村),Ms Li,67759354,populartaiwai@gmail.com,https://recruit.hkfew.org.hk/jobs/%e4%b8%ad%e6%96%87-%e8%8b%b1%e6%96%87%e7%a7%91%e5%b0%8e%e5%b8%ab%ef%bc%88%e5%85%a8%e8%81%b7-%e5%85%bc%e8%81%b7%ef%bc%89/
cb3a089e2749147ba3d5238b3feee32d,藍田街坊福利會,盧承依女士,27723163,hongyingkinder@gmail.com,https://recruit.hkfew.org.hk/jobs/%e5%85%bc%e8%81%b7%e8%aa%b2%e9%a4%98%e8%a8%97%e7%ae%a1%e5%b0%8e%e5%b8%ab-12/
485419704600e9be2474e8e066169523,大衆教室(田心村),Fanny Li,67759354,yffanny@gmail.com,https://recruit.hkfew.org.hk/jobs/%e4%b8%ad%e6%96%87%e5%8f%8a%e8%8b%b1%e6%96%87%e7%a7%91%e5%b0%8e%e5%b8%ab/
2bf9958366c1f035db11196f67dae5ad,小月亮創作室,邱小姐,68781132,littlemoonart@gmail.com,https://recruit.hkfew.org.hk/jobs/%e5%85%a8%e8%81%b7%e7%95%ab%e7%8f%ad%e5%b0%8e%e5%b8%ab-2/
e8cb6f23c95d33af50424ef0f1b45822,薈晉教育中心,張小姐,31532697,eduirradiate@gmail.com,https://recruit.hkfew.org.hk/jobs/%e6%95%99%e8%82%b2%e4%b8%ad%e5%bf%83%e8%a1%8c%e6%94%bf%e4%b8%bb%e4%bb%bb%ef%bc%88%e5%85%bc%e8%a3%9c%e7%bf%92%e5%b0%8e%e5%b8%ab%ef%bc%89/
239e3f8624738c9847de480648795377,豆豆導師招聘網,吳小姐,67480761,hihimoon@yahoo.com.hk,https://recruit.hkfew.org.hk/jobs/%e5%a4%a7%e9%87%8f%e6%8b%9b%e8%81%98%e5%85%bc%e8%81%b7%e5%b0%8e%e5%b8%ab/
5833029306ca819352a0113a94c27b80,Eye Level Little Scholar Education Centre,Centre Manager,21857205,enquiry-enopi@hotmail.com.hk,https://recruit.hkfew.org.hk/jobs/full-time-mathematics-senior-mathematics-teacher/
26b0adc9bd370fcd3d653350efbf4c7b,天主教新民書院,羅小姐,23857812,ncc@newman.edu.hk,https://recruit.hkfew.org.hk/jobs/%e6%8e%92%e7%90%83%e9%9a%8a%e6%95%99%e7%b7%b4-2/
7ec9e7ee06629c8463974b984cc96607,小童星訓練學院,林小姐,93649364,smallmo@momocastingtalentschool.com,https://recruit.hkfew.org.hk/jobs/%e5%85%a8%e8%81%b7%e8%80%81%e5%b8%ab%ef%bc%8f%e5%b0%8e%e5%b8%ab%ef%bc%88%e6%8f%90%e5%8d%87%e5%ad%a9%e5%ad%90%e8%87%aa%e4%bf%a1%e5%bf%83%e7%9a%84%e8%aa%b2%e7%a8%8b%ef%bc%89-2/
84ca8a51b9b4d97fdf4c560c3ca3a82a,Topswood Education Centre,Vincent Chan,54076614,Topschan16@gmail.com,https://recruit.hkfew.org.hk/jobs/%e5%b0%8f%e5%ad%b8%e8%a3%9c%e7%bf%92%e5%b0%8e%e5%b8%ab-%e9%9d%92%e8%a1%a3-%e5%85%a8%e8%81%b7-%e5%85%bc%e8%81%b7/
6d7b0835782480cd8fffd43a6b9e39f2,大眾教室(將軍澳廣場),蘇太,94044044,seededucation2020@gmail.com,https://recruit.hkfew.org.hk/jobs/%e5%85%bc%e8%81%b7%e8%8b%b1%e6%96%87%e7%a7%91%e5%b0%8e%e5%b8%ab/
36e1ebfeef577b5b3f08d36990968f25,棉紡會中學,區小姐,24220028,csa@csa.edu.hk,https://recruit.hkfew.org.hk/jobs/%e8%aa%b2%e5%be%8c%e5%8a%9f%e8%bc%94%e7%8f%ad%e5%b0%8e%e5%b8%ab/
3fa22a56b4d7a4f7b375c57a854d8ad9,香港基督少年軍,Sarah Chan,24456722,stedfast_house@bbhk.org.hk,https://recruit.hkfew.org.hk/jobs/%e7%8f%ad%e7%b5%84%e5%b0%8e%e5%b8%ab-%e5%8d%80%e6%9c%ac%e8%a8%88%e5%8a%83/
cea48f8fa50e9aef75caa36dee7b0180,嶺南中學,袁小姐,28916966,recruit@lingnan.edu.hk,https://recruit.hkfew.org.hk/jobs/%e5%90%84%e7%a7%91%e8%aa%b2%e5%be%8c%e6%94%af%e6%8f%b4%e5%b0%8e%e5%b8%ab-%e5%85%bc%e8%81%b7/
4f151695ead81663e33cb5563a1279d8,樂善堂顧超文中學,陳小姐,24295171,email@lstkcmss.edu.hk,https://recruit.hkfew.org.hk/jobs/%e5%90%88%e7%b4%84%e8%be%af%e8%ab%96%e9%9a%8a%e5%b0%8e%e5%b8%ab/
e498c87f5ed6ec914effe6a0c7044c7a,Wah Yan College Hong Kong,Ms Mok,25722251,human_resources@wahyan.edu.hk,https://recruit.hkfew.org.hk/jobs/part-time-tutors-various-subjects/
5d70141a463d2378d3f48cabcdbb57cd,晉斯琴行 AMA Music Centre,朱小姐,55050322,amamusiccentre@gmail.com,https://recruit.hkfew.org.hk/jobs/%e6%a8%82%e5%99%a8%e5%b0%8e%e5%b8%ab-2/
b37b35515bb71948df91187b99ed0804,保良局錦泰小學,潘小姐,23262886,plkgpsrecruit@gmail.com,https://recruit.hkfew.org.hk/jobs/%e6%95%99%e5%ad%b8%e5%8a%a9%e7%90%86%e5%85%bc%e8%aa%b2%e5%be%8c%e5%8a%9f%e8%bc%94%e7%8f%ad%e5%b0%8e%e5%b8%ab%e5%90%88%e7%b4%84-3/
efd7e570bf18a4372141f8dae0ecbf88,明愛樂恩學校,柳小姐,23100440,info@cmts.edu.hk,https://recruit.hkfew.org.hk/jobs/%e4%b8%ad%e5%9c%8b%e8%88%9e%e5%b0%8e%e5%b8%ab-2/
544565ce720812bbf2603187f57915ac,研樂補習學校(葵星中心),Mr Martin Tong,93840216,martintong0914@gmail.com,https://recruit.hkfew.org.hk/jobs/%e5%85%a8%e8%81%b7%e5%8a%9f%e8%aa%b2%e8%bc%94%e5%b0%8e%e7%8f%ad%e5%b0%8e%e5%b8%ab-2/
b78828aa08370b170627540febca716c,青年專業書院 YMCA College of Careers,Maria Wong,27833513,sfwong@ymca.org.hk,https://recruit.hkfew.org.hk/jobs/adobe-illustrator-photoshop-and-indesign%e6%97%a5%e9%96%93-%e5%a4%9c%e9%96%93%e5%85%bc%e8%81%b7%e5%b0%8e%e5%b8%ab-pt-tutor_da/
b147f3ff959ea6eecbec6f9b53e35d55,基督教宣道會華基堂青年中心,張姑娘,25380644,cheunghy@cmawkc.org,https://recruit.hkfew.org.hk/jobs/%e8%8a%b1%e5%bc%8f%e8%b7%b3%e7%b9%a9%e7%8f%ad%e5%b0%8e%e5%b8%ab/
878ede16544e419178ca31b1183bf2a8,香港教育工作者聯會黃楚標中學,陳小姐,21094005,contact@wcbss.edu.hk,https://recruit.hkfew.org.hk/jobs/%e5%85%bc%e8%81%b7%e5%b9%b3%e6%9d%bf%e9%9b%bb%e8%85%a6%e9%9b%bb%e7%b9%aa%e7%8f%ad%e5%b0%8e%e5%b8%ab/
c4861bebdee597b7a6febdcf5f29ccd1,救恩書院,黃小姐,26608308,recruit@kyc.edu.hk,https://recruit.hkfew.org.hk/jobs/%e6%a0%a1%e5%a4%96%e6%95%99%e8%82%b2%e6%9c%8d%e5%8b%99%e5%b0%8e%e5%b8%ab/
26fa13b0c6bf56c66375062fa0b0b8fb,循道衛理楊震社會服務處 何文田青少年綜合發展中心,區本陳姑娘,27181330,heidychan@yang.org.hk,https://recruit.hkfew.org.hk/jobs/%e8%a8%98%e6%86%b6%e5%8a%9b%e5%b0%8e%e5%b8%ab%ef%bc%88%e8%81%b7%e4%bd%8d%e7%b7%a8%e8%99%9f%ef%bc%9ahic-cbp-m%ef%bc%89/
860d23df7e5aea44d4459354f10fd9e3,聖雅各福群會 樂寧兒童發展中心,劉姑娘,25962500,heidi_lau@sjs.org.hk,https://recruit.hkfew.org.hk/jobs/%e5%90%84%e9%a1%9esen%e5%85%a5%e6%a0%a1%e5%b0%8e%e5%b8%ab-%e7%b6%b2%e4%b8%8a%e8%aa%b2%e5%b0%8e%e5%b8%ab/
8640d37ef7c69d8095026393e338a858,嘉言教育機構,Venus Lo,35654432,Arts@greenville.edu.hk,https://recruit.hkfew.org.hk/jobs/%e8%aa%b2%e5%be%8c%e8%88%88%e8%b6%a3%e7%8f%ad%e5%b0%8e%e5%b8%ab/
6af0a5651c86ce0b0be01769ac9c0886,思諾教室(大埔),林小姐,34856905,silokrecruit@gmail.com,https://recruit.hkfew.org.hk/jobs/part-time-tutor-2/
99d3865e85cecd924c38fb3499a5c5f2,基督教女青年會丘佐榮中學,行政主任李小姐,27117159,info@htyc.edu.hk,https://recruit.hkfew.org.hk/jobs/activity-coaches-and-tutors/
b9fc46c5eb83e739d8cd3591f78de4a5,香港宣教會粉嶺家庭中心,陳先生,26764010,gordon_chan@hkecffc.org.hk,https://recruit.hkfew.org.hk/jobs/%e5%b9%bc%e5%85%92%e8%b7%86%e6%8b%b3%e9%81%93%e7%8f%ad%e5%b0%8e%e5%b8%ab/
8889ff38955c6aaccbba9cf4dfc128ff,Oxfam Hong Kong,Ida Wong,25202525,hr@oxfam.org.hk,https://recruit.hkfew.org.hk/jobs/course-instructor-one-year-consultancy-contract-2/
0412f27217985d340d36a6c56dae9fd9,佛教孔仙洲紀念中學,溫老師,23226915,mail@bhscmc.edu.hk,https://recruit.hkfew.org.hk/jobs/%e5%85%bc%e8%81%b7%e7%84%a1%e4%bc%b4%e5%a5%8f%e5%b0%8e%e5%b8%ab/
0418b566215f96b3d18ce605e17ab0dc,Sacred Heart Canossian College,Ivy Ng,25506111,office@ecampus.shcc.edu.hk,https://recruit.hkfew.org.hk/jobs/english-language-tutorials-teacher/
8012b277ce9da87309dd24d3ebbc814a,Steamlabo Education Centre,China Chung,98210908,hr@steamlabo.hk,https://recruit.hkfew.org.hk/jobs/tseung-kwan-o-full-time-teacher-kindergarten-to-junior-school/
0f6c5768885d2d98f1a10d100a831bd5,Pharos Tutorial Centre,Ms Ng,96300998,donnanwl.dn@gmail.com,https://recruit.hkfew.org.hk/jobs/%e8%a3%9c%e7%bf%92%e5%b0%8e%e5%b8%ab-4/
040ff6817ae85dc79854a32eb587ba80,保良局方王錦全小學,麥小姐,24661882,general@eclass.plkfwkc.edu.hk,https://recruit.hkfew.org.hk/jobs/%e4%b8%ad%e5%9c%8b%e7%95%ab%e5%b0%8e%e5%b8%ab-2/
cde64acdc1aa2644455aa042405a30b7,路德會新翠少年中心,傅生,26912102,chorfung.fu@hklss.hk,https://recruit.hkfew.org.hk/jobs/%e8%aa%b2%e9%a4%98%e8%a8%97%e7%ae%a1%e5%b0%8e%e5%b8%ab-7/
496861be711f982641d4ecdd65ba85b0,Thrive 1+國際兒童邏輯思維遊戲互動學習中心,顧老師,69902616,nine@thrivehaba.com,https://recruit.hkfew.org.hk/jobs/%e5%85%a8%e8%81%b7-%e5%85%bc%e8%81%b7%e4%b8%ad%e5%bf%83%e5%8a%a9%e7%90%86/
8a20ebe64b5e0179d08434062bd246c9,香港道教聯合會青松中學,余小姐,27274315,ccn-c30@ccss.edu.hk,https://recruit.hkfew.org.hk/jobs/%e6%8f%90%e4%be%9b%e3%80%8c%e4%b8%ad%e4%b8%80%e7%b4%9a%e5%8a%9f%e8%aa%b2%e8%bc%94%e5%b0%8e%e7%8f%ad%e5%b0%8e%e5%b8%ab%e3%80%8d%e6%9c%8d%e5%8b%99/
153c72f628da3da41d4bb2ad9055177c,一沂博學教室,Ms Leung,61178526,yieducation21@yahoo.com,https://recruit.hkfew.org.hk/jobs/%e8%aa%a0%e5%be%b5%e5%85%bc%e8%81%b7%e5%8a%a9%e6%95%99%e5%b0%8e%e5%b8%ab-4/
af62f599409b24d75fa8f4c3f32ca375,/,陳小姐,26328953,baptistec@hkstbc.org,https://recruit.hkfew.org.hk/jobs/%e5%85%bc%e8%81%b7%e5%b0%8e%e5%b8%ab-8/
e975c2945a9be68bf61d2959ad8f2478,Stem & English,莊先生,65648596,admin@stem100.com.hk,https://recruit.hkfew.org.hk/jobs/%e5%85%a8%e8%81%b7-%e5%8d%8a%e8%81%b7-%e5%85%bc%e8%81%b7%e5%b0%8e%e5%b8%ab-2/
2fb6f6188306f063de767c0300a85622,聖雅各福群會 延續教育中心,Gin Keung,28313268,gin.keung@sjs.org.hk,https://recruit.hkfew.org.hk/jobs/%e5%8a%9f%e8%aa%b2%e8%bc%94%e5%b0%8e%e7%8f%ad%e5%b0%8e%e5%b8%ab-7/
c4daf65dd7e7dd61a1cb1d8cccd5fb5f,東華三院馬振玉紀念中學,呂君豪老師,24439833,luikwanho@cyma.edu.hk,https://recruit.hkfew.org.hk/jobs/%e6%94%80%e6%a8%b9%e5%8f%8a%e6%ad%b7%e5%a5%87%e5%b0%8e%e5%b8%ab/
800e29f0f7d0cfbc08c3005dad2a6fef,慈幼英文學校,葉小姐,28843581,admin@ssshk.edu.hk,https://recruit.hkfew.org.hk/jobs/%e4%b8%ad%e6%96%87%e7%a7%91%e5%b0%8e%e5%b8%ab-%e5%85%a8%e5%b9%b4%e7%89%b9%e5%ae%9a%e6%97%a5%e5%ad%90-2/
fb0cdaba6c78336ba8893174ab2b4de2,佛教黃焯菴小學,劉小姐,25762638,cua_mail@yahoo.com.hk,https://recruit.hkfew.org.hk/jobs/%e8%aa%b2%e5%be%8c%e8%bc%94%e5%b0%8e%e8%80%81%e5%b8%ab-%e5%85%bc%e8%81%b7/
475e86a16abd1ebe5edbfe11514c6929,藍田街坊褔利會,盧先生,27753101,dennislsc@gmail.com,https://recruit.hkfew.org.hk/jobs/%e8%a8%97%e7%ae%a1%e5%b0%8e%e5%b8%ab-2/
7c9096ccdbd4eefb89292ba566962950,佛教茂峰法師紀念中學,Ms Anne HUNG,24457171,bmf-mail@bmf.edu.hk,https://recruit.hkfew.org.hk/jobs/%e6%99%ae%e9%80%9a%e8%a9%b1%e6%9c%97%e8%aa%a6%e5%b0%8e%e5%b8%ab/
8ee80944c1d64129e2948f30c8a48b09,東華三院馬振玉紀念中學,謝爾溱老師,24439833,tseyitsun@cyma.edu.hk,https://recruit.hkfew.org.hk/jobs/%e5%8f%a4%e7%ae%8f%e7%8f%ad%e5%b0%8e%e5%b8%ab1%e5%90%8d/
14c9a61869fbdec23d3468c5c73ac654,同學坊教育中心(旺角),MS Winni Tong,27826922,mongkok@edfun.com.hk,https://recruit.hkfew.org.hk/jobs/%e6%95%b8%e5%ad%b8%e7%8f%ad%e5%b0%8e%e5%b8%ab/
cb21d7dbce3b53837237c99e2dfa76c1,HeSheLearn 網上教學平臺,何先生,94450283,victor@heshelearn.com,https://recruit.hkfew.org.hk/jobs/%e3%80%90%e5%85%bc%e8%81%b7-%e5%85%a8%e8%81%b7%e3%80%91%e5%b0%8f%e5%ad%b8-%e4%b8%ad%e5%ad%b8%e8%a3%9c%e7%bf%92%e7%b7%9a%e4%b8%8a%e5%b0%8e%e5%b8%ab/
8b1d6948640b5ab5ac65c611791c5ba3,Smart Coaching Service,Ben Yim,60507054,smartcshk@yahoo.com.hk,https://recruit.hkfew.org.hk/jobs/%e5%b0%8f%e5%ad%b8%e5%8a%9f%e8%aa%b2%e8%bc%94%e5%b0%8e%e5%b0%8e%e5%b8%ab/
797e1ff8dac9dfbd739a0537e3c6652c,啟教,Miss Tsang,52794773,Inspireducationhk@gmail.com,https://recruit.hkfew.org.hk/jobs/%e5%85%bc%e8%81%b7%e5%b0%8f%e5%ad%b8%e5%8a%9f%e8%aa%b2%e8%bc%94%e5%b0%8e%e7%8f%ad-%e5%b0%88%e7%a7%91%e8%80%81%e5%b8%ab/
d7cc0930e185c319b58f7abda4f7d6b2,小天地中心,方小姐,98679638,fongricky84@yahoo.com.hk,https://recruit.hkfew.org.hk/jobs/%e8%a3%9c%e7%bf%92%e8%80%81%e5%b8%ab/
1413255756fcf084bc978d8f092c489c,Casual Aace Learning Centre,Manson Kwok,56693000,casualace.lc@gmail.com,https://recruit.hkfew.org.hk/jobs/%e5%b0%8f%e5%ad%b8%e5%8a%9f%e8%aa%b2%e5%b0%88%e7%a7%91%e5%b0%8e%e5%b8%ab/
f06e10c4c7c28d1398371fb7d72ed76f,嘉諾撒聖方濟各書院,Ms. Chan,25872700,recruit@mail.sfcc.edu.hk,https://recruit.hkfew.org.hk/jobs/ole-music-tutor-part-time/
2b7857691c3b0dc53a9aa9f9e18eea4c,Good Hope School,Ms. Sonia Wong,23210250(ext.22),recruitment@ghs.edu.hk,https://recruit.hkfew.org.hk/jobs/athletics-sprinting-hurdling-coach-2/
c59ba9b980ed46641f9cdbdd1132fe19,地利亞修女紀念學校(吉利徑),Ms. FU Ka Yan,27415239,recruitment@dmsgp.edu.hk,https://recruit.hkfew.org.hk/jobs/part-time-tutorial-tutors-and-coaches-of-various-activities/
2daab7cfa0e02ee067065c5b2ee9609d,驕陽教育中心 Jiao Yang Education Centre,Miss Chan,23218487,jyrecruit@yahoo.com.hk,https://recruit.hkfew.org.hk/jobs/%e4%b8%ad%e5%b0%8f%e5%ad%b8%e5%85%a8%e8%81%b7-%e5%85%bc%e8%81%b7%e8%a3%9c%e7%bf%92%e5%b0%8e%e5%b8%ab-full-time-tutor-part-time-tutor/
591fe032128558b8f97a19ee79acfcd0,英藝小學,梁小姐,26633311,zenithhr@zenith.edu.hk,https://recruit.hkfew.org.hk/jobs/%e6%95%b8%e5%ad%b8%e6%95%99%e5%b8%ab-2/
db305c3f36a7d522108539d0249b177b,才藝教育Talent Education,Ms Cheng,54060584,talentedu.hk.tw@gmail.com,https://recruit.hkfew.org.hk/jobs/%e5%85%bc%e8%81%b7%e5%b0%8f%e5%ad%b8%e5%8a%9f%e8%aa%b2%e8%bc%94%e5%b0%8e%e7%8f%ad%e8%80%81%e5%b8%ab-%e5%b0%88%e7%a7%91%e8%a3%9c%e7%bf%92%e8%80%81%e5%b8%ab/
f19efbe4eff41abd964f9e2df96f439f,Popular Learning Center (Lai Chi Kok),Helen Lau,98073009fax,popularlearning.kt@gmail.com,https://recruit.hkfew.org.hk/jobs/%e5%85%a8%e8%81%b7-%e5%85%bc%e8%81%b7%e6%95%99%e5%ae%a4%e5%b0%8e%e5%b8%ab-%e4%b8%ad%e6%96%87-%e8%8b%b1%e6%96%87%ef%bc%89/
f5d75503f2708089b3343dc0623447f7,藝柏琴行,梁小姐,27560712,puiyee.l@yahoo.com,https://recruit.hkfew.org.hk/jobs/%e5%b9%bc%e5%85%92%e8%8b%b1%e8%aa%9e%e6%8b%bc%e9%9f%b3%e5%b0%8e%e5%b8%ab/
563b2793093e95642fb563081fcd9d58,上水宣道小學,蕭小姐,26702257,recruit@apsss.edu.hk,https://recruit.hkfew.org.hk/jobs/%e5%8a%9f%e8%aa%b2%e8%bc%94%e5%b0%8e%e7%8f%ad%e5%b0%8e%e5%b8%ab-6/
3d14124671c94b2c4049618cb11b3021,嘉諾撒培德書院,黎小姐,25540780,ptcc@ptcc.edu.hk,https://recruit.hkfew.org.hk/jobs/%e8%8b%b1%e6%96%87%e7%a7%91%e8%bc%94%e5%b0%8e%e7%8f%ad%e5%b0%8e%e5%b8%ab-%e6%98%9f%e6%9c%9f%e5%85%ad-english-language-tutor-saturday-2022-2023/
8cc6ee79d035cdc76e4e4bb04db9a39d,腦潛能教育有限公司,林小姐,97573889,ylbrainpower@gmail.com,https://recruit.hkfew.org.hk/jobs/%e5%b9%bc%e5%85%92%e5%b0%8e%e5%b8%ab-17/
7c3c3978684ed9d4d65951d3f47539b9,JL Music Academy,李小姐,63909108,missli_pianomusic@yahoo.com.hk,https://recruit.hkfew.org.hk/jobs/%e6%a8%82%e5%99%a8%e5%b0%8e%e5%b8%ab/
056ecd2c704f1b2a0dc427a8026fc17b,倫敦卓越書院 (沙田),Mr. CHENG,23656093,examsinfo@excellondoncollege.edu.hk,https://recruit.hkfew.org.hk/jobs/%e7%89%a9%e7%90%86%e5%b0%8e%e5%b8%ab/
6ad8efa2ce13626ad954dc43a817e483,Popular Learning (Tai Po) Limited 大眾教室(大埔),Miss Wong,98338348,popularlearningtp@gmail.com,https://recruit.hkfew.org.hk/jobs/%e4%b8%ad%e6%96%87%e5%b0%88%e7%a7%91%e5%b0%8e%e5%b8%ab-%e5%85%a8%e8%81%b7-%e5%85%bc%e8%81%b7/
20bb5664f05aa04cc5ad210071714125,/,薛校長,27707776,jphkghr@gmail.com,https://recruit.hkfew.org.hk/jobs/%e4%b8%ad%e6%96%87%e5%b0%8e%e5%b8%ab-4/
7089392094e3577958cee70897348c98,長沙灣天主教英文中學,李先生,27415034,contact@cswcss.edu.hk,https://recruit.hkfew.org.hk/jobs/flute-class-tutor/
ed3747f76ed7c8dda4184b5355e1c3bf,Indigo Kids,Miss Lo,57025777,indigo_kids.adm@hotmail.com,https://recruit.hkfew.org.hk/jobs/%e5%85%a8%e8%81%b7%e4%b8%ad%e5%bf%83%e5%b0%8e%e5%b8%ab%e5%85%83%e6%9c%97%e5%8d%80/
1d4c25d61a00785d661aaa6a429fb59e,東華三院甲寅年總理中學,梁小姐,26727395,mail@twghkyds.edu.hk,https://recruit.hkfew.org.hk/jobs/%e5%a4%a7%e6%8f%90%e7%90%b4%e7%8f%ad%e5%b0%8e%e5%b8%ab-2/
7a95247501ea2635e153937aafc978f8,瑪利灣學校,陳小姐,25540168,recruit@marycove.edu.hk,https://recruit.hkfew.org.hk/jobs/%e6%9a%91%e6%9c%9f%e8%aa%b2%e7%a8%8b%e5%b0%8e%e5%b8%ab/
9cef6f205c943eb756dd84520573058e,Joyful art centre,Miss wong,60265103,joyfulart777@yahoo.com.hi,https://recruit.hkfew.org.hk/jobs/%e5%85%a8%e8%81%b7%e8%a6%96%e8%a6%ba%e8%97%9d%e8%a1%93%e5%b0%8e%e5%b8%ab-2/
1c0efcb09110298982489de9bee9d2f8,聖公會聖三一堂中學,林小姐,27144137,office@skhhtcss.edu.hk,https://recruit.hkfew.org.hk/jobs/english-drama-teacherpart-time/
6e2f2de501c6710df7807e5006480f7f,香港遊樂場協會賽馬會上葵涌青少年綜合服務中心,何小姐,24243043,ritaho@hkpa.hk,https://recruit.hkfew.org.hk/jobs/%e6%8b%9b%e8%81%98%e8%91%b5%e6%b6%8cngo%e5%8a%9f%e8%aa%b2%e8%bc%94%e5%b0%8e%e7%8f%ad%e5%b0%8e%e5%b8%ab/
513328af8959c478ba231b2446a72c7f,東華三院馬振玉紀念中學,黎兆添老師,24439833,dadadee1234@yahoo.com.hk,https://recruit.hkfew.org.hk/jobs/%e6%97%a5%e6%96%87%e5%9f%ba%e7%a4%8e%e8%aa%b2%e7%a8%8b%e5%b0%8e%e5%b8%ab%e4%b8%ad%e5%9b%9b%e3%80%81%e4%ba%94%e7%b4%9a/
a12e8497f0f2125d2c4004944cec0d26,大衆教室(薈學坊)有限公司,Mr. Ng,98595581,plcsmarta3c@gmail.com,https://recruit.hkfew.org.hk/jobs/%e5%85%a8%e8%81%b7-%e5%85%bc%e8%81%b7%e5%b0%8e%e5%b8%ab-3/
2d19e957cce88295f3761a94e71a614d,香港神託會 生命教育計劃,Jade LAM,26371866,life@stewards.hk,https://recruit.hkfew.org.hk/jobs/%e6%88%b2%e5%8a%87%e5%b0%8e%e5%b8%ab/
31e6ed32bc99809b3bda75ed37c50744,Anglomile Education Centre,Mr Chan,67199919,hello@anglomile.com,https://recruit.hkfew.org.hk/jobs/%e5%85%bc%e8%81%b7%e8%8b%b1%e8%aa%9e%e7%8f%ad%e5%b0%8e%e5%b8%ab-2/

178
src/YuanjiajiaQl.php

@ -0,0 +1,178 @@
<?php
namespace Yuanjiajia\Qldome;
use GuzzleHttp\Exception\RequestException;
use QL\QueryList;
class YuanjiajiaQl
{
public function actionIndex()
{
$itemCount = 0;
$validCount = 0;
$users = [];
$listUrl = 'https://recruit.hkfew.org.hk/?post_type=noo_job&s&category%5B0%5D=%25e5%25b0%258e%25e5%25b8%25ab&paged=';
$fpQueryListLog = fopen("./qlOut/QueryListLog.txt",'r');
$page = fgets($fpQueryListLog);
$page = $page ? (Integer)$page : 1;
fclose($fpQueryListLog);
$fpRecruitInfo = fopen("./qlOut/recruit_info.xls",'r');
for($str = true; $str; $str=$str){
$str = fgets($fpRecruitInfo);
if($str){
$arr = preg_split("/[,]{1}/", $str);
$users[$arr[0]] =implode(', ',array_slice($arr,1,4)).', '.implode('',array_slice($arr,5));
}
}
fclose($fpRecruitInfo);
var_dump($users);
for($page = $page; $page <= 95; $page++){
$qlList = new QueryList();
$curl = curl_init();
curl_setopt($curl,CURLOPT_RETURNTRANSFER,true);
curl_setopt($curl,CURLOPT_URL,$listUrl.$page);
$result = curl_exec($curl);
$info = curl_getinfo($curl);
if($info["http_code"] !== 200){
echo "Http 请求错误: ".$listUrl.$page."。程序已经终止\n";
break;
}
curl_close($curl);
$qlList = $qlList->html($result);
$urls = $qlList->find('article')->attrs('data-url')->all();
foreach($urls as $url){
$itemCount = $itemCount + 1;
$user = null;
$qlDetail = new QueryList();
$qlTemp = new QueryList();
// $curl = curl_init();
// curl_setopt($curl,CURLOPT_RETURNTRANSFER,true);
// curl_setopt($curl,CURLOPT_URL,$url);
// $result = curl_exec($curl);
// $info = curl_getinfo($curl);
// if($info["http_code"] !== 200){
// echo "Http 请求错误: ".$url."。程序已经终止\n";
// break;
// }
// curl_close($curl);
try {
$qlDetail = $qlDetail->get($url);
} catch (RequestException $e) {
echo "Http 请求错误: ".$e->message."url: ".$listUrl.$page."。跳过当前链接\n";
continue;
}
$ul = $qlDetail->find('div.video-gallery-fields ul li')->htmls()->all();
foreach($ul as $li){
$qlTemp->html($li);
if (preg_match("/(value-_noo_job_field_job_school_name cf-text-value){1}/", $qlTemp->find('span')->attr('class')) == 1) {
$user['companyName'] = preg_replace("/[,]+/", ' ', $qlTemp->find('span')->text());
} else if (preg_match("/(value-_noo_job_field_contact cf-text-value){1}/", $qlTemp->find('span')->attr('class')) == 1) {
$user['contactPerson'] = preg_replace("/[,]+/", ' or ', $qlTemp->find('span')->text());
} else if (preg_match("/(value-_noo_job_field_phone cf-text-value){1}/", $qlTemp->find('span')->attr('class')) == 1) {
$user['tel'] = preg_replace("/[,]+/", ' or ', $qlTemp->find('span')->text());
$user['tel'] = preg_replace("/[\s]+/", '', $user['tel']);
$user['tel'] = preg_replace("/[-]+/", '', $user['tel']);
} else if (preg_match("/(value-_noo_job_field_job_email cf-email-value){1}/", $qlTemp->find('span')->attr('class')) == 1) {
$user['email'] = $this->deCFEmail($qlTemp->find('span a')->attr('data-cfemail'));
$user['email'] = preg_replace("/[,]+/", ' or ', $user['email']);
$user['email'] = preg_replace("/[\s]+/", '', $user['email']);
}
$user['url'] = $url;
}
if( !empty($user['tel']) && !empty($user['email'])){
$user['companyName'] = !empty($user['companyName']) ? $user['companyName'] : '/';
$user['contactPerson'] = !empty($user['contactPerson']) ? $user['contactPerson'] : '/';
$usreInfo = $user['companyName'].','.$user['contactPerson'].','.str_replace(' ','',$user['tel']).','.$user['email'].','.$user['url'];
$hashKey = hash('md5', str_replace(' ','',$user['tel']).','.$user['email']);
if( !array_key_exists($hashKey, $users))
{
echo '当前第 '.$page.' 页: 第 '.$itemCount.' 个,有效个数: '.++$validCount."\n";
echo '机构: '.$user['companyName']."\n";
echo '联系人: '.$user['contactPerson']."\n";
echo 'tel: '.str_replace(' ','',$user['tel'])."\n";
echo 'email: '.$user['email']."\n";
echo 'url: '.$user['url']."\n\n";
$users[$hashKey] = $usreInfo;
$fpRecruitInfo = fopen("./qlOut/recruit_info.xls",'a+');
fwrite($fpRecruitInfo, $hashKey.','.$usreInfo."\n");
fclose($fpRecruitInfo);
}else{
$equalUrl = $users[$hashKey];
$errLog = '数据无效(2): 当前第 '.$page.' 页: 第 '.$itemCount.' 个无效。与 '.$equalUrl.' 具有相同的 tel 或 email。 url: '.$url."\n\n";
echo $errLog;
$fpErrLog = fopen("./qlOut/errLog.txt",'a+');
fwrite($fpErrLog, $errLog."\n");
fclose($fpErrLog);
}
// break;
}else{
$errLog = '数据无效(1): 当前第 '.$page." 页: 第 ".$itemCount." 个无效。没有有效的 tel 或 email。 url: ".$url."\n\n";
echo $errLog;
$fpErrLog = fopen("./qlOut/errLog.txt",'a+');
fwrite($fpErrLog, $errLog."\n");
fclose($fpErrLog);
}
sleep(10);
}
// break;
$fpQueryListLog = fopen("./qlOut/QueryListLog.txt",'w+');
fwrite($fpQueryListLog, $page."\n");
fclose($fpQueryListLog);
}
}
/**
* 解密email
*/
function deCFEmail($encode)
{
$k = hexdec(substr($encode, 0, 2));
for ($i = 2, $m = ''; $i < strlen($encode) - 1; $i += 2) {
$m .= chr(hexdec(substr($encode, $i, 2)) ^ $k);
}
return $m;
}
}

12
vendor/autoload.php

@ -0,0 +1,12 @@
<?php
// autoload.php @generated by Composer
if (PHP_VERSION_ID < 50600) {
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;
exit(1);
}
require_once __DIR__ . '/composer/autoload_real.php';
return ComposerAutoloaderInit8583f236fb7cd3ae1a5996e2fc00e413::getLoader();

117
vendor/bin/var-dump-server

@ -0,0 +1,117 @@
#!/usr/bin/env php
<?php
/**
* Proxy PHP file generated by Composer
*
* This file includes the referenced bin path (../symfony/var-dumper/Resources/bin/var-dump-server)
* using a stream wrapper to prevent the shebang from being output on PHP<8
*
* @generated
*/
namespace Composer;
$GLOBALS['_composer_bin_dir'] = __DIR__;
$GLOBALS['_composer_autoload_path'] = __DIR__ . '/..'.'/autoload.php';
if (PHP_VERSION_ID < 80000) {
if (!class_exists('Composer\BinProxyWrapper')) {
/**
* @internal
*/
final class BinProxyWrapper
{
private $handle;
private $position;
private $realpath;
public function stream_open($path, $mode, $options, &$opened_path)
{
// get rid of phpvfscomposer:// prefix for __FILE__ & __DIR__ resolution
$opened_path = substr($path, 17);
$this->realpath = realpath($opened_path) ?: $opened_path;
$opened_path = $this->realpath;
$this->handle = fopen($this->realpath, $mode);
$this->position = 0;
return (bool) $this->handle;
}
public function stream_read($count)
{
$data = fread($this->handle, $count);
if ($this->position === 0) {
$data = preg_replace('{^#!.*\r?\n}', '', $data);
}
$this->position += strlen($data);
return $data;
}
public function stream_cast($castAs)
{
return $this->handle;
}
public function stream_close()
{
fclose($this->handle);
}
public function stream_lock($operation)
{
return $operation ? flock($this->handle, $operation) : true;
}
public function stream_seek($offset, $whence)
{
if (0 === fseek($this->handle, $offset, $whence)) {
$this->position = ftell($this->handle);
return true;
}
return false;
}
public function stream_tell()
{
return $this->position;
}
public function stream_eof()
{
return feof($this->handle);
}
public function stream_stat()
{
return array();
}
public function stream_set_option($option, $arg1, $arg2)
{
return true;
}
public function url_stat($path, $flags)
{
$path = substr($path, 17);
if (file_exists($path)) {
return stat($path);
}
return false;
}
}
}
if (function_exists('stream_wrapper_register') && stream_wrapper_register('phpvfscomposer', 'Composer\BinProxyWrapper')) {
include("phpvfscomposer://" . __DIR__ . '/..'.'/symfony/var-dumper/Resources/bin/var-dump-server');
exit(0);
}
}
include __DIR__ . '/..'.'/symfony/var-dumper/Resources/bin/var-dump-server';

559
vendor/cache/adapter-common/AbstractCachePool.php

@ -0,0 +1,559 @@
<?php
/*
* This file is part of php-cache organization.
*
* (c) 2015 Aaron Scherer <aequasi@gmail.com>, Tobias Nyholm <tobias.nyholm@gmail.com>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
namespace Cache\Adapter\Common;
use Cache\Adapter\Common\Exception\CacheException;
use Cache\Adapter\Common\Exception\CachePoolException;
use Cache\Adapter\Common\Exception\InvalidArgumentException;
use Psr\Cache\CacheItemInterface;
use Psr\Log\LoggerAwareInterface;
use Psr\Log\LoggerInterface;
use Psr\SimpleCache\CacheInterface;
/**
* @author Aaron Scherer <aequasi@gmail.com>
* @author Tobias Nyholm <tobias.nyholm@gmail.com>
*/
abstract class AbstractCachePool implements PhpCachePool, LoggerAwareInterface, CacheInterface
{
const SEPARATOR_TAG = '!';
/**
* @type LoggerInterface
*/
private $logger;
/**
* @type PhpCacheItem[] deferred
*/
protected $deferred = [];
/**
* @param PhpCacheItem $item
* @param int|null $ttl seconds from now
*
* @return bool true if saved
*/
abstract protected function storeItemInCache(PhpCacheItem $item, $ttl);
/**
* Fetch an object from the cache implementation.
*
* If it is a cache miss, it MUST return [false, null, [], null]
*
* @param string $key
*
* @return array with [isHit, value, tags[], expirationTimestamp]
*/
abstract protected function fetchObjectFromCache($key);
/**
* Clear all objects from cache.
*
* @return bool false if error
*/
abstract protected function clearAllObjectsFromCache();
/**
* Remove one object from cache.
*
* @param string $key
*
* @return bool
*/
abstract protected function clearOneObjectFromCache($key);
/**
* Get an array with all the values in the list named $name.
*
* @param string $name
*
* @return array
*/
abstract protected function getList($name);
/**
* Remove the list.
*
* @param string $name
*
* @return bool
*/
abstract protected function removeList($name);
/**
* Add a item key on a list named $name.
*
* @param string $name
* @param string $key
*/
abstract protected function appendListItem($name, $key);
/**
* Remove an item from the list.
*
* @param string $name
* @param string $key
*/
abstract protected function removeListItem($name, $key);
/**
* Make sure to commit before we destruct.
*/
public function __destruct()
{
$this->commit();
}
/**
* {@inheritdoc}
*/
public function getItem($key)
{
$this->validateKey($key);
if (isset($this->deferred[$key])) {
/** @type CacheItem $item */
$item = clone $this->deferred[$key];
$item->moveTagsToPrevious();
return $item;
}
$func = function () use ($key) {
try {
return $this->fetchObjectFromCache($key);
} catch (\Exception $e) {
$this->handleException($e, __FUNCTION__);
}
};
return new CacheItem($key, $func);
}
/**
* {@inheritdoc}
*/
public function getItems(array $keys = [])
{
$items = [];
foreach ($keys as $key) {
$items[$key] = $this->getItem($key);
}
return $items;
}
/**
* {@inheritdoc}
*/
public function hasItem($key)
{
try {
return $this->getItem($key)->isHit();
} catch (\Exception $e) {
$this->handleException($e, __FUNCTION__);
}
}
/**
* {@inheritdoc}
*/
public function clear()
{
// Clear the deferred items
$this->deferred = [];
try {
return $this->clearAllObjectsFromCache();
} catch (\Exception $e) {
$this->handleException($e, __FUNCTION__);
}
}
/**
* {@inheritdoc}
*/
public function deleteItem($key)
{
try {
return $this->deleteItems([$key]);
} catch (\Exception $e) {
$this->handleException($e, __FUNCTION__);
}
}
/**
* {@inheritdoc}
*/
public function deleteItems(array $keys)
{
$deleted = true;
foreach ($keys as $key) {
$this->validateKey($key);
// Delete form deferred
unset($this->deferred[$key]);
// We have to commit here to be able to remove deferred hierarchy items
$this->commit();
$this->preRemoveItem($key);
if (!$this->clearOneObjectFromCache($key)) {
$deleted = false;
}
}
return $deleted;
}
/**
* {@inheritdoc}
*/
public function save(CacheItemInterface $item)
{
if (!$item instanceof PhpCacheItem) {
$e = new InvalidArgumentException('Cache items are not transferable between pools. Item MUST implement PhpCacheItem.');
$this->handleException($e, __FUNCTION__);
}
$this->removeTagEntries($item);
$this->saveTags($item);
$timeToLive = null;
if (null !== $timestamp = $item->getExpirationTimestamp()) {
$timeToLive = $timestamp - time();
if ($timeToLive < 0) {
return $this->deleteItem($item->getKey());
}
}
try {
return $this->storeItemInCache($item, $timeToLive);
} catch (\Exception $e) {
$this->handleException($e, __FUNCTION__);
}
}
/**
* {@inheritdoc}
*/
public function saveDeferred(CacheItemInterface $item)
{
$this->deferred[$item->getKey()] = $item;
return true;
}
/**
* {@inheritdoc}
*/
public function commit()
{
$saved = true;
foreach ($this->deferred as $item) {
if (!$this->save($item)) {
$saved = false;
}
}
$this->deferred = [];
return $saved;
}
/**
* @param string $key
*
* @throws InvalidArgumentException
*/
protected function validateKey($key)
{
if (!is_string($key)) {
$e = new InvalidArgumentException(sprintf(
'Cache key must be string, "%s" given',
gettype($key)
));
$this->handleException($e, __FUNCTION__);
}
if (!isset($key[0])) {
$e = new InvalidArgumentException('Cache key cannot be an empty string');
$this->handleException($e, __FUNCTION__);
}
if (preg_match('|[\{\}\(\)/\\\@\:]|', $key)) {
$e = new InvalidArgumentException(sprintf(
'Invalid key: "%s". The key contains one or more characters reserved for future extension: {}()/\@:',
$key
));
$this->handleException($e, __FUNCTION__);
}
}
/**
* @param LoggerInterface $logger
*/
public function setLogger(LoggerInterface $logger): void
{
$this->logger = $logger;
}
/**
* Logs with an arbitrary level if the logger exists.
*
* @param mixed $level
* @param string $message
* @param array $context
*/
protected function log($level, $message, array $context = [])
{
if ($this->logger !== null) {
$this->logger->log($level, $message, $context);
}
}
/**
* Log exception and rethrow it.
*
* @param \Exception $e
* @param string $function
*
* @throws CachePoolException
*/
private function handleException(\Exception $e, $function)
{
$level = 'alert';
if ($e instanceof InvalidArgumentException) {
$level = 'warning';
}
$this->log($level, $e->getMessage(), ['exception' => $e]);
if (!$e instanceof CacheException) {
$e = new CachePoolException(sprintf('Exception thrown when executing "%s". ', $function), 0, $e);
}
throw $e;
}
/**
* @param array $tags
*
* @return bool
*/
public function invalidateTags(array $tags)
{
$itemIds = [];
foreach ($tags as $tag) {
$itemIds = array_merge($itemIds, $this->getList($this->getTagKey($tag)));
}
// Remove all items with the tag
$success = $this->deleteItems($itemIds);
if ($success) {
// Remove the tag list
foreach ($tags as $tag) {
$this->removeList($this->getTagKey($tag));
$l = $this->getList($this->getTagKey($tag));
}
}
return $success;
}
public function invalidateTag($tag)
{
return $this->invalidateTags([$tag]);
}
/**
* @param PhpCacheItem $item
*/
protected function saveTags(PhpCacheItem $item)
{
$tags = $item->getTags();
foreach ($tags as $tag) {
$this->appendListItem($this->getTagKey($tag), $item->getKey());
}
}
/**
* Removes the key form all tag lists. When an item with tags is removed
* we MUST remove the tags. If we fail to remove the tags a new item with
* the same key will automatically get the previous tags.
*
* @param string $key
*
* @return $this
*/
protected function preRemoveItem($key)
{
$item = $this->getItem($key);
$this->removeTagEntries($item);
return $this;
}
/**
* @param PhpCacheItem $item
*/
private function removeTagEntries(PhpCacheItem $item)
{
$tags = $item->getPreviousTags();
foreach ($tags as $tag) {
$this->removeListItem($this->getTagKey($tag), $item->getKey());
}
}
/**
* @param string $tag
*
* @return string
*/
protected function getTagKey($tag)
{
return 'tag'.self::SEPARATOR_TAG.$tag;
}
/**
* {@inheritdoc}
*/
public function get($key, $default = null)
{
$item = $this->getItem($key);
if (!$item->isHit()) {
return $default;
}
return $item->get();
}
/**
* {@inheritdoc}
*/
public function set($key, $value, $ttl = null)
{
$item = $this->getItem($key);
$item->set($value);
$item->expiresAfter($ttl);
return $this->save($item);
}
/**
* {@inheritdoc}
*/
public function delete($key)
{
return $this->deleteItem($key);
}
/**
* {@inheritdoc}
*/
public function getMultiple($keys, $default = null)
{
if (!is_array($keys)) {
if (!$keys instanceof \Traversable) {
throw new InvalidArgumentException('$keys is neither an array nor Traversable');
}
// Since we need to throw an exception if *any* key is invalid, it doesn't
// make sense to wrap iterators or something like that.
$keys = iterator_to_array($keys, false);
}
$items = $this->getItems($keys);
return $this->generateValues($default, $items);
}
/**
* @param $default
* @param $items
*
* @return \Generator
*/
private function generateValues($default, $items)
{
foreach ($items as $key => $item) {
/** @type $item CacheItemInterface */
if (!$item->isHit()) {
yield $key => $default;
} else {
yield $key => $item->get();
}
}
}
/**
* {@inheritdoc}
*/
public function setMultiple($values, $ttl = null)
{
if (!is_array($values)) {
if (!$values instanceof \Traversable) {
throw new InvalidArgumentException('$values is neither an array nor Traversable');
}
}
$keys = [];
$arrayValues = [];
foreach ($values as $key => $value) {
if (is_int($key)) {
$key = (string) $key;
}
$this->validateKey($key);
$keys[] = $key;
$arrayValues[$key] = $value;
}
$items = $this->getItems($keys);
$itemSuccess = true;
foreach ($items as $key => $item) {
$item->set($arrayValues[$key]);
try {
$item->expiresAfter($ttl);
} catch (InvalidArgumentException $e) {
throw new InvalidArgumentException($e->getMessage(), $e->getCode(), $e);
}
$itemSuccess = $itemSuccess && $this->saveDeferred($item);
}
return $itemSuccess && $this->commit();
}
/**
* {@inheritdoc}
*/
public function deleteMultiple($keys)
{
if (!is_array($keys)) {
if (!$keys instanceof \Traversable) {
throw new InvalidArgumentException('$keys is neither an array nor Traversable');
}
// Since we need to throw an exception if *any* key is invalid, it doesn't
// make sense to wrap iterators or something like that.
$keys = iterator_to_array($keys, false);
}
return $this->deleteItems($keys);
}
/**
* {@inheritdoc}
*/
public function has($key)
{
return $this->hasItem($key);
}
}

269
vendor/cache/adapter-common/CacheItem.php

@ -0,0 +1,269 @@
<?php
/*
* This file is part of php-cache organization.
*
* (c) 2015 Aaron Scherer <aequasi@gmail.com>, Tobias Nyholm <tobias.nyholm@gmail.com>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
namespace Cache\Adapter\Common;
use Cache\Adapter\Common\Exception\InvalidArgumentException;
use Cache\TagInterop\TaggableCacheItemInterface;
/**
* @author Aaron Scherer <aequasi@gmail.com>
* @author Tobias Nyholm <tobias.nyholm@gmail.com>
*/
class CacheItem implements PhpCacheItem
{
/**
* @type array
*/
private $prevTags = [];
/**
* @type array
*/
private $tags = [];
/**
* @type \Closure
*/
private $callable;
/**
* @type string
*/
private $key;
/**
* @type mixed
*/
private $value;
/**
* The expiration timestamp is the source of truth. This is the UTC timestamp
* when the cache item expire. A value of zero means it never expires. A nullvalue
* means that no expiration is set.
*
* @type int|null
*/
private $expirationTimestamp = null;
/**
* @type bool
*/
private $hasValue = false;
/**
* @param string $key
* @param \Closure|bool $callable or boolean hasValue
*/
public function __construct($key, $callable = null, $value = null)
{
$this->key = $key;
if ($callable === true) {
$this->hasValue = true;
$this->value = $value;
} elseif ($callable !== false) {
// This must be a callable or null
$this->callable = $callable;
}
}
/**
* {@inheritdoc}
*/
public function getKey()
{
return $this->key;
}
/**
* {@inheritdoc}
*/
public function set($value)
{
$this->value = $value;
$this->hasValue = true;
$this->callable = null;
return $this;
}
/**
* {@inheritdoc}
*/
public function get()
{
if (!$this->isHit()) {
return;
}
return $this->value;
}
/**
* {@inheritdoc}
*/
public function isHit()
{
$this->initialize();
if (!$this->hasValue) {
return false;
}
if ($this->expirationTimestamp !== null) {
return $this->expirationTimestamp > time();
}
return true;
}
/**
* {@inheritdoc}
*/
public function getExpirationTimestamp()
{
return $this->expirationTimestamp;
}
/**
* {@inheritdoc}
*/
public function expiresAt($expiration)
{
if ($expiration instanceof \DateTimeInterface) {
$this->expirationTimestamp = $expiration->getTimestamp();
} elseif (is_int($expiration) || null === $expiration) {
$this->expirationTimestamp = $expiration;
} else {
throw new InvalidArgumentException('Cache item ttl/expiresAt must be of type integer or \DateTimeInterface.');
}
return $this;
}
/**
* {@inheritdoc}
*/
public function expiresAfter($time)
{
if ($time === null) {
$this->expirationTimestamp = null;
} elseif ($time instanceof \DateInterval) {
$date = new \DateTime();
$date->add($time);
$this->expirationTimestamp = $date->getTimestamp();
} elseif (is_int($time)) {
$this->expirationTimestamp = time() + $time;
} else {
throw new InvalidArgumentException('Cache item ttl/expiresAfter must be of type integer or \DateInterval.');
}
return $this;
}
/**
* {@inheritdoc}
*/
public function getPreviousTags()
{
$this->initialize();
return $this->prevTags;
}
/**
* {@inheritdoc}
*/
public function getTags()
{
return $this->tags;
}
/**
* {@inheritdoc}
*/
public function setTags(array $tags)
{
$this->tags = [];
$this->tag($tags);
return $this;
}
/**
* Adds a tag to a cache item.
*
* @param string|string[] $tags A tag or array of tags
*
* @throws InvalidArgumentException When $tag is not valid.
*
* @return TaggableCacheItemInterface
*/
private function tag($tags)
{
$this->initialize();
if (!is_array($tags)) {
$tags = [$tags];
}
foreach ($tags as $tag) {
if (!is_string($tag)) {
throw new InvalidArgumentException(sprintf('Cache tag must be string, "%s" given', is_object($tag) ? get_class($tag) : gettype($tag)));
}
if (isset($this->tags[$tag])) {
continue;
}
if (!isset($tag[0])) {
throw new InvalidArgumentException('Cache tag length must be greater than zero');
}
if (isset($tag[strcspn($tag, '{}()/\@:')])) {
throw new InvalidArgumentException(sprintf('Cache tag "%s" contains reserved characters {}()/\@:', $tag));
}
$this->tags[$tag] = $tag;
}
return $this;
}
/**
* If callable is not null, execute it an populate this object with values.
*/
private function initialize()
{
if ($this->callable !== null) {
// $func will be $adapter->fetchObjectFromCache();
$func = $this->callable;
$result = $func();
$this->hasValue = $result[0];
$this->value = $result[1];
$this->prevTags = isset($result[2]) ? $result[2] : [];
$this->expirationTimestamp = null;
if (isset($result[3]) && is_int($result[3])) {
$this->expirationTimestamp = $result[3];
}
$this->callable = null;
}
}
/**
* @internal This function should never be used and considered private.
*
* Move tags from $tags to $prevTags
*/
public function moveTagsToPrevious()
{
$this->prevTags = $this->tags;
$this->tags = [];
}
}

73
vendor/cache/adapter-common/Changelog.md

@ -0,0 +1,73 @@
# Change Log
The change log describes what is "Added", "Removed", "Changed" or "Fixed" between each release.
## 1.3.0
* Support for PHP 8.1
* Drop support for PHP < 7.4
* Allow psr/cache: ^1.0 || ^2.0
## 1.2.0
### Added
* Support for PHP 8
## 1.1.0
### Added
- Support for storing binary data
### Fixed
- Issue with one character variables
### Changed
- Tests are now extending `PHPUnit\Framework\TestCase`
## 1.0.0
* No changes since 0.4.0.
## 0.4.0
### Added
* `AbstractCachePool` has 4 new abstract methods: `getList`, `removeList`, `appendListItem` and `removeListItem`.
* `AbstractCachePool::invalidateTags` and `AbstractCachePool::invalidateTags`
* Added interfaces for our items and pools `PhpCachePool` and `PhpCacheItem`
* Trait to help adapters to support tags. `TagSupportWithArray`.
### Changed
* First parameter to `AbstractCachePool::storeItemInCache` must be a `PhpCacheItem`.
* Return value from `AbstractCachePool::fetchObjectFromCache` must be a an array with 4 values. Added expiration timestamp.
* `HasExpirationDateInterface` is replaced by `HasExpirationTimestampInterface`
* We do not work with `\DateTime` internally anymore. We work with timestamps.
## 0.3.3
### Fixed
* Bugfix when you fetch data from the cache storage that was saved as "non-tagging item" but fetch as a tagging item.
## 0.3.2
### Added
* Cache pools do implement `LoggerAwareInterface`
## 0.3.0
### Changed
* The `AbstractCachePool` does not longer implement `TaggablePoolInterface`. However, the `CacheItem` does still implement `TaggableItemInterface`.
* `CacheItem::getKeyFromTaggedKey` has been removed
* The `CacheItem`'s second parameter is a callable that must return an array with 3 elements; [`hasValue`, `value`, `tags`].
## 0.2.0
* No changelog before this version

23
vendor/cache/adapter-common/Exception/CacheException.php

@ -0,0 +1,23 @@
<?php
/*
* This file is part of php-cache organization.
*
* (c) 2015 Aaron Scherer <aequasi@gmail.com>, Tobias Nyholm <tobias.nyholm@gmail.com>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
namespace Cache\Adapter\Common\Exception;
use Psr\Cache\CacheException as CacheExceptionInterface;
/**
* A base exception. All exceptions in this organization will extend this exception.
*
* @author Tobias Nyholm <tobias.nyholm@gmail.com>
*/
abstract class CacheException extends \RuntimeException implements CacheExceptionInterface
{
}

21
vendor/cache/adapter-common/Exception/CachePoolException.php

@ -0,0 +1,21 @@
<?php
/*
* This file is part of php-cache organization.
*
* (c) 2015 Aaron Scherer <aequasi@gmail.com>, Tobias Nyholm <tobias.nyholm@gmail.com>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
namespace Cache\Adapter\Common\Exception;
/**
* If an exception is caused by a pool or by the cache storage.
*
* @author Tobias Nyholm <tobias.nyholm@gmail.com>
*/
class CachePoolException extends CacheException
{
}

19
vendor/cache/adapter-common/Exception/InvalidArgumentException.php

@ -0,0 +1,19 @@
<?php
/*
* This file is part of php-cache organization.
*
* (c) 2015 Aaron Scherer <aequasi@gmail.com>, Tobias Nyholm <tobias.nyholm@gmail.com>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
namespace Cache\Adapter\Common\Exception;
use Psr\Cache\InvalidArgumentException as CacheInvalidArgumentException;
use Psr\SimpleCache\InvalidArgumentException as SimpleCacheInvalidArgumentException;
class InvalidArgumentException extends CacheException implements CacheInvalidArgumentException, SimpleCacheInvalidArgumentException
{
}

26
vendor/cache/adapter-common/HasExpirationTimestampInterface.php

@ -0,0 +1,26 @@
<?php
/*
* This file is part of php-cache organization.
*
* (c) 2015 Aaron Scherer <aequasi@gmail.com>, Tobias Nyholm <tobias.nyholm@gmail.com>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
namespace Cache\Adapter\Common;
/**
* @author Aaron Scherer <aequasi@gmail.com>
* @author Tobias Nyholm <tobias.nyholm@gmail.com>
*/
interface HasExpirationTimestampInterface
{
/**
* The timestamp when the object expires.
*
* @return int|null
*/
public function getExpirationTimestamp();
}

68
vendor/cache/adapter-common/JsonBinaryArmoring.php

@ -0,0 +1,68 @@
<?php
/*
* This file is part of php-cache organization.
*
* (c) 2015 Aaron Scherer <aequasi@gmail.com>, Tobias Nyholm <tobias.nyholm@gmail.com>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
namespace Cache\Adapter\Common;
/**
* This trait provides common routines for safely encoding binary and non-UTF8 data in
* JSON. This is needed for components that use JSON natively (currently, the MongoDB
* adapter and EncryptedCachePool).
*
* @author Stephen Clouse <stephen.clouse@noaa.gov>
*/
trait JsonBinaryArmoring
{
private static $ESCAPE_JSON_CHARACTERS = [
"\x00", "\x01", "\x02", "\x03", "\x04", "\x05", "\x06", "\x07",
"\x08", "\x09", "\x0A", "\x0B", "\x0C", "\x0D", "\x0E", "\x0F",
"\x10", "\x11", "\x12", "\x13", "\x14", "\x15", "\x16", "\x17",
"\x18", "\x19", "\x1A", "\x1B", "\x1C", "\x1D", "\x1E", "\x1F",
];
private static $ENCODED_JSON_CHARACTERS = [
'\u0000', '\u0001', '\u0002', '\u0003', '\u0004', '\u0005', '\u0006', '\u0007',
'\u0008', '\u0009', '\u000A', '\u000B', '\u000C', '\u000D', '\u000E', '\u000F',
'\u0010', '\u0011', '\u0012', '\u0013', '\u0014', '\u0015', '\u0016', '\u0017',
'\u0018', '\u0019', '\u001A', '\u001B', '\u001C', '\u001D', '\u001E', '\u001F',
];
/**
* Armor a value going into a JSON document.
*
* @param string $value
*
* @return string
*/
protected static function jsonArmor($value)
{
return str_replace(
static::$ESCAPE_JSON_CHARACTERS,
static::$ENCODED_JSON_CHARACTERS,
utf8_encode($value)
);
}
/**
* De-armor a value from a JSON document.
*
* @param string $value
*
* @return string
*/
protected static function jsonDeArmor($value)
{
return utf8_decode(str_replace(
static::$ENCODED_JSON_CHARACTERS,
static::$ESCAPE_JSON_CHARACTERS,
$value
));
}
}

22
vendor/cache/adapter-common/LICENSE

@ -0,0 +1,22 @@
The MIT License (MIT)
Copyright (c) 2015 Aaron Scherer, Tobias Nyholm
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

32
vendor/cache/adapter-common/PhpCacheItem.php

@ -0,0 +1,32 @@
<?php
/*
* This file is part of php-cache organization.
*
* (c) 2015 Aaron Scherer <aequasi@gmail.com>, Tobias Nyholm <tobias.nyholm@gmail.com>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
namespace Cache\Adapter\Common;
use Cache\TagInterop\TaggableCacheItemInterface;
/**
* @author Tobias Nyholm <tobias.nyholm@gmail.com>
*/
interface PhpCacheItem extends HasExpirationTimestampInterface, TaggableCacheItemInterface
{
/**
* Get the current tags. These are not the same tags as getPrevious tags. This
* is the tags that has been added to the item after the item was fetched from
* the cache storage.
*
* WARNING: This is generally not the function you want to use. Please see
* `getPreviousTags`.
*
* @return array
*/
public function getTags();
}

34
vendor/cache/adapter-common/PhpCachePool.php

@ -0,0 +1,34 @@
<?php
/*
* This file is part of php-cache organization.
*
* (c) 2015 Aaron Scherer <aequasi@gmail.com>, Tobias Nyholm <tobias.nyholm@gmail.com>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
namespace Cache\Adapter\Common;
use Cache\TagInterop\TaggableCacheItemPoolInterface;
/**
* @author Tobias Nyholm <tobias.nyholm@gmail.com>
*/
interface PhpCachePool extends TaggableCacheItemPoolInterface
{
/**
* {@inheritdoc}
*
* @return PhpCacheItem
*/
public function getItem($key);
/**
* {@inheritdoc}
*
* @return array|\Traversable|PhpCacheItem[]
*/
public function getItems(array $keys = []);
}

15
vendor/cache/adapter-common/README.md

@ -0,0 +1,15 @@
# Common PSR-6 Cache pool
[![Gitter](https://badges.gitter.im/php-cache/cache.svg)](https://gitter.im/php-cache/cache?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
[![Latest Stable Version](https://poser.pugx.org/cache/adapter-common/v/stable)](https://packagist.org/packages/cache/adapter-common)
[![codecov.io](https://codecov.io/github/php-cache/adapter-common/coverage.svg?branch=master)](https://codecov.io/github/php-cache/adapter-common?branch=master)
[![Total Downloads](https://poser.pugx.org/cache/adapter-common/downloads)](https://packagist.org/packages/cache/adapter-common)
[![Monthly Downloads](https://poser.pugx.org/cache/adapter-common/d/monthly.png)](https://packagist.org/packages/cache/adapter-common)
[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE)
This repository contains shared classes and interfaces used by the PHP Cache organisation. To read about
features like tagging and hierarchy support please read the shared documentation at [www.php-cache.com](http://www.php-cache.com).
### Contribute
Contributions are very welcome! Send a pull request to the [main repository](https://github.com/php-cache/cache) or
report any issues you find on the [issue tracker](http://issues.php-cache.com).

88
vendor/cache/adapter-common/TagSupportWithArray.php

@ -0,0 +1,88 @@
<?php
/*
* This file is part of php-cache organization.
*
* (c) 2015 Aaron Scherer <aequasi@gmail.com>, Tobias Nyholm <tobias.nyholm@gmail.com>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
namespace Cache\Adapter\Common;
/**
* This trait could be used by adapters that do not have a native support for lists.
*
* @author Tobias Nyholm <tobias.nyholm@gmail.com>
*/
trait TagSupportWithArray
{
/**
* Get a value from the storage.
*
* @param string $name
*
* @return mixed
*/
abstract public function getDirectValue($name);
/**
* Set a value to the storage.
*
* @param string $name
* @param mixed $value
*/
abstract public function setDirectValue($name, $value);
/**
* {@inheritdoc}
*/
protected function appendListItem($name, $value)
{
$data = $this->getDirectValue($name);
if (!is_array($data)) {
$data = [];
}
$data[] = $value;
$this->setDirectValue($name, $data);
}
/**
* {@inheritdoc}
*/
protected function getList($name)
{
$data = $this->getDirectValue($name);
if (!is_array($data)) {
$data = [];
}
return $data;
}
/**
* {@inheritdoc}
*/
protected function removeList($name)
{
$this->setDirectValue($name, []);
return true;
}
/**
* {@inheritdoc}
*/
protected function removeListItem($name, $key)
{
$data = $this->getList($name);
foreach ($data as $i => $value) {
if ($key === $value) {
unset($data[$i]);
}
}
return $this->setDirectValue($name, $data);
}
}

55
vendor/cache/adapter-common/composer.json

@ -0,0 +1,55 @@
{
"name": "cache/adapter-common",
"description": "Common classes for PSR-6 adapters",
"license": "MIT",
"type": "library",
"keywords": [
"cache",
"psr-6",
"tag"
],
"authors": [
{
"name": "Aaron Scherer",
"email": "aequasi@gmail.com",
"homepage": "https://github.com/aequasi"
},
{
"name": "Tobias Nyholm",
"email": "tobias.nyholm@gmail.com",
"homepage": "https://github.com/nyholm"
}
],
"homepage": "http://www.php-cache.com/en/latest/",
"require": {
"php": ">=7.4",
"cache/tag-interop": "^1.0",
"psr/cache": "^1.0 || ^2.0",
"psr/log": "^1.0 || ^2.0 || ^3.0",
"psr/simple-cache": "^1.0"
},
"require-dev": {
"cache/integration-tests": "^0.17",
"phpunit/phpunit": "^7.5.20 || ^9.5.10"
},
"minimum-stability": "dev",
"prefer-stable": true,
"autoload": {
"psr-4": {
"Cache\\Adapter\\Common\\": ""
}
},
"autoload-dev": {
"psr-4": {
"Cache\\Adapter\\Common\\Tests\\": "Tests/"
},
"exclude-from-classmap": [
"/Tests/"
]
},
"extra": {
"branch-alias": {
"dev-master": "1.1-dev"
}
}
}

64
vendor/cache/filesystem-adapter/Changelog.md

@ -0,0 +1,64 @@
# Change Log
The change log describes what is "Added", "Removed", "Changed" or "Fixed" between each release.
## UNRELEASED
## 1.2.0
* Support for PHP 8.1
* Drop support for PHP < 7.4
* Allow psr/cache: ^1.0 || ^2.0
## 1.1.0
### Added
* Support for PHP 8
### Changed
* Use `League\Flysystem\FilesystemInterface` instead of concrete `League\Flysystem\Filesystem` class
## 1.0.0
* No changes since 0.4.0
## 0.4.0
### Added
* Support for the new `TaggableCacheItemPoolInterface`.
* Support for PSR-16 SimpleCache
### Changed
* The behavior of `CacheItem::getTags()` has changed. It will not return the tags stored in the cache storage.
### Removed
* `CacheItem::getExpirationDate()`. Use `CacheItem::getExpirationTimestamp()`
* `CacheItem::getTags()`. Use `CacheItem::getPreviousTags()`
* `CacheItem::addTag()`. Use `CacheItem::setTags()`
## 0.3.3
### Fixed
* Race condition in `fetchObjectFromCache`.
## 0.3.2
### Changed
* Using `Filesystem::update` instead of `Filesystem::delete` and `Filesystem::write`.
## 0.3.1
### Added
* Add ability to change cache path in FilesystemCachePool
## 0.3.0
* No changelog before this version

213
vendor/cache/filesystem-adapter/FilesystemCachePool.php

@ -0,0 +1,213 @@
<?php
/*
* This file is part of php-cache organization.
*
* (c) 2015 Aaron Scherer <aequasi@gmail.com>, Tobias Nyholm <tobias.nyholm@gmail.com>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
namespace Cache\Adapter\Filesystem;
use Cache\Adapter\Common\AbstractCachePool;
use Cache\Adapter\Common\Exception\InvalidArgumentException;
use Cache\Adapter\Common\PhpCacheItem;
use League\Flysystem\FileExistsException;
use League\Flysystem\FileNotFoundException;
use League\Flysystem\FilesystemInterface;
/**
* @author Tobias Nyholm <tobias.nyholm@gmail.com>
*/
class FilesystemCachePool extends AbstractCachePool
{
/**
* @type FilesystemInterface
*/
private $filesystem;
/**
* The folder should not begin nor end with a slash. Example: path/to/cache.
*
* @type string
*/
private $folder;
/**
* @param FilesystemInterface $filesystem
* @param string $folder
*/
public function __construct(FilesystemInterface $filesystem, $folder = 'cache')
{
$this->folder = $folder;
$this->filesystem = $filesystem;
$this->filesystem->createDir($this->folder);
}
/**
* @param string $folder
*/
public function setFolder($folder)
{
$this->folder = $folder;
}
/**
* {@inheritdoc}
*/
protected function fetchObjectFromCache($key)
{
$empty = [false, null, [], null];
$file = $this->getFilePath($key);
try {
$data = @unserialize($this->filesystem->read($file));
if ($data === false) {
return $empty;
}
} catch (FileNotFoundException $e) {
return $empty;
}
// Determine expirationTimestamp from data, remove items if expired
$expirationTimestamp = $data[2] ?: null;
if ($expirationTimestamp !== null && time() > $expirationTimestamp) {
foreach ($data[1] as $tag) {
$this->removeListItem($this->getTagKey($tag), $key);
}
$this->forceClear($key);
return $empty;
}
return [true, $data[0], $data[1], $expirationTimestamp];
}
/**
* {@inheritdoc}
*/
protected function clearAllObjectsFromCache()
{
$this->filesystem->deleteDir($this->folder);
$this->filesystem->createDir($this->folder);
return true;
}
/**
* {@inheritdoc}
*/
protected function clearOneObjectFromCache($key)
{
return $this->forceClear($key);
}
/**
* {@inheritdoc}
*/
protected function storeItemInCache(PhpCacheItem $item, $ttl)
{
$data = serialize(
[
$item->get(),
$item->getTags(),
$item->getExpirationTimestamp(),
]
);
$file = $this->getFilePath($item->getKey());
if ($this->filesystem->has($file)) {
// Update file if it exists
return $this->filesystem->update($file, $data);
}
try {
return $this->filesystem->write($file, $data);
} catch (FileExistsException $e) {
// To handle issues when/if race conditions occurs, we try to update here.
return $this->filesystem->update($file, $data);
}
}
/**
* @param string $key
*
* @throws InvalidArgumentException
*
* @return string
*/
private function getFilePath($key)
{
if (!preg_match('|^[a-zA-Z0-9_\.! ]+$|', $key)) {
throw new InvalidArgumentException(sprintf('Invalid key "%s". Valid filenames must match [a-zA-Z0-9_\.! ].', $key));
}
return sprintf('%s/%s', $this->folder, $key);
}
/**
* {@inheritdoc}
*/
protected function getList($name)
{
$file = $this->getFilePath($name);
if (!$this->filesystem->has($file)) {
$this->filesystem->write($file, serialize([]));
}
return unserialize($this->filesystem->read($file));
}
/**
* {@inheritdoc}
*/
protected function removeList($name)
{
$file = $this->getFilePath($name);
$this->filesystem->delete($file);
}
/**
* {@inheritdoc}
*/
protected function appendListItem($name, $key)
{
$list = $this->getList($name);
$list[] = $key;
return $this->filesystem->update($this->getFilePath($name), serialize($list));
}
/**
* {@inheritdoc}
*/
protected function removeListItem($name, $key)
{
$list = $this->getList($name);
foreach ($list as $i => $item) {
if ($item === $key) {
unset($list[$i]);
}
}
return $this->filesystem->update($this->getFilePath($name), serialize($list));
}
/**
* @param $key
*
* @return bool
*/
private function forceClear($key)
{
try {
return $this->filesystem->delete($this->getFilePath($key));
} catch (FileNotFoundException $e) {
return true;
}
}
}

22
vendor/cache/filesystem-adapter/LICENSE

@ -0,0 +1,22 @@
The MIT License (MIT)
Copyright (c) 2015 Aaron Scherer, Tobias Nyholm
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

45
vendor/cache/filesystem-adapter/README.md

@ -0,0 +1,45 @@
# Filesystem PSR-6 Cache pool
[![Gitter](https://badges.gitter.im/php-cache/cache.svg)](https://gitter.im/php-cache/cache?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
[![Latest Stable Version](https://poser.pugx.org/cache/filesystem-adapter/v/stable)](https://packagist.org/packages/cache/filesystem-adapter)
[![codecov.io](https://codecov.io/github/php-cache/filesystem-adapter/coverage.svg?branch=master)](https://codecov.io/github/php-cache/filesystem-adapter?branch=master)
[![Total Downloads](https://poser.pugx.org/cache/filesystem-adapter/downloads)](https://packagist.org/packages/cache/filesystem-adapter)
[![Monthly Downloads](https://poser.pugx.org/cache/filesystem-adapter/d/monthly.png)](https://packagist.org/packages/cache/filesystem-adapter)
[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE)
This is a PSR-6 cache implementation using Filesystem. It is a part of the PHP Cache organisation. To read about
features like tagging and hierarchy support please read the shared documentation at [www.php-cache.com](http://www.php-cache.com).
This implementation is using the excellent [Flysystem](http://flysystem.thephpleague.com/).
### Install
```bash
composer require cache/filesystem-adapter
```
### Use
To create an instance of `FilesystemCachePool` you need to configure a `Filesystem` and its adapter.
```php
use League\Flysystem\Adapter\Local;
use League\Flysystem\Filesystem;
use Cache\Adapter\Filesystem\FilesystemCachePool;
$filesystemAdapter = new Local(__DIR__.'/');
$filesystem = new Filesystem($filesystemAdapter);
$pool = new FilesystemCachePool($filesystem);
```
You can change the folder the cache pool will write to through the `setFolder` setter:
```php
$pool = new FilesystemCachePool($filesystem);
$pool->setFolder('path/to/cache');
```
### Contribute
Contributions are very welcome! Send a pull request to the [main repository](https://github.com/php-cache/cache) or
report any issues you find on the [issue tracker](http://issues.php-cache.com).

55
vendor/cache/filesystem-adapter/composer.json

@ -0,0 +1,55 @@
{
"name": "cache/filesystem-adapter",
"description": "A PSR-6 cache implementation using filesystem. This implementation supports tags",
"license": "MIT",
"type": "library",
"keywords": [
"cache",
"psr-6",
"filesystem",
"tag"
],
"authors": [
{
"name": "Aaron Scherer",
"email": "aequasi@gmail.com",
"homepage": "https://github.com/aequasi"
},
{
"name": "Tobias Nyholm",
"email": "tobias.nyholm@gmail.com",
"homepage": "https://github.com/nyholm"
}
],
"homepage": "http://www.php-cache.com/en/latest/",
"require": {
"php": ">=7.4",
"cache/adapter-common": "^1.0",
"league/flysystem": "^1.0",
"psr/cache": "^1.0 || ^2.0",
"psr/simple-cache": "^1.0"
},
"require-dev": {
"cache/integration-tests": "^0.17",
"phpunit/phpunit": "^7.5.20 || ^9.5.10"
},
"provide": {
"psr/cache-implementation": "^1.0",
"psr/simple-cache-implementation": "^1.0"
},
"minimum-stability": "dev",
"prefer-stable": true,
"autoload": {
"psr-4": {
"Cache\\Adapter\\Filesystem\\": ""
},
"exclude-from-classmap": [
"/Tests/"
]
},
"extra": {
"branch-alias": {
"dev-master": "1.1-dev"
}
}
}

5
vendor/cache/tag-interop/.github/PULL_REQUEST_TEMPLATE.md

@ -0,0 +1,5 @@
This is a READ ONLY repository.
Please make your pull request to https://github.com/php-cache/cache
Thank you for contributing.

2
vendor/cache/tag-interop/.gitignore

@ -0,0 +1,2 @@
composer.lock
vendor

22
vendor/cache/tag-interop/.travis.yml

@ -0,0 +1,22 @@
language: php
sudo: false
matrix:
include:
- php: 7.1
cache:
directories:
- "$HOME/.composer/cache"
install:
- composer update --prefer-dist --prefer-stable
script:
- ./vendor/bin/phpunit --coverage-clover=coverage.xml
after_success:
- pip install --user codecov && codecov
notifications:
email: false

18
vendor/cache/tag-interop/Changelog.md

@ -0,0 +1,18 @@
# Change Log
The change log describes what is "Added", "Removed", "Changed" or "Fixed" between each release.
## 1.1.0
* Support PHP 8.1
* Support for psr/cache v2
## 1.0.1
* Support PHP 8
## 1.0.0
* First release

22
vendor/cache/tag-interop/LICENSE

@ -0,0 +1,22 @@
The MIT License (MIT)
Copyright (c) 2015 Aaron Scherer, Tobias Nyholm
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

25
vendor/cache/tag-interop/README.md

@ -0,0 +1,25 @@
# Tag support for PSR-6 Cache
[![Gitter](https://badges.gitter.im/php-cache/cache.svg)](https://gitter.im/php-cache/cache?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
[![Latest Stable Version](https://poser.pugx.org/cache/tag-interop/v/stable)](https://packagist.org/packages/cache/tag-interop)
[![Total Downloads](https://poser.pugx.org/cache/tag-interop/downloads)](https://packagist.org/packages/cache/tag-interop)
[![Monthly Downloads](https://poser.pugx.org/cache/tag-interop/d/monthly.png)](https://packagist.org/packages/cache/tag-interop)
[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE)
This repository holds two interfaces for tagging. These interfaces will make their
way into PHP Fig. Representatives from Symfony, PHP-cache and Drupal has worked
together to agree on these interfaces.
### Install
```bash
composer require cache/tag-interop
```
### Use
Read the [documentation on usage](http://www.php-cache.com/).
### Contribute
Contributions are very welcome! Send a pull request to the [main repository](https://github.com/php-cache/cache) or
report any issues you find on the [issue tracker](http://issues.php-cache.com).

43
vendor/cache/tag-interop/TaggableCacheItemInterface.php

@ -0,0 +1,43 @@
<?php
/*
* This file is part of php-cache organization.
*
* (c) 2015 Aaron Scherer <aequasi@gmail.com>, Tobias Nyholm <tobias.nyholm@gmail.com>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
namespace Cache\TagInterop;
use Psr\Cache\CacheItemInterface;
use Psr\Cache\InvalidArgumentException;
/**
* An item that supports tags. This interface is a soon-to-be-PSR.
*
* @author Tobias Nyholm <tobias.nyholm@gmail.com>
* @author Nicolas Grekas <p@tchwork.com>
*/
interface TaggableCacheItemInterface extends CacheItemInterface
{
/**
* Get all existing tags. These are the tags the item has when the item is
* returned from the pool.
*
* @return array
*/
public function getPreviousTags();
/**
* Overwrite all tags with a new set of tags.
*
* @param string[] $tags An array of tags
*
* @throws InvalidArgumentException When a tag is not valid.
*
* @return TaggableCacheItemInterface
*/
public function setTags(array $tags);
}

60
vendor/cache/tag-interop/TaggableCacheItemPoolInterface.php

@ -0,0 +1,60 @@
<?php
/*
* This file is part of php-cache organization.
*
* (c) 2015 Aaron Scherer <aequasi@gmail.com>, Tobias Nyholm <tobias.nyholm@gmail.com>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
namespace Cache\TagInterop;
use Psr\Cache\CacheItemPoolInterface;
use Psr\Cache\InvalidArgumentException;
/**
* Interface for invalidating cached items using tags. This interface is a soon-to-be-PSR.
*
* @author Tobias Nyholm <tobias.nyholm@gmail.com>
* @author Nicolas Grekas <p@tchwork.com>
*/
interface TaggableCacheItemPoolInterface extends CacheItemPoolInterface
{
/**
* Invalidates cached items using a tag.
*
* @param string $tag The tag to invalidate
*
* @throws InvalidArgumentException When $tags is not valid
*
* @return bool True on success
*/
public function invalidateTag($tag);
/**
* Invalidates cached items using tags.
*
* @param string[] $tags An array of tags to invalidate
*
* @throws InvalidArgumentException When $tags is not valid
*
* @return bool True on success
*/
public function invalidateTags(array $tags);
/**
* {@inheritdoc}
*
* @return TaggableCacheItemInterface
*/
public function getItem($key);
/**
* {@inheritdoc}
*
* @return array|\Traversable|TaggableCacheItemInterface[]
*/
public function getItems(array $keys = []);
}

39
vendor/cache/tag-interop/composer.json

@ -0,0 +1,39 @@
{
"name": "cache/tag-interop",
"description": "Framework interoperable interfaces for tags",
"license": "MIT",
"type": "library",
"keywords": [
"cache",
"psr6",
"tag",
"psr"
],
"authors": [
{
"name": "Tobias Nyholm",
"email": "tobias.nyholm@gmail.com",
"homepage": "https://github.com/nyholm"
},
{
"name": "Nicolas Grekas ",
"email": "p@tchwork.com",
"homepage": "https://github.com/nicolas-grekas"
}
],
"homepage": "https://www.php-cache.com/en/latest/",
"require": {
"php": "^5.5 || ^7.0 || ^8.0",
"psr/cache": "^1.0 || ^2.0"
},
"autoload": {
"psr-4": {
"Cache\\TagInterop\\": ""
}
},
"extra": {
"branch-alias": {
"dev-master": "1.1-dev"
}
}
}

572
vendor/composer/ClassLoader.php

@ -0,0 +1,572 @@
<?php
/*
* This file is part of Composer.
*
* (c) Nils Adermann <naderman@naderman.de>
* Jordi Boggiano <j.boggiano@seld.be>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Composer\Autoload;
/**
* ClassLoader implements a PSR-0, PSR-4 and classmap class loader.
*
* $loader = new \Composer\Autoload\ClassLoader();
*
* // register classes with namespaces
* $loader->add('Symfony\Component', __DIR__.'/component');
* $loader->add('Symfony', __DIR__.'/framework');
*
* // activate the autoloader
* $loader->register();
*
* // to enable searching the include path (eg. for PEAR packages)
* $loader->setUseIncludePath(true);
*
* In this example, if you try to use a class in the Symfony\Component
* namespace or one of its children (Symfony\Component\Console for instance),
* the autoloader will first look for the class under the component/
* directory, and it will then fallback to the framework/ directory if not
* found before giving up.
*
* This class is loosely based on the Symfony UniversalClassLoader.
*
* @author Fabien Potencier <fabien@symfony.com>
* @author Jordi Boggiano <j.boggiano@seld.be>
* @see https://www.php-fig.org/psr/psr-0/
* @see https://www.php-fig.org/psr/psr-4/
*/
class ClassLoader
{
/** @var ?string */
private $vendorDir;
// PSR-4
/**
* @var array[]
* @psalm-var array<string, array<string, int>>
*/
private $prefixLengthsPsr4 = array();
/**
* @var array[]
* @psalm-var array<string, array<int, string>>
*/
private $prefixDirsPsr4 = array();
/**
* @var array[]
* @psalm-var array<string, string>
*/
private $fallbackDirsPsr4 = array();
// PSR-0
/**
* @var array[]
* @psalm-var array<string, array<string, string[]>>
*/
private $prefixesPsr0 = array();
/**
* @var array[]
* @psalm-var array<string, string>
*/
private $fallbackDirsPsr0 = array();
/** @var bool */
private $useIncludePath = false;
/**
* @var string[]
* @psalm-var array<string, string>
*/
private $classMap = array();
/** @var bool */
private $classMapAuthoritative = false;
/**
* @var bool[]
* @psalm-var array<string, bool>
*/
private $missingClasses = array();
/** @var ?string */
private $apcuPrefix;
/**
* @var self[]
*/
private static $registeredLoaders = array();
/**
* @param ?string $vendorDir
*/
public function __construct($vendorDir = null)
{
$this->vendorDir = $vendorDir;
}
/**
* @return string[]
*/
public function getPrefixes()
{
if (!empty($this->prefixesPsr0)) {
return call_user_func_array('array_merge', array_values($this->prefixesPsr0));
}
return array();
}
/**
* @return array[]
* @psalm-return array<string, array<int, string>>
*/
public function getPrefixesPsr4()
{
return $this->prefixDirsPsr4;
}
/**
* @return array[]
* @psalm-return array<string, string>
*/
public function getFallbackDirs()
{
return $this->fallbackDirsPsr0;
}
/**
* @return array[]
* @psalm-return array<string, string>
*/
public function getFallbackDirsPsr4()
{
return $this->fallbackDirsPsr4;
}
/**
* @return string[] Array of classname => path
* @psalm-return array<string, string>
*/
public function getClassMap()
{
return $this->classMap;
}
/**
* @param string[] $classMap Class to filename map
* @psalm-param array<string, string> $classMap
*
* @return void
*/
public function addClassMap(array $classMap)
{
if ($this->classMap) {
$this->classMap = array_merge($this->classMap, $classMap);
} else {
$this->classMap = $classMap;
}
}
/**
* Registers a set of PSR-0 directories for a given prefix, either
* appending or prepending to the ones previously set for this prefix.
*
* @param string $prefix The prefix
* @param string[]|string $paths The PSR-0 root directories
* @param bool $prepend Whether to prepend the directories
*
* @return void
*/
public function add($prefix, $paths, $prepend = false)
{
if (!$prefix) {
if ($prepend) {
$this->fallbackDirsPsr0 = array_merge(
(array) $paths,
$this->fallbackDirsPsr0
);
} else {
$this->fallbackDirsPsr0 = array_merge(
$this->fallbackDirsPsr0,
(array) $paths
);
}
return;
}
$first = $prefix[0];
if (!isset($this->prefixesPsr0[$first][$prefix])) {
$this->prefixesPsr0[$first][$prefix] = (array) $paths;
return;
}
if ($prepend) {
$this->prefixesPsr0[$first][$prefix] = array_merge(
(array) $paths,
$this->prefixesPsr0[$first][$prefix]
);
} else {
$this->prefixesPsr0[$first][$prefix] = array_merge(
$this->prefixesPsr0[$first][$prefix],
(array) $paths
);
}
}
/**
* Registers a set of PSR-4 directories for a given namespace, either
* appending or prepending to the ones previously set for this namespace.
*
* @param string $prefix The prefix/namespace, with trailing '\\'
* @param string[]|string $paths The PSR-4 base directories
* @param bool $prepend Whether to prepend the directories
*
* @throws \InvalidArgumentException
*
* @return void
*/
public function addPsr4($prefix, $paths, $prepend = false)
{
if (!$prefix) {
// Register directories for the root namespace.
if ($prepend) {
$this->fallbackDirsPsr4 = array_merge(
(array) $paths,
$this->fallbackDirsPsr4
);
} else {
$this->fallbackDirsPsr4 = array_merge(
$this->fallbackDirsPsr4,
(array) $paths
);
}
} elseif (!isset($this->prefixDirsPsr4[$prefix])) {
// Register directories for a new namespace.
$length = strlen($prefix);
if ('\\' !== $prefix[$length - 1]) {
throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
}
$this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
$this->prefixDirsPsr4[$prefix] = (array) $paths;
} elseif ($prepend) {
// Prepend directories for an already registered namespace.
$this->prefixDirsPsr4[$prefix] = array_merge(
(array) $paths,
$this->prefixDirsPsr4[$prefix]
);
} else {
// Append directories for an already registered namespace.
$this->prefixDirsPsr4[$prefix] = array_merge(
$this->prefixDirsPsr4[$prefix],
(array) $paths
);
}
}
/**
* Registers a set of PSR-0 directories for a given prefix,
* replacing any others previously set for this prefix.
*
* @param string $prefix The prefix
* @param string[]|string $paths The PSR-0 base directories
*
* @return void
*/
public function set($prefix, $paths)
{
if (!$prefix) {
$this->fallbackDirsPsr0 = (array) $paths;
} else {
$this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths;
}
}
/**
* Registers a set of PSR-4 directories for a given namespace,
* replacing any others previously set for this namespace.
*
* @param string $prefix The prefix/namespace, with trailing '\\'
* @param string[]|string $paths The PSR-4 base directories
*
* @throws \InvalidArgumentException
*
* @return void
*/
public function setPsr4($prefix, $paths)
{
if (!$prefix) {
$this->fallbackDirsPsr4 = (array) $paths;
} else {
$length = strlen($prefix);
if ('\\' !== $prefix[$length - 1]) {
throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
}
$this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
$this->prefixDirsPsr4[$prefix] = (array) $paths;
}
}
/**
* Turns on searching the include path for class files.
*
* @param bool $useIncludePath
*
* @return void
*/
public function setUseIncludePath($useIncludePath)
{
$this->useIncludePath = $useIncludePath;
}
/**
* Can be used to check if the autoloader uses the include path to check
* for classes.
*
* @return bool
*/
public function getUseIncludePath()
{
return $this->useIncludePath;
}
/**
* Turns off searching the prefix and fallback directories for classes
* that have not been registered with the class map.
*
* @param bool $classMapAuthoritative
*
* @return void
*/
public function setClassMapAuthoritative($classMapAuthoritative)
{
$this->classMapAuthoritative = $classMapAuthoritative;
}
/**
* Should class lookup fail if not found in the current class map?
*
* @return bool
*/
public function isClassMapAuthoritative()
{
return $this->classMapAuthoritative;
}
/**
* APCu prefix to use to cache found/not-found classes, if the extension is enabled.
*
* @param string|null $apcuPrefix
*
* @return void
*/
public function setApcuPrefix($apcuPrefix)
{
$this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null;
}
/**
* The APCu prefix in use, or null if APCu caching is not enabled.
*
* @return string|null
*/
public function getApcuPrefix()
{
return $this->apcuPrefix;
}
/**
* Registers this instance as an autoloader.
*
* @param bool $prepend Whether to prepend the autoloader or not
*
* @return void
*/
public function register($prepend = false)
{
spl_autoload_register(array($this, 'loadClass'), true, $prepend);
if (null === $this->vendorDir) {
return;
}
if ($prepend) {
self::$registeredLoaders = array($this->vendorDir => $this) + self::$registeredLoaders;
} else {
unset(self::$registeredLoaders[$this->vendorDir]);
self::$registeredLoaders[$this->vendorDir] = $this;
}
}
/**
* Unregisters this instance as an autoloader.
*
* @return void
*/
public function unregister()
{
spl_autoload_unregister(array($this, 'loadClass'));
if (null !== $this->vendorDir) {
unset(self::$registeredLoaders[$this->vendorDir]);
}
}
/**
* Loads the given class or interface.
*
* @param string $class The name of the class
* @return true|null True if loaded, null otherwise
*/
public function loadClass($class)
{
if ($file = $this->findFile($class)) {
includeFile($file);
return true;
}
return null;
}
/**
* Finds the path to the file where the class is defined.
*
* @param string $class The name of the class
*
* @return string|false The path if found, false otherwise
*/
public function findFile($class)
{
// class map lookup
if (isset($this->classMap[$class])) {
return $this->classMap[$class];
}
if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) {
return false;
}
if (null !== $this->apcuPrefix) {
$file = apcu_fetch($this->apcuPrefix.$class, $hit);
if ($hit) {
return $file;
}
}
$file = $this->findFileWithExtension($class, '.php');
// Search for Hack files if we are running on HHVM
if (false === $file && defined('HHVM_VERSION')) {
$file = $this->findFileWithExtension($class, '.hh');
}
if (null !== $this->apcuPrefix) {
apcu_add($this->apcuPrefix.$class, $file);
}
if (false === $file) {
// Remember that this class does not exist.
$this->missingClasses[$class] = true;
}
return $file;
}
/**
* Returns the currently registered loaders indexed by their corresponding vendor directories.
*
* @return self[]
*/
public static function getRegisteredLoaders()
{
return self::$registeredLoaders;
}
/**
* @param string $class
* @param string $ext
* @return string|false
*/
private function findFileWithExtension($class, $ext)
{
// PSR-4 lookup
$logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext;
$first = $class[0];
if (isset($this->prefixLengthsPsr4[$first])) {
$subPath = $class;
while (false !== $lastPos = strrpos($subPath, '\\')) {
$subPath = substr($subPath, 0, $lastPos);
$search = $subPath . '\\';
if (isset($this->prefixDirsPsr4[$search])) {
$pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1);
foreach ($this->prefixDirsPsr4[$search] as $dir) {
if (file_exists($file = $dir . $pathEnd)) {
return $file;
}
}
}
}
}
// PSR-4 fallback dirs
foreach ($this->fallbackDirsPsr4 as $dir) {
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) {
return $file;
}
}
// PSR-0 lookup
if (false !== $pos = strrpos($class, '\\')) {
// namespaced class name
$logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1)
. strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR);
} else {
// PEAR-like class name
$logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext;
}
if (isset($this->prefixesPsr0[$first])) {
foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) {
if (0 === strpos($class, $prefix)) {
foreach ($dirs as $dir) {
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
return $file;
}
}
}
}
}
// PSR-0 fallback dirs
foreach ($this->fallbackDirsPsr0 as $dir) {
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
return $file;
}
}
// PSR-0 include paths.
if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) {
return $file;
}
return false;
}
}
/**
* Scope isolated include.
*
* Prevents access to $this/self from included files.
*
* @param string $file
* @return void
* @private
*/
function includeFile($file)
{
include $file;
}

352
vendor/composer/InstalledVersions.php

@ -0,0 +1,352 @@
<?php
/*
* This file is part of Composer.
*
* (c) Nils Adermann <naderman@naderman.de>
* Jordi Boggiano <j.boggiano@seld.be>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Composer;
use Composer\Autoload\ClassLoader;
use Composer\Semver\VersionParser;
/**
* This class is copied in every Composer installed project and available to all
*
* See also https://getcomposer.org/doc/07-runtime.md#installed-versions
*
* To require its presence, you can require `composer-runtime-api ^2.0`
*
* @final
*/
class InstalledVersions
{
/**
* @var mixed[]|null
* @psalm-var array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}|array{}|null
*/
private static $installed;
/**
* @var bool|null
*/
private static $canGetVendors;
/**
* @var array[]
* @psalm-var array<string, array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}>
*/
private static $installedByVendor = array();
/**
* Returns a list of all package names which are present, either by being installed, replaced or provided
*
* @return string[]
* @psalm-return list<string>
*/
public static function getInstalledPackages()
{
$packages = array();
foreach (self::getInstalled() as $installed) {
$packages[] = array_keys($installed['versions']);
}
if (1 === \count($packages)) {
return $packages[0];
}
return array_keys(array_flip(\call_user_func_array('array_merge', $packages)));
}
/**
* Returns a list of all package names with a specific type e.g. 'library'
*
* @param string $type
* @return string[]
* @psalm-return list<string>
*/
public static function getInstalledPackagesByType($type)
{
$packagesByType = array();
foreach (self::getInstalled() as $installed) {
foreach ($installed['versions'] as $name => $package) {
if (isset($package['type']) && $package['type'] === $type) {
$packagesByType[] = $name;
}
}
}
return $packagesByType;
}
/**
* Checks whether the given package is installed
*
* This also returns true if the package name is provided or replaced by another package
*
* @param string $packageName
* @param bool $includeDevRequirements
* @return bool
*/
public static function isInstalled($packageName, $includeDevRequirements = true)
{
foreach (self::getInstalled() as $installed) {
if (isset($installed['versions'][$packageName])) {
return $includeDevRequirements || empty($installed['versions'][$packageName]['dev_requirement']);
}
}
return false;
}
/**
* Checks whether the given package satisfies a version constraint
*
* e.g. If you want to know whether version 2.3+ of package foo/bar is installed, you would call:
*
* Composer\InstalledVersions::satisfies(new VersionParser, 'foo/bar', '^2.3')
*
* @param VersionParser $parser Install composer/semver to have access to this class and functionality
* @param string $packageName
* @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
* @return bool
*/
public static function satisfies(VersionParser $parser, $packageName, $constraint)
{
$constraint = $parser->parseConstraints($constraint);
$provided = $parser->parseConstraints(self::getVersionRanges($packageName));
return $provided->matches($constraint);
}
/**
* Returns a version constraint representing all the range(s) which are installed for a given package
*
* It is easier to use this via isInstalled() with the $constraint argument if you need to check
* whether a given version of a package is installed, and not just whether it exists
*
* @param string $packageName
* @return string Version constraint usable with composer/semver
*/
public static function getVersionRanges($packageName)
{
foreach (self::getInstalled() as $installed) {
if (!isset($installed['versions'][$packageName])) {
continue;
}
$ranges = array();
if (isset($installed['versions'][$packageName]['pretty_version'])) {
$ranges[] = $installed['versions'][$packageName]['pretty_version'];
}
if (array_key_exists('aliases', $installed['versions'][$packageName])) {
$ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']);
}
if (array_key_exists('replaced', $installed['versions'][$packageName])) {
$ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']);
}
if (array_key_exists('provided', $installed['versions'][$packageName])) {
$ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']);
}
return implode(' || ', $ranges);
}
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
}
/**
* @param string $packageName
* @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
*/
public static function getVersion($packageName)
{
foreach (self::getInstalled() as $installed) {
if (!isset($installed['versions'][$packageName])) {
continue;
}
if (!isset($installed['versions'][$packageName]['version'])) {
return null;
}
return $installed['versions'][$packageName]['version'];
}
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
}
/**
* @param string $packageName
* @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
*/
public static function getPrettyVersion($packageName)
{
foreach (self::getInstalled() as $installed) {
if (!isset($installed['versions'][$packageName])) {
continue;
}
if (!isset($installed['versions'][$packageName]['pretty_version'])) {
return null;
}
return $installed['versions'][$packageName]['pretty_version'];
}
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
}
/**
* @param string $packageName
* @return string|null If the package is being replaced or provided but is not really installed, null will be returned as reference
*/
public static function getReference($packageName)
{
foreach (self::getInstalled() as $installed) {
if (!isset($installed['versions'][$packageName])) {
continue;
}
if (!isset($installed['versions'][$packageName]['reference'])) {
return null;
}
return $installed['versions'][$packageName]['reference'];
}
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
}
/**
* @param string $packageName
* @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.
*/
public static function getInstallPath($packageName)
{
foreach (self::getInstalled() as $installed) {
if (!isset($installed['versions'][$packageName])) {
continue;
}
return isset($installed['versions'][$packageName]['install_path']) ? $installed['versions'][$packageName]['install_path'] : null;
}
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
}
/**
* @return array
* @psalm-return array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}
*/
public static function getRootPackage()
{
$installed = self::getInstalled();
return $installed[0]['root'];
}
/**
* Returns the raw installed.php data for custom implementations
*
* @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.
* @return array[]
* @psalm-return array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}
*/
public static function getRawData()
{
@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);
if (null === self::$installed) {
// only require the installed.php file if this file is loaded from its dumped location,
// and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937
if (substr(__DIR__, -8, 1) !== 'C') {
self::$installed = include __DIR__ . '/installed.php';
} else {
self::$installed = array();
}
}
return self::$installed;
}
/**
* Returns the raw data of all installed.php which are currently loaded for custom implementations
*
* @return array[]
* @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}>
*/
public static function getAllRawData()
{
return self::getInstalled();
}
/**
* Lets you reload the static array from another file
*
* This is only useful for complex integrations in which a project needs to use
* this class but then also needs to execute another project's autoloader in process,
* and wants to ensure both projects have access to their version of installed.php.
*
* A typical case would be PHPUnit, where it would need to make sure it reads all
* the data it needs from this class, then call reload() with
* `require $CWD/vendor/composer/installed.php` (or similar) as input to make sure
* the project in which it runs can then also use this class safely, without
* interference between PHPUnit's dependencies and the project's dependencies.
*
* @param array[] $data A vendor/composer/installed.php data set
* @return void
*
* @psalm-param array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>} $data
*/
public static function reload($data)
{
self::$installed = $data;
self::$installedByVendor = array();
}
/**
* @return array[]
* @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}>
*/
private static function getInstalled()
{
if (null === self::$canGetVendors) {
self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders');
}
$installed = array();
if (self::$canGetVendors) {
foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) {
if (isset(self::$installedByVendor[$vendorDir])) {
$installed[] = self::$installedByVendor[$vendorDir];
} elseif (is_file($vendorDir.'/composer/installed.php')) {
$installed[] = self::$installedByVendor[$vendorDir] = require $vendorDir.'/composer/installed.php';
if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) {
self::$installed = $installed[count($installed) - 1];
}
}
}
}
if (null === self::$installed) {
// only require the installed.php file if this file is loaded from its dumped location,
// and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937
if (substr(__DIR__, -8, 1) !== 'C') {
self::$installed = require __DIR__ . '/installed.php';
} else {
self::$installed = array();
}
}
$installed[] = self::$installed;
return $installed;
}
}

21
vendor/composer/LICENSE

@ -0,0 +1,21 @@
Copyright (c) Nils Adermann, Jordi Boggiano
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is furnished
to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

28
vendor/composer/autoload_classmap.php

@ -0,0 +1,28 @@
<?php
// autoload_classmap.php @generated by Composer
$vendorDir = dirname(__DIR__);
$baseDir = dirname($vendorDir);
return array(
'Attribute' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/Attribute.php',
'Callback' => $vendorDir . '/jaeger/phpquery-single/phpQuery.php',
'CallbackBody' => $vendorDir . '/jaeger/phpquery-single/phpQuery.php',
'CallbackParam' => $vendorDir . '/jaeger/phpquery-single/phpQuery.php',
'CallbackParameterToReference' => $vendorDir . '/jaeger/phpquery-single/phpQuery.php',
'CallbackReturnReference' => $vendorDir . '/jaeger/phpquery-single/phpQuery.php',
'CallbackReturnValue' => $vendorDir . '/jaeger/phpquery-single/phpQuery.php',
'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php',
'DOMDocumentWrapper' => $vendorDir . '/jaeger/phpquery-single/phpQuery.php',
'DOMEvent' => $vendorDir . '/jaeger/phpquery-single/phpQuery.php',
'ICallbackNamed' => $vendorDir . '/jaeger/phpquery-single/phpQuery.php',
'PhpToken' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/PhpToken.php',
'Stringable' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/Stringable.php',
'UnhandledMatchError' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php',
'ValueError' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/ValueError.php',
'phpQuery' => $vendorDir . '/jaeger/phpquery-single/phpQuery.php',
'phpQueryEvents' => $vendorDir . '/jaeger/phpquery-single/phpQuery.php',
'phpQueryObject' => $vendorDir . '/jaeger/phpquery-single/phpQuery.php',
'phpQueryPlugins' => $vendorDir . '/jaeger/phpquery-single/phpQuery.php',
);

18
vendor/composer/autoload_files.php

@ -0,0 +1,18 @@
<?php
// autoload_files.php @generated by Composer
$vendorDir = dirname(__DIR__);
$baseDir = dirname($vendorDir);
return array(
'7b11c4dc42b3b3023073cb14e519683c' => $vendorDir . '/ralouphie/getallheaders/src/getallheaders.php',
'c964ee0ededf28c96ebd9db5099ef910' => $vendorDir . '/guzzlehttp/promises/src/functions_include.php',
'6e3fae29631ef280660b3cdad06f25a8' => $vendorDir . '/symfony/deprecation-contracts/function.php',
'0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => $vendorDir . '/symfony/polyfill-mbstring/bootstrap.php',
'a4a119a56e50fbb293281d9a48007e0e' => $vendorDir . '/symfony/polyfill-php80/bootstrap.php',
'37a3dc5111fe8f707ab4c132ef1dbc62' => $vendorDir . '/guzzlehttp/guzzle/src/functions_include.php',
'667aeda72477189d0494fecd327c3641' => $vendorDir . '/symfony/var-dumper/Resources/functions/dump.php',
'fe62ba7e10580d903cc46d808b5961a4' => $vendorDir . '/tightenco/collect/src/Collect/Support/helpers.php',
'caf31cc6ec7cf2241cb6f12c226c3846' => $vendorDir . '/tightenco/collect/src/Collect/Support/alias.php',
);

9
vendor/composer/autoload_namespaces.php

@ -0,0 +1,9 @@
<?php
// autoload_namespaces.php @generated by Composer
$vendorDir = dirname(__DIR__);
$baseDir = dirname($vendorDir);
return array(
);

29
vendor/composer/autoload_psr4.php

@ -0,0 +1,29 @@
<?php
// autoload_psr4.php @generated by Composer
$vendorDir = dirname(__DIR__);
$baseDir = dirname($vendorDir);
return array(
'Yuanjiajia\\Qldome\\' => array($baseDir . '/src'),
'Tightenco\\Collect\\' => array($vendorDir . '/tightenco/collect/src/Collect'),
'Symfony\\Polyfill\\Php80\\' => array($vendorDir . '/symfony/polyfill-php80'),
'Symfony\\Polyfill\\Mbstring\\' => array($vendorDir . '/symfony/polyfill-mbstring'),
'Symfony\\Component\\VarDumper\\' => array($vendorDir . '/symfony/var-dumper'),
'QL\\' => array($vendorDir . '/jaeger/querylist/src'),
'Psr\\SimpleCache\\' => array($vendorDir . '/psr/simple-cache/src'),
'Psr\\Log\\' => array($vendorDir . '/psr/log/Psr/Log'),
'Psr\\Http\\Message\\' => array($vendorDir . '/psr/http-message/src', $vendorDir . '/psr/http-factory/src'),
'Psr\\Http\\Client\\' => array($vendorDir . '/psr/http-client/src'),
'Psr\\Cache\\' => array($vendorDir . '/psr/cache/src'),
'League\\MimeTypeDetection\\' => array($vendorDir . '/league/mime-type-detection/src'),
'League\\Flysystem\\' => array($vendorDir . '/league/flysystem/src'),
'Jaeger\\' => array($vendorDir . '/jaeger/g-http/src'),
'GuzzleHttp\\Psr7\\' => array($vendorDir . '/guzzlehttp/psr7/src'),
'GuzzleHttp\\Promise\\' => array($vendorDir . '/guzzlehttp/promises/src'),
'GuzzleHttp\\' => array($vendorDir . '/guzzlehttp/guzzle/src'),
'Cache\\TagInterop\\' => array($vendorDir . '/cache/tag-interop'),
'Cache\\Adapter\\Filesystem\\' => array($vendorDir . '/cache/filesystem-adapter'),
'Cache\\Adapter\\Common\\' => array($vendorDir . '/cache/adapter-common'),
);

57
vendor/composer/autoload_real.php

@ -0,0 +1,57 @@
<?php
// autoload_real.php @generated by Composer
class ComposerAutoloaderInit8583f236fb7cd3ae1a5996e2fc00e413
{
private static $loader;
public static function loadClassLoader($class)
{
if ('Composer\Autoload\ClassLoader' === $class) {
require __DIR__ . '/ClassLoader.php';
}
}
/**
* @return \Composer\Autoload\ClassLoader
*/
public static function getLoader()
{
if (null !== self::$loader) {
return self::$loader;
}
require __DIR__ . '/platform_check.php';
spl_autoload_register(array('ComposerAutoloaderInit8583f236fb7cd3ae1a5996e2fc00e413', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
spl_autoload_unregister(array('ComposerAutoloaderInit8583f236fb7cd3ae1a5996e2fc00e413', 'loadClassLoader'));
require __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInit8583f236fb7cd3ae1a5996e2fc00e413::getInitializer($loader));
$loader->register(true);
$includeFiles = \Composer\Autoload\ComposerStaticInit8583f236fb7cd3ae1a5996e2fc00e413::$files;
foreach ($includeFiles as $fileIdentifier => $file) {
composerRequire8583f236fb7cd3ae1a5996e2fc00e413($fileIdentifier, $file);
}
return $loader;
}
}
/**
* @param string $fileIdentifier
* @param string $file
* @return void
*/
function composerRequire8583f236fb7cd3ae1a5996e2fc00e413($fileIdentifier, $file)
{
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
require $file;
}
}

186
vendor/composer/autoload_static.php

@ -0,0 +1,186 @@
<?php
// autoload_static.php @generated by Composer
namespace Composer\Autoload;
class ComposerStaticInit8583f236fb7cd3ae1a5996e2fc00e413
{
public static $files = array (
'7b11c4dc42b3b3023073cb14e519683c' => __DIR__ . '/..' . '/ralouphie/getallheaders/src/getallheaders.php',
'c964ee0ededf28c96ebd9db5099ef910' => __DIR__ . '/..' . '/guzzlehttp/promises/src/functions_include.php',
'6e3fae29631ef280660b3cdad06f25a8' => __DIR__ . '/..' . '/symfony/deprecation-contracts/function.php',
'0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php',
'a4a119a56e50fbb293281d9a48007e0e' => __DIR__ . '/..' . '/symfony/polyfill-php80/bootstrap.php',
'37a3dc5111fe8f707ab4c132ef1dbc62' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/functions_include.php',
'667aeda72477189d0494fecd327c3641' => __DIR__ . '/..' . '/symfony/var-dumper/Resources/functions/dump.php',
'fe62ba7e10580d903cc46d808b5961a4' => __DIR__ . '/..' . '/tightenco/collect/src/Collect/Support/helpers.php',
'caf31cc6ec7cf2241cb6f12c226c3846' => __DIR__ . '/..' . '/tightenco/collect/src/Collect/Support/alias.php',
);
public static $prefixLengthsPsr4 = array (
'Y' =>
array (
'Yuanjiajia\\Qldome\\' => 18,
),
'T' =>
array (
'Tightenco\\Collect\\' => 18,
),
'S' =>
array (
'Symfony\\Polyfill\\Php80\\' => 23,
'Symfony\\Polyfill\\Mbstring\\' => 26,
'Symfony\\Component\\VarDumper\\' => 28,
),
'Q' =>
array (
'QL\\' => 3,
),
'P' =>
array (
'Psr\\SimpleCache\\' => 16,
'Psr\\Log\\' => 8,
'Psr\\Http\\Message\\' => 17,
'Psr\\Http\\Client\\' => 16,
'Psr\\Cache\\' => 10,
),
'L' =>
array (
'League\\MimeTypeDetection\\' => 25,
'League\\Flysystem\\' => 17,
),
'J' =>
array (
'Jaeger\\' => 7,
),
'G' =>
array (
'GuzzleHttp\\Psr7\\' => 16,
'GuzzleHttp\\Promise\\' => 19,
'GuzzleHttp\\' => 11,
),
'C' =>
array (
'Cache\\TagInterop\\' => 17,
'Cache\\Adapter\\Filesystem\\' => 25,
'Cache\\Adapter\\Common\\' => 21,
),
);
public static $prefixDirsPsr4 = array (
'Yuanjiajia\\Qldome\\' =>
array (
0 => __DIR__ . '/../..' . '/src',
),
'Tightenco\\Collect\\' =>
array (
0 => __DIR__ . '/..' . '/tightenco/collect/src/Collect',
),
'Symfony\\Polyfill\\Php80\\' =>
array (
0 => __DIR__ . '/..' . '/symfony/polyfill-php80',
),
'Symfony\\Polyfill\\Mbstring\\' =>
array (
0 => __DIR__ . '/..' . '/symfony/polyfill-mbstring',
),
'Symfony\\Component\\VarDumper\\' =>
array (
0 => __DIR__ . '/..' . '/symfony/var-dumper',
),
'QL\\' =>
array (
0 => __DIR__ . '/..' . '/jaeger/querylist/src',
),
'Psr\\SimpleCache\\' =>
array (
0 => __DIR__ . '/..' . '/psr/simple-cache/src',
),
'Psr\\Log\\' =>
array (
0 => __DIR__ . '/..' . '/psr/log/Psr/Log',
),
'Psr\\Http\\Message\\' =>
array (
0 => __DIR__ . '/..' . '/psr/http-message/src',
1 => __DIR__ . '/..' . '/psr/http-factory/src',
),
'Psr\\Http\\Client\\' =>
array (
0 => __DIR__ . '/..' . '/psr/http-client/src',
),
'Psr\\Cache\\' =>
array (
0 => __DIR__ . '/..' . '/psr/cache/src',
),
'League\\MimeTypeDetection\\' =>
array (
0 => __DIR__ . '/..' . '/league/mime-type-detection/src',
),
'League\\Flysystem\\' =>
array (
0 => __DIR__ . '/..' . '/league/flysystem/src',
),
'Jaeger\\' =>
array (
0 => __DIR__ . '/..' . '/jaeger/g-http/src',
),
'GuzzleHttp\\Psr7\\' =>
array (
0 => __DIR__ . '/..' . '/guzzlehttp/psr7/src',
),
'GuzzleHttp\\Promise\\' =>
array (
0 => __DIR__ . '/..' . '/guzzlehttp/promises/src',
),
'GuzzleHttp\\' =>
array (
0 => __DIR__ . '/..' . '/guzzlehttp/guzzle/src',
),
'Cache\\TagInterop\\' =>
array (
0 => __DIR__ . '/..' . '/cache/tag-interop',
),
'Cache\\Adapter\\Filesystem\\' =>
array (
0 => __DIR__ . '/..' . '/cache/filesystem-adapter',
),
'Cache\\Adapter\\Common\\' =>
array (
0 => __DIR__ . '/..' . '/cache/adapter-common',
),
);
public static $classMap = array (
'Attribute' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/Attribute.php',
'Callback' => __DIR__ . '/..' . '/jaeger/phpquery-single/phpQuery.php',
'CallbackBody' => __DIR__ . '/..' . '/jaeger/phpquery-single/phpQuery.php',
'CallbackParam' => __DIR__ . '/..' . '/jaeger/phpquery-single/phpQuery.php',
'CallbackParameterToReference' => __DIR__ . '/..' . '/jaeger/phpquery-single/phpQuery.php',
'CallbackReturnReference' => __DIR__ . '/..' . '/jaeger/phpquery-single/phpQuery.php',
'CallbackReturnValue' => __DIR__ . '/..' . '/jaeger/phpquery-single/phpQuery.php',
'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php',
'DOMDocumentWrapper' => __DIR__ . '/..' . '/jaeger/phpquery-single/phpQuery.php',
'DOMEvent' => __DIR__ . '/..' . '/jaeger/phpquery-single/phpQuery.php',
'ICallbackNamed' => __DIR__ . '/..' . '/jaeger/phpquery-single/phpQuery.php',
'PhpToken' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/PhpToken.php',
'Stringable' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/Stringable.php',
'UnhandledMatchError' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php',
'ValueError' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/ValueError.php',
'phpQuery' => __DIR__ . '/..' . '/jaeger/phpquery-single/phpQuery.php',
'phpQueryEvents' => __DIR__ . '/..' . '/jaeger/phpquery-single/phpQuery.php',
'phpQueryObject' => __DIR__ . '/..' . '/jaeger/phpquery-single/phpQuery.php',
'phpQueryPlugins' => __DIR__ . '/..' . '/jaeger/phpquery-single/phpQuery.php',
);
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInit8583f236fb7cd3ae1a5996e2fc00e413::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit8583f236fb7cd3ae1a5996e2fc00e413::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInit8583f236fb7cd3ae1a5996e2fc00e413::$classMap;
}, null, ClassLoader::class);
}
}

1629
vendor/composer/installed.json
File diff suppressed because it is too large
View File

260
vendor/composer/installed.php

@ -0,0 +1,260 @@
<?php return array(
'root' => array(
'pretty_version' => '1.0.0+no-version-set',
'version' => '1.0.0.0',
'type' => 'library',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
'reference' => NULL,
'name' => 'yuanjiajia/qldome',
'dev' => true,
),
'versions' => array(
'cache/adapter-common' => array(
'pretty_version' => '1.3.0',
'version' => '1.3.0.0',
'type' => 'library',
'install_path' => __DIR__ . '/../cache/adapter-common',
'aliases' => array(),
'reference' => '8788309be72aa7be69b88cdc0687549c74a7d479',
'dev_requirement' => false,
),
'cache/filesystem-adapter' => array(
'pretty_version' => '1.2.0',
'version' => '1.2.0.0',
'type' => 'library',
'install_path' => __DIR__ . '/../cache/filesystem-adapter',
'aliases' => array(),
'reference' => 'f1faaae40aaa696ef899cef6f6888aedb90b419b',
'dev_requirement' => false,
),
'cache/tag-interop' => array(
'pretty_version' => '1.1.0',
'version' => '1.1.0.0',
'type' => 'library',
'install_path' => __DIR__ . '/../cache/tag-interop',
'aliases' => array(),
'reference' => 'b062b1d735357da50edf8387f7a8696f3027d328',
'dev_requirement' => false,
),
'guzzlehttp/guzzle' => array(
'pretty_version' => '7.5.0',
'version' => '7.5.0.0',
'type' => 'library',
'install_path' => __DIR__ . '/../guzzlehttp/guzzle',
'aliases' => array(),
'reference' => 'b50a2a1251152e43f6a37f0fa053e730a67d25ba',
'dev_requirement' => false,
),
'guzzlehttp/promises' => array(
'pretty_version' => '1.5.2',
'version' => '1.5.2.0',
'type' => 'library',
'install_path' => __DIR__ . '/../guzzlehttp/promises',
'aliases' => array(),
'reference' => 'b94b2807d85443f9719887892882d0329d1e2598',
'dev_requirement' => false,
),
'guzzlehttp/psr7' => array(
'pretty_version' => '2.4.3',
'version' => '2.4.3.0',
'type' => 'library',
'install_path' => __DIR__ . '/../guzzlehttp/psr7',
'aliases' => array(),
'reference' => '67c26b443f348a51926030c83481b85718457d3d',
'dev_requirement' => false,
),
'jaeger/g-http' => array(
'pretty_version' => 'V1.7.2',
'version' => '1.7.2.0',
'type' => 'library',
'install_path' => __DIR__ . '/../jaeger/g-http',
'aliases' => array(),
'reference' => '82585ddd5e2c6651e37ab1d8166efcdbb6b293d4',
'dev_requirement' => false,
),
'jaeger/phpquery-single' => array(
'pretty_version' => '1.1.1',
'version' => '1.1.1.0',
'type' => 'library',
'install_path' => __DIR__ . '/../jaeger/phpquery-single',
'aliases' => array(),
'reference' => '39a650ade692a6b480c22220dce0c198d6a946fb',
'dev_requirement' => false,
),
'jaeger/querylist' => array(
'pretty_version' => 'V4.2.8',
'version' => '4.2.8.0',
'type' => 'library',
'install_path' => __DIR__ . '/../jaeger/querylist',
'aliases' => array(),
'reference' => '39dc0ca9c668bec7a793e20472ccd7d26ef89ea4',
'dev_requirement' => false,
),
'league/flysystem' => array(
'pretty_version' => '1.1.10',
'version' => '1.1.10.0',
'type' => 'library',
'install_path' => __DIR__ . '/../league/flysystem',
'aliases' => array(),
'reference' => '3239285c825c152bcc315fe0e87d6b55f5972ed1',
'dev_requirement' => false,
),
'league/mime-type-detection' => array(
'pretty_version' => '1.11.0',
'version' => '1.11.0.0',
'type' => 'library',
'install_path' => __DIR__ . '/../league/mime-type-detection',
'aliases' => array(),
'reference' => 'ff6248ea87a9f116e78edd6002e39e5128a0d4dd',
'dev_requirement' => false,
),
'psr/cache' => array(
'pretty_version' => '1.0.1',
'version' => '1.0.1.0',
'type' => 'library',
'install_path' => __DIR__ . '/../psr/cache',
'aliases' => array(),
'reference' => 'd11b50ad223250cf17b86e38383413f5a6764bf8',
'dev_requirement' => false,
),
'psr/cache-implementation' => array(
'dev_requirement' => false,
'provided' => array(
0 => '^1.0',
),
),
'psr/http-client' => array(
'pretty_version' => '1.0.1',
'version' => '1.0.1.0',
'type' => 'library',
'install_path' => __DIR__ . '/../psr/http-client',
'aliases' => array(),
'reference' => '2dfb5f6c5eff0e91e20e913f8c5452ed95b86621',
'dev_requirement' => false,
),
'psr/http-client-implementation' => array(
'dev_requirement' => false,
'provided' => array(
0 => '1.0',
),
),
'psr/http-factory' => array(
'pretty_version' => '1.0.1',
'version' => '1.0.1.0',
'type' => 'library',
'install_path' => __DIR__ . '/../psr/http-factory',
'aliases' => array(),
'reference' => '12ac7fcd07e5b077433f5f2bee95b3a771bf61be',
'dev_requirement' => false,
),
'psr/http-factory-implementation' => array(
'dev_requirement' => false,
'provided' => array(
0 => '1.0',
),
),
'psr/http-message' => array(
'pretty_version' => '1.0.1',
'version' => '1.0.1.0',
'type' => 'library',
'install_path' => __DIR__ . '/../psr/http-message',
'aliases' => array(),
'reference' => 'f6561bf28d520154e4b0ec72be95418abe6d9363',
'dev_requirement' => false,
),
'psr/http-message-implementation' => array(
'dev_requirement' => false,
'provided' => array(
0 => '1.0',
),
),
'psr/log' => array(
'pretty_version' => '1.1.4',
'version' => '1.1.4.0',
'type' => 'library',
'install_path' => __DIR__ . '/../psr/log',
'aliases' => array(),
'reference' => 'd49695b909c3b7628b6289db5479a1c204601f11',
'dev_requirement' => false,
),
'psr/simple-cache' => array(
'pretty_version' => '1.0.1',
'version' => '1.0.1.0',
'type' => 'library',
'install_path' => __DIR__ . '/../psr/simple-cache',
'aliases' => array(),
'reference' => '408d5eafb83c57f6365a3ca330ff23aa4a5fa39b',
'dev_requirement' => false,
),
'psr/simple-cache-implementation' => array(
'dev_requirement' => false,
'provided' => array(
0 => '^1.0',
),
),
'ralouphie/getallheaders' => array(
'pretty_version' => '3.0.3',
'version' => '3.0.3.0',
'type' => 'library',
'install_path' => __DIR__ . '/../ralouphie/getallheaders',
'aliases' => array(),
'reference' => '120b605dfeb996808c31b6477290a714d356e822',
'dev_requirement' => false,
),
'symfony/deprecation-contracts' => array(
'pretty_version' => 'v2.5.2',
'version' => '2.5.2.0',
'type' => 'library',
'install_path' => __DIR__ . '/../symfony/deprecation-contracts',
'aliases' => array(),
'reference' => 'e8b495ea28c1d97b5e0c121748d6f9b53d075c66',
'dev_requirement' => false,
),
'symfony/polyfill-mbstring' => array(
'pretty_version' => 'v1.27.0',
'version' => '1.27.0.0',
'type' => 'library',
'install_path' => __DIR__ . '/../symfony/polyfill-mbstring',
'aliases' => array(),
'reference' => '8ad114f6b39e2c98a8b0e3bd907732c207c2b534',
'dev_requirement' => false,
),
'symfony/polyfill-php80' => array(
'pretty_version' => 'v1.27.0',
'version' => '1.27.0.0',
'type' => 'library',
'install_path' => __DIR__ . '/../symfony/polyfill-php80',
'aliases' => array(),
'reference' => '7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936',
'dev_requirement' => false,
),
'symfony/var-dumper' => array(
'pretty_version' => 'v5.4.14',
'version' => '5.4.14.0',
'type' => 'library',
'install_path' => __DIR__ . '/../symfony/var-dumper',
'aliases' => array(),
'reference' => '6894d06145fefebd9a4c7272baa026a1c394a430',
'dev_requirement' => false,
),
'tightenco/collect' => array(
'pretty_version' => 'v8.83.25',
'version' => '8.83.25.0',
'type' => 'library',
'install_path' => __DIR__ . '/../tightenco/collect',
'aliases' => array(),
'reference' => '7d2a6fc5e97c5f7209a780bea98f35042c1fd0ea',
'dev_requirement' => false,
),
'yuanjiajia/qldome' => array(
'pretty_version' => '1.0.0+no-version-set',
'version' => '1.0.0.0',
'type' => 'library',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
'reference' => NULL,
'dev_requirement' => false,
),
),
);

26
vendor/composer/platform_check.php

@ -0,0 +1,26 @@
<?php
// platform_check.php @generated by Composer
$issues = array();
if (!(PHP_VERSION_ID >= 70400)) {
$issues[] = 'Your Composer dependencies require a PHP version ">= 7.4.0". You are running ' . PHP_VERSION . '.';
}
if ($issues) {
if (!headers_sent()) {
header('HTTP/1.1 500 Internal Server Error');
}
if (!ini_get('display_errors')) {
if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') {
fwrite(STDERR, 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . implode(PHP_EOL, $issues) . PHP_EOL.PHP_EOL);
} elseif (!headers_sent()) {
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;
}
}
trigger_error(
'Composer detected issues in your platform: ' . implode(' ', $issues),
E_USER_ERROR
);
}

1519
vendor/guzzlehttp/guzzle/CHANGELOG.md
File diff suppressed because it is too large
View File

27
vendor/guzzlehttp/guzzle/LICENSE

@ -0,0 +1,27 @@
The MIT License (MIT)
Copyright (c) 2011 Michael Dowling <mtdowling@gmail.com>
Copyright (c) 2012 Jeremy Lindblom <jeremeamia@gmail.com>
Copyright (c) 2014 Graham Campbell <hello@gjcampbell.co.uk>
Copyright (c) 2015 Márk Sági-Kazár <mark.sagikazar@gmail.com>
Copyright (c) 2015 Tobias Schultze <webmaster@tubo-world.de>
Copyright (c) 2016 Tobias Nyholm <tobias.nyholm@gmail.com>
Copyright (c) 2016 George Mponos <gmponos@gmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

94
vendor/guzzlehttp/guzzle/README.md

@ -0,0 +1,94 @@
![Guzzle](.github/logo.png?raw=true)
# Guzzle, PHP HTTP client
[![Latest Version](https://img.shields.io/github/release/guzzle/guzzle.svg?style=flat-square)](https://github.com/guzzle/guzzle/releases)
[![Build Status](https://img.shields.io/github/workflow/status/guzzle/guzzle/CI?label=ci%20build&style=flat-square)](https://github.com/guzzle/guzzle/actions?query=workflow%3ACI)
[![Total Downloads](https://img.shields.io/packagist/dt/guzzlehttp/guzzle.svg?style=flat-square)](https://packagist.org/packages/guzzlehttp/guzzle)
Guzzle is a PHP HTTP client that makes it easy to send HTTP requests and
trivial to integrate with web services.
- Simple interface for building query strings, POST requests, streaming large
uploads, streaming large downloads, using HTTP cookies, uploading JSON data,
etc...
- Can send both synchronous and asynchronous requests using the same interface.
- Uses PSR-7 interfaces for requests, responses, and streams. This allows you
to utilize other PSR-7 compatible libraries with Guzzle.
- Supports PSR-18 allowing interoperability between other PSR-18 HTTP Clients.
- Abstracts away the underlying HTTP transport, allowing you to write
environment and transport agnostic code; i.e., no hard dependency on cURL,
PHP streams, sockets, or non-blocking event loops.
- Middleware system allows you to augment and compose client behavior.
```php
$client = new \GuzzleHttp\Client();
$response = $client->request('GET', 'https://api.github.com/repos/guzzle/guzzle');
echo $response->getStatusCode(); // 200
echo $response->getHeaderLine('content-type'); // 'application/json; charset=utf8'
echo $response->getBody(); // '{"id": 1420053, "name": "guzzle", ...}'
// Send an asynchronous request.
$request = new \GuzzleHttp\Psr7\Request('GET', 'http://httpbin.org');
$promise = $client->sendAsync($request)->then(function ($response) {
echo 'I completed! ' . $response->getBody();
});
$promise->wait();
```
## Help and docs
We use GitHub issues only to discuss bugs and new features. For support please refer to:
- [Documentation](https://docs.guzzlephp.org)
- [Stack Overflow](https://stackoverflow.com/questions/tagged/guzzle)
- [#guzzle](https://app.slack.com/client/T0D2S9JCT/CE6UAAKL4) channel on [PHP-HTTP Slack](https://slack.httplug.io/)
- [Gitter](https://gitter.im/guzzle/guzzle)
## Installing Guzzle
The recommended way to install Guzzle is through
[Composer](https://getcomposer.org/).
```bash
composer require guzzlehttp/guzzle
```
## Version Guidance
| Version | Status | Packagist | Namespace | Repo | Docs | PSR-7 | PHP Version |
|---------|----------------|---------------------|--------------|---------------------|---------------------|-------|--------------|
| 3.x | EOL | `guzzle/guzzle` | `Guzzle` | [v3][guzzle-3-repo] | [v3][guzzle-3-docs] | No | >=5.3.3,<7.0 |
| 4.x | EOL | `guzzlehttp/guzzle` | `GuzzleHttp` | [v4][guzzle-4-repo] | N/A | No | >=5.4,<7.0 |
| 5.x | EOL | `guzzlehttp/guzzle` | `GuzzleHttp` | [v5][guzzle-5-repo] | [v5][guzzle-5-docs] | No | >=5.4,<7.4 |
| 6.x | Security fixes | `guzzlehttp/guzzle` | `GuzzleHttp` | [v6][guzzle-6-repo] | [v6][guzzle-6-docs] | Yes | >=5.5,<8.0 |
| 7.x | Latest | `guzzlehttp/guzzle` | `GuzzleHttp` | [v7][guzzle-7-repo] | [v7][guzzle-7-docs] | Yes | >=7.2.5,<8.2 |
[guzzle-3-repo]: https://github.com/guzzle/guzzle3
[guzzle-4-repo]: https://github.com/guzzle/guzzle/tree/4.x
[guzzle-5-repo]: https://github.com/guzzle/guzzle/tree/5.3
[guzzle-6-repo]: https://github.com/guzzle/guzzle/tree/6.5
[guzzle-7-repo]: https://github.com/guzzle/guzzle
[guzzle-3-docs]: https://guzzle3.readthedocs.io/
[guzzle-5-docs]: https://docs.guzzlephp.org/en/5.3/
[guzzle-6-docs]: https://docs.guzzlephp.org/en/6.5/
[guzzle-7-docs]: https://docs.guzzlephp.org/en/latest/
## Security
If you discover a security vulnerability within this package, please send an email to security@tidelift.com. All security vulnerabilities will be promptly addressed. Please do not disclose security-related issues publicly until a fix has been announced. Please see [Security Policy](https://github.com/guzzle/guzzle/security/policy) for more information.
## License
Guzzle is made available under the MIT License (MIT). Please see [License File](LICENSE) for more information.
## For Enterprise
Available as part of the Tidelift Subscription
The maintainers of Guzzle and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/packagist-guzzlehttp-guzzle?utm_source=packagist-guzzlehttp-guzzle&utm_medium=referral&utm_campaign=enterprise&utm_term=repo)

1253
vendor/guzzlehttp/guzzle/UPGRADING.md
File diff suppressed because it is too large
View File

105
vendor/guzzlehttp/guzzle/composer.json

@ -0,0 +1,105 @@
{
"name": "guzzlehttp/guzzle",
"description": "Guzzle is a PHP HTTP client library",
"keywords": [
"framework",
"http",
"rest",
"web service",
"curl",
"client",
"HTTP client",
"PSR-7",
"PSR-18"
],
"license": "MIT",
"authors": [
{
"name": "Graham Campbell",
"email": "hello@gjcampbell.co.uk",
"homepage": "https://github.com/GrahamCampbell"
},
{
"name": "Michael Dowling",
"email": "mtdowling@gmail.com",
"homepage": "https://github.com/mtdowling"
},
{
"name": "Jeremy Lindblom",
"email": "jeremeamia@gmail.com",
"homepage": "https://github.com/jeremeamia"
},
{
"name": "George Mponos",
"email": "gmponos@gmail.com",
"homepage": "https://github.com/gmponos"
},
{
"name": "Tobias Nyholm",
"email": "tobias.nyholm@gmail.com",
"homepage": "https://github.com/Nyholm"
},
{
"name": "Márk Sági-Kazár",
"email": "mark.sagikazar@gmail.com",
"homepage": "https://github.com/sagikazarmark"
},
{
"name": "Tobias Schultze",
"email": "webmaster@tubo-world.de",
"homepage": "https://github.com/Tobion"
}
],
"require": {
"php": "^7.2.5 || ^8.0",
"ext-json": "*",
"guzzlehttp/promises": "^1.5",
"guzzlehttp/psr7": "^1.9 || ^2.4",
"psr/http-client": "^1.0",
"symfony/deprecation-contracts": "^2.2 || ^3.0"
},
"provide": {
"psr/http-client-implementation": "1.0"
},
"require-dev": {
"ext-curl": "*",
"bamarni/composer-bin-plugin": "^1.8.1",
"php-http/client-integration-tests": "^3.0",
"phpunit/phpunit": "^8.5.29 || ^9.5.23",
"psr/log": "^1.1 || ^2.0 || ^3.0"
},
"suggest": {
"ext-curl": "Required for CURL handler support",
"ext-intl": "Required for Internationalized Domain Name (IDN) support",
"psr/log": "Required for using the Log middleware"
},
"config": {
"allow-plugins": {
"bamarni/composer-bin-plugin": true
},
"preferred-install": "dist",
"sort-packages": true
},
"extra": {
"bamarni-bin": {
"bin-links": true,
"forward-command": false
},
"branch-alias": {
"dev-master": "7.5-dev"
}
},
"autoload": {
"psr-4": {
"GuzzleHttp\\": "src/"
},
"files": [
"src/functions_include.php"
]
},
"autoload-dev": {
"psr-4": {
"GuzzleHttp\\Tests\\": "tests/"
}
}
}

28
vendor/guzzlehttp/guzzle/src/BodySummarizer.php

@ -0,0 +1,28 @@
<?php
namespace GuzzleHttp;
use Psr\Http\Message\MessageInterface;
final class BodySummarizer implements BodySummarizerInterface
{
/**
* @var int|null
*/
private $truncateAt;
public function __construct(int $truncateAt = null)
{
$this->truncateAt = $truncateAt;
}
/**
* Returns a summarized message body.
*/
public function summarize(MessageInterface $message): ?string
{
return $this->truncateAt === null
? \GuzzleHttp\Psr7\Message::bodySummary($message)
: \GuzzleHttp\Psr7\Message::bodySummary($message, $this->truncateAt);
}
}

13
vendor/guzzlehttp/guzzle/src/BodySummarizerInterface.php

@ -0,0 +1,13 @@
<?php
namespace GuzzleHttp;
use Psr\Http\Message\MessageInterface;
interface BodySummarizerInterface
{
/**
* Returns a summarized message body.
*/
public function summarize(MessageInterface $message): ?string;
}

477
vendor/guzzlehttp/guzzle/src/Client.php

@ -0,0 +1,477 @@
<?php
namespace GuzzleHttp;
use GuzzleHttp\Cookie\CookieJar;
use GuzzleHttp\Exception\GuzzleException;
use GuzzleHttp\Exception\InvalidArgumentException;
use GuzzleHttp\Promise as P;
use GuzzleHttp\Promise\PromiseInterface;
use Psr\Http\Message\RequestInterface;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\UriInterface;
/**
* @final
*/
class Client implements ClientInterface, \Psr\Http\Client\ClientInterface
{
use ClientTrait;
/**
* @var array Default request options
*/
private $config;
/**
* Clients accept an array of constructor parameters.
*
* Here's an example of creating a client using a base_uri and an array of
* default request options to apply to each request:
*
* $client = new Client([
* 'base_uri' => 'http://www.foo.com/1.0/',
* 'timeout' => 0,
* 'allow_redirects' => false,
* 'proxy' => '192.168.16.1:10'
* ]);
*
* Client configuration settings include the following options:
*
* - handler: (callable) Function that transfers HTTP requests over the
* wire. The function is called with a Psr7\Http\Message\RequestInterface
* and array of transfer options, and must return a
* GuzzleHttp\Promise\PromiseInterface that is fulfilled with a
* Psr7\Http\Message\ResponseInterface on success.
* If no handler is provided, a default handler will be created
* that enables all of the request options below by attaching all of the
* default middleware to the handler.
* - base_uri: (string|UriInterface) Base URI of the client that is merged
* into relative URIs. Can be a string or instance of UriInterface.
* - **: any request option
*
* @param array $config Client configuration settings.
*
* @see \GuzzleHttp\RequestOptions for a list of available request options.
*/
public function __construct(array $config = [])
{
if (!isset($config['handler'])) {
$config['handler'] = HandlerStack::create();
} elseif (!\is_callable($config['handler'])) {
throw new InvalidArgumentException('handler must be a callable');
}
// Convert the base_uri to a UriInterface
if (isset($config['base_uri'])) {
$config['base_uri'] = Psr7\Utils::uriFor($config['base_uri']);
}
$this->configureDefaults($config);
}
/**
* @param string $method
* @param array $args
*
* @return PromiseInterface|ResponseInterface
*
* @deprecated Client::__call will be removed in guzzlehttp/guzzle:8.0.
*/
public function __call($method, $args)
{
if (\count($args) < 1) {
throw new InvalidArgumentException('Magic request methods require a URI and optional options array');
}
$uri = $args[0];
$opts = $args[1] ?? [];
return \substr($method, -5) === 'Async'
? $this->requestAsync(\substr($method, 0, -5), $uri, $opts)
: $this->request($method, $uri, $opts);
}
/**
* Asynchronously send an HTTP request.
*
* @param array $options Request options to apply to the given
* request and to the transfer. See \GuzzleHttp\RequestOptions.
*/
public function sendAsync(RequestInterface $request, array $options = []): PromiseInterface
{
// Merge the base URI into the request URI if needed.
$options = $this->prepareDefaults($options);
return $this->transfer(
$request->withUri($this->buildUri($request->getUri(), $options), $request->hasHeader('Host')),
$options
);
}
/**
* Send an HTTP request.
*
* @param array $options Request options to apply to the given
* request and to the transfer. See \GuzzleHttp\RequestOptions.
*
* @throws GuzzleException
*/
public function send(RequestInterface $request, array $options = []): ResponseInterface
{
$options[RequestOptions::SYNCHRONOUS] = true;
return $this->sendAsync($request, $options)->wait();
}
/**
* The HttpClient PSR (PSR-18) specify this method.
*
* @inheritDoc
*/
public function sendRequest(RequestInterface $request): ResponseInterface
{
$options[RequestOptions::SYNCHRONOUS] = true;
$options[RequestOptions::ALLOW_REDIRECTS] = false;
$options[RequestOptions::HTTP_ERRORS] = false;
return $this->sendAsync($request, $options)->wait();
}
/**
* Create and send an asynchronous HTTP request.
*
* Use an absolute path to override the base path of the client, or a
* relative path to append to the base path of the client. The URL can
* contain the query string as well. Use an array to provide a URL
* template and additional variables to use in the URL template expansion.
*
* @param string $method HTTP method
* @param string|UriInterface $uri URI object or string.
* @param array $options Request options to apply. See \GuzzleHttp\RequestOptions.
*/
public function requestAsync(string $method, $uri = '', array $options = []): PromiseInterface
{
$options = $this->prepareDefaults($options);
// Remove request modifying parameter because it can be done up-front.
$headers = $options['headers'] ?? [];
$body = $options['body'] ?? null;
$version = $options['version'] ?? '1.1';
// Merge the URI into the base URI.
$uri = $this->buildUri(Psr7\Utils::uriFor($uri), $options);
if (\is_array($body)) {
throw $this->invalidBody();
}
$request = new Psr7\Request($method, $uri, $headers, $body, $version);
// Remove the option so that they are not doubly-applied.
unset($options['headers'], $options['body'], $options['version']);
return $this->transfer($request, $options);
}
/**
* Create and send an HTTP request.
*
* Use an absolute path to override the base path of the client, or a
* relative path to append to the base path of the client. The URL can
* contain the query string as well.
*
* @param string $method HTTP method.
* @param string|UriInterface $uri URI object or string.
* @param array $options Request options to apply. See \GuzzleHttp\RequestOptions.
*
* @throws GuzzleException
*/
public function request(string $method, $uri = '', array $options = []): ResponseInterface
{
$options[RequestOptions::SYNCHRONOUS] = true;
return $this->requestAsync($method, $uri, $options)->wait();
}
/**
* Get a client configuration option.
*
* These options include default request options of the client, a "handler"
* (if utilized by the concrete client), and a "base_uri" if utilized by
* the concrete client.
*
* @param string|null $option The config option to retrieve.
*
* @return mixed
*
* @deprecated Client::getConfig will be removed in guzzlehttp/guzzle:8.0.
*/
public function getConfig(?string $option = null)
{
return $option === null
? $this->config
: ($this->config[$option] ?? null);
}
private function buildUri(UriInterface $uri, array $config): UriInterface
{
if (isset($config['base_uri'])) {
$uri = Psr7\UriResolver::resolve(Psr7\Utils::uriFor($config['base_uri']), $uri);
}
if (isset($config['idn_conversion']) && ($config['idn_conversion'] !== false)) {
$idnOptions = ($config['idn_conversion'] === true) ? \IDNA_DEFAULT : $config['idn_conversion'];
$uri = Utils::idnUriConvert($uri, $idnOptions);
}
return $uri->getScheme() === '' && $uri->getHost() !== '' ? $uri->withScheme('http') : $uri;
}
/**
* Configures the default options for a client.
*/
private function configureDefaults(array $config): void
{
$defaults = [
'allow_redirects' => RedirectMiddleware::$defaultSettings,
'http_errors' => true,
'decode_content' => true,
'verify' => true,
'cookies' => false,
'idn_conversion' => false,
];
// Use the standard Linux HTTP_PROXY and HTTPS_PROXY if set.
// We can only trust the HTTP_PROXY environment variable in a CLI
// process due to the fact that PHP has no reliable mechanism to
// get environment variables that start with "HTTP_".
if (\PHP_SAPI === 'cli' && ($proxy = Utils::getenv('HTTP_PROXY'))) {
$defaults['proxy']['http'] = $proxy;
}
if ($proxy = Utils::getenv('HTTPS_PROXY')) {
$defaults['proxy']['https'] = $proxy;
}
if ($noProxy = Utils::getenv('NO_PROXY')) {
$cleanedNoProxy = \str_replace(' ', '', $noProxy);
$defaults['proxy']['no'] = \explode(',', $cleanedNoProxy);
}
$this->config = $config + $defaults;
if (!empty($config['cookies']) && $config['cookies'] === true) {
$this->config['cookies'] = new CookieJar();
}
// Add the default user-agent header.
if (!isset($this->config['headers'])) {
$this->config['headers'] = ['User-Agent' => Utils::defaultUserAgent()];
} else {
// Add the User-Agent header if one was not already set.
foreach (\array_keys($this->config['headers']) as $name) {
if (\strtolower($name) === 'user-agent') {
return;
}
}
$this->config['headers']['User-Agent'] = Utils::defaultUserAgent();
}
}
/**
* Merges default options into the array.
*
* @param array $options Options to modify by reference
*/
private function prepareDefaults(array $options): array
{
$defaults = $this->config;
if (!empty($defaults['headers'])) {
// Default headers are only added if they are not present.
$defaults['_conditional'] = $defaults['headers'];
unset($defaults['headers']);
}
// Special handling for headers is required as they are added as
// conditional headers and as headers passed to a request ctor.
if (\array_key_exists('headers', $options)) {
// Allows default headers to be unset.
if ($options['headers'] === null) {
$defaults['_conditional'] = [];
unset($options['headers']);
} elseif (!\is_array($options['headers'])) {
throw new InvalidArgumentException('headers must be an array');
}
}
// Shallow merge defaults underneath options.
$result = $options + $defaults;
// Remove null values.
foreach ($result as $k => $v) {
if ($v === null) {
unset($result[$k]);
}
}
return $result;
}
/**
* Transfers the given request and applies request options.
*
* The URI of the request is not modified and the request options are used
* as-is without merging in default options.
*
* @param array $options See \GuzzleHttp\RequestOptions.
*/
private function transfer(RequestInterface $request, array $options): PromiseInterface
{
$request = $this->applyOptions($request, $options);
/** @var HandlerStack $handler */
$handler = $options['handler'];
try {
return P\Create::promiseFor($handler($request, $options));
} catch (\Exception $e) {
return P\Create::rejectionFor($e);
}
}
/**
* Applies the array of request options to a request.
*/
private function applyOptions(RequestInterface $request, array &$options): RequestInterface
{
$modify = [
'set_headers' => [],
];
if (isset($options['headers'])) {
if (array_keys($options['headers']) === range(0, count($options['headers']) - 1)) {
throw new InvalidArgumentException('The headers array must have header name as keys.');
}
$modify['set_headers'] = $options['headers'];
unset($options['headers']);
}
if (isset($options['form_params'])) {
if (isset($options['multipart'])) {
throw new InvalidArgumentException('You cannot use '
. 'form_params and multipart at the same time. Use the '
. 'form_params option if you want to send application/'
. 'x-www-form-urlencoded requests, and the multipart '
. 'option to send multipart/form-data requests.');
}
$options['body'] = \http_build_query($options['form_params'], '', '&');
unset($options['form_params']);
// Ensure that we don't have the header in different case and set the new value.
$options['_conditional'] = Psr7\Utils::caselessRemove(['Content-Type'], $options['_conditional']);
$options['_conditional']['Content-Type'] = 'application/x-www-form-urlencoded';
}
if (isset($options['multipart'])) {
$options['body'] = new Psr7\MultipartStream($options['multipart']);
unset($options['multipart']);
}
if (isset($options['json'])) {
$options['body'] = Utils::jsonEncode($options['json']);
unset($options['json']);
// Ensure that we don't have the header in different case and set the new value.
$options['_conditional'] = Psr7\Utils::caselessRemove(['Content-Type'], $options['_conditional']);
$options['_conditional']['Content-Type'] = 'application/json';
}
if (!empty($options['decode_content'])
&& $options['decode_content'] !== true
) {
// Ensure that we don't have the header in different case and set the new value.
$options['_conditional'] = Psr7\Utils::caselessRemove(['Accept-Encoding'], $options['_conditional']);
$modify['set_headers']['Accept-Encoding'] = $options['decode_content'];
}
if (isset($options['body'])) {
if (\is_array($options['body'])) {
throw $this->invalidBody();
}
$modify['body'] = Psr7\Utils::streamFor($options['body']);
unset($options['body']);
}
if (!empty($options['auth']) && \is_array($options['auth'])) {
$value = $options['auth'];
$type = isset($value[2]) ? \strtolower($value[2]) : 'basic';
switch ($type) {
case 'basic':
// Ensure that we don't have the header in different case and set the new value.
$modify['set_headers'] = Psr7\Utils::caselessRemove(['Authorization'], $modify['set_headers']);
$modify['set_headers']['Authorization'] = 'Basic '
. \base64_encode("$value[0]:$value[1]");
break;
case 'digest':
// @todo: Do not rely on curl
$options['curl'][\CURLOPT_HTTPAUTH] = \CURLAUTH_DIGEST;
$options['curl'][\CURLOPT_USERPWD] = "$value[0]:$value[1]";
break;
case 'ntlm':
$options['curl'][\CURLOPT_HTTPAUTH] = \CURLAUTH_NTLM;
$options['curl'][\CURLOPT_USERPWD] = "$value[0]:$value[1]";
break;
}
}
if (isset($options['query'])) {
$value = $options['query'];
if (\is_array($value)) {
$value = \http_build_query($value, '', '&', \PHP_QUERY_RFC3986);
}
if (!\is_string($value)) {
throw new InvalidArgumentException('query must be a string or array');
}
$modify['query'] = $value;
unset($options['query']);
}
// Ensure that sink is not an invalid value.
if (isset($options['sink'])) {
// TODO: Add more sink validation?
if (\is_bool($options['sink'])) {
throw new InvalidArgumentException('sink must not be a boolean');
}
}
$request = Psr7\Utils::modifyRequest($request, $modify);
if ($request->getBody() instanceof Psr7\MultipartStream) {
// Use a multipart/form-data POST if a Content-Type is not set.
// Ensure that we don't have the header in different case and set the new value.
$options['_conditional'] = Psr7\Utils::caselessRemove(['Content-Type'], $options['_conditional']);
$options['_conditional']['Content-Type'] = 'multipart/form-data; boundary='
. $request->getBody()->getBoundary();
}
// Merge in conditional headers if they are not present.
if (isset($options['_conditional'])) {
// Build up the changes so it's in a single clone of the message.
$modify = [];
foreach ($options['_conditional'] as $k => $v) {
if (!$request->hasHeader($k)) {
$modify['set_headers'][$k] = $v;
}
}
$request = Psr7\Utils::modifyRequest($request, $modify);
// Don't pass this internal value along to middleware/handlers.
unset($options['_conditional']);
}
return $request;
}
/**
* Return an InvalidArgumentException with pre-set message.
*/
private function invalidBody(): InvalidArgumentException
{
return new InvalidArgumentException('Passing in the "body" request '
. 'option as an array to send a request is not supported. '
. 'Please use the "form_params" request option to send a '
. 'application/x-www-form-urlencoded request, or the "multipart" '
. 'request option to send a multipart/form-data request.');
}
}

84
vendor/guzzlehttp/guzzle/src/ClientInterface.php

@ -0,0 +1,84 @@
<?php
namespace GuzzleHttp;
use GuzzleHttp\Exception\GuzzleException;
use GuzzleHttp\Promise\PromiseInterface;
use Psr\Http\Message\RequestInterface;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\UriInterface;
/**
* Client interface for sending HTTP requests.
*/
interface ClientInterface
{
/**
* The Guzzle major version.
*/
public const MAJOR_VERSION = 7;
/**
* Send an HTTP request.
*
* @param RequestInterface $request Request to send
* @param array $options Request options to apply to the given
* request and to the transfer.
*
* @throws GuzzleException
*/
public function send(RequestInterface $request, array $options = []): ResponseInterface;
/**
* Asynchronously send an HTTP request.
*
* @param RequestInterface $request Request to send
* @param array $options Request options to apply to the given
* request and to the transfer.
*/
public function sendAsync(RequestInterface $request, array $options = []): PromiseInterface;
/**
* Create and send an HTTP request.
*
* Use an absolute path to override the base path of the client, or a
* relative path to append to the base path of the client. The URL can
* contain the query string as well.
*
* @param string $method HTTP method.
* @param string|UriInterface $uri URI object or string.
* @param array $options Request options to apply.
*
* @throws GuzzleException
*/
public function request(string $method, $uri, array $options = []): ResponseInterface;
/**
* Create and send an asynchronous HTTP request.
*
* Use an absolute path to override the base path of the client, or a
* relative path to append to the base path of the client. The URL can
* contain the query string as well. Use an array to provide a URL
* template and additional variables to use in the URL template expansion.
*
* @param string $method HTTP method
* @param string|UriInterface $uri URI object or string.
* @param array $options Request options to apply.
*/
public function requestAsync(string $method, $uri, array $options = []): PromiseInterface;
/**
* Get a client configuration option.
*
* These options include default request options of the client, a "handler"
* (if utilized by the concrete client), and a "base_uri" if utilized by
* the concrete client.
*
* @param string|null $option The config option to retrieve.
*
* @return mixed
*
* @deprecated ClientInterface::getConfig will be removed in guzzlehttp/guzzle:8.0.
*/
public function getConfig(?string $option = null);
}

241
vendor/guzzlehttp/guzzle/src/ClientTrait.php

@ -0,0 +1,241 @@
<?php
namespace GuzzleHttp;
use GuzzleHttp\Exception\GuzzleException;
use GuzzleHttp\Promise\PromiseInterface;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\UriInterface;
/**
* Client interface for sending HTTP requests.
*/
trait ClientTrait
{
/**
* Create and send an HTTP request.
*
* Use an absolute path to override the base path of the client, or a
* relative path to append to the base path of the client. The URL can
* contain the query string as well.
*
* @param string $method HTTP method.
* @param string|UriInterface $uri URI object or string.
* @param array $options Request options to apply.
*
* @throws GuzzleException
*/
abstract public function request(string $method, $uri, array $options = []): ResponseInterface;
/**
* Create and send an HTTP GET request.
*
* Use an absolute path to override the base path of the client, or a
* relative path to append to the base path of the client. The URL can
* contain the query string as well.
*
* @param string|UriInterface $uri URI object or string.
* @param array $options Request options to apply.
*
* @throws GuzzleException
*/
public function get($uri, array $options = []): ResponseInterface
{
return $this->request('GET', $uri, $options);
}
/**
* Create and send an HTTP HEAD request.
*
* Use an absolute path to override the base path of the client, or a
* relative path to append to the base path of the client. The URL can
* contain the query string as well.
*
* @param string|UriInterface $uri URI object or string.
* @param array $options Request options to apply.
*
* @throws GuzzleException
*/
public function head($uri, array $options = []): ResponseInterface
{
return $this->request('HEAD', $uri, $options);
}
/**
* Create and send an HTTP PUT request.
*
* Use an absolute path to override the base path of the client, or a
* relative path to append to the base path of the client. The URL can
* contain the query string as well.
*
* @param string|UriInterface $uri URI object or string.
* @param array $options Request options to apply.
*
* @throws GuzzleException
*/
public function put($uri, array $options = []): ResponseInterface
{
return $this->request('PUT', $uri, $options);
}
/**
* Create and send an HTTP POST request.
*
* Use an absolute path to override the base path of the client, or a
* relative path to append to the base path of the client. The URL can
* contain the query string as well.
*
* @param string|UriInterface $uri URI object or string.
* @param array $options Request options to apply.
*
* @throws GuzzleException
*/
public function post($uri, array $options = []): ResponseInterface
{
return $this->request('POST', $uri, $options);
}
/**
* Create and send an HTTP PATCH request.
*
* Use an absolute path to override the base path of the client, or a
* relative path to append to the base path of the client. The URL can
* contain the query string as well.
*
* @param string|UriInterface $uri URI object or string.
* @param array $options Request options to apply.
*
* @throws GuzzleException
*/
public function patch($uri, array $options = []): ResponseInterface
{
return $this->request('PATCH', $uri, $options);
}
/**
* Create and send an HTTP DELETE request.
*
* Use an absolute path to override the base path of the client, or a
* relative path to append to the base path of the client. The URL can
* contain the query string as well.
*
* @param string|UriInterface $uri URI object or string.
* @param array $options Request options to apply.
*
* @throws GuzzleException
*/
public function delete($uri, array $options = []): ResponseInterface
{
return $this->request('DELETE', $uri, $options);
}
/**
* Create and send an asynchronous HTTP request.
*
* Use an absolute path to override the base path of the client, or a
* relative path to append to the base path of the client. The URL can
* contain the query string as well. Use an array to provide a URL
* template and additional variables to use in the URL template expansion.
*
* @param string $method HTTP method
* @param string|UriInterface $uri URI object or string.
* @param array $options Request options to apply.
*/
abstract public function requestAsync(string $method, $uri, array $options = []): PromiseInterface;
/**
* Create and send an asynchronous HTTP GET request.
*
* Use an absolute path to override the base path of the client, or a
* relative path to append to the base path of the client. The URL can
* contain the query string as well. Use an array to provide a URL
* template and additional variables to use in the URL template expansion.
*
* @param string|UriInterface $uri URI object or string.
* @param array $options Request options to apply.
*/
public function getAsync($uri, array $options = []): PromiseInterface
{
return $this->requestAsync('GET', $uri, $options);
}
/**
* Create and send an asynchronous HTTP HEAD request.
*
* Use an absolute path to override the base path of the client, or a
* relative path to append to the base path of the client. The URL can
* contain the query string as well. Use an array to provide a URL
* template and additional variables to use in the URL template expansion.
*
* @param string|UriInterface $uri URI object or string.
* @param array $options Request options to apply.
*/
public function headAsync($uri, array $options = []): PromiseInterface
{
return $this->requestAsync('HEAD', $uri, $options);
}
/**
* Create and send an asynchronous HTTP PUT request.
*
* Use an absolute path to override the base path of the client, or a
* relative path to append to the base path of the client. The URL can
* contain the query string as well. Use an array to provide a URL
* template and additional variables to use in the URL template expansion.
*
* @param string|UriInterface $uri URI object or string.
* @param array $options Request options to apply.
*/
public function putAsync($uri, array $options = []): PromiseInterface
{
return $this->requestAsync('PUT', $uri, $options);
}
/**
* Create and send an asynchronous HTTP POST request.
*
* Use an absolute path to override the base path of the client, or a
* relative path to append to the base path of the client. The URL can
* contain the query string as well. Use an array to provide a URL
* template and additional variables to use in the URL template expansion.
*
* @param string|UriInterface $uri URI object or string.
* @param array $options Request options to apply.
*/
public function postAsync($uri, array $options = []): PromiseInterface
{
return $this->requestAsync('POST', $uri, $options);
}
/**
* Create and send an asynchronous HTTP PATCH request.
*
* Use an absolute path to override the base path of the client, or a
* relative path to append to the base path of the client. The URL can
* contain the query string as well. Use an array to provide a URL
* template and additional variables to use in the URL template expansion.
*
* @param string|UriInterface $uri URI object or string.
* @param array $options Request options to apply.
*/
public function patchAsync($uri, array $options = []): PromiseInterface
{
return $this->requestAsync('PATCH', $uri, $options);
}
/**
* Create and send an asynchronous HTTP DELETE request.
*
* Use an absolute path to override the base path of the client, or a
* relative path to append to the base path of the client. The URL can
* contain the query string as well. Use an array to provide a URL
* template and additional variables to use in the URL template expansion.
*
* @param string|UriInterface $uri URI object or string.
* @param array $options Request options to apply.
*/
public function deleteAsync($uri, array $options = []): PromiseInterface
{
return $this->requestAsync('DELETE', $uri, $options);
}
}

317
vendor/guzzlehttp/guzzle/src/Cookie/CookieJar.php

@ -0,0 +1,317 @@
<?php
namespace GuzzleHttp\Cookie;
use Psr\Http\Message\RequestInterface;
use Psr\Http\Message\ResponseInterface;
/**
* Cookie jar that stores cookies as an array
*/
class CookieJar implements CookieJarInterface
{
/**
* @var SetCookie[] Loaded cookie data
*/
private $cookies = [];
/**
* @var bool
*/
private $strictMode;
/**
* @param bool $strictMode Set to true to throw exceptions when invalid
* cookies are added to the cookie jar.
* @param array $cookieArray Array of SetCookie objects or a hash of
* arrays that can be used with the SetCookie
* constructor
*/
public function __construct(bool $strictMode = false, array $cookieArray = [])
{
$this->strictMode = $strictMode;
foreach ($cookieArray as $cookie) {
if (!($cookie instanceof SetCookie)) {
$cookie = new SetCookie($cookie);
}
$this->setCookie($cookie);
}
}
/**
* Create a new Cookie jar from an associative array and domain.
*
* @param array $cookies Cookies to create the jar from
* @param string $domain Domain to set the cookies to
*/
public static function fromArray(array $cookies, string $domain): self
{
$cookieJar = new self();
foreach ($cookies as $name => $value) {
$cookieJar->setCookie(new SetCookie([
'Domain' => $domain,
'Name' => $name,
'Value' => $value,
'Discard' => true
]));
}
return $cookieJar;
}
/**
* Evaluate if this cookie should be persisted to storage
* that survives between requests.
*
* @param SetCookie $cookie Being evaluated.
* @param bool $allowSessionCookies If we should persist session cookies
*/
public static function shouldPersist(SetCookie $cookie, bool $allowSessionCookies = false): bool
{
if ($cookie->getExpires() || $allowSessionCookies) {
if (!$cookie->getDiscard()) {
return true;
}
}
return false;
}
/**
* Finds and returns the cookie based on the name
*
* @param string $name cookie name to search for
*
* @return SetCookie|null cookie that was found or null if not found
*/
public function getCookieByName(string $name): ?SetCookie
{
foreach ($this->cookies as $cookie) {
if ($cookie->getName() !== null && \strcasecmp($cookie->getName(), $name) === 0) {
return $cookie;
}
}
return null;
}
/**
* @inheritDoc
*/
public function toArray(): array
{
return \array_map(static function (SetCookie $cookie): array {
return $cookie->toArray();
}, $this->getIterator()->getArrayCopy());
}
/**
* @inheritDoc
*/
public function clear(?string $domain = null, ?string $path = null, ?string $name = null): void
{
if (!$domain) {
$this->cookies = [];
return;
} elseif (!$path) {
$this->cookies = \array_filter(
$this->cookies,
static function (SetCookie $cookie) use ($domain): bool {
return !$cookie->matchesDomain($domain);
}
);
} elseif (!$name) {
$this->cookies = \array_filter(
$this->cookies,
static function (SetCookie $cookie) use ($path, $domain): bool {
return !($cookie->matchesPath($path) &&
$cookie->matchesDomain($domain));
}
);
} else {
$this->cookies = \array_filter(
$this->cookies,
static function (SetCookie $cookie) use ($path, $domain, $name) {
return !($cookie->getName() == $name &&
$cookie->matchesPath($path) &&
$cookie->matchesDomain($domain));
}
);
}
}
/**
* @inheritDoc
*/
public function clearSessionCookies(): void
{
$this->cookies = \array_filter(
$this->cookies,
static function (SetCookie $cookie): bool {
return !$cookie->getDiscard() && $cookie->getExpires();
}
);
}
/**
* @inheritDoc
*/
public function setCookie(SetCookie $cookie): bool
{
// If the name string is empty (but not 0), ignore the set-cookie
// string entirely.
$name = $cookie->getName();
if (!$name && $name !== '0') {
return false;
}
// Only allow cookies with set and valid domain, name, value
$result = $cookie->validate();
if ($result !== true) {
if ($this->strictMode) {
throw new \RuntimeException('Invalid cookie: ' . $result);
}
$this->removeCookieIfEmpty($cookie);
return false;
}
// Resolve conflicts with previously set cookies
foreach ($this->cookies as $i => $c) {
// Two cookies are identical, when their path, and domain are
// identical.
if ($c->getPath() != $cookie->getPath() ||
$c->getDomain() != $cookie->getDomain() ||
$c->getName() != $cookie->getName()
) {
continue;
}
// The previously set cookie is a discard cookie and this one is
// not so allow the new cookie to be set
if (!$cookie->getDiscard() && $c->getDiscard()) {
unset($this->cookies[$i]);
continue;
}
// If the new cookie's expiration is further into the future, then
// replace the old cookie
if ($cookie->getExpires() > $c->getExpires()) {
unset($this->cookies[$i]);
continue;
}
// If the value has changed, we better change it
if ($cookie->getValue() !== $c->getValue()) {
unset($this->cookies[$i]);
continue;
}
// The cookie exists, so no need to continue
return false;
}
$this->cookies[] = $cookie;
return true;
}
public function count(): int
{
return \count($this->cookies);
}
/**
* @return \ArrayIterator<int, SetCookie>
*/
public function getIterator(): \ArrayIterator
{
return new \ArrayIterator(\array_values($this->cookies));
}
public function extractCookies(RequestInterface $request, ResponseInterface $response): void
{
if ($cookieHeader = $response->getHeader('Set-Cookie')) {
foreach ($cookieHeader as $cookie) {
$sc = SetCookie::fromString($cookie);
if (!$sc->getDomain()) {
$sc->setDomain($request->getUri()->getHost());
}
if (0 !== \strpos($sc->getPath(), '/')) {
$sc->setPath($this->getCookiePathFromRequest($request));
}
if (!$sc->matchesDomain($request->getUri()->getHost())) {
continue;
}
// Note: At this point `$sc->getDomain()` being a public suffix should
// be rejected, but we don't want to pull in the full PSL dependency.
$this->setCookie($sc);
}
}
}
/**
* Computes cookie path following RFC 6265 section 5.1.4
*
* @link https://tools.ietf.org/html/rfc6265#section-5.1.4
*/
private function getCookiePathFromRequest(RequestInterface $request): string
{
$uriPath = $request->getUri()->getPath();
if ('' === $uriPath) {
return '/';
}
if (0 !== \strpos($uriPath, '/')) {
return '/';
}
if ('/' === $uriPath) {
return '/';
}
$lastSlashPos = \strrpos($uriPath, '/');
if (0 === $lastSlashPos || false === $lastSlashPos) {
return '/';
}
return \substr($uriPath, 0, $lastSlashPos);
}
public function withCookieHeader(RequestInterface $request): RequestInterface
{
$values = [];
$uri = $request->getUri();
$scheme = $uri->getScheme();
$host = $uri->getHost();
$path = $uri->getPath() ?: '/';
foreach ($this->cookies as $cookie) {
if ($cookie->matchesPath($path) &&
$cookie->matchesDomain($host) &&
!$cookie->isExpired() &&
(!$cookie->getSecure() || $scheme === 'https')
) {
$values[] = $cookie->getName() . '='
. $cookie->getValue();
}
}
return $values
? $request->withHeader('Cookie', \implode('; ', $values))
: $request;
}
/**
* If a cookie already exists and the server asks to set it again with a
* null value, the cookie must be deleted.
*/
private function removeCookieIfEmpty(SetCookie $cookie): void
{
$cookieValue = $cookie->getValue();
if ($cookieValue === null || $cookieValue === '') {
$this->clear(
$cookie->getDomain(),
$cookie->getPath(),
$cookie->getName()
);
}
}
}

79
vendor/guzzlehttp/guzzle/src/Cookie/CookieJarInterface.php

@ -0,0 +1,79 @@
<?php
namespace GuzzleHttp\Cookie;
use Psr\Http\Message\RequestInterface;
use Psr\Http\Message\ResponseInterface;
/**
* Stores HTTP cookies.
*
* It extracts cookies from HTTP requests, and returns them in HTTP responses.
* CookieJarInterface instances automatically expire contained cookies when
* necessary. Subclasses are also responsible for storing and retrieving
* cookies from a file, database, etc.
*
* @link https://docs.python.org/2/library/cookielib.html Inspiration
* @extends \IteratorAggregate<SetCookie>
*/
interface CookieJarInterface extends \Countable, \IteratorAggregate
{
/**
* Create a request with added cookie headers.
*
* If no matching cookies are found in the cookie jar, then no Cookie
* header is added to the request and the same request is returned.
*
* @param RequestInterface $request Request object to modify.
*
* @return RequestInterface returns the modified request.
*/
public function withCookieHeader(RequestInterface $request): RequestInterface;
/**
* Extract cookies from an HTTP response and store them in the CookieJar.
*
* @param RequestInterface $request Request that was sent
* @param ResponseInterface $response Response that was received
*/
public function extractCookies(RequestInterface $request, ResponseInterface $response): void;
/**
* Sets a cookie in the cookie jar.
*
* @param SetCookie $cookie Cookie to set.
*
* @return bool Returns true on success or false on failure
*/
public function setCookie(SetCookie $cookie): bool;
/**
* Remove cookies currently held in the cookie jar.
*
* Invoking this method without arguments will empty the whole cookie jar.
* If given a $domain argument only cookies belonging to that domain will
* be removed. If given a $domain and $path argument, cookies belonging to
* the specified path within that domain are removed. If given all three
* arguments, then the cookie with the specified name, path and domain is
* removed.
*
* @param string|null $domain Clears cookies matching a domain
* @param string|null $path Clears cookies matching a domain and path
* @param string|null $name Clears cookies matching a domain, path, and name
*/
public function clear(?string $domain = null, ?string $path = null, ?string $name = null): void;
/**
* Discard all sessions cookies.
*
* Removes cookies that don't have an expire field or a have a discard
* field set to true. To be called when the user agent shuts down according
* to RFC 2965.
*/
public function clearSessionCookies(): void;
/**
* Converts the cookie jar to an array.
*/
public function toArray(): array;
}

101
vendor/guzzlehttp/guzzle/src/Cookie/FileCookieJar.php

@ -0,0 +1,101 @@
<?php
namespace GuzzleHttp\Cookie;
use GuzzleHttp\Utils;
/**
* Persists non-session cookies using a JSON formatted file
*/
class FileCookieJar extends CookieJar
{
/**
* @var string filename
*/
private $filename;
/**
* @var bool Control whether to persist session cookies or not.
*/
private $storeSessionCookies;
/**
* Create a new FileCookieJar object
*
* @param string $cookieFile File to store the cookie data
* @param bool $storeSessionCookies Set to true to store session cookies
* in the cookie jar.
*
* @throws \RuntimeException if the file cannot be found or created
*/
public function __construct(string $cookieFile, bool $storeSessionCookies = false)
{
parent::__construct();
$this->filename = $cookieFile;
$this->storeSessionCookies = $storeSessionCookies;
if (\file_exists($cookieFile)) {
$this->load($cookieFile);
}
}
/**
* Saves the file when shutting down
*/
public function __destruct()
{
$this->save($this->filename);
}
/**
* Saves the cookies to a file.
*
* @param string $filename File to save
*
* @throws \RuntimeException if the file cannot be found or created
*/
public function save(string $filename): void
{
$json = [];
/** @var SetCookie $cookie */
foreach ($this as $cookie) {
if (CookieJar::shouldPersist($cookie, $this->storeSessionCookies)) {
$json[] = $cookie->toArray();
}
}
$jsonStr = Utils::jsonEncode($json);
if (false === \file_put_contents($filename, $jsonStr, \LOCK_EX)) {
throw new \RuntimeException("Unable to save file {$filename}");
}
}
/**
* Load cookies from a JSON formatted file.
*
* Old cookies are kept unless overwritten by newly loaded ones.
*
* @param string $filename Cookie file to load.
*
* @throws \RuntimeException if the file cannot be loaded.
*/
public function load(string $filename): void
{
$json = \file_get_contents($filename);
if (false === $json) {
throw new \RuntimeException("Unable to load file {$filename}");
}
if ($json === '') {
return;
}
$data = Utils::jsonDecode($json, true);
if (\is_array($data)) {
foreach ($data as $cookie) {
$this->setCookie(new SetCookie($cookie));
}
} elseif (\is_scalar($data) && !empty($data)) {
throw new \RuntimeException("Invalid cookie file: {$filename}");
}
}
}

77
vendor/guzzlehttp/guzzle/src/Cookie/SessionCookieJar.php

@ -0,0 +1,77 @@
<?php
namespace GuzzleHttp\Cookie;
/**
* Persists cookies in the client session
*/
class SessionCookieJar extends CookieJar
{
/**
* @var string session key
*/
private $sessionKey;
/**
* @var bool Control whether to persist session cookies or not.
*/
private $storeSessionCookies;
/**
* Create a new SessionCookieJar object
*
* @param string $sessionKey Session key name to store the cookie
* data in session
* @param bool $storeSessionCookies Set to true to store session cookies
* in the cookie jar.
*/
public function __construct(string $sessionKey, bool $storeSessionCookies = false)
{
parent::__construct();
$this->sessionKey = $sessionKey;
$this->storeSessionCookies = $storeSessionCookies;
$this->load();
}
/**
* Saves cookies to session when shutting down
*/
public function __destruct()
{
$this->save();
}
/**
* Save cookies to the client session
*/
public function save(): void
{
$json = [];
/** @var SetCookie $cookie */
foreach ($this as $cookie) {
if (CookieJar::shouldPersist($cookie, $this->storeSessionCookies)) {
$json[] = $cookie->toArray();
}
}
$_SESSION[$this->sessionKey] = \json_encode($json);
}
/**
* Load the contents of the client session into the data array
*/
protected function load(): void
{
if (!isset($_SESSION[$this->sessionKey])) {
return;
}
$data = \json_decode($_SESSION[$this->sessionKey], true);
if (\is_array($data)) {
foreach ($data as $cookie) {
$this->setCookie(new SetCookie($cookie));
}
} elseif (\strlen($data)) {
throw new \RuntimeException("Invalid cookie data");
}
}
}

446
vendor/guzzlehttp/guzzle/src/Cookie/SetCookie.php

@ -0,0 +1,446 @@
<?php
namespace GuzzleHttp\Cookie;
/**
* Set-Cookie object
*/
class SetCookie
{
/**
* @var array
*/
private static $defaults = [
'Name' => null,
'Value' => null,
'Domain' => null,
'Path' => '/',
'Max-Age' => null,
'Expires' => null,
'Secure' => false,
'Discard' => false,
'HttpOnly' => false
];
/**
* @var array Cookie data
*/
private $data;
/**
* Create a new SetCookie object from a string.
*
* @param string $cookie Set-Cookie header string
*/
public static function fromString(string $cookie): self
{
// Create the default return array
$data = self::$defaults;
// Explode the cookie string using a series of semicolons
$pieces = \array_filter(\array_map('trim', \explode(';', $cookie)));
// The name of the cookie (first kvp) must exist and include an equal sign.
if (!isset($pieces[0]) || \strpos($pieces[0], '=') === false) {
return new self($data);
}
// Add the cookie pieces into the parsed data array
foreach ($pieces as $part) {
$cookieParts = \explode('=', $part, 2);
$key = \trim($cookieParts[0]);
$value = isset($cookieParts[1])
? \trim($cookieParts[1], " \n\r\t\0\x0B")
: true;
// Only check for non-cookies when cookies have been found
if (!isset($data['Name'])) {
$data['Name'] = $key;
$data['Value'] = $value;
} else {
foreach (\array_keys(self::$defaults) as $search) {
if (!\strcasecmp($search, $key)) {
$data[$search] = $value;
continue 2;
}
}
$data[$key] = $value;
}
}
return new self($data);
}
/**
* @param array $data Array of cookie data provided by a Cookie parser
*/
public function __construct(array $data = [])
{
/** @var array|null $replaced will be null in case of replace error */
$replaced = \array_replace(self::$defaults, $data);
if ($replaced === null) {
throw new \InvalidArgumentException('Unable to replace the default values for the Cookie.');
}
$this->data = $replaced;
// Extract the Expires value and turn it into a UNIX timestamp if needed
if (!$this->getExpires() && $this->getMaxAge()) {
// Calculate the Expires date
$this->setExpires(\time() + $this->getMaxAge());
} elseif (null !== ($expires = $this->getExpires()) && !\is_numeric($expires)) {
$this->setExpires($expires);
}
}
public function __toString()
{
$str = $this->data['Name'] . '=' . ($this->data['Value'] ?? '') . '; ';
foreach ($this->data as $k => $v) {
if ($k !== 'Name' && $k !== 'Value' && $v !== null && $v !== false) {
if ($k === 'Expires') {
$str .= 'Expires=' . \gmdate('D, d M Y H:i:s \G\M\T', $v) . '; ';
} else {
$str .= ($v === true ? $k : "{$k}={$v}") . '; ';
}
}
}
return \rtrim($str, '; ');
}
public function toArray(): array
{
return $this->data;
}
/**
* Get the cookie name.
*
* @return string
*/
public function getName()
{
return $this->data['Name'];
}
/**
* Set the cookie name.
*
* @param string $name Cookie name
*/
public function setName($name): void
{
if (!is_string($name)) {
trigger_deprecation('guzzlehttp/guzzle', '7.4', 'Not passing a string to %s::%s() is deprecated and will cause an error in 8.0.', __CLASS__, __FUNCTION__);
}
$this->data['Name'] = (string) $name;
}
/**
* Get the cookie value.
*
* @return string|null
*/
public function getValue()
{
return $this->data['Value'];
}
/**
* Set the cookie value.
*
* @param string $value Cookie value
*/
public function setValue($value): void
{
if (!is_string($value)) {
trigger_deprecation('guzzlehttp/guzzle', '7.4', 'Not passing a string to %s::%s() is deprecated and will cause an error in 8.0.', __CLASS__, __FUNCTION__);
}
$this->data['Value'] = (string) $value;
}
/**
* Get the domain.
*
* @return string|null
*/
public function getDomain()
{
return $this->data['Domain'];
}
/**
* Set the domain of the cookie.
*
* @param string|null $domain
*/
public function setDomain($domain): void
{
if (!is_string($domain) && null !== $domain) {
trigger_deprecation('guzzlehttp/guzzle', '7.4', 'Not passing a string or null to %s::%s() is deprecated and will cause an error in 8.0.', __CLASS__, __FUNCTION__);
}
$this->data['Domain'] = null === $domain ? null : (string) $domain;
}
/**
* Get the path.
*
* @return string
*/
public function getPath()
{
return $this->data['Path'];
}
/**
* Set the path of the cookie.
*
* @param string $path Path of the cookie
*/
public function setPath($path): void
{
if (!is_string($path)) {
trigger_deprecation('guzzlehttp/guzzle', '7.4', 'Not passing a string to %s::%s() is deprecated and will cause an error in 8.0.', __CLASS__, __FUNCTION__);
}
$this->data['Path'] = (string) $path;
}
/**
* Maximum lifetime of the cookie in seconds.
*
* @return int|null
*/
public function getMaxAge()
{
return null === $this->data['Max-Age'] ? null : (int) $this->data['Max-Age'];
}
/**
* Set the max-age of the cookie.
*
* @param int|null $maxAge Max age of the cookie in seconds
*/
public function setMaxAge($maxAge): void
{
if (!is_int($maxAge) && null !== $maxAge) {
trigger_deprecation('guzzlehttp/guzzle', '7.4', 'Not passing an int or null to %s::%s() is deprecated and will cause an error in 8.0.', __CLASS__, __FUNCTION__);
}
$this->data['Max-Age'] = $maxAge === null ? null : (int) $maxAge;
}
/**
* The UNIX timestamp when the cookie Expires.
*
* @return string|int|null
*/
public function getExpires()
{
return $this->data['Expires'];
}
/**
* Set the unix timestamp for which the cookie will expire.
*
* @param int|string|null $timestamp Unix timestamp or any English textual datetime description.
*/
public function setExpires($timestamp): void
{
if (!is_int($timestamp) && !is_string($timestamp) && null !== $timestamp) {
trigger_deprecation('guzzlehttp/guzzle', '7.4', 'Not passing an int, string or null to %s::%s() is deprecated and will cause an error in 8.0.', __CLASS__, __FUNCTION__);
}
$this->data['Expires'] = null === $timestamp ? null : (\is_numeric($timestamp) ? (int) $timestamp : \strtotime((string) $timestamp));
}
/**
* Get whether or not this is a secure cookie.
*
* @return bool
*/
public function getSecure()
{
return $this->data['Secure'];
}
/**
* Set whether or not the cookie is secure.
*
* @param bool $secure Set to true or false if secure
*/
public function setSecure($secure): void
{
if (!is_bool($secure)) {
trigger_deprecation('guzzlehttp/guzzle', '7.4', 'Not passing a bool to %s::%s() is deprecated and will cause an error in 8.0.', __CLASS__, __FUNCTION__);
}
$this->data['Secure'] = (bool) $secure;
}
/**
* Get whether or not this is a session cookie.
*
* @return bool|null
*/
public function getDiscard()
{
return $this->data['Discard'];
}
/**
* Set whether or not this is a session cookie.
*
* @param bool $discard Set to true or false if this is a session cookie
*/
public function setDiscard($discard): void
{
if (!is_bool($discard)) {
trigger_deprecation('guzzlehttp/guzzle', '7.4', 'Not passing a bool to %s::%s() is deprecated and will cause an error in 8.0.', __CLASS__, __FUNCTION__);
}
$this->data['Discard'] = (bool) $discard;
}
/**
* Get whether or not this is an HTTP only cookie.
*
* @return bool
*/
public function getHttpOnly()
{
return $this->data['HttpOnly'];
}
/**
* Set whether or not this is an HTTP only cookie.
*
* @param bool $httpOnly Set to true or false if this is HTTP only
*/
public function setHttpOnly($httpOnly): void
{
if (!is_bool($httpOnly)) {
trigger_deprecation('guzzlehttp/guzzle', '7.4', 'Not passing a bool to %s::%s() is deprecated and will cause an error in 8.0.', __CLASS__, __FUNCTION__);
}
$this->data['HttpOnly'] = (bool) $httpOnly;
}
/**
* Check if the cookie matches a path value.
*
* A request-path path-matches a given cookie-path if at least one of
* the following conditions holds:
*
* - The cookie-path and the request-path are identical.
* - The cookie-path is a prefix of the request-path, and the last
* character of the cookie-path is %x2F ("/").
* - The cookie-path is a prefix of the request-path, and the first
* character of the request-path that is not included in the cookie-
* path is a %x2F ("/") character.
*
* @param string $requestPath Path to check against
*/
public function matchesPath(string $requestPath): bool
{
$cookiePath = $this->getPath();
// Match on exact matches or when path is the default empty "/"
if ($cookiePath === '/' || $cookiePath == $requestPath) {
return true;
}
// Ensure that the cookie-path is a prefix of the request path.
if (0 !== \strpos($requestPath, $cookiePath)) {
return false;
}
// Match if the last character of the cookie-path is "/"
if (\substr($cookiePath, -1, 1) === '/') {
return true;
}
// Match if the first character not included in cookie path is "/"
return \substr($requestPath, \strlen($cookiePath), 1) === '/';
}
/**
* Check if the cookie matches a domain value.
*
* @param string $domain Domain to check against
*/
public function matchesDomain(string $domain): bool
{
$cookieDomain = $this->getDomain();
if (null === $cookieDomain) {
return true;
}
// Remove the leading '.' as per spec in RFC 6265.
// https://tools.ietf.org/html/rfc6265#section-5.2.3
$cookieDomain = \ltrim(\strtolower($cookieDomain), '.');
$domain = \strtolower($domain);
// Domain not set or exact match.
if ('' === $cookieDomain || $domain === $cookieDomain) {
return true;
}
// Matching the subdomain according to RFC 6265.
// https://tools.ietf.org/html/rfc6265#section-5.1.3
if (\filter_var($domain, \FILTER_VALIDATE_IP)) {
return false;
}
return (bool) \preg_match('/\.' . \preg_quote($cookieDomain, '/') . '$/', $domain);
}
/**
* Check if the cookie is expired.
*/
public function isExpired(): bool
{
return $this->getExpires() !== null && \time() > $this->getExpires();
}
/**
* Check if the cookie is valid according to RFC 6265.
*
* @return bool|string Returns true if valid or an error message if invalid
*/
public function validate()
{
$name = $this->getName();
if ($name === '') {
return 'The cookie name must not be empty';
}
// Check if any of the invalid characters are present in the cookie name
if (\preg_match(
'/[\x00-\x20\x22\x28-\x29\x2c\x2f\x3a-\x40\x5c\x7b\x7d\x7f]/',
$name
)) {
return 'Cookie name must not contain invalid characters: ASCII '
. 'Control characters (0-31;127), space, tab and the '
. 'following characters: ()<>@,;:\"/?={}';
}
// Value must not be null. 0 and empty string are valid. Empty strings
// are technically against RFC 6265, but known to happen in the wild.
$value = $this->getValue();
if ($value === null) {
return 'The cookie value must not be empty';
}
// Domains must not be empty, but can be 0. "0" is not a valid internet
// domain, but may be used as server name in a private network.
$domain = $this->getDomain();
if ($domain === null || $domain === '') {
return 'The cookie domain must not be empty';
}
return true;
}
}

39
vendor/guzzlehttp/guzzle/src/Exception/BadResponseException.php

@ -0,0 +1,39 @@
<?php
namespace GuzzleHttp\Exception;
use Psr\Http\Message\RequestInterface;
use Psr\Http\Message\ResponseInterface;
/**
* Exception when an HTTP error occurs (4xx or 5xx error)
*/
class BadResponseException extends RequestException
{
public function __construct(
string $message,
RequestInterface $request,
ResponseInterface $response,
\Throwable $previous = null,
array $handlerContext = []
) {
parent::__construct($message, $request, $response, $previous, $handlerContext);
}
/**
* Current exception and the ones that extend it will always have a response.
*/
public function hasResponse(): bool
{
return true;
}
/**
* This function narrows the return type from the parent class and does not allow it to be nullable.
*/
public function getResponse(): ResponseInterface
{
/** @var ResponseInterface */
return parent::getResponse();
}
}

10
vendor/guzzlehttp/guzzle/src/Exception/ClientException.php

@ -0,0 +1,10 @@
<?php
namespace GuzzleHttp\Exception;
/**
* Exception when a client error is encountered (4xx codes)
*/
class ClientException extends BadResponseException
{
}

56
vendor/guzzlehttp/guzzle/src/Exception/ConnectException.php

@ -0,0 +1,56 @@
<?php
namespace GuzzleHttp\Exception;
use Psr\Http\Client\NetworkExceptionInterface;
use Psr\Http\Message\RequestInterface;
/**
* Exception thrown when a connection cannot be established.
*
* Note that no response is present for a ConnectException
*/
class ConnectException extends TransferException implements NetworkExceptionInterface
{
/**
* @var RequestInterface
*/
private $request;
/**
* @var array
*/
private $handlerContext;
public function __construct(
string $message,
RequestInterface $request,
\Throwable $previous = null,
array $handlerContext = []
) {
parent::__construct($message, 0, $previous);
$this->request = $request;
$this->handlerContext = $handlerContext;
}
/**
* Get the request that caused the exception
*/
public function getRequest(): RequestInterface
{
return $this->request;
}
/**
* Get contextual information about the error from the underlying handler.
*
* The contents of this array will vary depending on which handler you are
* using. It may also be just an empty array. Relying on this data will
* couple you to a specific handler, but can give more debug information
* when needed.
*/
public function getHandlerContext(): array
{
return $this->handlerContext;
}
}

9
vendor/guzzlehttp/guzzle/src/Exception/GuzzleException.php

@ -0,0 +1,9 @@
<?php
namespace GuzzleHttp\Exception;
use Psr\Http\Client\ClientExceptionInterface;
interface GuzzleException extends ClientExceptionInterface
{
}

7
vendor/guzzlehttp/guzzle/src/Exception/InvalidArgumentException.php

@ -0,0 +1,7 @@
<?php
namespace GuzzleHttp\Exception;
final class InvalidArgumentException extends \InvalidArgumentException implements GuzzleException
{
}

166
vendor/guzzlehttp/guzzle/src/Exception/RequestException.php

@ -0,0 +1,166 @@
<?php
namespace GuzzleHttp\Exception;
use GuzzleHttp\BodySummarizer;
use GuzzleHttp\BodySummarizerInterface;
use Psr\Http\Client\RequestExceptionInterface;
use Psr\Http\Message\RequestInterface;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\UriInterface;
/**
* HTTP Request exception
*/
class RequestException extends TransferException implements RequestExceptionInterface
{
/**
* @var RequestInterface
*/
private $request;
/**
* @var ResponseInterface|null
*/
private $response;
/**
* @var array
*/
private $handlerContext;
public function __construct(
string $message,
RequestInterface $request,
ResponseInterface $response = null,
\Throwable $previous = null,
array $handlerContext = []
) {
// Set the code of the exception if the response is set and not future.
$code = $response ? $response->getStatusCode() : 0;
parent::__construct($message, $code, $previous);
$this->request = $request;
$this->response = $response;
$this->handlerContext = $handlerContext;
}
/**
* Wrap non-RequestExceptions with a RequestException
*/
public static function wrapException(RequestInterface $request, \Throwable $e): RequestException
{
return $e instanceof RequestException ? $e : new RequestException($e->getMessage(), $request, null, $e);
}
/**
* Factory method to create a new exception with a normalized error message
*
* @param RequestInterface $request Request sent
* @param ResponseInterface $response Response received
* @param \Throwable|null $previous Previous exception
* @param array $handlerContext Optional handler context
* @param BodySummarizerInterface|null $bodySummarizer Optional body summarizer
*/
public static function create(
RequestInterface $request,
ResponseInterface $response = null,
\Throwable $previous = null,
array $handlerContext = [],
BodySummarizerInterface $bodySummarizer = null
): self {
if (!$response) {
return new self(
'Error completing request',
$request,
null,
$previous,
$handlerContext
);
}
$level = (int) \floor($response->getStatusCode() / 100);
if ($level === 4) {
$label = 'Client error';
$className = ClientException::class;
} elseif ($level === 5) {
$label = 'Server error';
$className = ServerException::class;
} else {
$label = 'Unsuccessful request';
$className = __CLASS__;
}
$uri = $request->getUri();
$uri = static::obfuscateUri($uri);
// Client Error: `GET /` resulted in a `404 Not Found` response:
// <html> ... (truncated)
$message = \sprintf(
'%s: `%s %s` resulted in a `%s %s` response',
$label,
$request->getMethod(),
$uri->__toString(),
$response->getStatusCode(),
$response->getReasonPhrase()
);
$summary = ($bodySummarizer ?? new BodySummarizer())->summarize($response);
if ($summary !== null) {
$message .= ":\n{$summary}\n";
}
return new $className($message, $request, $response, $previous, $handlerContext);
}
/**
* Obfuscates URI if there is a username and a password present
*/
private static function obfuscateUri(UriInterface $uri): UriInterface
{
$userInfo = $uri->getUserInfo();
if (false !== ($pos = \strpos($userInfo, ':'))) {
return $uri->withUserInfo(\substr($userInfo, 0, $pos), '***');
}
return $uri;
}
/**
* Get the request that caused the exception
*/
public function getRequest(): RequestInterface
{
return $this->request;
}
/**
* Get the associated response
*/
public function getResponse(): ?ResponseInterface
{
return $this->response;
}
/**
* Check if a response was received
*/
public function hasResponse(): bool
{
return $this->response !== null;
}
/**
* Get contextual information about the error from the underlying handler.
*
* The contents of this array will vary depending on which handler you are
* using. It may also be just an empty array. Relying on this data will
* couple you to a specific handler, but can give more debug information
* when needed.
*/
public function getHandlerContext(): array
{
return $this->handlerContext;
}
}

10
vendor/guzzlehttp/guzzle/src/Exception/ServerException.php

@ -0,0 +1,10 @@
<?php
namespace GuzzleHttp\Exception;
/**
* Exception when a server error is encountered (5xx codes)
*/
class ServerException extends BadResponseException
{
}

7
vendor/guzzlehttp/guzzle/src/Exception/TooManyRedirectsException.php

@ -0,0 +1,7 @@
<?php
namespace GuzzleHttp\Exception;
class TooManyRedirectsException extends RequestException
{
}

7
vendor/guzzlehttp/guzzle/src/Exception/TransferException.php

@ -0,0 +1,7 @@
<?php
namespace GuzzleHttp\Exception;
class TransferException extends \RuntimeException implements GuzzleException
{
}

595
vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php

@ -0,0 +1,595 @@
<?php
namespace GuzzleHttp\Handler;
use GuzzleHttp\Exception\ConnectException;
use GuzzleHttp\Exception\RequestException;
use GuzzleHttp\Promise as P;
use GuzzleHttp\Promise\FulfilledPromise;
use GuzzleHttp\Promise\PromiseInterface;
use GuzzleHttp\Psr7\LazyOpenStream;
use GuzzleHttp\TransferStats;
use GuzzleHttp\Utils;
use Psr\Http\Message\RequestInterface;
/**
* Creates curl resources from a request
*
* @final
*/
class CurlFactory implements CurlFactoryInterface
{
public const CURL_VERSION_STR = 'curl_version';
/**
* @deprecated
*/
public const LOW_CURL_VERSION_NUMBER = '7.21.2';
/**
* @var resource[]|\CurlHandle[]
*/
private $handles = [];
/**
* @var int Total number of idle handles to keep in cache
*/
private $maxHandles;
/**
* @param int $maxHandles Maximum number of idle handles.
*/
public function __construct(int $maxHandles)
{
$this->maxHandles = $maxHandles;
}
public function create(RequestInterface $request, array $options): EasyHandle
{
if (isset($options['curl']['body_as_string'])) {
$options['_body_as_string'] = $options['curl']['body_as_string'];
unset($options['curl']['body_as_string']);
}
$easy = new EasyHandle;
$easy->request = $request;
$easy->options = $options;
$conf = $this->getDefaultConf($easy);
$this->applyMethod($easy, $conf);
$this->applyHandlerOptions($easy, $conf);
$this->applyHeaders($easy, $conf);
unset($conf['_headers']);
// Add handler options from the request configuration options
if (isset($options['curl'])) {
$conf = \array_replace($conf, $options['curl']);
}
$conf[\CURLOPT_HEADERFUNCTION] = $this->createHeaderFn($easy);
$easy->handle = $this->handles ? \array_pop($this->handles) : \curl_init();
curl_setopt_array($easy->handle, $conf);
return $easy;
}
public function release(EasyHandle $easy): void
{
$resource = $easy->handle;
unset($easy->handle);
if (\count($this->handles) >= $this->maxHandles) {
\curl_close($resource);
} else {
// Remove all callback functions as they can hold onto references
// and are not cleaned up by curl_reset. Using curl_setopt_array
// does not work for some reason, so removing each one
// individually.
\curl_setopt($resource, \CURLOPT_HEADERFUNCTION, null);
\curl_setopt($resource, \CURLOPT_READFUNCTION, null);
\curl_setopt($resource, \CURLOPT_WRITEFUNCTION, null);
\curl_setopt($resource, \CURLOPT_PROGRESSFUNCTION, null);
\curl_reset($resource);
$this->handles[] = $resource;
}
}
/**
* Completes a cURL transaction, either returning a response promise or a
* rejected promise.
*
* @param callable(RequestInterface, array): PromiseInterface $handler
* @param CurlFactoryInterface $factory Dictates how the handle is released
*/
public static function finish(callable $handler, EasyHandle $easy, CurlFactoryInterface $factory): PromiseInterface
{
if (isset($easy->options['on_stats'])) {
self::invokeStats($easy);
}
if (!$easy->response || $easy->errno) {
return self::finishError($handler, $easy, $factory);
}
// Return the response if it is present and there is no error.
$factory->release($easy);
// Rewind the body of the response if possible.
$body = $easy->response->getBody();
if ($body->isSeekable()) {
$body->rewind();
}
return new FulfilledPromise($easy->response);
}
private static function invokeStats(EasyHandle $easy): void
{
$curlStats = \curl_getinfo($easy->handle);
$curlStats['appconnect_time'] = \curl_getinfo($easy->handle, \CURLINFO_APPCONNECT_TIME);
$stats = new TransferStats(
$easy->request,
$easy->response,
$curlStats['total_time'],
$easy->errno,
$curlStats
);
($easy->options['on_stats'])($stats);
}
/**
* @param callable(RequestInterface, array): PromiseInterface $handler
*/
private static function finishError(callable $handler, EasyHandle $easy, CurlFactoryInterface $factory): PromiseInterface
{
// Get error information and release the handle to the factory.
$ctx = [
'errno' => $easy->errno,
'error' => \curl_error($easy->handle),
'appconnect_time' => \curl_getinfo($easy->handle, \CURLINFO_APPCONNECT_TIME),
] + \curl_getinfo($easy->handle);
$ctx[self::CURL_VERSION_STR] = \curl_version()['version'];
$factory->release($easy);
// Retry when nothing is present or when curl failed to rewind.
if (empty($easy->options['_err_message']) && (!$easy->errno || $easy->errno == 65)) {
return self::retryFailedRewind($handler, $easy, $ctx);
}
return self::createRejection($easy, $ctx);
}
private static function createRejection(EasyHandle $easy, array $ctx): PromiseInterface
{
static $connectionErrors = [
\CURLE_OPERATION_TIMEOUTED => true,
\CURLE_COULDNT_RESOLVE_HOST => true,
\CURLE_COULDNT_CONNECT => true,
\CURLE_SSL_CONNECT_ERROR => true,
\CURLE_GOT_NOTHING => true,
];
if ($easy->createResponseException) {
return P\Create::rejectionFor(
new RequestException(
'An error was encountered while creating the response',
$easy->request,
$easy->response,
$easy->createResponseException,
$ctx
)
);
}
// If an exception was encountered during the onHeaders event, then
// return a rejected promise that wraps that exception.
if ($easy->onHeadersException) {
return P\Create::rejectionFor(
new RequestException(
'An error was encountered during the on_headers event',
$easy->request,
$easy->response,
$easy->onHeadersException,
$ctx
)
);
}
$message = \sprintf(
'cURL error %s: %s (%s)',
$ctx['errno'],
$ctx['error'],
'see https://curl.haxx.se/libcurl/c/libcurl-errors.html'
);
$uriString = (string) $easy->request->getUri();
if ($uriString !== '' && false === \strpos($ctx['error'], $uriString)) {
$message .= \sprintf(' for %s', $uriString);
}
// Create a connection exception if it was a specific error code.
$error = isset($connectionErrors[$easy->errno])
? new ConnectException($message, $easy->request, null, $ctx)
: new RequestException($message, $easy->request, $easy->response, null, $ctx);
return P\Create::rejectionFor($error);
}
/**
* @return array<int|string, mixed>
*/
private function getDefaultConf(EasyHandle $easy): array
{
$conf = [
'_headers' => $easy->request->getHeaders(),
\CURLOPT_CUSTOMREQUEST => $easy->request->getMethod(),
\CURLOPT_URL => (string) $easy->request->getUri()->withFragment(''),
\CURLOPT_RETURNTRANSFER => false,
\CURLOPT_HEADER => false,
\CURLOPT_CONNECTTIMEOUT => 150,
];
if (\defined('CURLOPT_PROTOCOLS')) {
$conf[\CURLOPT_PROTOCOLS] = \CURLPROTO_HTTP | \CURLPROTO_HTTPS;
}
$version = $easy->request->getProtocolVersion();
if ($version == 1.1) {
$conf[\CURLOPT_HTTP_VERSION] = \CURL_HTTP_VERSION_1_1;
} elseif ($version == 2.0) {
$conf[\CURLOPT_HTTP_VERSION] = \CURL_HTTP_VERSION_2_0;
} else {
$conf[\CURLOPT_HTTP_VERSION] = \CURL_HTTP_VERSION_1_0;
}
return $conf;
}
private function applyMethod(EasyHandle $easy, array &$conf): void
{
$body = $easy->request->getBody();
$size = $body->getSize();
if ($size === null || $size > 0) {
$this->applyBody($easy->request, $easy->options, $conf);
return;
}
$method = $easy->request->getMethod();
if ($method === 'PUT' || $method === 'POST') {
// See https://tools.ietf.org/html/rfc7230#section-3.3.2
if (!$easy->request->hasHeader('Content-Length')) {
$conf[\CURLOPT_HTTPHEADER][] = 'Content-Length: 0';
}
} elseif ($method === 'HEAD') {
$conf[\CURLOPT_NOBODY] = true;
unset(
$conf[\CURLOPT_WRITEFUNCTION],
$conf[\CURLOPT_READFUNCTION],
$conf[\CURLOPT_FILE],
$conf[\CURLOPT_INFILE]
);
}
}
private function applyBody(RequestInterface $request, array $options, array &$conf): void
{
$size = $request->hasHeader('Content-Length')
? (int) $request->getHeaderLine('Content-Length')
: null;
// Send the body as a string if the size is less than 1MB OR if the
// [curl][body_as_string] request value is set.
if (($size !== null && $size < 1000000) || !empty($options['_body_as_string'])) {
$conf[\CURLOPT_POSTFIELDS] = (string) $request->getBody();
// Don't duplicate the Content-Length header
$this->removeHeader('Content-Length', $conf);
$this->removeHeader('Transfer-Encoding', $conf);
} else {
$conf[\CURLOPT_UPLOAD] = true;
if ($size !== null) {
$conf[\CURLOPT_INFILESIZE] = $size;
$this->removeHeader('Content-Length', $conf);
}
$body = $request->getBody();
if ($body->isSeekable()) {
$body->rewind();
}
$conf[\CURLOPT_READFUNCTION] = static function ($ch, $fd, $length) use ($body) {
return $body->read($length);
};
}
// If the Expect header is not present, prevent curl from adding it
if (!$request->hasHeader('Expect')) {
$conf[\CURLOPT_HTTPHEADER][] = 'Expect:';
}
// cURL sometimes adds a content-type by default. Prevent this.
if (!$request->hasHeader('Content-Type')) {
$conf[\CURLOPT_HTTPHEADER][] = 'Content-Type:';
}
}
private function applyHeaders(EasyHandle $easy, array &$conf): void
{
foreach ($conf['_headers'] as $name => $values) {
foreach ($values as $value) {
$value = (string) $value;
if ($value === '') {
// cURL requires a special format for empty headers.
// See https://github.com/guzzle/guzzle/issues/1882 for more details.
$conf[\CURLOPT_HTTPHEADER][] = "$name;";
} else {
$conf[\CURLOPT_HTTPHEADER][] = "$name: $value";
}
}
}
// Remove the Accept header if one was not set
if (!$easy->request->hasHeader('Accept')) {
$conf[\CURLOPT_HTTPHEADER][] = 'Accept:';
}
}
/**
* Remove a header from the options array.
*
* @param string $name Case-insensitive header to remove
* @param array $options Array of options to modify
*/
private function removeHeader(string $name, array &$options): void
{
foreach (\array_keys($options['_headers']) as $key) {
if (!\strcasecmp($key, $name)) {
unset($options['_headers'][$key]);
return;
}
}
}
private function applyHandlerOptions(EasyHandle $easy, array &$conf): void
{
$options = $easy->options;
if (isset($options['verify'])) {
if ($options['verify'] === false) {
unset($conf[\CURLOPT_CAINFO]);
$conf[\CURLOPT_SSL_VERIFYHOST] = 0;
$conf[\CURLOPT_SSL_VERIFYPEER] = false;
} else {
$conf[\CURLOPT_SSL_VERIFYHOST] = 2;
$conf[\CURLOPT_SSL_VERIFYPEER] = true;
if (\is_string($options['verify'])) {
// Throw an error if the file/folder/link path is not valid or doesn't exist.
if (!\file_exists($options['verify'])) {
throw new \InvalidArgumentException("SSL CA bundle not found: {$options['verify']}");
}
// If it's a directory or a link to a directory use CURLOPT_CAPATH.
// If not, it's probably a file, or a link to a file, so use CURLOPT_CAINFO.
if (
\is_dir($options['verify']) ||
(
\is_link($options['verify']) === true &&
($verifyLink = \readlink($options['verify'])) !== false &&
\is_dir($verifyLink)
)
) {
$conf[\CURLOPT_CAPATH] = $options['verify'];
} else {
$conf[\CURLOPT_CAINFO] = $options['verify'];
}
}
}
}
if (!isset($options['curl'][\CURLOPT_ENCODING]) && !empty($options['decode_content'])) {
$accept = $easy->request->getHeaderLine('Accept-Encoding');
if ($accept) {
$conf[\CURLOPT_ENCODING] = $accept;
} else {
// The empty string enables all available decoders and implicitly
// sets a matching 'Accept-Encoding' header.
$conf[\CURLOPT_ENCODING] = '';
// But as the user did not specify any acceptable encodings we need
// to overwrite this implicit header with an empty one.
$conf[\CURLOPT_HTTPHEADER][] = 'Accept-Encoding:';
}
}
if (!isset($options['sink'])) {
// Use a default temp stream if no sink was set.
$options['sink'] = \GuzzleHttp\Psr7\Utils::tryFopen('php://temp', 'w+');
}
$sink = $options['sink'];
if (!\is_string($sink)) {
$sink = \GuzzleHttp\Psr7\Utils::streamFor($sink);
} elseif (!\is_dir(\dirname($sink))) {
// Ensure that the directory exists before failing in curl.
throw new \RuntimeException(\sprintf('Directory %s does not exist for sink value of %s', \dirname($sink), $sink));
} else {
$sink = new LazyOpenStream($sink, 'w+');
}
$easy->sink = $sink;
$conf[\CURLOPT_WRITEFUNCTION] = static function ($ch, $write) use ($sink): int {
return $sink->write($write);
};
$timeoutRequiresNoSignal = false;
if (isset($options['timeout'])) {
$timeoutRequiresNoSignal |= $options['timeout'] < 1;
$conf[\CURLOPT_TIMEOUT_MS] = $options['timeout'] * 1000;
}
// CURL default value is CURL_IPRESOLVE_WHATEVER
if (isset($options['force_ip_resolve'])) {
if ('v4' === $options['force_ip_resolve']) {
$conf[\CURLOPT_IPRESOLVE] = \CURL_IPRESOLVE_V4;
} elseif ('v6' === $options['force_ip_resolve']) {
$conf[\CURLOPT_IPRESOLVE] = \CURL_IPRESOLVE_V6;
}
}
if (isset($options['connect_timeout'])) {
$timeoutRequiresNoSignal |= $options['connect_timeout'] < 1;
$conf[\CURLOPT_CONNECTTIMEOUT_MS] = $options['connect_timeout'] * 1000;
}
if ($timeoutRequiresNoSignal && \strtoupper(\substr(\PHP_OS, 0, 3)) !== 'WIN') {
$conf[\CURLOPT_NOSIGNAL] = true;
}
if (isset($options['proxy'])) {
if (!\is_array($options['proxy'])) {
$conf[\CURLOPT_PROXY] = $options['proxy'];
} else {
$scheme = $easy->request->getUri()->getScheme();
if (isset($options['proxy'][$scheme])) {
$host = $easy->request->getUri()->getHost();
if (!isset($options['proxy']['no']) || !Utils::isHostInNoProxy($host, $options['proxy']['no'])) {
$conf[\CURLOPT_PROXY] = $options['proxy'][$scheme];
}
}
}
}
if (isset($options['cert'])) {
$cert = $options['cert'];
if (\is_array($cert)) {
$conf[\CURLOPT_SSLCERTPASSWD] = $cert[1];
$cert = $cert[0];
}
if (!\file_exists($cert)) {
throw new \InvalidArgumentException("SSL certificate not found: {$cert}");
}
# OpenSSL (versions 0.9.3 and later) also support "P12" for PKCS#12-encoded files.
# see https://curl.se/libcurl/c/CURLOPT_SSLCERTTYPE.html
$ext = pathinfo($cert, \PATHINFO_EXTENSION);
if (preg_match('#^(der|p12)$#i', $ext)) {
$conf[\CURLOPT_SSLCERTTYPE] = strtoupper($ext);
}
$conf[\CURLOPT_SSLCERT] = $cert;
}
if (isset($options['ssl_key'])) {
if (\is_array($options['ssl_key'])) {
if (\count($options['ssl_key']) === 2) {
[$sslKey, $conf[\CURLOPT_SSLKEYPASSWD]] = $options['ssl_key'];
} else {
[$sslKey] = $options['ssl_key'];
}
}
$sslKey = $sslKey ?? $options['ssl_key'];
if (!\file_exists($sslKey)) {
throw new \InvalidArgumentException("SSL private key not found: {$sslKey}");
}
$conf[\CURLOPT_SSLKEY] = $sslKey;
}
if (isset($options['progress'])) {
$progress = $options['progress'];
if (!\is_callable($progress)) {
throw new \InvalidArgumentException('progress client option must be callable');
}
$conf[\CURLOPT_NOPROGRESS] = false;
$conf[\CURLOPT_PROGRESSFUNCTION] = static function ($resource, int $downloadSize, int $downloaded, int $uploadSize, int $uploaded) use ($progress) {
$progress($downloadSize, $downloaded, $uploadSize, $uploaded);
};
}
if (!empty($options['debug'])) {
$conf[\CURLOPT_STDERR] = Utils::debugResource($options['debug']);
$conf[\CURLOPT_VERBOSE] = true;
}
}
/**
* This function ensures that a response was set on a transaction. If one
* was not set, then the request is retried if possible. This error
* typically means you are sending a payload, curl encountered a
* "Connection died, retrying a fresh connect" error, tried to rewind the
* stream, and then encountered a "necessary data rewind wasn't possible"
* error, causing the request to be sent through curl_multi_info_read()
* without an error status.
*
* @param callable(RequestInterface, array): PromiseInterface $handler
*/
private static function retryFailedRewind(callable $handler, EasyHandle $easy, array $ctx): PromiseInterface
{
try {
// Only rewind if the body has been read from.
$body = $easy->request->getBody();
if ($body->tell() > 0) {
$body->rewind();
}
} catch (\RuntimeException $e) {
$ctx['error'] = 'The connection unexpectedly failed without '
. 'providing an error. The request would have been retried, '
. 'but attempting to rewind the request body failed. '
. 'Exception: ' . $e;
return self::createRejection($easy, $ctx);
}
// Retry no more than 3 times before giving up.
if (!isset($easy->options['_curl_retries'])) {
$easy->options['_curl_retries'] = 1;
} elseif ($easy->options['_curl_retries'] == 2) {
$ctx['error'] = 'The cURL request was retried 3 times '
. 'and did not succeed. The most likely reason for the failure '
. 'is that cURL was unable to rewind the body of the request '
. 'and subsequent retries resulted in the same error. Turn on '
. 'the debug option to see what went wrong. See '
. 'https://bugs.php.net/bug.php?id=47204 for more information.';
return self::createRejection($easy, $ctx);
} else {
$easy->options['_curl_retries']++;
}
return $handler($easy->request, $easy->options);
}
private function createHeaderFn(EasyHandle $easy): callable
{
if (isset($easy->options['on_headers'])) {
$onHeaders = $easy->options['on_headers'];
if (!\is_callable($onHeaders)) {
throw new \InvalidArgumentException('on_headers must be callable');
}
} else {
$onHeaders = null;
}
return static function ($ch, $h) use (
$onHeaders,
$easy,
&$startingResponse
) {
$value = \trim($h);
if ($value === '') {
$startingResponse = true;
try {
$easy->createResponse();
} catch (\Exception $e) {
$easy->createResponseException = $e;
return -1;
}
if ($onHeaders !== null) {
try {
$onHeaders($easy->response);
} catch (\Exception $e) {
// Associate the exception with the handle and trigger
// a curl header write error by returning 0.
$easy->onHeadersException = $e;
return -1;
}
}
} elseif ($startingResponse) {
$startingResponse = false;
$easy->headers = [$value];
} else {
$easy->headers[] = $value;
}
return \strlen($h);
};
}
}

25
vendor/guzzlehttp/guzzle/src/Handler/CurlFactoryInterface.php

@ -0,0 +1,25 @@
<?php
namespace GuzzleHttp\Handler;
use Psr\Http\Message\RequestInterface;
interface CurlFactoryInterface
{
/**
* Creates a cURL handle resource.
*
* @param RequestInterface $request Request
* @param array $options Transfer options
*
* @throws \RuntimeException when an option cannot be applied
*/
public function create(RequestInterface $request, array $options): EasyHandle;
/**
* Release an easy handle, allowing it to be reused or closed.
*
* This function must call unset on the easy handle's "handle" property.
*/
public function release(EasyHandle $easy): void;
}

49
vendor/guzzlehttp/guzzle/src/Handler/CurlHandler.php

@ -0,0 +1,49 @@
<?php
namespace GuzzleHttp\Handler;
use GuzzleHttp\Promise\PromiseInterface;
use Psr\Http\Message\RequestInterface;
/**
* HTTP handler that uses cURL easy handles as a transport layer.
*
* When using the CurlHandler, custom curl options can be specified as an
* associative array of curl option constants mapping to values in the
* **curl** key of the "client" key of the request.
*
* @final
*/
class CurlHandler
{
/**
* @var CurlFactoryInterface
*/
private $factory;
/**
* Accepts an associative array of options:
*
* - handle_factory: Optional curl factory used to create cURL handles.
*
* @param array{handle_factory?: ?CurlFactoryInterface} $options Array of options to use with the handler
*/
public function __construct(array $options = [])
{
$this->factory = $options['handle_factory']
?? new CurlFactory(3);
}
public function __invoke(RequestInterface $request, array $options): PromiseInterface
{
if (isset($options['delay'])) {
\usleep($options['delay'] * 1000);
}
$easy = $this->factory->create($request, $options);
\curl_exec($easy->handle);
$easy->errno = \curl_errno($easy->handle);
return CurlFactory::finish($this, $easy, $this->factory);
}
}

262
vendor/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php

@ -0,0 +1,262 @@
<?php
namespace GuzzleHttp\Handler;
use GuzzleHttp\Promise as P;
use GuzzleHttp\Promise\Promise;
use GuzzleHttp\Promise\PromiseInterface;
use GuzzleHttp\Utils;
use Psr\Http\Message\RequestInterface;
/**
* Returns an asynchronous response using curl_multi_* functions.
*
* When using the CurlMultiHandler, custom curl options can be specified as an
* associative array of curl option constants mapping to values in the
* **curl** key of the provided request options.
*
* @property resource|\CurlMultiHandle $_mh Internal use only. Lazy loaded multi-handle.
*
* @final
*/
#[\AllowDynamicProperties]
class CurlMultiHandler
{
/**
* @var CurlFactoryInterface
*/
private $factory;
/**
* @var int
*/
private $selectTimeout;
/**
* @var int Will be higher than 0 when `curl_multi_exec` is still running.
*/
private $active = 0;
/**
* @var array Request entry handles, indexed by handle id in `addRequest`.
*
* @see CurlMultiHandler::addRequest
*/
private $handles = [];
/**
* @var array<int, float> An array of delay times, indexed by handle id in `addRequest`.
*
* @see CurlMultiHandler::addRequest
*/
private $delays = [];
/**
* @var array<mixed> An associative array of CURLMOPT_* options and corresponding values for curl_multi_setopt()
*/
private $options = [];
/**
* This handler accepts the following options:
*
* - handle_factory: An optional factory used to create curl handles
* - select_timeout: Optional timeout (in seconds) to block before timing
* out while selecting curl handles. Defaults to 1 second.
* - options: An associative array of CURLMOPT_* options and
* corresponding values for curl_multi_setopt()
*/
public function __construct(array $options = [])
{
$this->factory = $options['handle_factory'] ?? new CurlFactory(50);
if (isset($options['select_timeout'])) {
$this->selectTimeout = $options['select_timeout'];
} elseif ($selectTimeout = Utils::getenv('GUZZLE_CURL_SELECT_TIMEOUT')) {
@trigger_error('Since guzzlehttp/guzzle 7.2.0: Using environment variable GUZZLE_CURL_SELECT_TIMEOUT is deprecated. Use option "select_timeout" instead.', \E_USER_DEPRECATED);
$this->selectTimeout = (int) $selectTimeout;
} else {
$this->selectTimeout = 1;
}
$this->options = $options['options'] ?? [];
}
/**
* @param string $name
*
* @return resource|\CurlMultiHandle
*
* @throws \BadMethodCallException when another field as `_mh` will be gotten
* @throws \RuntimeException when curl can not initialize a multi handle
*/
public function __get($name)
{
if ($name !== '_mh') {
throw new \BadMethodCallException("Can not get other property as '_mh'.");
}
$multiHandle = \curl_multi_init();
if (false === $multiHandle) {
throw new \RuntimeException('Can not initialize curl multi handle.');
}
$this->_mh = $multiHandle;
foreach ($this->options as $option => $value) {
// A warning is raised in case of a wrong option.
curl_multi_setopt($this->_mh, $option, $value);
}
return $this->_mh;
}
public function __destruct()
{
if (isset($this->_mh)) {
\curl_multi_close($this->_mh);
unset($this->_mh);
}
}
public function __invoke(RequestInterface $request, array $options): PromiseInterface
{
$easy = $this->factory->create($request, $options);
$id = (int) $easy->handle;
$promise = new Promise(
[$this, 'execute'],
function () use ($id) {
return $this->cancel($id);
}
);
$this->addRequest(['easy' => $easy, 'deferred' => $promise]);
return $promise;
}
/**
* Ticks the curl event loop.
*/
public function tick(): void
{
// Add any delayed handles if needed.
if ($this->delays) {
$currentTime = Utils::currentTime();
foreach ($this->delays as $id => $delay) {
if ($currentTime >= $delay) {
unset($this->delays[$id]);
\curl_multi_add_handle(
$this->_mh,
$this->handles[$id]['easy']->handle
);
}
}
}
// Step through the task queue which may add additional requests.
P\Utils::queue()->run();
if ($this->active && \curl_multi_select($this->_mh, $this->selectTimeout) === -1) {
// Perform a usleep if a select returns -1.
// See: https://bugs.php.net/bug.php?id=61141
\usleep(250);
}
while (\curl_multi_exec($this->_mh, $this->active) === \CURLM_CALL_MULTI_PERFORM);
$this->processMessages();
}
/**
* Runs until all outstanding connections have completed.
*/
public function execute(): void
{
$queue = P\Utils::queue();
while ($this->handles || !$queue->isEmpty()) {
// If there are no transfers, then sleep for the next delay
if (!$this->active && $this->delays) {
\usleep($this->timeToNext());
}
$this->tick();
}
}
private function addRequest(array $entry): void
{
$easy = $entry['easy'];
$id = (int) $easy->handle;
$this->handles[$id] = $entry;
if (empty($easy->options['delay'])) {
\curl_multi_add_handle($this->_mh, $easy->handle);
} else {
$this->delays[$id] = Utils::currentTime() + ($easy->options['delay'] / 1000);
}
}
/**
* Cancels a handle from sending and removes references to it.
*
* @param int $id Handle ID to cancel and remove.
*
* @return bool True on success, false on failure.
*/
private function cancel($id): bool
{
if (!is_int($id)) {
trigger_deprecation('guzzlehttp/guzzle', '7.4', 'Not passing an integer to %s::%s() is deprecated and will cause an error in 8.0.', __CLASS__, __FUNCTION__);
}
// Cannot cancel if it has been processed.
if (!isset($this->handles[$id])) {
return false;
}
$handle = $this->handles[$id]['easy']->handle;
unset($this->delays[$id], $this->handles[$id]);
\curl_multi_remove_handle($this->_mh, $handle);
\curl_close($handle);
return true;
}
private function processMessages(): void
{
while ($done = \curl_multi_info_read($this->_mh)) {
if ($done['msg'] !== \CURLMSG_DONE) {
// if it's not done, then it would be premature to remove the handle. ref https://github.com/guzzle/guzzle/pull/2892#issuecomment-945150216
continue;
}
$id = (int) $done['handle'];
\curl_multi_remove_handle($this->_mh, $done['handle']);
if (!isset($this->handles[$id])) {
// Probably was cancelled.
continue;
}
$entry = $this->handles[$id];
unset($this->handles[$id], $this->delays[$id]);
$entry['easy']->errno = $done['result'];
$entry['deferred']->resolve(
CurlFactory::finish($this, $entry['easy'], $this->factory)
);
}
}
private function timeToNext(): int
{
$currentTime = Utils::currentTime();
$nextTime = \PHP_INT_MAX;
foreach ($this->delays as $time) {
if ($time < $nextTime) {
$nextTime = $time;
}
}
return ((int) \max(0, $nextTime - $currentTime)) * 1000000;
}
}

112
vendor/guzzlehttp/guzzle/src/Handler/EasyHandle.php

@ -0,0 +1,112 @@
<?php
namespace GuzzleHttp\Handler;
use GuzzleHttp\Psr7\Response;
use GuzzleHttp\Utils;
use Psr\Http\Message\RequestInterface;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\StreamInterface;
/**
* Represents a cURL easy handle and the data it populates.
*
* @internal
*/
final class EasyHandle
{
/**
* @var resource|\CurlHandle cURL resource
*/
public $handle;
/**
* @var StreamInterface Where data is being written
*/
public $sink;
/**
* @var array Received HTTP headers so far
*/
public $headers = [];
/**
* @var ResponseInterface|null Received response (if any)
*/
public $response;
/**
* @var RequestInterface Request being sent
*/
public $request;
/**
* @var array Request options
*/
public $options = [];
/**
* @var int cURL error number (if any)
*/
public $errno = 0;
/**
* @var \Throwable|null Exception during on_headers (if any)
*/
public $onHeadersException;
/**
* @var \Exception|null Exception during createResponse (if any)
*/
public $createResponseException;
/**
* Attach a response to the easy handle based on the received headers.
*
* @throws \RuntimeException if no headers have been received or the first
* header line is invalid.
*/
public function createResponse(): void
{
[$ver, $status, $reason, $headers] = HeaderProcessor::parseHeaders($this->headers);
$normalizedKeys = Utils::normalizeHeaderKeys($headers);
if (!empty($this->options['decode_content']) && isset($normalizedKeys['content-encoding'])) {
$headers['x-encoded-content-encoding'] = $headers[$normalizedKeys['content-encoding']];
unset($headers[$normalizedKeys['content-encoding']]);
if (isset($normalizedKeys['content-length'])) {
$headers['x-encoded-content-length'] = $headers[$normalizedKeys['content-length']];
$bodyLength = (int) $this->sink->getSize();
if ($bodyLength) {
$headers[$normalizedKeys['content-length']] = $bodyLength;
} else {
unset($headers[$normalizedKeys['content-length']]);
}
}
}
// Attach a response to the easy handle with the parsed headers.
$this->response = new Response(
$status,
$headers,
$this->sink,
$ver,
$reason
);
}
/**
* @param string $name
*
* @return void
*
* @throws \BadMethodCallException
*/
public function __get($name)
{
$msg = $name === 'handle' ? 'The EasyHandle has been released' : 'Invalid property: ' . $name;
throw new \BadMethodCallException($msg);
}
}

42
vendor/guzzlehttp/guzzle/src/Handler/HeaderProcessor.php

@ -0,0 +1,42 @@
<?php
namespace GuzzleHttp\Handler;
use GuzzleHttp\Utils;
/**
* @internal
*/
final class HeaderProcessor
{
/**
* Returns the HTTP version, status code, reason phrase, and headers.
*
* @param string[] $headers
*
* @throws \RuntimeException
*
* @return array{0:string, 1:int, 2:?string, 3:array}
*/
public static function parseHeaders(array $headers): array
{
if ($headers === []) {
throw new \RuntimeException('Expected a non-empty array of header data');
}
$parts = \explode(' ', \array_shift($headers), 3);
$version = \explode('/', $parts[0])[1] ?? null;
if ($version === null) {
throw new \RuntimeException('HTTP version missing from header data');
}
$status = $parts[1] ?? null;
if ($status === null) {
throw new \RuntimeException('HTTP status code missing from header data');
}
return [$version, (int) $status, $parts[2] ?? null, Utils::headersFromLines($headers)];
}
}

211
vendor/guzzlehttp/guzzle/src/Handler/MockHandler.php

@ -0,0 +1,211 @@
<?php
namespace GuzzleHttp\Handler;
use GuzzleHttp\Exception\RequestException;
use GuzzleHttp\HandlerStack;
use GuzzleHttp\Promise as P;
use GuzzleHttp\Promise\PromiseInterface;
use GuzzleHttp\TransferStats;
use GuzzleHttp\Utils;
use Psr\Http\Message\RequestInterface;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\StreamInterface;
/**
* Handler that returns responses or throw exceptions from a queue.
*
* @final
*/
class MockHandler implements \Countable
{
/**
* @var array
*/
private $queue = [];
/**
* @var RequestInterface|null
*/
private $lastRequest;
/**
* @var array
*/
private $lastOptions = [];
/**
* @var callable|null
*/
private $onFulfilled;
/**
* @var callable|null
*/
private $onRejected;
/**
* Creates a new MockHandler that uses the default handler stack list of
* middlewares.
*
* @param array|null $queue Array of responses, callables, or exceptions.
* @param callable|null $onFulfilled Callback to invoke when the return value is fulfilled.
* @param callable|null $onRejected Callback to invoke when the return value is rejected.
*/
public static function createWithMiddleware(array $queue = null, callable $onFulfilled = null, callable $onRejected = null): HandlerStack
{
return HandlerStack::create(new self($queue, $onFulfilled, $onRejected));
}
/**
* The passed in value must be an array of
* {@see \Psr\Http\Message\ResponseInterface} objects, Exceptions,
* callables, or Promises.
*
* @param array<int, mixed>|null $queue The parameters to be passed to the append function, as an indexed array.
* @param callable|null $onFulfilled Callback to invoke when the return value is fulfilled.
* @param callable|null $onRejected Callback to invoke when the return value is rejected.
*/
public function __construct(array $queue = null, callable $onFulfilled = null, callable $onRejected = null)
{
$this->onFulfilled = $onFulfilled;
$this->onRejected = $onRejected;
if ($queue) {
// array_values included for BC
$this->append(...array_values($queue));
}
}
public function __invoke(RequestInterface $request, array $options): PromiseInterface
{
if (!$this->queue) {
throw new \OutOfBoundsException('Mock queue is empty');
}
if (isset($options['delay']) && \is_numeric($options['delay'])) {
\usleep((int) $options['delay'] * 1000);
}
$this->lastRequest = $request;
$this->lastOptions = $options;
$response = \array_shift($this->queue);
if (isset($options['on_headers'])) {
if (!\is_callable($options['on_headers'])) {
throw new \InvalidArgumentException('on_headers must be callable');
}
try {
$options['on_headers']($response);
} catch (\Exception $e) {
$msg = 'An error was encountered during the on_headers event';
$response = new RequestException($msg, $request, $response, $e);
}
}
if (\is_callable($response)) {
$response = $response($request, $options);
}
$response = $response instanceof \Throwable
? P\Create::rejectionFor($response)
: P\Create::promiseFor($response);
return $response->then(
function (?ResponseInterface $value) use ($request, $options) {
$this->invokeStats($request, $options, $value);
if ($this->onFulfilled) {
($this->onFulfilled)($value);
}
if ($value !== null && isset($options['sink'])) {
$contents = (string) $value->getBody();
$sink = $options['sink'];
if (\is_resource($sink)) {
\fwrite($sink, $contents);
} elseif (\is_string($sink)) {
\file_put_contents($sink, $contents);
} elseif ($sink instanceof StreamInterface) {
$sink->write($contents);
}
}
return $value;
},
function ($reason) use ($request, $options) {
$this->invokeStats($request, $options, null, $reason);
if ($this->onRejected) {
($this->onRejected)($reason);
}
return P\Create::rejectionFor($reason);
}
);
}
/**
* Adds one or more variadic requests, exceptions, callables, or promises
* to the queue.
*
* @param mixed ...$values
*/
public function append(...$values): void
{
foreach ($values as $value) {
if ($value instanceof ResponseInterface
|| $value instanceof \Throwable
|| $value instanceof PromiseInterface
|| \is_callable($value)
) {
$this->queue[] = $value;
} else {
throw new \TypeError('Expected a Response, Promise, Throwable or callable. Found ' . Utils::describeType($value));
}
}
}
/**
* Get the last received request.
*/
public function getLastRequest(): ?RequestInterface
{
return $this->lastRequest;
}
/**
* Get the last received request options.
*/
public function getLastOptions(): array
{
return $this->lastOptions;
}
/**
* Returns the number of remaining items in the queue.
*/
public function count(): int
{
return \count($this->queue);
}
public function reset(): void
{
$this->queue = [];
}
/**
* @param mixed $reason Promise or reason.
*/
private function invokeStats(
RequestInterface $request,
array $options,
ResponseInterface $response = null,
$reason = null
): void {
if (isset($options['on_stats'])) {
$transferTime = $options['transfer_time'] ?? 0;
$stats = new TransferStats($request, $response, $transferTime, $reason);
($options['on_stats'])($stats);
}
}
}

51
vendor/guzzlehttp/guzzle/src/Handler/Proxy.php

@ -0,0 +1,51 @@
<?php
namespace GuzzleHttp\Handler;
use GuzzleHttp\Promise\PromiseInterface;
use GuzzleHttp\RequestOptions;
use Psr\Http\Message\RequestInterface;
/**
* Provides basic proxies for handlers.
*
* @final
*/
class Proxy
{
/**
* Sends synchronous requests to a specific handler while sending all other
* requests to another handler.
*
* @param callable(\Psr\Http\Message\RequestInterface, array): \GuzzleHttp\Promise\PromiseInterface $default Handler used for normal responses
* @param callable(\Psr\Http\Message\RequestInterface, array): \GuzzleHttp\Promise\PromiseInterface $sync Handler used for synchronous responses.
*
* @return callable(\Psr\Http\Message\RequestInterface, array): \GuzzleHttp\Promise\PromiseInterface Returns the composed handler.
*/
public static function wrapSync(callable $default, callable $sync): callable
{
return static function (RequestInterface $request, array $options) use ($default, $sync): PromiseInterface {
return empty($options[RequestOptions::SYNCHRONOUS]) ? $default($request, $options) : $sync($request, $options);
};
}
/**
* Sends streaming requests to a streaming compatible handler while sending
* all other requests to a default handler.
*
* This, for example, could be useful for taking advantage of the
* performance benefits of curl while still supporting true streaming
* through the StreamHandler.
*
* @param callable(\Psr\Http\Message\RequestInterface, array): \GuzzleHttp\Promise\PromiseInterface $default Handler used for non-streaming responses
* @param callable(\Psr\Http\Message\RequestInterface, array): \GuzzleHttp\Promise\PromiseInterface $streaming Handler used for streaming responses
*
* @return callable(\Psr\Http\Message\RequestInterface, array): \GuzzleHttp\Promise\PromiseInterface Returns the composed handler.
*/
public static function wrapStreaming(callable $default, callable $streaming): callable
{
return static function (RequestInterface $request, array $options) use ($default, $streaming): PromiseInterface {
return empty($options['stream']) ? $default($request, $options) : $streaming($request, $options);
};
}
}

593
vendor/guzzlehttp/guzzle/src/Handler/StreamHandler.php

@ -0,0 +1,593 @@
<?php
namespace GuzzleHttp\Handler;
use GuzzleHttp\Exception\ConnectException;
use GuzzleHttp\Exception\RequestException;
use GuzzleHttp\Promise as P;
use GuzzleHttp\Promise\FulfilledPromise;
use GuzzleHttp\Promise\PromiseInterface;
use GuzzleHttp\Psr7;
use GuzzleHttp\TransferStats;
use GuzzleHttp\Utils;
use Psr\Http\Message\RequestInterface;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\StreamInterface;
use Psr\Http\Message\UriInterface;
/**
* HTTP handler that uses PHP's HTTP stream wrapper.
*
* @final
*/
class StreamHandler
{
/**
* @var array
*/
private $lastHeaders = [];
/**
* Sends an HTTP request.
*
* @param RequestInterface $request Request to send.
* @param array $options Request transfer options.
*/
public function __invoke(RequestInterface $request, array $options): PromiseInterface
{
// Sleep if there is a delay specified.
if (isset($options['delay'])) {
\usleep($options['delay'] * 1000);
}
$startTime = isset($options['on_stats']) ? Utils::currentTime() : null;
try {
// Does not support the expect header.
$request = $request->withoutHeader('Expect');
// Append a content-length header if body size is zero to match
// cURL's behavior.
if (0 === $request->getBody()->getSize()) {
$request = $request->withHeader('Content-Length', '0');
}
return $this->createResponse(
$request,
$options,
$this->createStream($request, $options),
$startTime
);
} catch (\InvalidArgumentException $e) {
throw $e;
} catch (\Exception $e) {
// Determine if the error was a networking error.
$message = $e->getMessage();
// This list can probably get more comprehensive.
if (false !== \strpos($message, 'getaddrinfo') // DNS lookup failed
|| false !== \strpos($message, 'Connection refused')
|| false !== \strpos($message, "couldn't connect to host") // error on HHVM
|| false !== \strpos($message, "connection attempt failed")
) {
$e = new ConnectException($e->getMessage(), $request, $e);
} else {
$e = RequestException::wrapException($request, $e);
}
$this->invokeStats($options, $request, $startTime, null, $e);
return P\Create::rejectionFor($e);
}
}
private function invokeStats(
array $options,
RequestInterface $request,
?float $startTime,
ResponseInterface $response = null,
\Throwable $error = null
): void {
if (isset($options['on_stats'])) {
$stats = new TransferStats($request, $response, Utils::currentTime() - $startTime, $error, []);
($options['on_stats'])($stats);
}
}
/**
* @param resource $stream
*/
private function createResponse(RequestInterface $request, array $options, $stream, ?float $startTime): PromiseInterface
{
$hdrs = $this->lastHeaders;
$this->lastHeaders = [];
try {
[$ver, $status, $reason, $headers] = HeaderProcessor::parseHeaders($hdrs);
} catch (\Exception $e) {
return P\Create::rejectionFor(
new RequestException('An error was encountered while creating the response', $request, null, $e)
);
}
[$stream, $headers] = $this->checkDecode($options, $headers, $stream);
$stream = Psr7\Utils::streamFor($stream);
$sink = $stream;
if (\strcasecmp('HEAD', $request->getMethod())) {
$sink = $this->createSink($stream, $options);
}
try {
$response = new Psr7\Response($status, $headers, $sink, $ver, $reason);
} catch (\Exception $e) {
return P\Create::rejectionFor(
new RequestException('An error was encountered while creating the response', $request, null, $e)
);
}
if (isset($options['on_headers'])) {
try {
$options['on_headers']($response);
} catch (\Exception $e) {
return P\Create::rejectionFor(
new RequestException('An error was encountered during the on_headers event', $request, $response, $e)
);
}
}
// Do not drain when the request is a HEAD request because they have
// no body.
if ($sink !== $stream) {
$this->drain($stream, $sink, $response->getHeaderLine('Content-Length'));
}
$this->invokeStats($options, $request, $startTime, $response, null);
return new FulfilledPromise($response);
}
private function createSink(StreamInterface $stream, array $options): StreamInterface
{
if (!empty($options['stream'])) {
return $stream;
}
$sink = $options['sink'] ?? Psr7\Utils::tryFopen('php://temp', 'r+');
return \is_string($sink) ? new Psr7\LazyOpenStream($sink, 'w+') : Psr7\Utils::streamFor($sink);
}
/**
* @param resource $stream
*/
private function checkDecode(array $options, array $headers, $stream): array
{
// Automatically decode responses when instructed.
if (!empty($options['decode_content'])) {
$normalizedKeys = Utils::normalizeHeaderKeys($headers);
if (isset($normalizedKeys['content-encoding'])) {
$encoding = $headers[$normalizedKeys['content-encoding']];
if ($encoding[0] === 'gzip' || $encoding[0] === 'deflate') {
$stream = new Psr7\InflateStream(Psr7\Utils::streamFor($stream));
$headers['x-encoded-content-encoding'] = $headers[$normalizedKeys['content-encoding']];
// Remove content-encoding header
unset($headers[$normalizedKeys['content-encoding']]);
// Fix content-length header
if (isset($normalizedKeys['content-length'])) {
$headers['x-encoded-content-length'] = $headers[$normalizedKeys['content-length']];
$length = (int) $stream->getSize();
if ($length === 0) {
unset($headers[$normalizedKeys['content-length']]);
} else {
$headers[$normalizedKeys['content-length']] = [$length];
}
}
}
}
}
return [$stream, $headers];
}
/**
* Drains the source stream into the "sink" client option.
*
* @param string $contentLength Header specifying the amount of
* data to read.
*
* @throws \RuntimeException when the sink option is invalid.
*/
private function drain(StreamInterface $source, StreamInterface $sink, string $contentLength): StreamInterface
{
// If a content-length header is provided, then stop reading once
// that number of bytes has been read. This can prevent infinitely
// reading from a stream when dealing with servers that do not honor
// Connection: Close headers.
Psr7\Utils::copyToStream(
$source,
$sink,
(\strlen($contentLength) > 0 && (int) $contentLength > 0) ? (int) $contentLength : -1
);
$sink->seek(0);
$source->close();
return $sink;
}
/**
* Create a resource and check to ensure it was created successfully
*
* @param callable $callback Callable that returns stream resource
*
* @return resource
*
* @throws \RuntimeException on error
*/
private function createResource(callable $callback)
{
$errors = [];
\set_error_handler(static function ($_, $msg, $file, $line) use (&$errors): bool {
$errors[] = [
'message' => $msg,
'file' => $file,
'line' => $line
];
return true;
});
try {
$resource = $callback();
} finally {
\restore_error_handler();
}
if (!$resource) {
$message = 'Error creating resource: ';
foreach ($errors as $err) {
foreach ($err as $key => $value) {
$message .= "[$key] $value" . \PHP_EOL;
}
}
throw new \RuntimeException(\trim($message));
}
return $resource;
}
/**
* @return resource
*/
private function createStream(RequestInterface $request, array $options)
{
static $methods;
if (!$methods) {
$methods = \array_flip(\get_class_methods(__CLASS__));
}
if (!\in_array($request->getUri()->getScheme(), ['http', 'https'])) {
throw new RequestException(\sprintf("The scheme '%s' is not supported.", $request->getUri()->getScheme()), $request);
}
// HTTP/1.1 streams using the PHP stream wrapper require a
// Connection: close header
if ($request->getProtocolVersion() == '1.1'
&& !$request->hasHeader('Connection')
) {
$request = $request->withHeader('Connection', 'close');
}
// Ensure SSL is verified by default
if (!isset($options['verify'])) {
$options['verify'] = true;
}
$params = [];
$context = $this->getDefaultContext($request);
if (isset($options['on_headers']) && !\is_callable($options['on_headers'])) {
throw new \InvalidArgumentException('on_headers must be callable');
}
if (!empty($options)) {
foreach ($options as $key => $value) {
$method = "add_{$key}";
if (isset($methods[$method])) {
$this->{$method}($request, $context, $value, $params);
}
}
}
if (isset($options['stream_context'])) {
if (!\is_array($options['stream_context'])) {
throw new \InvalidArgumentException('stream_context must be an array');
}
$context = \array_replace_recursive($context, $options['stream_context']);
}
// Microsoft NTLM authentication only supported with curl handler
if (isset($options['auth'][2]) && 'ntlm' === $options['auth'][2]) {
throw new \InvalidArgumentException('Microsoft NTLM authentication only supported with curl handler');
}
$uri = $this->resolveHost($request, $options);
$contextResource = $this->createResource(
static function () use ($context, $params) {
return \stream_context_create($context, $params);
}
);
return $this->createResource(
function () use ($uri, &$http_response_header, $contextResource, $context, $options, $request) {
$resource = @\fopen((string) $uri, 'r', false, $contextResource);
$this->lastHeaders = $http_response_header ?? [];
if (false === $resource) {
throw new ConnectException(sprintf('Connection refused for URI %s', $uri), $request, null, $context);
}
if (isset($options['read_timeout'])) {
$readTimeout = $options['read_timeout'];
$sec = (int) $readTimeout;
$usec = ($readTimeout - $sec) * 100000;
\stream_set_timeout($resource, $sec, $usec);
}
return $resource;
}
);
}
private function resolveHost(RequestInterface $request, array $options): UriInterface
{
$uri = $request->getUri();
if (isset($options['force_ip_resolve']) && !\filter_var($uri->getHost(), \FILTER_VALIDATE_IP)) {
if ('v4' === $options['force_ip_resolve']) {
$records = \dns_get_record($uri->getHost(), \DNS_A);
if (false === $records || !isset($records[0]['ip'])) {
throw new ConnectException(\sprintf("Could not resolve IPv4 address for host '%s'", $uri->getHost()), $request);
}
return $uri->withHost($records[0]['ip']);
}
if ('v6' === $options['force_ip_resolve']) {
$records = \dns_get_record($uri->getHost(), \DNS_AAAA);
if (false === $records || !isset($records[0]['ipv6'])) {
throw new ConnectException(\sprintf("Could not resolve IPv6 address for host '%s'", $uri->getHost()), $request);
}
return $uri->withHost('[' . $records[0]['ipv6'] . ']');
}
}
return $uri;
}
private function getDefaultContext(RequestInterface $request): array
{
$headers = '';
foreach ($request->getHeaders() as $name => $value) {
foreach ($value as $val) {
$headers .= "$name: $val\r\n";
}
}
$context = [
'http' => [
'method' => $request->getMethod(),
'header' => $headers,
'protocol_version' => $request->getProtocolVersion(),
'ignore_errors' => true,
'follow_location' => 0,
],
'ssl' => [
'peer_name' => $request->getUri()->getHost(),
],
];
$body = (string) $request->getBody();
if (!empty($body)) {
$context['http']['content'] = $body;
// Prevent the HTTP handler from adding a Content-Type header.
if (!$request->hasHeader('Content-Type')) {
$context['http']['header'] .= "Content-Type:\r\n";
}
}
$context['http']['header'] = \rtrim($context['http']['header']);
return $context;
}
/**
* @param mixed $value as passed via Request transfer options.
*/
private function add_proxy(RequestInterface $request, array &$options, $value, array &$params): void
{
$uri = null;
if (!\is_array($value)) {
$uri = $value;
} else {
$scheme = $request->getUri()->getScheme();
if (isset($value[$scheme])) {
if (!isset($value['no']) || !Utils::isHostInNoProxy($request->getUri()->getHost(), $value['no'])) {
$uri = $value[$scheme];
}
}
}
if (!$uri) {
return;
}
$parsed = $this->parse_proxy($uri);
$options['http']['proxy'] = $parsed['proxy'];
if ($parsed['auth']) {
if (!isset($options['http']['header'])) {
$options['http']['header'] = [];
}
$options['http']['header'] .= "\r\nProxy-Authorization: {$parsed['auth']}";
}
}
/**
* Parses the given proxy URL to make it compatible with the format PHP's stream context expects.
*/
private function parse_proxy(string $url): array
{
$parsed = \parse_url($url);
if ($parsed !== false && isset($parsed['scheme']) && $parsed['scheme'] === 'http') {
if (isset($parsed['host']) && isset($parsed['port'])) {
$auth = null;
if (isset($parsed['user']) && isset($parsed['pass'])) {
$auth = \base64_encode("{$parsed['user']}:{$parsed['pass']}");
}
return [
'proxy' => "tcp://{$parsed['host']}:{$parsed['port']}",
'auth' => $auth ? "Basic {$auth}" : null,
];
}
}
// Return proxy as-is.
return [
'proxy' => $url,
'auth' => null,
];
}
/**
* @param mixed $value as passed via Request transfer options.
*/
private function add_timeout(RequestInterface $request, array &$options, $value, array &$params): void
{
if ($value > 0) {
$options['http']['timeout'] = $value;
}
}
/**
* @param mixed $value as passed via Request transfer options.
*/
private function add_verify(RequestInterface $request, array &$options, $value, array &$params): void
{
if ($value === false) {
$options['ssl']['verify_peer'] = false;
$options['ssl']['verify_peer_name'] = false;
return;
}
if (\is_string($value)) {
$options['ssl']['cafile'] = $value;
if (!\file_exists($value)) {
throw new \RuntimeException("SSL CA bundle not found: $value");
}
} elseif ($value !== true) {
throw new \InvalidArgumentException('Invalid verify request option');
}
$options['ssl']['verify_peer'] = true;
$options['ssl']['verify_peer_name'] = true;
$options['ssl']['allow_self_signed'] = false;
}
/**
* @param mixed $value as passed via Request transfer options.
*/
private function add_cert(RequestInterface $request, array &$options, $value, array &$params): void
{
if (\is_array($value)) {
$options['ssl']['passphrase'] = $value[1];
$value = $value[0];
}
if (!\file_exists($value)) {
throw new \RuntimeException("SSL certificate not found: {$value}");
}
$options['ssl']['local_cert'] = $value;
}
/**
* @param mixed $value as passed via Request transfer options.
*/
private function add_progress(RequestInterface $request, array &$options, $value, array &$params): void
{
self::addNotification(
$params,
static function ($code, $a, $b, $c, $transferred, $total) use ($value) {
if ($code == \STREAM_NOTIFY_PROGRESS) {
// The upload progress cannot be determined. Use 0 for cURL compatibility:
// https://curl.se/libcurl/c/CURLOPT_PROGRESSFUNCTION.html
$value($total, $transferred, 0, 0);
}
}
);
}
/**
* @param mixed $value as passed via Request transfer options.
*/
private function add_debug(RequestInterface $request, array &$options, $value, array &$params): void
{
if ($value === false) {
return;
}
static $map = [
\STREAM_NOTIFY_CONNECT => 'CONNECT',
\STREAM_NOTIFY_AUTH_REQUIRED => 'AUTH_REQUIRED',
\STREAM_NOTIFY_AUTH_RESULT => 'AUTH_RESULT',
\STREAM_NOTIFY_MIME_TYPE_IS => 'MIME_TYPE_IS',
\STREAM_NOTIFY_FILE_SIZE_IS => 'FILE_SIZE_IS',
\STREAM_NOTIFY_REDIRECTED => 'REDIRECTED',
\STREAM_NOTIFY_PROGRESS => 'PROGRESS',
\STREAM_NOTIFY_FAILURE => 'FAILURE',
\STREAM_NOTIFY_COMPLETED => 'COMPLETED',
\STREAM_NOTIFY_RESOLVE => 'RESOLVE',
];
static $args = ['severity', 'message', 'message_code', 'bytes_transferred', 'bytes_max'];
$value = Utils::debugResource($value);
$ident = $request->getMethod() . ' ' . $request->getUri()->withFragment('');
self::addNotification(
$params,
static function (int $code, ...$passed) use ($ident, $value, $map, $args): void {
\fprintf($value, '<%s> [%s] ', $ident, $map[$code]);
foreach (\array_filter($passed) as $i => $v) {
\fwrite($value, $args[$i] . ': "' . $v . '" ');
}
\fwrite($value, "\n");
}
);
}
private static function addNotification(array &$params, callable $notify): void
{
// Wrap the existing function if needed.
if (!isset($params['notification'])) {
$params['notification'] = $notify;
} else {
$params['notification'] = self::callArray([
$params['notification'],
$notify
]);
}
}
private static function callArray(array $functions): callable
{
return static function (...$args) use ($functions) {
foreach ($functions as $fn) {
$fn(...$args);
}
};
}
}

275
vendor/guzzlehttp/guzzle/src/HandlerStack.php

@ -0,0 +1,275 @@
<?php
namespace GuzzleHttp;
use GuzzleHttp\Promise\PromiseInterface;
use Psr\Http\Message\RequestInterface;
use Psr\Http\Message\ResponseInterface;
/**
* Creates a composed Guzzle handler function by stacking middlewares on top of
* an HTTP handler function.
*
* @final
*/
class HandlerStack
{
/**
* @var (callable(RequestInterface, array): PromiseInterface)|null
*/
private $handler;
/**
* @var array{(callable(callable(RequestInterface, array): PromiseInterface): callable), (string|null)}[]
*/
private $stack = [];
/**
* @var (callable(RequestInterface, array): PromiseInterface)|null
*/
private $cached;
/**
* Creates a default handler stack that can be used by clients.
*
* The returned handler will wrap the provided handler or use the most
* appropriate default handler for your system. The returned HandlerStack has
* support for cookies, redirects, HTTP error exceptions, and preparing a body
* before sending.
*
* The returned handler stack can be passed to a client in the "handler"
* option.
*
* @param (callable(RequestInterface, array): PromiseInterface)|null $handler HTTP handler function to use with the stack. If no
* handler is provided, the best handler for your
* system will be utilized.
*/
public static function create(?callable $handler = null): self
{
$stack = new self($handler ?: Utils::chooseHandler());
$stack->push(Middleware::httpErrors(), 'http_errors');
$stack->push(Middleware::redirect(), 'allow_redirects');
$stack->push(Middleware::cookies(), 'cookies');
$stack->push(Middleware::prepareBody(), 'prepare_body');
return $stack;
}
/**
* @param (callable(RequestInterface, array): PromiseInterface)|null $handler Underlying HTTP handler.
*/
public function __construct(callable $handler = null)
{
$this->handler = $handler;
}
/**
* Invokes the handler stack as a composed handler
*
* @return ResponseInterface|PromiseInterface
*/
public function __invoke(RequestInterface $request, array $options)
{
$handler = $this->resolve();
return $handler($request, $options);
}
/**
* Dumps a string representation of the stack.
*
* @return string
*/
public function __toString()
{
$depth = 0;
$stack = [];
if ($this->handler !== null) {
$stack[] = "0) Handler: " . $this->debugCallable($this->handler);
}
$result = '';
foreach (\array_reverse($this->stack) as $tuple) {
$depth++;
$str = "{$depth}) Name: '{$tuple[1]}', ";
$str .= "Function: " . $this->debugCallable($tuple[0]);
$result = "> {$str}\n{$result}";
$stack[] = $str;
}
foreach (\array_keys($stack) as $k) {
$result .= "< {$stack[$k]}\n";
}
return $result;
}
/**
* Set the HTTP handler that actually returns a promise.
*
* @param callable(RequestInterface, array): PromiseInterface $handler Accepts a request and array of options and
* returns a Promise.
*/
public function setHandler(callable $handler): void
{
$this->handler = $handler;
$this->cached = null;
}
/**
* Returns true if the builder has a handler.
*/
public function hasHandler(): bool
{
return $this->handler !== null ;
}
/**
* Unshift a middleware to the bottom of the stack.
*
* @param callable(callable): callable $middleware Middleware function
* @param string $name Name to register for this middleware.
*/
public function unshift(callable $middleware, ?string $name = null): void
{
\array_unshift($this->stack, [$middleware, $name]);
$this->cached = null;
}
/**
* Push a middleware to the top of the stack.
*
* @param callable(callable): callable $middleware Middleware function
* @param string $name Name to register for this middleware.
*/
public function push(callable $middleware, string $name = ''): void
{
$this->stack[] = [$middleware, $name];
$this->cached = null;
}
/**
* Add a middleware before another middleware by name.
*
* @param string $findName Middleware to find
* @param callable(callable): callable $middleware Middleware function
* @param string $withName Name to register for this middleware.
*/
public function before(string $findName, callable $middleware, string $withName = ''): void
{
$this->splice($findName, $withName, $middleware, true);
}
/**
* Add a middleware after another middleware by name.
*
* @param string $findName Middleware to find
* @param callable(callable): callable $middleware Middleware function
* @param string $withName Name to register for this middleware.
*/
public function after(string $findName, callable $middleware, string $withName = ''): void
{
$this->splice($findName, $withName, $middleware, false);
}
/**
* Remove a middleware by instance or name from the stack.
*
* @param callable|string $remove Middleware to remove by instance or name.
*/
public function remove($remove): void
{
if (!is_string($remove) && !is_callable($remove)) {
trigger_deprecation('guzzlehttp/guzzle', '7.4', 'Not passing a callable or string to %s::%s() is deprecated and will cause an error in 8.0.', __CLASS__, __FUNCTION__);
}
$this->cached = null;
$idx = \is_callable($remove) ? 0 : 1;
$this->stack = \array_values(\array_filter(
$this->stack,
static function ($tuple) use ($idx, $remove) {
return $tuple[$idx] !== $remove;
}
));
}
/**
* Compose the middleware and handler into a single callable function.
*
* @return callable(RequestInterface, array): PromiseInterface
*/
public function resolve(): callable
{
if ($this->cached === null) {
if (($prev = $this->handler) === null) {
throw new \LogicException('No handler has been specified');
}
foreach (\array_reverse($this->stack) as $fn) {
/** @var callable(RequestInterface, array): PromiseInterface $prev */
$prev = $fn[0]($prev);
}
$this->cached = $prev;
}
return $this->cached;
}
private function findByName(string $name): int
{
foreach ($this->stack as $k => $v) {
if ($v[1] === $name) {
return $k;
}
}
throw new \InvalidArgumentException("Middleware not found: $name");
}
/**
* Splices a function into the middleware list at a specific position.
*/
private function splice(string $findName, string $withName, callable $middleware, bool $before): void
{
$this->cached = null;
$idx = $this->findByName($findName);
$tuple = [$middleware, $withName];
if ($before) {
if ($idx === 0) {
\array_unshift($this->stack, $tuple);
} else {
$replacement = [$tuple, $this->stack[$idx]];
\array_splice($this->stack, $idx, 1, $replacement);
}
} elseif ($idx === \count($this->stack) - 1) {
$this->stack[] = $tuple;
} else {
$replacement = [$this->stack[$idx], $tuple];
\array_splice($this->stack, $idx, 1, $replacement);
}
}
/**
* Provides a debug string for a given callable.
*
* @param callable|string $fn Function to write as a string.
*/
private function debugCallable($fn): string
{
if (\is_string($fn)) {
return "callable({$fn})";
}
if (\is_array($fn)) {
return \is_string($fn[0])
? "callable({$fn[0]}::{$fn[1]})"
: "callable(['" . \get_class($fn[0]) . "', '{$fn[1]}'])";
}
/** @var object $fn */
return 'callable(' . \spl_object_hash($fn) . ')';
}
}

198
vendor/guzzlehttp/guzzle/src/MessageFormatter.php

@ -0,0 +1,198 @@
<?php
namespace GuzzleHttp;
use Psr\Http\Message\MessageInterface;
use Psr\Http\Message\RequestInterface;
use Psr\Http\Message\ResponseInterface;
/**
* Formats log messages using variable substitutions for requests, responses,
* and other transactional data.
*
* The following variable substitutions are supported:
*
* - {request}: Full HTTP request message
* - {response}: Full HTTP response message
* - {ts}: ISO 8601 date in GMT
* - {date_iso_8601} ISO 8601 date in GMT
* - {date_common_log} Apache common log date using the configured timezone.
* - {host}: Host of the request
* - {method}: Method of the request
* - {uri}: URI of the request
* - {version}: Protocol version
* - {target}: Request target of the request (path + query + fragment)
* - {hostname}: Hostname of the machine that sent the request
* - {code}: Status code of the response (if available)
* - {phrase}: Reason phrase of the response (if available)
* - {error}: Any error messages (if available)
* - {req_header_*}: Replace `*` with the lowercased name of a request header to add to the message
* - {res_header_*}: Replace `*` with the lowercased name of a response header to add to the message
* - {req_headers}: Request headers
* - {res_headers}: Response headers
* - {req_body}: Request body
* - {res_body}: Response body
*
* @final
*/
class MessageFormatter implements MessageFormatterInterface
{
/**
* Apache Common Log Format.
*
* @link https://httpd.apache.org/docs/2.4/logs.html#common
*
* @var string
*/
public const CLF = "{hostname} {req_header_User-Agent} - [{date_common_log}] \"{method} {target} HTTP/{version}\" {code} {res_header_Content-Length}";
public const DEBUG = ">>>>>>>>\n{request}\n<<<<<<<<\n{response}\n--------\n{error}";
public const SHORT = '[{ts}] "{method} {target} HTTP/{version}" {code}';
/**
* @var string Template used to format log messages
*/
private $template;
/**
* @param string $template Log message template
*/
public function __construct(?string $template = self::CLF)
{
$this->template = $template ?: self::CLF;
}
/**
* Returns a formatted message string.
*
* @param RequestInterface $request Request that was sent
* @param ResponseInterface|null $response Response that was received
* @param \Throwable|null $error Exception that was received
*/
public function format(RequestInterface $request, ?ResponseInterface $response = null, ?\Throwable $error = null): string
{
$cache = [];
/** @var string */
return \preg_replace_callback(
'/{\s*([A-Za-z_\-\.0-9]+)\s*}/',
function (array $matches) use ($request, $response, $error, &$cache) {
if (isset($cache[$matches[1]])) {
return $cache[$matches[1]];
}
$result = '';
switch ($matches[1]) {
case 'request':
$result = Psr7\Message::toString($request);
break;
case 'response':
$result = $response ? Psr7\Message::toString($response) : '';
break;
case 'req_headers':
$result = \trim($request->getMethod()
. ' ' . $request->getRequestTarget())
. ' HTTP/' . $request->getProtocolVersion() . "\r\n"
. $this->headers($request);
break;
case 'res_headers':
$result = $response ?
\sprintf(
'HTTP/%s %d %s',
$response->getProtocolVersion(),
$response->getStatusCode(),
$response->getReasonPhrase()
) . "\r\n" . $this->headers($response)
: 'NULL';
break;
case 'req_body':
$result = $request->getBody()->__toString();
break;
case 'res_body':
if (!$response instanceof ResponseInterface) {
$result = 'NULL';
break;
}
$body = $response->getBody();
if (!$body->isSeekable()) {
$result = 'RESPONSE_NOT_LOGGEABLE';
break;
}
$result = $response->getBody()->__toString();
break;
case 'ts':
case 'date_iso_8601':
$result = \gmdate('c');
break;
case 'date_common_log':
$result = \date('d/M/Y:H:i:s O');
break;
case 'method':
$result = $request->getMethod();
break;
case 'version':
$result = $request->getProtocolVersion();
break;
case 'uri':
case 'url':
$result = $request->getUri()->__toString();
break;
case 'target':
$result = $request->getRequestTarget();
break;
case 'req_version':
$result = $request->getProtocolVersion();
break;
case 'res_version':
$result = $response
? $response->getProtocolVersion()
: 'NULL';
break;
case 'host':
$result = $request->getHeaderLine('Host');
break;
case 'hostname':
$result = \gethostname();
break;
case 'code':
$result = $response ? $response->getStatusCode() : 'NULL';
break;
case 'phrase':
$result = $response ? $response->getReasonPhrase() : 'NULL';
break;
case 'error':
$result = $error ? $error->getMessage() : 'NULL';
break;
default:
// handle prefixed dynamic headers
if (\strpos($matches[1], 'req_header_') === 0) {
$result = $request->getHeaderLine(\substr($matches[1], 11));
} elseif (\strpos($matches[1], 'res_header_') === 0) {
$result = $response
? $response->getHeaderLine(\substr($matches[1], 11))
: 'NULL';
}
}
$cache[$matches[1]] = $result;
return $result;
},
$this->template
);
}
/**
* Get headers from message as string
*/
private function headers(MessageInterface $message): string
{
$result = '';
foreach ($message->getHeaders() as $name => $values) {
$result .= $name . ': ' . \implode(', ', $values) . "\r\n";
}
return \trim($result);
}
}

18
vendor/guzzlehttp/guzzle/src/MessageFormatterInterface.php

@ -0,0 +1,18 @@
<?php
namespace GuzzleHttp;
use Psr\Http\Message\RequestInterface;
use Psr\Http\Message\ResponseInterface;
interface MessageFormatterInterface
{
/**
* Returns a formatted message string.
*
* @param RequestInterface $request Request that was sent
* @param ResponseInterface|null $response Response that was received
* @param \Throwable|null $error Exception that was received
*/
public function format(RequestInterface $request, ?ResponseInterface $response = null, ?\Throwable $error = null): string;
}

260
vendor/guzzlehttp/guzzle/src/Middleware.php

@ -0,0 +1,260 @@
<?php
namespace GuzzleHttp;
use GuzzleHttp\Cookie\CookieJarInterface;
use GuzzleHttp\Exception\RequestException;
use GuzzleHttp\Promise as P;
use GuzzleHttp\Promise\PromiseInterface;
use Psr\Http\Message\RequestInterface;
use Psr\Http\Message\ResponseInterface;
use Psr\Log\LoggerInterface;
/**
* Functions used to create and wrap handlers with handler middleware.
*/
final class Middleware
{
/**
* Middleware that adds cookies to requests.
*
* The options array must be set to a CookieJarInterface in order to use
* cookies. This is typically handled for you by a client.
*
* @return callable Returns a function that accepts the next handler.
*/
public static function cookies(): callable
{
return static function (callable $handler): callable {
return static function ($request, array $options) use ($handler) {
if (empty($options['cookies'])) {
return $handler($request, $options);
} elseif (!($options['cookies'] instanceof CookieJarInterface)) {
throw new \InvalidArgumentException('cookies must be an instance of GuzzleHttp\Cookie\CookieJarInterface');
}
$cookieJar = $options['cookies'];
$request = $cookieJar->withCookieHeader($request);
return $handler($request, $options)
->then(
static function (ResponseInterface $response) use ($cookieJar, $request): ResponseInterface {
$cookieJar->extractCookies($request, $response);
return $response;
}
);
};
};
}
/**
* Middleware that throws exceptions for 4xx or 5xx responses when the
* "http_errors" request option is set to true.
*
* @param BodySummarizerInterface|null $bodySummarizer The body summarizer to use in exception messages.
*
* @return callable(callable): callable Returns a function that accepts the next handler.
*/
public static function httpErrors(BodySummarizerInterface $bodySummarizer = null): callable
{
return static function (callable $handler) use ($bodySummarizer): callable {
return static function ($request, array $options) use ($handler, $bodySummarizer) {
if (empty($options['http_errors'])) {
return $handler($request, $options);
}
return $handler($request, $options)->then(
static function (ResponseInterface $response) use ($request, $bodySummarizer) {
$code = $response->getStatusCode();
if ($code < 400) {
return $response;
}
throw RequestException::create($request, $response, null, [], $bodySummarizer);
}
);
};
};
}
/**
* Middleware that pushes history data to an ArrayAccess container.
*
* @param array|\ArrayAccess<int, array> $container Container to hold the history (by reference).
*
* @return callable(callable): callable Returns a function that accepts the next handler.
*
* @throws \InvalidArgumentException if container is not an array or ArrayAccess.
*/
public static function history(&$container): callable
{
if (!\is_array($container) && !$container instanceof \ArrayAccess) {
throw new \InvalidArgumentException('history container must be an array or object implementing ArrayAccess');
}
return static function (callable $handler) use (&$container): callable {
return static function (RequestInterface $request, array $options) use ($handler, &$container) {
return $handler($request, $options)->then(
static function ($value) use ($request, &$container, $options) {
$container[] = [
'request' => $request,
'response' => $value,
'error' => null,
'options' => $options
];
return $value;
},
static function ($reason) use ($request, &$container, $options) {
$container[] = [
'request' => $request,
'response' => null,
'error' => $reason,
'options' => $options
];
return P\Create::rejectionFor($reason);
}
);
};
};
}
/**
* Middleware that invokes a callback before and after sending a request.
*
* The provided listener cannot modify or alter the response. It simply
* "taps" into the chain to be notified before returning the promise. The
* before listener accepts a request and options array, and the after
* listener accepts a request, options array, and response promise.
*
* @param callable $before Function to invoke before forwarding the request.
* @param callable $after Function invoked after forwarding.
*
* @return callable Returns a function that accepts the next handler.
*/
public static function tap(callable $before = null, callable $after = null): callable
{
return static function (callable $handler) use ($before, $after): callable {
return static function (RequestInterface $request, array $options) use ($handler, $before, $after) {
if ($before) {
$before($request, $options);
}
$response = $handler($request, $options);
if ($after) {
$after($request, $options, $response);
}
return $response;
};
};
}
/**
* Middleware that handles request redirects.
*
* @return callable Returns a function that accepts the next handler.
*/
public static function redirect(): callable
{
return static function (callable $handler): RedirectMiddleware {
return new RedirectMiddleware($handler);
};
}
/**
* Middleware that retries requests based on the boolean result of
* invoking the provided "decider" function.
*
* If no delay function is provided, a simple implementation of exponential
* backoff will be utilized.
*
* @param callable $decider Function that accepts the number of retries,
* a request, [response], and [exception] and
* returns true if the request is to be retried.
* @param callable $delay Function that accepts the number of retries and
* returns the number of milliseconds to delay.
*
* @return callable Returns a function that accepts the next handler.
*/
public static function retry(callable $decider, callable $delay = null): callable
{
return static function (callable $handler) use ($decider, $delay): RetryMiddleware {
return new RetryMiddleware($decider, $handler, $delay);
};
}
/**
* Middleware that logs requests, responses, and errors using a message
* formatter.
*
* @phpstan-param \Psr\Log\LogLevel::* $logLevel Level at which to log requests.
*
* @param LoggerInterface $logger Logs messages.
* @param MessageFormatterInterface|MessageFormatter $formatter Formatter used to create message strings.
* @param string $logLevel Level at which to log requests.
*
* @return callable Returns a function that accepts the next handler.
*/
public static function log(LoggerInterface $logger, $formatter, string $logLevel = 'info'): callable
{
// To be compatible with Guzzle 7.1.x we need to allow users to pass a MessageFormatter
if (!$formatter instanceof MessageFormatter && !$formatter instanceof MessageFormatterInterface) {
throw new \LogicException(sprintf('Argument 2 to %s::log() must be of type %s', self::class, MessageFormatterInterface::class));
}
return static function (callable $handler) use ($logger, $formatter, $logLevel): callable {
return static function (RequestInterface $request, array $options = []) use ($handler, $logger, $formatter, $logLevel) {
return $handler($request, $options)->then(
static function ($response) use ($logger, $request, $formatter, $logLevel): ResponseInterface {
$message = $formatter->format($request, $response);
$logger->log($logLevel, $message);
return $response;
},
static function ($reason) use ($logger, $request, $formatter): PromiseInterface {
$response = $reason instanceof RequestException ? $reason->getResponse() : null;
$message = $formatter->format($request, $response, P\Create::exceptionFor($reason));
$logger->error($message);
return P\Create::rejectionFor($reason);
}
);
};
};
}
/**
* This middleware adds a default content-type if possible, a default
* content-length or transfer-encoding header, and the expect header.
*/
public static function prepareBody(): callable
{
return static function (callable $handler): PrepareBodyMiddleware {
return new PrepareBodyMiddleware($handler);
};
}
/**
* Middleware that applies a map function to the request before passing to
* the next handler.
*
* @param callable $fn Function that accepts a RequestInterface and returns
* a RequestInterface.
*/
public static function mapRequest(callable $fn): callable
{
return static function (callable $handler) use ($fn): callable {
return static function (RequestInterface $request, array $options) use ($handler, $fn) {
return $handler($fn($request), $options);
};
};
}
/**
* Middleware that applies a map function to the resolved promise's
* response.
*
* @param callable $fn Function that accepts a ResponseInterface and
* returns a ResponseInterface.
*/
public static function mapResponse(callable $fn): callable
{
return static function (callable $handler) use ($fn): callable {
return static function (RequestInterface $request, array $options) use ($handler, $fn) {
return $handler($request, $options)->then($fn);
};
};
}
}

125
vendor/guzzlehttp/guzzle/src/Pool.php

@ -0,0 +1,125 @@
<?php
namespace GuzzleHttp;
use GuzzleHttp\Promise as P;
use GuzzleHttp\Promise\EachPromise;
use GuzzleHttp\Promise\PromiseInterface;
use GuzzleHttp\Promise\PromisorInterface;
use Psr\Http\Message\RequestInterface;
/**
* Sends an iterator of requests concurrently using a capped pool size.
*
* The pool will read from an iterator until it is cancelled or until the
* iterator is consumed. When a request is yielded, the request is sent after
* applying the "request_options" request options (if provided in the ctor).
*
* When a function is yielded by the iterator, the function is provided the
* "request_options" array that should be merged on top of any existing
* options, and the function MUST then return a wait-able promise.
*
* @final
*/
class Pool implements PromisorInterface
{
/**
* @var EachPromise
*/
private $each;
/**
* @param ClientInterface $client Client used to send the requests.
* @param array|\Iterator $requests Requests or functions that return
* requests to send concurrently.
* @param array $config Associative array of options
* - concurrency: (int) Maximum number of requests to send concurrently
* - options: Array of request options to apply to each request.
* - fulfilled: (callable) Function to invoke when a request completes.
* - rejected: (callable) Function to invoke when a request is rejected.
*/
public function __construct(ClientInterface $client, $requests, array $config = [])
{
if (!isset($config['concurrency'])) {
$config['concurrency'] = 25;
}
if (isset($config['options'])) {
$opts = $config['options'];
unset($config['options']);
} else {
$opts = [];
}
$iterable = P\Create::iterFor($requests);
$requests = static function () use ($iterable, $client, $opts) {
foreach ($iterable as $key => $rfn) {
if ($rfn instanceof RequestInterface) {
yield $key => $client->sendAsync($rfn, $opts);
} elseif (\is_callable($rfn)) {
yield $key => $rfn($opts);
} else {
throw new \InvalidArgumentException('Each value yielded by the iterator must be a Psr7\Http\Message\RequestInterface or a callable that returns a promise that fulfills with a Psr7\Message\Http\ResponseInterface object.');
}
}
};
$this->each = new EachPromise($requests(), $config);
}
/**
* Get promise
*/
public function promise(): PromiseInterface
{
return $this->each->promise();
}
/**
* Sends multiple requests concurrently and returns an array of responses
* and exceptions that uses the same ordering as the provided requests.
*
* IMPORTANT: This method keeps every request and response in memory, and
* as such, is NOT recommended when sending a large number or an
* indeterminate number of requests concurrently.
*
* @param ClientInterface $client Client used to send the requests
* @param array|\Iterator $requests Requests to send concurrently.
* @param array $options Passes through the options available in
* {@see \GuzzleHttp\Pool::__construct}
*
* @return array Returns an array containing the response or an exception
* in the same order that the requests were sent.
*
* @throws \InvalidArgumentException if the event format is incorrect.
*/
public static function batch(ClientInterface $client, $requests, array $options = []): array
{
$res = [];
self::cmpCallback($options, 'fulfilled', $res);
self::cmpCallback($options, 'rejected', $res);
$pool = new static($client, $requests, $options);
$pool->promise()->wait();
\ksort($res);
return $res;
}
/**
* Execute callback(s)
*/
private static function cmpCallback(array &$options, string $name, array &$results): void
{
if (!isset($options[$name])) {
$options[$name] = static function ($v, $k) use (&$results) {
$results[$k] = $v;
};
} else {
$currentFn = $options[$name];
$options[$name] = static function ($v, $k) use (&$results, $currentFn) {
$currentFn($v, $k);
$results[$k] = $v;
};
}
}
}

104
vendor/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php

@ -0,0 +1,104 @@
<?php
namespace GuzzleHttp;
use GuzzleHttp\Promise\PromiseInterface;
use Psr\Http\Message\RequestInterface;
/**
* Prepares requests that contain a body, adding the Content-Length,
* Content-Type, and Expect headers.
*
* @final
*/
class PrepareBodyMiddleware
{
/**
* @var callable(RequestInterface, array): PromiseInterface
*/
private $nextHandler;
/**
* @param callable(RequestInterface, array): PromiseInterface $nextHandler Next handler to invoke.
*/
public function __construct(callable $nextHandler)
{
$this->nextHandler = $nextHandler;
}
public function __invoke(RequestInterface $request, array $options): PromiseInterface
{
$fn = $this->nextHandler;
// Don't do anything if the request has no body.
if ($request->getBody()->getSize() === 0) {
return $fn($request, $options);
}
$modify = [];
// Add a default content-type if possible.
if (!$request->hasHeader('Content-Type')) {
if ($uri = $request->getBody()->getMetadata('uri')) {
if (is_string($uri) && $type = Psr7\MimeType::fromFilename($uri)) {
$modify['set_headers']['Content-Type'] = $type;
}
}
}
// Add a default content-length or transfer-encoding header.
if (!$request->hasHeader('Content-Length')
&& !$request->hasHeader('Transfer-Encoding')
) {
$size = $request->getBody()->getSize();
if ($size !== null) {
$modify['set_headers']['Content-Length'] = $size;
} else {
$modify['set_headers']['Transfer-Encoding'] = 'chunked';
}
}
// Add the expect header if needed.
$this->addExpectHeader($request, $options, $modify);
return $fn(Psr7\Utils::modifyRequest($request, $modify), $options);
}
/**
* Add expect header
*/
private function addExpectHeader(RequestInterface $request, array $options, array &$modify): void
{
// Determine if the Expect header should be used
if ($request->hasHeader('Expect')) {
return;
}
$expect = $options['expect'] ?? null;
// Return if disabled or if you're not using HTTP/1.1 or HTTP/2.0
if ($expect === false || $request->getProtocolVersion() < 1.1) {
return;
}
// The expect header is unconditionally enabled
if ($expect === true) {
$modify['set_headers']['Expect'] = '100-Continue';
return;
}
// By default, send the expect header when the payload is > 1mb
if ($expect === null) {
$expect = 1048576;
}
// Always add if the body cannot be rewound, the size cannot be
// determined, or the size is greater than the cutoff threshold
$body = $request->getBody();
$size = $body->getSize();
if ($size === null || $size >= (int) $expect || !$body->isSeekable()) {
$modify['set_headers']['Expect'] = '100-Continue';
}
}
}

228
vendor/guzzlehttp/guzzle/src/RedirectMiddleware.php

@ -0,0 +1,228 @@
<?php
namespace GuzzleHttp;
use GuzzleHttp\Exception\BadResponseException;
use GuzzleHttp\Exception\TooManyRedirectsException;
use GuzzleHttp\Promise\PromiseInterface;
use Psr\Http\Message\RequestInterface;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\UriInterface;
/**
* Request redirect middleware.
*
* Apply this middleware like other middleware using
* {@see \GuzzleHttp\Middleware::redirect()}.
*
* @final
*/
class RedirectMiddleware
{
public const HISTORY_HEADER = 'X-Guzzle-Redirect-History';
public const STATUS_HISTORY_HEADER = 'X-Guzzle-Redirect-Status-History';
/**
* @var array
*/
public static $defaultSettings = [
'max' => 5,
'protocols' => ['http', 'https'],
'strict' => false,
'referer' => false,
'track_redirects' => false,
];
/**
* @var callable(RequestInterface, array): PromiseInterface
*/
private $nextHandler;
/**
* @param callable(RequestInterface, array): PromiseInterface $nextHandler Next handler to invoke.
*/
public function __construct(callable $nextHandler)
{
$this->nextHandler = $nextHandler;
}
public function __invoke(RequestInterface $request, array $options): PromiseInterface
{
$fn = $this->nextHandler;
if (empty($options['allow_redirects'])) {
return $fn($request, $options);
}
if ($options['allow_redirects'] === true) {
$options['allow_redirects'] = self::$defaultSettings;
} elseif (!\is_array($options['allow_redirects'])) {
throw new \InvalidArgumentException('allow_redirects must be true, false, or array');
} else {
// Merge the default settings with the provided settings
$options['allow_redirects'] += self::$defaultSettings;
}
if (empty($options['allow_redirects']['max'])) {
return $fn($request, $options);
}
return $fn($request, $options)
->then(function (ResponseInterface $response) use ($request, $options) {
return $this->checkRedirect($request, $options, $response);
});
}
/**
* @return ResponseInterface|PromiseInterface
*/
public function checkRedirect(RequestInterface $request, array $options, ResponseInterface $response)
{
if (\strpos((string) $response->getStatusCode(), '3') !== 0
|| !$response->hasHeader('Location')
) {
return $response;
}
$this->guardMax($request, $response, $options);
$nextRequest = $this->modifyRequest($request, $options, $response);
// If authorization is handled by curl, unset it if URI is cross-origin.
if (Psr7\UriComparator::isCrossOrigin($request->getUri(), $nextRequest->getUri()) && defined('\CURLOPT_HTTPAUTH')) {
unset(
$options['curl'][\CURLOPT_HTTPAUTH],
$options['curl'][\CURLOPT_USERPWD]
);
}
if (isset($options['allow_redirects']['on_redirect'])) {
($options['allow_redirects']['on_redirect'])(
$request,
$response,
$nextRequest->getUri()
);
}
$promise = $this($nextRequest, $options);
// Add headers to be able to track history of redirects.
if (!empty($options['allow_redirects']['track_redirects'])) {
return $this->withTracking(
$promise,
(string) $nextRequest->getUri(),
$response->getStatusCode()
);
}
return $promise;
}
/**
* Enable tracking on promise.
*/
private function withTracking(PromiseInterface $promise, string $uri, int $statusCode): PromiseInterface
{
return $promise->then(
static function (ResponseInterface $response) use ($uri, $statusCode) {
// Note that we are pushing to the front of the list as this
// would be an earlier response than what is currently present
// in the history header.
$historyHeader = $response->getHeader(self::HISTORY_HEADER);
$statusHeader = $response->getHeader(self::STATUS_HISTORY_HEADER);
\array_unshift($historyHeader, $uri);
\array_unshift($statusHeader, (string) $statusCode);
return $response->withHeader(self::HISTORY_HEADER, $historyHeader)
->withHeader(self::STATUS_HISTORY_HEADER, $statusHeader);
}
);
}
/**
* Check for too many redirects.
*
* @throws TooManyRedirectsException Too many redirects.
*/
private function guardMax(RequestInterface $request, ResponseInterface $response, array &$options): void
{
$current = $options['__redirect_count']
?? 0;
$options['__redirect_count'] = $current + 1;
$max = $options['allow_redirects']['max'];
if ($options['__redirect_count'] > $max) {
throw new TooManyRedirectsException("Will not follow more than {$max} redirects", $request, $response);
}
}
public function modifyRequest(RequestInterface $request, array $options, ResponseInterface $response): RequestInterface
{
// Request modifications to apply.
$modify = [];
$protocols = $options['allow_redirects']['protocols'];
// Use a GET request if this is an entity enclosing request and we are
// not forcing RFC compliance, but rather emulating what all browsers
// would do.
$statusCode = $response->getStatusCode();
if ($statusCode == 303 ||
($statusCode <= 302 && !$options['allow_redirects']['strict'])
) {
$safeMethods = ['GET', 'HEAD', 'OPTIONS'];
$requestMethod = $request->getMethod();
$modify['method'] = in_array($requestMethod, $safeMethods) ? $requestMethod : 'GET';
$modify['body'] = '';
}
$uri = self::redirectUri($request, $response, $protocols);
if (isset($options['idn_conversion']) && ($options['idn_conversion'] !== false)) {
$idnOptions = ($options['idn_conversion'] === true) ? \IDNA_DEFAULT : $options['idn_conversion'];
$uri = Utils::idnUriConvert($uri, $idnOptions);
}
$modify['uri'] = $uri;
Psr7\Message::rewindBody($request);
// Add the Referer header if it is told to do so and only
// add the header if we are not redirecting from https to http.
if ($options['allow_redirects']['referer']
&& $modify['uri']->getScheme() === $request->getUri()->getScheme()
) {
$uri = $request->getUri()->withUserInfo('');
$modify['set_headers']['Referer'] = (string) $uri;
} else {
$modify['remove_headers'][] = 'Referer';
}
// Remove Authorization and Cookie headers if URI is cross-origin.
if (Psr7\UriComparator::isCrossOrigin($request->getUri(), $modify['uri'])) {
$modify['remove_headers'][] = 'Authorization';
$modify['remove_headers'][] = 'Cookie';
}
return Psr7\Utils::modifyRequest($request, $modify);
}
/**
* Set the appropriate URL on the request based on the location header.
*/
private static function redirectUri(
RequestInterface $request,
ResponseInterface $response,
array $protocols
): UriInterface {
$location = Psr7\UriResolver::resolve(
$request->getUri(),
new Psr7\Uri($response->getHeaderLine('Location'))
);
// Ensure that the redirect URI is allowed based on the protocols.
if (!\in_array($location->getScheme(), $protocols)) {
throw new BadResponseException(\sprintf('Redirect URI, %s, does not use one of the allowed redirect protocols: %s', $location, \implode(', ', $protocols)), $request, $response);
}
return $location;
}
}

264
vendor/guzzlehttp/guzzle/src/RequestOptions.php

@ -0,0 +1,264 @@
<?php
namespace GuzzleHttp;
/**
* This class contains a list of built-in Guzzle request options.
*
* More documentation for each option can be found at http://guzzlephp.org/.
*
* @link http://docs.guzzlephp.org/en/v6/request-options.html
*/
final class RequestOptions
{
/**
* allow_redirects: (bool|array) Controls redirect behavior. Pass false
* to disable redirects, pass true to enable redirects, pass an
* associative to provide custom redirect settings. Defaults to "false".
* This option only works if your handler has the RedirectMiddleware. When
* passing an associative array, you can provide the following key value
* pairs:
*
* - max: (int, default=5) maximum number of allowed redirects.
* - strict: (bool, default=false) Set to true to use strict redirects
* meaning redirect POST requests with POST requests vs. doing what most
* browsers do which is redirect POST requests with GET requests
* - referer: (bool, default=false) Set to true to enable the Referer
* header.
* - protocols: (array, default=['http', 'https']) Allowed redirect
* protocols.
* - on_redirect: (callable) PHP callable that is invoked when a redirect
* is encountered. The callable is invoked with the request, the redirect
* response that was received, and the effective URI. Any return value
* from the on_redirect function is ignored.
*/
public const ALLOW_REDIRECTS = 'allow_redirects';
/**
* auth: (array) Pass an array of HTTP authentication parameters to use
* with the request. The array must contain the username in index [0],
* the password in index [1], and you can optionally provide a built-in
* authentication type in index [2]. Pass null to disable authentication
* for a request.
*/
public const AUTH = 'auth';
/**
* body: (resource|string|null|int|float|StreamInterface|callable|\Iterator)
* Body to send in the request.
*/
public const BODY = 'body';
/**
* cert: (string|array) Set to a string to specify the path to a file
* containing a PEM formatted SSL client side certificate. If a password
* is required, then set cert to an array containing the path to the PEM
* file in the first array element followed by the certificate password
* in the second array element.
*/
public const CERT = 'cert';
/**
* cookies: (bool|GuzzleHttp\Cookie\CookieJarInterface, default=false)
* Specifies whether or not cookies are used in a request or what cookie
* jar to use or what cookies to send. This option only works if your
* handler has the `cookie` middleware. Valid values are `false` and
* an instance of {@see \GuzzleHttp\Cookie\CookieJarInterface}.
*/
public const COOKIES = 'cookies';
/**
* connect_timeout: (float, default=0) Float describing the number of
* seconds to wait while trying to connect to a server. Use 0 to wait
* indefinitely (the default behavior).
*/
public const CONNECT_TIMEOUT = 'connect_timeout';
/**
* debug: (bool|resource) Set to true or set to a PHP stream returned by
* fopen() enable debug output with the HTTP handler used to send a
* request.
*/
public const DEBUG = 'debug';
/**
* decode_content: (bool, default=true) Specify whether or not
* Content-Encoding responses (gzip, deflate, etc.) are automatically
* decoded.
*/
public const DECODE_CONTENT = 'decode_content';
/**
* delay: (int) The amount of time to delay before sending in milliseconds.
*/
public const DELAY = 'delay';
/**
* expect: (bool|integer) Controls the behavior of the
* "Expect: 100-Continue" header.
*
* Set to `true` to enable the "Expect: 100-Continue" header for all
* requests that sends a body. Set to `false` to disable the
* "Expect: 100-Continue" header for all requests. Set to a number so that
* the size of the payload must be greater than the number in order to send
* the Expect header. Setting to a number will send the Expect header for
* all requests in which the size of the payload cannot be determined or
* where the body is not rewindable.
*
* By default, Guzzle will add the "Expect: 100-Continue" header when the
* size of the body of a request is greater than 1 MB and a request is
* using HTTP/1.1.
*/
public const EXPECT = 'expect';
/**
* form_params: (array) Associative array of form field names to values
* where each value is a string or array of strings. Sets the Content-Type
* header to application/x-www-form-urlencoded when no Content-Type header
* is already present.
*/
public const FORM_PARAMS = 'form_params';
/**
* headers: (array) Associative array of HTTP headers. Each value MUST be
* a string or array of strings.
*/
public const HEADERS = 'headers';
/**
* http_errors: (bool, default=true) Set to false to disable exceptions
* when a non- successful HTTP response is received. By default,
* exceptions will be thrown for 4xx and 5xx responses. This option only
* works if your handler has the `httpErrors` middleware.
*/
public const HTTP_ERRORS = 'http_errors';
/**
* idn: (bool|int, default=true) A combination of IDNA_* constants for
* idn_to_ascii() PHP's function (see "options" parameter). Set to false to
* disable IDN support completely, or to true to use the default
* configuration (IDNA_DEFAULT constant).
*/
public const IDN_CONVERSION = 'idn_conversion';
/**
* json: (mixed) Adds JSON data to a request. The provided value is JSON
* encoded and a Content-Type header of application/json will be added to
* the request if no Content-Type header is already present.
*/
public const JSON = 'json';
/**
* multipart: (array) Array of associative arrays, each containing a
* required "name" key mapping to the form field, name, a required
* "contents" key mapping to a StreamInterface|resource|string, an
* optional "headers" associative array of custom headers, and an
* optional "filename" key mapping to a string to send as the filename in
* the part. If no "filename" key is present, then no "filename" attribute
* will be added to the part.
*/
public const MULTIPART = 'multipart';
/**
* on_headers: (callable) A callable that is invoked when the HTTP headers
* of the response have been received but the body has not yet begun to
* download.
*/
public const ON_HEADERS = 'on_headers';
/**
* on_stats: (callable) allows you to get access to transfer statistics of
* a request and access the lower level transfer details of the handler
* associated with your client. ``on_stats`` is a callable that is invoked
* when a handler has finished sending a request. The callback is invoked
* with transfer statistics about the request, the response received, or
* the error encountered. Included in the data is the total amount of time
* taken to send the request.
*/
public const ON_STATS = 'on_stats';
/**
* progress: (callable) Defines a function to invoke when transfer
* progress is made. The function accepts the following positional
* arguments: the total number of bytes expected to be downloaded, the
* number of bytes downloaded so far, the number of bytes expected to be
* uploaded, the number of bytes uploaded so far.
*/
public const PROGRESS = 'progress';
/**
* proxy: (string|array) Pass a string to specify an HTTP proxy, or an
* array to specify different proxies for different protocols (where the
* key is the protocol and the value is a proxy string).
*/
public const PROXY = 'proxy';
/**
* query: (array|string) Associative array of query string values to add
* to the request. This option uses PHP's http_build_query() to create
* the string representation. Pass a string value if you need more
* control than what this method provides
*/
public const QUERY = 'query';
/**
* sink: (resource|string|StreamInterface) Where the data of the
* response is written to. Defaults to a PHP temp stream. Providing a
* string will write data to a file by the given name.
*/
public const SINK = 'sink';
/**
* synchronous: (bool) Set to true to inform HTTP handlers that you intend
* on waiting on the response. This can be useful for optimizations. Note
* that a promise is still returned if you are using one of the async
* client methods.
*/
public const SYNCHRONOUS = 'synchronous';
/**
* ssl_key: (array|string) Specify the path to a file containing a private
* SSL key in PEM format. If a password is required, then set to an array
* containing the path to the SSL key in the first array element followed
* by the password required for the certificate in the second element.
*/
public const SSL_KEY = 'ssl_key';
/**
* stream: Set to true to attempt to stream a response rather than
* download it all up-front.
*/
public const STREAM = 'stream';
/**
* verify: (bool|string, default=true) Describes the SSL certificate
* verification behavior of a request. Set to true to enable SSL
* certificate verification using the system CA bundle when available
* (the default). Set to false to disable certificate verification (this
* is insecure!). Set to a string to provide the path to a CA bundle on
* disk to enable verification using a custom certificate.
*/
public const VERIFY = 'verify';
/**
* timeout: (float, default=0) Float describing the timeout of the
* request in seconds. Use 0 to wait indefinitely (the default behavior).
*/
public const TIMEOUT = 'timeout';
/**
* read_timeout: (float, default=default_socket_timeout ini setting) Float describing
* the body read timeout, for stream requests.
*/
public const READ_TIMEOUT = 'read_timeout';
/**
* version: (float) Specifies the HTTP protocol version to attempt to use.
*/
public const VERSION = 'version';
/**
* force_ip_resolve: (bool) Force client to use only ipv4 or ipv6 protocol
*/
public const FORCE_IP_RESOLVE = 'force_ip_resolve';
}

116
vendor/guzzlehttp/guzzle/src/RetryMiddleware.php

@ -0,0 +1,116 @@
<?php
namespace GuzzleHttp;
use GuzzleHttp\Promise as P;
use GuzzleHttp\Promise\PromiseInterface;
use Psr\Http\Message\RequestInterface;
use Psr\Http\Message\ResponseInterface;
/**
* Middleware that retries requests based on the boolean result of
* invoking the provided "decider" function.
*
* @final
*/
class RetryMiddleware
{
/**
* @var callable(RequestInterface, array): PromiseInterface
*/
private $nextHandler;
/**
* @var callable
*/
private $decider;
/**
* @var callable(int)
*/
private $delay;
/**
* @param callable $decider Function that accepts the number of retries,
* a request, [response], and [exception] and
* returns true if the request is to be
* retried.
* @param callable(RequestInterface, array): PromiseInterface $nextHandler Next handler to invoke.
* @param (callable(int): int)|null $delay Function that accepts the number of retries
* and returns the number of
* milliseconds to delay.
*/
public function __construct(callable $decider, callable $nextHandler, callable $delay = null)
{
$this->decider = $decider;
$this->nextHandler = $nextHandler;
$this->delay = $delay ?: __CLASS__ . '::exponentialDelay';
}
/**
* Default exponential backoff delay function.
*
* @return int milliseconds.
*/
public static function exponentialDelay(int $retries): int
{
return (int) \pow(2, $retries - 1) * 1000;
}
public function __invoke(RequestInterface $request, array $options): PromiseInterface
{
if (!isset($options['retries'])) {
$options['retries'] = 0;
}
$fn = $this->nextHandler;
return $fn($request, $options)
->then(
$this->onFulfilled($request, $options),
$this->onRejected($request, $options)
);
}
/**
* Execute fulfilled closure
*/
private function onFulfilled(RequestInterface $request, array $options): callable
{
return function ($value) use ($request, $options) {
if (!($this->decider)(
$options['retries'],
$request,
$value,
null
)) {
return $value;
}
return $this->doRetry($request, $options, $value);
};
}
/**
* Execute rejected closure
*/
private function onRejected(RequestInterface $req, array $options): callable
{
return function ($reason) use ($req, $options) {
if (!($this->decider)(
$options['retries'],
$req,
null,
$reason
)) {
return P\Create::rejectionFor($reason);
}
return $this->doRetry($req, $options);
};
}
private function doRetry(RequestInterface $request, array $options, ResponseInterface $response = null): PromiseInterface
{
$options['delay'] = ($this->delay)(++$options['retries'], $response, $request);
return $this($request, $options);
}
}

133
vendor/guzzlehttp/guzzle/src/TransferStats.php

@ -0,0 +1,133 @@
<?php
namespace GuzzleHttp;
use Psr\Http\Message\RequestInterface;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\UriInterface;
/**
* Represents data at the point after it was transferred either successfully
* or after a network error.
*/
final class TransferStats
{
/**
* @var RequestInterface
*/
private $request;
/**
* @var ResponseInterface|null
*/
private $response;
/**
* @var float|null
*/
private $transferTime;
/**
* @var array
*/
private $handlerStats;
/**
* @var mixed|null
*/
private $handlerErrorData;
/**
* @param RequestInterface $request Request that was sent.
* @param ResponseInterface|null $response Response received (if any)
* @param float|null $transferTime Total handler transfer time.
* @param mixed $handlerErrorData Handler error data.
* @param array $handlerStats Handler specific stats.
*/
public function __construct(
RequestInterface $request,
?ResponseInterface $response = null,
?float $transferTime = null,
$handlerErrorData = null,
array $handlerStats = []
) {
$this->request = $request;
$this->response = $response;
$this->transferTime = $transferTime;
$this->handlerErrorData = $handlerErrorData;
$this->handlerStats = $handlerStats;
}
public function getRequest(): RequestInterface
{
return $this->request;
}
/**
* Returns the response that was received (if any).
*/
public function getResponse(): ?ResponseInterface
{
return $this->response;
}
/**
* Returns true if a response was received.
*/
public function hasResponse(): bool
{
return $this->response !== null;
}
/**
* Gets handler specific error data.
*
* This might be an exception, a integer representing an error code, or
* anything else. Relying on this value assumes that you know what handler
* you are using.
*
* @return mixed
*/
public function getHandlerErrorData()
{
return $this->handlerErrorData;
}
/**
* Get the effective URI the request was sent to.
*/
public function getEffectiveUri(): UriInterface
{
return $this->request->getUri();
}
/**
* Get the estimated time the request was being transferred by the handler.
*
* @return float|null Time in seconds.
*/
public function getTransferTime(): ?float
{
return $this->transferTime;
}
/**
* Gets an array of all of the handler specific transfer data.
*/
public function getHandlerStats(): array
{
return $this->handlerStats;
}
/**
* Get a specific handler statistic from the handler by name.
*
* @param string $stat Handler specific transfer stat to retrieve.
*
* @return mixed|null
*/
public function getHandlerStat(string $stat)
{
return $this->handlerStats[$stat] ?? null;
}
}

385
vendor/guzzlehttp/guzzle/src/Utils.php

@ -0,0 +1,385 @@
<?php
namespace GuzzleHttp;
use GuzzleHttp\Exception\InvalidArgumentException;
use GuzzleHttp\Handler\CurlHandler;
use GuzzleHttp\Handler\CurlMultiHandler;
use GuzzleHttp\Handler\Proxy;
use GuzzleHttp\Handler\StreamHandler;
use Psr\Http\Message\UriInterface;
final class Utils
{
/**
* Debug function used to describe the provided value type and class.
*
* @param mixed $input
*
* @return string Returns a string containing the type of the variable and
* if a class is provided, the class name.
*/
public static function describeType($input): string
{
switch (\gettype($input)) {
case 'object':
return 'object(' . \get_class($input) . ')';
case 'array':
return 'array(' . \count($input) . ')';
default:
\ob_start();
\var_dump($input);
// normalize float vs double
/** @var string $varDumpContent */
$varDumpContent = \ob_get_clean();
return \str_replace('double(', 'float(', \rtrim($varDumpContent));
}
}
/**
* Parses an array of header lines into an associative array of headers.
*
* @param iterable $lines Header lines array of strings in the following
* format: "Name: Value"
*/
public static function headersFromLines(iterable $lines): array
{
$headers = [];
foreach ($lines as $line) {
$parts = \explode(':', $line, 2);
$headers[\trim($parts[0])][] = isset($parts[1]) ? \trim($parts[1]) : null;
}
return $headers;
}
/**
* Returns a debug stream based on the provided variable.
*
* @param mixed $value Optional value
*
* @return resource
*/
public static function debugResource($value = null)
{
if (\is_resource($value)) {
return $value;
}
if (\defined('STDOUT')) {
return \STDOUT;
}
return \GuzzleHttp\Psr7\Utils::tryFopen('php://output', 'w');
}
/**
* Chooses and creates a default handler to use based on the environment.
*
* The returned handler is not wrapped by any default middlewares.
*
* @throws \RuntimeException if no viable Handler is available.
*
* @return callable(\Psr\Http\Message\RequestInterface, array): \GuzzleHttp\Promise\PromiseInterface Returns the best handler for the given system.
*/
public static function chooseHandler(): callable
{
$handler = null;
if (\defined('CURLOPT_CUSTOMREQUEST')) {
if (\function_exists('curl_multi_exec') && \function_exists('curl_exec')) {
$handler = Proxy::wrapSync(new CurlMultiHandler(), new CurlHandler());
} elseif (\function_exists('curl_exec')) {
$handler = new CurlHandler();
} elseif (\function_exists('curl_multi_exec')) {
$handler = new CurlMultiHandler();
}
}
if (\ini_get('allow_url_fopen')) {
$handler = $handler
? Proxy::wrapStreaming($handler, new StreamHandler())
: new StreamHandler();
} elseif (!$handler) {
throw new \RuntimeException('GuzzleHttp requires cURL, the allow_url_fopen ini setting, or a custom HTTP handler.');
}
return $handler;
}
/**
* Get the default User-Agent string to use with Guzzle.
*/
public static function defaultUserAgent(): string
{
return sprintf('GuzzleHttp/%d', ClientInterface::MAJOR_VERSION);
}
/**
* Returns the default cacert bundle for the current system.
*
* First, the openssl.cafile and curl.cainfo php.ini settings are checked.
* If those settings are not configured, then the common locations for
* bundles found on Red Hat, CentOS, Fedora, Ubuntu, Debian, FreeBSD, OS X
* and Windows are checked. If any of these file locations are found on
* disk, they will be utilized.
*
* Note: the result of this function is cached for subsequent calls.
*
* @throws \RuntimeException if no bundle can be found.
*
* @deprecated Utils::defaultCaBundle will be removed in guzzlehttp/guzzle:8.0. This method is not needed in PHP 5.6+.
*/
public static function defaultCaBundle(): string
{
static $cached = null;
static $cafiles = [
// Red Hat, CentOS, Fedora (provided by the ca-certificates package)
'/etc/pki/tls/certs/ca-bundle.crt',
// Ubuntu, Debian (provided by the ca-certificates package)
'/etc/ssl/certs/ca-certificates.crt',
// FreeBSD (provided by the ca_root_nss package)
'/usr/local/share/certs/ca-root-nss.crt',
// SLES 12 (provided by the ca-certificates package)
'/var/lib/ca-certificates/ca-bundle.pem',
// OS X provided by homebrew (using the default path)
'/usr/local/etc/openssl/cert.pem',
// Google app engine
'/etc/ca-certificates.crt',
// Windows?
'C:\\windows\\system32\\curl-ca-bundle.crt',
'C:\\windows\\curl-ca-bundle.crt',
];
if ($cached) {
return $cached;
}
if ($ca = \ini_get('openssl.cafile')) {
return $cached = $ca;
}
if ($ca = \ini_get('curl.cainfo')) {
return $cached = $ca;
}
foreach ($cafiles as $filename) {
if (\file_exists($filename)) {
return $cached = $filename;
}
}
throw new \RuntimeException(
<<< EOT
No system CA bundle could be found in any of the the common system locations.
PHP versions earlier than 5.6 are not properly configured to use the system's
CA bundle by default. In order to verify peer certificates, you will need to
supply the path on disk to a certificate bundle to the 'verify' request
option: http://docs.guzzlephp.org/en/latest/clients.html#verify. If you do not
need a specific certificate bundle, then Mozilla provides a commonly used CA
bundle which can be downloaded here (provided by the maintainer of cURL):
https://curl.haxx.se/ca/cacert.pem. Once
you have a CA bundle available on disk, you can set the 'openssl.cafile' PHP
ini setting to point to the path to the file, allowing you to omit the 'verify'
request option. See https://curl.haxx.se/docs/sslcerts.html for more
information.
EOT
);
}
/**
* Creates an associative array of lowercase header names to the actual
* header casing.
*/
public static function normalizeHeaderKeys(array $headers): array
{
$result = [];
foreach (\array_keys($headers) as $key) {
$result[\strtolower($key)] = $key;
}
return $result;
}
/**
* Returns true if the provided host matches any of the no proxy areas.
*
* This method will strip a port from the host if it is present. Each pattern
* can be matched with an exact match (e.g., "foo.com" == "foo.com") or a
* partial match: (e.g., "foo.com" == "baz.foo.com" and ".foo.com" ==
* "baz.foo.com", but ".foo.com" != "foo.com").
*
* Areas are matched in the following cases:
* 1. "*" (without quotes) always matches any hosts.
* 2. An exact match.
* 3. The area starts with "." and the area is the last part of the host. e.g.
* '.mit.edu' will match any host that ends with '.mit.edu'.
*
* @param string $host Host to check against the patterns.
* @param string[] $noProxyArray An array of host patterns.
*
* @throws InvalidArgumentException
*/
public static function isHostInNoProxy(string $host, array $noProxyArray): bool
{
if (\strlen($host) === 0) {
throw new InvalidArgumentException('Empty host provided');
}
// Strip port if present.
[$host] = \explode(':', $host, 2);
foreach ($noProxyArray as $area) {
// Always match on wildcards.
if ($area === '*') {
return true;
}
if (empty($area)) {
// Don't match on empty values.
continue;
}
if ($area === $host) {
// Exact matches.
return true;
}
// Special match if the area when prefixed with ".". Remove any
// existing leading "." and add a new leading ".".
$area = '.' . \ltrim($area, '.');
if (\substr($host, -(\strlen($area))) === $area) {
return true;
}
}
return false;
}
/**
* Wrapper for json_decode that throws when an error occurs.
*
* @param string $json JSON data to parse
* @param bool $assoc When true, returned objects will be converted
* into associative arrays.
* @param int $depth User specified recursion depth.
* @param int $options Bitmask of JSON decode options.
*
* @return object|array|string|int|float|bool|null
*
* @throws InvalidArgumentException if the JSON cannot be decoded.
*
* @link https://www.php.net/manual/en/function.json-decode.php
*/
public static function jsonDecode(string $json, bool $assoc = false, int $depth = 512, int $options = 0)
{
$data = \json_decode($json, $assoc, $depth, $options);
if (\JSON_ERROR_NONE !== \json_last_error()) {
throw new InvalidArgumentException('json_decode error: ' . \json_last_error_msg());
}
return $data;
}
/**
* Wrapper for JSON encoding that throws when an error occurs.
*
* @param mixed $value The value being encoded
* @param int $options JSON encode option bitmask
* @param int $depth Set the maximum depth. Must be greater than zero.
*
* @throws InvalidArgumentException if the JSON cannot be encoded.
*
* @link https://www.php.net/manual/en/function.json-encode.php
*/
public static function jsonEncode($value, int $options = 0, int $depth = 512): string
{
$json = \json_encode($value, $options, $depth);
if (\JSON_ERROR_NONE !== \json_last_error()) {
throw new InvalidArgumentException('json_encode error: ' . \json_last_error_msg());
}
/** @var string */
return $json;
}
/**
* Wrapper for the hrtime() or microtime() functions
* (depending on the PHP version, one of the two is used)
*
* @return float UNIX timestamp
*
* @internal
*/
public static function currentTime(): float
{
return (float) \function_exists('hrtime') ? \hrtime(true) / 1e9 : \microtime(true);
}
/**
* @throws InvalidArgumentException
*
* @internal
*/
public static function idnUriConvert(UriInterface $uri, int $options = 0): UriInterface
{
if ($uri->getHost()) {
$asciiHost = self::idnToAsci($uri->getHost(), $options, $info);
if ($asciiHost === false) {
$errorBitSet = $info['errors'] ?? 0;
$errorConstants = array_filter(array_keys(get_defined_constants()), static function (string $name): bool {
return substr($name, 0, 11) === 'IDNA_ERROR_';
});
$errors = [];
foreach ($errorConstants as $errorConstant) {
if ($errorBitSet & constant($errorConstant)) {
$errors[] = $errorConstant;
}
}
$errorMessage = 'IDN conversion failed';
if ($errors) {
$errorMessage .= ' (errors: ' . implode(', ', $errors) . ')';
}
throw new InvalidArgumentException($errorMessage);
}
if ($uri->getHost() !== $asciiHost) {
// Replace URI only if the ASCII version is different
$uri = $uri->withHost($asciiHost);
}
}
return $uri;
}
/**
* @internal
*/
public static function getenv(string $name): ?string
{
if (isset($_SERVER[$name])) {
return (string) $_SERVER[$name];
}
if (\PHP_SAPI === 'cli' && ($value = \getenv($name)) !== false && $value !== null) {
return (string) $value;
}
return null;
}
/**
* @return string|false
*/
private static function idnToAsci(string $domain, int $options, ?array &$info = [])
{
if (\function_exists('idn_to_ascii') && \defined('INTL_IDNA_VARIANT_UTS46')) {
return \idn_to_ascii($domain, $options, \INTL_IDNA_VARIANT_UTS46, $info);
}
throw new \Error('ext-idn or symfony/polyfill-intl-idn not loaded or too old');
}
}

167
vendor/guzzlehttp/guzzle/src/functions.php

@ -0,0 +1,167 @@
<?php
namespace GuzzleHttp;
/**
* Debug function used to describe the provided value type and class.
*
* @param mixed $input Any type of variable to describe the type of. This
* parameter misses a typehint because of that.
*
* @return string Returns a string containing the type of the variable and
* if a class is provided, the class name.
*
* @deprecated describe_type will be removed in guzzlehttp/guzzle:8.0. Use Utils::describeType instead.
*/
function describe_type($input): string
{
return Utils::describeType($input);
}
/**
* Parses an array of header lines into an associative array of headers.
*
* @param iterable $lines Header lines array of strings in the following
* format: "Name: Value"
*
* @deprecated headers_from_lines will be removed in guzzlehttp/guzzle:8.0. Use Utils::headersFromLines instead.
*/
function headers_from_lines(iterable $lines): array
{
return Utils::headersFromLines($lines);
}
/**
* Returns a debug stream based on the provided variable.
*
* @param mixed $value Optional value
*
* @return resource
*
* @deprecated debug_resource will be removed in guzzlehttp/guzzle:8.0. Use Utils::debugResource instead.
*/
function debug_resource($value = null)
{
return Utils::debugResource($value);
}
/**
* Chooses and creates a default handler to use based on the environment.
*
* The returned handler is not wrapped by any default middlewares.
*
* @throws \RuntimeException if no viable Handler is available.
*
* @return callable(\Psr\Http\Message\RequestInterface, array): \GuzzleHttp\Promise\PromiseInterface Returns the best handler for the given system.
*
* @deprecated choose_handler will be removed in guzzlehttp/guzzle:8.0. Use Utils::chooseHandler instead.
*/
function choose_handler(): callable
{
return Utils::chooseHandler();
}
/**
* Get the default User-Agent string to use with Guzzle.
*
* @deprecated default_user_agent will be removed in guzzlehttp/guzzle:8.0. Use Utils::defaultUserAgent instead.
*/
function default_user_agent(): string
{
return Utils::defaultUserAgent();
}
/**
* Returns the default cacert bundle for the current system.
*
* First, the openssl.cafile and curl.cainfo php.ini settings are checked.
* If those settings are not configured, then the common locations for
* bundles found on Red Hat, CentOS, Fedora, Ubuntu, Debian, FreeBSD, OS X
* and Windows are checked. If any of these file locations are found on
* disk, they will be utilized.
*
* Note: the result of this function is cached for subsequent calls.
*
* @throws \RuntimeException if no bundle can be found.
*
* @deprecated default_ca_bundle will be removed in guzzlehttp/guzzle:8.0. This function is not needed in PHP 5.6+.
*/
function default_ca_bundle(): string
{
return Utils::defaultCaBundle();
}
/**
* Creates an associative array of lowercase header names to the actual
* header casing.
*
* @deprecated normalize_header_keys will be removed in guzzlehttp/guzzle:8.0. Use Utils::normalizeHeaderKeys instead.
*/
function normalize_header_keys(array $headers): array
{
return Utils::normalizeHeaderKeys($headers);
}
/**
* Returns true if the provided host matches any of the no proxy areas.
*
* This method will strip a port from the host if it is present. Each pattern
* can be matched with an exact match (e.g., "foo.com" == "foo.com") or a
* partial match: (e.g., "foo.com" == "baz.foo.com" and ".foo.com" ==
* "baz.foo.com", but ".foo.com" != "foo.com").
*
* Areas are matched in the following cases:
* 1. "*" (without quotes) always matches any hosts.
* 2. An exact match.
* 3. The area starts with "." and the area is the last part of the host. e.g.
* '.mit.edu' will match any host that ends with '.mit.edu'.
*
* @param string $host Host to check against the patterns.
* @param string[] $noProxyArray An array of host patterns.
*
* @throws Exception\InvalidArgumentException
*
* @deprecated is_host_in_noproxy will be removed in guzzlehttp/guzzle:8.0. Use Utils::isHostInNoProxy instead.
*/
function is_host_in_noproxy(string $host, array $noProxyArray): bool
{
return Utils::isHostInNoProxy($host, $noProxyArray);
}
/**
* Wrapper for json_decode that throws when an error occurs.
*
* @param string $json JSON data to parse
* @param bool $assoc When true, returned objects will be converted
* into associative arrays.
* @param int $depth User specified recursion depth.
* @param int $options Bitmask of JSON decode options.
*
* @return object|array|string|int|float|bool|null
*
* @throws Exception\InvalidArgumentException if the JSON cannot be decoded.
*
* @link https://www.php.net/manual/en/function.json-decode.php
* @deprecated json_decode will be removed in guzzlehttp/guzzle:8.0. Use Utils::jsonDecode instead.
*/
function json_decode(string $json, bool $assoc = false, int $depth = 512, int $options = 0)
{
return Utils::jsonDecode($json, $assoc, $depth, $options);
}
/**
* Wrapper for JSON encoding that throws when an error occurs.
*
* @param mixed $value The value being encoded
* @param int $options JSON encode option bitmask
* @param int $depth Set the maximum depth. Must be greater than zero.
*
* @throws Exception\InvalidArgumentException if the JSON cannot be encoded.
*
* @link https://www.php.net/manual/en/function.json-encode.php
* @deprecated json_encode will be removed in guzzlehttp/guzzle:8.0. Use Utils::jsonEncode instead.
*/
function json_encode($value, int $options = 0, int $depth = 512): string
{
return Utils::jsonEncode($value, $options, $depth);
}

6
vendor/guzzlehttp/guzzle/src/functions_include.php

@ -0,0 +1,6 @@
<?php
// Don't redefine the functions if included multiple times.
if (!\function_exists('GuzzleHttp\describe_type')) {
require __DIR__ . '/functions.php';
}

110
vendor/guzzlehttp/promises/CHANGELOG.md

@ -0,0 +1,110 @@
# CHANGELOG
## 1.5.2 - 2022-08-07
### Changed
- Officially support PHP 8.2
## 1.5.1 - 2021-10-22
### Fixed
- Revert "Call handler when waiting on fulfilled/rejected Promise"
- Fix pool memory leak when empty array of promises provided
## 1.5.0 - 2021-10-07
### Changed
- Call handler when waiting on fulfilled/rejected Promise
- Officially support PHP 8.1
### Fixed
- Fix manually settle promises generated with `Utils::task`
## 1.4.1 - 2021-02-18
### Fixed
- Fixed `each_limit` skipping promises and failing
## 1.4.0 - 2020-09-30
### Added
- Support for PHP 8
- Optional `$recursive` flag to `all`
- Replaced functions by static methods
### Fixed
- Fix empty `each` processing
- Fix promise handling for Iterators of non-unique keys
- Fixed `method_exists` crashes on PHP 8
- Memory leak on exceptions
## 1.3.1 - 2016-12-20
### Fixed
- `wait()` foreign promise compatibility
## 1.3.0 - 2016-11-18
### Added
- Adds support for custom task queues.
### Fixed
- Fixed coroutine promise memory leak.
## 1.2.0 - 2016-05-18
### Changed
- Update to now catch `\Throwable` on PHP 7+
## 1.1.0 - 2016-03-07
### Changed
- Update EachPromise to prevent recurring on a iterator when advancing, as this
could trigger fatal generator errors.
- Update Promise to allow recursive waiting without unwrapping exceptions.
## 1.0.3 - 2015-10-15
### Changed
- Update EachPromise to immediately resolve when the underlying promise iterator
is empty. Previously, such a promise would throw an exception when its `wait`
function was called.
## 1.0.2 - 2015-05-15
### Changed
- Conditionally require functions.php.
## 1.0.1 - 2015-06-24
### Changed
- Updating EachPromise to call next on the underlying promise iterator as late
as possible to ensure that generators that generate new requests based on
callbacks are not iterated until after callbacks are invoked.
## 1.0.0 - 2015-05-12
- Initial release

24
vendor/guzzlehttp/promises/LICENSE

@ -0,0 +1,24 @@
The MIT License (MIT)
Copyright (c) 2015 Michael Dowling <mtdowling@gmail.com>
Copyright (c) 2015 Graham Campbell <hello@gjcampbell.co.uk>
Copyright (c) 2017 Tobias Schultze <webmaster@tubo-world.de>
Copyright (c) 2020 Tobias Nyholm <tobias.nyholm@gmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

546
vendor/guzzlehttp/promises/README.md

@ -0,0 +1,546 @@
# Guzzle Promises
[Promises/A+](https://promisesaplus.com/) implementation that handles promise
chaining and resolution iteratively, allowing for "infinite" promise chaining
while keeping the stack size constant. Read [this blog post](https://blog.domenic.me/youre-missing-the-point-of-promises/)
for a general introduction to promises.
- [Features](#features)
- [Quick start](#quick-start)
- [Synchronous wait](#synchronous-wait)
- [Cancellation](#cancellation)
- [API](#api)
- [Promise](#promise)
- [FulfilledPromise](#fulfilledpromise)
- [RejectedPromise](#rejectedpromise)
- [Promise interop](#promise-interop)
- [Implementation notes](#implementation-notes)
## Features
- [Promises/A+](https://promisesaplus.com/) implementation.
- Promise resolution and chaining is handled iteratively, allowing for
"infinite" promise chaining.
- Promises have a synchronous `wait` method.
- Promises can be cancelled.
- Works with any object that has a `then` function.
- C# style async/await coroutine promises using
`GuzzleHttp\Promise\Coroutine::of()`.
## Quick Start
A *promise* represents the eventual result of an asynchronous operation. The
primary way of interacting with a promise is through its `then` method, which
registers callbacks to receive either a promise's eventual value or the reason
why the promise cannot be fulfilled.
### Callbacks
Callbacks are registered with the `then` method by providing an optional
`$onFulfilled` followed by an optional `$onRejected` function.
```php
use GuzzleHttp\Promise\Promise;
$promise = new Promise();
$promise->then(
// $onFulfilled
function ($value) {
echo 'The promise was fulfilled.';
},
// $onRejected
function ($reason) {
echo 'The promise was rejected.';
}
);
```
*Resolving* a promise means that you either fulfill a promise with a *value* or
reject a promise with a *reason*. Resolving a promise triggers callbacks
registered with the promise's `then` method. These callbacks are triggered
only once and in the order in which they were added.
### Resolving a Promise
Promises are fulfilled using the `resolve($value)` method. Resolving a promise
with any value other than a `GuzzleHttp\Promise\RejectedPromise` will trigger
all of the onFulfilled callbacks (resolving a promise with a rejected promise
will reject the promise and trigger the `$onRejected` callbacks).
```php
use GuzzleHttp\Promise\Promise;
$promise = new Promise();
$promise
->then(function ($value) {
// Return a value and don't break the chain
return "Hello, " . $value;
})
// This then is executed after the first then and receives the value
// returned from the first then.
->then(function ($value) {
echo $value;
});
// Resolving the promise triggers the $onFulfilled callbacks and outputs
// "Hello, reader."
$promise->resolve('reader.');
```
### Promise Forwarding
Promises can be chained one after the other. Each then in the chain is a new
promise. The return value of a promise is what's forwarded to the next
promise in the chain. Returning a promise in a `then` callback will cause the
subsequent promises in the chain to only be fulfilled when the returned promise
has been fulfilled. The next promise in the chain will be invoked with the
resolved value of the promise.
```php
use GuzzleHttp\Promise\Promise;
$promise = new Promise();
$nextPromise = new Promise();
$promise
->then(function ($value) use ($nextPromise) {
echo $value;
return $nextPromise;
})
->then(function ($value) {
echo $value;
});
// Triggers the first callback and outputs "A"
$promise->resolve('A');
// Triggers the second callback and outputs "B"
$nextPromise->resolve('B');
```
### Promise Rejection
When a promise is rejected, the `$onRejected` callbacks are invoked with the
rejection reason.
```php
use GuzzleHttp\Promise\Promise;
$promise = new Promise();
$promise->then(null, function ($reason) {
echo $reason;
});
$promise->reject('Error!');
// Outputs "Error!"
```
### Rejection Forwarding
If an exception is thrown in an `$onRejected` callback, subsequent
`$onRejected` callbacks are invoked with the thrown exception as the reason.
```php
use GuzzleHttp\Promise\Promise;
$promise = new Promise();
$promise->then(null, function ($reason) {
throw new Exception($reason);
})->then(null, function ($reason) {
assert($reason->getMessage() === 'Error!');
});
$promise->reject('Error!');
```
You can also forward a rejection down the promise chain by returning a
`GuzzleHttp\Promise\RejectedPromise` in either an `$onFulfilled` or
`$onRejected` callback.
```php
use GuzzleHttp\Promise\Promise;
use GuzzleHttp\Promise\RejectedPromise;
$promise = new Promise();
$promise->then(null, function ($reason) {
return new RejectedPromise($reason);
})->then(null, function ($reason) {
assert($reason === 'Error!');
});
$promise->reject('Error!');
```
If an exception is not thrown in a `$onRejected` callback and the callback
does not return a rejected promise, downstream `$onFulfilled` callbacks are
invoked using the value returned from the `$onRejected` callback.
```php
use GuzzleHttp\Promise\Promise;
$promise = new Promise();
$promise
->then(null, function ($reason) {
return "It's ok";
})
->then(function ($value) {
assert($value === "It's ok");
});
$promise->reject('Error!');
```
## Synchronous Wait
You can synchronously force promises to complete using a promise's `wait`
method. When creating a promise, you can provide a wait function that is used
to synchronously force a promise to complete. When a wait function is invoked
it is expected to deliver a value to the promise or reject the promise. If the
wait function does not deliver a value, then an exception is thrown. The wait
function provided to a promise constructor is invoked when the `wait` function
of the promise is called.
```php
$promise = new Promise(function () use (&$promise) {
$promise->resolve('foo');
});
// Calling wait will return the value of the promise.
echo $promise->wait(); // outputs "foo"
```
If an exception is encountered while invoking the wait function of a promise,
the promise is rejected with the exception and the exception is thrown.
```php
$promise = new Promise(function () use (&$promise) {
throw new Exception('foo');
});
$promise->wait(); // throws the exception.
```
Calling `wait` on a promise that has been fulfilled will not trigger the wait
function. It will simply return the previously resolved value.
```php
$promise = new Promise(function () { die('this is not called!'); });
$promise->resolve('foo');
echo $promise->wait(); // outputs "foo"
```
Calling `wait` on a promise that has been rejected will throw an exception. If
the rejection reason is an instance of `\Exception` the reason is thrown.
Otherwise, a `GuzzleHttp\Promise\RejectionException` is thrown and the reason
can be obtained by calling the `getReason` method of the exception.
```php
$promise = new Promise();
$promise->reject('foo');
$promise->wait();
```
> PHP Fatal error: Uncaught exception 'GuzzleHttp\Promise\RejectionException' with message 'The promise was rejected with value: foo'
### Unwrapping a Promise
When synchronously waiting on a promise, you are joining the state of the
promise into the current state of execution (i.e., return the value of the
promise if it was fulfilled or throw an exception if it was rejected). This is
called "unwrapping" the promise. Waiting on a promise will by default unwrap
the promise state.
You can force a promise to resolve and *not* unwrap the state of the promise
by passing `false` to the first argument of the `wait` function:
```php
$promise = new Promise();
$promise->reject('foo');
// This will not throw an exception. It simply ensures the promise has
// been resolved.
$promise->wait(false);
```
When unwrapping a promise, the resolved value of the promise will be waited
upon until the unwrapped value is not a promise. This means that if you resolve
promise A with a promise B and unwrap promise A, the value returned by the
wait function will be the value delivered to promise B.
**Note**: when you do not unwrap the promise, no value is returned.
## Cancellation
You can cancel a promise that has not yet been fulfilled using the `cancel()`
method of a promise. When creating a promise you can provide an optional
cancel function that when invoked cancels the action of computing a resolution
of the promise.
## API
### Promise
When creating a promise object, you can provide an optional `$waitFn` and
`$cancelFn`. `$waitFn` is a function that is invoked with no arguments and is
expected to resolve the promise. `$cancelFn` is a function with no arguments
that is expected to cancel the computation of a promise. It is invoked when the
`cancel()` method of a promise is called.
```php
use GuzzleHttp\Promise\Promise;
$promise = new Promise(
function () use (&$promise) {
$promise->resolve('waited');
},
function () {
// do something that will cancel the promise computation (e.g., close
// a socket, cancel a database query, etc...)
}
);
assert('waited' === $promise->wait());
```
A promise has the following methods:
- `then(callable $onFulfilled, callable $onRejected) : PromiseInterface`
Appends fulfillment and rejection handlers to the promise, and returns a new promise resolving to the return value of the called handler.
- `otherwise(callable $onRejected) : PromiseInterface`
Appends a rejection handler callback to the promise, and returns a new promise resolving to the return value of the callback if it is called, or to its original fulfillment value if the promise is instead fulfilled.
- `wait($unwrap = true) : mixed`
Synchronously waits on the promise to complete.
`$unwrap` controls whether or not the value of the promise is returned for a
fulfilled promise or if an exception is thrown if the promise is rejected.
This is set to `true` by default.
- `cancel()`
Attempts to cancel the promise if possible. The promise being cancelled and
the parent most ancestor that has not yet been resolved will also be
cancelled. Any promises waiting on the cancelled promise to resolve will also
be cancelled.
- `getState() : string`
Returns the state of the promise. One of `pending`, `fulfilled`, or
`rejected`.
- `resolve($value)`
Fulfills the promise with the given `$value`.
- `reject($reason)`
Rejects the promise with the given `$reason`.
### FulfilledPromise
A fulfilled promise can be created to represent a promise that has been
fulfilled.
```php
use GuzzleHttp\Promise\FulfilledPromise;
$promise = new FulfilledPromise('value');
// Fulfilled callbacks are immediately invoked.
$promise->then(function ($value) {
echo $value;
});
```
### RejectedPromise
A rejected promise can be created to represent a promise that has been
rejected.
```php
use GuzzleHttp\Promise\RejectedPromise;
$promise = new RejectedPromise('Error');
// Rejected callbacks are immediately invoked.
$promise->then(null, function ($reason) {
echo $reason;
});
```
## Promise Interoperability
This library works with foreign promises that have a `then` method. This means
you can use Guzzle promises with [React promises](https://github.com/reactphp/promise)
for example. When a foreign promise is returned inside of a then method
callback, promise resolution will occur recursively.
```php
// Create a React promise
$deferred = new React\Promise\Deferred();
$reactPromise = $deferred->promise();
// Create a Guzzle promise that is fulfilled with a React promise.
$guzzlePromise = new GuzzleHttp\Promise\Promise();
$guzzlePromise->then(function ($value) use ($reactPromise) {
// Do something something with the value...
// Return the React promise
return $reactPromise;
});
```
Please note that wait and cancel chaining is no longer possible when forwarding
a foreign promise. You will need to wrap a third-party promise with a Guzzle
promise in order to utilize wait and cancel functions with foreign promises.
### Event Loop Integration
In order to keep the stack size constant, Guzzle promises are resolved
asynchronously using a task queue. When waiting on promises synchronously, the
task queue will be automatically run to ensure that the blocking promise and
any forwarded promises are resolved. When using promises asynchronously in an
event loop, you will need to run the task queue on each tick of the loop. If
you do not run the task queue, then promises will not be resolved.
You can run the task queue using the `run()` method of the global task queue
instance.
```php
// Get the global task queue
$queue = GuzzleHttp\Promise\Utils::queue();
$queue->run();
```
For example, you could use Guzzle promises with React using a periodic timer:
```php
$loop = React\EventLoop\Factory::create();
$loop->addPeriodicTimer(0, [$queue, 'run']);
```
*TODO*: Perhaps adding a `futureTick()` on each tick would be faster?
## Implementation Notes
### Promise Resolution and Chaining is Handled Iteratively
By shuffling pending handlers from one owner to another, promises are
resolved iteratively, allowing for "infinite" then chaining.
```php
<?php
require 'vendor/autoload.php';
use GuzzleHttp\Promise\Promise;
$parent = new Promise();
$p = $parent;
for ($i = 0; $i < 1000; $i++) {
$p = $p->then(function ($v) {
// The stack size remains constant (a good thing)
echo xdebug_get_stack_depth() . ', ';
return $v + 1;
});
}
$parent->resolve(0);
var_dump($p->wait()); // int(1000)
```
When a promise is fulfilled or rejected with a non-promise value, the promise
then takes ownership of the handlers of each child promise and delivers values
down the chain without using recursion.
When a promise is resolved with another promise, the original promise transfers
all of its pending handlers to the new promise. When the new promise is
eventually resolved, all of the pending handlers are delivered the forwarded
value.
### A Promise is the Deferred
Some promise libraries implement promises using a deferred object to represent
a computation and a promise object to represent the delivery of the result of
the computation. This is a nice separation of computation and delivery because
consumers of the promise cannot modify the value that will be eventually
delivered.
One side effect of being able to implement promise resolution and chaining
iteratively is that you need to be able for one promise to reach into the state
of another promise to shuffle around ownership of handlers. In order to achieve
this without making the handlers of a promise publicly mutable, a promise is
also the deferred value, allowing promises of the same parent class to reach
into and modify the private properties of promises of the same type. While this
does allow consumers of the value to modify the resolution or rejection of the
deferred, it is a small price to pay for keeping the stack size constant.
```php
$promise = new Promise();
$promise->then(function ($value) { echo $value; });
// The promise is the deferred value, so you can deliver a value to it.
$promise->resolve('foo');
// prints "foo"
```
## Upgrading from Function API
A static API was first introduced in 1.4.0, in order to mitigate problems with
functions conflicting between global and local copies of the package. The
function API will be removed in 2.0.0. A migration table has been provided here
for your convenience:
| Original Function | Replacement Method |
|----------------|----------------|
| `queue` | `Utils::queue` |
| `task` | `Utils::task` |
| `promise_for` | `Create::promiseFor` |
| `rejection_for` | `Create::rejectionFor` |
| `exception_for` | `Create::exceptionFor` |
| `iter_for` | `Create::iterFor` |
| `inspect` | `Utils::inspect` |
| `inspect_all` | `Utils::inspectAll` |
| `unwrap` | `Utils::unwrap` |
| `all` | `Utils::all` |
| `some` | `Utils::some` |
| `any` | `Utils::any` |
| `settle` | `Utils::settle` |
| `each` | `Each::of` |
| `each_limit` | `Each::ofLimit` |
| `each_limit_all` | `Each::ofLimitAll` |
| `!is_fulfilled` | `Is::pending` |
| `is_fulfilled` | `Is::fulfilled` |
| `is_rejected` | `Is::rejected` |
| `is_settled` | `Is::settled` |
| `coroutine` | `Coroutine::of` |
## Security
If you discover a security vulnerability within this package, please send an email to security@tidelift.com. All security vulnerabilities will be promptly addressed. Please do not disclose security-related issues publicly until a fix has been announced. Please see [Security Policy](https://github.com/guzzle/promises/security/policy) for more information.
## License
Guzzle is made available under the MIT License (MIT). Please see [License File](LICENSE) for more information.
## For Enterprise
Available as part of the Tidelift Subscription
The maintainers of Guzzle and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/packagist-guzzlehttp-promises?utm_source=packagist-guzzlehttp-promises&utm_medium=referral&utm_campaign=enterprise&utm_term=repo)

58
vendor/guzzlehttp/promises/composer.json

@ -0,0 +1,58 @@
{
"name": "guzzlehttp/promises",
"description": "Guzzle promises library",
"keywords": ["promise"],
"license": "MIT",
"authors": [
{
"name": "Graham Campbell",
"email": "hello@gjcampbell.co.uk",
"homepage": "https://github.com/GrahamCampbell"
},
{
"name": "Michael Dowling",
"email": "mtdowling@gmail.com",
"homepage": "https://github.com/mtdowling"
},
{
"name": "Tobias Nyholm",
"email": "tobias.nyholm@gmail.com",
"homepage": "https://github.com/Nyholm"
},
{
"name": "Tobias Schultze",
"email": "webmaster@tubo-world.de",
"homepage": "https://github.com/Tobion"
}
],
"require": {
"php": ">=5.5"
},
"require-dev": {
"symfony/phpunit-bridge": "^4.4 || ^5.1"
},
"autoload": {
"psr-4": {
"GuzzleHttp\\Promise\\": "src/"
},
"files": ["src/functions_include.php"]
},
"autoload-dev": {
"psr-4": {
"GuzzleHttp\\Promise\\Tests\\": "tests/"
}
},
"scripts": {
"test": "vendor/bin/simple-phpunit",
"test-ci": "vendor/bin/simple-phpunit --coverage-text"
},
"extra": {
"branch-alias": {
"dev-master": "1.5-dev"
}
},
"config": {
"preferred-install": "dist",
"sort-packages": true
}
}

17
vendor/guzzlehttp/promises/src/AggregateException.php

@ -0,0 +1,17 @@
<?php
namespace GuzzleHttp\Promise;
/**
* Exception thrown when too many errors occur in the some() or any() methods.
*/
class AggregateException extends RejectionException
{
public function __construct($msg, array $reasons)
{
parent::__construct(
$reasons,
sprintf('%s; %d rejected promises', $msg, count($reasons))
);
}
}

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save