From a95efe833f1ba90924b69bb159b31949a828f58c Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Sun, 11 Nov 2007 02:54:19 +0000 Subject: [PATCH] added is_cli() git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@44573 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- core/control/Director.php | 7 +++++++ 1 file changed, 7 insertions(+) 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),