Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- blanche cohen
July 1, 2009, 9:18 pm
rate this thread
so I need to fix it.
Uh huh. student programmers.
It's not the database that's the problem, it's the "topology" that
the students used to stitch stuff together as well as their assumptions.
If I were still teaching (these were NOT my students - I'd never make
a student project a commerical website) I'd change their grade....
But I digress. I'm casually familiar with php, intimate with the rest
of the stuff. Since this is now hosted on a commercial ISP, I'm
limited to what I can do for configuration.
But....is it practical to have multiple settings.inc.php files or should
I just stuff everything into one?
What is in settings.inc.php? It's not a standard file - it's one of
your own. Does it have configuration info? Passwords? Something else?
Whether you need one or more depends completely on what's in it. If it
is configuration info or passwords, the entire site should use the same
settings. Otherwise you have a maintenance nightmare.
Remove the "x" from my email address
JDS Computer Training Corp.
Usually something with a generic name like "settings.inc" is a file
that you want included in every, or almost every, page. So put
config, error handling, stuff like that into one file. I sometimes
put my w3c validation bugs in there, too, although that includes
formatting -- so sue me.
Then if you have modules specific to certain groups of pages, name
them something else.
OK. To the original poster: the file is probably called settings.inc.php
because it will be rendered instead of downloaded if called directly.
Off course, that file should not be ABLE to be called directly, but the
students may not have thought about that and the commercial provider may
not offer other directories than publicly available ones. In which case
I'd seriously think of switching providers.
Calling it "settings.inc" could make the file available for download
(and thus reveal passwords).
- C. (http://symcbean.blogspot.c
July 2, 2009, 9:17 am
On Jul 1, 10:18=A0pm, bco...@nyx.net (blanche cohen) wrote:
It depends. Really the overriding concern is writing code which is
easy to manage (so if you do want multiple configs, they should all be
in the same location) and avoid nesting includes too deeply. The other
consideration is where you want to load different configs at runtime -
in which case alternative config files can be very handy. A secondary
concern is the amount of code you are loading - but this is only an
issue of these files are getting to more that 500 or so lines AND can
sensibly be seperated.