Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-09-05 04:56:27

wet
Developer Emeritus
From: Schoerfling, Austria
Registered: 2005-06-06
Posts: 3,330
Website Mastodon

Setup: server path agnostic txp config

In order to avoid dependencies on absolute server paths which are changed by certain ISPs during server upgrades/repairs quite indeliberately (seen that twice during the last 6 months or so), I’d suggest that Txp builds config.php during setup using $_SERVER[‘DOCUMENT_ROOT’] as a base for $txpcfg[‘txpath’] whenever available.

Resulting entries in config.php would then rather be

$txpcfg['txpath'] = $_SERVER['DOCUMENT_ROOT'].'/textpattern';

than

$txpcfg['txpath'] = '/var/www/vhosts/example.com/subdomains/anotherone/httpdocs/textpattern';

-

Offline

#2 2007-01-02 20:41:08

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: Setup: server path agnostic txp config

$_SERVER['DOCUMENT_ROOT'] does not always exist.

Offline

#3 2007-01-02 20:42:29

wet
Developer Emeritus
From: Schoerfling, Austria
Registered: 2005-06-06
Posts: 3,330
Website Mastodon

Re: Setup: server path agnostic txp config

But this would be determinable on setup, wouldn’t it?

Offline

#4 2007-01-02 21:16:07

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: Setup: server path agnostic txp config

True, yes, it should be.

I’m not sure that it would really solve more troubleshooting problems than it might cause. If these hosts are inadvertantly changing something so important, how do we know $_SERVER['DOCUMENT_ROOT'] should still be trusted (it gets the info from httpd.conf)?

Offline

#5 2007-01-03 05:24:10

wet
Developer Emeritus
From: Schoerfling, Austria
Registered: 2005-06-06
Posts: 3,330
Website Mastodon

Re: Setup: server path agnostic txp config

That’s true, I wasn’t aware that there are server setups that lack this variable.

I just got around it as a) one host changed DOCUMENT_ROOT as a follow-up to a hardware failure/rebuild (it was a small company so they probably had no established procedure for this), and b) as a result of changing hosting companies for a site. In both instances it would have eliminated one reason of displeasure.

Offline

#6 2007-01-03 10:16:32

Sencer
Archived Developer
From: cgn, de
Registered: 2004-03-23
Posts: 1,803
Website

Re: Setup: server path agnostic txp config

A more reliable variable is to use automagic constant __FILE__. IIRC this is already done in crockery.

Last edited by Sencer (2007-01-03 10:16:52)

Offline

#7 2008-01-22 06:10:02

jm
Plugin Author
From: Missoula, MT
Registered: 2005-11-27
Posts: 1,746
Website

Re: Setup: server path agnostic txp config

Is there still a need for a user-defined $txpcfg['txpath'] in config.php, since setup determines it?

Offline

#8 2008-01-22 11:12:54

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: Setup: server path agnostic txp config

No, see SVN changeset 2772

Offline

Board footer

Powered by FluxBB