Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Integrating Zend Framework lib / Autoload

Go to End

3 Posts   2242 Views


Community Member, 78 Posts

19 March 2010 at 6:39am


anyone got an idea of integrating Zend Framework Classes/Components with the Zend Autoload features ?
In my App i want to use some zf classes inside an SS class.
Don't get it working.....

Kind regards,


Community Member, 712 Posts

19 March 2010 at 10:27am

Sapphire will autoload classes for you. Just make sure the Zend classes are sitting somewhere that Sapphire can add them to the manifest. Note that 2.4 actually uses some Zend classes (Caching and Date stuff in particular I think), so you can have a look at those for examples.


Community Member, 78 Posts

20 March 2010 at 12:45am

Hmmm, i do not think it's a good approach to add thousands of classes to the manifest.

For now i will do it this way:


function __autoload($className) {
	if(isset($_CLASS_MANIFEST[$className])) {
	} elseif ( substr  ($className, 0, 4) == "Zend"  ) {
		require(str_replace('_', '/', $className) . '.php');

inside an own Method of a controller:

        $user = '';
        $pass = 'YYYYYYYYY';
        $service = Zend_Gdata_Calendar::AUTH_SERVICE_NAME; // predefined service name for calendar
        $client = Zend_Gdata_ClientLogin::getHttpClient($user,$pass,$service);
        $gdataCal = new Zend_Gdata_Calendar($client);
        $this->gdataCal = $gdataCal;

Assuming that the Zend Framework lib is in the include_path.

Works fine.

I will try to do solve it a less ugly way ......