Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:91042 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 34946 invoked from network); 1 Feb 2016 09:23:52 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 1 Feb 2016 09:23:52 -0000 Authentication-Results: pb1.pair.com smtp.mail=dmitry@zend.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=dmitry@zend.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 207.46.100.116 as permitted sender) X-PHP-List-Original-Sender: dmitry@zend.com X-Host-Fingerprint: 207.46.100.116 mail-by2on0116.outbound.protection.outlook.com Received: from [207.46.100.116] ([207.46.100.116:36736] helo=na01-by2-obe.outbound.protection.outlook.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 58/45-07168-5242FA65 for ; Mon, 01 Feb 2016 04:23:50 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=RWSoftware.onmicrosoft.com; s=selector1-zend-com; h=From:To:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=jn1Vv/qPNqSOKl6SlGp8DHE35DiRAJ6WBOXveGXDwMs=; b=sklL7RBMiY5dkOAhwUKEn325nL3o3AtTqNZR1F6niKND83gEy6uK2ZliOmvj+SZEWzirUKE03amAeTbNCJYrdCyL+8If8+BuwLsPgsjfB63cwHhPsrrvLt6RhQkjKmW2e4n2UDQO5Ka+O0rE17FeJHrJVRUUxs8JEflQhxQC99I= Authentication-Results: gmail.com; dkim=none (message not signed) header.d=none;gmail.com; dmarc=none action=none header.from=zend.com; Received: from tpl2.home (92.62.57.172) by BY2PR0201MB1781.namprd02.prod.outlook.com (10.163.72.23) with Microsoft SMTP Server (TLS) id 15.1.390.13; Mon, 1 Feb 2016 09:23:43 +0000 To: Anatol Belski , References: <03ca01d159da$fe2d76b0$fa886410$@belski.net> CC: 'Pierre Joye' , 'Xinchen Hui' , 'Nikita Popov' Message-ID: <56AF2410.3090009@zend.com> Date: Mon, 1 Feb 2016 12:23:28 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: <03ca01d159da$fe2d76b0$fa886410$@belski.net> Content-Type: multipart/alternative; boundary="------------060301060205030206060203" X-Originating-IP: [92.62.57.172] X-ClientProxiedBy: DB5PR06CA0033.eurprd06.prod.outlook.com (25.162.165.43) To BY2PR0201MB1781.namprd02.prod.outlook.com (25.163.72.23) X-Microsoft-Exchange-Diagnostics: 1;BY2PR0201MB1781;2:VmhSzr93Wikll9kS/q4XeWrraStSy5lx8LAl0lVdgsIWAR8+I51A0C3AyDV35OnZY33QzjEuqN2JwB1q6snCE0l4Bce0KAjKeOyRavs9ZYtrJrsKYMBK3z8B/W8ndQV1oh3n7//g4H3bAY1HiQzggw==;3:xBN14dFfrvUAbf+gXKW7idV3yZ9HZBatOVtk9TjM02AhJCFVfGC3p/Kw7Do5tZw4flDBw20ooOfyi7PlM3b9G+suWrqJYGstqyfU8bggJpLF7CR8QXlt/+JxzTBAljdN;25:eFGz2/gzHySkAEm/qNNpeUWsBTxG2k8NOpCaPlGOu3i1pPocnpqS97Q5XGQddmN2fdN+u5QY7mGmvCw3ufCb5jQgAnNqV1vLx8x9GaG/5B/Vc+spVCa31ZzW+MtRRuE6xCIscjg2zeelF2YrNOP+kaPFRuuWF6KFb8ShkAHk6hws17F2g5AJ+HP56cFry+5Dl9UeapIfVT/qHfp7rXxF9+N6CuigamD4GpcM/jVjkeRpjvvvHrKEfNuve7pXoHwL X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BY2PR0201MB1781; X-MS-Office365-Filtering-Correlation-Id: 91ad9476-435f-4408-1dd8-08d32ae96208 X-Microsoft-Exchange-Diagnostics: 1;BY2PR0201MB1781;20:Qp30Hqr0By/PwR0sBhnvDxrWTytz6J2FFZCqyOy0ZKmYYFO2QSD7KlHEbmNYDnZYfXE8QoXYG63pYuc1UUwGViTCcD3HoZdEciaexMDm13BpQWlkld4/8UBLErDLGaYzEnjM+E19uY4G9vdArkJnEAO3yKqZwBrI2qLVGqKBFWzv+Nmi9ymw+ajBzsecR7oa0MVU+Ap4AIQjBbQsHXr5etC5ZVz1FrfAzzLsBa1kpCMTQmm49mmHDjgrPyxDJD297T5ptdAdHOnfk1aFgiGWKb5785l7Jm+pNUn/jQVUb5X+eygI3iWo3bo9juHXfxVXYZow0mdoV/rR4M3xL1vMeAVuctUyUFUZKj5+i88RinvXOeWwJf/IN4Z4+CdB6LTWG+RDEBXJgccu02QMuwsDVxh/ed3moL1acj7hTFEKlCESCyv6//QWwc0w3A41arIHG5JzkP9zFDPf6bMwNFxqZxsawwOWGaSv3ofF3IbkrDige6tGpd+6XFONNZ8+HDEl;4:/6m/2rYnEKVxaH88xPbTkkfz5/7/7w5hBD3F0b9yVJxF+2aaG/qOakP70VNJmdEBCmpflpN1DytILzaRWgDu98q88McNW813rabvyYKoxTX/E6HHs127WES80sjonjgcHz270wfGjocUVqcX3hSOQ2dBEwWv1IRu13VpR3nJU5QGW2CdYlyoD5aMkGciZ2V5rwv58XDkt9at+EaT15kfZ9BmBImYZesLqhKpoA1gsQpcq6Bzvs3b1Tx/VG25H9takOvt25cizYues3jIc1MjpbLFrYdz5dx+AIomFa/NuUlqw8C/yvbypyMhTFAn8krnKIw3MHnhSuij6hPDrlHYmIuZEIgZwkLeOBYFSc3RD6uMLbwc5NjdM2AGbVRqkaKT X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046);SRVR:BY2PR0201MB1781;BCL:0;PCL:0;RULEID:;SRVR:BY2PR0201MB1781; X-Forefront-PRVS: 0839D067E7 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(479174004)(377454003)(76104003)(24454002)(3846002)(5008740100001)(87266999)(50986999)(65816999)(586003)(189998001)(54356999)(83506001)(76176999)(87976001)(80316001)(1096002)(19580395003)(512944002)(40100003)(33656002)(42186005)(86362001)(84326002)(4326007)(36756003)(64126003)(270700001)(59896002)(5001960100002)(122386002)(65806001)(66066001)(15975445007)(92566002)(2906002)(4001350100001)(77096005)(3470700001)(2950100001)(5001770100001)(65956001)(19617315012)(5004730100002)(15977405006);DIR:OUT;SFP:1102;SCL:1;SRVR:BY2PR0201MB1781;H:tpl2.home;FPR:;SPF:None;MLV:sfv;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;BY2PR0201MB1781;23:D4EG6zdDNXs80/wBg4SvjzLNvFpX3sc2namgGTh?= =?us-ascii?Q?FONzIeWcLvmCav3x6oVIum0PwdF1JosgyQMMQoTX7G53LoPj9gG/8MGx28HL?= =?us-ascii?Q?/gny7Ixa9PxMJuEAHyF57XA3x9WeDAKUfvj2xwA4Y6TnFjVjo4eQRhuKnZfK?= =?us-ascii?Q?5xLYz78V1BjgbM5k2wbLTgb7Rj3O8H4b42JoWCdnWIf3GIWbfGBP0tF0cMU7?= =?us-ascii?Q?brLfJgSnIxoJIx/PsSjxMy4K538rly1YJPUOL0x6enTvdliV8ScadbmAkiUW?= =?us-ascii?Q?k4CTfSQlwnex/EQ+cXqRFk8ZbPQzc+3xRtgmGK58zbnx5TD3cRZlz+iJLVnC?= =?us-ascii?Q?79mpBfjM6OeRGQyqcvtfrUTRS1Rpa43kLEzYe11WisZ6nzRM0PbUtIrMExSz?= =?us-ascii?Q?+xm3//AYr43kyo+ZPaaKNlwgTqt0UDs3CLjRPbvvuigqufbdT+20Z3PQvnAq?= =?us-ascii?Q?ae4IrATbbfA3YMxbZ7Pwj0M4Z6I98DlROQlIjjWveBmfxXqiur0Zeji98BMe?= =?us-ascii?Q?oqo7Ji2cG5/VEIpsHfAN10wOwWqs83iowHsZ7c9hE+b0RsM4UZb3R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IJPmXMeBMcpZtMcS2IACipp22xvtUddJCsKdzsVXPA09RZAcJUzO5et5qu/DbR963IK0GzQOQ= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: zend.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Feb 2016 09:23:43.3098 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR0201MB1781 Subject: Re: Streams and I/O refactoring approach From: dmitry@zend.com (Dmitry Stogov) --------------060301060205030206060203 Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit Hi, At current state, I see this not as a whole stream layer refactoring, but as a low-level replacement of POSIX layer on Windows. I see only few "visible" changes: 1. The layer first checks, if file names are valid UTF-8 strings, and use UTF-8 names or fall back to system locale. 2. The patch allows to use long file names (longer than MAX_PATH) using "//?/******" 3. Files now are opened in FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE mode (I'm not sure about intended better POSIX compliance and possible side effects). For me, the approach looks a bit inconsistent, especially the attempt to use the same string as UTF-8 and then using some code page. Thanks. Dmitry. On 01/28/2016 05:48 PM, Anatol Belski wrote: > Hi, > > I'm writing to ask for a review on the following: > > https://gist.github.com/weltling/29779b61db26c62b5ab0 > > It is quite far from being even near to be ready. It is an approach for the > streams refactoring. After some time playing around, I think that the ideas > I was initially approaching are to the big part not applicable to our code > base in its current state. For one, "isolate the actual concrete low level > implementations by platforms" - it's probably the goal 1. that has to be > done before anything else. However creating an isolated layer of structs for > every platform (libuv alike) most likely is not doable at the current stage, > if at all (and whether makes sense). > > So in this patch, I've started to create an I/O layer in win32, with the > goal to create a framework global to the whole PHP. This serves as the first > unavoidable step for the separation by platform. Ideally, we should have all > the abstracted low level I/O code for platforms concentrated at one place, > while currently all possible code parts of win32 I/O are spread over all the > code base - Zend, TSRM, ext/standard, win32. > > In the current state it is hard to both maintain and to develop these pieces > of our codebase. So sounds like a gross refactoring which might last for > some longer time. For the Windows part it'll bring a huge functional > advantage of using the native win32 APIs which means support for multibyte > and long filepath and improved security, later probably overlapped I/O. For > the overall codebase it'll mean simpler and better readable code, so more > stability and possibility to extend with new modern features more easily. > > Practically in this patch, with the approach I've described, I've > implemented several helpers and routines replacements for Windows that use > the native APIs. Particularly PHP's fopen and mkdir there support multibyte > filepaths and implementing the long path support is then quite easy. For > that to work cross platform, I define macros like php_ioutil_open, > php_ioutil_mkdir, etc. for the low level POSIX surrogates. There, I used > several parts from libuv to not to do everything from scratch. Also I've > started to pull the win32 related code out from zend_virtual_cwd.c, but > that's just a start. The plus of such approach is also that the work can be > done incrementally, moving the functions one by one, as the unported code > will stay compatible with function signatures and functionality. > > Please let me know what you think about this approach as it's a very early > stage which would be good to take the corrections. > > Thanks > > Anatol > --------------060301060205030206060203--