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:

Customising the CMS /

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

Where to put custom sapphire core classes

Go to End

2 Posts   1265 Views


Community Member, 127 Posts

29 March 2010 at 3:41pm

If I want to add a class, such as Malte's "class UTF8MySQLDatabase extends MySQLDatabase" I assumed I could just put it in mysite/code and it would be picked up there automatically. However, if I do that I get a "Fatal Error" :

[Sun Mar 28 19:14:17 2010] [error] [client] PHP Fatal error:  Class 'UTF8MySQLDatabase' not found in /....../htdocs/sapphire/core/model/DB.php on line 94, referer:

So the question is, where can I put it? Obviously it works if I put it in the sapphire core next to MySQLDatabase, but there must be a better way. Is there (using SS 2.4 beta)?


Community Member, 127 Posts

29 March 2010 at 3:52pm

Here's the link to the class Malte's UTF8MySQLDatabase class in case you need more info about what I'm trying to do.