diff --git a/Classes/Command/ExportCommand.php b/Classes/Command/ExportCommand.php index 7ae3a4d..a9f5408 100644 --- a/Classes/Command/ExportCommand.php +++ b/Classes/Command/ExportCommand.php @@ -5,7 +5,7 @@ namespace Remind\Backup\Command; use Remind\Backup\Service\DatabaseService; -use Remind\Backup\Utility\FileNameUtility; +use Remind\Backup\Utility\FileNamingUtility; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; @@ -96,7 +96,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int $dir = $input->getOption(self::INPUT_DIR); - $path = FileNameUtility::buildPath( + $path = FileNamingUtility::buildPath( $dir, $input->getOption(self::INPUT_FILE), !$input->getOption(self::INPUT_OMIT_TIMESTAMP), diff --git a/Classes/Command/ImportCommand.php b/Classes/Command/ImportCommand.php index 3ff9df0..ae513b4 100644 --- a/Classes/Command/ImportCommand.php +++ b/Classes/Command/ImportCommand.php @@ -5,7 +5,7 @@ namespace Remind\Backup\Command; use Remind\Backup\Service\DatabaseService; -use Remind\Backup\Utility\FileNameUtility; +use Remind\Backup\Utility\FileNamingUtility; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; @@ -58,7 +58,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int $dir = $input->getOption(self::INPUT_DIR); $file = $input->getOption(self::INPUT_FILE); - $path = FileNameUtility::buildPath($dir, $file, false, true); + $path = FileNamingUtility::buildPath($dir, $file, false, true); if (!file_exists($path)) { if (!is_dir($dir)) { @@ -68,10 +68,10 @@ protected function execute(InputInterface $input, OutputInterface $output): int $files = array_values(array_diff(scandir($dir, SCANDIR_SORT_ASCENDING), ['.', '..'])); $matches = array_filter($files, function (string $fileToCheck) use ($file) { - return preg_match(FileNameUtility::getRegexPattern($file), $fileToCheck); + return preg_match(FileNamingUtility::getRegexPattern($file), $fileToCheck); }); if (!empty($matches)) { - $path = FileNameUtility::buildPath($dir, array_pop($matches)); + $path = FileNamingUtility::buildPath($dir, array_pop($matches)); $output->writeln(sprintf('Use \'%s\' for import.', $path)); } else { $output->writeln(sprintf('File \'%s\' does not exist.', $path)); diff --git a/Classes/Utility/FileNameUtility.php b/Classes/Utility/FileNamingUtility.php similarity index 97% rename from Classes/Utility/FileNameUtility.php rename to Classes/Utility/FileNamingUtility.php index 9adb726..8c3531d 100644 --- a/Classes/Utility/FileNameUtility.php +++ b/Classes/Utility/FileNamingUtility.php @@ -6,7 +6,7 @@ use TYPO3\CMS\Core\Utility\PathUtility; -class FileNameUtility +class FileNamingUtility { public static function getRegexPattern(string $file): string { diff --git a/Configuration/Services.yaml b/Configuration/Services.yaml index c917d38..05b1b77 100644 --- a/Configuration/Services.yaml +++ b/Configuration/Services.yaml @@ -8,15 +8,15 @@ services: Remind\Backup\Command\ExportCommand: tags: - name: console.command - command: 'remind:database:export' + command: 'remind:backup:export' description: 'Export database' Remind\Backup\Command\ImportCommand: tags: - name: console.command - command: 'remind:database:import' + command: 'remind:backup:import' description: 'Import database' Remind\Backup\Command\DeleteBackupCommand: tags: - name: console.command - command: 'remind:database:delete' + command: 'remind:backup:delete' description: 'Delete database backup' diff --git a/Resources/Private/Language/locallang.xlf b/Resources/Private/Language/locallang.xlf deleted file mode 100644 index c38da12..0000000 --- a/Resources/Private/Language/locallang.xlf +++ /dev/null @@ -1,17 +0,0 @@ - - - -
- - - Database Backup - - - Export - - - Import - - - - \ No newline at end of file