News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Volker Dusch's Blog:
Autoloading for legacy, non-framework projects
March 09, 2011 @ 12:02:06

In his latest post Volker looks at something he sees more and more projected implementing as a simple way to not have to manually define paths all over their applications - creating autoloaders. His post shows how to create one such autoloader for a legacy, non-framework type of project.

The first argument usually is "ease of use". It can get pretty annoying when you have to clutter your whole application with "require this file here and that file over there" statements. [...] The main motivation for autoloading usually is "getting rid of all the require statements and the problems resulting from forgetting one at one point where you don't notice it because on your machine it worked.

In some projects you're lucky enough to have class name to file name mapping to make it simpler. His project didn't have that, so he needed a way around it. His answer came in the PHP Autoload Builder tool - a handy command line script that works through your code and builds an index of sorts you can refer to for the correct class-to-file map.

0 comments voice your opinion now!
autoloader classmap phpautoloadbuilder tutorial


blog comments powered by Disqus

Similar Posts

Kevin van Zonneveld's Blog: Convert anything to Tree Structures in PHP

ZendCasts.com: Writing Custom Zend Filters with HTMLPurifier

Joshua Eichorn's Blog: Adding AJAX to a Website step by step, Part II

Sebastian Bergmann's Blog: Getting Started with Hamcrest

Artur Ejsmont's Blog: How to build mongodb pecl extension in 32bit for PHP 5.2 on OSX Snow Leaopard


Community Events

Don't see your event here?
Let us know!


configure part2 framework interview api conference podcast symfony2 language example laravel release composer php7 application opinion introduction performance community series

All content copyright, 2015 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework