Skip to content

Commit 0a623c7

Browse files
committed
Change from Ignore to Include sync flag (minor change)
1 parent bcf5e55 commit 0a623c7

2 files changed

Lines changed: 12 additions & 12 deletions

File tree

Command/DownloadImages.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@ class DownloadImages extends Command
2121
const OVERRIDE = 'override';
2222
const FORCE = 'force';
2323
const ENV = 'env';
24-
const IGNORE_SYNC = 'ignore-synchronization';
24+
const INCLUDE_SYNC = 'include-synchronization';
2525
/**#@- */
2626

2727
const OVERRIDE_CONFIRM_MESSAGE = "<question>Are you sure you want to override local files (y/n)[n]?</question>";
2828

2929
private $_override = false;
3030

31-
private $_ignoreSync = false;
31+
private $_includeSync = false;
3232

3333
/**
3434
* @var ObjectManagerInterface
@@ -76,7 +76,7 @@ public function __construct(
7676
protected function configure()
7777
{
7878
$this->setName('cloudinary:download:all');
79-
$this->setDescription('Download images from Cloudinary to the local pub/media dir. Optionally, ignore synchronization state and download everything');
79+
$this->setDescription('Download images from Cloudinary to the local pub/media dir. Optionally, Include synchronization state and download everything');
8080
$this->setDefinition([
8181
new InputOption(
8282
self::OVERRIDE,
@@ -98,10 +98,10 @@ protected function configure()
9898
null
9999
),
100100
new InputOption(
101-
self::IGNORE_SYNC,
101+
self::INCLUDE_SYNC,
102102
'-i',
103103
InputOption::VALUE_NONE,
104-
'Ignore synchronization state and download all images',
104+
'Include synchronization state and download all images',
105105
)
106106
]);
107107
}
@@ -128,11 +128,11 @@ protected function execute(InputInterface $input, OutputInterface $output)
128128
if ($input->getOption(self::FORCE)) {
129129
$this->coreRegistry->register(Configuration::CONFIG_PATH_ENABLED, true);
130130
}
131-
if ($input->getOption(self::IGNORE_SYNC)) {
132-
$this->_ignoreSync = true;
131+
if ($input->getOption(self::INCLUDE_SYNC)) {
132+
$this->_includeSync = true;
133133
}
134134
$this->outputLogger->setOutput($output);
135-
$this->batchDownloader->downloadUnsynchronisedImages($this->outputLogger, $this->_override, $this->_ignoreSync);
135+
$this->batchDownloader->downloadUnsynchronisedImages($this->outputLogger, $this->_override, $this->_includeSync);
136136

137137
return 1;
138138

Model/BatchDownloader.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ private function _authorise()
178178
* @return bool
179179
* @throws \Exception
180180
*/
181-
public function downloadUnsynchronisedImages(?OutputInterface $output = null, $override = false, $ignoreSync = false)
181+
public function downloadUnsynchronisedImages(?OutputInterface $output = null, $override = false, $includeSync = false)
182182
{
183183
if (!$this->_configuration->isEnabled(false)) {
184184
throw new \Exception("Cloudinary seems to be disabled. Please enable it first or pass -f in order to force it on the CLI");
@@ -195,8 +195,8 @@ public function downloadUnsynchronisedImages(?OutputInterface $output = null, $o
195195
$baseMediaPath = $this->_directoryList->getPath(DirectoryList::MEDIA);
196196
$directoryInstance = $this->_fileSystem->getDirectoryWrite(DirectoryList::MEDIA);
197197

198-
if ($ignoreSync) {
199-
$this->displayMessage('<comment>== [Notice] == Process started with ignore-synchronization flag.</comment>');
198+
if ($includeSync) {
199+
$this->displayMessage('<comment>== [Notice] == Process started with include-synchronization flag.</comment>');
200200
}
201201

202202
//= Checking migration lock / Start migration
@@ -269,7 +269,7 @@ public function downloadUnsynchronisedImages(?OutputInterface $output = null, $o
269269

270270
//Flagging as syncronized
271271
$resource->setImage(Image::fromPath($localFilePath, $localFileName));
272-
if ($ignoreSync || $resource->getImage()->getRelativePath() && !$this->_synchronizationChecker->isSynchronized($resource->getImage()->getRelativePath())) {
272+
if ($includeSync || $resource->getImage()->getRelativePath() && !$this->_synchronizationChecker->isSynchronized($resource->getImage()->getRelativePath())) {
273273
$this->displayMessage('<comment>=== [Processing] Flagging As Syncronized...</comment>');
274274
$this->_synchronisationRepository->saveAsSynchronized($resource->getImage()->getRelativePath());
275275
} else {

0 commit comments

Comments
 (0)