Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:62389 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 12198 invoked from network); 22 Aug 2012 07:06:57 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 22 Aug 2012 07:06:57 -0000 Authentication-Results: pb1.pair.com header.from=christoph.hochstrasser@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=christoph.hochstrasser@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.170 as permitted sender) X-PHP-List-Original-Sender: christoph.hochstrasser@gmail.com X-Host-Fingerprint: 74.125.82.170 mail-we0-f170.google.com Received: from [74.125.82.170] ([74.125.82.170:42365] helo=mail-we0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 0B/E1-02556-C0584305 for ; Wed, 22 Aug 2012 03:06:55 -0400 Received: by weyr1 with SMTP id r1so443401wey.29 for ; Wed, 22 Aug 2012 00:06:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:message-id:in-reply-to:references:subject:x-mailer :mime-version:content-type:content-transfer-encoding :content-disposition; bh=eHKQ8BfSVG8eMcTEXgYVi159+vTAISKrccK6WzNjAB0=; b=Yil8KsyQ6fCxo5e3VfxYokEFTrvoi5KKdIaDYj5EE1p0T+i5O4aIZb2/m1qw2SI1oV YmZsAfdJkMcF3gmZV6ZwBy0jsZPwFD3djCVltfhJZpq2kfNa+WHp0Gbtlyl/6fc1S1Ad TD/ZNPq7EfBv4SHVmwJllI4Cg4X57nmPwTa6cn6oygjcZ0ic8tRc//+zYs5aUG2W2eF4 jxLwPpLw0Q5zjMxEURdM+h8GiNTu0TO6shqLhmLKRm5scf7aToMNCsowuX3Yllrc11Ni BD7HuES5Cdf2gA4ZQPPluzZSCe9yPyVJiOBugm4g5ev/lqJr7sjjeNigj1g5fUcwcv8S bJ2g== Received: by 10.216.42.65 with SMTP id i43mr10789057web.208.1345619208048; Wed, 22 Aug 2012 00:06:48 -0700 (PDT) Received: from [192.168.15.48] (cm165-189.liwest.at. [81.10.165.189]) by mx.google.com with ESMTPS id t8sm37783509wiy.3.2012.08.22.00.06.46 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 22 Aug 2012 00:06:47 -0700 (PDT) Date: Wed, 22 Aug 2012 09:06:47 +0200 To: Lars Schultz Cc: internals@lists.php.net Message-ID: <2318376F24EC4B76AD4828C7F8E62B46@gmail.com> In-Reply-To: <5032A163.9040500@toolpark.com> References: <5032A163.9040500@toolpark.com> X-Mailer: sparrow 1.6.3 (build 1172) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Subject: Re: [PHP-DEV] Official Userland Library (was: removing an item from an array) From: christoph.hochstrasser@gmail.com (Christoph Hochstrasser) Hi, I find this idea awesome=21 We could maybe take some inspiration from oth= er communities, for example Ruby. In Ruby there's the =22Ruby Standard Li= brary=22 (http://www.ruby-doc.org/stdlib-1.9.3/) which is a collection of= classes written in Ruby and shipped with the Ruby distribution. I imagine something similar for PHP, but I'm uncertain if we should direc= tly put it into =22php-src=22, or provide it via with a PEAR/Composer pac= kage. The Ruby community also plans to unbundle the Userland Standard Lib= rary from the distribution, to make it accessible for other Ruby implemen= tations (which would be in our case also good). So I guess it would be be= st to ship PHP's Userland Standard Library as collection of functions, in= stalled as PEAR package by default, just like PHP=5FArchive. =20 If it's installed as a default PEAR package, then the library would alrea= dy be within PHP's include path by default, so the user could just =22req= uire=22 the needed modules. =46or example: require=5Fonce =22stdlib/strings=22; if (strings=5CstartsWith(=24foo, =22bar=22)) =7B // ... =7D I think the Userland standard lib should be structured in reasonable name= spaces (=22net=22, =22arrays=22, =22strings=22,=E2=80=A6) and could also = be a testbed for a redesign of PHP's standard library. So what we need would be: * Design document outlining the principles of the intended structure for= the =20 userland standard library. * Consistent conventions for error handling * Rule out, how the user should use the code. Require individual modules= or =20 include everything with one =22require=22=3F * The Userland Standard Library available as PEAR/composer package. * R=46C ruling out the way to ship the Userland Standard Library with th= e PHP distribution. -- =20 Christoph Hochstrasser =E2=9D=96 http://twitter.com/hochchristoph =E2=9D=96 http://christophh.ne= t =E2=9D=96 https://github.com/CHH =E2=9D=96 Am Montag, 20. August 2012 um 22:43 schrieb Lars Schultz: > Am 20.08.2012 19:43, schrieb Sebastian Krebs: > > What I don't understand is, why should every function goes directly i= nto > > the core, if you can achieve exactly the same without core changes=3F= > > =20 > =20 > =20 > =20 > This comment from Sebastian got me thinking. It's true. Every-someone =20 > has his own views on what is absolutely necessary and should be =20 > available to every-one. Depending on ones coding style, it probably is = =20 > absolutely necessary. > =20 > Whenever a userland implementation is viable, it becomes a strong =20 > argument against embedding it within the core. > =20 > But those suggestions keep coming up and some create more than a little= =20 > controversy among the contributors to the list and even among the =20 > core-developers. That said: > =20 > Why dont we embed a library of userland code right there in the =20 > documentation, next to the core code, where a php-user would expect or = =20 > look for the functionality. They'd have to be properly highlighted as =20 > userland implementations of course but would still be there to be found= =20 > in the documentation. This would at least solve the problem of: > =20 > - =22horrible=22 implementations, replaced by neatly formed official =20 > userland solutions. > - performance (because they would be as efficient as possible) > - correctness (because discussed on the internals (or docs) list, almos= t =20 > as if it'd go into the core) > - skill (because everyone can provide a solution, even if he's not able= =20 > to write c-code) > - availability (because with a simple copy/paste-action I can use the =20 > provided (currently) official solution immediately. > =20 > It sounds a lot like PEAR, I guess...but I wouldn't consider PEAR a =20 > source for a userland implementation of, say, array=5Fremove or =20 > print=5Fr=5Fhtml. Also its alot more accessible and available than PECL= , =20 > because it is after all just PHP code. > =20 > I am not sure wether this is a good idea, but it struck me as a better = =20 > solution than just saying: it's so simple, do it yourself. > =20 > =20 > -- =20 > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > =20