Changeset 17747

Show
Ignore:
Timestamp:
09/29/08 09:22:22 (2 months ago)
Author:
piotras
Message:

Do not get file handle with legacy MidgardAttachment?. Use midgard_blob instead.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/midcom/midcom.core/midcom/baseclasses/database/attachment.php

    r15677 r17747  
    125125                $mode = 'default'; 
    126126                $this->_open_write_mode = true; 
    127                  
    128                 if (!function_exists('mgd_open_attachment')) 
     127                
     128                try  
    129129                { 
    130                     // Legacy API disabled, use the modern method 
    131                     $handle = MidgardAttachment::open($this->id); 
    132                     break; 
     130                    $att_obj = new midgard_attachment($this->id); 
     131                } 
     132                catch(midgard_error_exception $e)  
     133                { 
     134                    /* FIXME, throw error */ 
    133135                } 
    134136                 
    135                 $handle = mgd_open_attachment($this->id); 
     137                $blob = new midgard_blob($att_obj); 
     138 
     139                if(!$blob) 
     140                { 
     141                    /* FIXME, throw error */ 
     142                } 
     143 
     144                $handle = $blob->get_handler(); 
    136145                break; 
    137146 
     
    140149                $this->_open_write_mode = ($mode{0} != 'r'); 
    141150 
     151                /* WARNING, read mode not supported by midgard_blob! */ 
     152                /* FIXME */ 
    142153                if (!function_exists('mgd_open_attachment')) 
    143154                {