Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:117709 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 83033 invoked from network); 9 May 2022 23:41:32 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 9 May 2022 23:41:32 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 1B6A7180211 for ; Mon, 9 May 2022 18:20:07 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=0.6 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,HTML_MESSAGE,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS2635 192.0.84.0/24 X-Spam-Virus: No X-Envelope-From: Received: from mx1.dfw.automattic.com (mx1.dfw.automattic.com [192.0.84.151]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Mon, 9 May 2022 18:20:06 -0700 (PDT) Received: from localhost (localhost.localdomain [127.0.0.1]) by mx1.dfw.automattic.com (Postfix) with ESMTP id F1EEF1CF57D for ; Tue, 10 May 2022 01:20:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=automattic.com; h=content-type:content-type:x-mailer:mime-version:message-id :subject:subject:from:from:date:date:received:received:received :received:received:received; s=automattic1; t=1652145605; bh=LXY 0suI17OjGC0Hx0rH+gAcyAvFA8L3J2P1pUrlStYg=; b=LZjDVaMy57J0MX/7Cly hlKdpDDaxaqORbYaY3FVBPsFc59WcLT8eOpEqfv8a4OKHu4udgBsFCdmrwuEr0gf 2vZOGw7w7m8Mqw4TT3ZBLvEwVwBJtGZbXFkIfbFG/j/O/NFUxgRWzclM3uIygcL0 ubWCbs4u+D/6dlYHuR2Qp3ROdkgAjWIwokA6C/WoszDhhNN2sfErNB8XuhNgptes 5yGgXQ+5hGZQ08E1PlisJobpH1Q/pfnW6kiN2wT2sRskjsrYawbdsu1xAps7aLtZ qfl2qhk6AZWnygCQeejjkuK93bPevWbJlti6H8lApfCNb6tdgZMLWitZEATCvX6e kgg== X-Virus-Scanned: Debian amavisd-new at wordpress.com Received: from mx1.dfw.automattic.com ([127.0.0.1]) by localhost (mx1.dfw.automattic.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id R9HW3w5Iew2x for ; Tue, 10 May 2022 01:20:05 +0000 (UTC) Received: from smtp-gw.dca.automattic.com (smtp-gw.dca.automattic.com [192.0.97.210]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx1.dfw.automattic.com (Postfix) with ESMTPS id 7D86F1CF558 for ; Tue, 10 May 2022 01:20:05 +0000 (UTC) Authentication-Results: mail.automattic.com; dkim=pass (2048-bit key; unprotected) header.d=automattic.com header.i=@automattic.com header.b="gbgjBDuw"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=a8c-com.20210112.gappssmtp.com header.i=@a8c-com.20210112.gappssmtp.com header.b="i5SaeHNR"; dkim-atps=neutral Received: from smtp-gw.dca.automattic.com (localhost.localdomain [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-gw.dca.automattic.com (Postfix) with ESMTPS id 2159DA0978 for ; Tue, 10 May 2022 01:20:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=automattic.com; s=automattic1; t=1652145605; bh=LXY0suI17OjGC0Hx0rH+gAcyAvFA8L3J2P1pUrlStYg=; h=Date:From:To:Subject:From; b=gbgjBDuwcpNOFCBjETghKC+EPeQGV64fe3vx1CHwJsfQG3GcoSuqDL9x3uaiIk1Ub 0bfTTz3e8Te75LGaJQTQLHvX+LfBgTEaksutpjmlQXdQTPpwNMPFi07T8wjqZkVBxd XS4GLOR3bGzVcJs6OtPS5TPHBvVnfPbcNmD2yQXBhz91UtJGEMssWMvgQvDfd5tDc0 q+4m1UzA2+JyBcSyskbBVMhrOOAAFfSOzWoNUlCPFzTKLS/hdj0PhSrn1IiZMLHdqJ /NyEbKQZbGnsgjhXkufZnTrBhyBlIIPs2geibrNtK7z4phUUOQtAhyA7VDKLrZEkUQ tB4diOtojQ7RQ== Received: from mail-pf1-f197.google.com (mail-pf1-f197.google.com [209.85.210.197]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-gw.dca.automattic.com (Postfix) with ESMTPS id 08E36A0793 for ; Tue, 10 May 2022 01:20:05 +0000 (UTC) Received: by mail-pf1-f197.google.com with SMTP id y5-20020aa79425000000b005104c6e01efso5352889pfo.23 for ; Mon, 09 May 2022 18:20:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=a8c-com.20210112.gappssmtp.com; s=20210112; h=date:from:to:subject:message-id:mime-version; bh=jYjEmMqS1whaMCr39JdK3I1XPTx4D887wZcItrOzRr0=; b=i5SaeHNRDeM/rXZIKH2EB7yQ9cyF0VI9UBnmBpj2VIM3cbj2UX9EhDENbD/l8Uz0lc a2uLWBsuadNOmjRSkQg9fAmKwkVA6iVExzg6l3a3bkDhamfr6ge7SazJvPFWwIkA01Xo LmsY+6lTCXnufnV09ffBSj6lwNmA32OKp22cLhvohAeBf8XrP/B1cdSYISkiutWlJ8Xm XEiccMf0J/8yo4kOzfCzjRSS7O6NHRGyIm5tkzZ223stsrUeQ9zz2z12M/yI9YmBq8x/ Dg5GFC7Jzce6lOwXhFUVww3Bh3pCeRyx4a3GZl2oqLJcTwj1WNSFZUv4jiHARw8kLXbw 2KVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:subject:message-id:mime-version; bh=jYjEmMqS1whaMCr39JdK3I1XPTx4D887wZcItrOzRr0=; b=lLqaiOE/eWs88lLFKNG5aA3XuHafuP/n4h8f7ErfwINLOL16qhhJfiNgR5vei/pj7/ JzhrQO8aQ9Wj1vgW5PpavOOuUaU+ku+637fIr0pG5cEBtmB1cAa6z8HbTCXDiovslyUe HgqS6aY+fmKMcgyf8gZP39KalhSx/XbHk2yT0vOT3O+xeBfkbKejhdr5hUUaLvGj6S83 DHXGqWer1U5CiJcaLhCVJL822Gjb+H3XBBedbF3CtnwPN0I8W9swlDHXwompMSNWoEmW 82t+QQnzLfQIpEgLMHKPLbj7UVC0lqF2QJ02Thj1D034mdV8Wqc9TrFDlZ1lUBpN4yY5 JqqA== X-Gm-Message-State: AOAM532mm0I0icUA1OJgZll5cadDu5dEDTQyDRkC+kxUUYSTjPlRNTRL cmGQEaly17QssDj87rZlvR1xHtoWDyaASxCP4ywlLtEMAxvr6GBCvWcmdLPPzOtuUcbCQgdGMkX XfotWd5kJN3MbqL3nCQ== X-Received: by 2002:a17:902:c78a:b0:15c:eccf:2055 with SMTP id w10-20020a170902c78a00b0015ceccf2055mr18466371pla.99.1652145603898; Mon, 09 May 2022 18:20:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzQ5cYXh6ff6YYFdwMa1Q+c27U+sjLDda3a72LRSOfRoPZiHLogv8EcYtZHJeKF1plaedpWGg== X-Received: by 2002:a17:902:c78a:b0:15c:eccf:2055 with SMTP id w10-20020a170902c78a00b0015ceccf2055mr18466343pla.99.1652145603570; Mon, 09 May 2022 18:20:03 -0700 (PDT) Received: from [10.0.0.29] (ip70-172-124-59.ph.ph.cox.net. [70.172.124.59]) by smtp.gmail.com with ESMTPSA id b187-20020a62cfc4000000b0050dc76281eesm9181774pfg.200.2022.05.09.18.20.02 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 09 May 2022 18:20:02 -0700 (PDT) Date: Mon, 09 May 2022 18:20:02 -0700 (PDT) X-Google-Original-Date: 09 May 2022 18:20:01 -0700 X-Google-Original-From: Dennis Snell To: Message-ID: <656B3B10-E159-4696-A814-76A2D4CB250F@automattic.com> MIME-Version: 1.0 X-Mailer: Unibox (443:21.4.0) Content-Type: multipart/alternative; boundary="=_B3CA2235-981F-4773-AD6A-FD0852070ACA" Subject: Re: [PHP-DEV] [RFC] Exposed parsed value of php.ini numeric directives From: dennis.snell@automattic.com (Dennis Snell) --=_B3CA2235-981F-4773-AD6A-FD0852070ACA Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable >=C2=A0`ini_get_size($option)` would be nice to have, but may not be feasib= le, see . I concur and did start by exploring this idea. It raised too many questions= when a simpler interface seemed to accomplish what we need in practice. > I guess it could [have ]be[en] useful to Symfony too: It's my presumption that many projects have had to build some workaround, m= ost of which are defective in a range of plausible values (such as the linked Symphony code that interprets= a `t` when PHP doesn't). Adding this scope-limited function could be dramatic in removing the need to port = PHP internals to outside projects. >=C2=A0Regarding the name: What about 'ini_get_as_bytes()'? It makes the= =C2=A0 relationship with 'ini_get()' clear by using the same prefix and the=C2=A0 suffix should be reasonable explanatory in what happens. > Just not sure whether it should be e.g. `ini_get_size($option)` (like ini_get) or rather e.g. `ini_parse_size($value)` (more generally usable). Given that many non-memory-size configuration settings also currently use t= his same parsing flow I have been mixed on associating this with "byte sizes" the way the PHP docs indicate. = In fact, based on the work in #7951 I've renamed my proposed function to `ini_parse_quantity( $shorthand )` and= rather like the match between the implementation and meaning. --- Dennis Snell --=_B3CA2235-981F-4773-AD6A-FD0852070ACA--