Skip to content

Commit

Permalink
[!!!][TASK] Remove lowerCamelCase Import/Export command options
Browse files Browse the repository at this point in the history
The lowerCamelCase options and the deprecation
warnings have been removed alongside with deprecated
tests.

Resolves: #96186
Related: #94902
Releases: main
Change-Id: I979b32797e7c84d7952c456cadc8623fe26a7a4d
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/72448
Tested-by: core-ci <typo3@b13.com>
Tested-by: Oliver Bartsch <bo@cedev.de>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Oliver Bartsch <bo@cedev.de>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
  • Loading branch information
nhovratov authored and lolli42 committed Dec 2, 2021
1 parent 5af323c commit 8d19f68
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 329 deletions.
Expand Up @@ -224,6 +224,19 @@ The following module configuration have been removed:
- :php:`navFrameScriptParam`
- :php:`navigationFrameModule` (Extbase)

The following command line options have been removed:

- :shell:`impexp:export --includeRelated`
- :shell:`impexp:export --includeStatic`
- :shell:`impexp:export --excludeDisabledRecords`
- :shell:`impexp:export --excludeHtmlCss`
- :shell:`impexp:export --saveFilesOutsideExportFile`
- :shell:`impexp:import --updateRecords`
- :shell:`impexp:import --ignorePid`
- :shell:`impexp:import --forceUid`
- :shell:`impexp:import --importMode`
- :shell:`impexp:import --enableLog`

Impact
======

Expand Down
89 changes: 5 additions & 84 deletions typo3/sysext/impexp/Classes/Command/ExportCommand.php
Expand Up @@ -161,37 +161,6 @@ protected function configure(): void
InputOption::VALUE_NONE,
'Save files into separate folder instead of including them into the common export file. Folder name pattern is "{filename}.files".'
)
// @deprecated since v11, will be removed in v12. Drop all options below and look for other fallbacks in the class.
->addOption(
'includeRelated',
null,
InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY,
'Deprecated. Use --include-related instead.'
)
->addOption(
'includeStatic',
null,
InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY,
'Deprecated. Use --include-static instead.'
)
->addOption(
'excludeDisabledRecords',
null,
InputOption::VALUE_NONE,
'Deprecated. Use --exclude-disabled-records instead.'
)
->addOption(
'excludeHtmlCss',
null,
InputOption::VALUE_NONE,
'Deprecated. Use --exclude-html-css instead.'
)
->addOption(
'saveFilesOutsideExportFile',
null,
InputOption::VALUE_NONE,
'Deprecated. Use --save-files-outside-export-file instead.'
)
;
}

Expand All @@ -204,20 +173,6 @@ protected function configure(): void
*/
protected function execute(InputInterface $input, OutputInterface $output): int
{
// @deprecated since v11, will be removed in v12. lowerCameCased options. Also look for other fallbacks in the class.
$deprecatedOptions = [
'--includeRelated' => '--include-related',
'--includeStatic' => '--include-static',
'--excludeDisabledRecords' => '--exclude-disabled-records',
'--excludeHtmlCss' => '--exclude-html-css',
'--saveFilesOutsideExportFile' => '--save-files-outside-export-file',
];
foreach ($deprecatedOptions as $deprecatedName => $actualName) {
if ($input->hasParameterOption($deprecatedName, true)) {
$this->triggerCommandOptionDeprecation($deprecatedName, $actualName);
}
}

// Ensure the _cli_ user is authenticated
Bootstrap::initializeBackendAuthentication();

Expand All @@ -231,35 +186,16 @@ protected function execute(InputInterface $input, OutputInterface $output): int
$this->export->setTables($input->getOption('table'));
$this->export->setRecord($input->getOption('record'));
$this->export->setList($input->getOption('list'));
$this->export->setRelOnlyTables(
array_merge(
$input->getOption('includeRelated'),
$input->getOption('include-related')
)
);
$this->export->setRelStaticTables(
array_merge(
$input->getOption('includeStatic'),
$input->getOption('include-static')
)
);
$this->export->setRelOnlyTables($input->getOption('include-related'));
$this->export->setRelStaticTables($input->getOption('include-static'));
$this->export->setExcludeMap($input->getOption('exclude'));
$this->export->setExcludeDisabledRecords(
$input->getOption('excludeDisabledRecords') ||
$input->getOption('exclude-disabled-records')
);
$this->export->setIncludeExtFileResources(!(
$input->getOption('excludeHtmlCss') ||
$input->getOption('exclude-html-css')
));
$this->export->setExcludeDisabledRecords($input->getOption('exclude-disabled-records'));
$this->export->setIncludeExtFileResources(!$input->getOption('exclude-html-css'));
$this->export->setTitle((string)$input->getOption('title'));
$this->export->setDescription((string)$input->getOption('description'));
$this->export->setNotes((string)$input->getOption('notes'));
$this->export->setExtensionDependencies($input->getOption('dependency'));
$this->export->setSaveFilesOutsideExportFile(
$input->getOption('saveFilesOutsideExportFile') ||
$input->getOption('save-files-outside-export-file')
);
$this->export->setSaveFilesOutsideExportFile($input->getOption('save-files-outside-export-file'));
$this->export->process();
$saveFile = $this->export->saveToFile();
$io->success('Exporting to ' . $saveFile->getPublicUrl() . ' succeeded.');
Expand All @@ -273,19 +209,4 @@ protected function execute(InputInterface $input, OutputInterface $output): int
return 1;
}
}

/**
* @deprecated since v11, will be removed in v12. Drop all options below and look for other fallbacks in the class.
*/
protected function triggerCommandOptionDeprecation(string $deprecatedName, string $actualName): void
{
trigger_error(
sprintf(
'Command option "impexp:export %s" is deprecated and will be removed in v12. Use "%s" instead.',
$deprecatedName,
$actualName
),
E_USER_DEPRECATED
);
}
}
87 changes: 5 additions & 82 deletions typo3/sysext/impexp/Classes/Command/ImportCommand.php
Expand Up @@ -98,37 +98,6 @@ protected function configure(): void
InputOption::VALUE_NONE,
'If set, all database actions are logged.'
)
// @deprecated since v11, will be removed in v12. Drop all options below and look for other fallbacks in the class.
->addOption(
'updateRecords',
null,
InputOption::VALUE_NONE,
'Deprecated. Use --update-records instead.'
)
->addOption(
'ignorePid',
null,
InputOption::VALUE_NONE,
'Deprecated. Use --ignore-pid instead.'
)
->addOption(
'forceUid',
null,
InputOption::VALUE_NONE,
'Deprecated. Use --force-uid instead.'
)
->addOption(
'importMode',
null,
InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY,
'Deprecated. Use --import-mode instead.'
)
->addOption(
'enableLog',
null,
InputOption::VALUE_NONE,
'Deprecated. Use --enable-log instead.'
)
;
}

Expand All @@ -141,49 +110,18 @@ protected function configure(): void
*/
protected function execute(InputInterface $input, OutputInterface $output): int
{
// @deprecated since v11, will be removed in v12. lowerCameCased options. Also look for other fallbacks in the class.
$deprecatedOptions = [
'--updateRecords' => '--update-records',
'--ignorePid' => '--ignore-pid',
'--forceUid' => '--force-uid',
'--importMode' => '--import-mode',
'--enableLog' => '--enable-log',
];
foreach ($deprecatedOptions as $deprecatedName => $actualName) {
if ($input->hasParameterOption($deprecatedName, true)) {
$this->triggerCommandOptionDeprecation($deprecatedName, $actualName);
}
}

// Ensure the _cli_ user is authenticated
Bootstrap::initializeBackendAuthentication();

$io = new SymfonyStyle($input, $output);

try {
$this->import->setPid((int)$input->getArgument('pid'));
$this->import->setUpdate(
$input->getOption('updateRecords') ||
$input->getOption('update-records')
);
$this->import->setGlobalIgnorePid(
$input->getOption('ignorePid') ||
$input->getOption('ignore-pid')
);
$this->import->setForceAllUids(
$input->getOption('forceUid') ||
$input->getOption('force-uid')
);
$this->import->setEnableLogging(
$input->getOption('enableLog') ||
$input->getOption('enable-log')
);
$this->import->setImportMode(
array_merge(
$this->parseAssociativeArray($input, 'importMode', '='),
$this->parseAssociativeArray($input, 'import-mode', '='),
)
);
$this->import->setUpdate($input->getOption('update-records'));
$this->import->setGlobalIgnorePid($input->getOption('ignore-pid'));
$this->import->setForceAllUids($input->getOption('force-uid'));
$this->import->setEnableLogging($input->getOption('enable-log'));
$this->import->setImportMode($this->parseAssociativeArray($input, 'import-mode', '='));
$this->import->loadFile((string)$input->getArgument('file'), true);
$this->import->checkImportPrerequisites();
$this->import->importData();
Expand All @@ -200,21 +138,6 @@ protected function execute(InputInterface $input, OutputInterface $output): int
}
}

/**
* @deprecated since v11, will be removed in v12. Drop all options below and look for other fallbacks in the class.
*/
protected function triggerCommandOptionDeprecation(string $deprecatedName, string $actualName): void
{
trigger_error(
sprintf(
'Command option "impexp:import %s" is deprecated and will be removed in v12. Use "%s" instead.',
$deprecatedName,
$actualName
),
E_USER_DEPRECATED
);
}

/**
* Parse a basic commandline option array into an associative array by splitting each entry into a key part and
* a value part using a specific separator.
Expand Down
Expand Up @@ -55,7 +55,6 @@ public function importCommandPassesArgumentsToImportObject(): void
$input = [
'file' => 'EXT:impexp/Tests/Functional/Fixtures/XmlImports/sys_language.xml',
'pid' => 3,
// @deprecated since v11, will be removed in v12. Drop the lowerCamelCase options.
'--update-records' => false,
'--ignore-pid' => false,
'--force-uid' => false,
Expand Down

This file was deleted.

0 comments on commit 8d19f68

Please sign in to comment.