[ZendTo] Feature request: optional units on some preferences
Jules at Zend.To
Tue Jan 26 13:04:10 GMT 2021
As the preferences.php file is executable PHP, you could put settings in
'maxBytesForDropoff' => 24*1024*1024*1024,
at which point you can see exactly what it means.
Just a thought.
On Thu 10/12/20 16:42, Jules via ZendTo wrote:
> John and others,
> I didn't ignore this, I just mentally added it to the list without
> remembering to reply to you about it! :-/
> I should be able to do hours and days and stuff like that too.
> So that it matches with what happens in the code already, can we agree
> to use 1024, 1024^2, 1024^3 etc as the K, M and G multiples?
> For times I could allow s, h, d, w.
> So the multipliers would be (ignoring case):
> k = 1024
> m = 1024*1024
> g = 1024*1024*1024
> s = 1
> h = 60*60
> d = 60*60*24
> w = 60*60*24*7
> Are there any I have missed (I'm avoiding minutes in favour of megs).
> The syntax would have to change in the preferences.php file where you
> chose to use a suffix, as
> 'maxBytesForDropoff' => *24G*,
> is not valid PHP, it would need to be
> 'maxBytesForDropoff' => *'24G'*,
> but you would only need the quotes round ones where you chose to use a
> Sound okay to everyone?
> On Tue 17/11/20 19:13, John Thurston via ZendTo wrote:
>> Computers are good at doing math. Can we have the option of including
>> units on some preferences?
>> I'm thinking, particularly, about:
>> These are currently specified in bytes. This is generally a long
>> number which is hard to read and easy to stumble over. May we have
>> the default continue to be "number of bytes" but have it accept an
>> optional unit-suffix? For example:
>> 'maxBytesForDropoff' => 25769790582,
>> could be specified as:
>> 'maxBytesForDropoff' => 24G,
>> Old preferences would continue to work, and new preferences would be
>> easier to read.
> Julian Field MEng CEng CITP MBCS MIEEE MACM
> 'Solutions nearly always come from the direction you least expect, which
> means there's no point trying to look in that direction because it won't
> be coming from there.' - Douglas Adams
> Twitter: @JulesFM
> ZendTo mailing list
> ZendTo at zend.to
Julian Field MEng CEng CITP MBCS MIEEE MACM
The current UK shipping forecast:
Trafalgar: West or southwest 3 to 5, becoming variable 2 to 4 later. Moderate
or rough, becoming slight or moderate in southeast. Drizzle, fog patches.
Moderate or good, occasionally very poor.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the ZendTo