3
3
use \WP_CLI \Utils ;
4
4
5
5
/**
6
- * Perform basic database operations using credentials stored in wp-config.php
6
+ * Performs basic database operations using credentials stored in wp-config.php.
7
7
*
8
8
* ## EXAMPLES
9
9
*
27
27
class DB_Command extends WP_CLI_Command {
28
28
29
29
/**
30
- * Create a new database.
30
+ * Creates a new database.
31
31
*
32
32
* Runs `CREATE_DATABASE` SQL statement using `DB_HOST`, `DB_NAME`,
33
33
* `DB_USER` and `DB_PASSWORD` database credentials specified in
@@ -46,7 +46,7 @@ public function create( $_, $assoc_args ) {
46
46
}
47
47
48
48
/**
49
- * Delete the existing database.
49
+ * Deletes the existing database.
50
50
*
51
51
* Runs `DROP_DATABASE` SQL statement using `DB_HOST`, `DB_NAME`,
52
52
* `DB_USER` and `DB_PASSWORD` database credentials specified in
@@ -71,7 +71,7 @@ public function drop( $_, $assoc_args ) {
71
71
}
72
72
73
73
/**
74
- * Remove all tables from the database.
74
+ * Removes all tables from the database.
75
75
*
76
76
* Runs `DROP_DATABASE` and `CREATE_DATABASE` SQL statements using
77
77
* `DB_HOST`, `DB_NAME`, `DB_USER` and `DB_PASSWORD` database credentials
@@ -97,7 +97,7 @@ public function reset( $_, $assoc_args ) {
97
97
}
98
98
99
99
/**
100
- * Check the current status of the database.
100
+ * Checks the current status of the database.
101
101
*
102
102
* Runs `mysqlcheck` utility with `--check` using `DB_HOST`,
103
103
* `DB_NAME`, `DB_USER` and `DB_PASSWORD` database credentials
@@ -120,7 +120,7 @@ public function check() {
120
120
}
121
121
122
122
/**
123
- * Optimize the database.
123
+ * Optimizes the database.
124
124
*
125
125
* Runs `mysqlcheck` utility with `--optimize=true` using `DB_HOST`,
126
126
* `DB_NAME`, `DB_USER` and `DB_PASSWORD` database credentials
@@ -143,7 +143,7 @@ public function optimize() {
143
143
}
144
144
145
145
/**
146
- * Repair the database.
146
+ * Repairs the database.
147
147
*
148
148
* Runs `mysqlcheck` utility with `--repair=true` using `DB_HOST`,
149
149
* `DB_NAME`, `DB_USER` and `DB_PASSWORD` database credentials
@@ -166,7 +166,7 @@ public function repair() {
166
166
}
167
167
168
168
/**
169
- * Open a MySQL console using credentials from wp-config.php
169
+ * Opens a MySQL console using credentials from wp-config.php
170
170
*
171
171
* ## OPTIONS
172
172
*
@@ -196,7 +196,7 @@ public function cli( $args, $assoc_args ) {
196
196
}
197
197
198
198
/**
199
- * Execute a SQL query against the database.
199
+ * Executes a SQL query against the database.
200
200
*
201
201
* Executes an arbitrary SQL query using `DB_HOST`, `DB_NAME`, `DB_USER`
202
202
* and `DB_PASSWORD` database credentials specified in wp-config.php.
@@ -374,7 +374,7 @@ public function export( $args, $assoc_args ) {
374
374
}
375
375
376
376
/**
377
- * Import a database from a file or from STDIN.
377
+ * Imports a database from a file or from STDIN.
378
378
*
379
379
* Runs SQL queries using `DB_HOST`, `DB_NAME`, `DB_USER` and
380
380
* `DB_PASSWORD` database credentials specified in wp-config.php. This
@@ -424,7 +424,7 @@ public function import( $args, $assoc_args ) {
424
424
}
425
425
426
426
/**
427
- * List the database tables.
427
+ * Lists the database tables.
428
428
*
429
429
* Defaults to all tables registered to the $wpdb database handler.
430
430
*
@@ -495,7 +495,7 @@ public function tables( $args, $assoc_args ) {
495
495
}
496
496
497
497
/**
498
- * Display the database name and size.
498
+ * Displays the database name and size.
499
499
*
500
500
* Display the database name and size for `DB_NAME` specified in wp-config.php.
501
501
* The size defaults to a human-readable number.
@@ -671,7 +671,7 @@ public function size( $args, $assoc_args ) {
671
671
}
672
672
673
673
/**
674
- * Display the database table prefix.
674
+ * Displays the database table prefix.
675
675
*
676
676
* Display the database table prefix, as defined by the database handler's interpretation of the current site.
677
677
*
@@ -689,7 +689,7 @@ public function prefix() {
689
689
}
690
690
691
691
/**
692
- * Find a string in the database.
692
+ * Finds a string in the database.
693
693
*
694
694
* Searches through all or a selection of database tables for a given string, Outputs colorized references to the string.
695
695
*
@@ -1022,7 +1022,7 @@ private static function run( $cmd, $assoc_args = array(), $descriptors = null )
1022
1022
}
1023
1023
1024
1024
/**
1025
- * Get the column names of a db table differentiated into key columns and text columns and all columns.
1025
+ * Gets the column names of a db table differentiated into key columns and text columns and all columns.
1026
1026
*
1027
1027
* @param string $table The table name.
1028
1028
* @return array A 3 element array consisting of an array of primary key column names, an array of text column names, and an array containing all column names.
@@ -1049,7 +1049,7 @@ private static function get_columns( $table ) {
1049
1049
}
1050
1050
1051
1051
/**
1052
- * Whether a column is considered text or not.
1052
+ * Determines whether a column is considered text or not.
1053
1053
*
1054
1054
* @param string Column type.
1055
1055
* @bool True if text column, false otherwise.
0 commit comments