After the ASSETS/IMAGES thing (which is yet undetermined, I'm waiting for a few more votes), I'd like to ask whether you think my terminology for new constants is all right...
'theme_url' => TEMPLATES (because eventually, the folder will only have templates in it)
'theme_dir' => TEMPLATES_DIR
'images_url' => IMAGES or ASSETS (see other topic)
'images_dir' => IMAGES_DIR or ASSETS_DIR (the variable doesn't actually exist, it's for consistency reasons.)
$scripturl => SCRIPT[1]
$boardurl => BOARD (this might be a problem, as $board is already a global var, and unrelated to it...)
$boarddir => BOARD_DIR (underscore might be a problem..? ElkArte uses BOARDDIR)
$sourcedir => SOURCES_DIR (again, underscore, too much?)[2]
$pluginsdir => PLUGINS_DIR
$pluginsurl => PLUGINS
$cachedir => CACHE_DIR (I'd like CACHEDIR better, honestly, but I can't fathom a TEMPLATESDIR either, and I want to harmonize everything...)
Also, $cssdir => CSS_DIR and $jsdir => JS_DIR, but these are not used in a lot of places ($jsdir is really only used in Subs-Cache), so I'm thinking maybe I'll just pass on the constants. Or maybe later.
I'm not going to put these for a vote (too complicated), but I'd like opinions on the naming scheme. Should I do with or without the underscore? Maybe go for a lowercase version of constants? (Nah, it's actually parsed faster with uppercase, yes I did benchmarks.) Maybe move 'DIR' at the beginning of the constant names? Maybe force adding '_URL' on $...url variables?
$boarddir, $boardurl and $sourcedir are all used between 170 and 250 times across the entire codebase, so it makes a lot of sense to use constants for these, so I don't have to global these. $scripturl is still used 500+ times, and that's even after turning hundreds of these into <URL> HTML. Wow... Well, this one definitely warrants a constant, once I can ensure the variable is not changed during the page's lifetime.
Opinions welcome -- really! Even if you're not a programmer.
'theme_url' => TEMPLATES (because eventually, the folder will only have templates in it)
'theme_dir' => TEMPLATES_DIR
'images_url' => IMAGES or ASSETS (see other topic)
'images_dir' => IMAGES_DIR or ASSETS_DIR (the variable doesn't actually exist, it's for consistency reasons.)
$scripturl => SCRIPT[1]
$boardurl => BOARD (this might be a problem, as $board is already a global var, and unrelated to it...)
$boarddir => BOARD_DIR (underscore might be a problem..? ElkArte uses BOARDDIR)
$sourcedir => SOURCES_DIR (again, underscore, too much?)[2]
$pluginsdir => PLUGINS_DIR
$pluginsurl => PLUGINS
$cachedir => CACHE_DIR (I'd like CACHEDIR better, honestly, but I can't fathom a TEMPLATESDIR either, and I want to harmonize everything...)
Also, $cssdir => CSS_DIR and $jsdir => JS_DIR, but these are not used in a lot of places ($jsdir is really only used in Subs-Cache), so I'm thinking maybe I'll just pass on the constants. Or maybe later.
I'm not going to put these for a vote (too complicated), but I'd like opinions on the naming scheme. Should I do with or without the underscore? Maybe go for a lowercase version of constants? (Nah, it's actually parsed faster with uppercase, yes I did benchmarks.) Maybe move 'DIR' at the beginning of the constant names? Maybe force adding '_URL' on $...url variables?
$boarddir, $boardurl and $sourcedir are all used between 170 and 250 times across the entire codebase, so it makes a lot of sense to use constants for these, so I don't have to global these. $scripturl is still used 500+ times, and that's even after turning hundreds of these into <URL> HTML. Wow... Well, this one definitely warrants a constant, once I can ensure the variable is not changed during the page's lifetime.
Opinions welcome -- really! Even if you're not a programmer.
| 1. | Also, there's the alternative of using <URL> in your HTML. Should I then name the constant URL..? |
| 2. | I think the plural is important because the folder is named that way. |





