hardcoded path information for example /var/www/mvhub
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
MVHub |
In Progress
|
Medium
|
Mansi |
Bug Description
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
affects mvhub
assignee mansi
importance medium
milestone 2009-09
security no
status confirmed
tag refactor
Problems we are solving:
Information is duplicated in apache.conf , test scripts, application
conf, env_vars.sh change requires modification of several files.
ugly to hard code (emotionally very traumatic to read)
we will need to change paths to package software, easier if not hard coded
other people will want to install in places other than our
hard coded choices
In many places in the code there is hard coded path information for
example '/var/www/mvhub'
All this information should be in a single config file and the various
scripts and libraries should read this info from the config file
Some scripts should be generated from conf file.
For example lib-mvhub/
$BASE_DIR for project root and $SOURCE_DIR $BASE_DIR/
Some paths are or should be calculated.
For example cgi-bin is $BASE_DIR/
Eric A says sprintf or interpolation is better/less dangerous than eval
for this.
Possible Steps to project:
0) write tests:
look for /var/www maybe?
look for /.*/.*/ maybe?
1) find and list all hard coded path info
2) make a chart (spreadsheet ??) with current hardcoded info
| ideal variable names
3) list code to be written, probably
lib-
mv_
modify: lib-mvhub/
4) modify all code to remove hard coded paths
5) remove conf files now generated from version control
6) Add test to be sure generated conf is older than master conf file
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://
iEYEARECAAYFAkq
J7gAn3BZZnepjak
=gfDZ
-----END PGP SIGNATURE-----
When completed the following query should only return the conf files:
grep /var/www/mvhub . -Rl | grep -v 'txt$'