wp-studio 1.7.8-beta2 → 1.7.8-beta3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (219) hide show
  1. package/README.md +33 -0
  2. package/assets/demo.gif +0 -0
  3. package/dist/cli/{_events-BRGCap7g.mjs → _events-C60cNJ1W.mjs} +1 -1
  4. package/dist/cli/{index-9Oz-0bqF.mjs → index-D9syEMMz.mjs} +4 -4
  5. package/dist/cli/{index-CT4S2538.mjs → index-Ru6CUP6w.mjs} +24 -12
  6. package/dist/cli/{login-D4E3GoXe.mjs → login-C3QlGVbr.mjs} +1 -1
  7. package/dist/cli/{logout-DE-RoshK.mjs → logout-B63eZwJZ.mjs} +1 -1
  8. package/dist/cli/main.mjs +2 -1
  9. package/dist/cli/{resume-DLoXmzNG.mjs → resume-DQT_MK6A.mjs} +1 -1
  10. package/dist/cli/{set-B0L-QiXT.mjs → set-C805heQS.mjs} +1 -1
  11. package/dist/cli/{set-B8YYUENH.mjs → set-CjTbueyB.mjs} +1 -1
  12. package/dist/cli/{status-DEOAA0yx.mjs → status-SnKm1rRP.mjs} +1 -1
  13. package/dist/cli/{wp-CobSX6C6.mjs → wp-D0HZdudM.mjs} +1 -1
  14. package/dist/cli/wp-files/sqlite-command/composer.json +4 -3
  15. package/dist/cli/wp-files/sqlite-command/composer.lock +132 -80
  16. package/dist/cli/wp-files/sqlite-command/vendor/autoload.php +1 -1
  17. package/dist/cli/wp-files/sqlite-command/vendor/composer/autoload_classmap.php +58 -70
  18. package/dist/cli/wp-files/sqlite-command/vendor/composer/autoload_namespaces.php +1 -0
  19. package/dist/cli/wp-files/sqlite-command/vendor/composer/autoload_psr4.php +1 -1
  20. package/dist/cli/wp-files/sqlite-command/vendor/composer/autoload_real.php +5 -5
  21. package/dist/cli/wp-files/sqlite-command/vendor/composer/autoload_static.php +78 -80
  22. package/dist/cli/wp-files/sqlite-command/vendor/composer/installed.json +104 -49
  23. package/dist/cli/wp-files/sqlite-command/vendor/composer/installed.php +29 -16
  24. package/dist/cli/wp-files/sqlite-command/vendor/symfony/finder/CHANGELOG.md +103 -0
  25. package/dist/cli/wp-files/sqlite-command/vendor/symfony/finder/Comparator/Comparator.php +62 -0
  26. package/dist/cli/wp-files/sqlite-command/vendor/symfony/finder/Comparator/DateComparator.php +50 -0
  27. package/dist/cli/wp-files/sqlite-command/vendor/symfony/finder/Comparator/NumberComparator.php +78 -0
  28. package/dist/cli/wp-files/sqlite-command/vendor/symfony/finder/Exception/AccessDeniedException.php +19 -0
  29. package/dist/cli/wp-files/sqlite-command/vendor/symfony/finder/Exception/DirectoryNotFoundException.php +19 -0
  30. package/dist/cli/wp-files/sqlite-command/vendor/symfony/finder/Finder.php +851 -0
  31. package/dist/cli/wp-files/sqlite-command/vendor/symfony/finder/Gitignore.php +91 -0
  32. package/dist/cli/wp-files/sqlite-command/vendor/symfony/finder/Glob.php +116 -0
  33. package/dist/cli/wp-files/sqlite-command/vendor/symfony/finder/Iterator/CustomFilterIterator.php +61 -0
  34. package/dist/cli/wp-files/sqlite-command/vendor/symfony/finder/Iterator/DateRangeFilterIterator.php +58 -0
  35. package/dist/cli/wp-files/sqlite-command/vendor/symfony/finder/Iterator/DepthRangeFilterIterator.php +48 -0
  36. package/dist/cli/wp-files/sqlite-command/vendor/symfony/finder/Iterator/ExcludeDirectoryFilterIterator.php +110 -0
  37. package/dist/cli/wp-files/sqlite-command/vendor/symfony/finder/Iterator/FileTypeFilterIterator.php +51 -0
  38. package/dist/cli/wp-files/sqlite-command/vendor/symfony/finder/Iterator/FilecontentFilterIterator.php +58 -0
  39. package/dist/cli/wp-files/sqlite-command/vendor/symfony/finder/Iterator/FilenameFilterIterator.php +45 -0
  40. package/dist/cli/wp-files/sqlite-command/vendor/symfony/finder/Iterator/LazyIterator.php +32 -0
  41. package/dist/cli/wp-files/sqlite-command/vendor/symfony/finder/Iterator/MultiplePcreFilterIterator.php +107 -0
  42. package/dist/cli/wp-files/sqlite-command/vendor/symfony/finder/Iterator/PathFilterIterator.php +56 -0
  43. package/dist/cli/wp-files/sqlite-command/vendor/symfony/finder/Iterator/RecursiveDirectoryIterator.php +134 -0
  44. package/dist/cli/wp-files/sqlite-command/vendor/symfony/finder/Iterator/SizeRangeFilterIterator.php +57 -0
  45. package/dist/cli/wp-files/sqlite-command/vendor/symfony/finder/Iterator/SortableIterator.php +115 -0
  46. package/dist/cli/wp-files/sqlite-command/vendor/symfony/finder/Iterator/VcsIgnoredFilterIterator.php +173 -0
  47. package/dist/cli/wp-files/sqlite-command/vendor/symfony/finder/LICENSE +19 -0
  48. package/dist/cli/wp-files/sqlite-command/vendor/symfony/finder/README.md +14 -0
  49. package/dist/cli/wp-files/sqlite-command/vendor/symfony/finder/SplFileInfo.php +80 -0
  50. package/dist/cli/wp-files/sqlite-command/vendor/symfony/finder/composer.json +31 -0
  51. package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/mustache/.gitattributes +8 -0
  52. package/dist/cli/wp-files/sqlite-command/vendor/{mustache → wp-cli}/mustache/LICENSE +1 -1
  53. package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/mustache/README.md +76 -0
  54. package/dist/cli/wp-files/sqlite-command/vendor/{mustache → wp-cli}/mustache/composer.json +6 -16
  55. package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/mustache/src/Mustache/Autoloader.php +88 -0
  56. package/dist/cli/wp-files/sqlite-command/vendor/{mustache/mustache/src → wp-cli/mustache/src/Mustache}/Cache/AbstractCache.php +7 -15
  57. package/dist/cli/wp-files/sqlite-command/vendor/{mustache/mustache/src → wp-cli/mustache/src/Mustache}/Cache/FilesystemCache.php +15 -20
  58. package/dist/cli/wp-files/sqlite-command/vendor/{mustache/mustache/src → wp-cli/mustache/src/Mustache}/Cache/NoopCache.php +4 -8
  59. package/dist/cli/wp-files/sqlite-command/vendor/{mustache/mustache/src → wp-cli/mustache/src/Mustache}/Cache.php +7 -10
  60. package/dist/cli/wp-files/sqlite-command/vendor/{mustache/mustache/src → wp-cli/mustache/src/Mustache}/Compiler.php +87 -144
  61. package/dist/cli/wp-files/sqlite-command/vendor/{mustache/mustache/src → wp-cli/mustache/src/Mustache}/Context.php +19 -23
  62. package/dist/cli/wp-files/sqlite-command/vendor/{mustache/mustache/src → wp-cli/mustache/src/Mustache}/Engine.php +134 -251
  63. package/dist/cli/wp-files/sqlite-command/vendor/{mustache/mustache/src → wp-cli/mustache/src/Mustache}/Exception/InvalidArgumentException.php +2 -6
  64. package/dist/cli/wp-files/sqlite-command/vendor/{mustache/mustache/src → wp-cli/mustache/src/Mustache}/Exception/LogicException.php +2 -6
  65. package/dist/cli/wp-files/sqlite-command/vendor/{mustache/mustache/src → wp-cli/mustache/src/Mustache}/Exception/RuntimeException.php +2 -6
  66. package/dist/cli/wp-files/sqlite-command/vendor/{mustache/mustache/src → wp-cli/mustache/src/Mustache}/Exception/SyntaxException.php +8 -7
  67. package/dist/cli/wp-files/sqlite-command/vendor/{mustache/mustache/src → wp-cli/mustache/src/Mustache}/Exception/UnknownFilterException.php +7 -7
  68. package/dist/cli/wp-files/sqlite-command/vendor/{mustache/mustache/src → wp-cli/mustache/src/Mustache}/Exception/UnknownHelperException.php +7 -7
  69. package/dist/cli/wp-files/sqlite-command/vendor/{mustache/mustache/src → wp-cli/mustache/src/Mustache}/Exception/UnknownTemplateException.php +7 -7
  70. package/dist/cli/wp-files/sqlite-command/vendor/{mustache/mustache/src → wp-cli/mustache/src/Mustache}/Exception.php +5 -4
  71. package/dist/cli/wp-files/sqlite-command/vendor/{mustache/mustache/src → wp-cli/mustache/src/Mustache}/HelperCollection.php +17 -22
  72. package/dist/cli/wp-files/sqlite-command/vendor/{mustache/mustache/src → wp-cli/mustache/src/Mustache}/LambdaHelper.php +8 -28
  73. package/dist/cli/wp-files/sqlite-command/vendor/{mustache/mustache/src → wp-cli/mustache/src/Mustache}/Loader/ArrayLoader.php +9 -12
  74. package/dist/cli/wp-files/sqlite-command/vendor/{mustache/mustache/src → wp-cli/mustache/src/Mustache}/Loader/CascadingLoader.php +15 -18
  75. package/dist/cli/wp-files/sqlite-command/vendor/{mustache/mustache/src → wp-cli/mustache/src/Mustache}/Loader/FilesystemLoader.php +18 -24
  76. package/dist/cli/wp-files/sqlite-command/vendor/{mustache/mustache/src → wp-cli/mustache/src/Mustache}/Loader/InlineLoader.php +13 -19
  77. package/dist/cli/wp-files/sqlite-command/vendor/{mustache/mustache/src → wp-cli/mustache/src/Mustache}/Loader/MutableLoader.php +7 -4
  78. package/dist/cli/wp-files/sqlite-command/vendor/{mustache/mustache/src → wp-cli/mustache/src/Mustache}/Loader/ProductionFilesystemLoader.php +16 -23
  79. package/dist/cli/wp-files/sqlite-command/vendor/{mustache/mustache/src → wp-cli/mustache/src/Mustache}/Loader/StringLoader.php +4 -8
  80. package/dist/cli/wp-files/sqlite-command/vendor/{mustache/mustache/src → wp-cli/mustache/src/Mustache}/Loader.php +7 -8
  81. package/dist/cli/wp-files/sqlite-command/vendor/{mustache/mustache/src → wp-cli/mustache/src/Mustache}/Logger/AbstractLogger.php +26 -22
  82. package/dist/cli/wp-files/sqlite-command/vendor/{mustache/mustache/src → wp-cli/mustache/src/Mustache}/Logger/StreamLogger.php +20 -25
  83. package/dist/cli/wp-files/sqlite-command/vendor/{mustache/mustache/src → wp-cli/mustache/src/Mustache}/Logger.php +37 -13
  84. package/dist/cli/wp-files/sqlite-command/vendor/{mustache/mustache/src → wp-cli/mustache/src/Mustache}/Parser.php +93 -100
  85. package/dist/cli/wp-files/sqlite-command/vendor/{mustache/mustache/src → wp-cli/mustache/src/Mustache}/Source/FilesystemSource.php +7 -11
  86. package/dist/cli/wp-files/sqlite-command/vendor/{mustache/mustache/src → wp-cli/mustache/src/Mustache}/Source.php +5 -4
  87. package/dist/cli/wp-files/sqlite-command/vendor/{mustache/mustache/src → wp-cli/mustache/src/Mustache}/Template.php +32 -39
  88. package/dist/cli/wp-files/sqlite-command/vendor/{mustache/mustache/src → wp-cli/mustache/src/Mustache}/Tokenizer.php +29 -33
  89. package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/.actrc +3 -0
  90. package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/.gitattributes +6 -0
  91. package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/.mailmap +234 -0
  92. package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/README.md +4 -4
  93. package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/VERSION +1 -1
  94. package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/bundle/rmccue/requests/CHANGELOG.md +0 -65
  95. package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/bundle/rmccue/requests/README.md +1 -2
  96. package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/bundle/rmccue/requests/certificates/cacert.pem +372 -315
  97. package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/bundle/rmccue/requests/certificates/cacert.pem.sha256 +1 -1
  98. package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/bundle/rmccue/requests/composer.json +5 -7
  99. package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/bundle/rmccue/requests/src/Iri.php +18 -20
  100. package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/bundle/rmccue/requests/src/Requests.php +1 -1
  101. package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/bundle/rmccue/requests/src/Response/Headers.php +1 -1
  102. package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/bundle/rmccue/requests/src/Transport/Curl.php +1 -5
  103. package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/bundle/rmccue/requests/src/Transport/Fsockopen.php +0 -2
  104. package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/bundle/rmccue/requests/src/Utility/CaseInsensitiveDictionary.php +0 -12
  105. package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/bundle/rmccue/requests/src/Utility/FilteredIterator.php +2 -2
  106. package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/composer.json +13 -30
  107. package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/dependencies.yml +6 -0
  108. package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/manifest.json +1 -1
  109. package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/Autoloader.php +2 -4
  110. package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/Bootstrap/AutoloaderStep.php +1 -10
  111. package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/Bootstrap/CheckRoot.php +2 -20
  112. package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/Bootstrap/DefineProtectedCommands.php +3 -3
  113. package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/Bootstrap/IncludeFrameworkAutoloader.php +4 -3
  114. package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/Bootstrap/IncludeRequestsAutoloader.php +3 -4
  115. package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/Bootstrap/InitializeContexts.php +0 -3
  116. package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/Bootstrap/InitializeLogger.php +1 -1
  117. package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/Bootstrap/LaunchRunner.php +3 -6
  118. package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/Bootstrap/{RegisterShutdownHandler.php → LoadDispatcher.php} +4 -6
  119. package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/Bootstrap/LoadRequiredCommand.php +5 -9
  120. package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/Bootstrap/LoadUtilityFunctions.php +0 -1
  121. package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/Completions.php +6 -149
  122. package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/Configurator.php +49 -202
  123. package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/Context/Admin.php +21 -113
  124. package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/Context/Auto.php +1 -1
  125. package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/Context/Cli.php +1 -0
  126. package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/Context/Frontend.php +1 -0
  127. package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/Dispatcher/CommandFactory.php +26 -63
  128. package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/Dispatcher/CompositeCommand.php +9 -19
  129. package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/Dispatcher/Subcommand.php +19 -284
  130. package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/DocParser.php +5 -17
  131. package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/Exception/NonExistentKeyException.php +3 -6
  132. package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/Extractor.php +54 -30
  133. package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/Fetchers/Base.php +3 -7
  134. package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/Fetchers/Comment.php +2 -4
  135. package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/Fetchers/Post.php +3 -8
  136. package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/Fetchers/Signup.php +1 -3
  137. package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/Fetchers/Site.php +4 -12
  138. package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/Fetchers/User.php +1 -3
  139. package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/FileCache.php +33 -135
  140. package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/Formatter.php +57 -221
  141. package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/Inflector.php +4 -4
  142. package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/Iterators/CSV.php +1 -6
  143. package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/Iterators/Query.php +1 -3
  144. package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/Iterators/Table.php +1 -7
  145. package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/Iterators/Transform.php +0 -2
  146. package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/Loggers/Base.php +0 -15
  147. package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/Loggers/Quiet.php +3 -2
  148. package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/Loggers/Regular.php +3 -4
  149. package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/NoOp.php +0 -4
  150. package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/Process.php +7 -40
  151. package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/RequestsLibrary.php +1 -4
  152. package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php +234 -795
  153. package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/SynopsisParser.php +26 -116
  154. package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/SynopsisValidator.php +1 -1
  155. package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/Traverser/RecursiveDataStructureTraverser.php +26 -69
  156. package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/UpgraderSkin.php +1 -1
  157. package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/WpHttpCacheManager.php +5 -67
  158. package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/WpOrgApi.php +3 -3
  159. package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/boot-fs.php +2 -2
  160. package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/bootstrap.php +2 -5
  161. package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/class-wp-cli.php +62 -311
  162. package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/commands/src/CLI_Alias_Command.php +60 -292
  163. package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/commands/src/CLI_Cache_Command.php +1 -1
  164. package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/commands/src/CLI_Command.php +31 -191
  165. package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/commands/src/Help_Command.php +35 -177
  166. package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/config-spec.php +4 -28
  167. package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/utils-wp.php +47 -81
  168. package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/utils.php +200 -512
  169. package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/wp-cli.php +2 -2
  170. package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/wp-settings-cli.php +465 -0
  171. package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/templates/man-params.mustache +4 -0
  172. package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/templates/man.mustache +0 -8
  173. package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/tests/ArgValidationTest.php +74 -0
  174. package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/tests/CommandFactoryTest.php +420 -0
  175. package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/tests/ConfiguratorTest.php +87 -0
  176. package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/tests/DocParserTest.php +213 -0
  177. package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/tests/ExtractorTest.php +293 -0
  178. package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/tests/FileCacheTest.php +207 -0
  179. package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/tests/HelpTest.php +119 -0
  180. package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/tests/InflectorTest.php +37 -0
  181. package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/tests/LoggingTest.php +124 -0
  182. package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/tests/ProcessTest.php +30 -0
  183. package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/tests/SynopsisParserTest.php +194 -0
  184. package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/tests/UtilsTest.php +1092 -0
  185. package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/tests/WPCLITest.php +16 -0
  186. package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/tests/WP_CLI/Iterators/CSVTest.php +109 -0
  187. package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/tests/WP_CLI/Traversers/RecursiveDataStructureTraverserTest.php +151 -0
  188. package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/tests/WP_CLI/WpOrgApiTest.php +166 -0
  189. package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/tests/WpVersionCompareTest.php +78 -0
  190. package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/tests/bootstrap.php +17 -0
  191. package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/tests/data/commandfactory-doc_comment-class-win.php +70 -0
  192. package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/tests/data/commandfactory-doc_comment-class.php +70 -0
  193. package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/tests/data/commandfactory-doc_comment-function-win.php +19 -0
  194. package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/tests/data/commandfactory-doc_comment-function.php +19 -0
  195. package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/tests/data/expand_globs/bar.ab2 +0 -0
  196. package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/tests/data/expand_globs/baz.ab1 +0 -0
  197. package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/tests/data/expand_globs/baz.ac1 +0 -0
  198. package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/tests/data/expand_globs/baz.efg2 +0 -0
  199. package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/tests/data/expand_globs/foo.ab1 +0 -0
  200. package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/tests/data/expand_globs/foo.ab2 +0 -0
  201. package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/tests/data/expand_globs/foo.efg1 +0 -0
  202. package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/tests/data/expand_globs/foo.efg2 +0 -0
  203. package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/tests/mock-requests-transport.php +34 -0
  204. package/dist/cli/wp-files/sqlite-command/version +1 -1
  205. package/package.json +4 -3
  206. package/dist/cli/wp-files/sqlite-command/vendor/mustache/mustache/.php-cs-fixer.php +0 -20
  207. package/dist/cli/wp-files/sqlite-command/vendor/mustache/mustache/README.md +0 -94
  208. package/dist/cli/wp-files/sqlite-command/vendor/mustache/mustache/src/RenderedString.php +0 -51
  209. package/dist/cli/wp-files/sqlite-command/vendor/mustache/mustache/src/compat.php +0 -282
  210. package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/.typos.toml +0 -14
  211. package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/AGENTS.md +0 -121
  212. package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/bundle/rmccue/requests/scripts/proxy/proxy.py +0 -5
  213. package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/bundle/rmccue/requests/scripts/proxy/start.sh +0 -19
  214. package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/bundle/rmccue/requests/scripts/proxy/stop.sh +0 -10
  215. package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/Path.php +0 -260
  216. package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/ShutdownHandler.php +0 -329
  217. package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/schemas/wp-cli-config.json +0 -218
  218. package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/schemas/wp-cli.example.yml +0 -55
  219. /package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/{codecov.yml → tests/data/expand_globs/bar.ab1} +0 -0
@@ -3,7 +3,6 @@
3
3
  use cli\Shell;
4
4
  use WP_CLI\Dispatcher;
5
5
  use WP_CLI\Utils;
6
- use WP_CLI\Process;
7
6
 
8
7
  class Help_Command extends WP_CLI_Command {
9
8
 
@@ -22,11 +21,9 @@ class Help_Command extends WP_CLI_Command {
22
21
  *
23
22
  * # get help for `core download` subcommand
24
23
  * wp help core download
25
- *
26
- * @param string[] $args
27
24
  */
28
- public function __invoke( $args ) {
29
- $r = WP_CLI::get_runner()->find_command_to_run( $args, Utils\get_env_or_config( 'WP_CLI_AUTOCORRECT' ) ? 'auto' : 'confirm' );
25
+ public function __invoke( $args, $assoc_args ) {
26
+ $r = WP_CLI::get_runner()->find_command_to_run( $args );
30
27
 
31
28
  if ( is_array( $r ) ) {
32
29
  list( $command ) = $r;
@@ -37,10 +34,7 @@ class Help_Command extends WP_CLI_Command {
37
34
  }
38
35
 
39
36
  private static function show_help( $command ) {
40
- // Parse reference links once for the entire longdesc
41
- $longdesc_with_links = self::parse_reference_links( $command->get_longdesc() );
42
-
43
- $out = self::get_initial_markdown( $command, $longdesc_with_links );
37
+ $out = self::get_initial_markdown( $command );
44
38
 
45
39
  // Remove subcommands if in columns - will wordwrap separately.
46
40
  $subcommands = '';
@@ -51,15 +45,13 @@ class Help_Command extends WP_CLI_Command {
51
45
  $out = substr_replace( $out, $subcommands_header, $matches[1][1], strlen( $subcommands ) );
52
46
  }
53
47
 
54
- // Extract only the sections part (OPTIONS, EXAMPLES, etc.)
55
- $longdesc_sections = self::get_longdesc_sections( $longdesc_with_links );
56
- $out .= $longdesc_sections;
48
+ $out .= self::parse_reference_links( $command->get_longdesc() );
57
49
 
58
50
  // Definition lists.
59
- $out = (string) preg_replace_callback( '/([^\n]+)\n: (.+?)(\n\n|$)/s', [ __CLASS__, 'rewrap_param_desc' ], $out );
51
+ $out = preg_replace_callback( '/([^\n]+)\n: (.+?)(\n\n|$)/s', [ __CLASS__, 'rewrap_param_desc' ], $out );
60
52
 
61
53
  // Ensure lines with no leading whitespace that aren't section headers are indented.
62
- $out = (string) preg_replace( '/^((?! |\t|##).)/m', "\t$1", $out );
54
+ $out = preg_replace( '/^((?! |\t|##).)/m', "\t$1", $out );
63
55
 
64
56
  $tab = str_repeat( ' ', 2 );
65
57
 
@@ -69,9 +61,9 @@ class Help_Command extends WP_CLI_Command {
69
61
  $wordwrap_width = Shell::columns();
70
62
 
71
63
  // Wordwrap with indent.
72
- $out = (string) preg_replace_callback(
64
+ $out = preg_replace_callback(
73
65
  '/^( *)([^\n]+)\n/m',
74
- static function ( $matches ) use ( $wordwrap_width ) {
66
+ function ( $matches ) use ( $wordwrap_width ) {
75
67
  return $matches[1] . str_replace( "\n", "\n{$matches[1]}", wordwrap( $matches[2], $wordwrap_width - strlen( $matches[1] ) ) ) . "\n";
76
68
  },
77
69
  $out
@@ -79,9 +71,9 @@ class Help_Command extends WP_CLI_Command {
79
71
 
80
72
  if ( $subcommands ) {
81
73
  // Wordwrap with column indent.
82
- $subcommands = (string) preg_replace_callback(
74
+ $subcommands = preg_replace_callback(
83
75
  '/^(' . $column_subpattern . ')([^\n]+)\n/m',
84
- static function ( $matches ) use ( $wordwrap_width, $tab ) {
76
+ function ( $matches ) use ( $wordwrap_width, $tab ) {
85
77
  // Need to de-tab for wordwrapping to work properly.
86
78
  $matches[1] = str_replace( "\t", $tab, $matches[1] );
87
79
  $matches[2] = str_replace( "\t", $tab, $matches[2] );
@@ -97,7 +89,7 @@ class Help_Command extends WP_CLI_Command {
97
89
  }
98
90
 
99
91
  // Section headers.
100
- $out = (string) preg_replace( '/^## ([A-Z ]+)/m', WP_CLI::colorize( '%9\1%n' ), $out );
92
+ $out = preg_replace( '/^## ([A-Z ]+)/m', WP_CLI::colorize( '%9\1%n' ), $out );
101
93
 
102
94
  self::pass_through_pager( $out );
103
95
  }
@@ -116,68 +108,6 @@ class Help_Command extends WP_CLI_Command {
116
108
  return implode( "\n", $lines );
117
109
  }
118
110
 
119
- /**
120
- * Locate an executable binary or command by name using a platform-appropriate detector.
121
- *
122
- * On Windows, this uses `where`, and on POSIX systems it uses `command -v`.
123
- * This may not work accurately in PowerShell.
124
- *
125
- * @param string $binary Name of the binary or command to be found.
126
- * @return bool True if this command has determined that the binary or other command exists, false otherwise.
127
- */
128
- public static function binary_exists( $binary ) {
129
- if ( Utils\is_windows() ) {
130
- // This may not work in PowerShell; see https://stackoverflow.com/a/304447
131
- // If this needs to be adjusted to use 'where.exe' for PowerShell,
132
- // then we will need to add a way of detecting whether wp-cli is running in PowerShell.
133
- $detector = 'where';
134
- } else {
135
- // POSIX method to detect whether a command exists
136
- // This sometimes detects aliases.
137
- $detector = 'command -v';
138
- }
139
-
140
- $result = Process::create( $detector . ' ' . escapeshellarg( $binary ), null, null )->run();
141
-
142
- if ( 0 !== $result->return_code ) {
143
- // We could not reliably determine that the binary exists
144
- return false;
145
- } else {
146
- // POSIX binaries: command -v will return the path and exit 0
147
- // aliases: command -v may return the alias command and exit 0
148
- return true;
149
- }
150
- }
151
-
152
- /**
153
- * Determine whether to use `less` or `more` as a pager
154
- *
155
- * This caches the determined pager.
156
- *
157
- * @return string The command to use for the pager. Defaults to `more`.
158
- */
159
- public static function locate_pager() {
160
- static $pager = null;
161
-
162
- if ( empty( $pager ) ) {
163
- if ( self::binary_exists( 'less' ) ) {
164
- // less is not available in all systems
165
- $pager = 'less -R';
166
- } else {
167
- // more is part of the POSIX definition, and is also available on Windows.
168
- $pager = 'more';
169
- }
170
- }
171
-
172
- return $pager;
173
- }
174
-
175
- /**
176
- * Pass a given set of output through the system's terminal pager.
177
- *
178
- * @param string $out The output to be run through the pager.
179
- * @return mixed Termination status of the pager as reported by https://www.php.net/manual/en/function.proc-close.php
180
- */
181
111
  private static function pass_through_pager( $out ) {
182
112
 
183
113
  if ( ! Utils\check_proc_available( null /*context*/, true /*return*/ ) ) {
@@ -187,52 +117,33 @@ class Help_Command extends WP_CLI_Command {
187
117
  }
188
118
 
189
119
  $pager = getenv( 'PAGER' );
190
- // if '' we should assume that the user has explicitly disabled the pager by setting `PAGER=`
191
- if ( '' === $pager ) {
192
- WP_CLI::line( $out );
193
- return 0;
194
- }
195
120
  if ( false === $pager ) {
196
- $pager = self::locate_pager();
197
- }
198
-
199
- // If pager doesn't support ANSI colors, strip them from output.
200
- // Common pagers that don't support colors: more, pg, cat, and less without -R.
201
- // Pagers with color support typically use -R flag (less -R, most -R).
202
- if ( ! preg_match( '/(-R|--RAW-CONTROL-CHARS|--raw-control-chars)/i', $pager )
203
- && preg_match( '/(^|[\s\/\\\\])(less|more|pg|cat)(\s|$)/i', $pager ) ) {
204
- $out = \cli\Colors::decolorize( $out );
205
- WP_CLI::debug( 'Stripping ANSI color codes for pager without color support: ' . $pager, 'help' );
121
+ $pager = Utils\is_windows() ? 'more' : 'less -R';
206
122
  }
207
123
 
208
124
  // For Windows 7 need to set code page to something other than Unicode (65001) to get around "Not enough memory." error with `more.com` on PHP 7.1+.
209
- if ( 'more' === $pager && defined( 'PHP_WINDOWS_VERSION_MAJOR' ) && PHP_WINDOWS_VERSION_MAJOR < 10 ) {
125
+ if ( 'more' === $pager && defined( 'PHP_WINDOWS_VERSION_MAJOR' ) && PHP_WINDOWS_VERSION_MAJOR < 10 && function_exists( 'sapi_windows_cp_set' ) ) {
210
126
  // Note will also apply to Windows 8 (see https://msdn.microsoft.com/en-us/library/windows/desktop/ms724832.aspx) but probably harmless anyway.
211
- $cp = (int) Utils\get_env_or_config( 'WP_CLI_WINDOWS_CODE_PAGE' ) ?: 1252; // Code page 1252 is the most used so probably the most compat.
212
- sapi_windows_cp_set( $cp );
127
+ $cp = getenv( 'WP_CLI_WINDOWS_CODE_PAGE' ) ?: 1252; // Code page 1252 is the most used so probably the most compat.
128
+ // phpcs:ignore PHPCompatibility.FunctionUse.NewFunctions -- Wrapped in function_exists() call.
129
+ sapi_windows_cp_set( $cp ); // `sapi_windows_cp_set()` introduced PHP 7.1.
213
130
  }
214
131
 
215
132
  // Convert string to file handle.
216
133
  $fd = fopen( 'php://temp', 'r+b' );
217
- if ( $fd ) {
218
- fwrite( $fd, $out );
219
- rewind( $fd );
220
- }
134
+ fwrite( $fd, $out );
135
+ rewind( $fd );
221
136
 
222
- /**
223
- * @var array<resource> $descriptorspec
224
- */
225
137
  $descriptorspec = [
226
138
  0 => $fd,
227
139
  1 => STDOUT,
228
140
  2 => STDERR,
229
141
  ];
230
142
 
231
- $process = Utils\proc_open_compat( $pager, $descriptorspec, $pipes );
232
- return $process ? proc_close( $process ) : -1;
143
+ return proc_close( Utils\proc_open_compat( $pager, $descriptorspec, $pipes ) );
233
144
  }
234
145
 
235
- private static function get_initial_markdown( $command, $longdesc_with_links = null ) {
146
+ private static function get_initial_markdown( $command ) {
236
147
  $name = implode( ' ', Dispatcher\get_path( $command ) );
237
148
 
238
149
  $binding = [
@@ -256,21 +167,10 @@ class Help_Command extends WP_CLI_Command {
256
167
  }
257
168
  }
258
169
 
259
- // Add description paragraphs from longdesc to shortdesc for DESCRIPTION section
260
- if ( null === $longdesc_with_links ) {
261
- $longdesc_with_links = self::parse_reference_links( $command->get_longdesc() );
262
- }
263
- $longdesc_description = self::get_longdesc_description( $longdesc_with_links );
264
- if ( $longdesc_description ) {
265
- $binding['shortdesc'] .= "\n\n" . $longdesc_description;
266
- }
267
-
268
170
  if ( $command->can_have_subcommands() ) {
269
171
  $binding['has-subcommands']['subcommands'] = self::render_subcommands( $command );
270
172
  }
271
173
 
272
- $binding['root_command'] = $command instanceof WP_CLI\Dispatcher\RootCommand;
273
-
274
174
  return Utils\mustache_render( 'man.mustache', $binding );
275
175
  }
276
176
 
@@ -314,15 +214,21 @@ class Help_Command extends WP_CLI_Command {
314
214
  * @return string The longdescription which has links as footnote.
315
215
  */
316
216
  private static function parse_reference_links( $longdesc ) {
317
- $description = self::extract_before_sections( $longdesc );
217
+ $description = '';
218
+ foreach ( explode( "\n", $longdesc ) as $line ) {
219
+ if ( 0 === strpos( $line, '#' ) ) {
220
+ break;
221
+ }
222
+ $description .= $line . "\n";
223
+ }
318
224
 
319
- // Process if there is description text at the head of `$longdesc`.
320
- if ( trim( $description ) ) {
225
+ // Fires if it has description text at the head of `$longdesc`.
226
+ if ( $description ) {
321
227
  $links = []; // An array of URLs from the description.
322
228
  $pattern = '/\[.+?\]\((https?:\/\/.+?)\)/';
323
- $newdesc = (string) preg_replace_callback(
229
+ $newdesc = preg_replace_callback(
324
230
  $pattern,
325
- static function ( $matches ) use ( &$links ) {
231
+ function ( $matches ) use ( &$links ) {
326
232
  static $count = 0;
327
233
  $count++;
328
234
  $links[] = $matches[1];
@@ -331,10 +237,11 @@ class Help_Command extends WP_CLI_Command {
331
237
  $description
332
238
  );
333
239
 
334
- $footnote = '';
335
- foreach ( $links as $i => $link ) {
240
+ $footnote = '';
241
+ $link_count = count( $links );
242
+ for ( $i = 0; $i < $link_count; $i++ ) {
336
243
  $n = $i + 1;
337
- $footnote .= '[' . $n . '] ' . $link . "\n";
244
+ $footnote .= '[' . $n . '] ' . $links[ $i ] . "\n";
338
245
  }
339
246
 
340
247
  if ( $footnote ) {
@@ -345,53 +252,4 @@ class Help_Command extends WP_CLI_Command {
345
252
 
346
253
  return $longdesc;
347
254
  }
348
-
349
- /**
350
- * Extract description paragraphs from longdesc (content before first section header).
351
- *
352
- * @param string $longdesc The longdescription from the command.
353
- * @return string The description paragraphs only.
354
- */
355
- private static function get_longdesc_description( $longdesc ) {
356
- return trim( self::extract_before_sections( $longdesc ) );
357
- }
358
-
359
- /**
360
- * Extract section content from longdesc (content from first section header onwards).
361
- *
362
- * @param string $longdesc The longdescription from the command.
363
- * @return string The section content only (OPTIONS, EXAMPLES, etc.).
364
- */
365
- private static function get_longdesc_sections( $longdesc ) {
366
- $sections = '';
367
- $in_sections = false;
368
- foreach ( explode( "\n", $longdesc ) as $line ) {
369
- if ( ! $in_sections && 0 === strpos( $line, '##' ) ) {
370
- $in_sections = true;
371
- }
372
- if ( $in_sections ) {
373
- $sections .= $line . "\n";
374
- }
375
- }
376
-
377
- return $sections;
378
- }
379
-
380
- /**
381
- * Extract content before first section header (##).
382
- *
383
- * @param string $text The text to extract from.
384
- * @return string Content before first section header.
385
- */
386
- private static function extract_before_sections( $text ) {
387
- $before_sections = '';
388
- foreach ( explode( "\n", $text ) as $line ) {
389
- if ( 0 === strpos( $line, '##' ) ) {
390
- break;
391
- }
392
- $before_sections .= $line . "\n";
393
- }
394
-
395
- return $before_sections;
396
- }
397
255
  }
@@ -19,14 +19,6 @@ return [
19
19
  'desc' => 'Perform operation against a remote server over SSH (or a container using scheme of "docker", "docker-compose", "docker-compose-run", "vagrant").',
20
20
  ],
21
21
 
22
- 'ssh-args' => [
23
- 'runtime' => '=<args>',
24
- 'file' => '<args>',
25
- 'desc' => 'Pass additional arguments to SSH (or other tools specified by --ssh scheme).',
26
- 'multiple' => true,
27
- 'default' => [],
28
- ],
29
-
30
22
  'http' => [
31
23
  'runtime' => '=<http>',
32
24
  'file' => '<http>',
@@ -84,15 +76,14 @@ return [
84
76
  'context' => [
85
77
  'runtime' => '=<context>',
86
78
  'file' => '<context>',
87
- 'default' => 'auto',
79
+ 'default' => 'cli',
88
80
  'desc' => 'Load WordPress in a given context.',
89
81
  ],
90
82
 
91
83
  'disabled_commands' => [
92
- 'file' => '<list>',
93
- 'default' => [],
94
- 'multiple' => true,
95
- 'desc' => '(Sub)commands to disable.',
84
+ 'file' => '<list>',
85
+ 'default' => [],
86
+ 'desc' => '(Sub)commands to disable.',
96
87
  ],
97
88
 
98
89
  'color' => [
@@ -138,19 +129,4 @@ return [
138
129
  'hidden' => true,
139
130
  ],
140
131
 
141
- 'alias' => [
142
- 'runtime' => '=<name>',
143
- 'file' => '<name>',
144
- 'desc' => 'Name of the alias to use. Aliases can reference local WordPress installations or remote SSH connections. Aliases are defined in the wp-cli.yml file.',
145
- 'multiple' => false,
146
- 'default' => '',
147
- ],
148
-
149
- 'assume-https' => [
150
- 'runtime' => '',
151
- 'file' => '<bool>',
152
- 'default' => false,
153
- 'desc' => 'Set $_SERVER[\'HTTPS\'] to make WordPress treat the site as HTTPS. Use when WordPress is behind an HTTPS proxy or load balancer.',
154
- ],
155
-
156
132
  ];
@@ -7,7 +7,6 @@ namespace WP_CLI\Utils;
7
7
  use ReflectionClass;
8
8
  use ReflectionParameter;
9
9
  use WP_CLI;
10
- use WP_CLI\Path;
11
10
  use WP_CLI\UpgraderSkin;
12
11
 
13
12
  /**
@@ -57,35 +56,31 @@ function wp_debug_mode() {
57
56
 
58
57
  error_reporting( E_ALL & ~E_DEPRECATED );
59
58
  } else {
60
- if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) {
59
+ if ( WP_DEBUG ) {
61
60
  error_reporting( E_ALL );
62
61
 
63
- if ( defined( 'WP_DEBUG_DISPLAY' ) ) {
64
- ini_set( 'display_errors', WP_DEBUG_DISPLAY ? 1 : 0 );
62
+ if ( WP_DEBUG_DISPLAY ) {
63
+ ini_set( 'display_errors', 1 );
64
+ } elseif ( null !== WP_DEBUG_DISPLAY ) {
65
+ ini_set( 'display_errors', 0 );
65
66
  }
66
67
 
67
- if ( defined( 'WP_DEBUG_LOG' ) ) {
68
- // @phpstan-ignore cast.useless
69
- if ( in_array( strtolower( (string) WP_DEBUG_LOG ), [ 'true', '1' ], true ) ) {
70
- $log_path = WP_CONTENT_DIR . '/debug.log';
71
- // @phpstan-ignore function.alreadyNarrowedType
72
- } elseif ( is_string( WP_DEBUG_LOG ) ) {
73
- $log_path = WP_DEBUG_LOG;
74
- } else {
75
- $log_path = false;
76
- }
68
+ if ( in_array( strtolower( (string) WP_DEBUG_LOG ), [ 'true', '1' ], true ) ) {
69
+ $log_path = WP_CONTENT_DIR . '/debug.log';
70
+ } elseif ( is_string( WP_DEBUG_LOG ) ) {
71
+ $log_path = WP_DEBUG_LOG;
72
+ } else {
73
+ $log_path = false;
74
+ }
77
75
 
78
- if ( false !== $log_path ) {
79
- ini_set( 'log_errors', 1 );
80
- ini_set( 'error_log', $log_path );
81
- }
76
+ if ( false !== $log_path ) {
77
+ ini_set( 'log_errors', 1 );
78
+ ini_set( 'error_log', $log_path );
82
79
  }
83
80
  } else {
84
81
  error_reporting( E_CORE_ERROR | E_CORE_WARNING | E_COMPILE_ERROR | E_ERROR | E_WARNING | E_PARSE | E_USER_ERROR | E_USER_WARNING | E_RECOVERABLE_ERROR );
85
82
  }
86
83
 
87
- // wp_doing_ajax() might not be available.
88
- // @phpstan-ignore phpstanWP.wpConstant.fetch
89
84
  if ( defined( 'XMLRPC_REQUEST' ) || defined( 'REST_REQUEST' ) || ( defined( 'DOING_AJAX' ) && DOING_AJAX ) ) {
90
85
  ini_set( 'display_errors', 0 );
91
86
  }
@@ -116,6 +111,11 @@ function wp_die_handler( $message ) {
116
111
 
117
112
  if ( $message instanceof \WP_Error ) {
118
113
  $text_message = $message->get_error_message();
114
+ $error_data = $message->get_error_data( 'internal_server_error' );
115
+ if ( ! empty( $error_data['error']['file'] )
116
+ && false !== stripos( $error_data['error']['file'], 'themes/functions.php' ) ) {
117
+ $text_message = 'An unexpected functions.php file in the themes directory may have caused this internal server error.';
118
+ }
119
119
  } else {
120
120
  $text_message = $message;
121
121
  }
@@ -152,6 +152,20 @@ function wp_clean_error_message( $message ) {
152
152
  return $message;
153
153
  }
154
154
 
155
+ /**
156
+ * @param string $url
157
+ * @return string
158
+ */
159
+ function wp_redirect_handler( $url ) {
160
+ WP_CLI::warning( 'Some code is trying to do a URL redirect. Backtrace:' );
161
+
162
+ ob_start();
163
+ debug_print_backtrace();
164
+ fwrite( STDERR, ob_get_clean() );
165
+
166
+ return $url;
167
+ }
168
+
155
169
  /**
156
170
  * @param string $since Version number.
157
171
  * @param string $path File to include.
@@ -164,16 +178,14 @@ function maybe_require( $since, $path ) {
164
178
  }
165
179
 
166
180
  /**
167
- * @template T of \WP_Upgrader
168
181
  *
169
- * @param class-string<T> $class_name Class name.
170
- * @param bool $insecure Optional. Default false.
171
- * @param \WP_Upgrader_Skin $skin. Optional. Upgrader skin. Default \WP_CLI\UpgraderSkin.
182
+ * @param class-string $class_name
183
+ * @param bool $insecure
172
184
  *
173
- * @return T Upgrader instance.
185
+ * @return \WP_Upgrader Upgrader instance.
174
186
  * @throws \ReflectionException
175
187
  */
176
- function get_upgrader( $class_name, $insecure = false, $skin = null ) {
188
+ function get_upgrader( $class_name, $insecure = false ) {
177
189
  if ( ! class_exists( '\WP_Upgrader' ) ) {
178
190
  if ( file_exists( ABSPATH . 'wp-admin/includes/class-wp-upgrader.php' ) ) {
179
191
  include ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
@@ -202,22 +214,10 @@ function get_upgrader( $class_name, $insecure = false, $skin = null ) {
202
214
  }
203
215
 
204
216
  if ( $uses_insecure_flag ) {
205
- /**
206
- * @var T $result
207
- */
208
- // TODO: Introduce custom upgrader interface supporting two arguments.
209
- // @phpstan-ignore arguments.count
210
- $result = new $class_name( $skin ?: new UpgraderSkin(), $insecure );
211
-
212
- return $result;
217
+ return new $class_name( new UpgraderSkin(), $insecure );
218
+ } else {
219
+ return new $class_name( new UpgraderSkin() );
213
220
  }
214
-
215
- /**
216
- * @var T $result
217
- */
218
- $result = new $class_name( $skin ?: new UpgraderSkin() );
219
-
220
- return $result;
221
221
  }
222
222
 
223
223
  /**
@@ -228,7 +228,7 @@ function get_upgrader( $class_name, $insecure = false, $skin = null ) {
228
228
  */
229
229
  function get_plugin_name( $basename ) {
230
230
  if ( false === strpos( $basename, '/' ) ) {
231
- $name = Path::basename( $basename, '.php' );
231
+ $name = basename( $basename, '.php' );
232
232
  } else {
233
233
  $name = dirname( $basename );
234
234
  }
@@ -264,7 +264,7 @@ function is_plugin_skipped( $file ) {
264
264
  * @return string
265
265
  */
266
266
  function get_theme_name( $path ) {
267
- return Path::basename( $path );
267
+ return basename( $path );
268
268
  }
269
269
 
270
270
  /**
@@ -370,24 +370,6 @@ function wp_get_cache_type() {
370
370
  } elseif ( isset( $wp_object_cache->lcache ) && $wp_object_cache->lcache instanceof \LCache\Integrated ) {
371
371
  $message = 'WP LCache';
372
372
 
373
- // Test for WP-Stash (https://github.com/inpsyde/WP-Stash)
374
- } elseif ( class_exists( 'Inpsyde\WpStash\WpStash' ) ) {
375
- try {
376
- $wp_stash = \Inpsyde\WpStash\WpStash::instance();
377
- if ( is_object( $wp_stash ) && method_exists( $wp_stash, 'driver' ) ) {
378
- $driver = $wp_stash->driver();
379
- if ( is_object( $driver ) ) {
380
- $message = 'WP-Stash (' . get_class( $driver ) . ')';
381
- } else {
382
- $message = 'WP-Stash';
383
- }
384
- } else {
385
- $message = 'WP-Stash';
386
- }
387
- } catch ( \Throwable $e ) {
388
- // If WP-Stash fails to initialize, we can't determine the driver
389
- $message = 'WP-Stash';
390
- }
391
373
  } elseif ( function_exists( 'w3_instance' ) ) {
392
374
  $config = w3_instance( 'W3_Config' );
393
375
 
@@ -395,11 +377,6 @@ function wp_get_cache_type() {
395
377
  $message = 'W3TC ' . $config->get_string( 'objectcache.engine' );
396
378
  }
397
379
  }
398
-
399
- // If still unknown, provide the class name for debugging
400
- if ( 'Unknown' === $message && is_object( $wp_object_cache ) ) {
401
- $message = 'Unknown: ' . get_class( $wp_object_cache );
402
- }
403
380
  } else {
404
381
  $message = 'Default';
405
382
  }
@@ -437,20 +414,16 @@ function wp_clear_object_cache() {
437
414
  }
438
415
 
439
416
  // The following are Memcached (Redux) plugin specific (see https://core.trac.wordpress.org/ticket/31463).
440
- // @phpstan-ignore property.notFound
441
417
  if ( isset( $wp_object_cache->group_ops ) ) {
442
418
  $wp_object_cache->group_ops = [];
443
419
  }
444
- // @phpstan-ignore property.notFound
445
420
  if ( isset( $wp_object_cache->stats ) ) {
446
421
  $wp_object_cache->stats = [];
447
422
  }
448
- // @phpstan-ignore property.notFound
449
423
  if ( isset( $wp_object_cache->memcache_debug ) ) {
450
424
  $wp_object_cache->memcache_debug = [];
451
425
  }
452
426
  // Used by `WP_Object_Cache` also.
453
- // @phpstan-ignore property.notFound
454
427
  if ( isset( $wp_object_cache->cache ) ) {
455
428
  $wp_object_cache->cache = [];
456
429
  }
@@ -461,8 +434,8 @@ function wp_clear_object_cache() {
461
434
  *
462
435
  * Interprets common command-line options into a resolved set of table names.
463
436
  *
464
- * @param array<string> $args Provided table names, or tables with wildcards.
465
- * @param array<string, bool|string> $assoc_args Optional flags for groups of tables (e.g. --network)
437
+ * @param array<string> $args Provided table names, or tables with wildcards.
438
+ * @param array<string, string> $assoc_args Optional flags for groups of tables (e.g. --network)
466
439
  * @return array<string>
467
440
  */
468
441
  function wp_get_table_names( $args, $assoc_args = [] ) {
@@ -519,7 +492,6 @@ function wp_get_table_names( $args, $assoc_args = [] ) {
519
492
  }
520
493
 
521
494
  // The global_terms_enabled() function has been deprecated with WP 6.1+.
522
- // @phpstan-ignore function.deprecated
523
495
  if ( wp_version_compare( '6.1', '>=' ) || ! global_terms_enabled() ) { // phpcs:ignore WordPress.WP.DeprecatedFunctions.global_terms_enabledFound
524
496
  // Only include sitecategories when it's actually enabled.
525
497
  $wp_tables = array_values( array_diff( $wp_tables, [ $wpdb->sitecategories ] ) );
@@ -529,16 +501,10 @@ function wp_get_table_names( $args, $assoc_args = [] ) {
529
501
  // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared -- uses esc_sql_ident() and $wpdb->_escape().
530
502
  $tables = $wpdb->get_col( sprintf( "SHOW TABLES WHERE %s IN ('%s')", esc_sql_ident( 'Tables_in_' . $wpdb->dbname ), implode( "', '", $wpdb->_escape( $wp_tables ) ) ) );
531
503
 
532
- // Filter tables after the query for improved SQLite compatibility.
533
- // See https://github.com/WordPress/sqlite-database-integration/issues/319.
534
- if ( 'sqlite' === get_db_type() ) {
535
- $tables = array_values( array_intersect( $tables, $wp_tables ) );
536
- }
537
-
538
504
  if ( get_flag_value( $assoc_args, 'base-tables-only' ) || get_flag_value( $assoc_args, 'views-only' ) ) {
539
505
  // Apply Views restriction args if needed.
540
506
  // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared -- Query is prepared, see above.
541
- $views_query_tables = $wpdb->get_col( $tables_sql, 0 ); // @phpstan-ignore variable.undefined
507
+ $views_query_tables = $wpdb->get_col( $tables_sql, 0 );
542
508
  $tables = array_intersect( $tables, $views_query_tables );
543
509
  }
544
510
  }
@@ -585,7 +551,7 @@ function strip_tags( $string ) {
585
551
  return \wp_strip_all_tags( $string );
586
552
  }
587
553
 
588
- $string = (string) preg_replace(
554
+ $string = preg_replace(
589
555
  '@<(script|style)[^>]*?>.*?</\\1>@si',
590
556
  '',
591
557
  $string