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, Ed, biapar, Willr, Ingo, swaiba

Sapphire framework

Go to End

5 Posts   3286 Views


Community Member, 541 Posts

22 May 2009 at 11:46pm

Hi All,

I am looking into making a browser based strategy game as a personal project and have been looking into frameworks to make my life easier.

I considered Symfony, as it seems the most flexable of all the PHP ones (especially with its large range of databases supported), but it relies heavily in CLI to build its ORM and generally a lot more compex to work with than Silvstripe/Sapphire.

I ae mulled it over, an I am fairly certain Sapphire has all the capabilities I would need for such a project. The majority of the work will be done via forms storing info into the database, then outputting that data in a Rich UI. What does everyone else think?

Also, how difficult is it to separate Sapphire from the CMS? Can I just remove the CMS folder and rebuild the database (or better still, start a new project without it)? I know there was a topic on this a while ago, but I cant seem to find it.




Community Member, 904 Posts

24 May 2009 at 1:30am

Hi Mo

I'm sure you could achieve your goal using the sapphire Framework, although I never used it outside the SilverStripe context. I suggest you also have a look at the Zend Framework ( if you didn't do so already.
It's a highly modular and mature framework with powerful DB abstraction, logger, and Server-Components. It comes with a JSON-RPC Server component (if you have a JavaScript client-app) or a AMF Component (if you plan to write your game-client in flash/flex).

I really like the templating engine of sapphire and its auto-db table creation mechanisms, but these features could be redundant in a game project like yours. Maybe your client-app can't be based on templates and I'm sure you write your own DB/SQL code to get the best results.

Anyway.. I wish you all the best with your project. It sounds like a lot of fun :)


Community Member, 541 Posts

27 May 2009 at 8:50pm

Edited: 27/05/2009 8:54pm

I have looked at Zend before, but didn't really get on with it, thought I cant remember why. I have been told in a few places "try Zend" so I am giving it another chance.
<br >
<br >At the moment it does seem a likely candidate, thought I also really like Sapphire's database model and templating. One big issue I am having however, is that if you remeve the CMS, then there seems to be no way to control routing. Is this the case?
<br >
<br >I am dfinatly going to give Zend a go for this project, but my issue is that I am fairly adept at Silverstripe, and although learning another framework doesnt bother me, I barely have enough time.... If only I could give up sleeping!
<br >
<br >Mo


Community Member, 904 Posts

28 May 2009 at 4:01am

Hey Mo

One big issue I am having however, is that if you remeve the CMS, then there seems to be no way to control routing. Is this the case?

I'm sure routing works without the CMS part. The Director class is part of the sapphire framework.. it should be as simple as adding custom Director rules to your _config.php?
Maybe one of the core-devs can help here?

If you give the Zend Framework a try, make sure to install FirePHP ( and setup the FirePHP Logger
It's totally awesome to have the php log messages appear in the firebug console. You can even send objects or arrays to the log and view it directly in the browser.


Community Member, 127 Posts

28 May 2009 at 10:07pm

Edited: 28/05/2009 10:10pm

While I love SS as CMS and there is nothing better available, the underlying MVC framework has alternatives. No, not Zend or Symfony, the most flexible and most mature and advanced (IMHO) is CakePHP. I used it a lot and only found SilverStripe because CakePHP has no comparable CMS, at least not yet. (Please don't misunderstand, this is not meant at all as comparing cakePHP with Sapphire, I'm not ready to comment on that)