Jump to:

324 Posts in 153 Topics by 156 members

Migrating a Site to Silverstripe

SilverStripe Forums » Migrating a Site to Silverstripe » More SS 3 issues : set_environment_type() and init()?

What you need to know when migrating your existing site to SilverStripe.

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

Page: 1
Go to End
Author Topic: 921 Views
  • Garrett
    Avatar
    Community Member
    245 Posts

    More SS 3 issues : set_environment_type() and init()? Link to this post

    Hi,

    When I get PHP errors in my SS 3 install, I am only getting a generic 500 error instead of a custom SS error, despite having Director::set_environment_type("dev") set in my _config.php.

    Also, why am I getting the following error:

    PHP Fatal error: Cannot redeclare Page_Controller::init() in ...../mysite/code/Page.php on line 40

    How can I get a chunk of PHP code to run when the page loads without init()?

    Thanks,
    Garrett

  • Willr
    Avatar
    Forum Moderator
    5462 Posts

    Re: More SS 3 issues : set_environment_type() and init()? Link to this post

    You can still call init(), works fine on my sites. Check you simply haven't got 2 of the same function pasted in the same file

  • Garrett
    Avatar
    Community Member
    245 Posts

    Re: More SS 3 issues : set_environment_type() and init()? Link to this post

    On this one, you were right! init() was already provided in Page.php, it was just at the bottom so I didn't notice it ;) Sorry!

    //Garrett

    921 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.