Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:68126 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 99186 invoked from network); 15 Jul 2013 22:31:15 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 15 Jul 2013 22:31:15 -0000 Authentication-Results: pb1.pair.com header.from=hw2.eternity@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=hw2.eternity@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.214.179 as permitted sender) X-PHP-List-Original-Sender: hw2.eternity@gmail.com X-Host-Fingerprint: 209.85.214.179 mail-ob0-f179.google.com Received: from [209.85.214.179] ([209.85.214.179:40190] helo=mail-ob0-f179.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 38/02-20914-13874E15 for ; Mon, 15 Jul 2013 18:31:14 -0400 Received: by mail-ob0-f179.google.com with SMTP id xk17so14551192obc.10 for ; Mon, 15 Jul 2013 15:31:11 -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=i0+sXl11HAjKymaaOr/z/tbcptCmpq6bzsxfcJJs3pI=; b=wmdvrRAzU0PAMgD0olz4SqZbsK/9RPtp+Zf9C3XTvQ+uswgmTZT0hm7HxPDGSrBCpR lV5vNLR/CZVczFPGK/dpRBDFEYkPGfMrnRcMMj5qYMx7m9lH1X+HCVA4ouUIrXqb76cX 6R7VUSIsyUQZ5MTVB5BKOfIWgCq3YNcBxVHVMF4sBdw9whVEO7leLLYf6lMPd03wb0rR CRjRYBrwfTELz5hHdL4kvLbyll/PBwnHDv8hQJtEvxW5kO1gq6XVDc7mCYwqn1ypXVjj GySADWgMx0REGMSSeOkLdeFsBKMwdQA0dMHAjmmZwCRH40tqgOA2yg8jJtRCg56mEhee 9dBA== MIME-Version: 1.0 X-Received: by 10.60.37.74 with SMTP id w10mr45174520oej.30.1373927471368; Mon, 15 Jul 2013 15:31:11 -0700 (PDT) Sender: hw2.eternity@gmail.com Received: by 10.182.135.76 with HTTP; Mon, 15 Jul 2013 15:31:11 -0700 (PDT) In-Reply-To: References: <1373879683.17031.4.camel@guybrush> Date: Tue, 16 Jul 2013 00:31:11 +0200 X-Google-Sender-Auth: 06X70un7ZQ12uUTxZjEUBRmwPpg Message-ID: To: Marco Pivetta , internals@lists.php.net Content-Type: multipart/alternative; boundary=089e013cc49ce0d4c304e1946a36 Subject: Re: [PHP-DEV] PHP proposal on modular systems From: giuseppe.ronca2@gmail.com (Giuseppe Ronca) --089e013cc49ce0d4c304e1946a36 Content-Type: text/plain; charset=ISO-8859-1 I've studied Composer and as i thought ..it's a "component installer" (implementing an autoload system) .. nothing else ( i can have similar result using git submodules ) anyway , *you can have a class collision using or not using composer ( it doesn't solve it, but just advise you that you can't install that package )* for example, if i require those packages ( that require respectively monolog 1.3 and monolog 1.2 ) : { "require": { "dbarbar/campfire-monolog-handler": "dev-master", "swestcott/monolog-extension": "dev-master" } } *composer will shows it:* - Can only install one of: monolog/monolog[1.3.0, 1.2.0]. - Can only install one of: monolog/monolog[1.3.0, 1.2.1]. - *Conclusion: don't install monolog/monolog 1.3.1 * so , since both of packages need same library ( but with different version ) you can't install them. It's the same limitation that you can find in CMS and external extensions ...and it's a language issue ofc. 2013/7/15 Marco Pivetta > > On 15 July 2013 16:51, Giuseppe Ronca wrote: > >> I'm not talking about this kind of problem... >> I think you know how a CMS works ... we've for example : >> >> * *CMS sources that are developed by Joomla devs ( i.g ) with theirs >> libraries.* >> * *Plugin (A) developed externally and installed by the final user, that >> >> includes inside its sources pclzip library ( the version and library >> doesn't matter) .* >> * *Component (B) developed externally and installed by the final user, >> that >> includes inside its sources pclzip library again.* >> > > That's why you got two names for a different implementation of the same > thing. > You can't call your own thing the same as the original one: it's not the > same. > That would even confuse the consumer, which doesn't know if it's the > original or the new one. > > >> >> Now ..since that library could not be installed in CMS by default, since >> devs of the Plugin (A) can't know if needed library is installed ( at >> their >> needed version ) inside another component...*we will have ofc a name >> collision when both plugin and component will be loaded.* >> > > That's actually one of the problems solved by composer... > > >> It could be also a problem of various languages...but classes in local >> scope / nested are a known technique used by different languages..and php >> could implements it even better. >> > > These classes still live under their own package, and their fully > qualified name is different from all others. > > >> In this way any CMS/Extension can arbitrary decide to use load their >> components/library in a private scope ( avoiding collision ) . >> i.g: >> >> class Loader { >> public static function LoadComponent () { >> local_include "foo_component/loader.php"; >> } >> } >> > > This is really coupled to your own system and with how extensible you > design it. > You may look at modern PHP frameworks to see how the problem of > extensibility is solved: it's mainly a DI/configuration issue that has > nothing to do with class names. > > PS i'm not so practice with composer ( used few times ) but when modular >> systems , such as CMS , give the possibility to extends them with external >> components...i don't think that composer could solve this problem. >> > > It is actually already happening. > You should really really really check it out before going further in > exploring already explored grounds. > > Marco Pivetta > > http://twitter.com/Ocramius > > http://ocramius.github.com/ > --089e013cc49ce0d4c304e1946a36--