[CS-Project-svn_notify] SF.net SVN: cs-project: [840] trunk/1.2
Brought to you by:
crazedsanity
From: <cra...@us...> - 2008-02-14 08:23:51
|
Revision: 840 http://cs-project.svn.sourceforge.net/cs-project/?rev=840&view=rev Author: crazedsanity Date: 2008-02-14 00:23:49 -0800 (Thu, 14 Feb 2008) Log Message: ----------- More changes to make setup use config{}... PROBLEMS ENCOUNTERED::: 1.) ALL options show, including previously answered items 2.) Default values displayed instead of logically set ones (like project URL) 3.) user-defined values not stored when returning to step 4 4.) at the end of the run (step #5), system redirects before running tests, since the config already exists... (probably check for a session var in that test, instead of just checkng for the config file). Modified Paths: -------------- trunk/1.2/includes/setup/4.inc trunk/1.2/lib/config.class.php trunk/1.2/lib/site_config.php trunk/1.2/lib/upgradeClass.php Modified: trunk/1.2/includes/setup/4.inc =================================================================== --- trunk/1.2/includes/setup/4.inc 2008-02-14 07:58:02 UTC (rev 839) +++ trunk/1.2/includes/setup/4.inc 2008-02-14 08:23:49 UTC (rev 840) @@ -9,15 +9,15 @@ $defaultValues = array( 'isdevsite' => array(1, 'numeric', 0), 'proj_name' => array(10, 'sql', "CS-Project"), - 'project_url' => array(5, 'sql', $_SERVER['HTTP_HOST']), + 'project_url' => array(5, 'sql', $_SERVER['HTTP_HOST']), 'helpdesk_issue_announce_email' => array(7, 'email', "new...@yo..."), - 'max_time' => array(5, 'sql', "18 hours"), - 'max_idle' => array(5, 'sql', "2 hours"), - 'config_session_name' => array(9, 'alpha', "CS_PROJECT_SESSID"), - 'stop_logins_on_global_alert' => array(1, 'numeric', 1), + 'max_time' => array(5, 'sql', "18 hours"), + 'max_idle' => array(5, 'sql', "2 hours"), + 'config_session_name' => array(9, 'alpha', "CS_PROJECT_SESSID"), + 'stop_logins_on_global_alert' => array(1, 'numeric', 1), 'debugprintopt' => array(1, 'numeric', 0), 'debugremovehr' => array(1, 'numeric', 0), - 'workingonit' => array(1, 'numeric', 0) + 'workingonit' => array(1, 'numeric', 0) ); @@ -60,15 +60,18 @@ } } - foreach($priorSetupData as $index=>$value) { - //check if it's a yes/no type thing. - if(is_numeric($defaultValues[$index])) { - $index .= "__". $value ."__checked"; - $value = "selected"; - } - $page->add_template_var($index, $value); - } + $configObj = new config(); + $configObj->build_update_interface($page); + #foreach($priorSetupData as $index=>$value) { + # //check if it's a yes/no type thing. + # if(is_numeric($defaultValues[$index])) { + # $index .= "__". $value ."__checked"; + # $value = "selected"; + # } + # $page->add_template_var($index, $value); + #} + $page->add_template_var("currentUrl", $_SERVER['HTTP_HOST']); } @@ -93,6 +96,9 @@ $retval = __FUNCTION__ .": ". $index ." failed minimum length check after cleaning"; } } + elseif($index == 'workingonit') { + $goodValues++; + } else { $retval = __FUNCTION__ .": ". $index ." contains invalid data"; } Modified: trunk/1.2/lib/config.class.php =================================================================== --- trunk/1.2/lib/config.class.php 2008-02-14 07:58:02 UTC (rev 839) +++ trunk/1.2/lib/config.class.php 2008-02-14 08:23:49 UTC (rev 840) @@ -113,10 +113,12 @@ $parsedRows = ""; $defaultRowName = 'setting_text'; foreach($systemData as $indexName=>$defaultValue) { - $value = NULL; if(is_array($myData) && isset($myData[$indexName])) { $value = $myData[$indexName]; } + else { + $value = $systemData[$indexName]['value']; + } $attributes = $systemData[$indexName]['attributes']; $indexName = strtolower($indexName); @@ -139,7 +141,10 @@ } if(!isset($page->templateRows[$rowName])) { - throw new exception(__METHOD__ .": failed to retrieve block row named (". $rowName .")"); + $page->set_block_row('content', $rowName); + if(!isset($page->templateRows[$rowName])) { + throw new exception(__METHOD__ .": failed to retrieve block row named (". $rowName .")"); + } } //now parse stuff into the row... Modified: trunk/1.2/lib/site_config.php =================================================================== --- trunk/1.2/lib/site_config.php 2008-02-14 07:58:02 UTC (rev 839) +++ trunk/1.2/lib/site_config.php 2008-02-14 08:23:49 UTC (rev 840) @@ -63,14 +63,14 @@ //########################################################################## -$config = new config(dirname(__FILE__) .'/'. CONFIG_FILENAME, FALSE); -$config->read_config_file(TRUE, TRUE); +$configObj = new config(dirname(__FILE__) .'/'. CONFIG_FILENAME, FALSE); +$configObj->read_config_file(TRUE, TRUE); check_external_lib_versions(); if(!defined("PROJECT__INITIALSETUP") || PROJECT__INITIALSETUP !== TRUE) { - $config = read_config_file(FALSE); + $config = $configObj->read_config_file(FALSE); if(($config['WORKINGONIT'] != "0" && strlen($config['WORKINGONIT'])) || strlen($config['WORKINGONIT']) > 1) { //TODO: consider making this look prettier... @@ -93,7 +93,7 @@ else { $upgrade->check_versions(); } - read_config_file(TRUE); + $configObj->read_config_file(TRUE); } } Modified: trunk/1.2/lib/upgradeClass.php =================================================================== --- trunk/1.2/lib/upgradeClass.php 2008-02-14 07:58:02 UTC (rev 839) +++ trunk/1.2/lib/upgradeClass.php 2008-02-14 08:23:49 UTC (rev 840) @@ -141,7 +141,8 @@ //========================================================================= private function read_config_version() { - $config = read_config_file(FALSE); + $configObj = new config(); + $config = $configObj->read_config_file(FALSE); $this->mainConfig = $config; $retval = NULL; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |