Skip to content

Conversation

@kamil-tekiela
Copy link
Contributor

This refactors all Export plugins. All methods now return void instead of bool. There were only two reasons when any of these methods would return false:

  • when OutputHandler has insufficient disk space to save file
  • when ExportJson cannot json_encode the output

ExportException exception was reused to handle these two cases. In the next PR, json_encode handling can be improved.

Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>

$this->outputHandler->addLine(
'/**' . "\n"
. ' * Database ' . $this->commentString(Util::backquote($dbAlias))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be translatable?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe, but it's not really part of this PR.

}
$this->outputHandler->addLine(
$tableAlias !== ''
? '== ' . __('Dumping data for table') . ' ' . $tableAlias . "\n\n"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Qustion: Here and in a few other places, shouldn't sprintf be used instead?

Suggested change
? '== ' . __('Dumping data for table') . ' ' . $tableAlias . "\n\n"
? '== ' . sprintf(__('Dumping data for table %s'), $tableAlias) . "\n\n"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, sounds good, but this PR is already huge, so maybe let's do it in the next PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants