Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:68130 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 67608 invoked from network); 16 Jul 2013 22:29:21 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Jul 2013 22:29:21 -0000 Authentication-Results: pb1.pair.com smtp.mail=hw2.eternity@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=hw2.eternity@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.214.173 as permitted sender) X-PHP-List-Original-Sender: hw2.eternity@gmail.com X-Host-Fingerprint: 209.85.214.173 mail-ob0-f173.google.com Received: from [209.85.214.173] ([209.85.214.173:60758] helo=mail-ob0-f173.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id F2/1B-20914-049C5E15 for ; Tue, 16 Jul 2013 18:29:20 -0400 Received: by mail-ob0-f173.google.com with SMTP id wc20so1418970obb.4 for ; Tue, 16 Jul 2013 15:29:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; bh=FBTyddtoiLIp+Zh+onBmWv905HX0Gq63bnORHaItJKY=; b=t+ZctzD2C7OteIItGD8lg4gl3GrlGdaMOUVTyxaju/yvcvjF6vtoz90J7OrFPazQI9 xzibtfyER4S2cIZTcE+KM0nzkEORfrJbQwqvkLoeoyjflhgxFXli+oAjFuRoxZ3NNWtD +pRxgWfC3oA26huXS6ymM6QNyoU6X8DWP7T6ZJkGduYAaMY+oLFOdvRA9Inyz2xcK0lp 1Yo6p5l6n1nrigw2RDTb2hL/90wjp4Apy38Ocjutpe5+MOit5dMkx80WUVWb9FpdKc7Q cqCPqOCaqObYIKW64wH1xDD9REM/ugs5pGX9fv29LF0MCI98KNxN0NQj0fu4c9Ub6FaB SrTg== MIME-Version: 1.0 X-Received: by 10.60.37.74 with SMTP id w10mr4655414oej.30.1374013757392; Tue, 16 Jul 2013 15:29:17 -0700 (PDT) Sender: hw2.eternity@gmail.com Received: by 10.182.135.76 with HTTP; Tue, 16 Jul 2013 15:29:17 -0700 (PDT) In-Reply-To: References: <1373879683.17031.4.camel@guybrush> Date: Wed, 17 Jul 2013 00:29:17 +0200 X-Google-Sender-Auth: 5q_05kN8B9Nxnx2jwsPlU09W9cs Message-ID: To: internals@lists.php.net, Sebastian Krebs Content-Type: multipart/alternative; boundary=089e013cc49ced12cc04e1a8811c Subject: Re: [PHP-DEV] PHP proposal on modular systems From: giuseppe.ronca2@gmail.com (Giuseppe Ronca) --089e013cc49ced12cc04e1a8811c Content-Type: text/plain; charset=ISO-8859-1 Sorry , i think you're misunderstanding the main concept of this proposal .. take a look at this post: http://news.php.net/php.internals/68118 it explains how you could solve this problem using namespace. You can actually have 2 version of the same library loaded inside same process . But namespacing libraries ,using version number encoded in namespace, is not a common technique...and manually namespacing libraries is often a long job. It could be solved by precedent language features IMHO i've exposed. And many people can gain on this.. Composer too. 2013/7/16 Giuseppe Ronca > You can have multiple objects from the same type in different >> implemenations in the same process? >> > > > No i'm not saying it. > > > >> What should happen, when I instanciate an object of "test" in version X >> and >> pass it to a function, that expect it as version Y? To be consistent PHP >> _must_ trigger an error too, if something from the locally included file >> leaves its scope >> >> class foo { >> public static function bar () { >> local_include "test.php" / / file which includes "test" class; >> return new test (); // <-- error here >> } >> } >> Because else it is not a local scope anymore. >> > > > the concept as i said is the same of "nesting" a class inside another ( or > dynamically namespacing a file ) > > > if two different components need "Library v1.0" and "Library v2.0" .. they > will probably have same classes and namespaces ( but the code is not the > same ). So how could we use both lib at the same time? Actually php can't > load classes in a scope way so you can't do it in any way on global scope. > > nesting dynamically libraries inside a namespace or a class , we can > create objects that can be accessed only throught their root > namespace/class...something like: > > new Version1\ExternalLibrary\FooClass(); > > new Version2\ExternalLibrary\FooClass(); > > and also Composer will thankyou about it since they can solve > automatically problems . > > > >> Backward compatibility (or compatibility in general) between component is >> something the plugin maintainer should take care of, not the language. >> Regards, >> Sebastian > > > > i'm talking about backward compatibility of php version...not external > plugins etc...i think that my idea doesn't require any change to php apps > to adapt their code. > > --089e013cc49ced12cc04e1a8811c--