| 153 | | /* FIXME */ |
|---|
| 154 | | if (!function_exists('mgd_open_attachment')) |
|---|
| 155 | | { |
|---|
| 156 | | // Legacy API disabled, use the modern method |
|---|
| 157 | | $handle = MidgardAttachment::open($this->id, $mode); |
|---|
| 158 | | break; |
|---|
| 159 | | } |
|---|
| 160 | | |
|---|
| 161 | | $handle = mgd_open_attachment($this->id, $mode); |
|---|
| | 153 | try |
|---|
| | 154 | { |
|---|
| | 155 | $att_obj = new midgard_attachment($this->id); |
|---|
| | 156 | } |
|---|
| | 157 | catch(midgard_error_exception $e) |
|---|
| | 158 | { |
|---|
| | 159 | /* FIXME, throw error */ |
|---|
| | 160 | } |
|---|
| | 161 | |
|---|
| | 162 | $blob = new midgard_blob($att_obj); |
|---|
| | 163 | |
|---|
| | 164 | if(!$blob) |
|---|
| | 165 | { |
|---|
| | 166 | /* FIXME, throw error */ |
|---|
| | 167 | } |
|---|
| | 168 | |
|---|
| | 169 | $handle = fopen($blob->get_path(), 'r'); |
|---|