Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:56196 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 29258 invoked from network); 9 Nov 2011 16:03:46 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 9 Nov 2011 16:03:46 -0000 Authentication-Results: pb1.pair.com header.from=ircmaxell@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=ircmaxell@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.216.170 as permitted sender) X-PHP-List-Original-Sender: ircmaxell@gmail.com X-Host-Fingerprint: 209.85.216.170 mail-qy0-f170.google.com Received: from [209.85.216.170] ([209.85.216.170:41697] helo=mail-qy0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E4/00-28841-164AABE4 for ; Wed, 09 Nov 2011 11:03:45 -0500 Received: by qyg14 with SMTP id 14so5020971qyg.8 for ; Wed, 09 Nov 2011 08:03:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=pHzTvI45Hs9EsNK5mAfkB7MOotflHccqL+ug4xOP8gI=; b=eB9nZQaXp3BVomjH5TSnBuj11Q4j5hzAlNjjvikQC0m6Yv38J3ide2ClwECXjWbt6I mlmKm+G+1rA+c24WDI3pqYRSRPN3Dbs3vnIzT2k4y32tCxTvLlrYRktL4D9KoKqqWz1Q Rw+b6x/HGkCdmYYY+/isXTAMrS5sGmh+Uf860= MIME-Version: 1.0 Received: by 10.224.42.138 with SMTP id s10mr2594490qae.92.1320854622686; Wed, 09 Nov 2011 08:03:42 -0800 (PST) Received: by 10.229.6.202 with HTTP; Wed, 9 Nov 2011 08:03:42 -0800 (PST) In-Reply-To: References: <4EB81703.7030605@hoa-project.net> <4EB81C84.8010609@hoa-project.net> <4EB820BB.2030009@lsces.co.uk> <4EB822D4.4060306@hoa-project.net> <4EB89C36.5000503@garfieldtech.com> <4EB8A22B.8000607@lerdorf.com> <-4079824451837834664@unknownmsgid> Date: Wed, 9 Nov 2011 11:03:42 -0500 Message-ID: To: Rafael Dohms Cc: Will Fitch , "internals@lists.php.net" Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] SplClassLoader RFC Voting phase From: ircmaxell@gmail.com (Anthony Ferrara) Rafael > This makes life as a PHP developer much easier and having the standard> "= valued" by PHP by having a SplClassLoader that allows any library to> not n= eed to implement a autolaoder if no framework is present allows> for much n= icer "plug and play" interaction of libraries, less work for> their develop= ers and even less for the users. I would have to disagree here. When I need to use a library or a framework or whatever, I usually just bootstrap it and done. So instead of having to care about figuring out how to map the namespaces, or place them appropriately, I just call the included bootstrap.php in the library and it does the rest. You can take a peak at an example of that here: https://github.com/ircmaxell/PHP-CryptLib/blob/master/lib/CryptLib/bootstra= p.php If you're going for ease of use and interoperability, providing a bootstrap file is going to be king to any autoloader/naming scheme. Some libraries may have specific steps that it needs to do at startup to work. That's what a bootstrap is for. Some libraries may need to include and define functions or constants. That's what a bootstrap is for. Remember, libraries are more than collections of classes. They may contain other things that autoloading just doesn't take care of. Sure, the thought of just being able to add it to an autoloader to take care of including the library may suffice for 90% of use cases. But it won't work (or won't work well) enough times that I'm not sure if it's even worth trying to reach for that goal. Thanks, Anthony On Wed, Nov 9, 2011 at 10:23 AM, Rafael Dohms w= rote: > On Wed, Nov 9, 2011 at 12:04 AM, Will Fitch wrote: >> ... >> I have to say, I've never heard the argument, "man, if there's one >> thing I'd like to standardize in PHP, it'd definitely be autoloading >> classes." =A0No, indeed I believe this is a group of frameworks trying >> to implement a standard into PHP that will help them all stay on the >> same page. >>... > > As a UserLand developer. > Building a new project and using libraries from various different > packages is a pain, as you need to worry about the autoloading of > each. > The push for PSR-0 has solved this, or at least gives all library > developers a heading so that new libraries that are now PSR compliant > , simply allow me to drop it in a folder and at most define a rule > that "\Such\Namespace" =3D> "vendor/" > > This makes life as a PHP developer much easier and having the standard > "valued" by PHP by having a SplClassLoader that allows any library to > not need to implement a autolaoder if no framework is present allows > for much nicer "plug and play" interaction of libraries, less work for > their developers and even less for the users. > > I'm a UG leader and i work a lot on Hackathons and pet projects, my > own and guiding other people's and this is the kind of feedback i get, > not having to worry about autoloading by simply having everyone follow > a common structure is a very good outcome of the standards push. To me > this goes much further the the "framework developer" and reaches the > common developer. > > And i for one think the developer is a very important part of PHP and > should be valued. > -- > Rafael Dohms > PHP Evangelist and Community Leader > http://www.rafaeldohms.com.br > http://www.phpsp.org.br > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > >