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.

All other Modules /

Discuss all other Modules here.

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

Setup the "project" in config


Go to End


4 Posts   1843 Views

Avatar
eandre

Community Member, 2 Posts

23 March 2011 at 9:04am

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

Avatar
Mo

Community Member, 541 Posts

23 March 2011 at 9:54am

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

Avatar
Willr

Forum Moderator, 5523 Posts

23 March 2011 at 5:27pm

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.

Avatar
eandre

Community Member, 2 Posts

23 March 2011 at 8:29pm

Edited: 23/03/2011 8:34pm

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 :D

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