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.

All other Modules /

Discuss all other Modules here.

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

Setup the "project" in config


Reply


4 Posts   1239 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, 510 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, 5513 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.