Changeset 12143
- Timestamp:
- 09/12/07 09:16:56 (1 year ago)
- Files:
-
- trunk/midgard/data/midgard_datagard.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/midgard/data/midgard_datagard.php
r11963 r12143 13 13 'max' => 1, 14 14 'min' => 1, 15 'desc' => 'The type of installation. Normal or quick ( default )',15 'desc' => 'The type of installation.', 16 16 'default' => 'quick', 17 17 ); 18 $setup_types = array(' normal', 'quick');18 $setup_types = array('wizard', 'quick', 'config'); 19 19 20 20 /* Action to perform. Install, update, install pear packages, etc */ … … 26 26 'default' => 'install', 27 27 ); 28 $setup_actions = array('install', 'update', 'pear', 'vhost', 'dbupdate' );28 $setup_actions = array('install', 'update', 'pear', 'vhost', 'dbupdate', 'config-set'); 29 29 30 30 /* Configuration name , by default we should keep config file named from database name */ … … 33 33 'max' => 1, 34 34 'min' => 0, 35 'desc' => 'Midgard configuration name ( midgard by default ).', 35 'desc' => 'Midgard configuration name.', 36 'default' => "" 37 ); 38 39 /* Set configuration key's value */ 40 $opts_config['config-set'] = array ( 41 'short' => 's', 42 'max' => 2, 43 'min' => 2, 44 'desc' => 'Sets key value for the named configuration.', 36 45 'default' => "" 37 46 ); … … 62 71 switch ($arg_type) { 63 72 64 case ' normal':73 case 'wizard': 65 74 66 midgard_setup_cli::error(" Normaltype not yet implemented");75 midgard_setup_cli::error("Wizard type not yet implemented"); 67 76 68 77 break; 78 79 case 'config': 80 81 /* Be quiet */ 82 83 break; 69 84 70 85 default: … … 89 104 * It should removed once role_midgardelement gets username using midgard_config class 90 105 */ 91 $config = &$setup->midgard_config; 106 //$config = &$setup->midgard_config; 107 $config = new midgard_config(); 108 $config->read_file("midgard"); 92 109 $config->midgardusername = "admin"; 93 110 $config->midgardpassword = "password"; … … 107 124 case 'vhost': 108 125 109 $user_host = midgard_setup_cli::get_text(_("Hostname ?")); 110 $user_port = midgard_setup_cli::get_text(_("Hostname port (80 by default)?")); 111 $user_prefix = ""; 112 if($arg_type == 'normal') 113 $user_prefix = midgard_setup_cli::get_text(_("Hostname prefix ?")); 126 $setup->install_vhost(); 127 128 break; 114 129 115 $setup->set_vhost($user_host, $user_port, $user_prefix); 116 $setup->install_vhost(); 130 case 'config-set': 131 132 if($arg_config == "") 133 midgard_setup_cli::error(_("'config-set' requires configuration")); 134 135 $mc = new midgard_config(); 136 $mc->read_file($arg_config); 137 138 $kv = $args->getValue('config-set'); 139 140 $mc->{$kv[0]} = $kv[1]; 141 $mc->save_file($arg_config); 117 142 118 143 break;
