Make WordPress Core

Opened 5 years ago

Last modified 2 months ago

#40875 reviewing enhancement

Add a petabyte constant

Reported by: henry.wright Owned by: johnbillion
Milestone: 6.0 Priority: normal
Severity: normal Version:
Component: Formatting Keywords: needs-patch needs-unit-tests
Focuses: Cc:

Description

I'm hoping I'll need to use this one day on my own site :)

define( 'PB_IN_BYTES', 1024 * TB_IN_BYTES );

On a serious note, this may now (on soon) be needed by some of the largest websites.

It's used just once in core as far as I can tell, and that's in size_format().

Attachments (1)

40875.diff (1.3 KB) - added by Presskopp 5 years ago.

Download all attachments as: .zip

Change History (8)

@Presskopp
5 years ago

#1 @Presskopp
5 years ago

  • Keywords has-patch added

Well, the day will come for somebody..

This ticket was mentioned in Slack in #core by presskopp. View the logs.


4 years ago

#3 @flixos90
4 years ago

  • Keywords needs-testing added
  • Milestone changed from Awaiting Review to Future Release

#4 @johnbillion
2 months ago

  • Component changed from General to Formatting
  • Keywords needs-patch needs-unit-tests added; has-patch needs-testing removed
  • Milestone changed from Future Release to 6.0
  • Owner set to johnbillion
  • Status changed from new to reviewing

As size_format() works with floats and strings we might as well add PB, EB, ZB, and YB too.

#5 @henry.wright
2 months ago

1YB is a trillion trillion bytes according to Wikipedia

Yikes :)

#6 @Presskopp
2 months ago

While we're on it, what about the base 2 / base 10 thing?

#7 @johnbillion
2 months ago

The current constants and size_format() function use base 2. What's the use case for base 10 versions? I think that can go into a separate ticket if there is a need.

Note: See TracTickets for help on using tickets.