Make a few changes to config.php, please?

General project discussion. NOT for help questions.
Post Reply
chrishvmp
New Member
New Member
Posts: 4
Joined: Fri Nov 05, 2010 3:25 pm

Make a few changes to config.php, please?

Post by chrishvmp »

Hi Team!

After quite a few installations and management (a total with more then 150..), i want to give some input about the config.php regarding the Path Settings. Currently, these settings are in the following format: (Stripped down for reading purposes)

Code: Select all

$config['root_path'] = '/home/httpd/vhosts/domain.nl/httpdocs';
$config['admin_dir'] = 'admin';
$config['previews_path'] = '/home/httpd/vhosts/domain.nl/httpdocs/tmp/cache';
$config['uploads_path'] = '/home/httpd/vhosts/domain.nl/httpdocs/uploads';
$config['uploads_url'] = $config['root_url'] . '/uploads';
And later on (Image Settings)

Code: Select all

$config['image_uploads_path'] = '/home/httpd/vhosts/domain.nl/httpdocs/uploads/images';
$config['image_uploads_url'] = $config['root_url'] . '/uploads/images';
This method is good ofcourse, however, when changing to a different host (moving between different domains or hosting) you need to adjust all settings.

It would be far more logical, if you could do something like the following:

Code: Select all

# Admin is a dir, not a path, so it should be either on top or bottom, not somewhere in between.. I suggest right after the [i]root_url[/i] setting.
$config['admin_dir'] = 'admin';
# Same for the uploads URL
$config['uploads_url'] = $config['root_url'] . '/uploads';
# And why is the image_uploads_url any different? It's a path, and it should be kept here..
$config['image_uploads_url'] = $config['root_url'] . '/uploads/images';

# Take this path as a root, and use it in the next settings. That way you don't need to edit all paths...
$config['root_path'] = '/home/httpd/vhosts/domain.nl/httpdocs';
$config['previews_path'] = $config['root_path'].'tmp/cache';
$config['uploads_path'] = $config['root_path'].'uploads';
# Image_uploads_path is a path, so keep it here..
$config['image_uploads_path'] = $config['root_path'].'images';
I'm not quite sure if this has been proposed before, but i didn't make sense the way it is right now. If it has been proposed, what was the reason it was rejected?

Thanks in advance, and i really look forward to see this feature in 1.9.4!
leif
New Member
New Member
Posts: 4
Joined: Tue Oct 19, 2010 8:14 pm

Re: Make a few changes to config.php, please?

Post by leif »

I mostly agree with chrishvmp, but I would like to take it a small step further. One of the first files that is read in is 'fileloc.php'. If that file gets an extra line:

Code: Select all

define('ROOT_PATH', dirname(__FILE__));
then the root_path could be defined as

Code: Select all

$config['root_path'] = ROOT_PATH;
which would make it independent of the specific installation. Always a good thing.

Perhaps I don't believe in 1.9.4, but sometime?
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am
Location: Arizona

Re: Make a few changes to config.php, please?

Post by Dr.CSS »

Sounds like you know what you are doing so go for it, since you are knowledgeable enough to figure these things out guess you wont be coming around for any support, if you do just remember we can't really do support on CMSMS that has any hacked core files...
jmcgin51
Power Poster
Power Poster
Posts: 1899
Joined: Mon Jun 12, 2006 9:02 pm

Re: Make a few changes to config.php, please?

Post by jmcgin51 »

I don't think editing config.php can necessarily be counted as "hacking the core"... I have seen posts from Dev Team members recommending adding items to config.php. Surely they wouldn't recommend something that would result in the system be unsupportable... due to said officially-sanctioned "hack"... ;-)

the OP's post was just a logical reorganization of the existing config variables, as near as I can tell. The second poster's suggestion could be more accurately construed as a hack.

to the OP and the first responder - how about filing these as FRs for the Core in the Forge?
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am
Location: Arizona

Re: Make a few changes to config.php, please?

Post by Dr.CSS »

The only thing I've seen posted from Dev. about changing config.php has been settings that already exist in the config file, if someone were to change the order of those calls or something like that and then had problems but never bothered to tell they had done these changes it could be a big round and round till it gets figured out...

Yes if you think it's a good idea put in a FR...
replytomk3

Re: Make a few changes to config.php, please?

Post by replytomk3 »

I was thinking of the same idea, and I second it.
chrishvmp
New Member
New Member
Posts: 4
Joined: Fri Nov 05, 2010 3:25 pm

Re: Make a few changes to config.php, please?

Post by chrishvmp »

Dr.CSS wrote:The only thing I've seen posted from Dev. about changing config.php has been settings that already exist in the config file, if someone were to change the order of those calls or something like that and then had problems but never bothered to tell they had done these changes it could be a big round and round till it gets figured out...

Yes if you think it's a good idea put in a FR...
And how can i do this?
Jos
Support Guru
Support Guru
Posts: 4019
Joined: Wed Sep 05, 2007 8:03 pm
Location: The Netherlands

Re: Make a few changes to config.php, please?

Post by Jos »

Post Reply

Return to “General Discussion”