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

SilverStripe book samples


Go to End


4 Posts   2309 Views

Avatar
Ken23

Community Member, 2 Posts

9 July 2013 at 4:46pm

Having bought the Silverstripe book by Ingo Schommer and Steven Broschart I'm now trying to get the sample sites to work.

I've put the example files into C:/wamp/www/4_first_steps/

I copied the 4_first_steps/mysite/_config_example.php file to the 4_first_steps/mysite/_config.php file, and changed the database credentials to suit my setup – this is what the GitHub page says to do (I think…)

I had to manually create a database using PHPMyAdmin, then imported the database.sql included in the sample.

Then I attempt to load http://localhost/4_first_steps/ and get the error:
Fatal error: 'continue' operator with non-constant operand is no longer supported in C:\wamp\www\4_first_steps\sapphire\core\ManifestBuilder.php on line 151

So I edit (line 149 of) that file to include a missing end-of-line semicolon.

Then a get a series of errors:
Strict standards: Declaration of Controller::handleRequest() should be compatible with RequestHandler::handleRequest($request) in C:\wamp\www\4_first_steps\sapphire\core\control\Controller.php on line 12
Strict standards: Declaration of CMSMain::getRecord() should be compatible with LeftAndMain::getRecord($id, $className = NULL) in C:\wamp\www\4_first_steps\cms\code\CMSMain.php on line 11
Notice: Array to string conversion in C:\wamp\www\4_first_steps\sapphire\dev\Debug.php on line 558
With some quoted code in between.

Doubtless I'm making some fundamental mistake - can anyone help with this? Note that the demo site set up as part of my first clean install works fine.

Avatar
copernican

Community Member, 189 Posts

10 July 2013 at 12:19am

The book by Ingo/Steven was written for SS v2.X. I'm betting your using SS v3.0. The example files you refer are probably written for v2.X as well so they won't be compatible with SS v3.0. While you can still definitely learn a lot from the book (I haven't read it but i'm sure its quite good) some code will not be compatible with v3.0.

Avatar
(deleted)

Community Member, 473 Posts

10 July 2013 at 9:31am

You're running an old version of 2.3/2.4 on PHP 5.4. Either upgrade to 2.4.10, downgrade to PHP 5.3 or upgrade to 3.x.

Avatar
Ken23

Community Member, 2 Posts

10 July 2013 at 12:49pm

That would explain it - glad it's not my imbecility ;)
I'll forge ahead without that code.