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.

General Questions

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

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

Use Sapphire and other PHP lib/framewrok (Zend/CodeIgniter...). How?


Go to End
Reply

10 Posts   2732 Views

Avatar
biapar

11 March 2011 at 1:13am Forum Moderator, 435 Posts

Hi,

How is possible to use Zend or Codeigniter with SilverStripe?
Is there an example?

Thanks

Avatar
Willr

11 March 2011 at 5:45pm Forum Moderator, 5511 Posts

SilverStripe core uses Zend for some parts - Zend_Log, Zend_Cache and Zend_Date are the 3 places I remember. Zend is really nice to include as it is quite abstracted. Ideally what you want is to not autoload it, but to require it (using the standard php require()).

If this is for your own site the common pattern for include thirdparty libraries is to make a mysite/thirdparty/ folder. Add a blank '_manifest_include' file to that folder. Then in your SilverStripe code when you require Zend simply add require_once('../mysite/thirdparty/Zend/somefile.php');

Avatar
Willr

11 March 2011 at 5:46pm Forum Moderator, 5511 Posts

.. also if you need reference look at sapphire/dev/Log.php

Avatar
biapar

11 March 2011 at 9:26pm Forum Moderator, 435 Posts

Hi,

Where Do I see an example?

Avatar
joelg

11 March 2011 at 10:21pm Community Member, 129 Posts

Hi willr

Why is it a bad idea to autoload a thirdparty framework? Will it slow the site or? And what does a blank '_manifest_include' actually do?

Joel

Avatar
Devlin

11 March 2011 at 11:53pm (Last edited: 11 March 2011 11:54pm), Community Member, 215 Posts

Why is it a bad idea to autoload a thirdparty framework?

Because you want to avoid possible conflicts with autoload.

And what does a blank '_manifest_include' actually do?

Nothing. I'm sure Willr meant "_manifest_exclude". Such file will exclude the folder from the manifest.

Where Do I see an example?

require_once 'Zend/Log.php';
public static $logger_class = 'SS_ZendLog';
self::$logger = new self::$logger_class;

Avatar
joelg

11 March 2011 at 11:54pm Community Member, 129 Posts

Thanks!

Avatar
biapar

12 March 2011 at 12:28am Forum Moderator, 435 Posts

Where is?

require_once 'Zend/Log.php';
public static $logger_class = 'SS_ZendLog';
self::$logger = new self::$logger_class;

Go to Top