Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:124253 X-Original-To: internals@lists.php.net Delivered-To: internals@lists.php.net Received: from php-smtp4.php.net (php-smtp4.php.net [45.112.84.5]) by qa.php.net (Postfix) with ESMTPS id 623771A009C for ; Sun, 7 Jul 2024 09:26:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1720344459; bh=LWeTSb6mZWRuin/gpGZkgDXC9BUVom0MzTumKx5JRHM=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=j30q0lDAFW2oDOJS7XPGVGBwYwcYeLqdiQ3NLc3utNVSy38XtGEqeZi4cmgoT0Nlc 49so3ieqtXkVBZyAxC3rODsx33r2XNvqk2UqnNXUlHuRLEcYkheF2oIrg/RVmBAT5q UHGQmLR9wSOvo7roFi/0TLKzJlcCV0G1HwYokDJ8EaIFeqhnoueJP8QYUmU8me8WcI hXieUHKHiCoH/kD0FdA+3EYp420j1Lc6wGU7MZnOQytHpSBxxJw00v6CYaOXBRz1Eo B2RxtXWL+jFxRm04I7cRPJtY8eyFo28h6ea72GctRHE9EBaBrL7IN3fceus0y8auzB jk94AwCabSFpg== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 8127A18062A for ; Sun, 7 Jul 2024 09:27:38 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS, FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: Error (Cannot connect to unix socket '/var/run/clamav/clamd.ctl': connect: Connection refused) X-Envelope-From: Received: from mail-pj1-f42.google.com (mail-pj1-f42.google.com [209.85.216.42]) (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 php-smtp4.php.net (Postfix) with ESMTPS for ; Sun, 7 Jul 2024 09:27:38 +0000 (UTC) Received: by mail-pj1-f42.google.com with SMTP id 98e67ed59e1d1-2c9a1ea8cc3so1779499a91.0 for ; Sun, 07 Jul 2024 02:26:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1720344373; x=1720949173; darn=lists.php.net; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=LWeTSb6mZWRuin/gpGZkgDXC9BUVom0MzTumKx5JRHM=; b=EBkBHOh1QaUloTlLBpT1Ei+xVSSsbe6f6a33aEuNbBEJFgMf1qh/sMk0zNDnxS0PA8 NP0KUl+FCKVFiue+fwLq8JfQRfhq3SvvQwinWb2RHlqbEB1uqvXCLfHjnlmJQooowBq3 Y6XHZWivjEKZxHEPl9JiziCrFbibLdCzsy1KXEHL85XvstqaOYH7+MUpR9/cUMvn55ji v8Yf4ZFhU0xnqBkN2L/Yb42h93onKKWKnVE+NQHT6HA8l2KHBPzB0Mk3bqnqe8YhOVNM WSaS/G8FU+bqg2CNoAjvstZTDEBd+7rOzqLSXl8Ju5B4uhh562Br0c5MV7U6vypHAuXD CbxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720344373; x=1720949173; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=LWeTSb6mZWRuin/gpGZkgDXC9BUVom0MzTumKx5JRHM=; b=JxCfQ10drykTDxYLeWOLqdq+42SmvXPy7Yy+Yt5N4Ucb8+VyZ0vLABBBjHukWXbgKM C3/tKpPndTj58v5zA/kKtKKJlVHT0xbr13aiDhoIxY9HlBS3rt1IdMR8zsRV6kWMaoJH WThlnl+QOgLb5+/cXoryUqke3nRQU5IPcT5rNtcGtvqgroQ71lv1RQP6guXE7O3yXXXL vLErh7iXBLUPDnKhju0YtgklDFgyVzYnhCpebTV5IBp833cA9thrRNt115B+AMXHV1mx z4k2d19YS+mfkEI+ODiZdhZykQ12NdAFexziPQdeMl8JuTnz9dEpXNskzigHDIzaN/kq 0zeQ== X-Forwarded-Encrypted: i=1; AJvYcCVZ6f3V5bYYSwF8YnLzPd8K/Aq/9JNIneqpAlXY63T1v8ph3XSPEEtZttW0YWXNcjsmm6QjVQfKtArKvcDdCQmAAXKesI13Eg== X-Gm-Message-State: AOJu0Yw12lGYroR8lGXzfFGWkSfUtNp6p6zmC+UmlH0oL3nf/PQ8CSbm rMj23oIvw4N8sB7laB6EFlqwu7yqbw3BMymTbi/9471wRxKgiV4j+Kc7jf4xyo+oaPSs+6kAPnK RPcV9RhbJuYcrj7skeVdMhrypOpRqhHbsENiT8A== X-Google-Smtp-Source: AGHT+IHhiiPqBWbfcbc0lLFQyTniwvUnO9Ns8wUjnu7P7S2qY4bY9HMHixygoDP/Y3PUyUFqhJsc1dUYnYqA87x3LEM= X-Received: by 2002:a17:90a:ca11:b0:2c9:a831:3b7d with SMTP id 98e67ed59e1d1-2c9a8313ca6mr11641713a91.18.1720344372899; Sun, 07 Jul 2024 02:26:12 -0700 (PDT) Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net MIME-Version: 1.0 References: <50DEC8FF-FBE1-4B39-AACD-076683499897@koalephant.com> In-Reply-To: <50DEC8FF-FBE1-4B39-AACD-076683499897@koalephant.com> Date: Sun, 7 Jul 2024 12:26:00 +0300 Message-ID: Subject: Re: [PHP-DEV] [RFC] [Discussion] Add WHATWG compliant URL parsing API To: Stephen Reay Cc: Bilge , internals@lists.php.net Content-Type: multipart/alternative; boundary="0000000000003cf7b8061ca4e3f1" From: kocsismate90@gmail.com (=?UTF-8?B?TcOhdMOpIEtvY3Npcw==?=) --0000000000003cf7b8061ca4e3f1 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Stephen, I agree with the others, the static parser class is weird. Either put the > static methods on the url class, or make the parser an instance with > options. > Yes, I was sure that many people would find the signature of the parser weird, and I can totally understand it. Since I don't have hard feelings about any of the approaches, I'll try to find out what way the proposal should be changed. For the record, let me repeat my explanation about the current design choice that I expressed in my reply to Niels: ... one of my major design goals was to make the UrlParser class to be > extendable and configurable (e.g. via an "engine" property similar to wha= t > Random/Randomizer has). Of course, UrlParser > doesn't support any of this yet, but at least the possibility is there fo= r > followup RFCs due to the class being final. > Since I knew it would be an overkill to require instantiating an UrlParser > instance for a task which is stateless (URL parsing), > finally I settled on using static methods for the purpose. Later, if the > need arises, the static methods could be converted to > non-static ones with minimal BC impact. Regards, M=C3=A1t=C3=A9 --0000000000003cf7b8061ca4e3f1 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi Stephen,

I agree with the others, the static parser class is weird. Either put the s= tatic methods on the url class, or make the parser an instance with options= .

Yes, I was sure that many people woul= d find the signature of the parser weird, and I can totally understand it. = Since I
don't have hard feelings about any of the approaches,= I'll try to find out what way the proposal should be changed.
For the record, let me repeat my explanation about the=C2=A0current desig= n choice that I expressed in=C2=A0my reply to Niels:

... one of my major de= sign goals was to make the UrlParser class to be
extendable and configur= able (e.g. via an "engine" property similar to what Random/Random= izer has). Of course, UrlParser
doesn't support any of this yet, but= at least the possibility is there for followup RFCs due to the class being= final.
= =C2=A0
Since = I knew it would be an overkill to require instantiating an UrlParser instan= ce for a task which is stateless (URL parsing),
finally I settled on usi= ng static methods for the purpose. Later, if the need=C2=A0arises, the stat= ic methods could be converted to
non-static ones with minimal BC impact.=

=C2=A0Regards,
M=C3=A1t=C3= =A9

--0000000000003cf7b8061ca4e3f1--