[ticket/12160] Add function to check if phpBB is installed.

PHPBB3-12160
This commit is contained in:
Cesar G 2014-02-15 17:09:13 -08:00
parent ccf12ba166
commit d002d31b86

View file

@ -5303,3 +5303,22 @@ function phpbb_convert_30_dbms_to_31($dbms)
throw new \RuntimeException("You have specified an invalid dbms driver: $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');
}