Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:112377 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 28417 invoked from network); 2 Dec 2020 17:50:13 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 2 Dec 2020 17:50:13 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 3D1A71804C6 for ; Wed, 2 Dec 2020 09:17:57 -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=0.0 required=5.0 tests=BAYES_20,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_NONE autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from dd46610.kasserver.com (dd46610.kasserver.com [85.13.163.220]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Wed, 2 Dec 2020 09:17:56 -0800 (PST) Received: from [192.168.178.23] (dynamic-077-008-187-045.77.8.pool.telefonica.de [77.8.187.45]) by dd46610.kasserver.com (Postfix) with ESMTPSA id 516015F8095C for ; Wed, 2 Dec 2020 18:17:53 +0100 (CET) To: PHP internals Organization: Aimeos GmbH Message-ID: Date: Wed, 2 Dec 2020 18:17:52 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Pass file handle in XMLReader From: norbert@aimeos.com (Aimeos | Norbert Sendetzky) Hi internals 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/faea5ab837ab6393c8821f85cf8abe2723593e8e/ext/xmlreader/php_xmlreader.c#L835-L887 Not sure where the constructor is implemented. Thanks Norbert