diff options
author | Cesar G <prototech91@gmail.com> | 2014-02-15 17:09:13 -0800 |
---|---|---|
committer | Cesar G <prototech91@gmail.com> | 2014-02-15 17:09:13 -0800 |
commit | d002d31b86af92b07b44ca8541e2ed7d3d0cfd2a (patch) | |
tree | 7460efa71b65e34a0e6d52624b1bd70cdea1e95e /phpBB | |
parent | ccf12ba166299af5e09f2b2d9b77125f2fe033e9 (diff) | |
download | forums-d002d31b86af92b07b44ca8541e2ed7d3d0cfd2a.tar forums-d002d31b86af92b07b44ca8541e2ed7d3d0cfd2a.tar.gz forums-d002d31b86af92b07b44ca8541e2ed7d3d0cfd2a.tar.bz2 forums-d002d31b86af92b07b44ca8541e2ed7d3d0cfd2a.tar.xz forums-d002d31b86af92b07b44ca8541e2ed7d3d0cfd2a.zip |
[ticket/12160] Add function to check if phpBB is installed.
PHPBB3-12160
Diffstat (limited to 'phpBB')
-rw-r--r-- | phpBB/includes/functions.php | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 689a682de3..0c369bea5b 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -5303,3 +5303,22 @@ function phpbb_convert_30_dbms_to_31($dbms) throw new \RuntimeException("You have specified an invalid dbms driver: $dbms"); } + +/** +* Check whether phpBB is installed. +* +* @param string $phpbb_root_path Path to the phpBB board root. +* @param string $php_ext PHP file extension. +* +* @return bool Returns true if phpBB is installed. +*/ +function phpbb_check_installation_exists($phpbb_root_path, $php_ext) +{ + // Try opening config file + if (@file_exists($phpbb_root_path . 'config.' . $php_ext)) + { + include($phpbb_root_path . 'config.' . $php_ext); + } + + return defined('PHPBB_INSTALLED'); +} |