[wplug] replacing text within full website

John Harrold jmh17 at pitt.edu
Wed Jan 7 08:47:24 EST 2004


Sometime in January Rick Smith assaulted the keyboard and produced:

| On Mon, Jan 05, 2004 at 10:39:25PM -0500, Gentgeen wrote:
| > 2)  When I do move it to production, I will need to change any of the
| > links on the webpages from "http://kingpin/" to "http://www.foo.bar"  I
| > tried my best to keep them to a minimum, but a few cgi scripts need full
| > URL links.
| 
| What are the scripts written in?  Each language will have a way to
| include another file.  In /bin/sh, use '. <filename>'.  If you are
| on a RH or RH-like system, look in scripts in /etc/rc.d/init.d .
| Those typically read in a file which define environment variables.
| In Perl, there's 'require "<filename>";' 
| The idea is to define in one file, variables that would change
| if the web files are moved -- to another machine or to a different
| directory.  Then when things are moved, one file can be changed rather
| then hunting down all instances.

kevin,

i'm going to have to second ricks thought here. you should abstract this
kind of thing from the code if it's at all possible. defining the
environment variables in a separate file is good for shell scripts. perl
(via cpan) has many ways for accessing configuration files (like the kind
of stuff you see in /etc and the dot files you see in your home directory).
php had the include (or is it require?). personally i prefer getting things
from a configuration file to defining a bunch of variables at a time. it
feels a little cleaner to me.

-- 
--------------------------------------------------------------------------
                                               | /"\
 john harrold                                  | \ / ASCII ribbon campaign
      jmh at member.fsf.org                    |  X  against HTML mail
           the most useful idiot               | / \
--------------------------------------------------------------------------
 What difference does it make to the dead, the orphans, and the homeless,
 whether the mad destruction is brought under the name of totalitarianism or
 the holy name of liberty and democracy?
 --Gandhi
--------------------------------------------------------------------------
gpg --keyserver keys.indymedia.org --recv-key F65A739E
--------------------------------------------------------------------------
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://penguin.wplug.org/pipermail/wplug/attachments/20040107/8a5d05cf/attachment-0001.bin


More information about the wplug mailing list