diff --git a/core/control/Director.php b/core/control/Director.php index 1d084fe92..368c67360 100644 --- a/core/control/Director.php +++ b/core/control/Director.php @@ -388,6 +388,13 @@ class Director { ); } } + + /** + * @return boolean + */ + public static function is_cli() { + return preg_match('/cli-script\.php/', $_SERVER['SCRIPT_NAME']); + } /** * Sets the site mode (if it is the public site or the cms),