Skip to content

Commit

Permalink
revert change
Browse files Browse the repository at this point in the history
  • Loading branch information
sreichel committed Dec 18, 2024
1 parent 48a13f0 commit 057b4ce
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions src/N98/Magento/Command/Database/DumpCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace N98\Magento\Command\Database;

use Carbon\Carbon;
use InvalidArgumentException;
use N98\Magento\Command\Database\Compressor\Compressor;
use N98\Util\Console\Enabler;
Expand Down Expand Up @@ -487,15 +488,9 @@ protected function getFileName(InputInterface $input, OutputInterface $output, C
$fileName = $defaultName;
}
} elseif ($optionAddTime) {
$pathParts = pathinfo($fileName);
$pathPartsDirname = $pathParts['dirname'] ?? '';
$pathPartsFilename = $pathParts['filename'] ?? '';
$fileName = ($pathPartsDirname == '.' ? '' : $pathPartsDirname . '/')
. $namePrefix
. $pathPartsFilename
. $nameSuffix
. '.'
. $pathPartsFilename;
$pathParts = pathinfo($fileName);
$fileName = ($pathParts['dirname'] == '.' ? '' : $pathParts['dirname'] . '/') .
$namePrefix . $pathParts['filename'] . $nameSuffix . '.' . $pathParts['extension'];
}

return $compressor->getFileName((string) $fileName);
Expand All @@ -512,7 +507,7 @@ private function getFileNamePrefixSuffix($optionAddTime = null): array
return [$namePrefix, $nameSuffix];
}

$timeStamp = \Carbon\Carbon::now()->format('Y-m-d_His');
$timeStamp = Carbon::now()->format('Y-m-d_His');

if (in_array($optionAddTime, ['suffix', true], true)) {
$nameSuffix = '_' . $timeStamp;
Expand Down

0 comments on commit 057b4ce

Please sign in to comment.