Advertisement:

SMF's lack of self-awareness

Aloittaja Debbie2, maaliskuu 11, 2006, 12:41:39 AP

« edellinen - seuraava »

Debbie2

Why do I have to set this sort of thing in Settings.php:

Lainaa$boardurl = 'http://theanimaro.com/forums';
$boarddir = '/home/animaro/web/forums';       # The absolute path to the forum's folder. (not just '.'!)
$sourcedir = '/home/animaro/web/forums/Sources';      # Path to the Sources directory.

Why can't it figure out for itself?

$boardurl shouldn't be needed if all the URLs the board sends are relative. (Hmm, I guess it's needed for redirects in order to confirm with the HTTP RFC; in that case, use $_SERVER['HTTP_HOST'] HTTP_PORT REQUEST_URI? Although I'm not sure if you can tell whether it's on http:// or https:// from reading $_SERVER.)

$boarddir = realpath('.');
$sourcedir = "$boarddir/Sources";

    [/size][/list]
    [/

    Daniel15

    Well, you can move the Sources directory, if you're worried about security. That's why you can set it seperately.

    And $boardurl is useful if you have two domains, for example, a subdomain from your webhost, and a domain which you have bought. Also, $boardurl is used a lot to reference files (SMF uses full paths for most things).
    Daniel15, former Customisation team member, resigned due to lack of time. I still love everyone here :D.
    Go to smfshop.com for SMFshop support, do NOT email or PM me!

    Thantos

    There is nothing at all saying you can't split up the SMF directories.  Like on this forum the Sources directory isn't even under the public_html tree.  Don't believe me?  Check for yourself http://www.simplemachines.org/community/Sources/

    You could in theory have each and every "group" of directories in its own area.  The boardurl is used to set $scripturl which is what is generally used.

    Releative URLs are ok but have some serious flaws (like cross subdomain issues) so its better to use full URLs.

    Now lets clear up some stuff:  Unless you go and manually change it then Settings.php file is set by the installer not by you.  I'd say its a pretty safe bet that reading a string is faster then calling a function.


    Advertisement: