Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:83004 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 38667 invoked from network); 17 Feb 2015 19:28:39 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 Feb 2015 19:28:39 -0000 Authentication-Results: pb1.pair.com header.from=lisachenko.it@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=lisachenko.it@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.212.177 as permitted sender) X-PHP-List-Original-Sender: lisachenko.it@gmail.com X-Host-Fingerprint: 209.85.212.177 mail-wi0-f177.google.com Received: from [209.85.212.177] ([209.85.212.177:53034] helo=mail-wi0-f177.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id FD/70-34644-46693E45 for ; Tue, 17 Feb 2015 14:28:37 -0500 Received: by mail-wi0-f177.google.com with SMTP id bs8so36517484wib.4 for ; Tue, 17 Feb 2015 11:28:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=cco+QSfrhHL30qH50alvhenBLo/Eg3YqgB13vEeFA7k=; b=GvhZSf3NpP2fsorgexdNUD170N1IHw4shHT6oQ7S3CxFVSoxwOj/OXFATjN1fzYeGX MDurUMaEmqV4qac/N9APwE1gAh1SZKreCXXcyn14znp7mz+t7NyZ5gPHnRsZG6NZjs01 1ob1RwCcEQKVg/SAA9Li1ulAs0e6CWh6ZIrSEHhYE/1VadsubTK5B7Abs89iALL5yIOB xM79i7uyXRQyy2Bbg2Apopp4ZzO6rEpreP344r6SyL3g+nc6MQQD2ThpcF5dn05HvhD3 Rjq/wiRAVTNBy7BKMnNkIjF5CUtlqD7EurDLQBMWhjLnFR0/1HPDMdoSWKSGTBUuGW3z K3EQ== MIME-Version: 1.0 X-Received: by 10.181.13.14 with SMTP id eu14mr48474137wid.2.1424201313855; Tue, 17 Feb 2015 11:28:33 -0800 (PST) Received: by 10.194.154.229 with HTTP; Tue, 17 Feb 2015 11:28:33 -0800 (PST) In-Reply-To: <3325DBCC-DF31-4CC7-B8DB-84E35170824D@strojny.net> References: <3325DBCC-DF31-4CC7-B8DB-84E35170824D@strojny.net> Date: Tue, 17 Feb 2015 23:28:33 +0400 Message-ID: To: Lars Strojny Cc: PHP internals list Content-Type: multipart/alternative; boundary=f46d04388eb766ad49050f4db59e Subject: Re: [PHP-DEV] [RFC][Discussion] Parser extension API From: lisachenko.it@gmail.com (Alexander Lisachenko) --f46d04388eb766ad49050f4db59e Content-Type: text/plain; charset=UTF-8 Hello, Lars! 2015-02-17 22:09 GMT+03:00 Lars Strojny : > Looks cool and I could see a couple of interesting possibilities arising. > One thing: any particular reason ExtensionInterface is static? I could see > a couple of benefits having extensions carry state and registerExtension() > taking an instance of ExtensionInterface, not a class name. What do you > think? Thanks for the positive feedback! My first thought was to use instances for extensions: https://gist.github.com/lisachenko/ffcfdec4c46e01864b33. However, I have a doubts that this will introduce additional possibilities for side-effects, when extensions can be configured differently/loaded/unloaded. In this thread some people noticed this fact too and suggested to add a restrictions for preventing conditional parsing of the source code. So, static method and static registration was chosen to reduce a number of possible conditional extensions. This has some disadvantages (testing, configuration, etc), but should give better experience with parsing behavior. --f46d04388eb766ad49050f4db59e--