Skip to content

Use --max_file_size=-1 to avoid splitting export files#12

Merged
danielbachhuber merged 5 commits intowp-cli:masterfrom
drzraf:no-max-file-size
Sep 29, 2017
Merged

Use --max_file_size=-1 to avoid splitting export files#12
danielbachhuber merged 5 commits intowp-cli:masterfrom
drzraf:no-max-file-size

Conversation

@drzraf
Copy link
Copy Markdown

@drzraf drzraf commented Aug 18, 2017

Fixes #8

@drzraf drzraf changed the title issue#8: --max_file_size=0 does not split the export --max_file_size=0 does not split the export Aug 18, 2017
@miya0001 miya0001 self-requested a review August 18, 2017 06:29
Copy link
Copy Markdown
Member

@miya0001 miya0001 left a comment

Choose a reason for hiding this comment

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

I am feeling -1 is better than 0.
It will be similar with the php.ini.

What do you think about it?

@miya0001
Copy link
Copy Markdown
Member

Can you add tests too?

@drzraf
Copy link
Copy Markdown
Author

drzraf commented Aug 21, 2017

PR updated (not sure about my new behat's test, couldn't run the tests yet).
-1 is now the documented value, but 0 has the same (undocumented) effect since it seems more logical to me (and may be a sane behaviour for possible future reuse)

0
"""

Scenario: Export spliting the dump
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This will need Given a WP install to set up the WordPress install.

}

$this->max_file_size = $size;
$this->max_file_size = $size <= 0 ? WP_EXPORT_NO_SPLIT : $size;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Let's make -1 the only supported argument to prevent unexpected, undocumented behavior.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

what to do with --max-file-size=0 ?
Isn't a zero or negative value explicit enough to keep from spliting dumps?

@drzraf
Copy link
Copy Markdown
Author

drzraf commented Aug 31, 2017

new commits (don't know if you received notification about this)

@danielbachhuber
Copy link
Copy Markdown
Member

@drzraf Is this completed to your satisfaction?

@danielbachhuber danielbachhuber changed the title --max_file_size=0 does not split the export Use --max_file_size=-1 to avoid splitting export files Sep 19, 2017
@danielbachhuber danielbachhuber added this to the 1.0.3 milestone Sep 19, 2017
@danielbachhuber danielbachhuber added the command:export Related to 'export' command label Sep 19, 2017
@gitlost
Copy link
Copy Markdown
Contributor

gitlost commented Sep 29, 2017

A problem is that WP_EXPORT_NO_SPLIT isn't getting defined if KB_IN_BYTES is defined, which is the case for modern WPs but not for older ones such as 3.7.11. This isn't visible currently on Travis, only locally in error_log. Another problem is that max_file_size is getting multiplied by MB_IN_BYTES, with no check for WP_EXPORT_NO_SPLIT.

A problem with the tests is that they need a database > 15MB to check the no-split versus the default.

I made changes (eventually) to address these in edit gitlost#2 gitlost#3, which I can push if desired.

@danielbachhuber
Copy link
Copy Markdown
Member

I made changes (eventually) to address these in edit gitlost#2 gitlost#3, which I can push if desired.

Please do!

@gitlost
Copy link
Copy Markdown
Contributor

gitlost commented Sep 29, 2017

which I can push if desired.

Okay, I don't know how to do this on this branch, even after reading https://help.github.com/articles/committing-changes-to-a-pull-request-branch-created-from-a-fork/, so I'll open a new PR.

@gitlost gitlost mentioned this pull request Sep 29, 2017
@danielbachhuber danielbachhuber merged commit d18fb60 into wp-cli:master Sep 29, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

command:export Related to 'export' command

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants