amnuts / opcache-gui

A clean, effective and responsive interface for Zend OPcache
1.22k stars 198 forks source link

improve readability of data (spaces between colon, data, and unit) #5

Closed tessus closed 9 years ago

tessus commented 9 years ago

Before:

before

After:

after

tessus commented 9 years ago

@amnuts hmm, I think it is needed, because as the code is right now (oh, I just checked, you removed it again), there's no space between the number and the unit.

amnuts commented 9 years ago

@tessus No, I promise it doesn't need that space there. :-) The line you updated is in the function that starts like this:

$memsize = function($size, $precision = 3, $space = false)

and then is called with something like:

'total_memory' => $memsize($config['directives']['opcache.memory_consumption'])

So you could make it something like:

'total_memory' => $memsize($config['directives']['opcache.memory_consumption'], 2, false)

or probably easier for your case would be to alter the definition to be:

$memsize = function($size, $precision = 3, $space = true)

to always have the space added.... But regardless, it's there is people want to change it in their own install but would prefer not to force it (I personally like to have no space).

tessus commented 9 years ago

Ok, thx. Now it makes sense. I haven't deduced that you didn't want the space, but tell people to change the arguments of the function in their local code. In this case I usually add a config file or some flag in the beginning of the code to make the configuration easier. :-)