Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:89098 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 20522 invoked from network); 8 Nov 2015 14:11:46 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 8 Nov 2015 14:11:46 -0000 Authentication-Results: pb1.pair.com smtp.mail=pthreads@pthreads.org; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=pthreads@pthreads.org; sender-id=unknown Received-SPF: error (pb1.pair.com: domain pthreads.org from 209.85.160.172 cause and error) X-PHP-List-Original-Sender: pthreads@pthreads.org X-Host-Fingerprint: 209.85.160.172 mail-yk0-f172.google.com Received: from [209.85.160.172] ([209.85.160.172:33319] helo=mail-yk0-f172.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 11/48-06223-0285F365 for ; Sun, 08 Nov 2015 09:11:45 -0500 Received: by ykdv3 with SMTP id v3so139939023ykd.0 for ; Sun, 08 Nov 2015 06:11:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pthreads_org.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=iYnktgPOE+Nk9KUuvNUXyzak6UsRCnrqy7hF4n/tBwQ=; b=UPb+jSg36HlfOK5k6EsHzoupGzowvZXh64Wu1rh/7EWyk94pb/v4K5pTKLbNJYGWwc sMAQX0D+EqhWVy5IerEukZ1pY4xSA3C/nUbfRr6G4oOAumWIgcV3pD70YVKw6qt96MlJ LyLNEvMROwTkzfQAjmMzn3ZWIBIo0EfyiLqMHg0q7Jf3voO0tw6U7JFENIKBFTxfudUL puGKUgyLOXyB4lhg34odiJ6U9IM1vicPT0F2iwQgCOoSZk90rtKyMJlndCT6n8E+3o7H //J+YRgiJXFDFhhDwLwgHGNvwxUfbGFgq5kkRbNH94onG6Q78S98HO/7OzJiiyfdMaBx MU+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=iYnktgPOE+Nk9KUuvNUXyzak6UsRCnrqy7hF4n/tBwQ=; b=CbV2ppg23skM4+Oih/xZ2Zy2JQzUlhZiavo/VWhyzoMFTJjc9Z/NnNl0aSTsPnvvFa kKFtqgHKhEIq8WnYDEvTBrH7lKivN5165pL0wToXbaILkqO8xnDovX5EpyRf30zSb+Mz pmox1W0hdPXLyYEGkRrXA1HtVp8xx7yF6eKv2s//K2kqziudwfAT5oC6CUy5x8QSPoh5 P4mKeS4Wd1ggeJe3Iiy9f6XxbBiTHrdRknagCIVykKOrhpkTWDuvHRYD94hAH0flcj4K kD2ACgwHT7qNsA4KA86X9etOAne4FXRGfu+qga+9C6QW/762phRBWWR/hW2dLkxeIimx rnfg== X-Gm-Message-State: ALoCoQnexGQKt3X38aKr3Nmn6G7mU3sM9lBmy/8tmxEDh4sOmAooY+IYwg5dFTOtlBPVNugu0ZK5 MIME-Version: 1.0 X-Received: by 10.129.115.133 with SMTP id o127mr18628309ywc.102.1446991901082; Sun, 08 Nov 2015 06:11:41 -0800 (PST) Received: by 10.13.226.85 with HTTP; Sun, 8 Nov 2015 06:11:41 -0800 (PST) X-Originating-IP: [165.120.221.221] In-Reply-To: <563BEF66.4050202@php.net> References: <563BEF66.4050202@php.net> Date: Sun, 8 Nov 2015 14:11:41 +0000 Message-ID: To: =?UTF-8?Q?Fran=C3=A7ois_Laupretre?= Cc: PHP internals , Dmitry Stogov Content-Type: multipart/alternative; boundary=001a114736ac41fb2a0524080e50 Subject: Re: [PHP-DEV] PHP 7 : Cannot use stream wrappers during MINIT From: pthreads@pthreads.org (Joe Watkins) --001a114736ac41fb2a0524080e50 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable It doesn't sound like what you are doing belongs in MINIT, it seems to belong in RINIT. MINIT is only for module setup with regard to zend (and other deps perhaps), but you are preparing for the user, that's request stuff I think ... Cheers Joe On Fri, Nov 6, 2015 at 12:08 AM, Fran=C3=A7ois Laupretre wrote: > Hi, > > First, I don't know if this must be considered as a bug, because a lot of > features are not available during MINIT but it seems quite inconsistent. = I > precise I'm using the 7.x master branch (I don't know if it works on 5.x = or > not). > > I am writing an extension where I need to read a file tree during the > MINIT phase. So, I am using php_stream_scandir() to read some directories= . > At this time, php_init_stream_wrappers() has run, so I consider stream > wrappers are available. > > Unfortunately, this is not true because stream wrappers register resource= s > in EG(regular_list), which is not initialized before init_compiler() has > run. If I call zend_hash_init(&(EG(regular_list))) before calling > php_stream_scandir(), it seems to works. But it is not the solution becau= se > the hashtable is never destroyed and there are probably other side effect= s. > The same potentially applies to EG(persistent_list). > > So, does it mean that stream wrappers cannot be used during MINIT, or do > you know a workaround ? I can revert to the C stdio library but, for > portability reasons, I'd prefer using the plain wrapper. Every suggestion > is welcome. > > Another suggestion to help detecting such issues : can we consider, in > _zend_is_inconsistent(), that a HashTable whose nTableSize is null is > inconsistent and raises an alert. An uninitialized HashTable generally is > filled with 0s. Today, using an uninitialized HashTable goes undetected, > even in debug mode (because HT_OK =3D=3D 0), and is very hard to track. > > Regards > > Fran=C3=A7ois > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > --001a114736ac41fb2a0524080e50--