Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:88696 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 35696 invoked from network); 6 Oct 2015 14:01:15 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 6 Oct 2015 14:01:15 -0000 Authentication-Results: pb1.pair.com header.from=johannes@schlueters.de; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=johannes@schlueters.de; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain schlueters.de from 217.114.215.10 cause and error) X-PHP-List-Original-Sender: johannes@schlueters.de X-Host-Fingerprint: 217.114.215.10 mail.experimentalworks.net Received: from [217.114.215.10] ([217.114.215.10:50466] helo=mail.experimentalworks.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 53/A1-19251-924D3165 for ; Tue, 06 Oct 2015 10:01:14 -0400 Received: by mail.experimentalworks.net (Postfix, from userid 1003) id 62E8E4E81D; Tue, 6 Oct 2015 16:01:15 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on km31408.keymachine.de X-Spam-Level: X-Spam-Status: No, score=-1.0 required=4.0 tests=ALL_TRUSTED autolearn=unavailable autolearn_force=no version=3.4.0 X-Spam-HAM-Report: * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP Received: from [192.168.2.34] (ppp-93-104-12-149.dynamic.mnet-online.de [93.104.12.149]) (using TLSv1.2 with cipher DHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: johannes@schlueters.de) by mail.experimentalworks.net (Postfix) with ESMTPSA id A15494E81A; Tue, 6 Oct 2015 16:01:13 +0200 (CEST) Message-ID: <1444140068.15014.37.camel@kuechenschabe> To: somebody anon Cc: internals@lists.php.net Date: Tue, 06 Oct 2015 16:01:08 +0200 In-Reply-To: References: Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="=-q0b1Sd5rMXhV/NWv95Av" X-Mailer: Evolution 3.10.4-0ubuntu2 Mime-Version: 1.0 Subject: Re: [PHP-DEV] Re: Re: RFC proposal. From: johannes@schlueters.de (Johannes =?ISO-8859-1?Q?Schl=FCter?=) --=-q0b1Sd5rMXhV/NWv95Av Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, 2015-10-06 at 15:42 +0400, somebody anon wrote: Please fix your mail program to provide a name and In-Reply-To and References headers so that we can address somebody and your mails are sorted correctly. > I've implemented this function and two other size-related in php [1], but= I > think they should be in php core to avoid implementation of them by > thousands of people. This draft is only for demonstation purposes. There > are presented three functions: >=20 > a. size_format([$format,] $bytes [, $unit]): string If we do it this must be generic and work for "everybody". This is not trivial. i.e. for 1001 bytes depending on context any of these might be "correct": * 1001 byte * 0.98 KiB * 0.98 kB * 0,98 kB * 1 KiB * 1 KB * 1 Ko * ... Also one often wants different precision depending on the value * 100 MB (not 100.23 MB) * 1.44 MB (not 1 MB) Feel free to come back with a more complete proposal and provide a name, a proper subject etc. (... and even then I doubt this has to be part of the core distribution, we should only add things which can't be done in userland (due to libraries or performance requirements or similar) as userland code is more flexible to change/improve and simpler to debug for users and especially with PHP 7 fast enough for mot things) johannes --=-q0b1Sd5rMXhV/NWv95Av Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) iQEcBAABAgAGBQJWE9QkAAoJEH3sTmn8nIPXYEcH/0Xh5+kfv5P2XTmUtkEurZZ4 j9X/ToFvxaTXi7ygPnMxlgxDFqouloV6FN6h4FO4yeLKKFcrd6D3zcZ4bARzE+3+ u7QNDF39K6BVFSC8QlYBOjEF83bwoUQs/ZOc20cpNg7k2ysfv7z/5aHsQee8+b3S FWW0t6wau6VD4VswdAi5BMGJ8XaZocs06S/2/wCVf3poDHAa6NgHiwcJGPr0fDCH UBtmdsfsoIvdNX8Z5zBBheB2EaKaY5WLSrrrHtrfo8PbM18bYVzQwdiLD3Dz75cn pO9p7vR/n8rS8CXHZvatYkyZW8MC5JyM4A2qgAxQzFBRd57KwruO4IM6kZm8vbg= =5IlQ -----END PGP SIGNATURE----- --=-q0b1Sd5rMXhV/NWv95Av--