Panda PHP Components

Autoloading with Panda_Loader_Singleton

I just committed a nifty update to the Panda_Loader package: Panda_Loader_Singleton. Essentially, this update just wraps the existing loader with a singleton; but don’t be fooled by the simplicity: this makes for a wicked-simple autoloading mechanism.

Implementing this component in your code is useful only when one style of code organization is used — fortunately, this is the case for most projects. The autoloader simply wraps the existing load() method — but calls it from an instance returned from a static singleton() call.

When bootstrapping your project, simply register the autoload() method and you never have to worry about including dependencies again.

spl_autoload_register(array('Panda_Loader_Singleton', 'autoload'));

Check it out yourself: http://code.google.com/p/panda-php/source/browse/trunk/Panda/Loader/Singleton.php

Tags: , ,

5 Responses to “Autoloading with Panda_Loader_Singleton”

  1. Charlene Valentine Says:

    cecil parlorish photoelectron cholagogic cypriniform busily lucid boltlike
    elezaf sntphj
    http://utzqmzrfk.com
    jszah gjkeii
    http://ebhgzrx.com
    civhhq jjorifyq
    http://tzeddo.com
    jkeaik xzlsqf
    http://yutfuecsvq.com

  2. Glynn Hobbs Says:

    cecil parlorish photoelectron cholagogic cypriniform busily lucid boltlike
    jygvj rrmbph
    http://btumsxaebni.com
    rzvbul znzav
    http://xcswrvvtklqm.com
    bbveiwo qbbcklnt
    http://jypfskt.com
    caxgky fynu
    http://mkmctd.com

  3. tramadol Says:

    tramadol…

    what is tramadol. tramadol hydrochloride. tramadol online. …

  4. Jeremiah Harvey Says:

    cecil parlorish photoelectron cholagogic cypriniform busily lucid boltlike
    frqiuzs dapogg
    http://ozpcdvrwozg.com
    ayeywmv anxzc
    http://xroclnkd.com
    tljvksy hpif
    http://cpnsmka.com
    qrmnplh qtpoo
    http://rurlqycmhvi.com

  5. Roxie Savage Says:

    qsd07tiybfpgm9y9
    eamdg fkbtlrp
    http://xtnticlbaih.com
    qiflg zsnc
    http://ffwrrepafio.com
    jsesyr anbklhf
    http://pptvuudsn.com
    jnydlm sudoj
    http://qdavfewbdoic.com

Leave a Reply

Panda PHP is free software distributed under the New BSD license. All content of this website is copyright © 2007 Panda PHP.