From b4ba38d770b34cb7f7a4ba222cf072989de54430 Mon Sep 17 00:00:00 2001 From: Dmitriy Simushev Date: Tue, 17 Dec 2013 15:09:29 +0000 Subject: [PATCH] Add installation_in_progress function --- src/mibew/install/dbperform.php | 5 +++++ src/mibew/install/index.php | 5 +++++ src/mibew/libs/common/misc.php | 13 +++++++++++++ 3 files changed, 23 insertions(+) diff --git a/src/mibew/install/dbperform.php b/src/mibew/install/dbperform.php index 044caaff..5dfe54f1 100644 --- a/src/mibew/install/dbperform.php +++ b/src/mibew/install/dbperform.php @@ -15,6 +15,11 @@ * limitations under the License. */ +/** + * Indicate that installation in progress + */ +define('INSTALLATION_IN_PROGRESS', TRUE); + session_start(); require_once(dirname(dirname(__FILE__)).'/libs/config.php'); diff --git a/src/mibew/install/index.php b/src/mibew/install/index.php index 1933d333..b2317695 100644 --- a/src/mibew/install/index.php +++ b/src/mibew/install/index.php @@ -15,6 +15,11 @@ * limitations under the License. */ +/** + * Indicate that installation in progress + */ +define('INSTALLATION_IN_PROGRESS', TRUE); + session_start(); require_once(dirname(dirname(__FILE__)).'/libs/config.php'); diff --git a/src/mibew/libs/common/misc.php b/src/mibew/libs/common/misc.php index e6bcada9..b944f033 100644 --- a/src/mibew/libs/common/misc.php +++ b/src/mibew/libs/common/misc.php @@ -105,4 +105,17 @@ function array_flatten_recursive($arr) { return $result; } +/** + * Checks if currently processed script is installation script. + * + * @return boolean + */ +function installation_in_progress() { + if (!defined('INSTALLATION_IN_PROGRESS')) { + return FALSE; + } + + return INSTALLATION_IN_PROGRESS; +} + ?> \ No newline at end of file