processwire / processwire-requests

ProcessWire feature requests.
39 stars 0 forks source link

add all options to sample config.php #411

Closed jmartsch closed 3 years ago

jmartsch commented 3 years ago

Me and many other people are often searching for options that can be set in the config file. But they are hidden across blog posts or deep in the forum.

I want to have these options added good commented like the .htaccess page inside of the sample config file.

I can even make a PR, if you are planning to merge this idea.

Here are a few settings, that should appear there.

/**
 * Secure page files?
 *
 * When, true, prevents http access to file assets of access protected pages.
 *
 * Set to true if you want files on non-public or unpublished pages to be
 * protected from direct URL access.
 *
 * When used, such files will be delivered at a URL that is protected from public access.
 *
 * @var bool
 *
 */
$config->pagefileSecure = false;

/**
 * Prefix for secure page files
 *
 * One or more characters prefixed to the pathname of secured file dirs.
 *
 * If use of this feature originated with a pre-2.3 install, this may need to be 
 * specified as "." rather than "-". 
 *
 */
$config->pagefileSecurePathPrefix = '-';

$config->defaultAdminTheme = 'AdminThemeUikit';
$config->prependTemplateFile = '_init.php';
$config->sessionFingerprint = false;
$config->imageSizerOptions('interlace', true);
$config->advanced = false;
//$config->imageSizerOptions('webpAdd', true);
$config->contentTypes('webp', 'image/webp');
$config->moduleInstall('download', true);
BernhardBaumrock commented 3 years ago

Do you have proper intellisense in your IDE? I think this already helps a lot :)

img

img

teppokoivula commented 3 years ago

All of these are included and comprehensively explained in wire/config.php. I'm not entirely sure if I got this right, but if you're suggesting that we should have a sample config file in site directory (in addition to the real config file), I kind of fail to see the benefit in that — why not just check wire/config.php?

The issues I see with a duplicate config sample file would be that a) there's more chance of comments being out of sync between wire/config.php and this new sample file (leading to further confusion) and b) it's not obvious what should be included in the sample file in the first place.

That latter part is problematic since eventually it might mean that the sample file is (at least close to a) 1:1 copy of the wire/config.php file, in which case it no longer makes any sense :)

jmartsch commented 3 years ago

I close this for now, until I have time to think about a good solution. Thanks for your opinions.