[20944] Fix: More on configurable adodb/ pdo database abstraction - fresh install

Sigurd Nes <[email protected]> Sat, 09 Jan 2010 11:56:12 +0000
Newsgroups gmane.comp.web.phpgroupware.cvs
Message-ID <[email protected]>
Revision: 20944
          http://svn.sv.gnu.org/viewvc/?view=rev&root=phpgroupware&revision=20944
Author:   sigurdne
Date:     2010-01-09 11:56:12 +0000 (Sat, 09 Jan 2010)
Log Message:
-----------
Fix: More on configurable adodb/pdo database abstraction - fresh install

Modified Paths:
--------------
    people/sigurdne/modules/setup/trunk/manageheader.php

Modified: people/sigurdne/modules/setup/trunk/manageheader.php
===================================================================
--- people/sigurdne/modules/setup/trunk/manageheader.php	2010-01-09 11:17:13 UTC (rev 20943)
+++ people/sigurdne/modules/setup/trunk/manageheader.php	2010-01-09 11:56:12 UTC (rev 20944)
@@ -17,12 +17,12 @@
 		'currentapp'		=> 'setup',
 		'noapi' 			=> true
 	);
-	
+
 	/**
 	 * Include setup functions
 	 */
 	require_once('./inc/functions.inc.php');
-
+	
 	srand((double)microtime()*1000000);
 	$random_char = array(
 		'0','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f',
@@ -73,7 +73,7 @@
 			{
 				continue;
 			}
-			
+
 			if(!$_POST['settings'][$k]['config_pass'])
 			{
 				$errors .= '<br>' . lang("You didn't enter a config password for domain %1",$v);
@@ -113,7 +113,7 @@
 	$setup_tpl->set_block('T_login_stage_header','B_single_domain','V_single_domain');
 	$setup_tpl->set_block('T_setup_manage','manageheader','manageheader');
 	$setup_tpl->set_block('T_setup_manage','domain','domain');
-	
+
 	$setup_tpl->set_var('HeaderLoginWarning', lang('Warning: All your passwords (database, phpGroupWare admin,...)<br> will be shown in plain text after you log in for header administration.'));
 	$setup_tpl->set_var('lang_cookies_must_be_enabled', lang('<b>NOTE:</b> You must have cookies enabled to use setup and header admin!') );
 
@@ -156,7 +156,7 @@
 	$action = phpgw::get_var('action', 'string', 'POST');
 	if ( is_array($action) )
 	{
-		$action_keys = array_keys($action); 
+		$action_keys = array_keys($action);
 		$action = array_shift($action_keys);
 	}
 	switch($action)
@@ -243,7 +243,7 @@
 					. '</p></b><td></tr></table></body></html>';
 				die($detected);
 			}
-			
+
 			$phpver = '<li>' . lang('You appear to be using PHP %1+', 5.2) . "</li>\n";
 			$supported_sessions_type = array('php', 'db');
 
@@ -336,13 +336,13 @@
 				$lang_fix = lang('Try to configure your php to support one of the above mentioned DBMS, or install phpGroupWare by hand.');
 				$detected .= <<<HTML
 							<li class="err">$lang_nodb</li>
-							</ul>
+						</ul>
 						<h2>$lang_fix</h2>
-						</b>
+					</b>
 				<td>
-				</tr>
-			</table>
-		</body>
+			</tr>
+		</table>
+	</body>
 </html>
 
 HTML;
@@ -385,7 +385,7 @@
 			else
 			{
 				$detected .= '<li class="warn">' . lang('No mcrypt support found.') . "</li>\n";
-			}
+			}		
 			if( extension_loaded('xsl') && class_exists('XSLTProcessor') )
 			{
 				$detected .= '<li>' . lang('You appear to have XML/XSLT support enabled') . "</li>\n";
@@ -409,9 +409,9 @@
 				die($detected);
 
 			}
-			
+
 			$no_guess = false;
-			if ( is_file('../header.inc.php') 
+			if ( is_file('../header.inc.php')
 				&& is_readable('../header.inc.php'))
 			{
 				$detected .= '<li>' . lang('Found existing configuration file. Loading settings from the file...') . "</li>\n";
@@ -446,7 +446,7 @@
 					{
 						$GLOBALS['phpgw_domain'] = array();
 					}
-					
+
 					foreach($GLOBALS['phpgw_domain'] as $key => $val)
 					{
 						$setup_tpl->set_var('lang_domain',lang('Domain'));
@@ -511,7 +511,7 @@
 				if (defined('PHPGW_SERVER_ROOT'))
 				{
 					$GLOBALS['phpgw_info']['server']['server_root'] = PHPGW_SERVER_ROOT;
-					$GLOBALS['phpgw_info']['server']['include_root'] = PHPGW_INCLUDE_ROOT; 
+					$GLOBALS['phpgw_info']['server']['include_root'] = PHPGW_INCLUDE_ROOT;
 				}
 				else if ( !isset($GLOBALS['phpgw_info']['server']['include_root']) && $GLOBALS['phpgw_info']['server']['header_version'] <= 1.6)
 				{
@@ -535,6 +535,7 @@
 				$setup_tpl->set_var('db_user','phpgroupware');
 				$setup_tpl->set_var('db_pass','your_password');
 				$setup_tpl->set_var('db_type', $supported_db[0]);
+				$setup_tpl->set_var('db_abstraction', $supported_db_abstraction[0]);
 				$setup_tpl->set_var('config_pass','changeme');
 
 				$dbtype_options = '';
@@ -547,6 +548,17 @@
 				}
 				$setup_tpl->set_var('dbtype_options', $dbtype_options);
 
+				$db_abstraction_options = '';
+				foreach ( $supported_db_abstraction as $db_abstraction )
+				{
+					$db_abstraction_options .= <<<HTML
+						<option value="{$db_abstraction}">{$db_abstraction}</option>
+
+HTML;
+				}
+				$setup_tpl->set_var('db_abstraction_options', $db_abstraction_options);
+
+
 				$setup_tpl->parse('domains','domain',True);
 				$setup_tpl->set_var('domain','');
 
@@ -562,14 +574,14 @@
 
 			}
 
-			// now guessing better settings then the default ones 
+			// now guessing better settings then the default ones
 			if(!$no_guess)
 			{
 				$detected .= '<li>' . lang('Now guessing better values for defaults...') . "</li>\n";
 				$this_dir = dirname($_SERVER['SCRIPT_FILENAME']);
 				$updir    = realpath('../'); //str_replace('/setup','',$this_dir);
-				$GLOBALS['phpgw_info']['server']['server_root'] = $updir; 
-				$GLOBALS['phpgw_info']['server']['include_root'] = $updir; 
+				$GLOBALS['phpgw_info']['server']['server_root'] = $updir;
+				$GLOBALS['phpgw_info']['server']['include_root'] = $updir;
 			}
 
 			$detected .= "</ul>\n";