[ticket/10813] Installer now checks json extension

Installer now checks json extension and cannot continue without it.
Changes are made in phpBB/install/install_install.php where the
checking for json is added and to phpBB/language/en/install.php where
2 new keys for the messages that would be displayed are also added.

PHPBB3-10813
This commit is contained in:
riadhchtara 2012-04-15 12:36:42 +01:00 committed by Oleg Pudeyev
parent a650da79cb
commit 00172afa53
2 changed files with 23 additions and 1 deletions

View file

@ -128,7 +128,7 @@ class install_install extends module
'BODY' => $lang['REQUIREMENTS_EXPLAIN'], 'BODY' => $lang['REQUIREMENTS_EXPLAIN'],
)); ));
$passed = array('php' => false, 'db' => false, 'files' => false, 'pcre' => false, 'imagesize' => false,); $passed = array('php' => false, 'db' => false, 'files' => false, 'pcre' => false, 'imagesize' => false, 'json' => false,);
// Test for basic PHP settings // Test for basic PHP settings
$template->assign_block_vars('checks', array( $template->assign_block_vars('checks', array(
@ -245,6 +245,26 @@ class install_install extends module
'S_LEGEND' => false, 'S_LEGEND' => false,
)); ));
// Check for php json support
if (@extension_loaded('json'))
{
$passed['json'] = true;
$result = '<strong style="color:green">' . $lang['YES'] . '</strong>';
}
else
{
$result = '<strong style="color:red">' . $lang['NO'] . '</strong>';
}
$template->assign_block_vars('checks', array(
'TITLE' => $lang['PHP_JSON_SUPPORT'],
'TITLE_EXPLAIN' => $lang['PHP_JSON_SUPPORT_EXPLAIN'],
'RESULT' => $result,
'S_EXPLAIN' => true,
'S_LEGEND' => false,
));
/** /**
* Better not enabling and adding to the loaded extensions due to the specific requirements needed * Better not enabling and adding to the loaded extensions due to the specific requirements needed
if (!@extension_loaded('mbstring')) if (!@extension_loaded('mbstring'))

View file

@ -292,6 +292,8 @@ $lang = array_merge($lang, array(
'PCRE_UTF_SUPPORT_EXPLAIN' => 'phpBB will <strong>not</strong> run if your PHP installation is not compiled with UTF-8 support in the PCRE extension.', 'PCRE_UTF_SUPPORT_EXPLAIN' => 'phpBB will <strong>not</strong> run if your PHP installation is not compiled with UTF-8 support in the PCRE extension.',
'PHP_GETIMAGESIZE_SUPPORT' => 'PHP function getimagesize() is available', 'PHP_GETIMAGESIZE_SUPPORT' => 'PHP function getimagesize() is available',
'PHP_GETIMAGESIZE_SUPPORT_EXPLAIN' => '<strong>Required</strong> - In order for phpBB to function correctly, the getimagesize function needs to be available.', 'PHP_GETIMAGESIZE_SUPPORT_EXPLAIN' => '<strong>Required</strong> - In order for phpBB to function correctly, the getimagesize function needs to be available.',
'PHP_JSON_SUPPORT' => 'PHP JSON support',
'PHP_JSON_SUPPORT_EXPLAIN' => '<strong>Required</strong> - In order for phpBB to function correctly, the PHP JSON extension needs to be available.',
'PHP_OPTIONAL_MODULE' => 'Optional modules', 'PHP_OPTIONAL_MODULE' => 'Optional modules',
'PHP_OPTIONAL_MODULE_EXPLAIN' => '<strong>Optional</strong> - These modules or applications are optional. However, if they are available they will enable extra features.', 'PHP_OPTIONAL_MODULE_EXPLAIN' => '<strong>Optional</strong> - These modules or applications are optional. However, if they are available they will enable extra features.',
'PHP_SUPPORTED_DB' => 'Supported databases', 'PHP_SUPPORTED_DB' => 'Supported databases',