# HG changeset patch
# User Dan
# Date 1259645704 18000
# Node ID fcb2be1428e76115f0b1f455c7652e2517731119
# Parent e271ae801c62cd411785411855eff84e96da44ed
Installer sysreqs: Merged all the crypto extensions into one check; altered warnings. Strings are hopefully cleaned up.
diff -r e271ae801c62 -r fcb2be1428e7 ajax.php
diff -r e271ae801c62 -r fcb2be1428e7 install/includes/cli-core.php
--- a/install/includes/cli-core.php Tue Dec 01 00:27:26 2009 -0500
+++ b/install/includes/cli-core.php Tue Dec 01 00:35:04 2009 -0500
@@ -29,6 +29,8 @@
exit;
}
+require_once( ENANO_ROOT . '/install/includes/libenanoinstall.php' );
+
if ( defined('ENANO_INSTALLED') )
{
// start up the API to let it error out if something's wrong
@@ -108,7 +110,7 @@
case '--url-scheme':
case '-r':
$urlscheme_temp = @$argv[++$i];
- if ( in_array($urlscheme_temp, array('standard', 'short', 'rewrite')) )
+ if ( in_array($urlscheme_temp, array('standard', 'short', 'rewrite', 'tiny')) )
$urlscheme = $urlscheme_temp;
break;
case '--language':
@@ -441,6 +443,27 @@
$failed = true;
}
+// Test: crypto
+$crypto_backend = install_get_crypto_backend();
+if ( !$silent )
+{
+ echo ' ' . $lang->get('sysreqs_req_crypto') . ': ';
+ switch($crypto_backend)
+ {
+ case 'bcmath':
+ echo parse_shellcolor_string($lang->get('cli_test_warn') . " [" . $lang->get("sysreqs_req_{$crypto_backend}") . "]") . "\n";
+ $warnings[] = $lang->get('sysreqs_req_help_crypto_bcmath');
+ break;
+ case 'none':
+ echo parse_shellcolor_string($lang->get('cli_test_warn') . " [" . $lang->get("sysreqs_req_notfound") . "]") . "\n";
+ $warnings[] = $lang->get('sysreqs_req_help_crypto_none');
+ break;
+ default:
+ echo parse_shellcolor_string($lang->get('cli_test_pass') . " [" . $lang->get("sysreqs_req_{$crypto_backend}") . "]") . "\n";
+ break;
+ }
+}
+
// Write tests
$req_config_w = write_test('config.new.php');
$req_htaccess_w = write_test('.htaccess.new');
@@ -472,27 +495,6 @@
if ( !$silent ) echo ' ' . $lang->get('sysreqs_req_imagemagick') . ': ' . parse_shellcolor_string($lang->get($req_imagick ? 'cli_test_pass' : 'cli_test_warn')) . "\n";
-// Extension test: GMP
-$req_gmp = function_exists('gmp_init');
-if ( !$req_gmp )
- $warnings[] = $lang->get('sysreqs_req_help_gmp');
-
-if ( !$silent ) echo ' ' . $lang->get('sysreqs_req_gmp') . ': ' . parse_shellcolor_string($lang->get($req_gmp ? 'cli_test_pass' : 'cli_test_warn')) . "\n";
-
-// Extension test: Big_Int
-$req_bigint = function_exists('bi_from_str');
-if ( !$req_bigint && !$req_gmp )
- $warnings[] = $lang->get('sysreqs_req_help_bigint');
-
-if ( !$silent ) echo ' ' . $lang->get('sysreqs_req_bigint') . ': ' . parse_shellcolor_string($lang->get($req_bigint ? 'cli_test_pass' : 'cli_test_warn')) . "\n";
-
-// Extension test: BCMath
-$req_bcmath = function_exists('bcadd');
-if ( !$req_bcmath && !$req_bigint && !$req_gmp )
- $warnings[] = $lang->get('sysreqs_req_help_bcmath');
-
-if ( !$silent ) echo ' ' . $lang->get('sysreqs_req_bcmath') . ': ' . parse_shellcolor_string($lang->get($req_bcmath ? 'cli_test_pass' : 'cli_test_warn')) . "\n";
-
if ( !empty($warnings) && !$silent )
{
echo parse_shellcolor_string($lang->get('cli_msg_test_warnings')) . "\n";
diff -r e271ae801c62 -r fcb2be1428e7 install/includes/libenanoinstall.php
--- a/install/includes/libenanoinstall.php Tue Dec 01 00:27:26 2009 -0500
+++ b/install/includes/libenanoinstall.php Tue Dec 01 00:35:04 2009 -0500
@@ -116,6 +116,25 @@
exit;
}
+function install_get_crypto_backend()
+{
+ $crypto_backend = 'none';
+
+ // Extension test: BCMath
+ if ( function_exists('bcadd') )
+ $crypto_backend = 'bcmath';
+
+ // Extension test: Big_Int
+ if ( function_exists('bi_from_str') )
+ $crypto_backend = 'bigint';
+
+ // Extension test: GMP
+ if ( function_exists('gmp_init') )
+ $crypto_backend = 'gmp';
+
+ return $crypto_backend;
+}
+
function enano_perform_upgrade($target_branch)
{
global $db, $session, $paths, $template, $plugins; // Common objects
diff -r e271ae801c62 -r fcb2be1428e7 install/includes/stages/sysreqs.php
--- a/install/includes/stages/sysreqs.php Tue Dec 01 00:27:26 2009 -0500
+++ b/install/includes/stages/sysreqs.php Tue Dec 01 00:35:04 2009 -0500
@@ -16,6 +16,8 @@
if ( !defined('IN_ENANO_INSTALL') )
die();
+require_once(ENANO_ROOT . '/install/includes/libenanoinstall.php');
+
global $failed, $warned;
$failed = false;
@@ -127,20 +129,12 @@
if ( !$req_imagick )
$warnings[] = $lang->get('sysreqs_req_help_imagemagick');
-// Extension test: GMP
-$req_gmp = function_exists('gmp_init');
-if ( !$req_gmp )
- $warnings[] = $lang->get('sysreqs_req_help_gmp');
+$crypto_backend = install_get_crypto_backend();
-// Extension test: Big_Int
-$req_bigint = function_exists('bi_from_str');
-if ( !$req_bigint && !$req_gmp )
- $warnings[] = $lang->get('sysreqs_req_help_bigint');
-
-// Extension test: BCMath
-$req_bcmath = function_exists('bcadd');
-if ( !$req_bcmath && !$req_bigint && !$req_gmp )
- $warnings[] = $lang->get('sysreqs_req_help_bcmath');
+if ( $crypto_backend == 'none' )
+ $warnings[] = $lang->get('sysreqs_req_help_crypto_none');
+else if ( $crypto_backend == 'bcmath' )
+ $warnings[] = $lang->get('sysreqs_req_help_crypto_bcmath');
?>
@@ -265,6 +259,24 @@
+
+ get('sysreqs_req_crypto'); ?>
+ |
+ ' . $lang->get("sysreqs_req_{$crypto_backend}") . '';
+ }
+ else
+ {
+ echo '' . $lang->get("sysreqs_req_notfound") . ' | ';
+ }
+ ?>
+
+
+
+
+
get('sysreqs_heading_dbms'); ?> |
@@ -379,52 +391,6 @@
?>
-
- get('sysreqs_heading_crypto'); ?> |
-
-
-
-
- get('sysreqs_req_gmp'); ?>
- get('sysreqs_req_hint_gmp'); ?>
- |
- ' . $lang->get('sysreqs_req_supported') . '';
- else:
- echo '' . $lang->get('sysreqs_req_notfound') . ' | ';
- endif;
- ?>
-
-
-
-
- get('sysreqs_req_bigint'); ?>
- get('sysreqs_req_hint_bigint'); ?>
- |
- ' . $lang->get('sysreqs_req_supported') . '';
- else:
- echo '' . $lang->get('sysreqs_req_notfound') . ' | ';
- endif;
- ?>
-
-
-
-
- get('sysreqs_req_bcmath'); ?>
- get('sysreqs_req_hint_bcmath'); ?>
- |
- ' . $lang->get('sysreqs_req_supported') . '';
- else:
- echo '' . $lang->get('sysreqs_req_notfound') . ' | ';
- endif;
- ?>
-
-