Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:112412 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 54003 invoked from network); 4 Dec 2020 12:55:36 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 4 Dec 2020 12:55:36 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id F3ECE1804C9 for ; Fri, 4 Dec 2020 04:23:42 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mout.gmx.net (mout.gmx.net [212.227.15.18]) (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 ; Fri, 4 Dec 2020 04:23:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1607084619; bh=QqOlhbn6JlucQEz7JefrEVb8sBrhzYeYkJVOFuz6ies=; h=X-UI-Sender-Class:Subject:To:References:From:Date:In-Reply-To; b=L8Lch5SoSR+vkHwiZAC+z7ULgn++M9O0U1FxQdxIUeXl3VDilOIRAU0xnmMVn2i6I Tp2TvEBllN1b+YxVotON4yaHiu/d9ZztnhEM0GfLtOtRcL8x6/D+XY7GZ04QcPPZhB 7CNrI5TiqtmK1EcS2OVMByK1A8tzW7k15fH4iT9w= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [192.168.2.130] ([79.222.40.233]) by mail.gmx.com (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MMGN2-1kUBTB31M6-00JLh5; Fri, 04 Dec 2020 13:23:39 +0100 To: Aimeos | Norbert Sendetzky , PHP internals References: Message-ID: <186914ae-b5e8-382e-8766-58b45543b52d@gmx.de> Date: Fri, 4 Dec 2020 13:23:39 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.5.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: de-DE Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:xjhaOpgBuwSaKHSGqYUyCKHTqJnO5wzz5IIg/m6mclOSanDjRZh yHyYQmDQ4STYfvvwmqv5fjAgbKXNsYKstGZnDtvFv+jMCd1uln4e0pioOrI4sDn0nca0B1j I7jH8eFZnDA9/qtAJXe4bhQniEwqNBA8lnpkeaY+sFaQSeBvk25RzbYTvmxjV4sj0wnWLTD s/7kVXEMPmLoZCsUQDeKg== X-UI-Out-Filterresults: notjunk:1;V03:K0:0IknoSqaGEw=:A5WsiDKsxS22eSPqhWDONi powaDPbDeHAxJ5CnbKQYB8PleBvNFd/zracMTLywv3cpFdBNWuB5ptyomrywU+ZcNXNdScDFK gyquCjTXZ2lhQSsmzDuZKtMFlKgwj24WePnaZ/nTLLTbG7JYqiXn1TGQGdy/nxiIvpPwf8L7V EfKlhVvyvKTMweZ3dUn5bzfypSpPTH0MH9JA64h2T6mT94pgVK7OQj9zvJdSz/Lr2DnFs5haY NswNcGkWcgqE7wyMq717YNoalfBBbHxcHZoKYqHZTfjFcDzJIqkSKqUCguxD1Wi3vX6FRvzeG Tn/qx7B5xw0H9qNROvKyqua/PKdjsgXt9Wws54+E2KgGwjGTbhPMdc7VoSUBZFQl+AzdxmJe1 FyPPN4eKmdczWi6IxSDzZsNTUjS/E8/kst0SHWeX7t2oJKGrvhe6cotFBHs2kLYpvzG3WU9Ou PyGwsY7Kk/GULRk6LqSHeHYaPLuiHDzjzo89xRnzEVFZ5KpwlLkiKy8IOvFuYlA7oGUNHYp1U ZuYPn9SpqbZyMUDibpgmhQhlE9hPaa5/rPC5fLb0i9qOaptAqny4Cna73JqtyOSO9fHK06HFM OWVJJz4bDYnuM1zGM3P2HPP5TI8FmulOxbkWbnayHQXZcJJ4Utex8x+RXuY4b+k2XKT8RTFvd vsNU7cJyFDz8EBpicz78+A+ETO3bRq+3nfOfALdBPvbgJJfA5O1M1beOUMJmDNgw+/XD4h1IZ Cw6sfZAieFmb0qxdTp0oWdt1s8LmTfgGbUT0IBPiVQFlQbeA9oqgqa2M24yE+8L7dqvYIJgHy fEj9QEKHpJa8kY6+1sK2Cm/Kcuuhgo3yCUQkUgLspdsPfSfVWQ4s++LoVvChBvgM8421ebfEA PgSW0iEYTNEjtv/a1fRA== Subject: Re: Pass file handle in XMLReader From: cmbecker69@gmx.de ("Christoph M. Becker") On 02.12.2020 at 18:17, Aimeos | Norbert Sendetzky wrote: > The XMLReader object only allows a file name in the constructor and the > open() method. While this is OK most of the time, files stored at cloud > services not accessible via an URL must be downloaded first. For big > files (e.g 100MB to 1GB and more), this requires a lot of time and > resources. > > If the XMLReader would be able accept a file handle too, we could pass > the handle of a stream to the methods and the XMLReader could process > the XML data on the fly without the need of a local copy. > > Is it possible to allow a file handle in the existing methods or is a > new one required due to type or other constraints like implementation > difficulties? > > The open() method is implemented here: > > https://github.com/php/php-src/blob/faea5ab837ab6393c8821f85cf8abe272359= 3e8e/ext/xmlreader/php_xmlreader.c#L835-L887 For clarity, it might be preferable to introduce a new static creation method for this. The implementation could probably use xmlReaderForIO()[1], instead of xmlReaderForFile(). [1]