-
Notifications
You must be signed in to change notification settings - Fork 66
Include support for TB and GB database size formats #81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Add cases for tb and gb, so that terabyte and gigabyte options are support in the db command.
Match the existing to use terabytes and gigabytes
src/DB_Command.php
Outdated
define( 'MB_IN_BYTES', 1024 * KB_IN_BYTES ); | ||
} | ||
if ( ! defined( 'GB_IN_BYTES' ) ) { | ||
define( 'GB_IN_BYTES', 1024 * KB_IN_BYTES ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be 1024 * MB_IN_BYTES
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Made the change.
src/DB_Command.php
Outdated
define( 'GB_IN_BYTES', 1024 * KB_IN_BYTES ); | ||
} | ||
if ( ! defined( 'TB_IN_BYTES' ) ) { | ||
define( 'TB_IN_BYTES', 1024 * KB_IN_BYTES ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be 1024 * GB_IN_BYTES
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Made the change.
Changed GB_IN_BYTES to be defined correctly in MB_IN_BYTES and TB_IN_BYTES to be defined correctly in GB_IN_BYTES
Ah, I forgot to mention that we should also extend the test suite to cover these switches: https://github.com/wp-cli/db-command/blob/master/features/db-size.feature#L33-L51 @lukecav Could you add the additional test cases to the above feature file as well, please? It should be a matter of copy-pasting mostly. |
Add scenarios for both gb and tb.
Thanks, @lukecav ! |
Include support for TB and GB size formats
Added cases for tb and gb, so that terabyte and gigabyte options are supported in the db command for #80