includes/functions.php
changeset 1183 15957df91ea4
parent 1167 3c73e1b6d33f
child 1198 3ec9ac297045
--- a/includes/functions.php	Fri Dec 18 21:11:42 2009 -0500
+++ b/includes/functions.php	Fri Dec 18 21:21:59 2009 -0500
@@ -5282,3 +5282,27 @@
   }
 }
 
+/**
+ * Get the appropriate crypto backend for this server
+ * @return string
+ */
+
+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;
+}
+