1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-10 00:37:02 +02:00

A few phpdoc updates in config.php

This commit is contained in:
Ryan Cramer
2023-02-03 09:29:04 -05:00
parent 0e709b148c
commit a3fa73aec6
2 changed files with 30 additions and 12 deletions

View File

@@ -46,28 +46,40 @@ if(!defined("PROCESSWIRE")) die();
* always have this disabled for live/production sites since it reveals more information * always have this disabled for live/production sites since it reveals more information
* than is advisible for security. * than is advisible for security.
* *
* You may also set this to the constant `Config::debugVerbose` to enable verbose debug mode, * You may also set this to one of the constants:
* which uses more memory and time. * - `Config::debugVerbose` (or int `2`) for verbose debug mode, which uses more memory/time.
* - `Config::debugDev` (or string `dev`) for core development debug mode, which makes it use
* newer JS libraries in some cases when we are testing them.
* *
* #notes This enables debug mode for ALL requests. See the debugIf option for an alternative. * #notes This enables debug mode for ALL requests. See the debugIf option for an alternative.
* *
* @var bool * @var bool|string|int
* *
*/ */
$config->debug = false; $config->debug = false;
/** /**
* Enable debug mode if condition is met * Enable debug mode if condition is met
*
* ~~~~~
* $config->debug = false; // setting this to false required when using debugIf
* $config->debugIf = '123.123.123.123'; // true if user matches this IP address
* $config->debugIf = [ '123.123.123.123', '456.456.456.456' ]; // array of IPs (3.0.212)+
* $config->debugIf = 'function_name_to_call'; // callable function name
* $config->debugIf = function() { // callable function (3.0.212+)
* return $_SERVER['SERVER_PORT'] === '8888';
* };
* ~~~~~
* *
* Set debug mode to be false above, and then specify any one of the following here: * Set debug mode to be false above, and then specify any one of the following here:
* 1) IP address of user required to enable debug mode; * - IP address of user required to enable debug mode;
* 2) Your own callable function name (i.e. "debug_mode") in /site/config.php that returns * - Array of IP addresses where that debug mode should be enabled for (3.0.212+).
* true or false for debug mode; * - Your own callable function in /site/config.php that returns true or false for debug mode.
* 3) PCRE regular expression to match IP address of user (must start and end with a "/" * - PCRE regular expression to match IP address of user (must start and end with a "/"
* slash). If IP address matches, then debug mode is enabled. Regular expression * slash). If IP address matches, then debug mode is enabled. Regular expression
* example: /^123\.456\.789\./ would match all IP addresses that started with 123.456.789. * example: `/^123\.456\.789\./` would match all IP addresses that started with 123.456.789.
* *
* #notes When used, this overrides $config->debug, changing it at runtime automatically. * #notes When used, this will override a false $config->debug, changing it at runtime automatically.
* @var string * @var string
* *
*/ */

View File

@@ -98,8 +98,8 @@
* *
* @property bool $advanced Special mode for ProcessWire system development. Not recommended for regular site development or production use. #pw-group-system * @property bool $advanced Special mode for ProcessWire system development. Not recommended for regular site development or production use. #pw-group-system
* @property bool $demo Special mode for demonstration use that causes POST requests to be disabled. Applies to core, but may not be safe with 3rd party modules. #pw-group-system * @property bool $demo Special mode for demonstration use that causes POST requests to be disabled. Applies to core, but may not be safe with 3rd party modules. #pw-group-system
* @property bool|int $debug Special mode for use when debugging or developing a site. Recommended TRUE when site is in development and FALSE when not. Or set to Config::debugVerbose for verbose debug mode. #pw-group-system * @property bool|int|string $debug Special mode for use when debugging or developing a site. Recommended TRUE when site is in development and FALSE when not. Or set to `Config::debug*` constant. #pw-group-system
* @property string $debugIf Enable debug mode if condition is met #pw-group-system * @property string|callable|array $debugIf Enable debug mode if condition is met. One of IP address to match, regex to match IP, array of IPs to match, or callable function that returns true|false. #pw-group-system
* @property array $debugTools Tools, and their order, to show in debug mode (admin) #pw-group-system * @property array $debugTools Tools, and their order, to show in debug mode (admin) #pw-group-system
* *
* @property string $ignoreTemplateFileRegex Regular expression to ignore template files #pw-group-template-files * @property string $ignoreTemplateFileRegex Regular expression to ignore template files #pw-group-template-files
@@ -202,6 +202,12 @@ class Config extends WireData {
*/ */
const debugVerbose = 2; const debugVerbose = 2;
/**
* Constant for core development debug mode (makes it use newer JS libraries in some cases)
*
*/
const debugDev = 'dev';
/** /**
* Get config property * Get config property
* *