Jump to:

10979 Posts in 2722 Topics by 1815 members

All other Modules

SilverStripe Forums » All other Modules » Setup the "project" in config

Discuss all other Modules here.

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

Page: 1
Go to End
Author Topic: 1184 Views
  • eandre
    Avatar
    Community Member
    2 Posts

    Setup the "project" in config Link to this post

    Each time setting up a project like "mysite" (by default), the name of the folder requires an adaption of the global variable $project to what the name of the folder is - like "mysite => $project = "mysite". For me it's kind of incomprehensible to that every time, even though in many cases there is only one project

    what if the core deployment of __config.php for a project/module (mysite) looks like:

    <?php

    global $project;
    $project = basename(dirname(__FILE__));
    ...
    ?>

    Wouldnt that makes sense? So there will be no need to adapt the __config.php file anymore. of course setting up locales, themes for instance - sure...but isnt that a easier way?

    cheers

  • Mo
    Avatar
    Community Member
    508 Posts

    Re: Setup the "project" in config Link to this post

    As far as I am aware, there should only really be one project directory. I cant really see why you would need more than one. If you are running multiple projects from one install, maybe you would do well to look at something like the subsites module (http://silverstripe.org/subsites-module/)?

    If you find you are re-using a lot of classes across different installs, then you might be better suited just adding them to your own modules.

    Mo

  • Willr
    Avatar
    Forum Moderator
    5497 Posts

    Re: Setup the "project" in config Link to this post

    what if the core deployment of __config.php for a project/module (mysite) looks like:

    Sure, there is no reason it doesn't do that (though would have a slight negative impact on performance). The $project variable will likely be deprecated in 3.0 with the yaml configuration which has been discussed on the dev mailing list.

  • eandre
    Avatar
    Community Member
    2 Posts

    Re: Setup the "project" in config Link to this post

    Thanks Mo, it seems that the subsites-module fills my needs

    Willr, in addition to Mo's offer, there will be no need to adapt the $project variable any more...and of course, you're right. so when the variable will be deprecated in 3.0, everything's fine for me

    Thank you both. i'm amazed of the pace how fast you reply to users posts.

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