Changeset 11961
- Timestamp:
- 09/01/07 13:44:53 (1 year ago)
- Files:
-
- trunk/midgard/data/midgard_setup_config.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/midgard/data/midgard_setup_config.php
r11723 r11961 9 9 { 10 10 public $midgard_config; 11 public $ midgard_setup_ui;11 public $ui; 12 12 13 function __construct($ui = "cli", midgard_config &$config = NULL)13 function __construct($ui = "cli", $config_name = NULL, midgard_config &$config = NULL) 14 14 { 15 15 switch ($ui) 16 { 17 16 { 18 17 default: 19 18 midgard_setup_log::write(_("Initialize new ").__CLASS__."(cli)"); 20 $this->midgard_setup_ui =& new midgard_setup_cli(); 21 19 $this->ui =& new midgard_setup_cli(); 22 20 } 23 21 22 if($config_name != NULL && $config != NULL) 23 throw $this->ui->exception(_("Can not create setup for named configuration and midgard_config")); 24 25 if($config_name != NULL) 26 { 27 $this->midgard_config = new midgard_config(); 28 if(!$this->midgard_config->read_file($config_name)) 29 throw new $this->ui->exception( 30 _("Can not read configuration ") . "'{$config_name}'"); 31 32 $midgard = new midgard_connection(); 33 if(!$midgard->open($config_name)) 34 throw new $this->ui->exception( 35 _("Can not connect to database with given configuration") . "'{$config_name}'"); 36 } 37 24 38 if($config == NULL) 25 $this->midgard_config = &$this-> midgard_setup_ui->midgard_config;39 $this->midgard_config = &$this->ui->midgard_config; 26 40 else 27 41 $this->midgard_config = &$config;
