Jump to:

4875 Posts in 6996 Topics by 1472 members

Installing SilverStripe

SilverStripe Forums » Installing SilverStripe » How SS chooses a directory

Getting SilverStripe up and running on your computer and on your web server.

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

Page: 1
Go to End
Author Topic: 1155 Views
  • bpesner
    Avatar
    Community Member
    7 Posts

    How SS chooses a directory Link to this post

    Hi,

    I'm new to SS. I've installed it and run through the tutorials successfully . Here's my question. How does SS know to use the templates and code from the tutorial directory? Why doesn't it use the mysite directory?

    My details:

    running on Fedora 7 with apache
    installed in /var/www/html/SilverStripe
    accessing my site using the url http://localhost/SilverStripe
    accessing the CMS using the url http://localhost/SilverStripe/admin

    Thanks.

  • Sam
    Avatar
    Administrator
    679 Posts

    Re: How SS chooses a directory Link to this post

    It looks for the presence of a non-empty _config.php inside every top-level directory. It treats each directory that matches that criterion as "part of the silverstripe code".

    After including each of the _config.php files, it then looks at the value of the $project variable, which is set to "mysite" in mysite/_config.php. It then treats that as the "project directory" and all the other folders as "module directories". In practise, the difference between the project directory and the module directories is very small: templates in the project directory will take precedence of those in other modules, if there's a conflict.

  • bpesner
    Avatar
    Community Member
    7 Posts

    Re: How SS chooses a directory Link to this post

    Sam,

    Thanks for the prompt and thorough reply. It leaves open one question though: what happens if more than one top-level _config.php has a $project defined with different values?

    Of course, ny installation is consistent: I have a number of top-level _config.php files:

    auth_openid
    cms
    sapphire
    tutorial

    but only tutorial has $project.

  • Sam
    Avatar
    Administrator
    679 Posts

    Re: How SS chooses a directory Link to this post

    "what happens if more than one top-level _config.php has a $project defined with different values?"

    Bad things. Don't do it. :-P

    Technically, it would use the $project value of the last _config.php file that gets included, which I believe would be the last one in the alphabet. But, like I say, a site with two $project values set is better thought of as a broken site.

    Modules and core never set $project.

  • bpesner
    Avatar
    Community Member
    7 Posts

    Re: How SS chooses a directory Link to this post

    Sam,

    Excellent. Thanks so much for your help. If your attention is typical of the way things work with SilverStripe, I will enjoy working with it a lot.

    1155 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.