News Feed
Sections




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

Stubbles Blog:
Lazy loading of classes stored in a session without __autoload()
March 19, 2007 @ 10:39:00

On the Stubbles blog today, there's a warning from Frank Kleine about using the session.auto_start setting in your PHP installation and it preventing you from working with objects. As per the PHP manual:

If you do turn on session.auto_start then you cannot put objects into your sessions since the class definition has to be loaded before starting the session in order to recreate the objects in your session.

Frank points out that this also includes calling session_start before defining other classes to be used. They've come up with their own solution, though, using a base interface object for all of their classes. This object is included in each of the pages, eliminating the worry about having multiple objects and classes to mess with.

0 comments voice your opinion now!
autoload class lazy session object serialize autoload class lazy session object serialize


blog comments powered by Disqus

Similar Posts

DevShed: Creating AJAX Requester Objects with Abstract Factory Classes in PHP 5

Zend Developer Zone: Aaron Wormus Talks about his Session at ZendCon and Migrating to PHP 5

Felix Geisendorfer's Blog: A PHP developers guide to JavaScript - Part 1

PHPMaster.com: Under the Hood of Yii's Component Architecture, Part 1

PHP Web Services Blog: Payload the Way You Want with PHP5 built-in SOAP


Community Events





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


threedevsandamaybe series laravel interview wordpress introduction list podcast unittest install release opinion developer testing code community configure refactor framework language

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