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
@@ -0,0 +1,851 @@
1
+ <?php
2
+
3
+ /*
4
+ * This file is part of the Symfony package.
5
+ *
6
+ * (c) Fabien Potencier <fabien@symfony.com>
7
+ *
8
+ * For the full copyright and license information, please view the LICENSE
9
+ * file that was distributed with this source code.
10
+ */
11
+
12
+ namespace Symfony\Component\Finder;
13
+
14
+ use Symfony\Component\Finder\Comparator\DateComparator;
15
+ use Symfony\Component\Finder\Comparator\NumberComparator;
16
+ use Symfony\Component\Finder\Exception\DirectoryNotFoundException;
17
+ use Symfony\Component\Finder\Iterator\CustomFilterIterator;
18
+ use Symfony\Component\Finder\Iterator\DateRangeFilterIterator;
19
+ use Symfony\Component\Finder\Iterator\DepthRangeFilterIterator;
20
+ use Symfony\Component\Finder\Iterator\ExcludeDirectoryFilterIterator;
21
+ use Symfony\Component\Finder\Iterator\FilecontentFilterIterator;
22
+ use Symfony\Component\Finder\Iterator\FilenameFilterIterator;
23
+ use Symfony\Component\Finder\Iterator\LazyIterator;
24
+ use Symfony\Component\Finder\Iterator\SizeRangeFilterIterator;
25
+ use Symfony\Component\Finder\Iterator\SortableIterator;
26
+
27
+ /**
28
+ * Finder allows to build rules to find files and directories.
29
+ *
30
+ * It is a thin wrapper around several specialized iterator classes.
31
+ *
32
+ * All rules may be invoked several times.
33
+ *
34
+ * All methods return the current Finder object to allow chaining:
35
+ *
36
+ * $finder = Finder::create()->files()->name('*.php')->in(__DIR__);
37
+ *
38
+ * @author Fabien Potencier <fabien@symfony.com>
39
+ *
40
+ * @implements \IteratorAggregate<non-empty-string, SplFileInfo>
41
+ */
42
+ class Finder implements \IteratorAggregate, \Countable
43
+ {
44
+ public const IGNORE_VCS_FILES = 1;
45
+ public const IGNORE_DOT_FILES = 2;
46
+ public const IGNORE_VCS_IGNORED_FILES = 4;
47
+
48
+ private int $mode = 0;
49
+ private array $names = [];
50
+ private array $notNames = [];
51
+ private array $exclude = [];
52
+ private array $filters = [];
53
+ private array $pruneFilters = [];
54
+ private array $depths = [];
55
+ private array $sizes = [];
56
+ private bool $followLinks = false;
57
+ private bool $reverseSorting = false;
58
+ private \Closure|int|false $sort = false;
59
+ private int $ignore = 0;
60
+ /** @var list<string> */
61
+ private array $dirs = [];
62
+ private array $dates = [];
63
+ /** @var list<iterable<SplFileInfo|\SplFileInfo|string>> */
64
+ private array $iterators = [];
65
+ private array $contains = [];
66
+ private array $notContains = [];
67
+ private array $paths = [];
68
+ private array $notPaths = [];
69
+ private bool $ignoreUnreadableDirs = false;
70
+
71
+ private static array $vcsPatterns = ['.svn', '_svn', 'CVS', '_darcs', '.arch-params', '.monotone', '.bzr', '.git', '.hg'];
72
+
73
+ public function __construct()
74
+ {
75
+ $this->ignore = static::IGNORE_VCS_FILES | static::IGNORE_DOT_FILES;
76
+ }
77
+
78
+ /**
79
+ * Creates a new Finder.
80
+ */
81
+ public static function create(): static
82
+ {
83
+ return new static();
84
+ }
85
+
86
+ /**
87
+ * Restricts the matching to directories only.
88
+ *
89
+ * @return $this
90
+ */
91
+ public function directories(): static
92
+ {
93
+ $this->mode = Iterator\FileTypeFilterIterator::ONLY_DIRECTORIES;
94
+
95
+ return $this;
96
+ }
97
+
98
+ /**
99
+ * Restricts the matching to files only.
100
+ *
101
+ * @return $this
102
+ */
103
+ public function files(): static
104
+ {
105
+ $this->mode = Iterator\FileTypeFilterIterator::ONLY_FILES;
106
+
107
+ return $this;
108
+ }
109
+
110
+ /**
111
+ * Adds tests for the directory depth.
112
+ *
113
+ * Usage:
114
+ *
115
+ * $finder->depth('> 1') // the Finder will start matching at level 1.
116
+ * $finder->depth('< 3') // the Finder will descend at most 3 levels of directories below the starting point.
117
+ * $finder->depth(['>= 1', '< 3'])
118
+ *
119
+ * @param string|int|string[]|int[] $levels The depth level expression or an array of depth levels
120
+ *
121
+ * @return $this
122
+ *
123
+ * @see DepthRangeFilterIterator
124
+ * @see NumberComparator
125
+ */
126
+ public function depth(string|int|array $levels): static
127
+ {
128
+ foreach ((array) $levels as $level) {
129
+ $this->depths[] = new NumberComparator($level);
130
+ }
131
+
132
+ return $this;
133
+ }
134
+
135
+ /**
136
+ * Adds tests for file dates (last modified).
137
+ *
138
+ * The date must be something that strtotime() is able to parse:
139
+ *
140
+ * $finder->date('since yesterday');
141
+ * $finder->date('until 2 days ago');
142
+ * $finder->date('> now - 2 hours');
143
+ * $finder->date('>= 2005-10-15');
144
+ * $finder->date(['>= 2005-10-15', '<= 2006-05-27']);
145
+ *
146
+ * @param string|string[] $dates A date range string or an array of date ranges
147
+ *
148
+ * @return $this
149
+ *
150
+ * @see strtotime
151
+ * @see DateRangeFilterIterator
152
+ * @see DateComparator
153
+ */
154
+ public function date(string|array $dates): static
155
+ {
156
+ foreach ((array) $dates as $date) {
157
+ $this->dates[] = new DateComparator($date);
158
+ }
159
+
160
+ return $this;
161
+ }
162
+
163
+ /**
164
+ * Adds rules that files must match.
165
+ *
166
+ * You can use patterns (delimited with / sign), globs or simple strings.
167
+ *
168
+ * $finder->name('/\.php$/')
169
+ * $finder->name('*.php') // same as above, without dot files
170
+ * $finder->name('test.php')
171
+ * $finder->name(['test.py', 'test.php'])
172
+ *
173
+ * @param string|string[] $patterns A pattern (a regexp, a glob, or a string) or an array of patterns
174
+ *
175
+ * @return $this
176
+ *
177
+ * @see FilenameFilterIterator
178
+ */
179
+ public function name(string|array $patterns): static
180
+ {
181
+ $this->names = array_merge($this->names, (array) $patterns);
182
+
183
+ return $this;
184
+ }
185
+
186
+ /**
187
+ * Adds rules that files must not match.
188
+ *
189
+ * @param string|string[] $patterns A pattern (a regexp, a glob, or a string) or an array of patterns
190
+ *
191
+ * @return $this
192
+ *
193
+ * @see FilenameFilterIterator
194
+ */
195
+ public function notName(string|array $patterns): static
196
+ {
197
+ $this->notNames = array_merge($this->notNames, (array) $patterns);
198
+
199
+ return $this;
200
+ }
201
+
202
+ /**
203
+ * Adds tests that file contents must match.
204
+ *
205
+ * Strings or PCRE patterns can be used:
206
+ *
207
+ * $finder->contains('Lorem ipsum')
208
+ * $finder->contains('/Lorem ipsum/i')
209
+ * $finder->contains(['dolor', '/ipsum/i'])
210
+ *
211
+ * @param string|string[] $patterns A pattern (string or regexp) or an array of patterns
212
+ *
213
+ * @return $this
214
+ *
215
+ * @see FilecontentFilterIterator
216
+ */
217
+ public function contains(string|array $patterns): static
218
+ {
219
+ $this->contains = array_merge($this->contains, (array) $patterns);
220
+
221
+ return $this;
222
+ }
223
+
224
+ /**
225
+ * Adds tests that file contents must not match.
226
+ *
227
+ * Strings or PCRE patterns can be used:
228
+ *
229
+ * $finder->notContains('Lorem ipsum')
230
+ * $finder->notContains('/Lorem ipsum/i')
231
+ * $finder->notContains(['lorem', '/dolor/i'])
232
+ *
233
+ * @param string|string[] $patterns A pattern (string or regexp) or an array of patterns
234
+ *
235
+ * @return $this
236
+ *
237
+ * @see FilecontentFilterIterator
238
+ */
239
+ public function notContains(string|array $patterns): static
240
+ {
241
+ $this->notContains = array_merge($this->notContains, (array) $patterns);
242
+
243
+ return $this;
244
+ }
245
+
246
+ /**
247
+ * Adds rules that filenames must match.
248
+ *
249
+ * You can use patterns (delimited with / sign) or simple strings.
250
+ *
251
+ * $finder->path('some/special/dir')
252
+ * $finder->path('/some\/special\/dir/') // same as above
253
+ * $finder->path(['some dir', 'another/dir'])
254
+ *
255
+ * Use only / as dirname separator.
256
+ *
257
+ * @param string|string[] $patterns A pattern (a regexp or a string) or an array of patterns
258
+ *
259
+ * @return $this
260
+ *
261
+ * @see FilenameFilterIterator
262
+ */
263
+ public function path(string|array $patterns): static
264
+ {
265
+ $this->paths = array_merge($this->paths, (array) $patterns);
266
+
267
+ return $this;
268
+ }
269
+
270
+ /**
271
+ * Adds rules that filenames must not match.
272
+ *
273
+ * You can use patterns (delimited with / sign) or simple strings.
274
+ *
275
+ * $finder->notPath('some/special/dir')
276
+ * $finder->notPath('/some\/special\/dir/') // same as above
277
+ * $finder->notPath(['some/file.txt', 'another/file.log'])
278
+ *
279
+ * Use only / as dirname separator.
280
+ *
281
+ * @param string|string[] $patterns A pattern (a regexp or a string) or an array of patterns
282
+ *
283
+ * @return $this
284
+ *
285
+ * @see FilenameFilterIterator
286
+ */
287
+ public function notPath(string|array $patterns): static
288
+ {
289
+ $this->notPaths = array_merge($this->notPaths, (array) $patterns);
290
+
291
+ return $this;
292
+ }
293
+
294
+ /**
295
+ * Adds tests for file sizes.
296
+ *
297
+ * $finder->size('> 10K');
298
+ * $finder->size('<= 1Ki');
299
+ * $finder->size(4);
300
+ * $finder->size(['> 10K', '< 20K'])
301
+ *
302
+ * @param string|int|string[]|int[] $sizes A size range string or an integer or an array of size ranges
303
+ *
304
+ * @return $this
305
+ *
306
+ * @see SizeRangeFilterIterator
307
+ * @see NumberComparator
308
+ */
309
+ public function size(string|int|array $sizes): static
310
+ {
311
+ foreach ((array) $sizes as $size) {
312
+ $this->sizes[] = new NumberComparator($size);
313
+ }
314
+
315
+ return $this;
316
+ }
317
+
318
+ /**
319
+ * Excludes directories.
320
+ *
321
+ * Directories passed as argument must be relative to the ones defined with the `in()` method. For example:
322
+ *
323
+ * $finder->in(__DIR__)->exclude('ruby');
324
+ *
325
+ * @param string|array $dirs A directory path or an array of directories
326
+ *
327
+ * @return $this
328
+ *
329
+ * @see ExcludeDirectoryFilterIterator
330
+ */
331
+ public function exclude(string|array $dirs): static
332
+ {
333
+ $this->exclude = array_merge($this->exclude, (array) $dirs);
334
+
335
+ return $this;
336
+ }
337
+
338
+ /**
339
+ * Excludes "hidden" directories and files (starting with a dot).
340
+ *
341
+ * This option is enabled by default.
342
+ *
343
+ * @return $this
344
+ *
345
+ * @see ExcludeDirectoryFilterIterator
346
+ */
347
+ public function ignoreDotFiles(bool $ignoreDotFiles): static
348
+ {
349
+ if ($ignoreDotFiles) {
350
+ $this->ignore |= static::IGNORE_DOT_FILES;
351
+ } else {
352
+ $this->ignore &= ~static::IGNORE_DOT_FILES;
353
+ }
354
+
355
+ return $this;
356
+ }
357
+
358
+ /**
359
+ * Forces the finder to ignore version control directories.
360
+ *
361
+ * This option is enabled by default.
362
+ *
363
+ * @return $this
364
+ *
365
+ * @see ExcludeDirectoryFilterIterator
366
+ */
367
+ public function ignoreVCS(bool $ignoreVCS): static
368
+ {
369
+ if ($ignoreVCS) {
370
+ $this->ignore |= static::IGNORE_VCS_FILES;
371
+ } else {
372
+ $this->ignore &= ~static::IGNORE_VCS_FILES;
373
+ }
374
+
375
+ return $this;
376
+ }
377
+
378
+ /**
379
+ * Forces Finder to obey .gitignore and ignore files based on rules listed there.
380
+ *
381
+ * This option is disabled by default.
382
+ *
383
+ * @return $this
384
+ */
385
+ public function ignoreVCSIgnored(bool $ignoreVCSIgnored): static
386
+ {
387
+ if ($ignoreVCSIgnored) {
388
+ $this->ignore |= static::IGNORE_VCS_IGNORED_FILES;
389
+ } else {
390
+ $this->ignore &= ~static::IGNORE_VCS_IGNORED_FILES;
391
+ }
392
+
393
+ return $this;
394
+ }
395
+
396
+ /**
397
+ * Adds VCS patterns.
398
+ *
399
+ * @see ignoreVCS()
400
+ *
401
+ * @param string|string[] $pattern VCS patterns to ignore
402
+ */
403
+ public static function addVCSPattern(string|array $pattern): void
404
+ {
405
+ foreach ((array) $pattern as $p) {
406
+ self::$vcsPatterns[] = $p;
407
+ }
408
+
409
+ self::$vcsPatterns = array_unique(self::$vcsPatterns);
410
+ }
411
+
412
+ /**
413
+ * Sorts files and directories by an anonymous function.
414
+ *
415
+ * The anonymous function receives two \SplFileInfo instances to compare.
416
+ *
417
+ * This can be slow as all the matching files and directories must be retrieved for comparison.
418
+ *
419
+ * @return $this
420
+ *
421
+ * @see SortableIterator
422
+ */
423
+ public function sort(\Closure $closure): static
424
+ {
425
+ $this->sort = $closure;
426
+
427
+ return $this;
428
+ }
429
+
430
+ /**
431
+ * Sorts files and directories by extension.
432
+ *
433
+ * This can be slow as all the matching files and directories must be retrieved for comparison.
434
+ *
435
+ * @return $this
436
+ *
437
+ * @see SortableIterator
438
+ */
439
+ public function sortByExtension(): static
440
+ {
441
+ $this->sort = SortableIterator::SORT_BY_EXTENSION;
442
+
443
+ return $this;
444
+ }
445
+
446
+ /**
447
+ * Sorts files and directories by name.
448
+ *
449
+ * This can be slow as all the matching files and directories must be retrieved for comparison.
450
+ *
451
+ * @return $this
452
+ *
453
+ * @see SortableIterator
454
+ */
455
+ public function sortByName(bool $useNaturalSort = false): static
456
+ {
457
+ $this->sort = $useNaturalSort ? SortableIterator::SORT_BY_NAME_NATURAL : SortableIterator::SORT_BY_NAME;
458
+
459
+ return $this;
460
+ }
461
+
462
+ /**
463
+ * Sorts files and directories by name case insensitive.
464
+ *
465
+ * This can be slow as all the matching files and directories must be retrieved for comparison.
466
+ *
467
+ * @return $this
468
+ *
469
+ * @see SortableIterator
470
+ */
471
+ public function sortByCaseInsensitiveName(bool $useNaturalSort = false): static
472
+ {
473
+ $this->sort = $useNaturalSort ? SortableIterator::SORT_BY_NAME_NATURAL_CASE_INSENSITIVE : SortableIterator::SORT_BY_NAME_CASE_INSENSITIVE;
474
+
475
+ return $this;
476
+ }
477
+
478
+ /**
479
+ * Sorts files and directories by size.
480
+ *
481
+ * This can be slow as all the matching files and directories must be retrieved for comparison.
482
+ *
483
+ * @return $this
484
+ *
485
+ * @see SortableIterator
486
+ */
487
+ public function sortBySize(): static
488
+ {
489
+ $this->sort = SortableIterator::SORT_BY_SIZE;
490
+
491
+ return $this;
492
+ }
493
+
494
+ /**
495
+ * Sorts files and directories by type (directories before files), then by name.
496
+ *
497
+ * This can be slow as all the matching files and directories must be retrieved for comparison.
498
+ *
499
+ * @return $this
500
+ *
501
+ * @see SortableIterator
502
+ */
503
+ public function sortByType(): static
504
+ {
505
+ $this->sort = SortableIterator::SORT_BY_TYPE;
506
+
507
+ return $this;
508
+ }
509
+
510
+ /**
511
+ * Sorts files and directories by the last accessed time.
512
+ *
513
+ * This is the time that the file was last accessed, read or written to.
514
+ *
515
+ * This can be slow as all the matching files and directories must be retrieved for comparison.
516
+ *
517
+ * @return $this
518
+ *
519
+ * @see SortableIterator
520
+ */
521
+ public function sortByAccessedTime(): static
522
+ {
523
+ $this->sort = SortableIterator::SORT_BY_ACCESSED_TIME;
524
+
525
+ return $this;
526
+ }
527
+
528
+ /**
529
+ * Reverses the sorting.
530
+ *
531
+ * @return $this
532
+ */
533
+ public function reverseSorting(): static
534
+ {
535
+ $this->reverseSorting = true;
536
+
537
+ return $this;
538
+ }
539
+
540
+ /**
541
+ * Sorts files and directories by the last inode changed time.
542
+ *
543
+ * This is the time that the inode information was last modified (permissions, owner, group or other metadata).
544
+ *
545
+ * On Windows, since inode is not available, changed time is actually the file creation time.
546
+ *
547
+ * This can be slow as all the matching files and directories must be retrieved for comparison.
548
+ *
549
+ * @return $this
550
+ *
551
+ * @see SortableIterator
552
+ */
553
+ public function sortByChangedTime(): static
554
+ {
555
+ $this->sort = SortableIterator::SORT_BY_CHANGED_TIME;
556
+
557
+ return $this;
558
+ }
559
+
560
+ /**
561
+ * Sorts files and directories by the last modified time.
562
+ *
563
+ * This is the last time the actual contents of the file were last modified.
564
+ *
565
+ * This can be slow as all the matching files and directories must be retrieved for comparison.
566
+ *
567
+ * @return $this
568
+ *
569
+ * @see SortableIterator
570
+ */
571
+ public function sortByModifiedTime(): static
572
+ {
573
+ $this->sort = SortableIterator::SORT_BY_MODIFIED_TIME;
574
+
575
+ return $this;
576
+ }
577
+
578
+ /**
579
+ * Filters the iterator with an anonymous function.
580
+ *
581
+ * The anonymous function receives a \SplFileInfo and must return false
582
+ * to remove files.
583
+ *
584
+ * @param \Closure(SplFileInfo): bool $closure
585
+ * @param bool $prune Whether to skip traversing directories further
586
+ *
587
+ * @return $this
588
+ *
589
+ * @see CustomFilterIterator
590
+ */
591
+ public function filter(\Closure $closure, bool $prune = false): static
592
+ {
593
+ $this->filters[] = $closure;
594
+
595
+ if ($prune) {
596
+ $this->pruneFilters[] = $closure;
597
+ }
598
+
599
+ return $this;
600
+ }
601
+
602
+ /**
603
+ * Forces the following of symlinks.
604
+ *
605
+ * @return $this
606
+ */
607
+ public function followLinks(): static
608
+ {
609
+ $this->followLinks = true;
610
+
611
+ return $this;
612
+ }
613
+
614
+ /**
615
+ * Tells finder to ignore unreadable directories.
616
+ *
617
+ * By default, scanning unreadable directories content throws an AccessDeniedException.
618
+ *
619
+ * @return $this
620
+ */
621
+ public function ignoreUnreadableDirs(bool $ignore = true): static
622
+ {
623
+ $this->ignoreUnreadableDirs = $ignore;
624
+
625
+ return $this;
626
+ }
627
+
628
+ /**
629
+ * Searches files and directories which match defined rules.
630
+ *
631
+ * @param string|string[] $dirs A directory path or an array of directories
632
+ *
633
+ * @return $this
634
+ *
635
+ * @throws DirectoryNotFoundException if one of the directories does not exist
636
+ */
637
+ public function in(string|array $dirs): static
638
+ {
639
+ $resolvedDirs = [];
640
+
641
+ foreach ((array) $dirs as $dir) {
642
+ if (is_dir($dir)) {
643
+ $resolvedDirs[] = [$this->normalizeDir($dir)];
644
+ } elseif ($glob = glob($dir, (\defined('GLOB_BRACE') ? \GLOB_BRACE : 0) | \GLOB_ONLYDIR | \GLOB_NOSORT)) {
645
+ sort($glob);
646
+ $resolvedDirs[] = array_map($this->normalizeDir(...), $glob);
647
+ } else {
648
+ throw new DirectoryNotFoundException(\sprintf('The "%s" directory does not exist.', $dir));
649
+ }
650
+ }
651
+
652
+ $this->dirs = array_merge($this->dirs, ...$resolvedDirs);
653
+
654
+ return $this;
655
+ }
656
+
657
+ /**
658
+ * Returns an Iterator for the current Finder configuration.
659
+ *
660
+ * This method implements the IteratorAggregate interface.
661
+ *
662
+ * @return \Iterator<non-empty-string, SplFileInfo>
663
+ *
664
+ * @throws \LogicException if the in() method has not been called
665
+ */
666
+ public function getIterator(): \Iterator
667
+ {
668
+ if (!$this->dirs && !$this->iterators) {
669
+ throw new \LogicException('You must call one of in() or append() methods before iterating over a Finder.');
670
+ }
671
+
672
+ if (1 === \count($this->dirs) && !$this->iterators) {
673
+ $iterator = $this->searchInDirectory($this->dirs[0]);
674
+ } else {
675
+ $iterator = new \AppendIterator();
676
+ foreach ($this->dirs as $dir) {
677
+ $iterator->append(new \IteratorIterator(new LazyIterator(fn () => $this->searchInDirectory($dir))));
678
+ }
679
+
680
+ foreach ($this->iterators as $it) {
681
+ $iterator->append(new \IteratorIterator(new LazyIterator(static function () use ($it) {
682
+ foreach ($it as $file) {
683
+ if (!$file instanceof \SplFileInfo) {
684
+ $file = new \SplFileInfo($file);
685
+ }
686
+ $key = $file->getPathname();
687
+ if (!$file instanceof SplFileInfo) {
688
+ $file = new SplFileInfo($key, $file->getPath(), $key);
689
+ }
690
+
691
+ yield $key => $file;
692
+ }
693
+ })));
694
+ }
695
+ }
696
+
697
+ if ($this->sort || $this->reverseSorting) {
698
+ $iterator = (new SortableIterator($iterator, $this->sort, $this->reverseSorting))->getIterator();
699
+ }
700
+
701
+ return $iterator;
702
+ }
703
+
704
+ /**
705
+ * Appends an existing set of files/directories to the finder.
706
+ *
707
+ * The set can be another Finder, an Iterator, an IteratorAggregate, or even a plain array.
708
+ *
709
+ * @param iterable<SplFileInfo|\SplFileInfo|string> $iterator
710
+ *
711
+ * @return $this
712
+ */
713
+ public function append(iterable $iterator): static
714
+ {
715
+ $this->iterators[] = $iterator;
716
+
717
+ return $this;
718
+ }
719
+
720
+ /**
721
+ * Check if any results were found.
722
+ */
723
+ public function hasResults(): bool
724
+ {
725
+ foreach ($this->getIterator() as $_) {
726
+ return true;
727
+ }
728
+
729
+ return false;
730
+ }
731
+
732
+ /**
733
+ * Counts all the results collected by the iterators.
734
+ */
735
+ public function count(): int
736
+ {
737
+ return iterator_count($this->getIterator());
738
+ }
739
+
740
+ private function searchInDirectory(string $dir): \Iterator
741
+ {
742
+ $exclude = $this->exclude;
743
+ $notPaths = $this->notPaths;
744
+
745
+ if ($this->pruneFilters) {
746
+ $exclude = array_merge($exclude, $this->pruneFilters);
747
+ }
748
+
749
+ if (static::IGNORE_VCS_FILES === (static::IGNORE_VCS_FILES & $this->ignore)) {
750
+ $exclude = array_merge($exclude, self::$vcsPatterns);
751
+ }
752
+
753
+ if (static::IGNORE_DOT_FILES === (static::IGNORE_DOT_FILES & $this->ignore)) {
754
+ $notPaths[] = '#(^|/)\..+(/|$)#';
755
+ }
756
+
757
+ $minDepth = 0;
758
+ $maxDepth = \PHP_INT_MAX;
759
+
760
+ foreach ($this->depths as $comparator) {
761
+ switch ($comparator->getOperator()) {
762
+ case '>':
763
+ $minDepth = $comparator->getTarget() + 1;
764
+ break;
765
+ case '>=':
766
+ $minDepth = $comparator->getTarget();
767
+ break;
768
+ case '<':
769
+ $maxDepth = $comparator->getTarget() - 1;
770
+ break;
771
+ case '<=':
772
+ $maxDepth = $comparator->getTarget();
773
+ break;
774
+ default:
775
+ $minDepth = $maxDepth = $comparator->getTarget();
776
+ }
777
+ }
778
+
779
+ $flags = \RecursiveDirectoryIterator::SKIP_DOTS;
780
+
781
+ if ($this->followLinks) {
782
+ $flags |= \RecursiveDirectoryIterator::FOLLOW_SYMLINKS;
783
+ }
784
+
785
+ $iterator = new Iterator\RecursiveDirectoryIterator($dir, $flags, $this->ignoreUnreadableDirs);
786
+
787
+ if ($exclude) {
788
+ $iterator = new ExcludeDirectoryFilterIterator($iterator, $exclude);
789
+ }
790
+
791
+ $iterator = new \RecursiveIteratorIterator($iterator, \RecursiveIteratorIterator::SELF_FIRST);
792
+
793
+ if ($minDepth > 0 || $maxDepth < \PHP_INT_MAX) {
794
+ $iterator = new DepthRangeFilterIterator($iterator, $minDepth, $maxDepth);
795
+ }
796
+
797
+ if ($this->mode) {
798
+ $iterator = new Iterator\FileTypeFilterIterator($iterator, $this->mode);
799
+ }
800
+
801
+ if ($this->names || $this->notNames) {
802
+ $iterator = new FilenameFilterIterator($iterator, $this->names, $this->notNames);
803
+ }
804
+
805
+ if ($this->contains || $this->notContains) {
806
+ $iterator = new FilecontentFilterIterator($iterator, $this->contains, $this->notContains);
807
+ }
808
+
809
+ if ($this->sizes) {
810
+ $iterator = new SizeRangeFilterIterator($iterator, $this->sizes);
811
+ }
812
+
813
+ if ($this->dates) {
814
+ $iterator = new DateRangeFilterIterator($iterator, $this->dates);
815
+ }
816
+
817
+ if ($this->filters) {
818
+ $iterator = new CustomFilterIterator($iterator, $this->filters);
819
+ }
820
+
821
+ if ($this->paths || $notPaths) {
822
+ $iterator = new Iterator\PathFilterIterator($iterator, $this->paths, $notPaths);
823
+ }
824
+
825
+ if (static::IGNORE_VCS_IGNORED_FILES === (static::IGNORE_VCS_IGNORED_FILES & $this->ignore)) {
826
+ $iterator = new Iterator\VcsIgnoredFilterIterator($iterator, $dir);
827
+ }
828
+
829
+ return $iterator;
830
+ }
831
+
832
+ /**
833
+ * Normalizes given directory names by removing trailing slashes.
834
+ *
835
+ * Excluding: (s)ftp:// or ssh2.(s)ftp:// wrapper
836
+ */
837
+ private function normalizeDir(string $dir): string
838
+ {
839
+ if ('/' === $dir) {
840
+ return $dir;
841
+ }
842
+
843
+ $dir = rtrim($dir, '/'.\DIRECTORY_SEPARATOR);
844
+
845
+ if (preg_match('#^(ssh2\.)?s?ftp://#', $dir)) {
846
+ $dir .= '/';
847
+ }
848
+
849
+ return $dir;
850
+ }
851
+ }