News Feed
Sections




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

Sameer Borate's Blog:
Simulating Packages in PHP
November 05, 2009 @ 07:52:20

Sameer Borate has a new post to his blog looking at the idea of simulating the idea of packages that several other languages have (like Java) with similar functionality to use them.

Most modern languages have a concept of packages, wherein related classes are stored together. PHP sadly doesn't have a similar concept. [...] But in the spirit of 'programming into the language', what we can do is try to simulate a 'package-like' concept in PHP.

Wanting to stick with the "import()" function call, he's created a bit of sample code to mimic Java's loading method. The function more or less does what the auloading included in PHP can accomplish and he points out two issues with it - it doesn't really do a real "import" just an include and that, how it stands, you cannot tell what order the files will be included in (no sorting at all).

0 comments voice your opinion now!
import package simulate tutorial


blog comments powered by Disqus

Similar Posts

IBM developerWorks: Building the DB2 Health Monitor Sample Application for PHP (Part 2)

Tom Jowitt's Blog: Streamlined PHP Development - Part II

Fabien Potencier's Blog: Create your own framework... on top of the Symfony2 Components (part 12)

Lukas Smith's Blog: Transforming end user queries to Solr

Chance Garcia's Blog: MAMP PRO, PECL, SSH2, and OSX CLI (AKA acronym madness)


Community Events





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


list unittest configure wordpress install community release series api symfony language application code threedevsandamaybe interview library developer introduction laravel podcast

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