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 > 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 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/bootstrap.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 <lis...@rafaeldohms.com.br> wrote: > On Wed, Nov 9, 2011 at 12:04 AM, Will Fitch <will.fi...@gmail.com> 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." No, 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" => "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 > > -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php