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've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

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

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


Go to End


10 Posts   3648 Views

Avatar
biapar

Forum Moderator, 435 Posts

11 March 2011 at 1:13am

Hi,

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

Thanks

Avatar
Willr

Forum Moderator, 5523 Posts

11 March 2011 at 5:45pm

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

Forum Moderator, 5523 Posts

11 March 2011 at 5:46pm

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

Avatar
biapar

Forum Moderator, 435 Posts

11 March 2011 at 9:26pm

Hi,

Where Do I see an example?

Avatar
joelg

Community Member, 134 Posts

11 March 2011 at 10:21pm

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

Community Member, 344 Posts

11 March 2011 at 11:53pm

Edited: 11/03/2011 11:54pm

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

Community Member, 134 Posts

11 March 2011 at 11:54pm

Thanks!

Avatar
biapar

Forum Moderator, 435 Posts

12 March 2011 at 12:28am

Where is?

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

Go to Top