Changeset 11746

Show
Ignore:
Timestamp:
08/27/07 17:44:11 (1 year ago)
Author:
piotras
Message:

Added midgard_setup_log::write calls.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/midgard/data/midgard_setup_pear.php

    r11745 r11746  
    1616require_once 'midgard_setup_globals.php'; 
    1717require_once 'midgard_setup_ui_cli_config.php'; 
     18require_once 'midgard_setup_log.php'; 
    1819 
    1920class midgard_setup_pear { 
     
    4344    public function __construct() 
    4445    { 
     46        midgard_setup_log::write(_("Initialize new ").__CLASS__); 
     47 
    4548        $this->midcom_channel = "pear.midcom-project.org"; 
    4649        $this->midcom_channel_alias = "midcom"; 
     
    8184                );     
    8285         
    83         //$this->pear_config = new PEAR_Config(); 
    8486        $this->pear_config = PEAR_Config::singleton(); 
     87        if(PEAR::IsError($this->pear_config)) 
     88        { 
     89            $msg = "Failed to initialize PEAR_Config::singleton"; 
     90            midgard_setup_log::write_exception($msg); 
     91            throw new Exception($msg, 0); 
     92        } 
    8593          
    8694        $this->initial_php_dir = $this->pear_config->get('php_dir');     
     
    97105 
    98106        $this->pear_ui = new PEAR_Frontend_CLI();  
     107        if(PEAR::IsError($this->pear_ui)) 
     108        { 
     109            $msg = "Failed to initialize PEAR_Frontend_CLI"; 
     110            midgard_setup_log::write_exception($msg); 
     111            throw new Exception($msg, 0); 
     112        } 
    99113 
    100114        $this->pear_channel =  
    101115            new PEAR_Command_Channels(&$this->pear_ui, &$this->pear_config); 
    102116          
     117        if(PEAR::IsError($this->pear_channel)) 
     118        { 
     119            $msg = "Failed to initialize PEAR_Command_Channels"; 
     120            midgard_setup_log::write_exception($msg); 
     121            throw new Exception($msg, 0);           
     122        } 
     123 
    103124        $this->pear_installer = new PEAR_Installer(&$this->pear_ui, $this->pear_ui); 
     125        if(PEAR::IsError($this->pear_installer)) 
     126        { 
     127            $msg = "Failed to initialize PEAR_Installer"; 
     128            midgard_setup_log::write_exception($msg); 
     129            throw new Exception($msg, 0);                      
     130        } 
    104131                 
    105132        $this->pear_downloader = new PEAR_Downloader(&$this->pear_ui,  
    106133            array('force' => 'yes'), &$this->pear_config); 
     134        if(PEAR::IsError($this->pear_downloader)) 
     135        { 
     136            $msg = "Failed to initialize PEAR_Downloader"; 
     137            midgard_setup_log::write_exception($msg); 
     138            throw new Exception($msg, 0);                      
     139        } 
    107140 
    108141        $this->pear_registry = new PEAR_Registry(); 
    109          
    110         /* TODO */ 
    111         /* throw Exception when one of object can not be created */  
     142        if(PEAR::IsError($this->pear_registry)) 
     143        { 
     144            $msg = "Failed to initialize PEAR_registry"; 
     145            midgard_setup_log::write_exception($msg); 
     146            throw new Exception($msg, 0);                      
     147        }         
    112148    } 
    113149 
     
    140176    final public function install_midcom_roles() 
    141177    {  
     178        midgard_setup_log::write(_("Installing MidCOM roles")); 
     179         
    142180        /* Install or upgrade Role_Web */ 
    143181        $this->install_pearified_base_package("Role_Web"); 
     
    184222 
    185223    final public function install_base_packages() 
    186     {         
     224    {       
     225        midgard_setup_log::write(_("Installing base packages")); 
     226 
    187227        foreach($this->initial_midgard_packages as $name)  
    188228        { 
     
    228268    final public function install_midcom_package($name, $force = FALSE) 
    229269    { 
     270        midgard_setup_log::write(_("Installing MidCOM package").$name); 
     271 
    230272        $pkg_name = $this->midcom_channel_alias . "/" . $name; 
    231273 
     
    309351    final public function set_channels() 
    310352    { 
    311          
     353        midgard_setup_log::write(_("Setting MidCOM channels")); 
     354 
    312355        /* update pear.php.net */ 
    313356        $ret = $this->pear_channel->doUpdate('channel-update',  
     
    343386    final public function update_channels() 
    344387    { 
     388        midgard_setup_log::write(_("Updating MidCOM channels")); 
     389 
    345390        /* update midcom channel */ 
    346391        $ret = $this->pear_channel->doUpdate('channel-update',