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.
- package/README.md +33 -0
- package/assets/demo.gif +0 -0
- package/dist/cli/{_events-BRGCap7g.mjs → _events-C60cNJ1W.mjs} +1 -1
- package/dist/cli/{index-9Oz-0bqF.mjs → index-D9syEMMz.mjs} +4 -4
- package/dist/cli/{index-CT4S2538.mjs → index-Ru6CUP6w.mjs} +24 -12
- package/dist/cli/{login-D4E3GoXe.mjs → login-C3QlGVbr.mjs} +1 -1
- package/dist/cli/{logout-DE-RoshK.mjs → logout-B63eZwJZ.mjs} +1 -1
- package/dist/cli/main.mjs +2 -1
- package/dist/cli/{resume-DLoXmzNG.mjs → resume-DQT_MK6A.mjs} +1 -1
- package/dist/cli/{set-B0L-QiXT.mjs → set-C805heQS.mjs} +1 -1
- package/dist/cli/{set-B8YYUENH.mjs → set-CjTbueyB.mjs} +1 -1
- package/dist/cli/{status-DEOAA0yx.mjs → status-SnKm1rRP.mjs} +1 -1
- package/dist/cli/{wp-CobSX6C6.mjs → wp-D0HZdudM.mjs} +1 -1
- package/dist/cli/wp-files/sqlite-command/composer.json +4 -3
- package/dist/cli/wp-files/sqlite-command/composer.lock +132 -80
- package/dist/cli/wp-files/sqlite-command/vendor/autoload.php +1 -1
- package/dist/cli/wp-files/sqlite-command/vendor/composer/autoload_classmap.php +58 -70
- package/dist/cli/wp-files/sqlite-command/vendor/composer/autoload_namespaces.php +1 -0
- package/dist/cli/wp-files/sqlite-command/vendor/composer/autoload_psr4.php +1 -1
- package/dist/cli/wp-files/sqlite-command/vendor/composer/autoload_real.php +5 -5
- package/dist/cli/wp-files/sqlite-command/vendor/composer/autoload_static.php +78 -80
- package/dist/cli/wp-files/sqlite-command/vendor/composer/installed.json +104 -49
- package/dist/cli/wp-files/sqlite-command/vendor/composer/installed.php +29 -16
- package/dist/cli/wp-files/sqlite-command/vendor/symfony/finder/CHANGELOG.md +103 -0
- package/dist/cli/wp-files/sqlite-command/vendor/symfony/finder/Comparator/Comparator.php +62 -0
- package/dist/cli/wp-files/sqlite-command/vendor/symfony/finder/Comparator/DateComparator.php +50 -0
- package/dist/cli/wp-files/sqlite-command/vendor/symfony/finder/Comparator/NumberComparator.php +78 -0
- package/dist/cli/wp-files/sqlite-command/vendor/symfony/finder/Exception/AccessDeniedException.php +19 -0
- package/dist/cli/wp-files/sqlite-command/vendor/symfony/finder/Exception/DirectoryNotFoundException.php +19 -0
- package/dist/cli/wp-files/sqlite-command/vendor/symfony/finder/Finder.php +851 -0
- package/dist/cli/wp-files/sqlite-command/vendor/symfony/finder/Gitignore.php +91 -0
- package/dist/cli/wp-files/sqlite-command/vendor/symfony/finder/Glob.php +116 -0
- package/dist/cli/wp-files/sqlite-command/vendor/symfony/finder/Iterator/CustomFilterIterator.php +61 -0
- package/dist/cli/wp-files/sqlite-command/vendor/symfony/finder/Iterator/DateRangeFilterIterator.php +58 -0
- package/dist/cli/wp-files/sqlite-command/vendor/symfony/finder/Iterator/DepthRangeFilterIterator.php +48 -0
- package/dist/cli/wp-files/sqlite-command/vendor/symfony/finder/Iterator/ExcludeDirectoryFilterIterator.php +110 -0
- package/dist/cli/wp-files/sqlite-command/vendor/symfony/finder/Iterator/FileTypeFilterIterator.php +51 -0
- package/dist/cli/wp-files/sqlite-command/vendor/symfony/finder/Iterator/FilecontentFilterIterator.php +58 -0
- package/dist/cli/wp-files/sqlite-command/vendor/symfony/finder/Iterator/FilenameFilterIterator.php +45 -0
- package/dist/cli/wp-files/sqlite-command/vendor/symfony/finder/Iterator/LazyIterator.php +32 -0
- package/dist/cli/wp-files/sqlite-command/vendor/symfony/finder/Iterator/MultiplePcreFilterIterator.php +107 -0
- package/dist/cli/wp-files/sqlite-command/vendor/symfony/finder/Iterator/PathFilterIterator.php +56 -0
- package/dist/cli/wp-files/sqlite-command/vendor/symfony/finder/Iterator/RecursiveDirectoryIterator.php +134 -0
- package/dist/cli/wp-files/sqlite-command/vendor/symfony/finder/Iterator/SizeRangeFilterIterator.php +57 -0
- package/dist/cli/wp-files/sqlite-command/vendor/symfony/finder/Iterator/SortableIterator.php +115 -0
- package/dist/cli/wp-files/sqlite-command/vendor/symfony/finder/Iterator/VcsIgnoredFilterIterator.php +173 -0
- package/dist/cli/wp-files/sqlite-command/vendor/symfony/finder/LICENSE +19 -0
- package/dist/cli/wp-files/sqlite-command/vendor/symfony/finder/README.md +14 -0
- package/dist/cli/wp-files/sqlite-command/vendor/symfony/finder/SplFileInfo.php +80 -0
- package/dist/cli/wp-files/sqlite-command/vendor/symfony/finder/composer.json +31 -0
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/mustache/.gitattributes +8 -0
- package/dist/cli/wp-files/sqlite-command/vendor/{mustache → wp-cli}/mustache/LICENSE +1 -1
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/mustache/README.md +76 -0
- package/dist/cli/wp-files/sqlite-command/vendor/{mustache → wp-cli}/mustache/composer.json +6 -16
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/mustache/src/Mustache/Autoloader.php +88 -0
- package/dist/cli/wp-files/sqlite-command/vendor/{mustache/mustache/src → wp-cli/mustache/src/Mustache}/Cache/AbstractCache.php +7 -15
- package/dist/cli/wp-files/sqlite-command/vendor/{mustache/mustache/src → wp-cli/mustache/src/Mustache}/Cache/FilesystemCache.php +15 -20
- package/dist/cli/wp-files/sqlite-command/vendor/{mustache/mustache/src → wp-cli/mustache/src/Mustache}/Cache/NoopCache.php +4 -8
- package/dist/cli/wp-files/sqlite-command/vendor/{mustache/mustache/src → wp-cli/mustache/src/Mustache}/Cache.php +7 -10
- package/dist/cli/wp-files/sqlite-command/vendor/{mustache/mustache/src → wp-cli/mustache/src/Mustache}/Compiler.php +87 -144
- package/dist/cli/wp-files/sqlite-command/vendor/{mustache/mustache/src → wp-cli/mustache/src/Mustache}/Context.php +19 -23
- package/dist/cli/wp-files/sqlite-command/vendor/{mustache/mustache/src → wp-cli/mustache/src/Mustache}/Engine.php +134 -251
- package/dist/cli/wp-files/sqlite-command/vendor/{mustache/mustache/src → wp-cli/mustache/src/Mustache}/Exception/InvalidArgumentException.php +2 -6
- package/dist/cli/wp-files/sqlite-command/vendor/{mustache/mustache/src → wp-cli/mustache/src/Mustache}/Exception/LogicException.php +2 -6
- package/dist/cli/wp-files/sqlite-command/vendor/{mustache/mustache/src → wp-cli/mustache/src/Mustache}/Exception/RuntimeException.php +2 -6
- package/dist/cli/wp-files/sqlite-command/vendor/{mustache/mustache/src → wp-cli/mustache/src/Mustache}/Exception/SyntaxException.php +8 -7
- package/dist/cli/wp-files/sqlite-command/vendor/{mustache/mustache/src → wp-cli/mustache/src/Mustache}/Exception/UnknownFilterException.php +7 -7
- package/dist/cli/wp-files/sqlite-command/vendor/{mustache/mustache/src → wp-cli/mustache/src/Mustache}/Exception/UnknownHelperException.php +7 -7
- package/dist/cli/wp-files/sqlite-command/vendor/{mustache/mustache/src → wp-cli/mustache/src/Mustache}/Exception/UnknownTemplateException.php +7 -7
- package/dist/cli/wp-files/sqlite-command/vendor/{mustache/mustache/src → wp-cli/mustache/src/Mustache}/Exception.php +5 -4
- package/dist/cli/wp-files/sqlite-command/vendor/{mustache/mustache/src → wp-cli/mustache/src/Mustache}/HelperCollection.php +17 -22
- package/dist/cli/wp-files/sqlite-command/vendor/{mustache/mustache/src → wp-cli/mustache/src/Mustache}/LambdaHelper.php +8 -28
- package/dist/cli/wp-files/sqlite-command/vendor/{mustache/mustache/src → wp-cli/mustache/src/Mustache}/Loader/ArrayLoader.php +9 -12
- package/dist/cli/wp-files/sqlite-command/vendor/{mustache/mustache/src → wp-cli/mustache/src/Mustache}/Loader/CascadingLoader.php +15 -18
- package/dist/cli/wp-files/sqlite-command/vendor/{mustache/mustache/src → wp-cli/mustache/src/Mustache}/Loader/FilesystemLoader.php +18 -24
- package/dist/cli/wp-files/sqlite-command/vendor/{mustache/mustache/src → wp-cli/mustache/src/Mustache}/Loader/InlineLoader.php +13 -19
- package/dist/cli/wp-files/sqlite-command/vendor/{mustache/mustache/src → wp-cli/mustache/src/Mustache}/Loader/MutableLoader.php +7 -4
- package/dist/cli/wp-files/sqlite-command/vendor/{mustache/mustache/src → wp-cli/mustache/src/Mustache}/Loader/ProductionFilesystemLoader.php +16 -23
- package/dist/cli/wp-files/sqlite-command/vendor/{mustache/mustache/src → wp-cli/mustache/src/Mustache}/Loader/StringLoader.php +4 -8
- package/dist/cli/wp-files/sqlite-command/vendor/{mustache/mustache/src → wp-cli/mustache/src/Mustache}/Loader.php +7 -8
- package/dist/cli/wp-files/sqlite-command/vendor/{mustache/mustache/src → wp-cli/mustache/src/Mustache}/Logger/AbstractLogger.php +26 -22
- package/dist/cli/wp-files/sqlite-command/vendor/{mustache/mustache/src → wp-cli/mustache/src/Mustache}/Logger/StreamLogger.php +20 -25
- package/dist/cli/wp-files/sqlite-command/vendor/{mustache/mustache/src → wp-cli/mustache/src/Mustache}/Logger.php +37 -13
- package/dist/cli/wp-files/sqlite-command/vendor/{mustache/mustache/src → wp-cli/mustache/src/Mustache}/Parser.php +93 -100
- package/dist/cli/wp-files/sqlite-command/vendor/{mustache/mustache/src → wp-cli/mustache/src/Mustache}/Source/FilesystemSource.php +7 -11
- package/dist/cli/wp-files/sqlite-command/vendor/{mustache/mustache/src → wp-cli/mustache/src/Mustache}/Source.php +5 -4
- package/dist/cli/wp-files/sqlite-command/vendor/{mustache/mustache/src → wp-cli/mustache/src/Mustache}/Template.php +32 -39
- package/dist/cli/wp-files/sqlite-command/vendor/{mustache/mustache/src → wp-cli/mustache/src/Mustache}/Tokenizer.php +29 -33
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/.actrc +3 -0
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/.gitattributes +6 -0
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/.mailmap +234 -0
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/README.md +4 -4
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/VERSION +1 -1
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/bundle/rmccue/requests/CHANGELOG.md +0 -65
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/bundle/rmccue/requests/README.md +1 -2
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/bundle/rmccue/requests/certificates/cacert.pem +372 -315
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/bundle/rmccue/requests/certificates/cacert.pem.sha256 +1 -1
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/bundle/rmccue/requests/composer.json +5 -7
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/bundle/rmccue/requests/src/Iri.php +18 -20
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/bundle/rmccue/requests/src/Requests.php +1 -1
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/bundle/rmccue/requests/src/Response/Headers.php +1 -1
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/bundle/rmccue/requests/src/Transport/Curl.php +1 -5
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/bundle/rmccue/requests/src/Transport/Fsockopen.php +0 -2
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/bundle/rmccue/requests/src/Utility/CaseInsensitiveDictionary.php +0 -12
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/bundle/rmccue/requests/src/Utility/FilteredIterator.php +2 -2
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/composer.json +13 -30
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/dependencies.yml +6 -0
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/manifest.json +1 -1
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/Autoloader.php +2 -4
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/Bootstrap/AutoloaderStep.php +1 -10
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/Bootstrap/CheckRoot.php +2 -20
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/Bootstrap/DefineProtectedCommands.php +3 -3
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/Bootstrap/IncludeFrameworkAutoloader.php +4 -3
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/Bootstrap/IncludeRequestsAutoloader.php +3 -4
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/Bootstrap/InitializeContexts.php +0 -3
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/Bootstrap/InitializeLogger.php +1 -1
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/Bootstrap/LaunchRunner.php +3 -6
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/Bootstrap/{RegisterShutdownHandler.php → LoadDispatcher.php} +4 -6
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/Bootstrap/LoadRequiredCommand.php +5 -9
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/Bootstrap/LoadUtilityFunctions.php +0 -1
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/Completions.php +6 -149
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/Configurator.php +49 -202
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/Context/Admin.php +21 -113
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/Context/Auto.php +1 -1
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/Context/Cli.php +1 -0
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/Context/Frontend.php +1 -0
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/Dispatcher/CommandFactory.php +26 -63
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/Dispatcher/CompositeCommand.php +9 -19
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/Dispatcher/Subcommand.php +19 -284
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/DocParser.php +5 -17
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/Exception/NonExistentKeyException.php +3 -6
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/Extractor.php +54 -30
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/Fetchers/Base.php +3 -7
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/Fetchers/Comment.php +2 -4
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/Fetchers/Post.php +3 -8
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/Fetchers/Signup.php +1 -3
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/Fetchers/Site.php +4 -12
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/Fetchers/User.php +1 -3
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/FileCache.php +33 -135
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/Formatter.php +57 -221
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/Inflector.php +4 -4
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/Iterators/CSV.php +1 -6
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/Iterators/Query.php +1 -3
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/Iterators/Table.php +1 -7
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/Iterators/Transform.php +0 -2
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/Loggers/Base.php +0 -15
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/Loggers/Quiet.php +3 -2
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/Loggers/Regular.php +3 -4
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/NoOp.php +0 -4
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/Process.php +7 -40
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/RequestsLibrary.php +1 -4
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php +234 -795
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/SynopsisParser.php +26 -116
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/SynopsisValidator.php +1 -1
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/Traverser/RecursiveDataStructureTraverser.php +26 -69
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/UpgraderSkin.php +1 -1
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/WpHttpCacheManager.php +5 -67
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/WpOrgApi.php +3 -3
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/boot-fs.php +2 -2
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/bootstrap.php +2 -5
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/class-wp-cli.php +62 -311
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/commands/src/CLI_Alias_Command.php +60 -292
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/commands/src/CLI_Cache_Command.php +1 -1
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/commands/src/CLI_Command.php +31 -191
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/commands/src/Help_Command.php +35 -177
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/config-spec.php +4 -28
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/utils-wp.php +47 -81
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/utils.php +200 -512
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/wp-cli.php +2 -2
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/wp-settings-cli.php +465 -0
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/templates/man-params.mustache +4 -0
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/templates/man.mustache +0 -8
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/tests/ArgValidationTest.php +74 -0
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/tests/CommandFactoryTest.php +420 -0
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/tests/ConfiguratorTest.php +87 -0
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/tests/DocParserTest.php +213 -0
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/tests/ExtractorTest.php +293 -0
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/tests/FileCacheTest.php +207 -0
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/tests/HelpTest.php +119 -0
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/tests/InflectorTest.php +37 -0
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/tests/LoggingTest.php +124 -0
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/tests/ProcessTest.php +30 -0
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/tests/SynopsisParserTest.php +194 -0
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/tests/UtilsTest.php +1092 -0
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/tests/WPCLITest.php +16 -0
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/tests/WP_CLI/Iterators/CSVTest.php +109 -0
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/tests/WP_CLI/Traversers/RecursiveDataStructureTraverserTest.php +151 -0
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/tests/WP_CLI/WpOrgApiTest.php +166 -0
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/tests/WpVersionCompareTest.php +78 -0
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/tests/bootstrap.php +17 -0
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/tests/data/commandfactory-doc_comment-class-win.php +70 -0
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/tests/data/commandfactory-doc_comment-class.php +70 -0
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/tests/data/commandfactory-doc_comment-function-win.php +19 -0
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/tests/data/commandfactory-doc_comment-function.php +19 -0
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/tests/data/expand_globs/bar.ab2 +0 -0
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/tests/data/expand_globs/baz.ab1 +0 -0
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/tests/data/expand_globs/baz.ac1 +0 -0
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/tests/data/expand_globs/baz.efg2 +0 -0
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/tests/data/expand_globs/foo.ab1 +0 -0
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/tests/data/expand_globs/foo.ab2 +0 -0
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/tests/data/expand_globs/foo.efg1 +0 -0
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/tests/data/expand_globs/foo.efg2 +0 -0
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/tests/mock-requests-transport.php +34 -0
- package/dist/cli/wp-files/sqlite-command/version +1 -1
- package/package.json +4 -3
- package/dist/cli/wp-files/sqlite-command/vendor/mustache/mustache/.php-cs-fixer.php +0 -20
- package/dist/cli/wp-files/sqlite-command/vendor/mustache/mustache/README.md +0 -94
- package/dist/cli/wp-files/sqlite-command/vendor/mustache/mustache/src/RenderedString.php +0 -51
- package/dist/cli/wp-files/sqlite-command/vendor/mustache/mustache/src/compat.php +0 -282
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/.typos.toml +0 -14
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/AGENTS.md +0 -121
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/bundle/rmccue/requests/scripts/proxy/proxy.py +0 -5
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/bundle/rmccue/requests/scripts/proxy/start.sh +0 -19
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/bundle/rmccue/requests/scripts/proxy/stop.sh +0 -10
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/Path.php +0 -260
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/php/WP_CLI/ShutdownHandler.php +0 -329
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/schemas/wp-cli-config.json +0 -218
- package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/schemas/wp-cli.example.yml +0 -55
- /package/dist/cli/wp-files/sqlite-command/vendor/wp-cli/wp-cli/{codecov.yml → tests/data/expand_globs/bar.ab1} +0 -0
|
@@ -13,7 +13,6 @@ use WP_CLI\DocParser;
|
|
|
13
13
|
use WP_CLI\ExitException;
|
|
14
14
|
use WP_CLI\FileCache;
|
|
15
15
|
use WP_CLI\Loggers\Execution;
|
|
16
|
-
use WP_CLI\Path;
|
|
17
16
|
use WP_CLI\Process;
|
|
18
17
|
use WP_CLI\ProcessRun;
|
|
19
18
|
use WP_CLI\Runner;
|
|
@@ -23,15 +22,6 @@ use WP_CLI\WpHttpCacheManager;
|
|
|
23
22
|
|
|
24
23
|
/**
|
|
25
24
|
* Various utilities for WP-CLI commands.
|
|
26
|
-
*
|
|
27
|
-
* @phpstan-type GlobalConfig array{path: string|null, ssh: string|null, 'ssh-args': string[], http: string|null, url: string|null, user: string|null, 'skip-plugins': true|string[], 'skip-themes': true|string[], 'skip-packages': bool, require: string[], exec: string[], context: string, debug: string|true, prompt: false|string, quiet: bool, apache_modules: string[], 'assume-https': bool}
|
|
28
|
-
*
|
|
29
|
-
* @phpstan-type FlagParameter array{type: 'flag', name: string, description?: string, optional?: bool, repeating?: bool, aliases?: string[]}
|
|
30
|
-
* @phpstan-type AssocParameter array{type: 'assoc', name: string, description?: string, options?: string[], default?: string, optional?: bool, value: array{optional: bool, name?: string}, repeating?: bool, aliases?: string[]}
|
|
31
|
-
* @phpstan-type PositionalParameter array{type: 'positional', name: string, description?: string, optional?: bool, repeating?: bool}
|
|
32
|
-
* @phpstan-type GenericParameter array{type: 'generic', optional?: bool, repeating?: bool}
|
|
33
|
-
* @phpstan-type UnknownParameter array{type:'unknown', optional?: bool, repeating?: bool}
|
|
34
|
-
* @phpstan-type CommandSynopsis FlagParameter|AssocParameter|PositionalParameter|GenericParameter|UnknownParameter
|
|
35
25
|
*/
|
|
36
26
|
class WP_CLI {
|
|
37
27
|
|
|
@@ -45,13 +35,6 @@ class WP_CLI {
|
|
|
45
35
|
|
|
46
36
|
private static $deferred_additions = [];
|
|
47
37
|
|
|
48
|
-
/**
|
|
49
|
-
* Cached list of global argument names.
|
|
50
|
-
*
|
|
51
|
-
* @var array|null
|
|
52
|
-
*/
|
|
53
|
-
private static $global_arg_names;
|
|
54
|
-
|
|
55
38
|
/**
|
|
56
39
|
* Set the logger instance.
|
|
57
40
|
*
|
|
@@ -85,9 +68,6 @@ class WP_CLI {
|
|
|
85
68
|
return $configurator;
|
|
86
69
|
}
|
|
87
70
|
|
|
88
|
-
/**
|
|
89
|
-
* @return RootCommand
|
|
90
|
-
*/
|
|
91
71
|
public static function get_root_command() {
|
|
92
72
|
static $root;
|
|
93
73
|
|
|
@@ -116,8 +96,8 @@ class WP_CLI {
|
|
|
116
96
|
|
|
117
97
|
if ( ! $cache ) {
|
|
118
98
|
$dir = Utils\get_cache_dir();
|
|
119
|
-
$ttl = (
|
|
120
|
-
$max_size = (
|
|
99
|
+
$ttl = getenv( 'WP_CLI_CACHE_EXPIRY' ) ? : 15552000;
|
|
100
|
+
$max_size = getenv( 'WP_CLI_CACHE_MAX_SIZE' ) ? : 314572800;
|
|
121
101
|
// 6 months, 300mb
|
|
122
102
|
$cache = new FileCache( $dir, $ttl, $max_size );
|
|
123
103
|
|
|
@@ -152,8 +132,6 @@ class WP_CLI {
|
|
|
152
132
|
if ( isset( $url_parts['host'] ) ) {
|
|
153
133
|
if ( isset( $url_parts['scheme'] ) && 'https' === strtolower( $url_parts['scheme'] ) ) {
|
|
154
134
|
$_SERVER['HTTPS'] = 'on';
|
|
155
|
-
} elseif ( ! self::get_config( 'assume-https' ) ) {
|
|
156
|
-
unset( $_SERVER['HTTPS'] );
|
|
157
135
|
}
|
|
158
136
|
|
|
159
137
|
$_SERVER['HTTP_HOST'] = $url_parts['host'];
|
|
@@ -282,8 +260,8 @@ class WP_CLI {
|
|
|
282
260
|
* @access public
|
|
283
261
|
* @category Registration
|
|
284
262
|
*
|
|
285
|
-
* @param string
|
|
286
|
-
* @param
|
|
263
|
+
* @param string $when Identifier for the hook.
|
|
264
|
+
* @param mixed $callback Callback to execute when hook is called.
|
|
287
265
|
* @return void
|
|
288
266
|
*/
|
|
289
267
|
public static function add_hook( $when, $callback ) {
|
|
@@ -376,10 +354,10 @@ class WP_CLI {
|
|
|
376
354
|
* @access public
|
|
377
355
|
* @category Registration
|
|
378
356
|
*
|
|
379
|
-
* @param string
|
|
380
|
-
* @param
|
|
381
|
-
* @param integer
|
|
382
|
-
* @param integer
|
|
357
|
+
* @param string $tag Named WordPress action or filter.
|
|
358
|
+
* @param mixed $function_to_add Callable to execute when the action or filter is evaluated.
|
|
359
|
+
* @param integer $priority Priority to add the callback as.
|
|
360
|
+
* @param integer $accepted_args Number of arguments to pass to callback.
|
|
383
361
|
* @return true
|
|
384
362
|
*/
|
|
385
363
|
public static function add_wp_hook( $tag, $function_to_add, $priority = 10, $accepted_args = 1 ) {
|
|
@@ -428,14 +406,11 @@ class WP_CLI {
|
|
|
428
406
|
}
|
|
429
407
|
|
|
430
408
|
$obj_idx = get_class( $function[0] ) . $function[1];
|
|
431
|
-
// @phpstan-ignore property.notFound
|
|
432
409
|
if ( ! isset( $function[0]->wp_filter_id ) ) {
|
|
433
410
|
if ( false === $priority ) {
|
|
434
411
|
return false;
|
|
435
412
|
}
|
|
436
|
-
$obj_idx
|
|
437
|
-
|
|
438
|
-
// @phpstan-ignore property.notFound
|
|
413
|
+
$obj_idx .= isset( $wp_filter[ $tag ][ $priority ] ) ? count( (array) $wp_filter[ $tag ][ $priority ] ) : $filter_id_count;
|
|
439
414
|
$function[0]->wp_filter_id = $filter_id_count;
|
|
440
415
|
++$filter_id_count;
|
|
441
416
|
} else {
|
|
@@ -487,9 +462,9 @@ class WP_CLI {
|
|
|
487
462
|
* @access public
|
|
488
463
|
* @category Registration
|
|
489
464
|
*
|
|
490
|
-
* @param string
|
|
491
|
-
* @param callable|object|string
|
|
492
|
-
* @param array
|
|
465
|
+
* @param string $name Name for the command (e.g. "post list" or "site empty").
|
|
466
|
+
* @param callable|object|string $callable Command implementation as a class, function or closure.
|
|
467
|
+
* @param array $args {
|
|
493
468
|
* Optional. An associative array with additional registration parameters.
|
|
494
469
|
*
|
|
495
470
|
* @type callable $before_invoke Callback to execute before invoking the command.
|
|
@@ -501,8 +476,6 @@ class WP_CLI {
|
|
|
501
476
|
* @type bool $is_deferred Whether the command addition had already been deferred.
|
|
502
477
|
* }
|
|
503
478
|
* @return bool True on success, false if deferred, hard error if registration failed.
|
|
504
|
-
*
|
|
505
|
-
* @phpstan-param array{before_invoke?: callable, after_invoke?: callable, shortdesc?: string, longdesc?: string, synopsis?: string|CommandSynopsis[], when?: string, is_deferred?: bool} $args
|
|
506
479
|
*/
|
|
507
480
|
public static function add_command( $name, $callable, $args = [] ) {
|
|
508
481
|
// Bail immediately if the WP-CLI executable has not been run.
|
|
@@ -513,11 +486,11 @@ class WP_CLI {
|
|
|
513
486
|
$valid = false;
|
|
514
487
|
if ( is_callable( $callable ) ) {
|
|
515
488
|
$valid = true;
|
|
516
|
-
} elseif ( is_string( $callable ) && class_exists( $callable ) ) {
|
|
489
|
+
} elseif ( is_string( $callable ) && class_exists( (string) $callable ) ) {
|
|
517
490
|
$valid = true;
|
|
518
491
|
} elseif ( is_object( $callable ) ) {
|
|
519
492
|
$valid = true;
|
|
520
|
-
} elseif (
|
|
493
|
+
} elseif ( Utils\is_valid_class_and_method_pair( $callable ) ) {
|
|
521
494
|
$valid = true;
|
|
522
495
|
}
|
|
523
496
|
if ( ! $valid ) {
|
|
@@ -542,9 +515,9 @@ class WP_CLI {
|
|
|
542
515
|
}
|
|
543
516
|
}
|
|
544
517
|
|
|
545
|
-
$path = preg_split( '/\s+/', $name )
|
|
518
|
+
$path = preg_split( '/\s+/', $name );
|
|
546
519
|
|
|
547
|
-
$leaf_name =
|
|
520
|
+
$leaf_name = array_pop( $path );
|
|
548
521
|
|
|
549
522
|
$command = self::get_root_command();
|
|
550
523
|
|
|
@@ -572,10 +545,6 @@ class WP_CLI {
|
|
|
572
545
|
} else {
|
|
573
546
|
self::debug( "Deferring command: {$name}", 'commands' );
|
|
574
547
|
|
|
575
|
-
/**
|
|
576
|
-
* @var callable $callable
|
|
577
|
-
*/
|
|
578
|
-
|
|
579
548
|
self::defer_command_addition(
|
|
580
549
|
$name,
|
|
581
550
|
$parent,
|
|
@@ -646,9 +615,9 @@ class WP_CLI {
|
|
|
646
615
|
$long_desc .= ': ' . $arg['description'] . "\n";
|
|
647
616
|
}
|
|
648
617
|
$yamlify = [];
|
|
649
|
-
foreach ( [ 'default', 'options' ] as $
|
|
650
|
-
if ( isset( $arg[ $
|
|
651
|
-
$yamlify[ $
|
|
618
|
+
foreach ( [ 'default', 'options' ] as $key ) {
|
|
619
|
+
if ( isset( $arg[ $key ] ) ) {
|
|
620
|
+
$yamlify[ $key ] = $arg[ $key ];
|
|
652
621
|
}
|
|
653
622
|
}
|
|
654
623
|
if ( ! empty( $yamlify ) ) {
|
|
@@ -672,12 +641,11 @@ class WP_CLI {
|
|
|
672
641
|
self::get_runner()->register_early_invoke( $args['when'], $leaf_command );
|
|
673
642
|
}
|
|
674
643
|
|
|
675
|
-
$command_type = $leaf_command instanceof CommandNamespace ? 'namespace' : 'command';
|
|
676
644
|
if ( ! empty( $parent ) ) {
|
|
677
645
|
$sub_command = trim( str_replace( $parent, '', $name ) );
|
|
678
|
-
self::debug( "Adding
|
|
646
|
+
self::debug( "Adding command: {$sub_command} in {$parent} Namespace", 'commands' );
|
|
679
647
|
} else {
|
|
680
|
-
self::debug( "Adding
|
|
648
|
+
self::debug( "Adding command: {$name}", 'commands' );
|
|
681
649
|
}
|
|
682
650
|
|
|
683
651
|
$command->add_subcommand( $leaf_name, $leaf_command );
|
|
@@ -712,10 +680,10 @@ class WP_CLI {
|
|
|
712
680
|
* Defer command addition for a sub-command if the parent command is not yet
|
|
713
681
|
* registered.
|
|
714
682
|
*
|
|
715
|
-
* @param string
|
|
716
|
-
* @param string
|
|
717
|
-
* @param
|
|
718
|
-
* @param array
|
|
683
|
+
* @param string $name Name for the sub-command.
|
|
684
|
+
* @param string $parent Name for the parent command.
|
|
685
|
+
* @param string $callable Command implementation as a class, function or closure.
|
|
686
|
+
* @param array $args Optional. See `WP_CLI::add_command()` for details.
|
|
719
687
|
*/
|
|
720
688
|
private static function defer_command_addition( $name, $parent, $callable, $args = [] ) {
|
|
721
689
|
$args['is_deferred'] = true;
|
|
@@ -762,87 +730,6 @@ class WP_CLI {
|
|
|
762
730
|
unset( self::$deferred_additions[ $name ] );
|
|
763
731
|
}
|
|
764
732
|
|
|
765
|
-
/**
|
|
766
|
-
* Check if a command's arguments conflict with global arguments.
|
|
767
|
-
*
|
|
768
|
-
* Issues warnings for any command arguments that have the same name as
|
|
769
|
-
* global WP-CLI arguments (e.g., --debug, --user, --quiet).
|
|
770
|
-
*
|
|
771
|
-
* @param string $command_name The name of the command being registered.
|
|
772
|
-
* @param Dispatcher\Subcommand $command The command object to check.
|
|
773
|
-
*/
|
|
774
|
-
public static function check_global_arg_conflicts( $command_name, $command ) {
|
|
775
|
-
$synopsis = $command->get_synopsis();
|
|
776
|
-
if ( ! $synopsis ) {
|
|
777
|
-
return;
|
|
778
|
-
}
|
|
779
|
-
|
|
780
|
-
// Check if command has opted out of this check
|
|
781
|
-
if ( self::command_skips_global_arg_check( $command ) ) {
|
|
782
|
-
return;
|
|
783
|
-
}
|
|
784
|
-
|
|
785
|
-
// Get global argument names from config spec (cached)
|
|
786
|
-
if ( null === self::$global_arg_names ) {
|
|
787
|
-
self::$global_arg_names = [];
|
|
788
|
-
foreach ( self::get_configurator()->get_spec() as $key => $details ) {
|
|
789
|
-
if ( false === $details['runtime'] ) {
|
|
790
|
-
continue;
|
|
791
|
-
}
|
|
792
|
-
if ( isset( $details['deprecated'] ) ) {
|
|
793
|
-
continue;
|
|
794
|
-
}
|
|
795
|
-
if ( isset( $details['hidden'] ) ) {
|
|
796
|
-
continue;
|
|
797
|
-
}
|
|
798
|
-
self::$global_arg_names[] = $key;
|
|
799
|
-
}
|
|
800
|
-
}
|
|
801
|
-
|
|
802
|
-
// Parse the command's synopsis to get its argument names
|
|
803
|
-
$synopsis_params = SynopsisParser::parse( $synopsis );
|
|
804
|
-
$conflicts = [];
|
|
805
|
-
|
|
806
|
-
foreach ( $synopsis_params as $param ) {
|
|
807
|
-
// Check assoc and flag types; generic type has no specific name to conflict
|
|
808
|
-
if ( in_array( $param['type'], [ 'assoc', 'flag' ], true ) && isset( $param['name'] ) ) {
|
|
809
|
-
if ( in_array( $param['name'], self::$global_arg_names, true ) ) {
|
|
810
|
-
$conflicts[] = $param['name'];
|
|
811
|
-
}
|
|
812
|
-
}
|
|
813
|
-
}
|
|
814
|
-
|
|
815
|
-
// Warn about any conflicts found
|
|
816
|
-
foreach ( $conflicts as $conflict ) {
|
|
817
|
-
self::warning(
|
|
818
|
-
sprintf(
|
|
819
|
-
"The `%s` command is registering an argument '--%s' that conflicts with a global argument of the same name.",
|
|
820
|
-
$command_name,
|
|
821
|
-
$conflict
|
|
822
|
-
)
|
|
823
|
-
);
|
|
824
|
-
}
|
|
825
|
-
}
|
|
826
|
-
|
|
827
|
-
/**
|
|
828
|
-
* Check if a command has opted out of global argument conflict checking.
|
|
829
|
-
*
|
|
830
|
-
* Commands can use the @skipglobalargcheck tag in their PHPdoc to disable
|
|
831
|
-
* the warning for global argument conflicts.
|
|
832
|
-
*
|
|
833
|
-
* @param Dispatcher\Subcommand $command The command object to check.
|
|
834
|
-
* @return bool True if the command should skip the check, false otherwise.
|
|
835
|
-
*/
|
|
836
|
-
private static function command_skips_global_arg_check( $command ) {
|
|
837
|
-
$docparser = $command->get_docparser();
|
|
838
|
-
|
|
839
|
-
if ( ! $docparser ) {
|
|
840
|
-
return false;
|
|
841
|
-
}
|
|
842
|
-
|
|
843
|
-
return $docparser->has_tag( 'skipglobalargcheck' );
|
|
844
|
-
}
|
|
845
|
-
|
|
846
733
|
/**
|
|
847
734
|
* Display informational message without prefix, and ignore `--quiet`.
|
|
848
735
|
*
|
|
@@ -853,11 +740,10 @@ class WP_CLI {
|
|
|
853
740
|
* @category Output
|
|
854
741
|
*
|
|
855
742
|
* @param string $message Message to display to the end user.
|
|
856
|
-
* @param bool $newline Optional. Whether to append a newline to the end of the message. Default true.
|
|
857
743
|
* @return void
|
|
858
744
|
*/
|
|
859
|
-
public static function line( $message = ''
|
|
860
|
-
echo $message .
|
|
745
|
+
public static function line( $message = '' ) {
|
|
746
|
+
echo $message . "\n";
|
|
861
747
|
}
|
|
862
748
|
|
|
863
749
|
/**
|
|
@@ -874,14 +760,13 @@ class WP_CLI {
|
|
|
874
760
|
* @category Output
|
|
875
761
|
*
|
|
876
762
|
* @param string $message Message to write to STDOUT.
|
|
877
|
-
* @param bool $newline Optional. Whether to append a newline to the end of the message. Default true.
|
|
878
763
|
*/
|
|
879
|
-
public static function log( $message
|
|
764
|
+
public static function log( $message ) {
|
|
880
765
|
if ( null === self::$logger ) {
|
|
881
766
|
return;
|
|
882
767
|
}
|
|
883
768
|
|
|
884
|
-
self::$logger->info( $message
|
|
769
|
+
self::$logger->info( $message );
|
|
885
770
|
}
|
|
886
771
|
|
|
887
772
|
/**
|
|
@@ -1005,10 +890,6 @@ class WP_CLI {
|
|
|
1005
890
|
* Use `WP_CLI::warning()` instead when script execution should be permitted
|
|
1006
891
|
* to continue.
|
|
1007
892
|
*
|
|
1008
|
-
* When `--debug` is enabled, this method will also output a backtrace
|
|
1009
|
-
* showing where the error was triggered from, making it easier to identify
|
|
1010
|
-
* problematic code.
|
|
1011
|
-
*
|
|
1012
893
|
* ```
|
|
1013
894
|
* # `wp cache flush` considers flush failure to be a fatal error.
|
|
1014
895
|
* if ( false === wp_cache_flush() ) {
|
|
@@ -1020,10 +901,8 @@ class WP_CLI {
|
|
|
1020
901
|
* @category Output
|
|
1021
902
|
*
|
|
1022
903
|
* @param string|WP_Error|Exception|Throwable $message Message to write to STDERR.
|
|
1023
|
-
* @param boolean|
|
|
904
|
+
* @param boolean|integer $exit True defaults to exit(1).
|
|
1024
905
|
* @return null
|
|
1025
|
-
*
|
|
1026
|
-
* @phpstan-return ($exit is true|positive-int ? never : void)
|
|
1027
906
|
*/
|
|
1028
907
|
public static function error( $message, $exit = true ) {
|
|
1029
908
|
if ( null !== self::$logger && ! isset( self::get_runner()->assoc_args['completions'] ) ) {
|
|
@@ -1038,7 +917,6 @@ class WP_CLI {
|
|
|
1038
917
|
}
|
|
1039
918
|
|
|
1040
919
|
if ( $return_code ) {
|
|
1041
|
-
self::debug_backtrace_on_exit();
|
|
1042
920
|
if ( self::$capture_exit ) {
|
|
1043
921
|
throw new ExitException( '', $return_code );
|
|
1044
922
|
}
|
|
@@ -1051,10 +929,6 @@ class WP_CLI {
|
|
|
1051
929
|
*
|
|
1052
930
|
* Permits script execution to be overloaded by `WP_CLI::runcommand()`
|
|
1053
931
|
*
|
|
1054
|
-
* When `--debug` is enabled, this method will also output a backtrace
|
|
1055
|
-
* showing where the halt was triggered from, making it easier to identify
|
|
1056
|
-
* the cause of early termination.
|
|
1057
|
-
*
|
|
1058
932
|
* @access public
|
|
1059
933
|
* @category Output
|
|
1060
934
|
*
|
|
@@ -1062,7 +936,6 @@ class WP_CLI {
|
|
|
1062
936
|
* @return never
|
|
1063
937
|
*/
|
|
1064
938
|
public static function halt( $return_code ) {
|
|
1065
|
-
self::debug_backtrace_on_exit();
|
|
1066
939
|
if ( self::$capture_exit ) {
|
|
1067
940
|
throw new ExitException( '', $return_code );
|
|
1068
941
|
}
|
|
@@ -1077,7 +950,7 @@ class WP_CLI {
|
|
|
1077
950
|
* @access public
|
|
1078
951
|
* @category Output
|
|
1079
952
|
*
|
|
1080
|
-
* @param array
|
|
953
|
+
* @param array $message_lines Multi-line error message to be displayed.
|
|
1081
954
|
*/
|
|
1082
955
|
public static function error_multi_line( $message_lines ) {
|
|
1083
956
|
if ( null === self::$logger ) {
|
|
@@ -1085,14 +958,7 @@ class WP_CLI {
|
|
|
1085
958
|
}
|
|
1086
959
|
|
|
1087
960
|
if ( ! isset( self::get_runner()->assoc_args['completions'] ) && is_array( $message_lines ) ) {
|
|
1088
|
-
self::$logger->error_multi_line(
|
|
1089
|
-
array_map(
|
|
1090
|
-
static function ( $message ) {
|
|
1091
|
-
return self::error_to_string( $message );
|
|
1092
|
-
},
|
|
1093
|
-
$message_lines
|
|
1094
|
-
)
|
|
1095
|
-
);
|
|
961
|
+
self::$logger->error_multi_line( array_map( [ __CLASS__, 'error_to_string' ], $message_lines ) );
|
|
1096
962
|
}
|
|
1097
963
|
}
|
|
1098
964
|
|
|
@@ -1118,7 +984,7 @@ class WP_CLI {
|
|
|
1118
984
|
if ( ! Utils\get_flag_value( $assoc_args, 'yes' ) ) {
|
|
1119
985
|
fwrite( STDOUT, $question . ' [y/n] ' );
|
|
1120
986
|
|
|
1121
|
-
$answer = strtolower( trim(
|
|
987
|
+
$answer = strtolower( trim( fgets( STDIN ) ) );
|
|
1122
988
|
|
|
1123
989
|
if ( 'y' !== $answer ) {
|
|
1124
990
|
exit;
|
|
@@ -1136,7 +1002,7 @@ class WP_CLI {
|
|
|
1136
1002
|
*/
|
|
1137
1003
|
public static function get_value_from_arg_or_stdin( $args, $index ) {
|
|
1138
1004
|
if ( isset( $args[ $index ] ) ) {
|
|
1139
|
-
$raw_value =
|
|
1005
|
+
$raw_value = $args[ $index ];
|
|
1140
1006
|
} else {
|
|
1141
1007
|
// We don't use file_get_contents() here because it doesn't handle
|
|
1142
1008
|
// Ctrl-D properly, when typing in the value interactively.
|
|
@@ -1158,7 +1024,7 @@ class WP_CLI {
|
|
|
1158
1024
|
* @access public
|
|
1159
1025
|
* @category Input
|
|
1160
1026
|
*
|
|
1161
|
-
* @param
|
|
1027
|
+
* @param mixed $raw_value
|
|
1162
1028
|
* @param array $assoc_args
|
|
1163
1029
|
*/
|
|
1164
1030
|
public static function read_value( $raw_value, $assoc_args = [] ) {
|
|
@@ -1181,24 +1047,15 @@ class WP_CLI {
|
|
|
1181
1047
|
* @param array $assoc_args Arguments passed to the command, determining format.
|
|
1182
1048
|
*/
|
|
1183
1049
|
public static function print_value( $value, $assoc_args = [] ) {
|
|
1184
|
-
$_value = '';
|
|
1185
1050
|
if ( Utils\get_flag_value( $assoc_args, 'format' ) === 'json' ) {
|
|
1186
|
-
$
|
|
1051
|
+
$value = json_encode( $value );
|
|
1187
1052
|
} elseif ( Utils\get_flag_value( $assoc_args, 'format' ) === 'yaml' ) {
|
|
1188
|
-
|
|
1189
|
-
* @var array $value
|
|
1190
|
-
*/
|
|
1191
|
-
$_value = Spyc::YAMLDump( $value, 2, 0 );
|
|
1053
|
+
$value = Spyc::YAMLDump( $value, 2, 0 );
|
|
1192
1054
|
} elseif ( is_array( $value ) || is_object( $value ) ) {
|
|
1193
|
-
$
|
|
1194
|
-
} else {
|
|
1195
|
-
/**
|
|
1196
|
-
* @var string|int $_value
|
|
1197
|
-
*/
|
|
1198
|
-
$_value = $value;
|
|
1055
|
+
$value = var_export( $value, true );
|
|
1199
1056
|
}
|
|
1200
1057
|
|
|
1201
|
-
echo $
|
|
1058
|
+
echo $value . "\n";
|
|
1202
1059
|
}
|
|
1203
1060
|
|
|
1204
1061
|
/**
|
|
@@ -1226,14 +1083,16 @@ class WP_CLI {
|
|
|
1226
1083
|
if ( $errors instanceof WP_Error ) {
|
|
1227
1084
|
foreach ( $errors->get_error_messages() as $message ) {
|
|
1228
1085
|
if ( $errors->get_error_data() ) {
|
|
1229
|
-
return $message . ' ' .
|
|
1086
|
+
return $message . ' ' . $render_data( $errors->get_error_data() );
|
|
1230
1087
|
}
|
|
1231
1088
|
|
|
1232
1089
|
return $message;
|
|
1233
1090
|
}
|
|
1234
1091
|
}
|
|
1235
1092
|
|
|
1236
|
-
|
|
1093
|
+
// PHP 7+: internal and user exceptions must implement Throwable interface.
|
|
1094
|
+
// PHP 5: internal and user exceptions must extend Exception class.
|
|
1095
|
+
if ( ( interface_exists( 'Throwable' ) && ( $errors instanceof Throwable ) ) || ( $errors instanceof Exception ) ) {
|
|
1237
1096
|
return get_class( $errors ) . ': ' . $errors->getMessage();
|
|
1238
1097
|
}
|
|
1239
1098
|
|
|
@@ -1245,69 +1104,6 @@ class WP_CLI {
|
|
|
1245
1104
|
);
|
|
1246
1105
|
}
|
|
1247
1106
|
|
|
1248
|
-
/**
|
|
1249
|
-
* Output debug backtrace information when --debug is enabled.
|
|
1250
|
-
*
|
|
1251
|
-
* This is called when WP_CLI is about to exit (via error() or halt())
|
|
1252
|
-
* to help identify where the exit originated from.
|
|
1253
|
-
*
|
|
1254
|
-
* @access private
|
|
1255
|
-
*/
|
|
1256
|
-
private static function debug_backtrace_on_exit() {
|
|
1257
|
-
// Only output backtrace when debug mode is enabled.
|
|
1258
|
-
if ( ! self::$logger || ! self::get_config( 'debug' ) ) {
|
|
1259
|
-
return;
|
|
1260
|
-
}
|
|
1261
|
-
|
|
1262
|
-
$backtrace = debug_backtrace( DEBUG_BACKTRACE_IGNORE_ARGS );
|
|
1263
|
-
|
|
1264
|
-
// Skip the first few frames (this method, error/halt method, etc.).
|
|
1265
|
-
$skip_frames = 0;
|
|
1266
|
-
foreach ( $backtrace as $index => $frame ) {
|
|
1267
|
-
// Skip internal WP_CLI methods.
|
|
1268
|
-
if ( isset( $frame['class'] ) && 'WP_CLI' === $frame['class'] &&
|
|
1269
|
-
in_array( $frame['function'], [ 'debug_backtrace_on_exit', 'error', 'halt' ], true ) ) {
|
|
1270
|
-
$skip_frames = $index + 1;
|
|
1271
|
-
continue;
|
|
1272
|
-
}
|
|
1273
|
-
break;
|
|
1274
|
-
}
|
|
1275
|
-
|
|
1276
|
-
// Get the first relevant frame (where the error/halt was called from).
|
|
1277
|
-
if ( isset( $backtrace[ $skip_frames ] ) ) {
|
|
1278
|
-
$frame = $backtrace[ $skip_frames ];
|
|
1279
|
-
$file = $frame['file'] ?? 'unknown';
|
|
1280
|
-
$line = $frame['line'] ?? 'unknown';
|
|
1281
|
-
|
|
1282
|
-
self::debug( "Script called exit from: {$file}:{$line}", 'bootstrap' );
|
|
1283
|
-
|
|
1284
|
-
// Output a limited backtrace (first 5 frames after skipping internal ones).
|
|
1285
|
-
$backtrace_output = [];
|
|
1286
|
-
$max_frames = 5;
|
|
1287
|
-
$frame_count = 0;
|
|
1288
|
-
$backtrace_count = count( $backtrace );
|
|
1289
|
-
|
|
1290
|
-
for ( $i = $skip_frames; $i < $backtrace_count && $frame_count < $max_frames; $i++ ) {
|
|
1291
|
-
$frame = $backtrace[ $i ];
|
|
1292
|
-
$func = $frame['function'];
|
|
1293
|
-
|
|
1294
|
-
if ( isset( $frame['class'] ) ) {
|
|
1295
|
-
$func = $frame['class'] . ( $frame['type'] ?? '::' ) . $func;
|
|
1296
|
-
}
|
|
1297
|
-
|
|
1298
|
-
$file = $frame['file'] ?? 'unknown';
|
|
1299
|
-
$line = $frame['line'] ?? '?';
|
|
1300
|
-
|
|
1301
|
-
$backtrace_output[] = " #{$frame_count} {$func}() called at [{$file}:{$line}]";
|
|
1302
|
-
++$frame_count;
|
|
1303
|
-
}
|
|
1304
|
-
|
|
1305
|
-
if ( ! empty( $backtrace_output ) ) {
|
|
1306
|
-
self::debug( "Backtrace:\n" . implode( "\n", $backtrace_output ), 'bootstrap' );
|
|
1307
|
-
}
|
|
1308
|
-
}
|
|
1309
|
-
}
|
|
1310
|
-
|
|
1311
1107
|
/**
|
|
1312
1108
|
* Launch an arbitrary external process that takes over I/O.
|
|
1313
1109
|
*
|
|
@@ -1327,24 +1123,11 @@ class WP_CLI {
|
|
|
1327
1123
|
* @param boolean $exit_on_error Whether to exit if the command returns an elevated return code.
|
|
1328
1124
|
* @param boolean $return_detailed Whether to return an exit status (default) or detailed execution results.
|
|
1329
1125
|
* @return int|ProcessRun The command exit status, or a ProcessRun object for full details.
|
|
1330
|
-
*
|
|
1331
|
-
* @phpstan-return ($return_detailed is true ? ProcessRun : int)
|
|
1332
1126
|
*/
|
|
1333
1127
|
public static function launch( $command, $exit_on_error = true, $return_detailed = false ) {
|
|
1334
1128
|
Utils\check_proc_available( 'launch' );
|
|
1335
1129
|
|
|
1336
|
-
|
|
1337
|
-
// read DB_* (and other) values via getenv() / $_ENV in wp-config.php.
|
|
1338
|
-
$env = $_ENV;
|
|
1339
|
-
|
|
1340
|
-
if ( ! empty( $env ) ) {
|
|
1341
|
-
// Explicit env array, child process inherits only these entries.
|
|
1342
|
-
$proc = Process::create( $command, null, $env );
|
|
1343
|
-
} else {
|
|
1344
|
-
// $_ENV is empty → use null to inherit full parent environment.
|
|
1345
|
-
$proc = Process::create( $command, null, null );
|
|
1346
|
-
}
|
|
1347
|
-
|
|
1130
|
+
$proc = Process::create( $command );
|
|
1348
1131
|
$results = $proc->run();
|
|
1349
1132
|
|
|
1350
1133
|
if ( -1 === $results->return_code ) {
|
|
@@ -1382,8 +1165,6 @@ class WP_CLI {
|
|
|
1382
1165
|
* @param bool $return_detailed Whether to return an exit status (default) or detailed execution results.
|
|
1383
1166
|
* @param array $runtime_args Override one or more global args (path,url,user,allow-root)
|
|
1384
1167
|
* @return int|ProcessRun The command exit status, or a ProcessRun instance
|
|
1385
|
-
*
|
|
1386
|
-
* @phpstan-return ($return_detailed is false ? int : ProcessRun)
|
|
1387
1168
|
*/
|
|
1388
1169
|
public static function launch_self( $command, $args = [], $assoc_args = [], $exit_on_error = true, $return_detailed = false, $runtime_args = [] ) {
|
|
1389
1170
|
$reused_runtime_args = [
|
|
@@ -1407,23 +1188,16 @@ class WP_CLI {
|
|
|
1407
1188
|
|
|
1408
1189
|
$php_bin = escapeshellarg( Utils\get_php_binary() );
|
|
1409
1190
|
|
|
1410
|
-
|
|
1411
|
-
* @var string[] $argv
|
|
1412
|
-
*/
|
|
1413
|
-
$argv = $GLOBALS['argv'];
|
|
1191
|
+
$script_path = $GLOBALS['argv'][0];
|
|
1414
1192
|
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
$wp_cli_config_path = (string) getenv( 'WP_CLI_CONFIG_PATH' );
|
|
1418
|
-
|
|
1419
|
-
if ( $wp_cli_config_path ) {
|
|
1420
|
-
$config_path = $wp_cli_config_path;
|
|
1193
|
+
if ( getenv( 'WP_CLI_CONFIG_PATH' ) ) {
|
|
1194
|
+
$config_path = getenv( 'WP_CLI_CONFIG_PATH' );
|
|
1421
1195
|
} else {
|
|
1422
|
-
$config_path =
|
|
1196
|
+
$config_path = Utils\get_home_dir() . '/.wp-cli/config.yml';
|
|
1423
1197
|
}
|
|
1424
1198
|
$config_path = escapeshellarg( $config_path );
|
|
1425
1199
|
|
|
1426
|
-
$args = implode( ' ', array_map( 'escapeshellarg',
|
|
1200
|
+
$args = implode( ' ', array_map( 'escapeshellarg', $args ) );
|
|
1427
1201
|
$assoc_args = Utils\assoc_args_to_str( $assoc_args );
|
|
1428
1202
|
|
|
1429
1203
|
$full_command = "WP_CLI_CONFIG_PATH={$config_path} {$php_bin} {$script_path} {$command} {$args} {$assoc_args}";
|
|
@@ -1456,8 +1230,6 @@ class WP_CLI {
|
|
|
1456
1230
|
* @param string $key Config parameter key to check.
|
|
1457
1231
|
*
|
|
1458
1232
|
* @return bool
|
|
1459
|
-
*
|
|
1460
|
-
* @phpstan-param key-of<GlobalConfig> $key
|
|
1461
1233
|
*/
|
|
1462
1234
|
public static function has_config( $key ) {
|
|
1463
1235
|
return array_key_exists( $key, self::get_runner()->config );
|
|
@@ -1478,9 +1250,6 @@ class WP_CLI {
|
|
|
1478
1250
|
*
|
|
1479
1251
|
* @param string $key Get value for a specific global configuration parameter.
|
|
1480
1252
|
* @return mixed
|
|
1481
|
-
*
|
|
1482
|
-
* @phpstan-param key-of<GlobalConfig> $key
|
|
1483
|
-
* @phpstan-return ($key is null ? GlobalConfig : value-of<GlobalConfig>)
|
|
1484
1253
|
*/
|
|
1485
1254
|
public static function get_config( $key = null ) {
|
|
1486
1255
|
if ( null === $key ) {
|
|
@@ -1525,11 +1294,11 @@ class WP_CLI {
|
|
|
1525
1294
|
* @param array $options {
|
|
1526
1295
|
* Configuration options for command execution.
|
|
1527
1296
|
*
|
|
1528
|
-
* @type bool $launch
|
|
1529
|
-
* @type bool $exit_error
|
|
1530
|
-
* @type bool|string $return
|
|
1531
|
-
* @type bool|string $parse
|
|
1532
|
-
*
|
|
1297
|
+
* @type bool $launch Launches a new process (true) or reuses the existing process (false). Default: true.
|
|
1298
|
+
* @type bool $exit_error Halts the script on error. Default: true.
|
|
1299
|
+
* @type bool|string $return Returns output as an object when set to 'all' (string), return just the 'stdout', 'stderr', or 'return_code' (string) of command, or print directly to stdout/stderr (false). Default: false.
|
|
1300
|
+
* @type bool|string $parse Parse returned output as 'json' (string); otherwise, output is unchanged (false). Default: false.
|
|
1301
|
+
* @param array $command_args Contains additional command line arguments for the command. Each element represents a single argument. Default: empty array.
|
|
1533
1302
|
* }
|
|
1534
1303
|
* @return mixed
|
|
1535
1304
|
*/
|
|
@@ -1570,21 +1339,12 @@ class WP_CLI {
|
|
|
1570
1339
|
];
|
|
1571
1340
|
}
|
|
1572
1341
|
|
|
1573
|
-
/**
|
|
1574
|
-
* @var string[] $argv
|
|
1575
|
-
*/
|
|
1576
|
-
$argv = $GLOBALS['argv'];
|
|
1577
|
-
|
|
1578
|
-
/**
|
|
1579
|
-
* @var array<resource> $descriptors
|
|
1580
|
-
*/
|
|
1581
|
-
|
|
1582
1342
|
$php_bin = escapeshellarg( Utils\get_php_binary() );
|
|
1583
|
-
$script_path = $argv[0];
|
|
1343
|
+
$script_path = $GLOBALS['argv'][0];
|
|
1584
1344
|
|
|
1585
1345
|
// Persist runtime arguments unless they've been specified otherwise.
|
|
1586
1346
|
$configurator = self::get_configurator();
|
|
1587
|
-
$argv = array_slice( $argv, 1 );
|
|
1347
|
+
$argv = array_slice( $GLOBALS['argv'], 1 );
|
|
1588
1348
|
|
|
1589
1349
|
list( $ignore1, $ignore2, $runtime_config ) = $configurator->parse_args( $argv );
|
|
1590
1350
|
foreach ( $runtime_config as $k => $v ) {
|
|
@@ -1594,30 +1354,21 @@ class WP_CLI {
|
|
|
1594
1354
|
}
|
|
1595
1355
|
$runtime_config = Utils\assoc_args_to_str( $runtime_config );
|
|
1596
1356
|
|
|
1597
|
-
$
|
|
1598
|
-
$alias_prefix = '';
|
|
1599
|
-
if ( $alias && '@' !== substr( ltrim( $command ), 0, 1 ) ) {
|
|
1600
|
-
$alias_prefix = '@' . $alias . ' ';
|
|
1601
|
-
}
|
|
1602
|
-
|
|
1603
|
-
$runcommand = "{$php_bin} {$script_path} {$alias_prefix}{$runtime_config} {$command}";
|
|
1357
|
+
$runcommand = "{$php_bin} {$script_path} {$runtime_config} {$command}";
|
|
1604
1358
|
|
|
1605
|
-
/**
|
|
1606
|
-
* @phpstan-var array<int, resource> $pipes
|
|
1607
|
-
*/
|
|
1608
1359
|
$pipes = [];
|
|
1609
|
-
$proc = Utils\proc_open_compat( $runcommand, $descriptors, $pipes, getcwd()
|
|
1360
|
+
$proc = Utils\proc_open_compat( $runcommand, $descriptors, $pipes, getcwd() );
|
|
1610
1361
|
|
|
1611
1362
|
$stdout = '';
|
|
1612
1363
|
$stderr = '';
|
|
1613
1364
|
|
|
1614
1365
|
if ( $return ) {
|
|
1615
|
-
$stdout =
|
|
1366
|
+
$stdout = stream_get_contents( $pipes[1] );
|
|
1616
1367
|
fclose( $pipes[1] );
|
|
1617
|
-
$stderr =
|
|
1368
|
+
$stderr = stream_get_contents( $pipes[2] );
|
|
1618
1369
|
fclose( $pipes[2] );
|
|
1619
1370
|
}
|
|
1620
|
-
$return_code =
|
|
1371
|
+
$return_code = proc_close( $proc );
|
|
1621
1372
|
if ( -1 === $return_code ) {
|
|
1622
1373
|
self::warning( 'Spawned process returned exit code -1, which could be caused by a custom compiled version of PHP that uses the --enable-sigchild option.' );
|
|
1623
1374
|
} elseif ( $return_code && $exit_error ) {
|
|
@@ -1685,7 +1436,7 @@ class WP_CLI {
|
|
|
1685
1436
|
}
|
|
1686
1437
|
}
|
|
1687
1438
|
if ( ( true === $return || 'stdout' === $return )
|
|
1688
|
-
&& 'json' === $parse
|
|
1439
|
+
&& 'json' === $parse ) {
|
|
1689
1440
|
$retval = json_decode( $retval, true );
|
|
1690
1441
|
}
|
|
1691
1442
|
return $retval;
|