-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathwp-cli-stubs.php
6523 lines (6522 loc) · 201 KB
/
wp-cli-stubs.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?php
/**
* Generated stub declarations for WP-CLI
* @see https://wp-cli.org/
* @see https://github.com/php-stubs/wp-cli-stubs
*/
namespace WP_CLI {
/**
* Class Autoloader.
*
* This is a custom autoloader to replace the functionality that we would
* normally get through the autoloader generated by Composer.
*
* We need this separate autoloader for the bootstrapping process, which happens
* before the Composer autoloader(s) could be loaded.
*
* @package WP_CLI
*/
class Autoloader
{
/**
* Array containing the registered namespace structures
*
* @var array
*/
protected $namespaces = [];
/**
* Destructor for the Autoloader class.
*
* The destructor automatically unregisters the autoload callback function
* with the SPL autoload system.
*/
public function __destruct()
{
}
/**
* Registers the autoload callback with the SPL autoload system.
*/
public function register()
{
}
/**
* Unregisters the autoload callback with the SPL autoload system.
*/
public function unregister()
{
}
/**
* Add a specific namespace structure with our custom autoloader.
*
* @param string $root Root namespace name.
* @param string $base_dir Directory containing the class files.
* @param string $prefix Prefix to be added before the class.
* @param string $suffix Suffix to be added after the class.
* @param boolean $lowercase Whether the class should be changed to
* lowercase.
* @param boolean $underscores Whether the underscores should be changed to
* hyphens.
*
* @return self
*/
public function add_namespace($root, $base_dir, $prefix = '', $suffix = '.php', $lowercase = false, $underscores = false)
{
}
/**
* The autoload function that gets registered with the SPL Autoloader
* system.
*
* @param string $class The class that got requested by the spl_autoloader.
*/
public function autoload($class)
{
}
/**
* Normalize a namespace root.
*
* @param string $root Namespace root that needs to be normalized.
*
* @return string Normalized namespace root.
*/
protected function normalize_root($root)
{
}
/**
* Remove a leading backslash from a string.
*
* @param string $string String to remove the leading backslash from.
*
* @return string Modified string.
*/
protected function remove_leading_backslash($string)
{
}
/**
* Make sure a string ends with a trailing backslash.
*
* @param string $string String to check the trailing backslash of.
*
* @return string Modified string.
*/
protected function add_trailing_backslash($string)
{
}
/**
* Make sure a string ends with a trailing slash.
*
* @param string $string String to check the trailing slash of.
*
* @return string Modified string.
*/
protected function add_trailing_slash($string)
{
}
}
}
namespace WP_CLI\Bootstrap {
/**
* Interface BootstrapStep.
*
* Represents a single bootstrapping step that can be processed.
*
* @package WP_CLI\Bootstrap
*/
interface BootstrapStep
{
/**
* Process this single bootstrapping step.
*
* @param BootstrapState $state Contextual state to pass into the step.
*
* @return BootstrapState Modified state to pass to the next step.
*/
public function process(\WP_CLI\Bootstrap\BootstrapState $state);
}
/**
* Abstract class AutoloaderStep.
*
* Abstract base class for steps that include an autoloader.
*
* @package WP_CLI\Bootstrap
*/
abstract class AutoloaderStep implements \WP_CLI\Bootstrap\BootstrapStep
{
/**
* Store state for subclasses to have access.
*
* @var BootstrapState
*/
protected $state;
/**
* Process this single bootstrapping step.
*
* @param BootstrapState $state Contextual state to pass into the step.
*
* @return BootstrapState Modified state to pass to the next step.
*/
public function process(\WP_CLI\Bootstrap\BootstrapState $state)
{
}
/**
* Get the name of the custom vendor folder as set in `composer.json`.
*
* @return string|false Name of the custom vendor folder or false if none.
*/
protected function get_custom_vendor_folder()
{
}
/**
* Handle the failure to find an autoloader.
*
* @return void
*/
protected function handle_failure()
{
}
/**
* Get the autoloader paths to scan for an autoloader.
*
* @return string[]|false Array of strings with autoloader paths, or false
* to skip.
*/
protected abstract function get_autoloader_paths();
}
/**
* Class BootstrapState.
*
* Represents the state that is passed from one bootstrap step to the next.
*
* @package WP_CLI\Bootstrap
*
* Maintain BC: Changing the method names in this class breaks autoload interactions between Phar
* & framework/commands you use outside of Phar (like when running the Phar WP inside of a command folder).
* @phpcs:disable WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid
*/
class BootstrapState
{
/**
* Whether the command currently being run is "protected".
*
* This means that the command should not be allowed to break due to
* extension code.
*/
const IS_PROTECTED_COMMAND = 'is_protected_command';
/**
* Internal storage of the state values.
*
* @var array
*/
private $state = [];
/**
* Get the state value for a given key.
*
* @param string $key Key to get the state from.
* @param mixed $fallback Fallback value to use if the key is not defined.
*
* @return mixed
*/
public function getValue($key, $fallback = null)
{
}
/**
* Set the state value for a given key.
*
* @param string $key Key to set the state for.
* @param mixed $value Value to set the state for the given key to.
*
* @return void
*/
public function setValue($key, $value)
{
}
}
/**
* Class ConfigureRunner.
*
* Initialize the configuration for the `WP_CLI\Runner` object.
*
* @package WP_CLI\Bootstrap
*/
final class ConfigureRunner implements \WP_CLI\Bootstrap\BootstrapStep
{
/**
* Process this single bootstrapping step.
*
* @param BootstrapState $state Contextual state to pass into the step.
*
* @return BootstrapState Modified state to pass to the next step.
*/
public function process(\WP_CLI\Bootstrap\BootstrapState $state)
{
}
}
/**
* Class DeclareAbstractBaseCommand.
*
* Declares the abstract `WP_CLI_Command` base class.
*
* @package WP_CLI\Bootstrap
*/
final class DeclareAbstractBaseCommand implements \WP_CLI\Bootstrap\BootstrapStep
{
/**
* Process this single bootstrapping step.
*
* @param BootstrapState $state Contextual state to pass into the step.
*
* @return BootstrapState Modified state to pass to the next step.
*/
public function process(\WP_CLI\Bootstrap\BootstrapState $state)
{
}
}
/**
* Class DeclareFallbackFunctions.
*
* Declares functions that might have been disabled but are required.
*
* @package WP_CLI\Bootstrap
*/
final class DeclareFallbackFunctions implements \WP_CLI\Bootstrap\BootstrapStep
{
/**
* Process this single bootstrapping step.
*
* @param BootstrapState $state Contextual state to pass into the step.
*
* @return BootstrapState Modified state to pass to the next step.
*/
public function process(\WP_CLI\Bootstrap\BootstrapState $state)
{
}
}
/**
* Class DeclareMainClass.
*
* Declares the main `WP_CLI` class.
*
* @package WP_CLI\Bootstrap
*/
final class DeclareMainClass implements \WP_CLI\Bootstrap\BootstrapStep
{
/**
* Process this single bootstrapping step.
*
* @param BootstrapState $state Contextual state to pass into the step.
*
* @return BootstrapState Modified state to pass to the next step.
*/
public function process(\WP_CLI\Bootstrap\BootstrapState $state)
{
}
}
/**
* Class DefineProtectedCommands.
*
* Define the commands that are "protected", meaning that they shouldn't be able
* to break due to extension code.
*
* @package WP_CLI\Bootstrap
*/
final class DefineProtectedCommands implements \WP_CLI\Bootstrap\BootstrapStep
{
/**
* Process this single bootstrapping step.
*
* @param BootstrapState $state Contextual state to pass into the step.
*
* @return BootstrapState Modified state to pass to the next step.
*/
public function process(\WP_CLI\Bootstrap\BootstrapState $state)
{
}
/**
* Get the list of protected commands.
*
* @return array
*/
private function get_protected_commands()
{
}
/**
* Get the current command as a string.
*
* @return string Current command to be executed.
*/
private function get_current_command()
{
}
}
/**
* Class IncludeFallbackAutoloader.
*
* Loads the fallback autoloader that is provided through the `composer.json`
* file.
*
* @package WP_CLI\Bootstrap
*/
final class IncludeFallbackAutoloader extends \WP_CLI\Bootstrap\AutoloaderStep
{
/**
* Get the autoloader paths to scan for an autoloader.
*
* @return string[] Array of autoloader paths, or an empty array if none are found.
*/
protected function get_autoloader_paths()
{
}
}
/**
* Class IncludeFrameworkAutoloader.
*
* Loads the framework autoloader through an autoloader separate from the
* Composer one, to avoid coupling the loading of the framework with bundled
* commands.
*
* This only contains classes for the framework.
*
* @package WP_CLI\Bootstrap
*/
final class IncludeFrameworkAutoloader implements \WP_CLI\Bootstrap\BootstrapStep
{
/**
* Process this single bootstrapping step.
*
* @param BootstrapState $state Contextual state to pass into the step.
*
* @return BootstrapState Modified state to pass to the next step.
*/
public function process(\WP_CLI\Bootstrap\BootstrapState $state)
{
}
}
/**
* Class IncludePackageAutoloader.
*
* Loads the package autoloader that includes all the external packages.
*
* @package WP_CLI\Bootstrap
*/
final class IncludePackageAutoloader extends \WP_CLI\Bootstrap\AutoloaderStep
{
/**
* Get the autoloader paths to scan for an autoloader.
*
* @return string[]|false Array of strings with autoloader paths, or false
* to skip.
*/
protected function get_autoloader_paths()
{
}
/**
* Handle the failure to find an autoloader.
*
* @return void
*/
protected function handle_failure()
{
}
}
/**
* Class IncludeRequestsAutoloader.
*
* Loads the Requests autoloader that best fits the current environment.
*
* If a WordPress installation is found, it autoloads that version of Requests.
* Otherwise, it loads the version of Requests bundled with WP-CLI.
*
* This is done in order to avoid conflicts between Requests versions.
*
* @package WP_CLI\Bootstrap
*/
final class IncludeRequestsAutoloader implements \WP_CLI\Bootstrap\BootstrapStep
{
/**
* Requests is being used from the WordPress installation.
*
* @var string
*/
const FROM_WP_CORE = 'wp-core';
/**
* Requests is being used from the WP-CLI dependencies.
*
* @var string
*/
const FROM_WP_CLI = 'wp-cli';
/**
* Process this single bootstrapping step.
*
* @param BootstrapState $state Contextual state to pass into the step.
*
* @return BootstrapState Modified state to pass to the next step.
*/
public function process(\WP_CLI\Bootstrap\BootstrapState $state)
{
}
/**
* Store meta information about the used Requests integration.
*
* This can be used for all the conditional code that needs to work
* across multiple Requests versions.
*
* @param string $class_name The class name of the Requests integration.
* @param string $source The source of the Requests integration.
*/
private function store_requests_meta($class_name, $source)
{
}
}
/**
* Class InitializeColorization.
*
* Initialize the colorization through the `WP_CLI\Runner` object.
*
* @package WP_CLI\Bootstrap
*/
final class InitializeColorization implements \WP_CLI\Bootstrap\BootstrapStep
{
/**
* Process this single bootstrapping step.
*
* @param BootstrapState $state Contextual state to pass into the step.
*
* @return BootstrapState Modified state to pass to the next step.
*/
public function process(\WP_CLI\Bootstrap\BootstrapState $state)
{
}
}
/**
* Class InitializeContexts.
*
* @package WP_CLI\Bootstrap
*/
final class InitializeContexts implements \WP_CLI\Bootstrap\BootstrapStep
{
/**
* Process this single bootstrapping step.
*
* @param BootstrapState $state Contextual state to pass into the step.
*
* @return BootstrapState Modified state to pass to the next step.
*/
public function process(\WP_CLI\Bootstrap\BootstrapState $state)
{
}
}
/**
* Class InitializeLogger.
*
* Initialize the logger through the `WP_CLI\Runner` object.
*
* @package WP_CLI\Bootstrap
*/
final class InitializeLogger implements \WP_CLI\Bootstrap\BootstrapStep
{
/**
* Process this single bootstrapping step.
*
* @param BootstrapState $state Contextual state to pass into the step.
*
* @return BootstrapState Modified state to pass to the next step.
*/
public function process(\WP_CLI\Bootstrap\BootstrapState $state)
{
}
/**
* Load the class declarations for the loggers.
*/
private function declare_loggers()
{
}
}
/**
* Class LaunchRunner.
*
* Kick off the Runner object that starts the actual commands.
*
* @package WP_CLI\Bootstrap
*/
final class LaunchRunner implements \WP_CLI\Bootstrap\BootstrapStep
{
/**
* Process this single bootstrapping step.
*
* @param BootstrapState $state Contextual state to pass into the step.
*
* @return BootstrapState Modified state to pass to the next step.
*/
public function process(\WP_CLI\Bootstrap\BootstrapState $state)
{
}
}
/**
* Class LoadDispatcher.
*
* Loads the dispatcher that will dispatch command names to file locations.
*
* @package WP_CLI\Bootstrap
*/
final class LoadDispatcher implements \WP_CLI\Bootstrap\BootstrapStep
{
/**
* Process this single bootstrapping step.
*
* @param BootstrapState $state Contextual state to pass into the step.
*
* @return BootstrapState Modified state to pass to the next step.
*/
public function process(\WP_CLI\Bootstrap\BootstrapState $state)
{
}
}
/**
* Class LoadExtraCommand.
*
* Loads a command that was passed through the `--exec=<php-code>` option.
*
* @package WP_CLI\Bootstrap
*/
final class LoadExecCommand implements \WP_CLI\Bootstrap\BootstrapStep
{
/**
* Process this single bootstrapping step.
*
* @param BootstrapState $state Contextual state to pass into the step.
*
* @return BootstrapState Modified state to pass to the next step.
*/
public function process(\WP_CLI\Bootstrap\BootstrapState $state)
{
}
}
/**
* Class LoadRequiredCommand.
*
* Loads a command that was passed through the `--require=<command>` option.
*
* @package WP_CLI\Bootstrap
*/
final class LoadRequiredCommand implements \WP_CLI\Bootstrap\BootstrapStep
{
/**
* Process this single bootstrapping step.
*
* @param BootstrapState $state Contextual state to pass into the step.
*
* @return BootstrapState Modified state to pass to the next step.
*/
public function process(\WP_CLI\Bootstrap\BootstrapState $state)
{
}
}
/**
* Class LoadUtilityFunctions.
*
* Loads the functions available through `WP_CLI\Utils`.
*
* @package WP_CLI\Bootstrap
*/
final class LoadUtilityFunctions implements \WP_CLI\Bootstrap\BootstrapStep
{
/**
* Process this single bootstrapping step.
*
* @param BootstrapState $state Contextual state to pass into the step.
*
* @return BootstrapState Modified state to pass to the next step.
*/
public function process(\WP_CLI\Bootstrap\BootstrapState $state)
{
}
}
/**
* Class RegisterDeferredCommands.
*
* Registers the deferred commands that for which no parent was registered yet.
* This is necessary, because we can have sub-commands that have no direct
* parent, like `wp network meta`.
*
* @package WP_CLI\Bootstrap
*/
final class RegisterDeferredCommands implements \WP_CLI\Bootstrap\BootstrapStep
{
/**
* Process this single bootstrapping step.
*
* @param BootstrapState $state Contextual state to pass into the step.
*
* @return BootstrapState Modified state to pass to the next step.
*/
public function process(\WP_CLI\Bootstrap\BootstrapState $state)
{
}
/**
* Add deferred commands that are still waiting to be processed.
*/
public function add_deferred_commands()
{
}
}
/**
* Class RegisterFrameworkCommands.
*
* Register the commands that are directly included with the framework.
*
* @package WP_CLI\Bootstrap
*/
final class RegisterFrameworkCommands implements \WP_CLI\Bootstrap\BootstrapStep
{
/**
* Process this single bootstrapping step.
*
* @param BootstrapState $state Contextual state to pass into the step.
*
* @return BootstrapState Modified state to pass to the next step.
*/
public function process(\WP_CLI\Bootstrap\BootstrapState $state)
{
}
}
/**
* Class RunnerInstance.
*
* Convenience class for steps that make use of the `WP_CLI\Runner` object.
*
* @package WP_CLI\Bootstrap
*/
final class RunnerInstance
{
/**
* Return an instance of the `WP_CLI\Runner` object.
*
* Includes necessary class files first as needed.
*
* @return Runner
*/
public function __invoke()
{
}
}
}
namespace WP_CLI {
class Completions
{
private $cur_word;
private $words;
private $opts = [];
/**
* Instantiate a Completions object.
*
* @param string $line Line of shell input to compute a completion for.
*/
public function __construct($line)
{
}
/**
* Get the specific WP-CLI command that is being referenced.
*
* @param array $words Individual input line words.
*
* @return array|mixed Array with command and arguments, or error result if command detection failed.
*/
private function get_command($words)
{
}
/**
* Get global parameters.
*
* @return array Associative array of global parameters.
*/
private function get_global_parameters()
{
}
/**
* Store individual option.
*
* @param string $opt Option to store.
*
* @return void
*/
private function add($opt)
{
}
/**
* Render the stored options.
*
* @return void
*/
public function render()
{
}
}
/**
* Handles file- and runtime-based configuration values.
*
* @package WP_CLI
*/
class Configurator
{
/**
* Configurator argument specification.
*
* @var array
*/
private $spec;
/**
* Values for keys defined in Configurator spec.
*
* @var array
*/
private $config = [];
/**
* Extra config values not specified in spec.
*
* @var array
*/
private $extra_config = [];
/**
* Any aliases defined in config files.
*
* @var array
*/
private $aliases = [];
/**
* Regex pattern used to define an alias.
*
* @var string
*/
const ALIAS_REGEX = '^@[A-Za-z0-9-_\\.\\-]+$';
/**
* Arguments that can be used in an alias.
*
* @var array
*/
private static $alias_spec = ['user', 'url', 'path', 'ssh', 'http', 'proxyjump', 'key'];
/**
* @param string $path Path to config spec file.
*/
public function __construct($path)
{
}
/**
* Loads the config spec file.
*
* @param string $path Path to the config spec file.
*/
private function load_config_spec($path)
{
}
/**
* Get declared configuration values as an array.
*
* @return array
*/
public function to_array()
{
}
/**
* Get configuration specification, i.e. list of accepted keys.
*
* @return array
*/
public function get_spec()
{
}
/**
* Get any aliases defined in config files.
*
* @return array
*/
public function get_aliases()
{
}
/**
* Splits a list of arguments into positional, associative and config.
*
* @param array(string) $arguments
* @return array(array)
*/
public function parse_args($arguments)
{
}
/**
* Splits positional args from associative args.
*
* @param array $arguments
* @return array(array)
*/
public static function extract_assoc($arguments)
{
}
/**
* Separate runtime parameters from command-specific parameters.
*
* @param array $mixed_args
* @return array
*/
private function unmix_assoc_args($mixed_args, $global_assoc = [], $local_assoc = [])
{
}
/**
* Handle turning an $assoc_arg into a runtime arg.
*/
private function assoc_arg_to_runtime_config($key, $value, &$runtime_config)
{
}
/**
* Load a YAML file of parameters into scope.
*
* @param string $path Path to YAML file.
*/
public function merge_yml($path, $current_alias = null)
{
}
/**
* Merge an array of values into the configurator config.
*
* @param array $config
*/
public function merge_array($config)
{
}
/**
* Load values from a YAML file.
*
* @param string $yml_file Path to the YAML file
* @return array Declared configuration values
*/
private static function load_yml($yml_file)
{
}
/**
* Conform a variable to an array.
*
* @param mixed $val A string or an array
*/
private static function arrayify(&$val)
{
}
/**
* Make a path absolute.
*
* @param string $path Path to file.
* @param string $base Base path to prepend.
*/
private static function absolutize(&$path, $base)
{
}
}
/**
* Context that can be selected in order to run commands within a properly
* set-up environment.
*/
interface Context
{
const ADMIN = 'admin';
const AUTO = 'auto';
const CLI = 'cli';
const FRONTEND = 'frontend';
/**
* Debugging group to use for all context-related debug messages.
*
* @var string
*/
const DEBUG_GROUP = 'context';
/**
* Process the context to set up the environment correctly.
*
* @param array $config Associative array of configuration data.
* @return void
*/
public function process($config);
}
}
namespace WP_CLI\Context {
/**
* Context which simulates the administrator backend.
*/
final class Admin implements \WP_CLI\Context
{
/**
* Process the context to set up the environment correctly.
*
* @param array $config Associative array of configuration data.
* @return void
*/
public function process($config)
{
}
/**
* Ensure the current request is done under a logged-in administrator
* account.
*
* A lot of premium plugins/themes have their custom update routines locked
* behind an is_admin() call.
*
* @return void
*/
private function log_in_as_admin_user()
{
}
/**
* Load the admin environment.
*
* This tries to load `wp-admin/admin.php` while trying to avoid issues
* like re-loading the wp-config.php file (which redeclares constants).
*
* To make this work across WordPress versions, we use the actual file and
* modify it on-the-fly.
*
* @global string $hook_suffix
* @global string $pagenow
* @global int $wp_db_version
* @global array $_wp_submenu_nopriv
*
* @return void
*/
private function load_admin_environment()
{
}
}
/**
* Context which switches to other contexts automatically based on conditions.
*/
final class Auto implements \WP_CLI\Context
{
/**
* Array of commands to intercept.
*
* @var array<array>
*/
const COMMANDS_TO_RUN_AS_ADMIN = [['plugin'], ['theme']];
/**
* Context manager instance to use.
*
* @var ContextManager
*/
private $context_manager;
/**