Module version(s) affected
6.x-dev
Description
Minorish thing, but I just noticed that Director::is_cli() is basically just an alias for Environment::isCli(). I'm thinking it probably makes sense to deprecate Director::is_cli() and remove it in the next major release.
|
/** |
|
* Returns true if this script is being run from the command line rather than the web server. |
|
* |
|
* @return bool |
|
*/ |
|
public static function is_cli() |
|
{ |
|
return Environment::isCli(); |
|
} |
|
/** |
|
* Returns true if this script is being run from the command line rather than the web server |
|
* |
|
* @return bool |
|
*/ |
|
public static function isCli() |
|
{ |
|
if (Environment::$isCliOverride !== null) { |
|
return Environment::$isCliOverride; |
|
} |
|
return in_array(strtolower(php_sapi_name() ?? ''), ['cli', 'phpdbg']); |
|
} |
How to reproduce
Look at the code with your eyes.
Possible Solution
No response
Additional Context
No response
Validations
Kitchen sink CI (green - all PRs below used in run of recipe-kitchen-sink)
PRs
Module version(s) affected
6.x-dev
Description
Minorish thing, but I just noticed that
Director::is_cli()is basically just an alias forEnvironment::isCli(). I'm thinking it probably makes sense to deprecateDirector::is_cli()and remove it in the next major release.silverstripe-framework/src/Control/Director.php
Lines 1034 to 1042 in 9c59c42
silverstripe-framework/src/Core/Environment.php
Lines 254 to 265 in 9c59c42
How to reproduce
Look at the code with your eyes.
Possible Solution
No response
Additional Context
No response
Validations
silverstripe/installer(with any code examples you've provided)Kitchen sink CI (green - all PRs below used in run of recipe-kitchen-sink)
PRs