diff --git a/web/modules/custom/blog/drush.services.yml b/web/modules/custom/blog/drush.services.yml deleted file mode 100644 index 5a4a328..0000000 --- a/web/modules/custom/blog/drush.services.yml +++ /dev/null @@ -1,6 +0,0 @@ -services: - Drupal\opdavies_blog\Command\ExportBodyValuesForThemePurgingCommand: - arguments: ['@database'] - autowire: true - tags: - - { name: drush.command } diff --git a/web/modules/custom/blog/src/Command/ExportBodyValuesForThemePurgingCommand.php b/web/modules/custom/blog/src/Command/ExportBodyValuesForThemePurgingCommand.php deleted file mode 100644 index fea9a3d..0000000 --- a/web/modules/custom/blog/src/Command/ExportBodyValuesForThemePurgingCommand.php +++ /dev/null @@ -1,49 +0,0 @@ -database = $database; - } - - /** - * Drush command to export body field values into a file. - * - * @command opdavies:export-body-values-for-theme-purging - */ - public function handle(): void { - $values = Collection::make(self::$tableNames) - ->flatMap(fn(string $tableName) => $this->getValuesFromTable($tableName)) - ->implode(PHP_EOL); - - file_put_contents($this->getFilePath(), $values); - } - - private function getFilePath(): string { - return drupal_get_path('theme', 'opdavies') . DIRECTORY_SEPARATOR . $this->filename; - } - - private function getValuesFromTable(string $tableName): array { - return $this->database->select($tableName) - ->fields($tableName, ['body_value']) - ->execute() - ->fetchCol(); - } - -}