diff --git a/core/lib/Drupal/Core/Command/DbDumpApplication.php b/core/lib/Drupal/Core/Command/DbDumpApplication.php index d73814fb..d14d3bb 100644 --- a/core/lib/Drupal/Core/Command/DbDumpApplication.php +++ b/core/lib/Drupal/Core/Command/DbDumpApplication.php @@ -18,18 +18,26 @@ class DbDumpApplication extends Application { /** + * The database connection. + * * @var \Drupal\Core\Database\Connection */ protected $connection; /** + * The module handler. + * * @var \Drupal\Core\Extension\ModuleHandlerInterface */ protected $moduleHandler; /** + * Construct the application. + * * @param \Drupal\Core\Database\Connection $connection + * The database connection. * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler + * The module handler. */ function __construct(Connection $connection, ModuleHandlerInterface $module_handler) { $this->connection = $connection; diff --git a/core/lib/Drupal/Core/Command/DbDumpCommand.php b/core/lib/Drupal/Core/Command/DbDumpCommand.php index e182bbe..fd828b8 100644 --- a/core/lib/Drupal/Core/Command/DbDumpCommand.php +++ b/core/lib/Drupal/Core/Command/DbDumpCommand.php @@ -17,16 +17,24 @@ /** * Provides a command to dump the current database to a script. * - * @see \Drupal\Core\Command\DbDump + * This script exports all tables in the given database, and all data (except + * for tables denoted as schema-only). The resulting script creates the tables + * and populates them with the exported data. + * + * @see \Drupal\Core\Command\DbDumpApplication */ class DbDumpCommand extends Command { /** + * The database connection. + * * @var \Drupal\Core\Database\Connection $connection */ protected $connection; /** + * The module handler. + * * @var \Drupal\Core\Extension\ModuleHandlerInterface */ protected $moduleHandler; @@ -48,8 +56,12 @@ class DbDumpCommand extends Command { protected $schemaOnly = ['cache.*', 'sessions', 'watchdog']; /** + * Construct the database dump command. + * * @param \Drupal\Core\Database\Connection $connection + * The database connection to use. * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler + * The module handler to use. */ function __construct(Connection $connection, ModuleHandlerInterface $module_handler) { $this->connection = $connection; @@ -125,7 +137,7 @@ protected function getTables() { * Returns a schema array for a given table. * * @param string $table - * The table name + * The table name. * * @return array * A schema array (as defined by hook_schema()). @@ -186,6 +198,7 @@ protected function getTableSchema($table) { * * @param string $table * The table to query. + * * @return array * The data from the table as an array. */ @@ -226,6 +239,12 @@ protected function fieldTypeMap($type) { /** * Gets field ordering for a given table. + * + * @param string $table + * The table name. + * + * @return string + * The order string to append to the query. */ protected function getFieldOrder($table) { // @todo this is MySQL only since there are no Database API functions for @@ -252,6 +271,7 @@ protected function getFieldOrder($table) { * The script template. * * @return string + * The template for the generated PHP script. */ protected function getTemplate() { $script = <<<'ENDOFSCRIPT' @@ -285,6 +305,9 @@ protected function getTemplate() { * Drupal schema definition. * @param array $data * Data for the table. + * + * @return string + * The table create statement, and if there is data, the insert command. */ protected function getTableScript($table, array $schema, array $data) { $output = ''; @@ -306,6 +329,7 @@ protected function getTableScript($table, array $schema, array $data) { * List of modules enabled for insertion into the script docblock. * * @return string + * The formatted list of enabled modules. */ protected function getModulesScript() { $output = '';