Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:72594 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 14469 invoked from network); 14 Feb 2014 12:53:42 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Feb 2014 12:53:42 -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:50341] helo=mail-ob0-f173.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 04/E0-09381-5D11EF25 for ; Fri, 14 Feb 2014 07:53:41 -0500 Received: by mail-ob0-f173.google.com with SMTP id vb8so13791257obc.4 for ; Fri, 14 Feb 2014 04:53:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:content-type; bh=p7HRRRAHUgnznUI1pedaUsm6pWMEQG+xSMkruXE55N8=; b=viDPpF0ZUH0uuKMGXpCB810wF1WIgPeHai19m4oUoSaQ4GcpRqhubKBenLFjvLMWnK jfy+bs40G92HXSVzRImE8IOR7HxOj9L0EDW1V6cYV4wGIVhMxzvIJAL7WyJZZGxUIz/6 l0x0tNCW80m5eCiqWBy7aXu+Ao2SN09pqqlBGYsevP3oy/nNhhPFgAifCF3WwJZIrNVk OF1Jf+d9hZJeINJLWQQ7RuCxzexKxvuohWuIHts9vTPZVVnhC6YVFe6MGGCfRdxi2gu+ hrxvbZFfdRalWS6oNwB3WSoBPDzvc7+ZlXgYtwC2PZSghv0wzAXR2xsoWHzVif5kinrV ICKw== MIME-Version: 1.0 X-Received: by 10.60.33.229 with SMTP id u5mr172485oei.85.1392382417772; Fri, 14 Feb 2014 04:53:37 -0800 (PST) Sender: hw2.eternity@gmail.com Received: by 10.182.103.231 with HTTP; Fri, 14 Feb 2014 04:53:37 -0800 (PST) In-Reply-To: References: <1373879683.17031.4.camel@guybrush> Date: Fri, 14 Feb 2014 13:53:37 +0100 X-Google-Sender-Auth: B6StkkLjSe8c7QCh5S_K1ZweLBw Message-ID: To: internals@lists.php.net, Sebastian Krebs Content-Type: multipart/alternative; boundary=089e013d052c67274404f25d4ba4 Subject: Re: [PHP-DEV] PHP proposal on modular systems From: giuseppe.ronca2@gmail.com (Giuseppe Ronca) --089e013d052c67274404f25d4ba4 Content-Type: text/plain; charset=ISO-8859-1 Sorry for "necroposting" but i would bumping this because since package managers such as composer/bower etc. are growing , the hell of dependencies conflicts is increasing proportionally. here you are other examples: http://stackoverflow.com/questions/12656982/resolving-dependency-hell-with-composer http://stackoverflow.com/questions/15256416/symfony2-how-solve-two-bundles-requirements-conflicts-when-using-composer it's a real problem and not always caused by "bad programming". i think that the language itself must offer a solution in this case ( see javascript and no-conflicts techniques ) so , as explained in my first post, namespaces could be a nice solution if they can be nested or dynamically added in some way. 2013-07-17 0:29 GMT+02:00 Giuseppe Ronca : > 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. >> >> > --089e013d052c67274404f25d4ba4--